WO2021174696A1 - Data updating method and apparatus, computer device, and storage medium - Google Patents

Data updating method and apparatus, computer device, and storage medium Download PDF

Info

Publication number
WO2021174696A1
WO2021174696A1 PCT/CN2020/093327 CN2020093327W WO2021174696A1 WO 2021174696 A1 WO2021174696 A1 WO 2021174696A1 CN 2020093327 W CN2020093327 W CN 2020093327W WO 2021174696 A1 WO2021174696 A1 WO 2021174696A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
batch
index data
index
indicator
Prior art date
Application number
PCT/CN2020/093327
Other languages
French (fr)
Chinese (zh)
Inventor
周亮
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021174696A1 publication Critical patent/WO2021174696A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

Provided are a data updating method and apparatus, a computer device, and a storage medium, relating to the technical field of big data. The method comprises: acquiring unique data records and write-in times thereof from a configuration table in a front-end database; parsing a synchronous data time range in a data reading instruction, performing traversing and querying to obtain the write-in times that match the synchronous data time range and the unique data records associated with the various matched write-in times, and marking, as data identifiers to be subjected to reading, the unique data records associated with the various write-in times that match the synchronous data time range; querying an interface table for the index data corresponding to each of said data identifiers, determining, according to a segmentation symbol, batches to be subjected to reading, to which the index data corresponding to said data identifiers belongs, and recording all the index data of said batches as newly-added batch index data; and updating the newly-added batch index data of all the batches and storing same in a target data table of a back-end database. Accordingly, the operation performance of a back-end server can be improved.

Description

数据更新方法、装置、计算机设备及存储介质Data update method, device, computer equipment and storage medium
本申请要求于2020年3月6日提交中国专利局、申请号为202010152296.4,名称为“数据更新方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on March 6, 2020, with the application number 202010152296.4, titled "data update method, device, computer equipment and storage medium", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及大数据技术领域的数据更新领域,尤其涉及一种数据更新方法、装置、计算机设备及存储介质。This application relates to the field of data update in the field of big data technology, and in particular to a data update method, device, computer equipment, and storage medium.
背景技术Background technique
目前在数据库的数据处理场景中,前端需要把指标数据写入在一个接口表中,以供后端获取并且存储指标数据。为了保证后端数据的完整性,需要获取接口表中的所有指标数据。目前存在一种方法,其按照时间分区往后端所在数据库中同步指标数据,发明人意识到此方法容易导致部分指标数据的时间跨度较大,产生数据更新不全的问题。另有一种方法则是按照指标进行同步的方法,但发明人意识到此方法在存在多个指标的时候,就需要在后端设置多个对应的程序,随着指标不断增长,后端需同步的程序会越来越多,因此会造成难以开发和难以维护的问题。且发明人发现上述两种方法后端每次都是进行整个接口表同步,会导致后端所在的数据库积累太多无用的数据,会影响到后端服务器的运行性能,增加后端服务器运行任务的运行时间。因此,本领域技术人员亟需寻找一种技术方案解决上述提到的技术问题。At present, in the data processing scenario of the database, the front end needs to write the indicator data in an interface table for the back end to obtain and store the indicator data. In order to ensure the integrity of the back-end data, it is necessary to obtain all the indicator data in the interface table. At present, there is a method that synchronizes index data in the database where the back-end is located according to time partition. The inventor realizes that this method may easily lead to a large time span of part of the index data and cause the problem of incomplete data update. Another method is to synchronize according to the indicators, but the inventor realized that this method requires multiple corresponding programs on the back end when there are multiple indicators. As the indicators continue to grow, the back end needs to be synchronized. There will be more and more programs, which will cause problems that are difficult to develop and maintain. Moreover, the inventor found that the back-end of the above two methods synchronizes the entire interface table each time, which will cause the database where the back-end is located to accumulate too much useless data, which will affect the performance of the back-end server and increase the running tasks of the back-end server. Running time. Therefore, those skilled in the art urgently need to find a technical solution to solve the above-mentioned technical problems.
申请内容Application content
基于此,有必要针对上述技术问题,提供一种数据更新方法、装置、计算机设备及存储介质,用于提高后端服务器的运行性能,减少后端服务器运行任务的运行时间。Based on this, it is necessary to provide a data update method, device, computer equipment, and storage medium for the above technical problems to improve the running performance of the back-end server and reduce the running time of the running task of the back-end server.
一种数据更新方法,包括:A data update method includes:
在接收到读数指令时,后端服务器获取前端服务器的前端数据库中配置表所有唯一数据记录,以及与所述唯一数据记录关联的写入时间;其中,所述唯一数据记录是指在所述前端数据库的接口表中分批次写入的指标数据,同时在所述配置表中为该批次的所述指标数据中的第一个所述指标数据更新配置的唯一标识,且所述唯一数据记录与该批次的所述指标数据写入所述接口表的所述写入时间关联存储在所述配置表中;每一批次的所述指标数据中包含至少一个指标数据,所述接口表中以分割符号分割各个批次的所述指标数据;When receiving the reading instruction, the back-end server obtains all unique data records of the configuration table in the front-end database of the front-end server, and the writing time associated with the unique data record; wherein, the unique data record refers to the The index data written in batches in the interface table of the database, and at the same time the unique identifier of the configuration is updated in the configuration table for the first index data in the batch of the index data, and the unique data The record is stored in the configuration table in association with the write time when the indicator data of the batch is written into the interface table; the indicator data of each batch includes at least one indicator data, and the interface In the table, the index data of each batch is divided by dividing symbols;
所述后端服务器解析所述读数指令中的同步数据时间范围,从所述配置表中获取的所有所述写入时间和所述唯一数据记录中,遍历查询与所述同步数据时间范围匹配的所述写入时间,以及与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录,将与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录标记为待读取数据标识;The back-end server parses the synchronization data time range in the reading instruction, and traverses queries that match the synchronization data time range among all the write times and the unique data records obtained from the configuration table The writing time and the unique data record associated with each writing time matching the synchronization data time range, and marking the unique data record associated with each writing time matching the synchronization data time range Identifies the data to be read;
所述后端服务器在所述接口表中查询与各所述待读取数据标识对应的指标数据,根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,并将所述待读取批次的所有指标数据记录为新增批次指标数据;The back-end server queries the interface table for index data corresponding to each of the data identifiers to be read, and determines, according to the segmentation symbol in the interface table, that the index data corresponding to the data identifier to be read belongs to Batches to be read, and record all index data of the batches to be read as new batch index data;
所述后端服务器自接口表中获取所有批次的新增批次指标数据之后,将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,同时在所述配置表中删除与所有所述待读取批次的指标数据中的第一个指标数据对应的所述 唯一数据记录以及与其关联存储的所述写入时间。After the back-end server obtains the newly added batch index data of all batches from the interface table, it updates the newly-added batch index data of all the read batches to the back-end database stored in the back-end server. In the target data table, the unique data record corresponding to the first index data in the index data of all the batches to be read and the write time stored in association therewith are deleted from the configuration table at the same time.
一种数据更新装置,包括:A data update device includes:
获取模块,用于在接收到读数指令时,后端服务器获取前端服务器的前端数据库中配置表所有唯一数据记录,以及与所述唯一数据记录关联的写入时间;其中,所述唯一数据记录是指在所述前端数据库的接口表中分批次写入的指标数据,同时在所述配置表中为该批次的所述指标数据中的第一个所述指标数据更新配置的唯一标识,且所述唯一数据记录与该批次的所述指标数据写入所述接口表的所述写入时间关联存储在所述配置表中;每一批次的所述指标数据中包含至少一个指标数据,所述接口表中以分割符号分割各个批次的所述指标数据;The obtaining module is used to obtain all the unique data records of the configuration table in the front-end database of the front-end server and the writing time associated with the unique data record when the back-end server receives the reading instruction; wherein, the unique data record is Refers to the indicator data written in batches in the interface table of the front-end database, and at the same time update the configuration unique identifier for the first indicator data in the batch of the indicator data in the configuration table, And the unique data record is stored in the configuration table in association with the write time when the indicator data of the batch is written into the interface table; the indicator data of each batch includes at least one indicator Data, the index data of each batch is divided by a division symbol in the interface table;
第一标记模块,用于所述后端服务器解析所述读数指令中的同步数据时间范围,从所述配置表中获取的所有所述写入时间和所述唯一数据记录中,遍历查询与所述同步数据时间范围匹配的所述写入时间,以及与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录,将与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录标记为待读取数据标识;The first marking module is used for the back-end server to parse the synchronization data time range in the reading instruction, to traverse the query and all the writing times and the unique data records obtained from the configuration table. The write time that matches the synchronization data time range, and the unique data record associated with each write time that matches the synchronization data time range, and each write time that matches the synchronization data time range The unique data record mark associated with time is the data identification to be read;
记录模块,用于所述后端服务器在所述接口表中查询与各所述待读取数据标识对应的指标数据,根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,并将所述待读取批次的所有指标数据记录为新增批次指标数据;The recording module is used for the back-end server to query the index data corresponding to each of the data identifiers to be read in the interface table, and determine the data identifiers to be read according to the segmentation symbol in the interface table The batch to be read to which the corresponding index data belongs, and all the index data of the batch to be read are recorded as the new batch index data;
存储模块,用于所述后端服务器自接口表中获取所有批次的新增批次指标数据之后,将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,同时在所述配置表中删除与所有所述待读取批次的指标数据中的第一个指标数据对应的所述唯一数据记录以及与其关联存储的所述写入时间。The storage module is configured to update and store the new batch index data of all read batches after the back-end server obtains the new batch index data of all batches from the interface table In the target data table of the back-end database, delete the unique data record corresponding to the first index data in all the index data of the batch to be read and all the data stored in association therewith in the configuration table. The writing time.
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device includes a memory, a processor, and computer-readable instructions that are stored in the memory and can run on the processor, and the processor implements the following steps when the processor executes the computer-readable instructions:
在接收到读数指令时,后端服务器获取前端服务器的前端数据库中配置表所有唯一数据记录,以及与所述唯一数据记录关联的写入时间;其中,所述唯一数据记录是指在所述前端数据库的接口表中分批次写入的指标数据,同时在所述配置表中为该批次的所述指标数据中的第一个所述指标数据更新配置的唯一标识,且所述唯一数据记录与该批次的所述指标数据写入所述接口表的所述写入时间关联存储在所述配置表中;每一批次的所述指标数据中包含至少一个指标数据,所述接口表中以分割符号分割各个批次的所述指标数据;When receiving the reading instruction, the back-end server obtains all unique data records of the configuration table in the front-end database of the front-end server, and the writing time associated with the unique data record; wherein, the unique data record refers to the The index data written in batches in the interface table of the database, and at the same time the unique identifier of the configuration is updated in the configuration table for the first index data in the batch of the index data, and the unique data The record is stored in the configuration table in association with the write time when the indicator data of the batch is written into the interface table; the indicator data of each batch includes at least one indicator data, and the interface In the table, the index data of each batch is divided by dividing symbols;
所述后端服务器解析所述读数指令中的同步数据时间范围,从所述配置表中获取的所有所述写入时间和所述唯一数据记录中,遍历查询与所述同步数据时间范围匹配的所述写入时间,以及与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录,将与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录标记为待读取数据标识;The back-end server parses the synchronization data time range in the reading instruction, and traverses queries that match the synchronization data time range among all the write times and the unique data records obtained from the configuration table The writing time and the unique data record associated with each writing time matching the synchronization data time range, and marking the unique data record associated with each writing time matching the synchronization data time range Identifies the data to be read;
所述后端服务器在所述接口表中查询与各所述待读取数据标识对应的指标数据,根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,并将所述待读取批次的所有指标数据记录为新增批次指标数据;The back-end server queries the interface table for index data corresponding to each of the data identifiers to be read, and determines, according to the segmentation symbol in the interface table, that the index data corresponding to the data identifier to be read belongs to Batches to be read, and record all index data of the batches to be read as new batch index data;
所述后端服务器自接口表中获取所有批次的新增批次指标数据之后,将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,同时在所述配置表中删除与所有所述待读取批次的指标数据中的第一个指标数据对应的所述唯一数据记录以及与其关联存储的所述写入时间。After the back-end server obtains the newly added batch index data of all batches from the interface table, it updates the newly-added batch index data of all the read batches to the back-end database stored in the back-end server. In the target data table, the unique data record corresponding to the first index data in the index data of all the batches to be read and the write time stored in association therewith are deleted from the configuration table at the same time.
一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more readable storage media storing computer readable instructions, when the computer readable instructions are executed by one or more processors, the one or more processors execute the following steps:
在接收到读数指令时,后端服务器获取前端服务器的前端数据库中配置表所有唯一数据记录,以及与所述唯一数据记录关联的写入时间;其中,所述唯一数据记录是指在所述 前端数据库的接口表中分批次写入的指标数据,同时在所述配置表中为该批次的所述指标数据中的第一个所述指标数据更新配置的唯一标识,且所述唯一数据记录与该批次的所述指标数据写入所述接口表的所述写入时间关联存储在所述配置表中;每一批次的所述指标数据中包含至少一个指标数据,所述接口表中以分割符号分割各个批次的所述指标数据;When receiving the reading instruction, the back-end server obtains all unique data records of the configuration table in the front-end database of the front-end server, and the writing time associated with the unique data record; wherein, the unique data record refers to the The index data written in batches in the interface table of the database, and at the same time the unique identifier of the configuration is updated in the configuration table for the first index data in the batch of the index data, and the unique data The record is stored in the configuration table in association with the write time when the indicator data of the batch is written into the interface table; the indicator data of each batch includes at least one indicator data, and the interface In the table, the index data of each batch is divided by dividing symbols;
所述后端服务器解析所述读数指令中的同步数据时间范围,从所述配置表中获取的所有所述写入时间和所述唯一数据记录中,遍历查询与所述同步数据时间范围匹配的所述写入时间,以及与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录,将与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录标记为待读取数据标识;The back-end server parses the synchronization data time range in the reading instruction, and traverses queries that match the synchronization data time range among all the write times and the unique data records obtained from the configuration table The writing time and the unique data record associated with each writing time matching the synchronization data time range, and marking the unique data record associated with each writing time matching the synchronization data time range Identifies the data to be read;
所述后端服务器在所述接口表中查询与各所述待读取数据标识对应的指标数据,根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,并将所述待读取批次的所有指标数据记录为新增批次指标数据;The back-end server queries the interface table for index data corresponding to each of the data identifiers to be read, and determines, according to the segmentation symbol in the interface table, that the index data corresponding to the data identifier to be read belongs to Batches to be read, and record all index data of the batches to be read as new batch index data;
所述后端服务器自接口表中获取所有批次的新增批次指标数据之后,将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,同时在所述配置表中删除与所有所述待读取批次的指标数据中的第一个指标数据对应的所述唯一数据记录以及与其关联存储的所述写入时间。After the back-end server obtains the newly added batch index data of all batches from the interface table, it updates the newly-added batch index data of all the read batches to the back-end database stored in the back-end server. In the target data table, the unique data record corresponding to the first index data in the index data of all the batches to be read and the write time stored in association therewith are deleted from the configuration table at the same time.
上述数据更新方法、装置、计算机设备及存储介质,通过在数据库的接口表中不断验证接口表的各个批次的指标数据是否为新增批次指标数据,并将符合条件(包括各个批次指标数据对应的写入时间要落入至同步数据时间范围内)的新增批次指标数据更新存储至后端数据库所在的目标数据表中,起到一种增量更新的目的,目标数据表中的数据将会更符合后端数据库的使用,目标数据表所在的后端数据库将不会积累太多无用的数据(已同步至目标数据表中的各个历史的批次的指标数据,若再同步,将会造成目标数据表出现重复的各个批次的指标数据),后端数据库的运行性能不会大幅度受到影响,也即后端数据库对应的后端服务器也不会受到影响,因此通过本申请可提高后端服务器的运行性能,减少后端服务器运行任务的运行时间。本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。The above-mentioned data update method, device, computer equipment and storage medium continuously verify whether the index data of each batch of the interface table is the new batch index data in the interface table of the database, and will meet the conditions (including each batch index The write time corresponding to the data should fall within the synchronization data time range). The new batch indicator data is updated and stored in the target data table where the back-end database is located, for the purpose of incremental update, in the target data table The data will be more in line with the use of the back-end database, and the back-end database where the target data table is located will not accumulate too much useless data (the indicator data of each historical batch that has been synchronized to the target data table, if you re-synchronize , It will cause repeated batches of indicator data in the target data table), the operating performance of the back-end database will not be greatly affected, that is, the back-end server corresponding to the back-end database will not be affected, so through this Applying can improve the running performance of the back-end server and reduce the running time of the running tasks of the back-end server. The details of one or more embodiments of the present application are presented in the following drawings and description, and other features and advantages of the present application will become apparent from the description, drawings and claims.
附图说明Description of the drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.
图1是本申请一实施例中数据更新方法的一应用环境示意图;FIG. 1 is a schematic diagram of an application environment of a data update method in an embodiment of the present application;
图2是本申请一实施例中数据更新方法的一流程图;Figure 2 is a flowchart of a data update method in an embodiment of the present application;
图3是本申请一实施例中数据更新装置的结构示意图;3 is a schematic diagram of the structure of a data update device in an embodiment of the present application;
图4是本申请一实施例中计算机设备的一示意图。Fig. 4 is a schematic diagram of a computer device in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
本申请提供的数据更新方法,可应用在如图1的应用环境中,其中,客户端通过网络与后端服务器进行通信。其中,客户端可以但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。后端服务器可以用独立的服务器或者是多个服务器 组成的服务器集群来实现。The data update method provided in this application can be applied in the application environment as shown in Fig. 1, in which the client communicates with the back-end server through the network. Among them, the client can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The back-end server can be implemented as an independent server or a server cluster composed of multiple servers.
在一实施例中,如图2所示,提供一种数据更新方法,以该方法应用在图1中的服务器为例进行说明,包括如下步骤:In an embodiment, as shown in FIG. 2, a method for updating data is provided. The method is applied to the server in FIG. 1 as an example for description, and includes the following steps:
S10,在接收到读数指令时,后端服务器获取前端服务器的前端数据库中配置表所有唯一数据记录,以及与所述唯一数据记录关联的写入时间;其中,所述唯一数据记录是指在所述前端数据库的接口表中分批次写入的指标数据,同时在所述配置表中为该批次的所述指标数据中的第一个所述指标数据更新配置的唯一标识,且所述唯一数据记录与该批次的所述指标数据写入所述接口表的所述写入时间关联存储在所述配置表中;每一批次的所述指标数据中包含至少一个指标数据,所述接口表中以分割符号分割各个批次的所述指标数据;S10. When receiving the reading instruction, the back-end server obtains all unique data records of the configuration table in the front-end database of the front-end server, and the writing time associated with the unique data record; wherein, the unique data record refers to the The index data written in batches in the interface table of the front-end database, and at the same time update the configuration unique identifier for the first index data in the batch of the index data in the configuration table, and The unique data record is stored in the configuration table in association with the write time when the indicator data of the batch is written into the interface table; the indicator data of each batch includes at least one indicator data, so In the interface table, the index data of each batch is divided by a division symbol;
可理解地,接口表和配置表都位于前端服务器的前端数据库中;各个批次的指标数据是通过在前端数据库执行SQL语句的增加数据操作而写入到前端服务器中的接口表中(以批次数据的形式写入,可以将一个预设时间或一个业务场景等情况下的指标数据作为一个批次的指标数据,比如10分钟内的指标数据作为一个批次的指标数据,公司的一个数据报表中的指标数据作为一个批次的指标数据等),且接口表中的各个批次的指标数据被分割符号进行分割(分割符号可以为逗号、斜线等其他具有分割意义的符号);唯一数据记录是指在接口表中分批次新增写入指标数据时,在配置表为写入的新增的批次的指标数据中的第一个指标数据对应生成的一个唯一标识(该唯一标识为自指标数据中提取的关键信息,关键信息包括但不限于指标类型等,可对照预先设定指标数据的关键信息表,去提取指标数据的关键信息,进而而形成该唯一标识);在本实施例中,凡是在配置表中具有对应的唯一数据记录的指标数据均为新增的指标数据,可理解地,由于指标数据是分批次写入接口表中,因此,在一个批次的指标数据中具有一个新增的指标数据时,说明该批次的所有指标数据均为新增的指标数据。Understandably, both the interface table and the configuration table are located in the front-end database of the front-end server; the index data of each batch is written into the interface table in the front-end server (in batch The data is written in the form of secondary data, and the indicator data in a preset time or a business scenario can be used as a batch of indicator data, such as indicator data within 10 minutes as a batch of indicator data, a data of the company The indicator data in the report is used as a batch of indicator data, etc.), and the indicator data of each batch in the interface table is divided by a dividing symbol (the dividing symbol can be a comma, a slash, and other symbols that have the meaning of dividing); Data record refers to a unique identifier (the unique identifier) generated corresponding to the first indicator data in the indicator data of the newly added batch written in the interface table when the indicator data is added in batches in the interface table. Identifier is the key information extracted from the index data. The key information includes but is not limited to the index type. You can compare the key information table of the preset index data to extract the key information of the index data, and then form the unique identifier); In this embodiment, all index data that has a corresponding unique data record in the configuration table are newly-added index data. Understandably, since the index data is written into the interface table in batches, in a batch When there is a newly-added index data in the index data, it means that all the index data in the batch are newly-added index data.
在本实施例中,由于指标数据分批次导入到接口表中,因此可通过分割符号在接口表中呈现以两个分割符号之间的指标数据为一个批次的指标数据的形式,将指标数据以批次的形式导入可减少多次导入的时间,也便于在接口表中查询指标数据,且由于配置表中的唯一数据记录仅为一个批次的指标数据的第一个指标数据,因此在后续的数据处理过程中,可减少配置表中的负载程度,同时提升数据处理的速度和效率。In this embodiment, since the index data is imported into the interface table in batches, the index data between the two division symbols can be presented in the interface table through the division symbol in the form of index data in one batch, and the index data Importing data in batches can reduce the time required for multiple importing, and it is also convenient to query indicator data in the interface table. Since the only data record in the configuration table is only the first indicator data of a batch of indicator data, In the subsequent data processing process, the load level in the configuration table can be reduced, and the speed and efficiency of data processing can be improved at the same time.
S20,所述后端服务器解析所述读数指令中的同步数据时间范围,从所述配置表中获取的所有所述写入时间和所述唯一数据记录中,遍历查询与所述同步数据时间范围匹配的所述写入时间,以及与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录,将与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录标记为待读取数据标识;S20. The back-end server parses the synchronization data time range in the reading instruction, and traverses the query and the synchronization data time range from all the write times and the unique data records obtained from the configuration table The matched write time, and the unique data record associated with each write time that matches the synchronization data time range, and the unique data associated with each write time that matches the synchronization data time range The record mark is the identification of the data to be read;
可理解地,读数指令是后端服务器需要读取接口表中一段时间范围的批次指标数据(需同步至后端数据库的批次指标数据)的指令。Understandably, the reading instruction is an instruction that the back-end server needs to read the batch index data (the batch index data that needs to be synchronized to the back-end database) in the interface table for a period of time.
S30,所述后端服务器在所述接口表中查询与各所述待读取数据标识对应的指标数据,根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,并将所述待读取批次的所有指标数据记录为新增批次指标数据;S30. The back-end server queries the index data corresponding to each of the data identifiers to be read in the interface table, and determines the index corresponding to the data identifiers to be read according to the segmentation symbol in the interface table The batch to be read to which the data belongs, and all index data of the batch to be read are recorded as new batch index data;
在本实施例中,在解析出读数指令中包含的同步数据时间范围后,先遍历查询配置表中的与同步数据时间范围匹配的写入时间,确定出匹配成功的写入时间关联的唯一数据记录,该唯一数据记录杯标记为待读取数据标识;再根据查询出来的待读取数据标识和分割符号来验证接口表中的各个批次的指标数据(先从接口表中确定与待读取数据标识匹配的指标数据,之后确定该指标数据所属的批次,由于两个分割符号可确定出一个批次的指标数据,因而识别到离该指标数据前后最近的两个分割符号后,就可以确定两个符号之间的指标数据为一个批次的指标数据,也即该指标数据所属的批次)中第一个指标数据是否关 联待读取数据标识,以批次的指标数据作为一个对象,并验证此对象的第一个指标数据,在确定第一个指标数据与待读取数据标识是关联的时候,则可以说明该指标数据为新增的指标数据,也可以说明整个对象(一个批次的指标数据)为新增批次指标数据,从而避免后端服务器进行验证全部批次的指标数据,减少后端服务器的工作负担和工作时间,且由于待读取数据标识只对应一个批次的指标数据的第一个指标数据,也减少了后端服务器的查询验证次数,进一步也减少后端服务器的工作负担和工作时间。In this embodiment, after analyzing the synchronization data time range contained in the reading instruction, first traverse the write time matching the synchronization data time range in the query configuration table to determine the unique data associated with the successfully matched write time Record, the unique data recording cup is marked as the data to be read identification; then the indicator data of each batch in the interface table is verified according to the data identification and the segmentation symbol to be read out of the query (first determine and read from the interface table Take the index data that matches the data identifier, and then determine the batch to which the index data belongs. Since two segmentation symbols can determine the index data of a batch, the two segmentation symbols that are closest to the index data before and after the index data are identified. It can be determined whether the indicator data between the two symbols is a batch of indicator data, that is, whether the first indicator data in the batch to which the indicator data belongs is associated with the data identifier to be read, and the batch of indicator data is used as a Object, and verify the first indicator data of this object. When it is determined that the first indicator data is associated with the identifier of the data to be read, it can indicate that the indicator data is new indicator data, or the entire object ( One batch of index data) is a new batch of index data, which prevents the back-end server from verifying the index data of all batches, reduces the workload and working time of the back-end server, and because the data to be read only corresponds to one identifier The first indicator data of the batch of indicator data also reduces the number of queries and verifications of the back-end server, and further reduces the workload and working time of the back-end server.
进一步地,所述根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,包括:Further, the determining, according to the segmentation symbol in the interface table, the batch to be read to which the indicator data corresponding to the data identifier to be read belongs belongs to:
识别第一个未进行标记的所述分割符号后,将该所述分割符号标记为已识别;After recognizing the first unmarked segmentation symbol, mark the segmentation symbol as recognized;
再次识别位于第一个所述分割符号之后且未进行标记的第一个所述分割符号,以两个识别的所述分割符号之间的所述指标数据作为一个批次的所述指标数据,直至每一个批次的所述指标数据之间的两个所述分割符号都被标记已识别;Re-identify the first segmentation symbol that is located after the first segmentation symbol and is not marked, and use the index data between the two identified segmentation symbols as one batch of the index data, Until the two division symbols between the indicator data of each batch are marked and recognized;
从识别成功的各批次的所述指标数据中查询确定出排序顺序为第一个的所述指标数据,并验证第一个所述指标数据是否与所述待读取数据标识进行关联成功,并在关联成功后确定第一个所述指标数据所属的所述待读取批次。Query and determine the index data with the first sorting order from the index data of each successfully identified batch, and verify whether the first index data is successfully associated with the data identification to be read, And after the association is successful, the batch to be read to which the first indicator data belongs is determined.
在本实施例中,以识别两个未标记的分割符号来确定出一个批次的指标数据,可提高各批次的指标数据的识别效率,也可提高各批次的指标数据第一个指标数据得确定效率。In this embodiment, two unmarked segmentation symbols are used to determine the index data of a batch, which can improve the identification efficiency of the index data of each batch, and can also improve the first index of the index data of each batch. The data has to determine the efficiency.
S40,所述后端服务器自接口表中获取所有批次的新增批次指标数据之后,将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,同时在所述配置表中删除与所有所述待读取批次的指标数据中的第一个指标数据对应的所述唯一数据记录以及与其关联存储的所述写入时间。S40. After the back-end server obtains the new batch index data of all batches from the interface table, it updates and stores the back-end server's back-end server with the newly-added batch index data of all read batches. In the target data table of the database, delete the unique data record corresponding to the first indicator data in all the indicator data of the batch to be read and the write-in stored in association therewith in the configuration table at the same time time.
在本实施例中,通过在数据库的接口表中不断验证接口表的各个批次的指标数据是否为新增批次指标数据,并将符合条件(包括各个批次指标数据对应的写入时间要落入至同步数据时间范围内)的新增批次指标数据更新存储至后端数据库所在的目标数据表中,起到一种增量更新的目的,目标数据表中的数据将会更符合后端数据库的使用,目标数据表所在的后端数据库将不会积累太多无用的数据(已同步至目标数据表中的各个历史的批次的指标数据,若再同步,将会造成目标数据表出现重复的各个批次的指标数据),后端数据库的运行性能不会大幅度受到影响;且将删除与所有待读取批次的指标数据中的第一个指标数据对应的唯一数据记录以及与其关联存储的写入时间的原因为:由于唯一数据记录和写入时间是判断批次的指标数据是否为新增批次指标数据的依据,因此在将新增批次指标数据更新存储后端数据库后,为了避免下一次影响对新增批次指标数据的判断从而将已同步过新增批次指标数据关联的唯一数据记录和写入时间从配置表进行删除。In this embodiment, by continuously verifying in the interface table of the database whether the index data of each batch of the interface table is the new batch index data, and meeting the conditions (including the write time requirements for each batch index data) The new batch indicator data that falls within the synchronization data time range) is updated and stored in the target data table where the back-end database is located, for an incremental update purpose, and the data in the target data table will be more consistent The use of the end database, the backend database where the target data table is located will not accumulate too much useless data (the indicator data of each historical batch that has been synchronized to the target data table, if resynchronized, it will cause the target data table Duplicate indicator data of each batch), the operating performance of the back-end database will not be greatly affected; and the unique data record corresponding to the first indicator data in all the indicator data of the batch to be read will be deleted and The reason for the write time associated with the storage is: because the unique data record and write time are the basis for judging whether the indicator data of the batch is the new batch indicator data, the new batch indicator data is updated in the storage backend After the database, in order to avoid affecting the judgment of the new batch index data next time, the unique data record and writing time associated with the newly synchronized batch index data are deleted from the configuration table.
在步骤S10至步骤S40所在的实施例中,首先可在前端服务器中的前端数据库的接口表以批次指标数据的形式新增写入A批次指标数据和B批次指标数据(该接口表中还存在历史写入的批次指标数据,比如:C批次指标数据;历史写入的批次指标数据是指已经被传输并存储至目标数据表中的批次指标数据),且A批次的指标数据和B批次指标数据在新增写入接口表之后,A批次指标数据和B批次指标数据的首部和尾部均被插入用于与其他批次指标数据分隔的分割符号(比如,A批次指标数据之前具有一个分割符号,A批次指标数据和B批次指标数据之间存在一个分割符号,B批次指标数据和C批次指标数据之间存在一个分割符号),分割符号可将A批次的指标数据、B批次的指标数据和C批次指标数据等在接口表分隔。In the embodiment where step S10 to step S40 are located, first, batch A index data and B batch index data can be newly written in the interface table of the front-end database in the front-end server in the form of batch index data (the interface table There are also historically written batch indicator data, such as: C batch indicator data; historically written batch indicator data refers to the batch indicator data that has been transmitted and stored in the target data table), and A batch After the index data of the second batch and the index data of the batch B are newly written into the interface table, the header and the tail of the index data of the A batch and the index data of the B batch are inserted into the dividing symbol ( For example, there is a segmentation symbol in front of the index data of batch A, there is a segmentation symbol between batch A index data and batch B index data, and there is a segmentation symbol between batch B index data and batch C index data), The dividing symbol can separate the index data of batch A, the index data of batch B and the index data of batch C in the interface table.
在步骤S10至步骤S40所在的实施例中,A批次指标数据中的所有指标数据均在2019年10月1日下午3点被作为一个批次新增写入接口表中,B批次指标数据中的所有指标数据均在2019年10月1日下午1点被作为一个批次新增写入接口表中,此时,在A批次指标数据和B批次指标数据新增写入接口表的的同时,还需要在前端数据库中的配置表写入 与A批次指标数据的第一个指标数据以及B批次指标数据的第一个指标数据对应的唯一数据记录(唯一数据记录是指从第一指标数据中提取的第一个指标数据的类型和关键数据属性等),同时在该配置表中,A批次指标数据的唯一数据记录与A批次指标数据被写入到接口表的写入时间(也即2019年10月1日下午3点)关联存储,B批次指标数据的唯一数据记录与B批次指标数据的被写入到接口表的写入时间(也即2019年10月1日下午1点)关联存储。可理解地,历史写入的批次指标数据在该配置表中不具有与其对应的任何唯一数据记录或写入时间等信息,在历史写入的批次指标数据被传输并存储至目标数据表中之后,其在配置表中的上述信息均已被从配置表中删除。In the embodiment where step S10 to step S40 are located, all indicator data in batch A indicator data are written into the interface table as a batch addition at 3 pm on October 1, 2019, and batch B indicators All the indicator data in the data are added to the interface table as a batch at 1 p.m. on October 1, 2019. At this time, a new writing interface is added for the indicator data of batch A and the indicator data of batch B. At the same time as the table, the configuration table in the front-end database also needs to be written in the unique data record corresponding to the first indicator data of batch A indicator data and the first indicator data of batch B indicator data (the only data record is Refers to the type and key data attributes of the first indicator data extracted from the first indicator data). At the same time, in the configuration table, the only data record of batch A indicator data and batch A indicator data are written to the interface The write time of the table (that is, at 3 pm on October 1, 2019) is stored in association, and the unique data record of batch B index data and the write time of batch B index data written to the interface table (that is, 1 pm on October 1, 2019) Associated storage. Understandably, the historically written batch indicator data does not have any unique data record or writing time information corresponding to it in the configuration table, and the historically written batch indicator data is transmitted and stored to the target data table After the mediation, the above-mentioned information in the configuration table has been deleted from the configuration table.
然后,后端服务器解析出读数指令中的同步数据时间范围,比如,若同步数据时间范围为当天下午的2点到4点,此时,由于A批次指标数据的写入时间为当天下午3点时,B批次指标数据的写入时间为当天下午1点时;此时,A批次指标数据的写入时间落入到同步数据时间范围(2点到4点),而B批次指标数据的写入时间并不属于该同步数据时间范围,因此,后端服务器仅从配置表中,获取与落入同步数据时间范围的A批次指标数据写入时间关联的A批次指标数据的唯一数据记录,并将该唯一数据记录记录为待读取数据标识;接着在接口表中查询与待读取数据标识对应的A批次指标数据,具体查询过程为:先从接口表中确定与待读取数据标识匹配的唯一指标数据,之后确定该唯一指标数据所属的批次(根据该唯一指标数据的前后距离其最近的分割符号进行确定,也即,此时确定的该批次即为A批次指标数据),之后,确定该A批次指标数据均为需要传输至目标数据表中的新增批次指标数据(可理解地,由于在本申请中,每一个批次的指标数据均在同一个写入时间写入并形成一个与写入时间对应的批次,且指标数据从前端数据库的接口表中传输至后端服务器中的后端数据库的目标数据表,均为分批次传输,因此,在一个批次的指标数据中具有一个新增的指标数据时,说明该批次的所有指标数据均为新增的指标数据)。Then, the back-end server parses out the synchronization data time range in the reading instruction. For example, if the synchronization data time range is from 2:00 to 4:00 in the afternoon of the same day, at this time, because the write time of the indicator data of batch A is 3 in the afternoon of the same day At 1 o’clock, the writing time of the indicator data of batch B is 1 o’clock in the afternoon of the same day; at this time, the writing time of indicator data of batch A falls within the synchronization data time range (2 o’clock to 4 o’clock), and batch B The write time of indicator data does not belong to the synchronization data time range. Therefore, the back-end server only obtains the batch A indicator data associated with the write time of the indicator data of batch A that falls within the synchronization data time range from the configuration table. And record the unique data record as the data identifier to be read; then query the A batch indicator data corresponding to the data identifier to be read in the interface table. The specific query process is: first determine from the interface table The unique index data that matches the identification of the data to be read is determined, and then the batch to which the unique index data belongs is determined (determined according to the nearest segmentation symbol before and after the unique index data, that is, the batch determined at this time is Is the index data of batch A). After that, it is determined that the index data of batch A is the newly added batch index data that needs to be transmitted to the target data table (understandably, because in this application, the index of each batch The data is written at the same writing time and a batch corresponding to the writing time is formed, and the indicator data is transferred from the interface table of the front-end database to the target data table of the back-end database on the back-end server. Batch transmission, therefore, when there is a new index data in a batch of index data, it means that all the index data of the batch are newly added index data).
最后后端服务器自接口表中获取确定出为需要传输至目标数据表中的新增批次指标数据的A批次指标数据,并将其存储至后端服务器中的后端数据库的目标数据表,同时将配置表中与A批次指标数据的第一个指标数据关联的写入时间和唯一数据记录进行删除。(B批次指标数据由于其写入时间与同步数据时间范围并不匹配,因此,其为新增批次指标数据,但不与读数指令对应,因此并不需要根据本次读数指令被存储至目标数据表,B批次指标数据关联的写入时间和唯一数据记录也依旧被存储在配置表中)。Finally, the back-end server obtains the index data of batch A that is determined to be the new batch index data that needs to be transmitted to the target data table from the interface table, and stores it in the target data table of the back-end database in the back-end server , And delete the write time and unique data record associated with the first indicator data of batch A indicator data in the configuration table at the same time. (Because the writing time of batch B index data does not match the time range of the synchronized data, it is a new batch of index data, but it does not correspond to the reading command, so it does not need to be stored in accordance with this reading command. The target data table, the write time and unique data records associated with batch B indicator data are still stored in the configuration table).
进一步地,所述将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,包括:Further, the updating and storing the new batch indicator data of all the batches read in the target data table of the back-end database of the back-end server includes:
通过预设指标类型表确定出所述新增批次指标数据对应的指标类型;Determine the index type corresponding to the newly added batch of index data through the preset index type table;
按照所述指标类型将与其对应的所述新增批次指标数据更新存储至所述后端数据库所在的所述目标数据表中与所述指标类型对应的存储分区;一个所述存储分区对应一个所述指标类型。According to the indicator type, the new batch indicator data corresponding to it is updated and stored in the storage partition corresponding to the indicator type in the target data table where the back-end database is located; one storage partition corresponds to one The indicator type.
可理解地,指标类型是新增批次指标数据所属的数据类型,比如目前确定的180个数据类型的指标数据,而各指标类型可对应一个目标数据表中一个存储分区(该目标数据表已通过指标类型进行数据分区)。Understandably, the indicator type is the data type to which the new batch of indicator data belongs. For example, the currently determined indicator data of 180 data types, and each indicator type can correspond to a storage partition in a target data table (the target data table has Data partitioning by indicator type).
在本实施例中,通过指标类型将与其对应的新增批次指标数据存储至目标数据表中与指标类型对应的存储分区,从而可分类同步存储新增指标数据,方便与从中获取。In this embodiment, the newly-added batch index data corresponding to the index type is stored in the storage partition corresponding to the index type in the target data table, so that the newly-added index data can be classified and synchronized to be stored for convenience and acquisition.
进一步地,所述将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中之前,还包括:Further, before the updating and storing the index data of the newly added batches of all the batches read in the target data table of the back-end database of the back-end server, the method further includes:
通过指标数据校验判断所述接口表中的各批次的所述新增批次指标数据是否出现预设数据异常;Judging by index data verification whether the new batch index data of each batch in the interface table has a preset data abnormality;
若其中一个批次的所述新增批次指标数据出现所述预设数据异常,则标记该批次的所述新增批次指标数据并发出提醒。If the preset data abnormality occurs in the newly-added batch index data of one of the batches, the newly-added batch index data of the batch is marked and a reminder is issued.
在本实施例中,由于在将各个批次的新增批次指标数据写入到接口表的过程中或在后端服务器准备获取接口表中的新增批次指标数据的过程中,可能受到外界因素的干扰(比如计算机性能不稳定、有干扰的程序等),导致接口表中的指标数据出现预设数据异常(比如空白数据、乱码数据等),因此可通过标记出现异常的批次指标数据并提醒预设人员,从而可及时解决预设数据异常,可减少错误数据的产生,保证数据的准确性。In this embodiment, because in the process of writing the newly added batch index data of each batch into the interface table or the back-end server prepares to obtain the newly added batch index data in the interface table, it may be affected. The interference of external factors (such as unstable computer performance, interfering programs, etc.) causes the indicator data in the interface table to have preset data abnormalities (such as blank data, garbled data, etc.), so the abnormal batch indicators can be marked The data also reminds the preset personnel, so that the preset data abnormality can be solved in time, the generation of erroneous data can be reduced, and the accuracy of the data can be guaranteed.
进一步地,所述自接口表中获取所有批次的新增批次指标数据,包括:Further, the acquiring new batch index data of all batches from the interface table includes:
按照线程优先级顺序从多线程中获取具有空闲的第一处理线程后,将各批次的所述新增批次指标数据关联的批次编号关联于各所述第一处理线程,并下发各批次的所述新增批次指标数据至与其批次编号关联的各所述第一处理线程;所述批次编号按照各批次的所述新增批次指标数据对应的所述配置表中的所述写入时间的先后顺序生成;After obtaining the idle first processing thread from multiple threads in the order of thread priority, the batch number associated with the newly added batch index data of each batch is associated with each first processing thread, and issued The newly added batch indicator data of each batch is sent to each of the first processing threads associated with its batch number; the batch number is in accordance with the configuration corresponding to the newly added batch indicator data of each batch The sequence of the writing time in the table is generated;
检验当前处理各批次的所述新增批次指标数据对应的各所述第一处理线程是否出现预设进程异常;Verifying whether each of the first processing threads corresponding to the newly added batch index data of each batch currently being processed has a preset process abnormality;
若一个批次的所述新增批次指标数据对应的一个所述第一处理线程出现所述预设进程异常,则按照所述线程优先级顺序将该批次的所述新增批次指标数据关联的所述批次编号再次关联于具有空闲的第二处理线程,并按照各批次的所述新增批次指标数据关联的各所述批次编号和预设排列顺序对各批次的所述新增批次指标数据进行排列;If the preset process exception occurs in one of the first processing threads corresponding to the newly added batch indicator data of a batch, the newly added batch indicators of the batch will be executed in the order of the thread priority. The batch number associated with the data is again associated with the idle second processing thread, and the batch numbers and the preset arrangement sequence associated with the new batch index data of each batch are compared to each batch. Arranging the index data of the newly added batches;
自所述接口表获取已排列成功的各批次的所述新增批次指标数据。Obtain the newly added batch index data of each batch that has been successfully arranged from the interface table.
可理解地,批次编号的数字越小,就说明该批次编号关联的新增批次指标数据是越先被获取的;多线程中的处理线程是用来运行对各批次的新增批次指标数据进行排列的任务。Understandably, the smaller the number of the batch number, the earlier the new batch index data associated with the batch number is obtained; the processing thread in the multi-thread is used to run the new batches The task of arranging batch index data.
在本实施例中,通过将各批次生成的批次编号(批次编号是按照各批次的新增批次指标数据对应的配置表中的所述写入时间的先后顺序生成,其中,写入时间的时间越早,批次编号就越小,越小批次编号的新增批次指标数据是需要鲜卑获取的指标数据)关联于各个第一处理线程后,再下发各个批次的新增批次指标数据至与其批次编号关联的各第一处理线程,此种方式可增加第一处理线程处理各个批次的新增批次指标数据的工作效率(通过批次编号为第一处理线程安排各批次的新增批次指标数据数据,一个处理线程只能关联一个批次编号,即一个处理只能单独处理一个批次的新增批次指标数据,不会出现一个第一处理线程处理多个批次的新增批次指标数据,因此,一个处理线程只要识别到批次编号,就可以快速处理与批次编号关联的一个批次的新增批次指标数据,此时也按照批次编号的数字大小为各个批次的新增批次指标数据安排存在优先级顺序的各第一处理线程,其中,第一处理线程的优先级顺序高,第一处理线程优先处理批次编号的数字较小的新增批次指标数据,从而第一处理线程可按照批次编号的数字大小处理新增批次指标数据,不会发生第一处理线程无目的处理各个批次的新增批次指标数据,加快第一处理线程的处理效率);通过检测当前处理各个批次的新增批次指标数据对应的各第一处理线程是否出现预设进程异常,在第一处理线程出现预设进程异常时,为出现预设进程异常的第一处理线程所对应的批次的新增批次指标数据重新设置一个第二处理线程,从而可保证各个批次的新增批次指标数据都有一个处理线程可进行处理(也即将自接口表获取新增批次指标数据),保证及时处理好各个批次的新增批次指标数据。本实施例根据处理线程去获取新增批次指标数据,加快获取新增批次指标数据的进度。In this embodiment, the batch number generated by each batch (the batch number is generated according to the order of the writing time in the configuration table corresponding to the newly added batch index data of each batch, where: The earlier the writing time, the smaller the batch number. The new batch indicator data with the smaller batch number is the indicator data that needs to be obtained by Xianbei) after it is associated with each first processing thread, then each batch is issued To each first processing thread associated with its batch number. This method can increase the work efficiency of the first processing thread to process the new batch indicator data of each batch (by batch number as the first processing thread). One processing thread arranges the new batch index data data of each batch, and one processing thread can only be associated with one batch number, that is, one processing can only process one batch of newly added batch index data separately, and there will be no first batch. One processing thread processes multiple batches of newly added batch index data. Therefore, as long as a processing thread recognizes the batch number, it can quickly process the newly added batch index data of a batch associated with the batch number. According to the numerical size of the batch number, the first processing threads with priority order are arranged for the new batch index data of each batch. Among them, the first processing thread has a higher priority order, and the first processing thread has priority. The new batch index data with the smaller number of the batch number, so that the first processing thread can process the newly added batch index data according to the number of the batch number, and the first processing thread will not process each batch purposelessly. Add batch index data to speed up the processing efficiency of the first processing thread); by detecting whether each first processing thread corresponding to the new batch index data currently processed for each batch has a preset process abnormality, in the first processing thread When a preset process exception occurs, a second processing thread is reset for the new batch index data of the batch corresponding to the first processing thread with the preset process exception, so as to ensure the new batch index of each batch The data has a processing thread for processing (that is, the new batch index data will be obtained from the interface table) to ensure that the new batch index data of each batch is processed in a timely manner. In this embodiment, the index data of the newly added batch is acquired according to the processing thread, and the progress of acquiring index data of the newly added batch is accelerated.
进一步地,所述自接口表中获取所有批次的新增批次指标数据之后,还包括:Further, after acquiring the new batch index data of all batches from the interface table, it further includes:
判断所述获取所述接口表中的所述新增批次指标数据的过程中是否出现获取中断的问题;Judging whether there is a problem of interruption in obtaining the index data of the newly added batch in the interface table;
若出现所述获取中断的问题,则在异常日志中记录该批次的所述新增批次指标数据所对应的所述写入时间,在所述异常日志中记录获取该批次所述新增批次指标数据的工作进度,并在下一次启动写入时,根据所述异常日志中的所述写入时间确定出该批次的所述新增批次指标数据,根据所述异常日志中的所述工作进度和所述写入时间确定出的该批次的 所述新增批次指标数据剩余的所述指标数据。If the acquisition interruption problem occurs, the write time corresponding to the newly added batch index data of the batch is recorded in the exception log, and the new batch is acquired in the exception log. The work progress of the batch of index data is increased, and when writing is started next time, the newly added batch of index data of the batch is determined according to the writing time in the abnormal log, and according to the abnormal log The indicator data remaining in the batch of new batch indicator data determined by the work progress and the writing time.
在本实施例中,由于在通过处理线程获取各个批次的新增批次指标数据的过程中,有可能由于网络、服务器奔溃等原因而出现获取中断的问题,因此后续启动写入能通过异常日志去确定上一次获取中断时所对应的新增批次指标数据,也能确定出上一获取该批次的新增批次指标数据的工作进度,从而可保证数据处理不中断的问题。In this embodiment, since in the process of acquiring the new batch indicator data of each batch through the processing thread, the acquisition may be interrupted due to the network, server crash, etc., so the subsequent start-up writing can pass The exception log is used to determine the index data of the new batch corresponding to the last acquisition interruption, and it can also determine the work progress of the last acquisition of the new batch index data of the batch, so as to ensure that the data processing is not interrupted.
综上所述,上述提供了一种数据更新方法,通过在数据库的接口表中不断验证接口表的各个批次的指标数据是否为新增批次指标数据,并将符合条件(包括各个批次指标数据对应的写入时间要落入至同步数据时间范围内)的新增批次指标数据更新存储至后端数据库所在的目标数据表中,起到一种增量更新的目的,目标数据表中的数据将会更符合后端数据库的使用,目标数据表所在的后端数据库将不会积累太多无用的数据(已同步至目标数据表中的各个历史的批次的指标数据,若再同步,将会造成目标数据表出现重复的各个批次的指标数据),后端数据库的运行性能不会大幅度受到影响,也即后端数据库对应的后端服务器也不会受到影响,因此通过本申请可提高后端服务器的运行性能,减少后端服务器运行任务的运行时间。To sum up, the above provides a data update method, by continuously verifying whether the index data of each batch of the interface table is the new batch index data in the interface table of the database, and will meet the conditions (including each batch The write time corresponding to the indicator data should fall within the time range of the synchronization data) The new batch indicator data update is stored in the target data table where the back-end database is located, for the purpose of incremental update, the target data table The data in the database will be more in line with the use of the back-end database. The back-end database where the target data table is located will not accumulate too much useless data (it has been synchronized to the indicator data of each historical batch in the target data table. Synchronization will cause repeated batches of indicator data in the target data table), the operating performance of the back-end database will not be greatly affected, that is, the back-end server corresponding to the back-end database will not be affected, so through The application can improve the running performance of the back-end server and reduce the running time of the running tasks of the back-end server.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
在一实施例中,提供一种数据更新装置,该数据更新装置与上述实施例中数据更新方法一一对应。如图3所示,该数据更新装置包括获取模块11、第一标记模块12、记录模块13和存储模块14。各功能模块详细说明如下:In one embodiment, a data update device is provided, and the data update device corresponds to the data update method in the above-mentioned embodiment one-to-one. As shown in FIG. 3, the data update device includes an acquisition module 11, a first marking module 12, a recording module 13 and a storage module 14. The detailed description of each functional module is as follows:
获取模块11,用于在接收到读数指令时,后端服务器获取前端服务器的前端数据库中配置表所有唯一数据记录,以及与所述唯一数据记录关联的写入时间;其中,所述唯一数据记录是指在所述前端数据库的接口表中分批次写入的指标数据,同时在所述配置表中为该批次的所述指标数据中的第一个所述指标数据更新配置的唯一标识,且所述唯一数据记录与该批次的所述指标数据写入所述接口表的所述写入时间关联存储在所述配置表中;每一批次的所述指标数据中包含至少一个指标数据,所述接口表中以分割符号分割各个批次的所述指标数据;The obtaining module 11 is used to obtain all the unique data records of the configuration table in the front-end database of the front-end server and the writing time associated with the unique data record when the back-end server receives the reading instruction; wherein, the unique data record Refers to the index data written in batches in the interface table of the front-end database, and at the same time, in the configuration table, update the unique identifier of the configuration for the first index data in the batch of the index data , And the unique data record is stored in the configuration table in association with the write time when the indicator data of the batch is written into the interface table; each batch of the indicator data includes at least one Index data, the index data of each batch is divided by a division symbol in the interface table;
第一标记模块12,用于所述后端服务器解析所述读数指令中的同步数据时间范围,从所述配置表中获取的所有所述写入时间和所述唯一数据记录中,遍历查询与所述同步数据时间范围匹配的所述写入时间,以及与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录,将与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录标记为待读取数据标识;The first marking module 12 is used for the back-end server to parse the synchronization data time range in the reading instruction, and traverse the query and the unique data records from all the writing times and the unique data records obtained from the configuration table. The write time that matches the synchronization data time range, and the unique data record associated with each write time that matches the synchronization data time range, and each write time that matches the synchronization data time range The unique data record mark associated with the entry time is the data to be read identification;
记录模块13,用于所述后端服务器在所述接口表中查询与各所述待读取数据标识对应的指标数据,根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,并将所述待读取批次的所有指标数据记录为新增批次指标数据;The recording module 13 is used for the back-end server to query the index data corresponding to each of the data identifiers to be read in the interface table, and determine the data to be read according to the segmentation symbol in the interface table Identify the batch to be read to which the corresponding index data belongs, and record all index data of the batch to be read as the newly added batch index data;
存储模块14,用于所述后端服务器自接口表中获取所有批次的新增批次指标数据之后,将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,同时在所述配置表中删除与所有所述待读取批次的指标数据中的第一个指标数据对应的所述唯一数据记录以及与其关联存储的所述写入时间。The storage module 14 is configured to update and store the new batch index data of all the read batches after the back-end server obtains the new batch index data of all batches from the interface table In the target data table of the back-end database of the server, delete the unique data record corresponding to the first index data in all the index data of the batch to be read and the associated stored data in the configuration table. The write time.
进一步地,所述记录模块包括:Further, the recording module includes:
标记子模块,用于识别第一个未进行标记的所述分割符号后,将该所述分割符号标记为已识别;The marking sub-module is used to mark the segmentation symbol as recognized after identifying the first segmentation symbol that has not been marked;
识别子模块,用于再次识别位于第一个所述分割符号之后且未进行标记的第一个所述分割符号,以两个识别的所述分割符号之间的所述指标数据作为一个批次的所述指标数据,直至每一个批次的所述指标数据之间的两个所述分割符号都被标记已识别;The recognition sub-module is used for re-identifying the first segmentation symbol that is located after the first segmentation symbol and is not marked, and uses the index data between the two identified segmentation symbols as a batch The index data of each batch until the two segmentation symbols between the index data of each batch are marked and recognized;
第一确定子模块,用于从识别成功的各批次的所述指标数据中查询确定出排序顺序为 第一个的所述指标数据,并验证第一个所述指标数据是否与所述待读取数据标识进行关联成功,并在关联成功后确定第一个所述指标数据所属的所述待读取批次。The first determining sub-module is configured to query and determine the index data whose sorting order is the first from the index data of each batch that has been successfully identified, and verify whether the first index data is consistent with the pending index data. The read data identifier is successfully associated, and after the successful association, the batch to be read to which the first indicator data belongs is determined.
进一步地,所述存储模块包括:Further, the storage module includes:
第二确定子模块,用于通过预设指标类型表确定出所述新增批次指标数据对应的指标类型;The second determining sub-module is used to determine the index type corresponding to the newly added batch of index data through the preset index type table;
存储子模块,用于按照所述指标类型将与其对应的所述新增批次指标数据更新存储至所述后端数据库所在的所述目标数据表中与所述指标类型对应的存储分区;一个所述存储分区对应一个所述指标类型。The storage sub-module is configured to update and store the new batch index data corresponding to the index type to the storage partition corresponding to the index type in the target data table where the back-end database is located; The storage partition corresponds to one indicator type.
进一步地,所述数据更新装置还包括:Further, the data update device further includes:
第一判断模块,用于通过指标数据校验判断所述接口表中的各批次的所述新增批次指标数据是否出现预设数据异常;The first judgment module is configured to judge whether the new batch index data of each batch in the interface table has a preset data abnormality through index data verification;
第二标记模块,用于若其中一个批次的所述新增批次指标数据出现所述预设数据异常,则标记该批次的所述新增批次指标数据并发出提醒。The second marking module is configured to mark the newly-added batch index data of the batch and issue a reminder if the preset data abnormality occurs in the newly-added batch index data of one of the batches.
进一步地,所述存储模块包括:Further, the storage module includes:
下发子模块,用于按照线程优先级顺序从多线程中获取具有空闲的第一处理线程后,将各批次的所述新增批次指标数据关联的批次编号关联于各所述第一处理线程,并下发各批次的所述新增批次指标数据至与其批次编号关联的各所述第一处理线程;所述批次编号按照各批次的所述新增批次指标数据对应的所述配置表中的所述写入时间的先后顺序生成;The issuing sub-module is used to obtain the idle first processing thread from multiple threads in the order of thread priority, and then associate the batch number associated with the newly added batch indicator data of each batch with each of the first processing threads. A processing thread, and sends the newly added batch indicator data of each batch to each of the first processing threads associated with its batch number; the batch number is in accordance with the newly added batch of each batch The sequence of the writing time in the configuration table corresponding to the indicator data is generated;
检验子模块,用于检验当前处理各批次的所述新增批次指标数据对应的各所述第一处理线程是否出现预设进程异常;The verification sub-module is used to verify whether each of the first processing threads corresponding to the newly added batch index data of each batch currently processed has a preset process abnormality;
排列子模块,用于若一个批次的所述新增批次指标数据对应的一个所述第一处理线程出现所述预设进程异常,则按照所述线程优先级顺序将该批次的所述新增批次指标数据关联的所述批次编号再次关联于具有空闲的第二处理线程,并按照各批次的所述新增批次指标数据关联的各所述批次编号和预设排列顺序对各批次的所述新增批次指标数据进行排列;The arranging sub-module is configured to: if one of the first processing threads corresponding to the newly added batch indicator data of a batch has the preset process abnormality, then all the batches of the batch will be processed according to the thread priority order. The batch number associated with the newly added batch index data is again associated with the idle second processing thread, and each batch number and preset associated with the newly added batch index data of each batch The arrangement sequence arranges the index data of the newly added batches of each batch;
获取子模块,用于自所述接口表获取已排列成功的各批次的所述新增批次指标数据。The obtaining sub-module is used to obtain the newly-added batch index data of each batch that has been successfully arranged from the interface table.
进一步地,所述数据更新装置还包括:Further, the data update device further includes:
第二判断模块,用于判断所述获取所述接口表中的所述新增批次指标数据的过程中是否出现获取中断的问题;The second judgment module is configured to judge whether there is a problem of interruption in obtaining the index data of the newly added batch in the interface table;
确定模块,用于若出现所述获取中断的问题,则在异常日志中记录该批次的所述新增批次指标数据所对应的所述写入时间,在所述异常日志中记录获取该批次所述新增批次指标数据的工作进度,并在下一次启动写入时,根据所述异常日志中的所述写入时间确定出该批次的所述新增批次指标数据,根据所述异常日志中的所述工作进度和所述写入时间确定出的该批次的所述新增批次指标数据剩余的所述指标数据。The determination module is configured to record the write time corresponding to the new batch index data of the batch in the abnormal log if the problem of the acquisition interruption occurs, and record the acquisition in the abnormal log The work progress of the batch of newly added batch index data, and the next time the writing is started, the newly added batch index data of the batch is determined according to the writing time in the abnormal log, according to The work progress in the abnormal log and the remaining indicator data of the new batch of indicator data of the batch determined by the writing time.
关于数据更新装置的具体限定可以参见上文中对于数据更新方法的限定,在此不再赘述。上述数据更新装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the data update device, please refer to the above limitation of the data update method, which will not be repeated here. Each module in the above-mentioned data update device can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图4所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括可读存储介质、内存储器。该可读存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为可读存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储数据更新方法中涉及到的数据。该计算机设备的网络接口用于与 外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种数据更新方法。本实施例所提供的可读存储介质包括非易失性可读存储介质和易失性可读存储介质。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. 4. The computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The readable storage medium stores an operating system, computer readable instructions, and a database. The internal memory provides an environment for the operation of the operating system and computer readable instructions in the readable storage medium. The database of the computer equipment is used to store the data involved in the data update method. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer-readable instruction is executed by the processor to realize a data update method. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现上述实施例中数据更新方法的步骤,例如图2所示的步骤S10至步骤S40。或者,处理器执行计算机可读指令时实现上述实施例中数据更新装置的各模块/单元的功能,例如图3所示模块11至模块14的功能。为避免重复,这里不再赘述。In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor. When the processor executes the computer-readable instructions, the data in the above-mentioned embodiment is realized. The steps of the update method are, for example, step S10 to step S40 shown in FIG. 2. Alternatively, the processor implements the functions of the modules/units of the data update apparatus in the foregoing embodiment when executing computer-readable instructions, for example, the functions of the modules 11 to 14 shown in FIG. 3. To avoid repetition, I won’t repeat them here.
在一个实施例中,提供了一个或多个存储有计算机可读指令的可读存储介质,本实施例所提供的可读存储介质包括非易失性可读存储介质和易失性可读存储介质;该可读存储介质上存储有计算机可读指令,该计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现上述实施例中数据更新方法的步骤,例如图2所示的步骤S10至步骤S40。或者,计算机可读指令被处理器执行时实现上述实施例中数据更新装置的各模块/单元的功能,例如图3所示模块11至模块14的功能。为避免重复,这里不再赘述。In one embodiment, one or more readable storage media storing computer readable instructions are provided. The readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage. Medium; the readable storage medium stores computer readable instructions, and when the computer readable instructions are executed by one or more processors, the one or more processors implement the steps of the data update method in the above-mentioned embodiment, for example, as shown in FIG. Step S10 to Step S40 shown in 2. Alternatively, when the computer-readable instructions are executed by the processor, the functions of the modules/units of the data updating apparatus in the above-mentioned embodiment are realized, for example, the functions of the modules 11 to 14 shown in FIG. 3. To avoid repetition, I won’t repeat them here.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质或易失性可读存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be implemented by instructing relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile computer. In a readable storage medium or a volatile readable storage medium, when the computer readable instruction is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database, or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the division of the above functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as needed. Module completion, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that it can still implement the foregoing The technical solutions recorded in the examples are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种数据更新方法,其中,包括:A data update method, which includes:
    在接收到读数指令时,后端服务器获取前端服务器的前端数据库中配置表所有唯一数据记录,以及与所述唯一数据记录关联的写入时间;其中,所述唯一数据记录是指在所述前端数据库的接口表中分批次写入的指标数据,同时在所述配置表中为该批次的所述指标数据中的第一个所述指标数据更新配置的唯一标识,且所述唯一数据记录与该批次的所述指标数据写入所述接口表的所述写入时间关联存储在所述配置表中;每一批次的所述指标数据中包含至少一个指标数据,所述接口表中以分割符号分割各个批次的所述指标数据;When receiving the reading instruction, the back-end server obtains all unique data records of the configuration table in the front-end database of the front-end server, and the writing time associated with the unique data record; wherein, the unique data record refers to the The index data written in batches in the interface table of the database, and at the same time the unique identifier of the configuration is updated in the configuration table for the first index data in the batch of the index data, and the unique data The record is stored in the configuration table in association with the write time when the indicator data of the batch is written into the interface table; the indicator data of each batch includes at least one indicator data, and the interface In the table, the index data of each batch is divided by dividing symbols;
    所述后端服务器解析所述读数指令中的同步数据时间范围,从所述配置表中获取的所有所述写入时间和所述唯一数据记录中,遍历查询与所述同步数据时间范围匹配的所述写入时间,以及与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录,将与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录标记为待读取数据标识;The back-end server parses the synchronization data time range in the reading instruction, and traverses queries that match the synchronization data time range among all the write times and the unique data records obtained from the configuration table The writing time and the unique data record associated with each writing time matching the synchronization data time range, and marking the unique data record associated with each writing time matching the synchronization data time range Identifies the data to be read;
    所述后端服务器在所述接口表中查询与各所述待读取数据标识对应的指标数据,根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,并将所述待读取批次的所有指标数据记录为新增批次指标数据;The back-end server queries the interface table for index data corresponding to each of the data identifiers to be read, and determines, according to the segmentation symbol in the interface table, that the index data corresponding to the data identifier to be read belongs to Batches to be read, and record all index data of the batches to be read as new batch index data;
    所述后端服务器自接口表中获取所有批次的新增批次指标数据之后,将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,同时在所述配置表中删除与所有所述待读取批次的指标数据中的第一个指标数据对应的所述唯一数据记录以及与其关联存储的所述写入时间。After the back-end server obtains the newly added batch index data of all batches from the interface table, it updates the newly-added batch index data of all the read batches to the back-end database stored in the back-end server. In the target data table, the unique data record corresponding to the first index data in the index data of all the batches to be read and the write time stored in association therewith are deleted from the configuration table at the same time.
  2. 根据权利要求1所述的数据更新方法,其中,所述根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,包括:The data update method according to claim 1, wherein the determining, according to the segmentation symbol in the interface table, the batch to be read to which the indicator data corresponding to the data identifier to be read belongs belongs to:
    识别第一个未进行标记的所述分割符号后,将该所述分割符号标记为已识别;After recognizing the first unmarked segmentation symbol, mark the segmentation symbol as recognized;
    再次识别位于第一个所述分割符号之后且未进行标记的第一个所述分割符号,以两个识别的所述分割符号之间的所述指标数据作为一个批次的所述指标数据,直至每一个批次的所述指标数据之间的两个所述分割符号都被标记已识别;Re-identify the first segmentation symbol that is located after the first segmentation symbol and is not marked, and use the index data between the two identified segmentation symbols as one batch of the index data, Until the two division symbols between the indicator data of each batch are marked and recognized;
    从识别成功的各批次的所述指标数据中查询确定出排序顺序为第一个的所述指标数据,并验证第一个所述指标数据是否与所述待读取数据标识进行关联成功,并在关联成功后确定第一个所述指标数据所属的所述待读取批次。Query and determine the index data with the first sorting order from the index data of each successfully identified batch, and verify whether the first index data is successfully associated with the data identification to be read, And after the association is successful, the batch to be read to which the first indicator data belongs is determined.
  3. 根据权利要求1所述的数据更新方法,其中,所述将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,包括:The data update method according to claim 1, wherein the updating and storing the new batch indicator data of all the batches read in the target data table of the back-end database of the back-end server comprises:
    通过预设指标类型表确定出所述新增批次指标数据对应的指标类型;Determine the index type corresponding to the newly added batch of index data through the preset index type table;
    按照所述指标类型将与其对应的所述新增批次指标数据更新存储至所述后端数据库所在的所述目标数据表中与所述指标类型对应的存储分区;一个所述存储分区对应一个所述指标类型。According to the indicator type, the new batch indicator data corresponding to it is updated and stored in the storage partition corresponding to the indicator type in the target data table where the back-end database is located; one storage partition corresponds to one The indicator type.
  4. 根据权利要求1所述的数据更新方法,其中,所述将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中之前,还包括:The data update method according to claim 1, wherein before said updating the index data of the newly added batches of all the read batches in the target data table stored in the back-end database of the back-end server, further include:
    通过指标数据校验判断所述接口表中的各批次的所述新增批次指标数据是否出现预设数据异常;Judging by index data verification whether the new batch index data of each batch in the interface table has a preset data abnormality;
    若其中一个批次的所述新增批次指标数据出现所述预设数据异常,则标记该批次的所述新增批次指标数据并发出提醒。If the preset data abnormality occurs in the newly-added batch index data of one of the batches, the newly-added batch index data of the batch is marked and a reminder is issued.
  5. 根据权利要求1所述的数据更新方法,其中,所述自接口表中获取所有批次的新增批次指标数据,包括:The data update method according to claim 1, wherein said acquiring new batch index data of all batches from the interface table comprises:
    按照线程优先级顺序从多线程中获取具有空闲的第一处理线程后,将各批次的所述新 增批次指标数据关联的批次编号关联于各所述第一处理线程,并下发各批次的所述新增批次指标数据至与其批次编号关联的各所述第一处理线程;所述批次编号按照各批次的所述新增批次指标数据对应的所述配置表中的所述写入时间的先后顺序生成;After obtaining the idle first processing thread from multiple threads in the order of thread priority, the batch number associated with the newly added batch index data of each batch is associated with each first processing thread, and issued The newly added batch indicator data of each batch is sent to each of the first processing threads associated with its batch number; the batch number is in accordance with the configuration corresponding to the newly added batch indicator data of each batch The sequence of the writing time in the table is generated;
    检验当前处理各批次的所述新增批次指标数据对应的各所述第一处理线程是否出现预设进程异常;Verifying whether each of the first processing threads corresponding to the newly added batch index data of each batch currently being processed has a preset process abnormality;
    若一个批次的所述新增批次指标数据对应的一个所述第一处理线程出现所述预设进程异常,则按照所述线程优先级顺序将该批次的所述新增批次指标数据关联的所述批次编号再次关联于具有空闲的第二处理线程,并按照各批次的所述新增批次指标数据关联的各所述批次编号和预设排列顺序对各批次的所述新增批次指标数据进行排列;If the preset process exception occurs in one of the first processing threads corresponding to the newly added batch indicator data of a batch, the newly added batch indicators of the batch will be executed in the order of the thread priority. The batch number associated with the data is again associated with the idle second processing thread, and the batch numbers and the preset arrangement sequence associated with the new batch index data of each batch are compared to each batch. Arranging the index data of the newly added batches;
    自所述接口表获取已排列成功的各批次的所述新增批次指标数据。Obtain the newly added batch index data of each batch that has been successfully arranged from the interface table.
  6. 根据权利要求1所述的数据更新方法,其中,所述自接口表中获取所有批次的新增批次指标数据之后,还包括:The data update method according to claim 1, wherein, after acquiring the new batch index data of all batches from the interface table, the method further comprises:
    判断所述获取所述接口表中的所述新增批次指标数据的过程中是否出现获取中断的问题;Judging whether there is a problem of interruption in obtaining the index data of the newly added batch in the interface table;
    若出现所述获取中断的问题,则在异常日志中记录该批次的所述新增批次指标数据所对应的所述写入时间,在所述异常日志中记录获取该批次所述新增批次指标数据的工作进度,并在下一次启动写入时,根据所述异常日志中的所述写入时间确定出该批次的所述新增批次指标数据,根据所述异常日志中的所述工作进度和所述写入时间确定出的该批次的所述新增批次指标数据剩余的所述指标数据。If the acquisition interruption problem occurs, the write time corresponding to the newly added batch index data of the batch is recorded in the exception log, and the new batch is acquired in the exception log. The work progress of the batch of index data is increased, and when writing is started next time, the newly added batch of index data of the batch is determined according to the writing time in the abnormal log, and according to the abnormal log The indicator data remaining in the batch of new batch indicator data determined by the work progress and the writing time.
  7. 一种数据更新装置,其中,包括:A data update device, which includes:
    获取模块,用于在接收到读数指令时,后端服务器获取前端服务器的前端数据库中配置表所有唯一数据记录,以及与所述唯一数据记录关联的写入时间;其中,所述唯一数据记录是指在所述前端数据库的接口表中分批次写入的指标数据,同时在所述配置表中为该批次的所述指标数据中的第一个所述指标数据更新配置的唯一标识,且所述唯一数据记录与该批次的所述指标数据写入所述接口表的所述写入时间关联存储在所述配置表中;每一批次的所述指标数据中包含至少一个指标数据,所述接口表中以分割符号分割各个批次的所述指标数据;The obtaining module is used to obtain all the unique data records of the configuration table in the front-end database of the front-end server and the writing time associated with the unique data record when the back-end server receives the reading instruction; wherein, the unique data record is Refers to the indicator data written in batches in the interface table of the front-end database, and at the same time update the configuration unique identifier for the first indicator data in the batch of the indicator data in the configuration table, And the unique data record is stored in the configuration table in association with the write time when the indicator data of the batch is written into the interface table; the indicator data of each batch includes at least one indicator Data, the index data of each batch is divided by a division symbol in the interface table;
    第一标记模块,用于所述后端服务器解析所述读数指令中的同步数据时间范围,从所述配置表中获取的所有所述写入时间和所述唯一数据记录中,遍历查询与所述同步数据时间范围匹配的所述写入时间,以及与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录,将与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录标记为待读取数据标识;The first marking module is used for the back-end server to parse the synchronization data time range in the reading instruction, to traverse the query and all the writing times and the unique data records obtained from the configuration table. The write time that matches the synchronization data time range, and the unique data record associated with each write time that matches the synchronization data time range, and each write time that matches the synchronization data time range The unique data record mark associated with time is the data identification to be read;
    记录模块,用于所述后端服务器在所述接口表中查询与各所述待读取数据标识对应的指标数据,根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,并将所述待读取批次的所有指标数据记录为新增批次指标数据;The recording module is used for the back-end server to query the index data corresponding to each of the data identifiers to be read in the interface table, and determine the data identifiers to be read according to the segmentation symbol in the interface table The batch to be read to which the corresponding index data belongs, and all the index data of the batch to be read are recorded as the new batch index data;
    存储模块,用于所述后端服务器自接口表中获取所有批次的新增批次指标数据之后,将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,同时在所述配置表中删除与所有所述待读取批次的指标数据中的第一个指标数据对应的所述唯一数据记录以及与其关联存储的所述写入时间。The storage module is configured to update and store the new batch index data of all read batches after the back-end server obtains the new batch index data of all batches from the interface table In the target data table of the back-end database, delete the unique data record corresponding to the first index data in all the index data of the batch to be read and all the data stored in association therewith in the configuration table. The writing time.
  8. 根据权利要求7所述的数据更新装置,其中,所述记录模块包括:The data update device according to claim 7, wherein the recording module comprises:
    标记子模块,用于识别第一个未进行标记的所述分割符号后,将该所述分割符号标记为已识别;The marking sub-module is used to mark the segmentation symbol as recognized after identifying the first segmentation symbol that has not been marked;
    识别子模块,用于再次识别位于第一个所述分割符号之后且未进行标记的第一个所述分割符号,以两个识别的所述分割符号之间的所述指标数据作为一个批次的所述指标数据,直至每一个批次的所述指标数据之间的两个所述分割符号都被标记已识别;The recognition sub-module is used for re-identifying the first segmentation symbol that is located after the first segmentation symbol and is not marked, and uses the index data between the two identified segmentation symbols as a batch The index data of each batch until the two segmentation symbols between the index data of each batch are marked and recognized;
    第一确定子模块,用于从识别成功的各批次的所述指标数据中查询确定出排序顺序为第一个的所述指标数据,并验证第一个所述指标数据是否与所述待读取数据标识进行关联成功,并在关联成功后确定第一个所述指标数据所属的所述待读取批次。The first determining sub-module is configured to query and determine the index data whose sorting order is the first from the index data of each batch that has been successfully identified, and verify whether the first index data is consistent with the pending index data. The read data identifier is successfully associated, and after the successful association, the batch to be read to which the first indicator data belongs is determined.
  9. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其中,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device includes a memory, a processor, and computer-readable instructions that are stored in the memory and can run on the processor, wherein the processor implements the following steps when the processor executes the computer-readable instructions:
    在接收到读数指令时,后端服务器获取前端服务器的前端数据库中配置表所有唯一数据记录,以及与所述唯一数据记录关联的写入时间;其中,所述唯一数据记录是指在所述前端数据库的接口表中分批次写入的指标数据,同时在所述配置表中为该批次的所述指标数据中的第一个所述指标数据更新配置的唯一标识,且所述唯一数据记录与该批次的所述指标数据写入所述接口表的所述写入时间关联存储在所述配置表中;每一批次的所述指标数据中包含至少一个指标数据,所述接口表中以分割符号分割各个批次的所述指标数据;When receiving the reading instruction, the back-end server obtains all unique data records of the configuration table in the front-end database of the front-end server, and the writing time associated with the unique data record; wherein, the unique data record refers to the The index data written in batches in the interface table of the database, and at the same time the unique identifier of the configuration is updated in the configuration table for the first index data in the batch of the index data, and the unique data The record is stored in the configuration table in association with the write time when the indicator data of the batch is written into the interface table; the indicator data of each batch includes at least one indicator data, and the interface In the table, the index data of each batch is divided by dividing symbols;
    所述后端服务器解析所述读数指令中的同步数据时间范围,从所述配置表中获取的所有所述写入时间和所述唯一数据记录中,遍历查询与所述同步数据时间范围匹配的所述写入时间,以及与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录,将与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录标记为待读取数据标识;The back-end server parses the synchronization data time range in the reading instruction, and traverses queries that match the synchronization data time range among all the write times and the unique data records obtained from the configuration table The writing time and the unique data record associated with each writing time matching the synchronization data time range, and marking the unique data record associated with each writing time matching the synchronization data time range Identifies the data to be read;
    所述后端服务器在所述接口表中查询与各所述待读取数据标识对应的指标数据,根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,并将所述待读取批次的所有指标数据记录为新增批次指标数据;The back-end server queries the interface table for index data corresponding to each of the data identifiers to be read, and determines, according to the segmentation symbol in the interface table, that the index data corresponding to the data identifier to be read belongs to Batches to be read, and record all index data of the batches to be read as new batch index data;
    所述后端服务器自接口表中获取所有批次的新增批次指标数据之后,将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,同时在所述配置表中删除与所有所述待读取批次的指标数据中的第一个指标数据对应的所述唯一数据记录以及与其关联存储的所述写入时间。After the back-end server obtains the newly added batch index data of all batches from the interface table, it updates the newly-added batch index data of all the read batches to the back-end database stored in the back-end server. In the target data table, the unique data record corresponding to the first index data in the index data of all the batches to be read and the write time stored in association therewith are deleted from the configuration table at the same time.
  10. 如权利要求9所述的计算机设备,其中,所述根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,包括:9. The computer device according to claim 9, wherein the determining, according to the segmentation symbol in the interface table, the batch to be read to which the indicator data corresponding to the data identifier to be read belongs belongs to:
    识别第一个未进行标记的所述分割符号后,将该所述分割符号标记为已识别;After recognizing the first unmarked segmentation symbol, mark the segmentation symbol as recognized;
    再次识别位于第一个所述分割符号之后且未进行标记的第一个所述分割符号,以两个识别的所述分割符号之间的所述指标数据作为一个批次的所述指标数据,直至每一个批次的所述指标数据之间的两个所述分割符号都被标记已识别;Re-identify the first segmentation symbol that is located after the first segmentation symbol and is not marked, and use the index data between the two identified segmentation symbols as one batch of the index data, Until the two division symbols between the indicator data of each batch are marked and recognized;
    从识别成功的各批次的所述指标数据中查询确定出排序顺序为第一个的所述指标数据,并验证第一个所述指标数据是否与所述待读取数据标识进行关联成功,并在关联成功后确定第一个所述指标数据所属的所述待读取批次。Query and determine the index data with the first sorting order from the index data of each successfully identified batch, and verify whether the first index data is successfully associated with the data identification to be read, And after the association is successful, the batch to be read to which the first indicator data belongs is determined.
  11. 如权利要求9所述的计算机设备,其中,所述将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,包括:9. The computer device according to claim 9, wherein said updating and storing the new batch indicator data of all batches read in the target data table of the back-end database of the back-end server comprises:
    通过预设指标类型表确定出所述新增批次指标数据对应的指标类型;Determine the index type corresponding to the newly added batch of index data through the preset index type table;
    按照所述指标类型将与其对应的所述新增批次指标数据更新存储至所述后端数据库所在的所述目标数据表中与所述指标类型对应的存储分区;一个所述存储分区对应一个所述指标类型。According to the indicator type, the new batch indicator data corresponding to it is updated and stored in the storage partition corresponding to the indicator type in the target data table where the back-end database is located; one storage partition corresponds to one The indicator type.
  12. 如权利要求9所述的计算机设备,其中,所述将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中之前,所述处理器执行所述计算机可读指令时还实现如下步骤:9. The computer device according to claim 9, wherein before the said new batch indicator data of all batches read is updated in the target data table stored in the back-end database of the back-end server, said The processor also implements the following steps when executing the computer-readable instructions:
    通过指标数据校验判断所述接口表中的各批次的所述新增批次指标数据是否出现预设数据异常;Judging by index data verification whether the new batch index data of each batch in the interface table has a preset data abnormality;
    若其中一个批次的所述新增批次指标数据出现所述预设数据异常,则标记该批次的所述新增批次指标数据并发出提醒。If the preset data abnormality occurs in the newly-added batch index data of one of the batches, the newly-added batch index data of the batch is marked and a reminder is issued.
  13. 如权利要求9所述的计算机设备,其中,所述自接口表中获取所有批次的新增批次指标数据,包括:9. The computer device according to claim 9, wherein said acquiring new batch index data of all batches from the interface table comprises:
    按照线程优先级顺序从多线程中获取具有空闲的第一处理线程后,将各批次的所述新增批次指标数据关联的批次编号关联于各所述第一处理线程,并下发各批次的所述新增批次指标数据至与其批次编号关联的各所述第一处理线程;所述批次编号按照各批次的所述新增批次指标数据对应的所述配置表中的所述写入时间的先后顺序生成;After obtaining the idle first processing thread from multiple threads in the order of thread priority, the batch number associated with the newly added batch index data of each batch is associated with each first processing thread, and issued The newly added batch indicator data of each batch is sent to each of the first processing threads associated with its batch number; the batch number is in accordance with the configuration corresponding to the newly added batch indicator data of each batch The sequence of the writing time in the table is generated;
    检验当前处理各批次的所述新增批次指标数据对应的各所述第一处理线程是否出现预设进程异常;Verifying whether each of the first processing threads corresponding to the newly added batch index data of each batch currently being processed has a preset process abnormality;
    若一个批次的所述新增批次指标数据对应的一个所述第一处理线程出现所述预设进程异常,则按照所述线程优先级顺序将该批次的所述新增批次指标数据关联的所述批次编号再次关联于具有空闲的第二处理线程,并按照各批次的所述新增批次指标数据关联的各所述批次编号和预设排列顺序对各批次的所述新增批次指标数据进行排列;If the preset process exception occurs in one of the first processing threads corresponding to the newly added batch indicator data of a batch, the newly added batch indicators of the batch will be executed in the order of the thread priority. The batch number associated with the data is again associated with the idle second processing thread, and the batch numbers and the preset arrangement sequence associated with the new batch index data of each batch are compared to each batch. Arranging the index data of the newly added batches;
    自所述接口表获取已排列成功的各批次的所述新增批次指标数据。Obtain the newly added batch index data of each batch that has been successfully arranged from the interface table.
  14. 如权利要求9所述的计算机设备,其中,所述自接口表中获取所有批次的新增批次指标数据之后,所述处理器执行所述计算机可读指令时还实现如下步骤:9. The computer device according to claim 9, wherein after the new batch indicator data of all batches is obtained from the interface table, the processor further implements the following steps when executing the computer readable instruction:
    判断所述获取所述接口表中的所述新增批次指标数据的过程中是否出现获取中断的问题;Judging whether there is a problem of interruption in obtaining the index data of the newly added batch in the interface table;
    若出现所述获取中断的问题,则在异常日志中记录该批次的所述新增批次指标数据所对应的所述写入时间,在所述异常日志中记录获取该批次所述新增批次指标数据的工作进度,并在下一次启动写入时,根据所述异常日志中的所述写入时间确定出该批次的所述新增批次指标数据,根据所述异常日志中的所述工作进度和所述写入时间确定出的该批次的所述新增批次指标数据剩余的所述指标数据。If the acquisition interruption problem occurs, the write time corresponding to the newly added batch index data of the batch is recorded in the exception log, and the new batch is acquired in the exception log. The work progress of the batch of index data is increased, and when writing is started next time, the newly added batch of index data of the batch is determined according to the writing time in the abnormal log, and according to the abnormal log The indicator data remaining in the batch of new batch indicator data determined by the work progress and the writing time.
  15. 一个或多个存储有计算机可读指令的可读存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more readable storage media storing computer readable instructions, where when the computer readable instructions are executed by one or more processors, the one or more processors execute the following steps:
    在接收到读数指令时,后端服务器获取前端服务器的前端数据库中配置表所有唯一数据记录,以及与所述唯一数据记录关联的写入时间;其中,所述唯一数据记录是指在所述前端数据库的接口表中分批次写入的指标数据,同时在所述配置表中为该批次的所述指标数据中的第一个所述指标数据更新配置的唯一标识,且所述唯一数据记录与该批次的所述指标数据写入所述接口表的所述写入时间关联存储在所述配置表中;每一批次的所述指标数据中包含至少一个指标数据,所述接口表中以分割符号分割各个批次的所述指标数据;When receiving the reading instruction, the back-end server obtains all unique data records of the configuration table in the front-end database of the front-end server, and the writing time associated with the unique data record; wherein, the unique data record refers to the The index data written in batches in the interface table of the database, and at the same time the unique identifier of the configuration is updated in the configuration table for the first index data in the batch of the index data, and the unique data The record is stored in the configuration table in association with the write time when the indicator data of the batch is written into the interface table; the indicator data of each batch includes at least one indicator data, and the interface In the table, the index data of each batch is divided by dividing symbols;
    所述后端服务器解析所述读数指令中的同步数据时间范围,从所述配置表中获取的所有所述写入时间和所述唯一数据记录中,遍历查询与所述同步数据时间范围匹配的所述写入时间,以及与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录,将与所述同步数据时间范围匹配的各所述写入时间关联的唯一数据记录标记为待读取数据标识;The back-end server parses the synchronization data time range in the reading instruction, and traverses queries that match the synchronization data time range among all the write times and the unique data records obtained from the configuration table The writing time and the unique data record associated with each writing time matching the synchronization data time range, and marking the unique data record associated with each writing time matching the synchronization data time range Identifies the data to be read;
    所述后端服务器在所述接口表中查询与各所述待读取数据标识对应的指标数据,根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,并将所述待读取批次的所有指标数据记录为新增批次指标数据;The back-end server queries the interface table for index data corresponding to each of the data identifiers to be read, and determines, according to the segmentation symbol in the interface table, that the index data corresponding to the data identifier to be read belongs to Batches to be read, and record all index data of the batches to be read as new batch index data;
    所述后端服务器自接口表中获取所有批次的新增批次指标数据之后,将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,同时在所述配置表中删除与所有所述待读取批次的指标数据中的第一个指标数据对应的所述唯一数据记录以及与其关联存储的所述写入时间。After the back-end server obtains the newly added batch index data of all batches from the interface table, it updates the newly-added batch index data of all the read batches to the back-end database stored in the back-end server. In the target data table, the unique data record corresponding to the first index data in the index data of all the batches to be read and the write time stored in association therewith are deleted from the configuration table at the same time.
  16. 如权利要求15所述的可读存储介质,其中,所述根据所述接口表中的所述分割符号确定所述待读取数据标识对应的指标数据所属的待读取批次,包括:15. The readable storage medium according to claim 15, wherein the determining, according to the segmentation symbol in the interface table, the batch to be read to which the indicator data corresponding to the data identifier to be read belongs belongs to:
    识别第一个未进行标记的所述分割符号后,将该所述分割符号标记为已识别;After recognizing the first unmarked segmentation symbol, mark the segmentation symbol as recognized;
    再次识别位于第一个所述分割符号之后且未进行标记的第一个所述分割符号,以两个识别的所述分割符号之间的所述指标数据作为一个批次的所述指标数据,直至每一个批次的所述指标数据之间的两个所述分割符号都被标记已识别;Re-identify the first segmentation symbol that is located after the first segmentation symbol and is not marked, and use the index data between the two identified segmentation symbols as one batch of the index data, Until the two division symbols between the indicator data of each batch are marked and recognized;
    从识别成功的各批次的所述指标数据中查询确定出排序顺序为第一个的所述指标数据,并验证第一个所述指标数据是否与所述待读取数据标识进行关联成功,并在关联成功后确定第一个所述指标数据所属的所述待读取批次。Query and determine the index data with the first sorting order from the index data of each successfully identified batch, and verify whether the first index data is successfully associated with the data identification to be read, And after the association is successful, the batch to be read to which the first indicator data belongs is determined.
  17. 如权利要求15所述的可读存储介质,其中,所述将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中,包括:The readable storage medium according to claim 15, wherein said updating and storing the new batch indicator data of all batches read in the target data table of the back-end database of the back-end server includes :
    通过预设指标类型表确定出所述新增批次指标数据对应的指标类型;Determine the index type corresponding to the newly added batch of index data through the preset index type table;
    按照所述指标类型将与其对应的所述新增批次指标数据更新存储至所述后端数据库所在的所述目标数据表中与所述指标类型对应的存储分区;一个所述存储分区对应一个所述指标类型。According to the indicator type, the new batch indicator data corresponding to it is updated and stored in the storage partition corresponding to the indicator type in the target data table where the back-end database is located; one storage partition corresponds to one The indicator type.
  18. 如权利要求15所述的可读存储介质,其中,所述将读取的所有批次的所述新增批次指标数据更新存储所述后端服务器的后端数据库的目标数据表中之前,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:15. The readable storage medium according to claim 15, wherein, before the new batch indicator data of all batches read is updated and stored in the target data table of the back-end database of the back-end server, When the computer-readable instructions are executed by one or more processors, the one or more processors further execute the following steps:
    通过指标数据校验判断所述接口表中的各批次的所述新增批次指标数据是否出现预设数据异常;Judging by index data verification whether the new batch index data of each batch in the interface table has a preset data abnormality;
    若其中一个批次的所述新增批次指标数据出现所述预设数据异常,则标记该批次的所述新增批次指标数据并发出提醒。If the preset data abnormality occurs in the newly-added batch index data of one of the batches, the newly-added batch index data of the batch is marked and a reminder is issued.
  19. 如权利要求15所述的可读存储介质,其中,所述自接口表中获取所有批次的新增批次指标数据,包括:15. The readable storage medium according to claim 15, wherein said acquiring new batch indicator data of all batches from the interface table comprises:
    按照线程优先级顺序从多线程中获取具有空闲的第一处理线程后,将各批次的所述新增批次指标数据关联的批次编号关联于各所述第一处理线程,并下发各批次的所述新增批次指标数据至与其批次编号关联的各所述第一处理线程;所述批次编号按照各批次的所述新增批次指标数据对应的所述配置表中的所述写入时间的先后顺序生成;After obtaining the idle first processing thread from multiple threads in the order of thread priority, the batch number associated with the newly added batch index data of each batch is associated with each first processing thread, and issued The newly added batch indicator data of each batch is sent to each of the first processing threads associated with its batch number; the batch number is in accordance with the configuration corresponding to the newly added batch indicator data of each batch The sequence of the writing time in the table is generated;
    检验当前处理各批次的所述新增批次指标数据对应的各所述第一处理线程是否出现预设进程异常;Verifying whether each of the first processing threads corresponding to the newly added batch index data of each batch currently being processed has a preset process abnormality;
    若一个批次的所述新增批次指标数据对应的一个所述第一处理线程出现所述预设进程异常,则按照所述线程优先级顺序将该批次的所述新增批次指标数据关联的所述批次编号再次关联于具有空闲的第二处理线程,并按照各批次的所述新增批次指标数据关联的各所述批次编号和预设排列顺序对各批次的所述新增批次指标数据进行排列;If the preset process exception occurs in one of the first processing threads corresponding to the newly added batch indicator data of a batch, the newly added batch indicators of the batch will be executed in the order of the thread priority. The batch number associated with the data is again associated with the idle second processing thread, and the batch numbers and the preset arrangement sequence associated with the new batch index data of each batch are compared to each batch. Arranging the index data of the newly added batches;
    自所述接口表获取已排列成功的各批次的所述新增批次指标数据。Obtain the newly added batch index data of each batch that has been successfully arranged from the interface table.
  20. 如权利要求15所述的可读存储介质,其中,所述自接口表中获取所有批次的新增批次指标数据之后,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:The readable storage medium according to claim 15, wherein after the new batch indicator data of all batches is obtained from the interface table, when the computer-readable instructions are executed by one or more processors, The one or more processors further execute the following steps:
    判断所述获取所述接口表中的所述新增批次指标数据的过程中是否出现获取中断的问题;Judging whether there is a problem of interruption in obtaining the index data of the newly added batch in the interface table;
    若出现所述获取中断的问题,则在异常日志中记录该批次的所述新增批次指标数据所对应的所述写入时间,在所述异常日志中记录获取该批次所述新增批次指标数据的工作进度,并在下一次启动写入时,根据所述异常日志中的所述写入时间确定出该批次的所述新增批次指标数据,根据所述异常日志中的所述工作进度和所述写入时间确定出的该批次的所述新增批次指标数据剩余的所述指标数据。If the acquisition interruption problem occurs, the write time corresponding to the newly added batch index data of the batch is recorded in the exception log, and the new batch is acquired in the exception log. The work progress of the batch of index data is increased, and when writing is started next time, the newly added batch of index data of the batch is determined according to the writing time in the abnormal log, and according to the abnormal log The indicator data remaining in the batch of new batch indicator data determined by the work progress and the writing time.
PCT/CN2020/093327 2020-03-06 2020-05-29 Data updating method and apparatus, computer device, and storage medium WO2021174696A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010152296.4A CN111475517B (en) 2020-03-06 2020-03-06 Data updating method, device, computer equipment and storage medium
CN202010152296.4 2020-03-06

Publications (1)

Publication Number Publication Date
WO2021174696A1 true WO2021174696A1 (en) 2021-09-10

Family

ID=71747360

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093327 WO2021174696A1 (en) 2020-03-06 2020-05-29 Data updating method and apparatus, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN111475517B (en)
WO (1) WO2021174696A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116226255A (en) * 2023-03-15 2023-06-06 中大体育产业集团股份有限公司 Efficient batch importing method and system for body measurement data

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115121B (en) * 2020-11-20 2023-12-12 陕西云基华海信息技术有限公司 Real-time data quality detection system for data management
CN112669480B (en) * 2020-12-08 2023-04-18 安徽鸿程光电有限公司 Data processing method and device, terminal equipment and storage medium
CN112632091B (en) * 2020-12-17 2023-10-20 重庆软江图灵人工智能科技有限公司 Index flow real-time calculation method, device, equipment and medium based on big data

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130024422A1 (en) * 2011-07-19 2013-01-24 Infosys Limited Methods for tracking database changes and devices thereof
CN105488187A (en) * 2015-12-02 2016-04-13 北京四达时代软件技术股份有限公司 Method and device for extracting multi-source heterogeneous data increment
CN105975502A (en) * 2016-04-25 2016-09-28 南京优测信息科技有限公司 Method for realizing incremental data extract based on CDC (Change Data Capture) mode
CN107402981A (en) * 2017-07-07 2017-11-28 国网浙江省电力公司信息通信分公司 A kind of data increment processing method and system based on distributed offline database
CN107704607A (en) * 2017-10-17 2018-02-16 武汉楚鼎信息技术有限公司 A kind of method of database in phase
CN108536775A (en) * 2018-03-27 2018-09-14 广东能龙教育股份有限公司 Method for synchronizing or initializing multiple sub-databases and central database

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108073595B (en) * 2016-11-10 2020-09-18 北京国双科技有限公司 Method and device for realizing data updating and snapshot in OLAP database
CN108228613B (en) * 2016-12-14 2021-12-07 北京国双科技有限公司 Data reading method and device
CN107885804A (en) * 2017-11-02 2018-04-06 平安科技(深圳)有限公司 Database synchronization method, application server and computer-readable recording medium
CN108536759B (en) * 2018-03-20 2020-08-04 阿里巴巴集团控股有限公司 Sample playback data access method and device
CN109189785A (en) * 2018-08-10 2019-01-11 平安科技(深圳)有限公司 Date storage method, device, computer equipment and storage medium
CN110781214A (en) * 2019-09-26 2020-02-11 金蝶软件(中国)有限公司 Database reading and writing method and device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130024422A1 (en) * 2011-07-19 2013-01-24 Infosys Limited Methods for tracking database changes and devices thereof
CN105488187A (en) * 2015-12-02 2016-04-13 北京四达时代软件技术股份有限公司 Method and device for extracting multi-source heterogeneous data increment
CN105975502A (en) * 2016-04-25 2016-09-28 南京优测信息科技有限公司 Method for realizing incremental data extract based on CDC (Change Data Capture) mode
CN107402981A (en) * 2017-07-07 2017-11-28 国网浙江省电力公司信息通信分公司 A kind of data increment processing method and system based on distributed offline database
CN107704607A (en) * 2017-10-17 2018-02-16 武汉楚鼎信息技术有限公司 A kind of method of database in phase
CN108536775A (en) * 2018-03-27 2018-09-14 广东能龙教育股份有限公司 Method for synchronizing or initializing multiple sub-databases and central database

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116226255A (en) * 2023-03-15 2023-06-06 中大体育产业集团股份有限公司 Efficient batch importing method and system for body measurement data
CN116226255B (en) * 2023-03-15 2023-08-11 中大体育产业集团股份有限公司 Efficient batch importing method and system for body measurement data

Also Published As

Publication number Publication date
CN111475517A (en) 2020-07-31
CN111475517B (en) 2024-02-20

Similar Documents

Publication Publication Date Title
WO2021174696A1 (en) Data updating method and apparatus, computer device, and storage medium
CN109558440B (en) Data batch processing method and device, computer equipment and storage medium
WO2020186809A1 (en) Big data platform-based hive task scheduling method and apparatus, device, and storage medium
WO2020029368A1 (en) Data storage method and apparatus, computer device and storage medium
CN108304554B (en) File splitting method and device, computer equipment and storage medium
WO2019047565A1 (en) Task processing method, device, computer device, and storage medium
CN108762898B (en) Thread interface management method, terminal equipment and computer readable storage medium
US10078758B1 (en) Systems and methods for an incremental, reversible and decentralized biometric identity management system
CN113220782A (en) Method, device, equipment and medium for generating multivariate test data source
CN103593257A (en) Data backup method and device
WO2019104891A1 (en) Method and device for importing and exporting report, storage medium, and terminal
CN112559526A (en) Data table export method and device, computer equipment and storage medium
CN112306655A (en) Task auditing method and device, computer equipment and storage medium
CN111581155B (en) Method and device for entering data into database and computer equipment
CN114372006A (en) Method and system for automatically generating test case, computer equipment and storage medium
CN114385760A (en) Method and device for real-time synchronization of incremental data, computer equipment and storage medium
CN111522881B (en) Service data processing method, device, server and storage medium
CN107644041B (en) Policy settlement processing method and device
CN112182225A (en) Knowledge management method for multi-modal scene target based on semi-supervised deep learning
CA3184895A1 (en) User behavior data writing method and device, computer equipment and storage medium
CN114116811B (en) Log processing method, device, equipment and storage medium
CN115827777A (en) Self-adaptive synchronization and difference identification method, device and equipment for multiple data sources
CN113704267A (en) Data query method, system, equipment and storage medium based on elastic search
CN114416847A (en) Data conversion method, device, server and storage medium
CN112579571B (en) Monitoring data configuration, data monitoring method, device, equipment and storage medium

Legal Events

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

Ref document number: 20922600

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20922600

Country of ref document: EP

Kind code of ref document: A1