WO2018201859A1 - 数据补录方法、装置、服务器和存储介质 - Google Patents

数据补录方法、装置、服务器和存储介质 Download PDF

Info

Publication number
WO2018201859A1
WO2018201859A1 PCT/CN2018/082421 CN2018082421W WO2018201859A1 WO 2018201859 A1 WO2018201859 A1 WO 2018201859A1 CN 2018082421 W CN2018082421 W CN 2018082421W WO 2018201859 A1 WO2018201859 A1 WO 2018201859A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
identifier
data processing
library
thread
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2018/082421
Other languages
English (en)
French (fr)
Inventor
耿瑞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2018201859A1 publication Critical patent/WO2018201859A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors

Definitions

  • the present application relates to a data supplementing method, apparatus, server and storage medium.
  • the server responds to the service request and performs corresponding processing. When the server responds with more service requests, it needs to process large amounts of data.
  • the production library in the server is the database actually used by the business to store the data used or generated in the production environment.
  • the production library in the server is the database actually used by the business to store the data used or generated in the production environment.
  • the large-scale data processing is performed in the production library, if the production library does not perform the predetermined task at the specified time, It may cause a large amount of data to be missing. If the data in the production library is missing, you need to perform the supplementary processing on the missing data.
  • data replenishment is generally performed directly in the production library. Since the production library is a database actually used by the business, data re-recording directly in the production library may cause business data errors in the production environment, and the risk is high.
  • a data supplementing method, apparatus, server, and storage medium are provided.
  • a method of data supplementation including:
  • the supplemental data is copied from the development library to the production library, and the supplemental data is processed by the production library.
  • a data supplementing device comprising:
  • a state obtaining module configured to acquire a data processing state of the production library when the preset time node is reached;
  • a data identifier obtaining module configured to acquire, according to the data processing status, an unprocessed data identifier in the production library
  • a copy module configured to copy the supplemental data from the development library to the production library, and process the supplemental data through the production library.
  • a server comprising a memory and one or more processors, the memory storing computer readable instructions, the computer readable instructions being executed by the processor, causing the one or more processors to perform the following step:
  • One or more non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the following steps:
  • FIG. 1 is an application scenario diagram of a data supplementing method according to one or more embodiments
  • FIG. 2 is a block diagram of a server in accordance with one or more embodiments
  • FIG. 3 is a schematic flow chart of a data supplementing method according to one or more embodiments.
  • FIG. 4 is a flow diagram of obtaining a data processing state of a production library in accordance with one or more embodiments
  • FIG. 5 is a schematic flowchart of obtaining a data identifier that is not processed by a production library according to one or more embodiments
  • FIG. 6 is a flow diagram of detecting whether there is a complementary execution operation in accordance with one or more embodiments
  • FIG. 7 is a flow diagram of generating supplemental data in accordance with one or more embodiments.
  • FIG. 8 is a block diagram of a data supplementing device in accordance with one or more embodiments.
  • FIG. 9 is a block diagram of a state acquisition module in accordance with one or more embodiments.
  • FIG. 10 is a block diagram of a data identification acquisition module in accordance with one or more embodiments.
  • Figure 11 is a block diagram of a data supplementing apparatus in another embodiment
  • Figure 12 is a block diagram of a data supplementing apparatus in still another embodiment.
  • FIG. 1 is an application scenario diagram of a data supplementing method in an embodiment.
  • the application scenario may include a production library 10 and a development library 20 .
  • the preset node When the preset node is reached, the data processing state of the production library 10 is acquired, and the unprocessed data identifier in the production library 10 is obtained according to the data processing state.
  • the supplemental data is generated in the development library 20 based on the unprocessed data identification in the acquired production library 10, and the supplemental data is copied from the development library 20 to the production library 10, and the supplemental data is processed by the production library 10.
  • the server includes a processor, memory, and network interface connected by a system bus.
  • the memory of the server includes a non-volatile storage medium and an internal memory, the non-volatile storage medium storing an operating system, a database, and computer readable instructions.
  • the database can include production libraries, test libraries, and development libraries.
  • the production library refers to the production database, which is the database in actual use of the business.
  • the test library refers to the test database. It is the database used by the tester to test.
  • the data environment in the test library is basically consistent with the production library.
  • the data in the test library is also synchronized with the production library.
  • the development library refers to the development database, and the development library is in the development environment. Databases, program developers can use the development library to develop new services, application functions, and so on.
  • the computer readable instructions are used to implement a data supplementing method applicable to a server provided in the embodiments of the present application.
  • the server's processor is used to provide computing and control capabilities that support the operation of the entire server.
  • the internal memory of the server provides a cached operating environment for operating systems and computer readable instructions in a non-volatile storage medium.
  • the server's network interface is used to communicate with other computer devices, such as receiving generated supplemental data.
  • the server can be implemented with a stand-alone server or a server cluster consisting of multiple servers.
  • FIG. 2 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied.
  • the server may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements.
  • a data supplementing method including the following steps:
  • Step S310 when the preset time node is reached, the data processing state of the production library is obtained.
  • the server may be provided with a production library, a test library and a development library, and the correspondence between the production library, the test library and the development library may be preset, and the production library may simultaneously correspond to one or more test libraries, and corresponding to one or more at the same time.
  • the development library can store the production library and the corresponding test library and development library in the relationship correspondence table, and the relationship correspondence table can store the production library identifier, the corresponding test library identifier, and the development library identifier.
  • the database identifier stored in the relationship correspondence table may be a number or a name of the database, and the database identifier may be composed of one or more of numbers, letters, symbols, and the like.
  • the production library, the test library, and the development library may be named according to the correspondence between the production library, the test library, and the development library.
  • the name of the production library is DB
  • the corresponding test library name may be DB_1, DB_2, etc.
  • corresponding The development library name can be DB-1, DB-2, etc., but is not limited to this, and is named according to the corresponding relationship, so that it is convenient to quickly find the test library and the development library corresponding to the production library and use them.
  • the data manager can upload data processing tasks to the server in advance through the terminal.
  • the data processing task may include information such as a production library identifier, a data identifier, a processing mode, a start time, and an end time.
  • the data identifier may be a key of the data in the database ( The primary key) value, according to the data identifier, can be queried in the database to get the data that needs to be processed.
  • the server may obtain a corresponding test library identifier according to the data processing task according to the data processing task, and obtain data corresponding to the data identifier in the test library that matches the test library identifier, and put the data into the production library.
  • the acquired data is processed in the production library according to the processing method, and the processing is stopped at the end time.
  • the preset time node refers to the end time in the data processing task.
  • the production library has finished the data processing, and the server can obtain the data for processing from the production library that performs data processing. Data processing status.
  • the production library can be a relational database, such as MY SQL, Oracle, DB2, etc., or a key-value (key-value) type database, such as redis, Memcached, etc., or an object-oriented database, a mesh database, etc. Limited to this.
  • a key-value database it can speed up data access and operation, and improve server response speed.
  • Step S320 obtaining an unprocessed data identifier in the production library according to the data processing state.
  • the server can obtain the data processing status of each data to be processed from the production library for performing data processing.
  • the data processing status may include processing completion, unprocessed completion, etc., and is used to indicate whether the data is processed when the preset time node is reached.
  • the server may obtain a flag bit of each processed data in the production library, and determine a data processing state according to the flag bit. When the flag bit is the first flag bit, the data processing state is processed, when the flag bit When the second flag is set, the data processing status is unprocessed.
  • the first flag bit may be E
  • the second flag bit may be S, but is not limited thereto, for example, the first flag bit is 1, the second flag bit is 0, and the like.
  • Step S330 generating the supplemental data according to the data identifier in the development library.
  • the server may query the corresponding development library identifier according to the production library identifier, obtain the data corresponding to the unprocessed data identifier in the production library from the test library corresponding to the production library through the development library matching the development library identifier, and put the data corresponding to the unprocessed data identifier in the production library, and put In the development library, the supplemental data is generated in the development library corresponding to the production library.
  • step S340 the supplemental data is copied from the development library to the production library, and the supplementary data is processed through the production library.
  • the server can copy the supplemental data generated in the development library from the development library to the production library, and process the supplemental data through the production library to implement data re-recording.
  • the data manager uploads a data processing task to the server by sending a short message to the server through the terminal.
  • the data processing task includes the production library identifier DB and the customer number num_1 to num_100.
  • the processing method is to send the customer information to the short message sending platform to send the short message.
  • the start time is 12:00 and the end time is 13:00.
  • the server can obtain the customer information with the customer number num_1 ⁇ num_100 from the test library DB_1 corresponding to the production library DB, and put the customer information into the production library DB.
  • the server processes the customer information in the production library DB, and delivers the customer information of the customer number num_1 to num_100 to the short message sending platform, and when the server receives the response information of the successful sending of the short message sent by the short message sending platform.
  • the data processing status of the corresponding customer information can be changed to the processing completion according to the customer number in the response information.
  • the server can obtain the customer number whose data processing status is unprocessed from the production library DB. In this embodiment, the unprocessed customer number is num90 to num_100.
  • the server can obtain the customer information with the customer number num90 ⁇ num_100 from the test library DB_1 through the development library DB-1 corresponding to the production library DB, and put the customer information with the customer number num90 ⁇ num_100 into the development library DB-1.
  • the customer information of the customer number num90 to num_100 to be re-recorded is generated in the development library DB-1.
  • the server can copy the customer information generated in the development library DB-1 to the production library DB, and re-deliver the customer information with the customer number num90 to num_100 to the short message sending platform through the production library DB for processing.
  • the data supplementing method obtains the data processing state of the production library when the preset time node is reached, acquires the unprocessed data identifier in the production library according to the data processing state, and generates the supplemental data according to the data identifier in the development library, and Copying the supplemental data from the development library to the production library, processing the supplemental data through the production library, generating the supplemental data in the development library and copying it into the production library, can reduce the risk of the production library's supplementary data, and improve the data re-recording s efficiency.
  • step S310 when reaching the preset time node, acquires the data processing state of the production library, including the following steps:
  • Step S402 When the preset time node is reached, the thread identifier matching the preset time node in the production library is obtained.
  • the data may be processed by one or more threads established in advance, and the server may obtain the thread identifier in the production library that matches the preset time node, that is, Obtain a thread identifier for data processing in the production library between the start time and the end time, and the thread identifier may be composed of one or more of numbers, letters, symbols, and the like.
  • Step S404 respectively, searching for a data processing record table of each thread for performing data processing according to the thread identifier.
  • Each thread in the production library that matches the preset time node can separately process different data, and respectively write the data to be processed into the corresponding data processing record table.
  • one data may correspond to one data processing record
  • the data processing record may include a data identifier, a flag bit for indicating a data processing state, a processing time, etc.
  • the processing time refers to a thread starting to process data to the data. The time interval for processing completion.
  • Step S406 scanning each piece of data processing record stored in the data processing record table, and acquiring data processing status in each piece of data processing record.
  • the server may obtain a data processing record table corresponding to each thread according to the thread identifier matching the preset time in the production library, and scan each data processing record in each pair of each data processing record table to obtain each data processing.
  • the flag bit in the record determines the data processing status of each data processing record according to the flag bit.
  • step S320 acquires an unprocessed data identifier in the production library according to the data processing state, including the following steps:
  • Step S502 detecting a flag bit in each piece of data processing record.
  • the server may scan the data processing record table corresponding to each thread in the production library for data processing, and detect the flag bit in each data processing record in the data processing record table. When the flag bit is the first flag bit, Then, it can be determined that the data processing status of the data processing record is processing completion, and when the flag bit is the second flag bit, it can be determined that the data processing status of the data processing record is unprocessed.
  • Step S504 when the flag bit in the data processing record is a preset flag bit, the data identifier in the data processing record whose flag bit is the preset flag bit is obtained.
  • the preset flag bit may be the second flag bit.
  • the data processing state of the data corresponding to the data processing record may be determined to be unprocessed.
  • the server obtains the data identifier in the data processing record with the flag bit as the preset flag bit, and can obtain the unprocessed data identifier in the production library.
  • multiple threads can be established in the production library for parallel processing, speeding up the data processing speed, and processing the data processing records in the record table according to the data corresponding to the thread, and quickly and accurately obtaining the unprocessed completion.
  • Data identification can effectively improve the efficiency of data re-recording.
  • the data supplementing method further includes the following steps:
  • Step S602 Acquire, from the thread identifier that matches the preset time node, a thread identifier corresponding to the thread that includes the unprocessed data identifier.
  • the server scans the data processing record table of each thread in the production library that matches the preset time node, and marks the data processing record table containing the unprocessed data identifier, and obtains the marked data processing record table.
  • the thread ID of the corresponding thread is the thread ID of the corresponding thread.
  • Step S604 Query the thread record table according to the corresponding thread identifier, determine whether the thread containing the unprocessed data identifier includes a complementary execution operation, and if yes, execute step S608, and if no, execute step S606.
  • the server queries the thread record table according to the thread identifier of the thread corresponding to the marked data processing record table, and determines whether the thread containing the unprocessed data includes a complement execution operation.
  • the thread record table may store the thread identifier, the thread creation time, the corresponding production library identifier, the processed data identifier, the creator, and whether to perform the execution.
  • the creator refers to the account that created the thread, and the complement execution refers to the arrival.
  • the time node is preset, the thread contains unprocessed data, and the thread reprocesses the unprocessed data.
  • Step S606 generating the supplemental data according to the data identifier in the development library.
  • the server may temporarily not process, and at the set time, the unprocessed data is processed by the thread, and the data of the thread is processed.
  • the data corresponding to the data processing record whose flag bit is the second flag bit is complemented.
  • the set time may be 0:00 am, 1 am, or the like, or a point in time when other servers receive less service service requests.
  • the server may acquire data from the test library corresponding to the production library according to the unprocessed data identifier contained in the thread through the development library, and put In the development library, the complement data is generated in the development library, and the complement data generated in the development library is copied into the production library, and is processed by the thread again.
  • the thread in the production library that matches the preset time node includes thread 1, thread 2, thread 3, and thread 4, and thread 1 and thread 3 contain data identifiers whose data processing status is unprocessed.
  • the server query thread record table may determine that thread 1 includes a complement execution operation, and thread 3 does not include a complement execution operation, and may obtain the unprocessed data identifier included in thread 3 in the test library corresponding to the production library through the development library. Data, and the acquired data is put into the development library, the complement data is generated in the development library, and the supplemental data generated in the development library is copied into the production library, and the complement data is performed by the thread 3 in the production library. deal with.
  • step S608 no processing is temporarily performed.
  • the complement data corresponding to the thread that does not include the complement execution operation is generated in the development library, and when the thread includes the complementary execution operation, the process does not need to be performed.
  • Data re-recording can reduce the amount of data of the supplemental data, reduce the risk of re-recording data in the production library, and improve the efficiency of data re-recording, while ensuring the stability of the production library.
  • step S320 after obtaining the unprocessed data identifier in the production library according to the data processing state in step S320, the following steps are further included:
  • Step S702 constructing a data generation script according to the unprocessed data identifier.
  • the server obtains the data identifier of the data processing state in the production library as unprocessed data, and builds a data generation script according to the data identifier, and the data generation script can be a database executable script, such as SQL (Structured Query Language).
  • the data generation script can contain one or more SQL statements.
  • Step S704 submit the data generation script to the production library, so that the production library executes the data generation script to generate the supplemental data, and processes the supplementary data.
  • the server can submit a data generation script built according to the unprocessed data identifier to the production library, and execute a data generation script through SVN (Subversion), which is an open source version management system.
  • the server executes a data generation script through the SVN in the production library, establishes a connection with the test library corresponding to the production library, and acquires data corresponding to the unprocessed data identifier from the test library according to the SQL statement in the data generation script, in the production library.
  • the supplemental data is generated and the generated supplemental data is processed through the production library.
  • the data generation script can be constructed according to the unprocessed data identifier, and the data generation script can be directly executed by the production library to generate the supplemental data, which can reduce the risk of the production library supplemental data and improve the efficiency of data supplementation.
  • FIGS. 3-7 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in FIGS. 3-7 may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, these sub-steps or stages The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with at least a portion of other steps or sub-steps or stages of other steps.
  • a data supplementing apparatus 800 including a state obtaining module 810, a data identifier obtaining module 820, a generating module 830, and a copying module 840.
  • the state obtaining module 810 is configured to acquire a data processing state of the production library when the preset time node is reached.
  • the data identifier obtaining module 820 is configured to obtain an unprocessed data identifier in the production library according to the data processing status.
  • the generating module 830 is configured to generate the supplemental data according to the data identifier in the development library.
  • the copy module 840 is configured to copy the supplemental data from the development library to the production library, and process the supplemental data through the production library.
  • the data supplementing method obtains the data processing state of the production library when the preset time node is reached, acquires the unprocessed data identifier in the production library according to the data processing state, and generates the supplemental data according to the data identifier in the development library, and Copying the supplemental data from the development library to the production library, processing the supplemental data through the production library, generating the supplemental data in the development library and copying it into the production library, can reduce the risk of the production library's supplementary data, and improve the data re-recording s efficiency.
  • the state acquisition module 810 includes a thread identification acquisition unit 812, a lookup unit 814, and a scanning unit 816.
  • the thread identifier obtaining unit 812 is configured to acquire a thread identifier in the production library that matches the preset time node when the preset time node is reached.
  • the searching unit 814 is configured to separately search for a data processing record table of each thread that performs data processing according to the thread identifier.
  • the scanning unit 816 is configured to scan each data processing record stored in the data processing record table, and acquire data processing status in each piece of data processing record.
  • the data identifier obtaining module 820 includes a detecting unit 822 and a data identifier acquiring unit 824.
  • the detecting unit 822 is configured to detect the flag bit in each piece of data processing record.
  • the data identifier obtaining unit 824 is configured to: when the flag bit of the data processing record is a preset flag bit, obtain the data identifier in the data processing record whose flag bit is the preset flag bit.
  • multiple threads can be established in the production library for parallel processing, speeding up the data processing speed, and processing the data processing records in the record table according to the data corresponding to the thread, and quickly and accurately obtaining the unprocessed completion.
  • Data identification can effectively improve the efficiency of data re-recording.
  • the data supplementing apparatus 800 includes a state acquiring module 810, a data identifier acquiring module 820, a generating module 830, and a copying module 840, and further includes a thread identifier acquiring module 850 and determining Module 860.
  • the thread identifier obtaining module 850 is configured to obtain, from the thread identifier that matches the preset time node, a thread identifier corresponding to the thread that includes the unprocessed data identifier.
  • the determining module 860 is configured to query the thread record table according to the corresponding thread identifier, and determine whether the thread containing the unprocessed data identifier includes a complementary execution operation.
  • the generating module 830 is further configured to generate the supplemental data according to the data identifier in the development library when the thread that includes the unprocessed data identifier does not include the complement execution operation.
  • the complement data corresponding to the thread that does not include the complement execution operation is generated in the development library, and when the thread includes the complementary execution operation, the process does not need to be performed.
  • Data re-recording can reduce the amount of data of the supplemental data, reduce the risk of re-recording data in the production library, and improve the efficiency of data re-recording, while ensuring the stability of the production library.
  • the data supplementing apparatus 800 includes a state acquiring module 810, a data identifier acquiring module 820, a generating module 830, a copying module 840, a thread identifier acquiring module 850, and a determining module 860. It also includes a building module 870 and a submitting module 880.
  • the building module 870 is configured to build a data generation script according to the unprocessed data identifier.
  • the submitting module 880 is configured to submit the data generation script to the production library, so that the production library executes the data generation script to generate the supplemental data, and processes the supplementary data.
  • the data generation script can be constructed according to the unprocessed data identifier, and the data generation script can be directly executed by the production library to generate the supplemental data, which can reduce the risk of the production library supplemental data and improve the efficiency of data supplementation.
  • the various modules in the data-removing device described above may be implemented in whole or in part by software, hardware, and combinations thereof.
  • the above modules may be embedded in the hardware in the processor or in the memory in the server, or may be stored in the memory in the server, so that the processor calls the corresponding operations of the above modules.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executed by one or more processors such that one or more processors implement any of the present application
  • the steps of the regression test method provided in the examples are not limited to:
  • One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to be implemented in any one embodiment of the present application The steps provided by the regression test method.
  • Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in a variety of formats, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization chain.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • Synchlink DRAM SLDRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

一种数据补录方法,包括:当到达预设时间节点时,获取生产库的数据处理状态;根据所述数据处理状态获取所述生产库中未处理完成的数据标识;在开发库中根据所述数据标识生成补录数据;及将所述补录数据从所述开发库拷贝至所述生产库,并通过所述生产库处理所述补录数据。

Description

数据补录方法、装置、服务器和存储介质
相关申请的交叉引用
本申请要求于2017年05月04日提交中国专利局,申请号为2017103094663,申请名称为“数据补录方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及一种数据补录方法、装置、服务器和存储介质。
背景技术
服务器用于响应服务请求,并进行相应的处理,当服务器响应的服务请求较多时,则需要处理大批量的数据。服务器中的生产库是业务实际使用的数据库,用于存储生产环境中使用或产生的数据,当在生产库进行大批量的数据处理时,若在指定时间节点生产库未执行完成预定的任务,可能会造成数据大量缺失。若生产库中的数据缺失,则需要对缺失的数据进行补录处理。在传统的方式中,一般直接在生产库中进行数据补录,由于生产库是业务实际使用的数据库,直接在生产库中进行数据补录可能导致生产环境中业务数据出错,风险较高。
发明内容
根据本申请公开的各种实施例,提供一种数据补录方法、装置、服务器和存储介质。
一种数据补录方法,包括:
当到达预设时间节点时,获取生产库的数据处理状态;
根据所述数据处理状态获取所述生产库中未处理完成的数据标识;
在开发库中根据所述数据标识生成补录数据;及
将所述补录数据从所述开发库拷贝至所述生产库,并通过所述生产库处理所述补录数 据。
一种数据补录装置,包括:
状态获取模块,用于当到达预设时间节点时,获取生产库的数据处理状态;
数据标识获取模块,用于根据所述数据处理状态获取所述生产库中未处理完成的数据标识;
生成模块,用于在开发库中根据所述数据标识生成补录数据;及
拷贝模块,用于将所述补录数据从所述开发库拷贝至所述生产库,并通过所述生产库处理所述补录数据。
一种服务器,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:
当到达预设时间节点时,获取生产库的数据处理状态;
根据所述数据处理状态获取所述生产库中未处理完成的数据标识;
在开发库中根据所述数据标识生成补录数据;及
将所述补录数据从所述开发库拷贝至所述生产库,并通过所述生产库处理所述补录数据。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
当到达预设时间节点时,获取生产库的数据处理状态;
根据所述数据处理状态获取所述生产库中未处理完成的数据标识;
在开发库中根据所述数据标识生成补录数据;及
将所述补录数据从所述开发库拷贝至所述生产库,并通过所述生产库处理所述补录数据。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图 作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据一个或多个实施例中数据补录方法的应用场景图;
图2为根据一个或多个实施例中服务器的框图;
图3为根据一个或多个实施例中数据补录方法的流程示意图;
图4为根据一个或多个实施例中获取生产库的数据处理状态的流程示意图;
图5为根据一个或多个实施例中获取生产库未处理完成的数据标识的流程示意图;
图6为根据一个或多个实施例中检测是否有补执行操作的流程示意图;
图7为根据一个或多个实施例中生成补录数据的流程示意图;
图8为根据一个或多个实施例中数据补录装置的框图;
图9为根据一个或多个实施例中状态获取模块的框图;
图10为根据一个或多个实施例中数据标识获取模块的框图;
图11为另一个实施例中数据补录装置的框图;
图12为又一个实施例中数据补录装置的框图。
具体实施方式
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。
图1为一个实施例中数据补录方法的应用场景图。如图1所示,该应用场景可包括生产库10及开发库20。当到达预设节点时,获取生产库10的数据处理状态,根据数据处理状态获取生产库10中未处理完成的数据标识。在开发库20中根据获取的生产库10中未处理完成的数据标识生成补录数据,并将补录数据从开发库20拷贝至生产库10,并通过生产库10处理补录数据。
图2为一个实施例中服务器的框图。如图2所示,该服务器包括通过系统总线连接的处理器、存储器和网络接口。该服务器的存储器包括非易失性存储介质和内存储器,该非易失性存储介质存储有操作系统、数据库和计算机可读指令。数据库可包括生产库、测 试库及开发库等。生产库指的是生产数据库,生产库是业务实际使用中的数据库,当服务器对外提供服务时,客户可通过访问、操作生产库中的数据获取所需的业务服务;测试库指的是测试数据库,是测试人员进行测试时所使用的数据库,测试库中的数据环境基本与生产库保持一致,测试库中的数据也与生产库同步;开发库指的是开发数据库,开发库是开发环境中的数据库,程序开发人员可使用开发库开发新的服务、应用功能等。该计算机可读指令用于实现本申请实施例中提供的适用于服务器的一种数据补录方法。该服务器的处理器用于提供计算和控制能力,支撑整个服务器的运行。该服务器的内存储器为非易失性存储介质中的操作系统和计算机可读指令提供高速缓存的运行环境。该服务器的网络接口用于据以与其它的计算机设备进行通信,比如接收生成的补录数据等。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的服务器的限定,具体地服务器可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
如图3所示,在其中一个实施例中,提供了一种数据补录方法,包括以下步骤:
步骤S310,当到达预设时间节点时,获取生产库的数据处理状态。
服务器中可设置有生产库、测试库及开发库,可预先设置生产库、测试库及开发库之间的对应关系,生产库可同时对应一个或多个测试库,并同时对应一个或多个开发库,可将生产库与对应的测试库、开发库等存储在关系对应表中,关系对应表中可存储有生产库标识及对应的测试库标识、开发库标识等。关系对应表中存储的数据库标识可以是数据库的编号或名称等,数据库标识可由数字、字母及符号等中的一种或多种组成。可按照生产库、测试库及开发库的对应关系,对生产库、测试库及开发库分别进行命名,例如,生产库的名称为DB,对应的测试库名称可为DB_1、DB_2等,对应的开发库名称可为DB-1、DB-2等,但不限于此,按照对应关系进行命名,方便快速查找到生产库对应的测试库及开发库并进行使用。
数据管理员可通过终端预先向服务器上传数据处理任务,数据处理任务中可包括生产库标识、数据标识、处理方式、起始时间及结束时间等信息,数据标识可为数据在数据库中的key(主键)值,根据数据标识可在数据库中查询得到需要进行处理的数据。服务 器可根据数据处理任务,根据生产库标识获取对应的测试库标识,并在与测试库标识匹配的测试库中获取与数据标识对应的数据,并放入生产库中。在起始时间时,在生产库中按照处理方式对获取的数据进行处理,并在结束时间停止处理。预设时间节点指的是数据处理任务中的结束时间,当到达预设时间节点时,则说明生产库已结束数据处理,服务器可从进行数据处理的生产库中,获取进行处理的各个数据的数据处理状态。
生产库可以是关系型数据库,例如MY SQL、Oracle、DB2等,也可以是key-value(键-值)型数据库,例如redis、Memcached等,或是面向对象数据库、网状数据库等,并不限于此。当生产库为key-value型数据库时,可加快数据访问、操作的速度,提高服务器响应速度。
步骤S320,根据数据处理状态获取生产库中未处理完成的数据标识。
服务器从进行数据处理的生产库中,可获取进行处理的各个数据的数据处理状态,数据处理状态可包括处理完成、未处理完成等,用于表示在到达预设时间节点时数据是否处理完成。在其中一个实施例中,服务器可获取生产库中各个进行处理的数据的标志位,根据标志位确定数据处理状态,当标志位为第一标志位时,数据处理状态为处理完成,当标志位为第二标志位时,数据处理状态为未处理完成。在其中一个实施例中,第一标志位可为E,第二标志位可为S,但不限于此,例如,第一标志位为1,第二标志位为0等。服务器确定了生产库中进行处理的各个数据的数据处理状态后,可获取数据处理状态为未处理完成的数据的数据标识,该数据处理状态为未处理完成的数据即为生产库中缺失的数据。
步骤S330,在开发库中根据数据标识生成补录数据。
服务器可根据生产库标识查询对应的开发库标识,通过与该开发库标识匹配的开发库,从与生产库对应的测试库中获取与生产库中未处理完成的数据标识对应的数据,并放入该开发库中,在与生产库对应的开发库中生成补录数据。
步骤S340,将补录数据从开发库拷贝至生产库,并通过生产库处理补录数据。
服务器可将开发库中生成的补录数据从开发库拷贝至生产库中,并通过生产库对补录数据进行处理,实现数据补录。
为了更清楚明白地说明上述数据补录方法,举个例子对上述数据补录方法进行说明。 数据管理员通过终端向服务器上传了向100位客户发送短信的数据处理任务,数据处理任务中包括生产库标识DB、客户编号为num_1~num_100,处理方式为将客户信息发送至短信发送平台发送短信,起始时间为12:00,结束时间为13:00。服务器根据该数据处理任务,可从与生产库DB对应的测试库DB_1获取客户编号为num_1~num_100的客户信息,并将客户信息放入生产库DB中。当到达12:00,服务器在生产库DB中对客户信息进行处理,将客户编号为num_1~num_100的客户信息投放至短信发送平台,当服务器接收到短信发送平台返回的短信发送成功的响应信息时,可根据响应信息中的客户编号将对应的客户信息的数据处理状态更改为处理完成。当到达13:00时,服务器可从生产库DB中获取数据处理状态为未处理完成的客户编号,在本实施例中,未处理完成的客户编号为num90~num_100。服务器可通过与生产库DB对应的开发库DB-1,从测试库DB_1获取客户编号为num90~num_100的客户信息,并将客户编号为num90~num_100的客户信息放入开发库DB-1中,在开发库DB-1中生成需要补录的客户编号为num90~num_100的客户信息。服务器可将在开发库DB-1中生成的客户信息拷贝至生产库DB中,并通过生产库DB将客户编号为num90~num_100的客户信息重新投放至短信发送平台进行处理。
上述数据补录方法,当到达预设时间节点时,获取生产库的数据处理状态,根据数据处理状态获取生产库中未处理完成的数据标识,在开发库中根据数据标识生成补录数据,并将补录数据从开发库拷贝至生产库,通过生产库处理补录数据,在开发库中生成补录数据再拷贝至生产库中,可以降低生产库补录数据的风险,并提高数据补录的效率。
如图4所示,在其中一个实施例中,步骤S310当到达预设时间节点时,获取生产库的数据处理状态,包括以下步骤:
步骤S402,当到达预设时间节点时,获取生产库中与预设时间节点匹配的线程标识。
当服务器按照数据处理任务在生产库中进行数据处理时,可通过预先建立的一个或多个线程对数据进行处理,服务器可获取生产库中与预设时间节点匹配的线程标识,也即,可获取在起始时间至结束时间之间生产库中进行数据处理的线程标识,线程标识可由数字、字母及符号等中的一种或多种组成。
步骤S404,根据线程标识分别查找进行数据处理的各个线程的数据处理记录表。
生产库中与预设时间节点匹配的各个线程可分别对不同的数据进行处理,并分别将需 要进行处理的数据写入对应的数据处理记录表中。在数据处理记录表中,一个数据可对应一条数据处理记录,数据处理记录中可包含数据标识、用于表示数据处理状态的标志位、处理时间等,处理时间指的是线程开始处理数据至数据处理完成的时间间隔。
步骤S406,对数据处理记录表中存储的各条数据处理记录进行扫描,并获取各条数据处理记录中的数据处理状态。
服务器可根据生产库中与预设时间匹配的线程标识,获取各个线程对应的数据处理记录表,并分别一一对各个数据处理记录表中的各条数据处理记录进行扫描,获取各条数据处理记录中的标志位,根据标志位确定各条数据处理记录的数据处理状态。
如图5所示,在其中一个实施例中,步骤S320根据数据处理状态获取生产库中未处理完成的数据标识,包括以下步骤:
步骤S502,对各条数据处理记录中的标志位进行检测。
服务器可对与生产库中各个进行数据处理的线程对应的数据处理记录表进行扫描,对数据处理记录表中各条数据处理记录中的标志位进行检测,当标志位为第一标志位时,则可确定该数据处理记录的数据处理状态为处理完成,当标志位为第二标志位时,则可确定该数据处理记录的数据处理状态为未处理完成。
步骤S504,当数据处理记录中的标志位为预设标志位时,则获取标志位为预设标志位的数据处理记录中的数据标识。
在本实施例中,预设标志位可为第二标志位,当数据处理记录中的标志位为第二标志位时,则可确定该数据处理记录对应的数据的数据处理状态为未处理完成。服务器获取标志位为预设标志位的数据处理记录中的数据标识,即可获取生产库中未处理完成的数据标识。
在本实施例中,可在生产库中建立多个线程进行并行处理,加快数据处理速度,并根据线程对应的数据处理记录表中的各条数据处理记录,快速、准确地获取未处理完成的数据标识,可有效提高数据补录的效率。
如图6所示,在其中一个实施例中,上述数据补录方法,还包括以下步骤:
步骤S602,从与预设时间节点匹配的线程标识中获取包含未处理完成的数据标识的线程对应的线程标识。
服务器对生产库中与预设时间节点匹配的各个线程的数据处理记录表进行扫描,可对包含有未处理完成的数据标识的数据处理记录表进行标记,并获取与被标记的数据处理记录表对应的线程的线程标识。
步骤S604,根据对应的线程标识查询线程记录表,判断包含未处理完成的数据标识的线程是否包含补执行操作,当是时,则执行步骤S608,当否时,则执行步骤S606。
服务器根据与被标记的数据处理记录表对应的线程的线程标识,查询线程记录表,并判断包含未处理完成的数据的线程是否包含补执行操作。线程记录表中可存储有线程标识、线程创建时间、对应的生产库标识、处理的数据标识、创建者及是否补执行等,创建者指的是创建该线程的账户,补执行指的是到达预设时间节点时线程中包含有未处理完成的数据,则线程重新对未处理完成的数据进行处理。
步骤S606,在开发库中根据数据标识生成补录数据。
当通过线程记录表确定包含未处理完成的数据标识的线程具有补执行操作时,则服务器可暂时不作处理,并在设定时间,通过线程对未处理完成的数据进行处理,对该线程的数据处理记录表中,与标志位为第二标志位的数据处理记录对应的数据进行补执行操作。在其中一个实施例中,设定时间可为凌晨0点、凌晨1点等,或其它服务器较少接收到业务服务请求的时间点。
当包含未处理完成的数据标识的线程不具有补执行操作时,则服务器可通过开发库,根据该线程包含的未处理完成的数据标识从与生产库对应的测试库中获取数据,并放入开发库中,在开发库中生成补录数据,再将开发库中生成的补录数据拷贝至生产库中,由线程重新进行处理。
例如,生产库中与预设时间节点匹配的线程包括线程1、线程2、线程3及线程4,线程1及线程3中包含数据处理状态为未处理完成的数据标识。服务器查询线程记录表可确定线程1包含补执行操作,线程3不包含补执行操作,则可通过开发库,在与生产库对应的测试库中,根据线程3包含的未处理完成的数据标识获取数据,并将获取的数据放入开发库中,在开发库中生成补录数据,再将开发库中生成的补录数据拷贝至生产库中,由生产库中的线程3对补录数据进行处理。
步骤S608,暂时不作处理。
在本实施例中,当生产库的线程不包含补执行操作时,则在开发库中生成与该不包含补执行操作的线程对应的补录数据,当线程包含补执行操作时,则无需进行数据补录,可减少补录数据的数据量,降低生产库补录数据的风险,并提高数据补录的效率,同时可保证生产库的稳定性。
如图7所示,在其中一个实施例中,在步骤S320根据数据处理状态获取生产库中未处理完成的数据标识之后,还包括以下步骤:
步骤S702,根据未处理完成的数据标识构建数据生成脚本。
服务器获取生产库中数据处理状态为未处理完成的数据的数据标识,可根据该数据标识构建数据生成脚本,数据生成脚本可为数据库可执行脚本,例如SQL(Structured Query Language,结构化查询语言)脚本等,数据生成脚本中可包含一条或多条SQL语句。
步骤S704,将数据生成脚本提交至生产库,以使生产库执行数据生成脚本以生成补录数据,并对补录数据进行处理。
服务器可将根据未处理完成的数据标识构建的数据生成脚本提交至生产库,并通过SVN(Subversion)执行数据生成脚本,SVN是一种开源式的版本管理系统。服务器在生产库中通过SVN执行数据生成脚本,与生产库对应的测试库建立连接,并根据数据生成脚本中的SQL语句从测试库中获取与未处理完成的数据标识对应的数据,在生产库中生成补录数据,并通过生产库对生成的补录数据进行处理。
在本实施例中,可根据未处理完成的数据标识构建数据生成脚本,由生产库直接执行数据生成脚本生成补录数据,可以降低生产库补录数据的风险,并提高数据补录的效率。
应该理解的是,虽然图3-7的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图3-7中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行
如图8所示,在其中一个实施例中,提供一种数据补录装置800,包括状态获取模块 810、数据标识获取模块820、生成模块830及拷贝模块840。
状态获取模块810,用于当到达预设时间节点时,获取生产库的数据处理状态。
数据标识获取模块820,用于根据数据处理状态获取生产库中未处理完成的数据标识。
生成模块830,用于在开发库中根据数据标识生成补录数据。
拷贝模块840,用于将补录数据从开发库拷贝至所述生产库,并通过所述生产库处理所述补录数据。
上述数据补录方法,当到达预设时间节点时,获取生产库的数据处理状态,根据数据处理状态获取生产库中未处理完成的数据标识,在开发库中根据数据标识生成补录数据,并将补录数据从开发库拷贝至生产库,通过生产库处理补录数据,在开发库中生成补录数据再拷贝至生产库中,可以降低生产库补录数据的风险,并提高数据补录的效率。
如图9所示,在其中一个实施例中,状态获取模块810包括线程标识获取单元812、查找单元814及扫描单元816。
线程标识获取单元812,用于当到达预设时间节点时,获取生产库中与预设时间节点匹配的线程标识。
查找单元814,用于根据线程标识分别查找进行数据处理的各个线程的数据处理记录表。
扫描单元816,用于对数据处理记录表中存储的各条数据处理记录进行扫描,并获取各条数据处理记录中的数据处理状态。
如图10所示,在其中一个实施例中,数据标识获取模块820包括检测单元822及数据标识获取单元824。
检测单元822,用于对各条数据处理记录中的标志位进行检测。
数据标识获取单元824,用于当数据处理记录的标志位为预设标志位时,则获取标志位为预设标志位的数据处理记录中的数据标识。
在本实施例中,可在生产库中建立多个线程进行并行处理,加快数据处理速度,并根据线程对应的数据处理记录表中的各条数据处理记录,快速、准确地获取未处理完成的数据标识,可有效提高数据补录的效率。
如图11所示,在其中一个实施例中,上述数据补录装置800,除了包括状态获取模块 810、数据标识获取模块820、生成模块830及拷贝模块840,还包括线程标识获取模块850及判断模块860。
线程标识获取模块850,用于从与所述预设时间节点匹配的线程标识中获取包含未处理完成的数据标识的线程对应的线程标识。
判断模块860,用于根据对应的线程标识查询线程记录表,判断包含未处理完成的数据标识的线程是否包含补执行操作。
生成模块830,还用于当包含未处理完成的数据标识的线程不包含补执行操作时,则在开发库中根据数据标识生成补录数据。
在本实施例中,当生产库的线程不包含补执行操作时,则在开发库中生成与该不包含补执行操作的线程对应的补录数据,当线程包含补执行操作时,则无需进行数据补录,可减少补录数据的数据量,降低生产库补录数据的风险,并提高数据补录的效率,同时可保证生产库的稳定性。
如图12所示,在其中一个实施例中,上述数据补录装置800,除了包括状态获取模块810、数据标识获取模块820、生成模块830、拷贝模块840、线程标识获取模块850及判断模块860,还包括构建模块870及提交模块880。
构建模块870,用于根据未处理完成的数据标识构建数据生成脚本。
提交模块880,用于将数据生成脚本提交至生产库,以使生产库执行数据生成脚本以生成补录数据,并对补录数据进行处理。
在本实施例中,可根据未处理完成的数据标识构建数据生成脚本,由生产库直接执行数据生成脚本生成补录数据,可以降低生产库补录数据的风险,并提高数据补录的效率。
关于数据补录装置的具体限定可以参见上文中对于数据补录方法的限定,在此不再赘述。上述数据补录装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于服务器中的处理器中,也可以以软件形式存储于服务器中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
一种计算机设备,包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的回归测试方法的步骤。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的回归测试方法的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(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)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种数据补录方法,包括:
    当到达预设时间节点时,获取生产库的数据处理状态;
    根据所述数据处理状态获取所述生产库中未处理完成的数据标识;
    在开发库中根据所述数据标识生成补录数据;及
    将所述补录数据从所述开发库拷贝至所述生产库,并通过所述生产库处理所述补录数据。
  2. 根据权利要求1所述的方法,其特征在于,所述当到达预设时间节点时,获取生产库的数据处理状态,包括:
    当到达预设时间节点时,获取生产库中与所述预设时间节点匹配的线程标识;
    根据所述线程标识分别查找进行数据处理的各个线程的数据处理记录表;及
    对所述数据处理记录表中存储的各条数据处理记录进行扫描,并获取所述各条数据处理记录中的数据处理状态。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述数据处理状态获取所述生产库中未处理完成的数据标识,包括:
    对所述各条数据处理记录中的标志位进行检测;及
    当数据处理记录的标志位为预设标志位时,则获取标志位为预设标志位的数据处理记录中的数据标识。
  4. 根据权利要求2或3所述的方法,其特征在于,在所述在开发库中根据所述数据标识生成补录数据之前,所述方法还包括:
    从与所述预设时间节点匹配的线程标识中获取包含所述未处理完成的数据标识的线程对应的线程标识;
    根据所述对应的线程标识查询线程记录表,判断所述包含未处理完成的数据标识的线程是否包含补执行操作;及
    当不包含时,则执行所述在开发库中根据所述数据标识生成补录数据的步骤。
  5. 根据权利要求1所述的方法,其特征在于,在所述根据所述数据处理状态获取所述生产库中未处理完成的数据标识之后,所述方法还包括:
    根据所述未处理完成的数据标识构建数据生成脚本;及
    将所述数据生成脚本提交至所述生产库,以使所述生产库执行所述数据生成脚本以生成补录数据,并对所述补录数据进行处理。
  6. 一种数据补录装置,包括:
    状态获取模块,用于当到达预设时间节点时,获取生产库的数据处理状态;
    数据标识获取模块,用于根据所述数据处理状态获取所述生产库中未处理完成的数据标识;
    生成模块,用于在开发库中根据所述数据标识生成补录数据;及
    拷贝模块,用于将所述补录数据从所述开发库拷贝至所述生产库,并通过所述生产库处理所述补录数据。
  7. 根据权利要求6所述的装置,其特征在于,所述状态获取模块,包括:
    线程标识获取单元,用于当到达预设时间节点时,获取生产库中与所述预设时间节点匹配的线程标识;
    查找单元,用于根据所述线程标识分别查找进行数据处理的各个线程的数据处理记录表;及
    扫描单元,用于对所述数据处理记录表中存储的各条数据处理记录进行扫描,并获取所述各条数据处理记录中的数据处理状态。
  8. 根据权利要求7所述的装置,其特征在于,所述数据标识获取模块,包括:
    检测单元,用于对所述各条数据处理记录中的标志位进行检测;及
    数据标识获取单元,用于当数据处理记录的标志位为预设标志位时,则获取标志位为预设标志位的数据处理记录中的数据标识。
  9. 根据权利要求7或8所述的装置,其特征在于,所述装置还包括:
    线程标识获取模块,用于从与所述预设时间节点匹配的线程标识中获取包含所述未处理完成的数据标识的线程对应的线程标识;
    判断模块,用于根据所述对应的线程标识查询线程记录表,判断所述包含未处理完成的数据标识的线程是否包含补执行操作;及
    所述生成模块,还用于当所述包含未处理完成的数据标识的线程不包含补执行操作 时,则在开发库中根据所述数据标识生成补录数据。
  10. 根据权利要求6所述的装置,其特征在于,所述装置还包括:
    构建模块,用于根据所述未处理完成的数据标识构建数据生成脚本;及
    提交模块,用于将所述数据生成脚本提交至所述生产库,以使所述生产库执行所述数据生成脚本以生成补录数据,并对所述补录数据进行处理。
  11. 一种服务器,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    当到达预设时间节点时,获取生产库的数据处理状态;
    根据所述数据处理状态获取所述生产库中未处理完成的数据标识;
    在开发库中根据所述数据标识生成补录数据;及
    将所述补录数据从所述开发库拷贝至所述生产库,并通过所述生产库处理所述补录数据。
  12. 根据权利要求11所述的服务器,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    当到达预设时间节点时,获取生产库中与所述预设时间节点匹配的线程标识;
    根据所述线程标识分别查找进行数据处理的各个线程的数据处理记录表;及
    对所述数据处理记录表中存储的各条数据处理记录进行扫描,并获取所述各条数据处理记录中的数据处理状态。
  13. 根据权利要求12所述的服务器,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    对所述各条数据处理记录中的标志位进行检测;及
    当数据处理记录的标志位为预设标志位时,则获取标志位为预设标志位的数据处理记录中的数据标识。
  14. 根据权利要求12或13所述的服务器,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    从与所述预设时间节点匹配的线程标识中获取包含所述未处理完成的数据标识的线 程对应的线程标识;
    根据所述对应的线程标识查询线程记录表,判断所述包含未处理完成的数据标识的线程是否包含补执行操作;及
    当不包含时,则执行所述在开发库中根据所述数据标识生成补录数据的步骤。
  15. 根据权利要求11所述的服务器,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    根据所述未处理完成的数据标识构建数据生成脚本;及
    将所述数据生成脚本提交至所述生产库,以使所述生产库执行所述数据生成脚本以生成补录数据,并对所述补录数据进行处理。
  16. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    当到达预设时间节点时,获取生产库的数据处理状态;
    根据所述数据处理状态获取所述生产库中未处理完成的数据标识;
    在开发库中根据所述数据标识生成补录数据;及
    将所述补录数据从所述开发库拷贝至所述生产库,并通过所述生产库处理所述补录数据。
  17. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    当到达预设时间节点时,获取生产库中与所述预设时间节点匹配的线程标识;
    根据所述线程标识分别查找进行数据处理的各个线程的数据处理记录表;及
    对所述数据处理记录表中存储的各条数据处理记录进行扫描,并获取所述各条数据处理记录中的数据处理状态。
  18. 根据权利要求17所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    对所述各条数据处理记录中的标志位进行检测;及
    当数据处理记录的标志位为预设标志位时,则获取标志位为预设标志位的数据处理记录中的数据标识。
  19. 根据权利要求17或18所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    从与所述预设时间节点匹配的线程标识中获取包含所述未处理完成的数据标识的线程对应的线程标识;
    根据所述对应的线程标识查询线程记录表,判断所述包含未处理完成的数据标识的线程是否包含补执行操作;及
    当不包含时,则执行所述在开发库中根据所述数据标识生成补录数据的步骤。
  20. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    根据所述未处理完成的数据标识构建数据生成脚本;及
    将所述数据生成脚本提交至所述生产库,以使所述生产库执行所述数据生成脚本以生成补录数据,并对所述补录数据进行处理。
PCT/CN2018/082421 2017-05-04 2018-04-10 数据补录方法、装置、服务器和存储介质 Ceased WO2018201859A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710309466.3 2017-05-04
CN201710309466.3A CN108255906B (zh) 2017-05-04 2017-05-04 数据补录方法及装置

Publications (1)

Publication Number Publication Date
WO2018201859A1 true WO2018201859A1 (zh) 2018-11-08

Family

ID=62721701

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/082421 Ceased WO2018201859A1 (zh) 2017-05-04 2018-04-10 数据补录方法、装置、服务器和存储介质

Country Status (2)

Country Link
CN (1) CN108255906B (zh)
WO (1) WO2018201859A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117390059A (zh) * 2023-10-16 2024-01-12 中国建设银行股份有限公司 一种头寸处理方法、装置、电子设备及计算机可读介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651466B (zh) * 2020-05-09 2023-07-25 杭州数梦工场科技有限公司 数据采样方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103294574A (zh) * 2013-06-25 2013-09-11 浙江宇视科技有限公司 一种快速实现业务存储切换的装置和方法
CN104021033A (zh) * 2014-06-23 2014-09-03 中国银行股份有限公司 一种繁忙处理节点的散列方法和系统
CN104156360A (zh) * 2013-05-13 2014-11-19 阿里巴巴集团控股有限公司 业务数据处理方法及系统
CN105975510A (zh) * 2016-04-28 2016-09-28 广东鹰视能效科技有限公司 一种基于智能仪表数据自动补录的方法及系统

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678726B (zh) * 2012-09-05 2017-11-10 亿阳信通股份有限公司 一种数据补采方法和数据补采系统
CN103853837B (zh) * 2014-03-17 2017-07-28 上海爱数信息技术股份有限公司 Oracle全自动不停生产数据库的表级备份恢复方法
KR101662212B1 (ko) * 2014-05-30 2016-10-04 주식회사 알티베이스 부분동기화 지원 데이터베이스 관리 시스템 및 데이터베이스 관리 시스템에서 부분동기화 방법
CN104239444B (zh) * 2014-09-01 2017-11-03 上海爱数信息技术股份有限公司 Oracle数据库用的一致性数据保护与捕获一致性状态的方法
CN104462568B (zh) * 2014-12-26 2018-07-31 山东中创软件商用中间件股份有限公司 一种数据对账方法、装置和系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156360A (zh) * 2013-05-13 2014-11-19 阿里巴巴集团控股有限公司 业务数据处理方法及系统
CN103294574A (zh) * 2013-06-25 2013-09-11 浙江宇视科技有限公司 一种快速实现业务存储切换的装置和方法
CN104021033A (zh) * 2014-06-23 2014-09-03 中国银行股份有限公司 一种繁忙处理节点的散列方法和系统
CN105975510A (zh) * 2016-04-28 2016-09-28 广东鹰视能效科技有限公司 一种基于智能仪表数据自动补录的方法及系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117390059A (zh) * 2023-10-16 2024-01-12 中国建设银行股份有限公司 一种头寸处理方法、装置、电子设备及计算机可读介质

Also Published As

Publication number Publication date
CN108255906A (zh) 2018-07-06
CN108255906B (zh) 2020-08-14

Similar Documents

Publication Publication Date Title
CN112148509A (zh) 数据处理方法、装置、服务器及计算机可读存储介质
CN110515795B (zh) 一种大数据组件的监控方法、装置、电子设备
WO2018161760A1 (zh) 区块链数据存储系统和方法
CN105205053A (zh) 一种数据库增量日志解析方法及系统
WO2019056494A1 (zh) 图表生成方法、装置、计算机设备和存储介质
CN106899654B (zh) 一种序列值生成方法、装置及系统
WO2018177205A1 (zh) 回归测试方法、装置、计算机设备和存储介质
WO2019037418A1 (zh) 代码管理方法、装置、计算机设备和计算机可读存储介质
US20130275369A1 (en) Data record collapse and split functionality
CA3191210C (en) DATA SYNCHRONIZATION METHOD AND DEVICE, COMPUTER EQUIPMENT AND STORAGE MEDIA
WO2019037414A1 (zh) 页面配置更新方法、装置、服务器和存储介质
WO2022041672A1 (zh) 分布式数据库系统的全量备份方法、装置及计算机可读存储介质
CN108573019B (zh) 一种数据迁移方法、装置、电子设备及可读存储介质
CN114416689A (zh) 数据迁移方法、装置、计算机设备、存储介质
WO2023045054A1 (zh) 结构化查询语句的生成方法、装置和计算机设备
WO2018006723A1 (zh) 一种针对数据库的数据修改请求处理方法及装置
CN112000678A (zh) 数据同步方法、装置、服务器及存储介质
WO2020124619A1 (zh) 数据处理方法、装置、计算机设备及存储介质
WO2018201859A1 (zh) 数据补录方法、装置、服务器和存储介质
CN112363944A (zh) 一种用于多环境接口返回值对比的方法及设备
CN115994189A (zh) 多环境数据库的结构同步方法、装置、设备及介质
CN113961522B (zh) 一种pcap数据包分割方法、装置、设备及存储介质
CN114064674A (zh) 数据同步方法、装置、计算机设备、存储介质和产品
CN110895531A (zh) 数据存储表的数据写入方法、分区服务器及电子设备
CN115756521B (zh) 云应用处理方法、装置、计算机设备、存储介质

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: 18794505

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: 18794505

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 18794505

Country of ref document: EP

Kind code of ref document: A1

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

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 13/03/2020)