WO2019019361A1 - Method and apparatus for processing data of database, computer device, and storage medium - Google Patents

Method and apparatus for processing data of database, computer device, and storage medium Download PDF

Info

Publication number
WO2019019361A1
WO2019019361A1 PCT/CN2017/104253 CN2017104253W WO2019019361A1 WO 2019019361 A1 WO2019019361 A1 WO 2019019361A1 CN 2017104253 W CN2017104253 W CN 2017104253W WO 2019019361 A1 WO2019019361 A1 WO 2019019361A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
task
processing
instruction
data processing
Prior art date
Application number
PCT/CN2017/104253
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 WO2019019361A1 publication Critical patent/WO2019019361A1/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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24561Intermediate data storage techniques for performance improvement

Definitions

  • the present application relates to the field of data processing technologies, and in particular, to a database data processing method, apparatus, computer device, and storage medium.
  • a database data processing method, apparatus, computer device, and storage medium are provided.
  • a database data processing method comprising:
  • a database data processing device comprising:
  • An instruction acquisition module configured to acquire a data processing task execution instruction
  • An identifier extraction module configured to extract a task identifier in the data processing task execution instruction
  • a script obtaining module configured to acquire a task script corresponding to the task identifier
  • a script parsing module configured to extract data processing instructions and data acquisition conditions in the task script
  • a data acquisition module configured to acquire target data from a database corresponding to each database type according to the data acquisition condition
  • a data table creating module configured to respectively create a temporary data table according to the target data corresponding to each database type
  • a data processing module configured to process the target data in the temporary data table according to the data processing instruction.
  • a computer device comprising a memory and a processor, wherein the memory stores computer executable instructions that, when executed by the processor, cause the processor to perform the following steps:
  • One or more storage media storing computer executable instructions that, when executed by one or more processors, cause the one or more processors to perform the following steps:
  • FIG. 1 is an application environment diagram of a database data processing method in an embodiment
  • FIG. 2 is a structural block diagram of a server in a database data processing system in an embodiment
  • FIG. 3 is a schematic flow chart of a database data processing method in an embodiment
  • FIG. 4 is a schematic flowchart of a step of reading a task identifier according to a task dependency relationship in an embodiment
  • FIG. 5 is a schematic flow chart of steps of obtaining a custom function in an embodiment
  • FIG. 6 is a flow chart showing the steps of storing a processing result in an embodiment
  • Figure 7 is a block diagram showing the structure of a database data processing apparatus in an embodiment
  • FIG. 8 is a structural block diagram of a data processing module in an embodiment
  • Figure 9 is a block diagram showing the structure of a database data processing apparatus in another embodiment.
  • FIG. 1 is an application environment diagram of a database data processing method.
  • the database data processing method is applied to a database data processing system.
  • the database data processing system includes a terminal 110 and a server 120, wherein the terminal 110 is connected to the server 120 via a network.
  • the terminal 110 may be a fixed terminal or a mobile terminal, and the fixed terminal may specifically be at least one of a printer, a scanner, and a monitor, and the mobile terminal may specifically be at least one of a tablet computer, a smart phone, a personal data assistant, and a digital camera. .
  • FIG. 2 is a schematic diagram showing the internal structure of the server 120 in the database data processing system of FIG. 1 in an embodiment.
  • the server 120 includes a processor, a non-volatile storage medium, an internal memory, and a network interface connected by a system bus.
  • the processor of server 120 is used to provide computing and control capabilities to support the operation of the entire server 120, the memory for storing data, code instructions, etc., and the network interface for network communication with terminal 110.
  • At least one computer executable instruction is stored on the memory, and the computer executable instructions are executable by the processor to implement the database data processing method applicable to the server 120 provided in the embodiment of the present application.
  • the memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, or a read-only memory (ROM).
  • the memory includes a non-volatile storage medium and an internal memory; the non-volatile storage medium stores a processing system, a database, and computer-executable instructions, and the database includes a plurality of databases corresponding to the plurality of database types respectively
  • the target data is stored in the database, and the computer executable instructions are executable by the processor to implement the database data processing method described above; the internal memory provides a cache operation for the processing system and the computer executable instructions in the non-volatile storage medium. surroundings.
  • FIG. 2 is only related to the solution of the present application.
  • the schematic diagram of the partial structure does not constitute a limitation on the server to which the solution of the present application is applied, and the specific server may include more or less components than those shown in FIG. 2, or combine some components, or have Different parts are arranged.
  • a database data processing method is provided. This embodiment is exemplified by the method applied to the server 120 in FIG. 1, and the method specifically includes the following content:
  • the terminal 110 acquires a user account input by the user, generates a page data acquisition request according to the obtained user account, and sends a page data acquisition request to the server 120.
  • the server 120 parses the page data acquisition request, and extracts the user account in the page data acquisition request by parsing.
  • the server 120 performs rights verification on the extracted user account, and returns the data processing page data to the terminal 110 according to the page data acquisition request when verifying that the extracted user account has access rights to access the data processing page.
  • the terminal 110 displays the data processing page according to the data processing page data.
  • the terminal 110 acquires a task identifier selected by the user in the displayed data processing page, and generates a data processing task execution instruction according to the selected task identifier.
  • the terminal 110 transmits a data processing task execution instruction to the server 120.
  • the server 120 receives the data processing task execution instruction sent by the terminal 110, parses the data processing task execution instruction, and extracts the task identifier in the task execution instruction by parsing.
  • the task ID is a unique identifier for the task.
  • the terminal 110 acquires a task identifier corresponding to the task identifier and the task identifier input by the user in the displayed data processing page, and sends the obtained task identifier and task script to the server 120.
  • the server 120 stores the received task identifier and the task script correspondingly.
  • a task script is a script that is executed when a data processing task is executed. After extracting the task identifier, the server 120 queries the task script corresponding to the extracted task identifier in the stored task script, and obtains the query result. Task script.
  • the server 120 parses the task script and extracts data processing instructions and data acquisition conditions from the task script through parsing.
  • the data processing instruction is an instruction for processing data.
  • the server 120 parses the task script, analyzes and identifies the data processing instruction, the data acquisition condition, and the operation resource configuration parameter in the task script, and configures the computing resource for the data processing instruction according to the computing resource configuration parameter.
  • server 120 may access databases corresponding to multiple database types.
  • the databases corresponding to the plurality of database types may be set on the server 120 or may be set on other servers.
  • the server 120 acquires the access data interface of the database corresponding to the various database types, and obtains the target data that meets the data acquisition condition from the corresponding database by accessing the data access interface.
  • the server 120 extracts the database identifier in the data acquisition condition, identifies the database type corresponding to the database identifier, acquires the database access interface of the database type, and obtains the data acquisition condition according to the database access interface from the database corresponding to the database identifier.
  • Target data the database identifier in the data acquisition condition.
  • the server 120 extracts the database type in the data acquisition condition, acquires the database access interface of the database type and the database corresponding to the query database type, and obtains the target data that meets the data acquisition condition from the queryed database according to the database access interface.
  • the server 120 after obtaining the target data corresponding to each database type, the server 120 separately creates a temporary data table in a preset format according to the target data corresponding to each database type, and obtains a temporary data table corresponding to each database type, and a temporary data table.
  • the target data is stored in it.
  • S312 specifically includes the following: acquiring a temporary table creation instruction corresponding to each database type; and respectively corresponding to the corresponding database type according to the temporary table creation instruction According to the creation of a temporary data table.
  • the server 120 acquires target data corresponding to each database type, acquires a temporary table creation instruction corresponding to each database type, and creates a data temporary table corresponding to each database type according to the temporary table creation instruction, and corresponding each database type.
  • the data format of the target data is converted into a data format that matches the temporary data table, and the target data after the data format conversion is stored in the corresponding temporary data table.
  • S314 Process the target data in the temporary data table according to the data processing instruction.
  • the server 120 creates the temporary data table corresponding to each database type
  • the data processing is performed on the target data in the temporary data table corresponding to each database type according to the data processing, and the target in each temporary data table is adopted. The processing of the data is processed.
  • the edited task script is acquired according to the data processing task execution instruction, the data processing task is parsed by the task script, and the data processing instruction and the data acquisition condition in the data processing task are extracted, and the data acquisition condition is corresponding to each database type according to the data acquisition condition.
  • Get target data in the database The temporary data table is respectively created according to the target data corresponding to each database type, and the temporary data table corresponding to each database type is established, and the target data in the temporary data table corresponding to each database type is processed according to the data processing instruction. It is not necessary to separately perform the separate operation on the target data corresponding to each database type, which improves the processing efficiency of the data corresponding to each database type.
  • S306 specifically includes the step of reading the task identifier according to the task dependency, and the step specifically includes the following content:
  • the data processing task execution instruction includes a plurality of task identifiers and task dependencies corresponding to the plurality of task identifiers.
  • the server 120 parses the data processing task execution instruction, extracts the task dependency relationship and the task identifier in the data processing task execution instruction, and reads the task identifier according to the task dependency relationship.
  • the task identification in the data processing task execution instructions is a task flow identifier arranged in accordance with a task dependency.
  • the server 120 reads the task identification from the task flow identifier based on the task dependency.
  • the task flow identifier in the data processing task execution instruction is “1, 2
  • ",” indicates that the task has a dependency, first execute the task corresponding to the task ID before ",” and then execute the task corresponding to the task identifier after ",”;
  • " indicates that the task identifier before and after the "
  • 4, 5" is to execute task 1 first, and after task 1 is executed, perform task 2, task 3, and task 4 in parallel, and parallel in task 2, task 3, and task 4. After the execution is completed, perform task 5.
  • the server 120 after the server 120 reads the task identifier from the task execution instruction according to the task dependency, the server 120 queries the task script corresponding to the task identifier in the stored task script to obtain the queried task script.
  • the data processing task execution instruction includes a plurality of task identifiers and a task dependency relationship corresponding to the plurality of task identifiers, and the task identifier is read according to the task dependency relationship, and the task script is obtained according to the read task identifier.
  • the task corresponding to each task identifier is executed according to the task dependency relationship, the operation steps of executing the task are simplified, the task execution efficiency is improved, and multiple data processing tasks can be executed according to a data processing task execution instruction, thereby improving data processing efficiency.
  • S314 specifically includes the step of acquiring a custom function, and the step specifically includes the following:
  • server 120 parses the data processing instructions by parsing the custom function identifiers in the data processing instructions.
  • the custom function identifier is a unique identifier of the user-defined function.
  • S504 Obtain a data processing function from the custom function library according to the custom function identifier.
  • the terminal 110 acquires a data processing function input by the user in the data processing page, and sends the acquired data processing function to the server 120.
  • the server 120 extracts the custom function identifier in the data processing function, and stores the received data processing function and the extracted custom function identifier in the custom function library.
  • Server After extracting the custom function identifier from the data processing instruction, querying the data processing function in the custom function library according to the extracted custom function identifier, and obtaining the data processing function of the query.
  • S506 Process the target data in the temporary data table according to the acquired data processing function.
  • the server 120 processes the target data in the temporary data table according to the acquired data processing function, and processes the target data according to the data processing function to obtain a processing result.
  • the server 120 can transmit the obtained processing result to the terminal 110 to cause the terminal 110 to display in the data processing page.
  • the target data in the temporary data table of each database type can be processed according to the user-defined data processing function, so that the processing of the target data is more flexible, and the accuracy and efficiency of the data processing are improved.
  • the step S314 further includes a step of storing a processing result, where the step further includes the following content:
  • the terminal 110 displays the processing result obtained by the server 120 in the data processing page, and when detecting that the result saving button in the data processing page is clicked, triggers the processing result storage instruction, and sends the triggered processing result storage instruction. To the server 120.
  • the server 120 receives the processing result storage instruction transmitted by the terminal 110.
  • the server 120 can detect if the data processing process is complete, and upon detecting the end of the data processing process, trigger the processing result storage instruction.
  • the server 120 parses the processing result storage instructions by parsing the database types in the processing result storage instructions.
  • the extracted database type is the database type corresponding to the database in which the result is stored.
  • the server 120 obtains a processing result obtained by processing the target data, determines a data format that the extracted database type matches, and performs a data format conversion on the processing result. Convert the processing result to the data format that the extracted database type matches.
  • the server 120 queries the database corresponding to the extracted database type, extracts the data identifier of the processing result, and stores the extracted data identifier and the processing result in the queried database.
  • the server 120 extracts the database identifier in the processing result storage instruction, and identifies the database type to which the database corresponding to the extracted database identifier belongs.
  • the server 120 determines the data format corresponding to the identified database type, converts the data format of the processing result into a determined data format, and stores the processed result after the converted format into the database corresponding to the extracted database identifier.
  • the database type in the processing result storage instruction is extracted, the processing result is converted into a data format, the data format of the processing result is matched with the database type, and the processing result after the conversion format is stored to the processing.
  • the database corresponding to the database type in the result storage instruction the correctness of the data format of the processing result is ensured.
  • the user enters a user account and a user password through a browser page and a data processing application page.
  • the terminal 110 acquires the input user account and the user password, generates a page data request according to the obtained user account and the user password, and the terminal 110 sends the page data request to the server 120.
  • the server 120 After receiving the page data request, the server 120 extracts the user account and the user password in the page data request, and verifies whether the user corresponding to the user account has the access right according to the user account and the user password. The server 120 returns the data processing page data to the terminal 110 after verifying that the user corresponding to the user account has the access right.
  • the terminal 110 displays the data processing page based on the data processing page data.
  • the user selects the task identifier in the data processing page, and clicks the data task execution button through the input device of the terminal 110.
  • the terminal 110 When detecting that the data task execution button in the data processing page is clicked, the terminal 110 generates a data processing task execution instruction according to the selected task identifier and the task dependency relationship corresponding to the selected task identifier, The data processing task execution instructions are sent to the server 120.
  • the server 120 extracts the task identifier corresponding to the task identifier and the task identifier in the data processing task execution instruction, and splits the plurality of data processing tasks according to the task dependency relationship and the task identifier.
  • the server 120 extracts a task script according to the task identifiers in each data processing task, and extracts data processing instructions and data acquisition conditions in the task script.
  • the server 120 queries the target data from the database corresponding to each database type that can be accessed according to the data acquisition condition, and acquires the target data corresponding to each database type.
  • the server 120 acquires a temporary table creation instruction corresponding to each database type, creates a temporary data table corresponding to the database type according to the temporary table creation instruction, and stores the corresponding target data to the temporary data table corresponding to the database type.
  • the temporary data tables corresponding to each database type can be interacted with before.
  • the server 120 processes the target data in the temporary data table corresponding to each database type according to the data processing instruction to obtain a processing result.
  • the server 120 acquires at least one of a user account, a data processing time, a data processing type, a database type, and a data acquisition condition registered by the terminal 110, according to the obtained user account, data processing time, data processing type, database type, and data acquisition. At least one of the conditions generates a data processing log.
  • a database data processing apparatus 700 is provided.
  • the apparatus specifically includes the following: an instruction acquisition module 702, an identifier extraction module 704, a script acquisition module 706, a script parsing module 708, and data acquisition.
  • the instruction acquisition module 702 is configured to acquire a data processing task execution instruction.
  • the identifier extraction module 704 is configured to extract a task identifier in the data processing task execution instruction.
  • the script obtaining module 706 is configured to obtain a task script corresponding to the task identifier.
  • the script parsing module 708 is configured to extract data processing instructions and data acquisition conditions in the task script.
  • the data obtaining module 710 is configured to use data corresponding to each database type according to the data acquisition condition. Get target data in the library.
  • the data table creating module 712 is configured to separately create a temporary data table according to the target data corresponding to each database type.
  • the data processing module 714 is configured to process the target data in the temporary data table according to the data processing instruction.
  • the data table creation module 712 is further configured to acquire a temporary table creation instruction corresponding to each database type; and create a temporary data table for the target data corresponding to the corresponding database type according to the temporary table creation instruction.
  • the edited task script is acquired according to the data processing task execution instruction, the data processing task is parsed by the task script, and the data processing instruction and the data acquisition condition in the data processing task are extracted, and the data acquisition condition is corresponding to each database type according to the data acquisition condition.
  • Get target data in the database The temporary data table is respectively created according to the target data corresponding to each database type, and the temporary data table corresponding to each database type is established, and the target data in the temporary data table corresponding to each database type is processed according to the data processing instruction. It is not necessary to separately perform the separate operation on the target data corresponding to each database type, which improves the processing efficiency of the data corresponding to each database type.
  • the script obtaining module 706 is further configured to: read each task identifier according to the task dependency in the data processing task execution instruction; and acquire a task script corresponding to the read task identifier.
  • the data processing task execution instruction includes a plurality of task identifiers and a task dependency relationship corresponding to the plurality of task identifiers, and the task identifier is read according to the task dependency relationship, and the task script is obtained according to the read task identifier.
  • the task corresponding to each task identifier is executed according to the task dependency relationship, the operation steps of executing the task are simplified, the task execution efficiency is improved, and multiple data processing tasks can be executed according to a data processing task execution instruction, thereby improving data processing efficiency.
  • the data processing module 714 specifically includes the following: a function identifier extraction module 714a, a processing function acquisition module 714b, and a processing result obtaining module 714c.
  • the function identifier extraction module 714a is configured to extract a custom function identifier in the data processing instruction.
  • the processing function obtaining module 714b is configured to obtain the custom function library according to the custom function identifier Take the data processing function.
  • the processing result obtaining module 714c is configured to process the target data in the temporary data table according to the acquired data processing function.
  • the target data in the temporary data table of each database type can be processed according to the user-defined data processing function, so that the processing of the target data is more flexible, and the accuracy and efficiency of the data processing are improved.
  • the database data processing apparatus 700 specifically includes the following: an instruction acquisition module 716, a type extraction module 718, a format conversion module 720, and a data storage module 722.
  • the instruction acquisition module 716 is configured to acquire a processing result storage instruction.
  • the type extraction module 718 is configured to extract a database type in the processing result storage instruction.
  • the format conversion module 720 is configured to convert the processing result obtained by processing the target data into a data format that matches the extracted database type.
  • the data storage module 722 is configured to store the processed result after the conversion format to a database corresponding to the extracted database type.
  • the database type in the processing result storage instruction is extracted, the processing result is converted into a data format, the data format of the processing result is matched with the database type, and the processing result after the conversion format is stored to the processing.
  • the database corresponding to the database type in the result storage instruction the correctness of the data format of the processing result is ensured.
  • the various modules in the database data processing apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof.
  • the network interface may be an Ethernet or a wireless network card.
  • Each of the above modules may be embedded in a hardware form or independent of a processor in the server, or may be stored in a memory of the server in a software form, so that the processor calls to perform operations corresponding to the above modules.
  • the processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
  • a computer device comprising a memory and a processor, wherein the memory stores computer executable instructions that, when executed by the processor, cause the processor Performing the following steps: acquiring a data processing task execution instruction; extracting a task identifier in the data processing task execution instruction; acquiring a task script corresponding to the task identifier; extracting a data processing instruction and a data acquisition condition in the task script; and obtaining data from each database according to the data acquisition condition
  • the target data is obtained in the database corresponding to the type; the temporary data table is separately created according to the target data corresponding to each database type; and the target data in the temporary data table is processed according to the data processing instruction.
  • the task script corresponding to the task identifier is obtained, including: reading each task identifier according to the task dependency relationship in the data processing task execution instruction; and acquiring a task script corresponding to the read task identifier.
  • the temporary data table is separately created according to the target data corresponding to each database type, including: obtaining a temporary table creation instruction corresponding to each database type; and temporarily creating a temporary data corresponding to the corresponding database type according to the temporary table creation instruction. data sheet.
  • processing the target data in the temporary data table according to the data processing instruction comprises: extracting a custom function identifier in the data processing instruction; and acquiring a data processing function from the custom function library according to the custom function identifier; The target data in the temporary data table is processed according to the obtained data processing function.
  • the processor after processing the target data in the temporary data table according to the data processing instruction, the processor further performs the steps of: acquiring a processing result storage instruction; extracting a database type in the processing result storage instruction; performing the target data
  • the processed processing result is converted into a data format that matches the extracted database type; the processed result after the converted format is stored in the database corresponding to the extracted database type.
  • the edited task script is acquired according to the data processing task execution instruction, the data processing task is parsed by the task script, and the data processing instruction and the data acquisition condition in the data processing task are extracted, and the data acquisition condition is corresponding to each database type according to the data acquisition condition.
  • Get target data in the database The temporary data table is respectively created according to the target data corresponding to each database type, and the temporary data table corresponding to each database type is established, and the target data in the temporary data table corresponding to each database type is processed according to the data processing instruction. It is not necessary to separately perform the separate operation on the target data corresponding to each database type, which improves the processing efficiency of the data corresponding to each database type.
  • One or more storage media storing computer executable instructions that, when executed by one or more processors, cause one or more processors to perform the steps of: acquiring data processing task execution instructions; extracting data processing tasks Executing the task identifier in the instruction; acquiring the task script corresponding to the task identifier; extracting the data processing instruction and the data acquisition condition in the task script; acquiring the target data from the database corresponding to each database type according to the data acquisition condition; corresponding to each database type The target data respectively creates a temporary data table; the target data in the temporary data table is processed according to the data processing instruction.
  • the task script corresponding to the task identifier is obtained, including: reading each task identifier according to the task dependency relationship in the data processing task execution instruction; and acquiring a task script corresponding to the read task identifier.
  • the temporary data table is separately created according to the target data corresponding to each database type, including: obtaining a temporary table creation instruction corresponding to each database type; and temporarily creating a temporary data corresponding to the corresponding database type according to the temporary table creation instruction. data sheet.
  • processing the target data in the temporary data table according to the data processing instruction comprises: extracting a custom function identifier in the data processing instruction; and acquiring a data processing function from the custom function library according to the custom function identifier; The target data in the temporary data table is processed according to the obtained data processing function.
  • the processor after processing the target data in the temporary data table according to the data processing instruction, the processor further performs the steps of: acquiring a processing result storage instruction; extracting a database type in the processing result storage instruction; performing the target data
  • the processed processing result is converted into a data format that matches the extracted database type; the processed result after the converted format is stored in the database corresponding to the extracted database type.
  • the edited task script is acquired according to the data processing task execution instruction, the data processing task is parsed by the task script, and the data processing instruction and the data acquisition condition in the data processing task are extracted, and the data acquisition condition is corresponding to each database type according to the data acquisition condition.
  • Get target data in the database Create a temporary data table according to the target data corresponding to each database type, and establish each database by The temporary data table corresponding to the type is processed by the target data in the temporary data table corresponding to each database type according to the data processing instruction. It is not necessary to separately perform the separate operation on the target data corresponding to each database type, which improves the processing efficiency of the data corresponding to each database type.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or the like.

Landscapes

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

Abstract

A method for processing data of a database. The method comprises: acquiring a data processing task execution instruction (S302); extracting a task identifier in the data processing task execution instruction (S304); acquiring a task script corresponding to the task identifier (S306); extracting a data processing instruction and a data acquiring condition in the task script (S308); acquiring target data from a database corresponding to each database type according to the data acquiring condition (S310); separately creating a temporary data table according to the target data corresponding to each database type (S312); and processing the target data in the temporary data table according to the data processing instruction (S314).

Description

数据库数据处理方法、装置、计算机设备和存储介质Database data processing method, device, computer device and storage medium
本申请要求于2017年7月24日提交中国专利局、申请号为2017106085238、发明名称为“数据库数据处理方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on July 24, 2017, the Chinese Patent Application No. 2017106085238, entitled "Database Data Processing Method, Apparatus, Computer Equipment, and Storage Media", the entire contents of which are incorporated by reference. Combined in this application.
技术领域Technical field
本申请涉及数据处理技术领域,特别是涉及一种数据库数据处理方法、装置、计算机设备和存储介质。The present application relates to the field of data processing technologies, and in particular, to a database data processing method, apparatus, computer device, and storage medium.
背景技术Background technique
随时计算机技术的发展,大量的数据都需要用计算机来处理。随着数据处理需求的不断增长,计算机的数据处理能力也在不断提升。At any time, the development of computer technology requires a large amount of data to be processed by computers. As data processing needs continue to grow, so does the data processing power of computers.
在数据的存储过程中,根据业务需求会将数据存储在不同数据库类型的数据库中。传统的数据处理技术,只能对单个数据库类型的数据库中的数据进行处理。当涉及到多个数据库类型的数据时,使得数据处理效率较低。In the process of storing data, data is stored in databases of different database types according to business needs. Traditional data processing techniques can only process data in a database of a single database type. When it comes to data of multiple database types, the data processing efficiency is low.
发明内容Summary of the invention
根据本申请的各种实施例,提供一种数据库数据处理方法、装置、计算机设备和存储介质。According to various embodiments of the present application, a database data processing method, apparatus, computer device, and storage medium are provided.
一种数据库数据处理方法,包括:A database data processing method, comprising:
获取数据处理任务执行指令;Obtaining a data processing task execution instruction;
提取所述数据处理任务执行指令中的任务标识;Extracting a task identifier in the data processing task execution instruction;
获取所述任务标识对应的任务脚本;Obtaining a task script corresponding to the task identifier;
提取所述任务脚本中的数据处理指令和数据获取条件;Extracting data processing instructions and data acquisition conditions in the task script;
根据所述数据获取条件从各数据库类型对应的数据库中获取目标数据; Obtaining target data from a database corresponding to each database type according to the data acquisition condition;
根据所述各数据库类型对应的目标数据分别创建临时数据表;及Creating a temporary data table according to the target data corresponding to each database type; and
根据所述数据处理指令对所述临时数据表中的目标数据进行处理。Processing target data in the temporary data table according to the data processing instruction.
一种数据库数据处理装置,包括:A database data processing device comprising:
指令获取模块,用于获取数据处理任务执行指令;An instruction acquisition module, configured to acquire a data processing task execution instruction;
标识提取模块,用于提取所述数据处理任务执行指令中的任务标识;An identifier extraction module, configured to extract a task identifier in the data processing task execution instruction;
脚本获取模块,用于获取所述任务标识对应的任务脚本;a script obtaining module, configured to acquire a task script corresponding to the task identifier;
脚本解析模块,用于提取所述任务脚本中的数据处理指令和数据获取条件;a script parsing module, configured to extract data processing instructions and data acquisition conditions in the task script;
数据获取模块,用于根据所述数据获取条件从各数据库类型对应的数据库中获取目标数据;a data acquisition module, configured to acquire target data from a database corresponding to each database type according to the data acquisition condition;
数据表创建模块,用于根据所述各数据库类型对应的目标数据分别创建临时数据表;及a data table creating module, configured to respectively create a temporary data table according to the target data corresponding to each database type; and
数据处理模块,用于根据所述数据处理指令对所述临时数据表中的目标数据进行处理。And a data processing module, configured to process the target data in the temporary data table according to the data processing instruction.
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可执行指令,所述计算机可执行指令被所述处理器执行时,可使得所述处理器执行以下步骤:A computer device comprising a memory and a processor, wherein the memory stores computer executable instructions that, when executed by the processor, cause the processor to perform the following steps:
获取数据处理任务执行指令;Obtaining a data processing task execution instruction;
提取所述数据处理任务执行指令中的任务标识;Extracting a task identifier in the data processing task execution instruction;
获取所述任务标识对应的任务脚本;Obtaining a task script corresponding to the task identifier;
提取所述任务脚本中的数据处理指令和数据获取条件;Extracting data processing instructions and data acquisition conditions in the task script;
根据所述数据获取条件从各数据库类型对应的数据库中获取目标数据;Obtaining target data from a database corresponding to each database type according to the data acquisition condition;
根据所述各数据库类型对应的目标数据分别创建临时数据表;及Creating a temporary data table according to the target data corresponding to each database type; and
根据所述数据处理指令对所述临时数据表中的目标数据进行处理。 Processing target data in the temporary data table according to the data processing instruction.
一个或多个存储有计算机可执行指令的存储介质,所述计算机可执行指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more storage media storing computer executable instructions that, when executed by one or more processors, cause the one or more processors to perform the following steps:
获取数据处理任务执行指令;Obtaining a data processing task execution instruction;
提取所述数据处理任务执行指令中的任务标识;Extracting a task identifier in the data processing task execution instruction;
获取所述任务标识对应的任务脚本;Obtaining a task script corresponding to the task identifier;
提取所述任务脚本中的数据处理指令和数据获取条件;Extracting data processing instructions and data acquisition conditions in the task script;
根据所述数据获取条件从各数据库类型对应的数据库中获取目标数据;Obtaining target data from a database corresponding to each database type according to the data acquisition condition;
根据所述各数据库类型对应的目标数据分别创建临时数据表;及Creating a temporary data table according to the target data corresponding to each database type; and
根据所述数据处理指令对所述临时数据表中的目标数据进行处理。Processing target data in the temporary data table according to the data processing instruction.
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。Details of one or more embodiments of the present application are set forth in the accompanying drawings and description below. Other features, objects, and advantages of the invention will be apparent from the description and appended claims.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present application, and other drawings can be obtained according to the drawings without any creative work for those skilled in the art.
图1为一个实施例中数据库数据处理方法的应用环境图;1 is an application environment diagram of a database data processing method in an embodiment;
图2为一个实施例中数据库数据处理系统中的服务器的结构框图;2 is a structural block diagram of a server in a database data processing system in an embodiment;
图3为一个实施例中数据库数据处理方法的流程示意图;3 is a schematic flow chart of a database data processing method in an embodiment;
图4为一个实施例中根据任务依赖关系读取任务标识的步骤的流程示意图;4 is a schematic flowchart of a step of reading a task identifier according to a task dependency relationship in an embodiment;
图5为一个实施例中获取自定义函数的步骤的流程示意图;5 is a schematic flow chart of steps of obtaining a custom function in an embodiment;
图6为一个实施例中存储处理结果的步骤的流程示意图;6 is a flow chart showing the steps of storing a processing result in an embodiment;
图7为一个实施例中数据库数据处理装置的结构框图;Figure 7 is a block diagram showing the structure of a database data processing apparatus in an embodiment;
图8为一个实施例中数据处理模块的结构框图; 8 is a structural block diagram of a data processing module in an embodiment;
图9为另一个实施例中数据库数据处理装置的结构框图。Figure 9 is a block diagram showing the structure of a database data processing apparatus in another embodiment.
具体实施方式Detailed ways
体现本申请特征与优点的典型实施方式将在以下的说明中详细叙述。应理解的是本申请能够在不同的实施方式上具有各种的变化,其皆不脱离本申请的范围,且其中的说明及图示在本质上是当作说明之用,而非用以限制本申请。Exemplary embodiments embodying the features and advantages of the present application will be described in detail in the following description. It should be understood that the present invention is capable of various modifications in the various embodiments, and This application.
图1为一个数据库数据处理方法的应用环境图。参照图1,该数据库数据处理方法应用于数据库数据处理系统。数据库数据处理系统包括终端110和服务器120,其中终端110通过网络与服务器120连接。终端110可以是固定终端或移动终端,固定终端具体可以是打印机、扫描仪和监控器中的至少一种,移动终端具体可以是平板电脑、智能手机、个人数据助理和数码相机中的至少一种。Figure 1 is an application environment diagram of a database data processing method. Referring to Figure 1, the database data processing method is applied to a database data processing system. The database data processing system includes a terminal 110 and a server 120, wherein the terminal 110 is connected to the server 120 via a network. The terminal 110 may be a fixed terminal or a mobile terminal, and the fixed terminal may specifically be at least one of a printer, a scanner, and a monitor, and the mobile terminal may specifically be at least one of a tablet computer, a smart phone, a personal data assistant, and a digital camera. .
图2为一个实施例中图1数据库数据处理系统中的服务器120的内部结构示意图。如图2所示,该服务器120包括通过系统总线连接的处理器、非易失性存储介质、内存储器和网络接口。服务器120的处理器用于提供计算和控制能力,支撑整个服务器120的运行,存储器用于存储数据、代码指令等,网络接口用于与终端110进行网络通信。存储器上存储有至少一个计算机可执行指令,该计算机可执行指令可被处理器执行,以实现本申请实施例中提供的适用于服务器120的数据库数据处理方法。存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质。例如,在一个实施例中,存储器包括非易失性存储介质及内存储器;非易失性存储介质存储有处理系统、数据库和计算机可执行指令,数据库包括多个数据库类型分别对应的多个数据库,数据库中存储着目标数据,该计算机可执行指令可被处理器执行以实现上述的数据库数据处理方法;内存储器为非易失性存储介质中的处理系统及计算机可执行指令提供高速缓存的运行环境。FIG. 2 is a schematic diagram showing the internal structure of the server 120 in the database data processing system of FIG. 1 in an embodiment. As shown in FIG. 2, the server 120 includes a processor, a non-volatile storage medium, an internal memory, and a network interface connected by a system bus. The processor of server 120 is used to provide computing and control capabilities to support the operation of the entire server 120, the memory for storing data, code instructions, etc., and the network interface for network communication with terminal 110. At least one computer executable instruction is stored on the memory, and the computer executable instructions are executable by the processor to implement the database data processing method applicable to the server 120 provided in the embodiment of the present application. The memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, or a read-only memory (ROM). For example, in one embodiment, the memory includes a non-volatile storage medium and an internal memory; the non-volatile storage medium stores a processing system, a database, and computer-executable instructions, and the database includes a plurality of databases corresponding to the plurality of database types respectively The target data is stored in the database, and the computer executable instructions are executable by the processor to implement the database data processing method described above; the internal memory provides a cache operation for the processing system and the computer executable instructions in the non-volatile storage medium. surroundings.
本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相 关的部分结构的示意图,并不构成对本申请方案所应用于其上的服务器的限定,具体的服务器可以包括比图2中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 2 is only related to the solution of the present application. The schematic diagram of the partial structure does not constitute a limitation on the server to which the solution of the present application is applied, and the specific server may include more or less components than those shown in FIG. 2, or combine some components, or have Different parts are arranged.
如图3所示,在一个实施例中,提供一种数据库数据处理方法,本实施例以该方法应用于图1中的服务器120来举例说明,该方法具体包括以下内容:As shown in FIG. 3, in an embodiment, a database data processing method is provided. This embodiment is exemplified by the method applied to the server 120 in FIG. 1, and the method specifically includes the following content:
S302,获取数据处理任务执行指令。S302. Acquire a data processing task execution instruction.
在一个实施例中,终端110获取用户输入的用户账号,根据获取到的用户账号生成页面数据获取请求,将页面数据获取请求发送至服务器120。服务器120接收到终端110发送的页面数据获取请求后,对页面数据获取请求进行解析,通过解析提取页面数据获取请求中的用户账号。服务器120对提取到的用户账号进行权限验证,在验证提取到的用户账号具有访问数据处理页面的访问权限时,根据页面数据获取请求向终端110返回数据处理页面数据。终端110在接收到的数据处理页面数据后,根据数据处理页面数据显示数据处理页面。终端110获取用户在显示的数据处理页面中选取任务标识,根据选取的任务标识生成数据处理任务执行指令。终端110将数据处理任务执行指令发送至服务器120。In an embodiment, the terminal 110 acquires a user account input by the user, generates a page data acquisition request according to the obtained user account, and sends a page data acquisition request to the server 120. After receiving the page data acquisition request sent by the terminal 110, the server 120 parses the page data acquisition request, and extracts the user account in the page data acquisition request by parsing. The server 120 performs rights verification on the extracted user account, and returns the data processing page data to the terminal 110 according to the page data acquisition request when verifying that the extracted user account has access rights to access the data processing page. After receiving the data processing page data, the terminal 110 displays the data processing page according to the data processing page data. The terminal 110 acquires a task identifier selected by the user in the displayed data processing page, and generates a data processing task execution instruction according to the selected task identifier. The terminal 110 transmits a data processing task execution instruction to the server 120.
S304,提取数据处理任务执行指令中的任务标识。S304. Extract a task identifier in the data processing task execution instruction.
在一个实施例中,服务器120在接收到终端110发送的数据处理任务执行指令,对数据处理任务执行指令进行解析,通过解析提取任务执行指令中的任务标识。任务标识为任务的唯一标识。In one embodiment, the server 120 receives the data processing task execution instruction sent by the terminal 110, parses the data processing task execution instruction, and extracts the task identifier in the task execution instruction by parsing. The task ID is a unique identifier for the task.
S306,获取任务标识对应的任务脚本。S306. Obtain a task script corresponding to the task identifier.
在一个实施例中,终端110获取用户在显示的数据处理页面中输入的任务标识和任务标识对应的任务脚本,将获取到的任务标识和任务脚本发送至服务器120。服务器120将接收到的任务标识和任务脚本对应存储。任务脚本为执行数据处理任务时执行的脚本。服务器120在提取到任务标识后,在存储的任务脚本中查询与提取到的任务标识对应的任务脚本,获取查询到的 任务脚本。In one embodiment, the terminal 110 acquires a task identifier corresponding to the task identifier and the task identifier input by the user in the displayed data processing page, and sends the obtained task identifier and task script to the server 120. The server 120 stores the received task identifier and the task script correspondingly. A task script is a script that is executed when a data processing task is executed. After extracting the task identifier, the server 120 queries the task script corresponding to the extracted task identifier in the stored task script, and obtains the query result. Task script.
S308,提取任务脚本中的数据处理指令和数据获取条件。S308. Extract data processing instructions and data acquisition conditions in the task script.
在一个实施例中,服务器120在提取到任务脚本后,对任务脚本进行解析,通过解析从任务脚本中提取数据处理指令和数据获取条件。其中,数据处理指令为对数据进行处理的指令。In one embodiment, after extracting the task script, the server 120 parses the task script and extracts data processing instructions and data acquisition conditions from the task script through parsing. The data processing instruction is an instruction for processing data.
在一个实施例中,服务器120对任务脚本进行解析,通过解析识别任务脚本中的数据处理指令、数据获取条件和运算资源配置参数,根据运算资源配置参数为数据处理指令配置运算资源。In one embodiment, the server 120 parses the task script, analyzes and identifies the data processing instruction, the data acquisition condition, and the operation resource configuration parameter in the task script, and configures the computing resource for the data processing instruction according to the computing resource configuration parameter.
S310,根据数据获取条件从各数据库类型对应的数据库中获取目标数据。S310. Acquire target data from a database corresponding to each database type according to a data acquisition condition.
在一个实施例中,服务器120可以对多种数据库类型对应的数据库进行访问。其中,多种数据库类型对应的数据库可以设置在服务器120上,也可以设置在其他服务器上。服务器120获取各种数据库类型对应的数据库的访问数据接口,通过访问数据访问接口从相应的数据库中获取符合数据获取条件的目标数据。In one embodiment, server 120 may access databases corresponding to multiple database types. The databases corresponding to the plurality of database types may be set on the server 120 or may be set on other servers. The server 120 acquires the access data interface of the database corresponding to the various database types, and obtains the target data that meets the data acquisition condition from the corresponding database by accessing the data access interface.
在一个实施例中,服务器120提取数据获取条件中的数据库标识,识别数据库标识对应的数据库类型,获取数据库类型应的数据库访问接口,根据数据库访问接口从数据库标识对应的数据库中获取符合数据获取条件的目标数据。In an embodiment, the server 120 extracts the database identifier in the data acquisition condition, identifies the database type corresponding to the database identifier, acquires the database access interface of the database type, and obtains the data acquisition condition according to the database access interface from the database corresponding to the database identifier. Target data.
在一个实施例中,服务器120提取数据获取条件中的数据库类型,获取数据库类型的数据库访问接口和查询数据库类型对应的数据库,根据数据库访问接口从查询到的数据库中获取符合数据获取条件的目标数据。In an embodiment, the server 120 extracts the database type in the data acquisition condition, acquires the database access interface of the database type and the database corresponding to the query database type, and obtains the target data that meets the data acquisition condition from the queryed database according to the database access interface. .
S312,根据各数据库类型对应的目标数据分别创建临时数据表。S312. Create a temporary data table according to the target data corresponding to each database type.
在一个实施例中,服务器120获取到各数据库类型对应的目标数据后,根据各数据库类型对应的目标数据分别创建预设格式的临时数据表,得到各数据库类型对应的临时数据表,临时数据表中存储着目标数据。In an embodiment, after obtaining the target data corresponding to each database type, the server 120 separately creates a temporary data table in a preset format according to the target data corresponding to each database type, and obtains a temporary data table corresponding to each database type, and a temporary data table. The target data is stored in it.
在一个实施例中,S312具体包括以下内容:获取各数据库类型对应的临时表创建指令;根据临时表创建指令分别对相应的数据库类型对应的目标数 据创建临时数据表。In an embodiment, S312 specifically includes the following: acquiring a temporary table creation instruction corresponding to each database type; and respectively corresponding to the corresponding database type according to the temporary table creation instruction According to the creation of a temporary data table.
在一个实施例中,服务器120获取到各数据库类型对应的目标数据,分别获取各数据库类型对应的临时表创建指令,根据临时表创建指令创建各数据库类型对应的数据临时表,将各数据库类型对应的目标数据的数据格式转换为与临时数据表匹配的数据格式,将数据格式转换后的目标数据存储在相应的临时数据表中。In an embodiment, the server 120 acquires target data corresponding to each database type, acquires a temporary table creation instruction corresponding to each database type, and creates a data temporary table corresponding to each database type according to the temporary table creation instruction, and corresponding each database type. The data format of the target data is converted into a data format that matches the temporary data table, and the target data after the data format conversion is stored in the corresponding temporary data table.
S314,根据数据处理指令对临时数据表中的目标数据进行处理。S314: Process the target data in the temporary data table according to the data processing instruction.
在一个实施例中,服务器120创建了各数据库类型对应的临时数据表后,根据数据处理执行对各数据库类型对应的临时数据表中的目标数据进行数据处理,通过对各临时数据表中的目标数据的处理得到处理结果。In an embodiment, after the server 120 creates the temporary data table corresponding to each database type, the data processing is performed on the target data in the temporary data table corresponding to each database type according to the data processing, and the target in each temporary data table is adopted. The processing of the data is processed.
本实施例中,根据数据处理任务执行指令获取编辑的任务脚本,对任务脚本解析生成数据处理任务,提取数据处理任务中的数据处理指令和数据获取条件,根据数据获取条件从各数据库类型对应的数据库中获取目标数据。根据各数据库类型对应的目标数据分别创建临时数据表,通过建立各数据库类型对应的临时数据表,根据数据处理指令对各数据库类型对应的通过临时数据表中的目标数据进行处理。无需单独对每个数据库类型对应的目标数据进行单独操作,提高了各数据库类型对应的数据的处理效率。In this embodiment, the edited task script is acquired according to the data processing task execution instruction, the data processing task is parsed by the task script, and the data processing instruction and the data acquisition condition in the data processing task are extracted, and the data acquisition condition is corresponding to each database type according to the data acquisition condition. Get target data in the database. The temporary data table is respectively created according to the target data corresponding to each database type, and the temporary data table corresponding to each database type is established, and the target data in the temporary data table corresponding to each database type is processed according to the data processing instruction. It is not necessary to separately perform the separate operation on the target data corresponding to each database type, which improves the processing efficiency of the data corresponding to each database type.
如图4所示,在一个实施例中,S306具体还包括根据任务依赖关系读取任务标识的步骤,该步骤具体包括以下内容:As shown in FIG. 4, in an embodiment, S306 specifically includes the step of reading the task identifier according to the task dependency, and the step specifically includes the following content:
S402,根据数据处理任务执行指令中的任务依赖关系读取各任务标识。S402. Read each task identifier according to the task dependency in the data processing task execution instruction.
在一个实施例中,数据处理任务执行指令中包括多个任务标识和多个任务标识对应的任务依赖关系。服务器120对数据处理任务执行指令进行解析,通过解析提取数据处理任务执行指令中的任务依赖关系和任务标识,根据任务依赖关系读取任务标识。In an embodiment, the data processing task execution instruction includes a plurality of task identifiers and task dependencies corresponding to the plurality of task identifiers. The server 120 parses the data processing task execution instruction, extracts the task dependency relationship and the task identifier in the data processing task execution instruction, and reads the task identifier according to the task dependency relationship.
在一个实施例中,数据处理任务执行指令中任务标识是按照任务依赖关系排列的任务流标识。服务器120根据任务依赖关系从任务流标识中读取任务标识。 In one embodiment, the task identification in the data processing task execution instructions is a task flow identifier arranged in accordance with a task dependency. The server 120 reads the task identification from the task flow identifier based on the task dependency.
举例说明,数据处理任务执行指令中的任务流标识为“1,2|3|4,5”,任务流标识中包括任务1、任务2、任务3、任务4和任务5的任务标识。其中“,”表示任务有依赖,先执行“,”前的任务标识对应的任务,后执行“,”后的任务标识对应的任务;“|”表示可并行执行“|”前后的任务标识对应的任务。“1,2|3|4,5”的任务执行顺序为先执行任务1,在任务1执行完毕后,再并行执行任务2、任务3和任务4,在任务2、任务3和任务4并行执行完毕后,再执行任务5。For example, the task flow identifier in the data processing task execution instruction is “1, 2|3|4, 5”, and the task flow identifier includes the task identifiers of task 1, task 2, task 3, task 4, and task 5. Where "," indicates that the task has a dependency, first execute the task corresponding to the task ID before "," and then execute the task corresponding to the task identifier after ","; "|" indicates that the task identifier before and after the "|" can be executed in parallel. Task. The task execution order of "1, 2|3|4, 5" is to execute task 1 first, and after task 1 is executed, perform task 2, task 3, and task 4 in parallel, and parallel in task 2, task 3, and task 4. After the execution is completed, perform task 5.
S404,获取与读取到的任务标识对应的任务脚本。S404. Obtain a task script corresponding to the read task identifier.
在一个实施例中,服务器120在按照任务依赖关系从任务执行指令中读取到任务标识后,在存储的任务脚本中查询与任务标识对应的任务脚本,获取查询到的任务脚本。In an embodiment, after the server 120 reads the task identifier from the task execution instruction according to the task dependency, the server 120 queries the task script corresponding to the task identifier in the stored task script to obtain the queried task script.
本实施例中,数据处理任务执行指令包括多个任务标识和多个任务标识对应的任务依赖关系,根据任务依赖关系读取任务标识,根据读取到的任务标识获取任务脚本。保证根据任务依赖关系执行各任务标识对应的任务,简化了执行任务的操作步骤,提高了任务执行效率,根据一个数据处理任务执行指令即可执行多个数据处理任务,提高了数据处理效率。In this embodiment, the data processing task execution instruction includes a plurality of task identifiers and a task dependency relationship corresponding to the plurality of task identifiers, and the task identifier is read according to the task dependency relationship, and the task script is obtained according to the read task identifier. The task corresponding to each task identifier is executed according to the task dependency relationship, the operation steps of executing the task are simplified, the task execution efficiency is improved, and multiple data processing tasks can be executed according to a data processing task execution instruction, thereby improving data processing efficiency.
如图5所示,在一个实施例中,S314具体包括获取自定义函数的步骤,该步骤具体包括以下内容:As shown in FIG. 5, in an embodiment, S314 specifically includes the step of acquiring a custom function, and the step specifically includes the following:
S502,提取数据处理指令中的自定义函数标识。S502. Extract a custom function identifier in the data processing instruction.
在一个实施例中,服务器120对数据处理指令解析,通过解析提取数据处理指令中的自定义函数标识。其中,自定义函数标识为用户自定义的函数的唯一标识。In one embodiment, server 120 parses the data processing instructions by parsing the custom function identifiers in the data processing instructions. Among them, the custom function identifier is a unique identifier of the user-defined function.
S504,根据自定义函数标识从自定义函数库中获取数据处理函数。S504: Obtain a data processing function from the custom function library according to the custom function identifier.
在一个实施例中,终端110获取用户在数据处理页面中用户输入的数据处理函数,将获取到的数据处理函数发送至服务器120。服务器120在接收到数据处理函数后,提取数据处理函数中的自定义函数标识,将接收到的数据处理函数和提取到的自定义函数标识对应存储在自定义函数库中。服务器 120从数据处理指令中提取到自定义函数标识后,根据提取到的自定义函数标识在自定义函数库中查询数据处理函数,获取查询到的数据处理函数。In one embodiment, the terminal 110 acquires a data processing function input by the user in the data processing page, and sends the acquired data processing function to the server 120. After receiving the data processing function, the server 120 extracts the custom function identifier in the data processing function, and stores the received data processing function and the extracted custom function identifier in the custom function library. Server After extracting the custom function identifier from the data processing instruction, querying the data processing function in the custom function library according to the extracted custom function identifier, and obtaining the data processing function of the query.
S506,根据获取到的数据处理函数对临时数据表中的目标数据进行处理。S506: Process the target data in the temporary data table according to the acquired data processing function.
在一个实施例中,服务器120根据获取到的数据处理函数对临时数据表中的目标数据进行处理,根据数据处理函数对目标数据进行处理得到处理结果。服务器120可以将得到的处理结果发送至终端110,使终端110显示在数据处理页面中。In one embodiment, the server 120 processes the target data in the temporary data table according to the acquired data processing function, and processes the target data according to the data processing function to obtain a processing result. The server 120 can transmit the obtained processing result to the terminal 110 to cause the terminal 110 to display in the data processing page.
本实施例中,可根据用户自定义的数据处理函数对各数据库类型的临时数据表中的目标数据进行处理,使得对目标数据的处理更加灵活,提高了数据处理的准确性和高效性。In this embodiment, the target data in the temporary data table of each database type can be processed according to the user-defined data processing function, so that the processing of the target data is more flexible, and the accuracy and efficiency of the data processing are improved.
如图6所示,在一个实施例中,S314之后具体还包括存储处理结果的步骤,该步骤具体还包括以下内容:As shown in FIG. 6, in an embodiment, the step S314 further includes a step of storing a processing result, where the step further includes the following content:
S602,获取处理结果存储指令。S602. Acquire a processing result storage instruction.
在一个实施例中,终端110将服务器120得到的处理结果显示在数据处理页面中,检测到数据处理页面中的结果保存按钮被点击时,触发处理结果存储指令,将触发的处理结果存储指令发送至服务器120。服务器120接收终端110发送的处理结果存储指令。In one embodiment, the terminal 110 displays the processing result obtained by the server 120 in the data processing page, and when detecting that the result saving button in the data processing page is clicked, triggers the processing result storage instruction, and sends the triggered processing result storage instruction. To the server 120. The server 120 receives the processing result storage instruction transmitted by the terminal 110.
在一个实施例中,服务器120可以检测数据处理过程是否结束,在检测到数据处理过程结束时,触发处理结果存储指令。In one embodiment, the server 120 can detect if the data processing process is complete, and upon detecting the end of the data processing process, trigger the processing result storage instruction.
S604,提取处理结果存储指令中的数据库类型。S604. Extract the database type in the processing result storage instruction.
在一个实施例中,服务器120对处理结果存储指令进行解析,通过解析提取处理结果存储指令中的数据库类型。其中,提取到的数据库类型为处理结果存储的数据库所对应的数据库类型。In one embodiment, the server 120 parses the processing result storage instructions by parsing the database types in the processing result storage instructions. The extracted database type is the database type corresponding to the database in which the result is stored.
S606,将对目标数据进行处理得到的处理结果,转换为与提取到的数据库类型匹配的数据格式。S606. Convert the processing result obtained by processing the target data into a data format that matches the extracted database type.
在一个实施例中,服务器120获取对目标数据进行处理得到的处理结果,确定提取到的数据库类型匹配的数据格式,将处理结果进行数据格式转换, 将处理结果转换为提取到的数据库类型匹配的数据格式。In an embodiment, the server 120 obtains a processing result obtained by processing the target data, determines a data format that the extracted database type matches, and performs a data format conversion on the processing result. Convert the processing result to the data format that the extracted database type matches.
S608,将转换格式后的处理结果存储至提取到的数据库类型对应的数据库。S608. Store the processing result after the conversion format to the database corresponding to the extracted database type.
在一个实施例中,服务器120查询提取到的数据库类型对应的数据库,提取处理结果的数据标识,将提取到的数据标识和处理结果对应存储至查询到的数据库中。In one embodiment, the server 120 queries the database corresponding to the extracted database type, extracts the data identifier of the processing result, and stores the extracted data identifier and the processing result in the queried database.
在一个实施例中,服务器120提取处理结果存储指令中的数据库标识,识别提取到的数据库标识对应的数据库所属的数据库类型。服务器120确定识别到的数据库类型对应的数据格式,将处理结果的数据格式转换为确定的数据格式,将转换格式后的处理结果存储至提取到的数据库标识对应的数据库中。In one embodiment, the server 120 extracts the database identifier in the processing result storage instruction, and identifies the database type to which the database corresponding to the extracted database identifier belongs. The server 120 determines the data format corresponding to the identified database type, converts the data format of the processing result into a determined data format, and stores the processed result after the converted format into the database corresponding to the extracted database identifier.
本实施例中,根据处理结果存储指令,提取处理结果存储指令中的数据库类型,将处理结果进行数据格式转换,保证处理结果的数据格式与数据库类型匹配,将转换格式后的处理结果存储至处理结果存储指令中数据库类型对应的数据库中,保证了处理结果的数据格式的正确性。In this embodiment, according to the processing result storage instruction, the database type in the processing result storage instruction is extracted, the processing result is converted into a data format, the data format of the processing result is matched with the database type, and the processing result after the conversion format is stored to the processing. In the database corresponding to the database type in the result storage instruction, the correctness of the data format of the processing result is ensured.
在一个实施例中,用户通过浏览器页面和数据处理应用页面中输入用户账号和用户密码。终端110获取输入的用户账号和用户密码,根据获取到的用户账号和用户密码生成页面数据请求,终端110将页面数据请求发送至服务器120。In one embodiment, the user enters a user account and a user password through a browser page and a data processing application page. The terminal 110 acquires the input user account and the user password, generates a page data request according to the obtained user account and the user password, and the terminal 110 sends the page data request to the server 120.
服务器120接收到页面数据请求后,提取页面数据请求中的用户账号和用户密码,根据用户账号和用户密码验证用户账号对应的用户是否具有访问权限。服务器120在验证用户账号对应的用户具有访问权限后,向终端110返回数据处理页面数据。After receiving the page data request, the server 120 extracts the user account and the user password in the page data request, and verifies whether the user corresponding to the user account has the access right according to the user account and the user password. The server 120 returns the data processing page data to the terminal 110 after verifying that the user corresponding to the user account has the access right.
终端110根据数据处理页面数据显示数据处理页面。用户在数据处理页面中选取任务标识,通过终端110的输入设备点击数据任务执行按钮。终端110在检测到数据处理页面中的数据任务执行按钮被点击时,根据选取的任务标识和选取的任务标识对应的任务依赖关系生成数据处理任务执行指令, 将数据处理任务执行指令发送至服务器120。The terminal 110 displays the data processing page based on the data processing page data. The user selects the task identifier in the data processing page, and clicks the data task execution button through the input device of the terminal 110. When detecting that the data task execution button in the data processing page is clicked, the terminal 110 generates a data processing task execution instruction according to the selected task identifier and the task dependency relationship corresponding to the selected task identifier, The data processing task execution instructions are sent to the server 120.
服务器120提取数据处理任务执行指令中的任务标识和任务标识对应的任务依赖关系,根据任务依赖关系和任务标识拆分城多个数据处理任务。服务器120分别根据各数据处理任务中的任务标识提取任务脚本,提取任务脚本中的数据处理指令和数据获取条件。The server 120 extracts the task identifier corresponding to the task identifier and the task identifier in the data processing task execution instruction, and splits the plurality of data processing tasks according to the task dependency relationship and the task identifier. The server 120 extracts a task script according to the task identifiers in each data processing task, and extracts data processing instructions and data acquisition conditions in the task script.
服务器120根据数据获取条件从可以访问的各数据库类型对应的数据库中查询目标数据,获取各数据库类型对应的目标数据。服务器120根据分别获取各数据库类型对应的临时表创建指令,根据临时表创建指令创建与数据库类型对应的临时数据表,将相应的目标数据存储至数据库类型对应的临时数据表。各数据库类型对应的临时数据表之前可以交互。服务器120根据数据处理指令对各数据库类型对应的临时数据表中的目标数据进行处理得到处理结果。The server 120 queries the target data from the database corresponding to each database type that can be accessed according to the data acquisition condition, and acquires the target data corresponding to each database type. The server 120 acquires a temporary table creation instruction corresponding to each database type, creates a temporary data table corresponding to the database type according to the temporary table creation instruction, and stores the corresponding target data to the temporary data table corresponding to the database type. The temporary data tables corresponding to each database type can be interacted with before. The server 120 processes the target data in the temporary data table corresponding to each database type according to the data processing instruction to obtain a processing result.
服务器120获取终端110登录的用户账号、数据处理时间、数据处理类型、数据库类型和数据获取条件中的至少一种,根据获取到的用户账号、数据处理时间、数据处理类型、数据库类型和数据获取条件中的至少一种生成数据处理日志。The server 120 acquires at least one of a user account, a data processing time, a data processing type, a database type, and a data acquisition condition registered by the terminal 110, according to the obtained user account, data processing time, data processing type, database type, and data acquisition. At least one of the conditions generates a data processing log.
如图7所示,在一个实施例中,提供一种数据库数据处理装置700,该装置具体包括以下内容:指令获取模块702、标识提取模块704、脚本获取模块706、脚本解析模块708、数据获取模块710、数据表创建模块712和数据处理模块714。As shown in FIG. 7, in an embodiment, a database data processing apparatus 700 is provided. The apparatus specifically includes the following: an instruction acquisition module 702, an identifier extraction module 704, a script acquisition module 706, a script parsing module 708, and data acquisition. Module 710, data table creation module 712, and data processing module 714.
指令获取模块702,用于获取数据处理任务执行指令。The instruction acquisition module 702 is configured to acquire a data processing task execution instruction.
标识提取模块704,用于提取数据处理任务执行指令中的任务标识。The identifier extraction module 704 is configured to extract a task identifier in the data processing task execution instruction.
脚本获取模块706,用于获取任务标识对应的任务脚本。The script obtaining module 706 is configured to obtain a task script corresponding to the task identifier.
脚本解析模块708,用于提取任务脚本中的数据处理指令和数据获取条件。The script parsing module 708 is configured to extract data processing instructions and data acquisition conditions in the task script.
数据获取模块710,用于根据数据获取条件从各数据库类型对应的数据 库中获取目标数据。The data obtaining module 710 is configured to use data corresponding to each database type according to the data acquisition condition. Get target data in the library.
数据表创建模块712,用于根据各数据库类型对应的目标数据分别创建临时数据表。The data table creating module 712 is configured to separately create a temporary data table according to the target data corresponding to each database type.
数据处理模块714,用于根据数据处理指令对临时数据表中的目标数据进行处理。The data processing module 714 is configured to process the target data in the temporary data table according to the data processing instruction.
在一个实施例中,数据表创建模块712还用于获取各数据库类型对应的临时表创建指令;根据临时表创建指令分别对相应的数据库类型对应的目标数据创建临时数据表。In one embodiment, the data table creation module 712 is further configured to acquire a temporary table creation instruction corresponding to each database type; and create a temporary data table for the target data corresponding to the corresponding database type according to the temporary table creation instruction.
本实施例中,根据数据处理任务执行指令获取编辑的任务脚本,对任务脚本解析生成数据处理任务,提取数据处理任务中的数据处理指令和数据获取条件,根据数据获取条件从各数据库类型对应的数据库中获取目标数据。根据各数据库类型对应的目标数据分别创建临时数据表,通过建立各数据库类型对应的临时数据表,根据数据处理指令对各数据库类型对应的通过临时数据表中的目标数据进行处理。无需单独对每个数据库类型对应的目标数据进行单独操作,提高了各数据库类型对应的数据的处理效率。In this embodiment, the edited task script is acquired according to the data processing task execution instruction, the data processing task is parsed by the task script, and the data processing instruction and the data acquisition condition in the data processing task are extracted, and the data acquisition condition is corresponding to each database type according to the data acquisition condition. Get target data in the database. The temporary data table is respectively created according to the target data corresponding to each database type, and the temporary data table corresponding to each database type is established, and the target data in the temporary data table corresponding to each database type is processed according to the data processing instruction. It is not necessary to separately perform the separate operation on the target data corresponding to each database type, which improves the processing efficiency of the data corresponding to each database type.
在一个实施例中,脚本获取模块706还用于根据数据处理任务执行指令中的任务依赖关系读取各任务标识;获取与读取到的任务标识对应的任务脚本。In one embodiment, the script obtaining module 706 is further configured to: read each task identifier according to the task dependency in the data processing task execution instruction; and acquire a task script corresponding to the read task identifier.
本实施例中,数据处理任务执行指令包括多个任务标识和多个任务标识对应的任务依赖关系,根据任务依赖关系读取任务标识,根据读取到的任务标识获取任务脚本。保证根据任务依赖关系执行各任务标识对应的任务,简化了执行任务的操作步骤,提高了任务执行效率,根据一个数据处理任务执行指令即可执行多个数据处理任务,提高了数据处理效率。In this embodiment, the data processing task execution instruction includes a plurality of task identifiers and a task dependency relationship corresponding to the plurality of task identifiers, and the task identifier is read according to the task dependency relationship, and the task script is obtained according to the read task identifier. The task corresponding to each task identifier is executed according to the task dependency relationship, the operation steps of executing the task are simplified, the task execution efficiency is improved, and multiple data processing tasks can be executed according to a data processing task execution instruction, thereby improving data processing efficiency.
如图8所示,在一个实施例中,数据处理模块714具体包括以下内容:函数标识提取模块714a、处理函数获取模块714b和处理结果得到模块714c。As shown in FIG. 8, in one embodiment, the data processing module 714 specifically includes the following: a function identifier extraction module 714a, a processing function acquisition module 714b, and a processing result obtaining module 714c.
函数标识提取模块714a,用于提取数据处理指令中的自定义函数标识。The function identifier extraction module 714a is configured to extract a custom function identifier in the data processing instruction.
处理函数获取模块714b,用于根据自定义函数标识从自定义函数库中获 取数据处理函数。The processing function obtaining module 714b is configured to obtain the custom function library according to the custom function identifier Take the data processing function.
处理结果得到模块714c,用于根据获取到的数据处理函数对临时数据表中的目标数据进行处理。The processing result obtaining module 714c is configured to process the target data in the temporary data table according to the acquired data processing function.
本实施例中,可根据用户自定义的数据处理函数对各数据库类型的临时数据表中的目标数据进行处理,使得对目标数据的处理更加灵活,提高了数据处理的准确性和高效性。In this embodiment, the target data in the temporary data table of each database type can be processed according to the user-defined data processing function, so that the processing of the target data is more flexible, and the accuracy and efficiency of the data processing are improved.
如图9所示,在一个实施例中,数据库数据处理装置700具体还包括以下内容:指令获取模块716、类型提取模块718、格式转换模块720和数据存储模块722。As shown in FIG. 9, in one embodiment, the database data processing apparatus 700 specifically includes the following: an instruction acquisition module 716, a type extraction module 718, a format conversion module 720, and a data storage module 722.
指令获取模块716,用于获取处理结果存储指令。The instruction acquisition module 716 is configured to acquire a processing result storage instruction.
类型提取模块718,用于提取处理结果存储指令中的数据库类型。The type extraction module 718 is configured to extract a database type in the processing result storage instruction.
格式转换模块720,用于将对目标数据进行处理得到的处理结果,转换为与提取到的数据库类型匹配的数据格式。The format conversion module 720 is configured to convert the processing result obtained by processing the target data into a data format that matches the extracted database type.
数据存储模块722,用于将转换格式后的处理结果存储至提取到的数据库类型对应的数据库。The data storage module 722 is configured to store the processed result after the conversion format to a database corresponding to the extracted database type.
本实施例中,根据处理结果存储指令,提取处理结果存储指令中的数据库类型,将处理结果进行数据格式转换,保证处理结果的数据格式与数据库类型匹配,将转换格式后的处理结果存储至处理结果存储指令中数据库类型对应的数据库中,保证了处理结果的数据格式的正确性。In this embodiment, according to the processing result storage instruction, the database type in the processing result storage instruction is extracted, the processing result is converted into a data format, the data format of the processing result is matched with the database type, and the processing result after the conversion format is stored to the processing. In the database corresponding to the database type in the result storage instruction, the correctness of the data format of the processing result is ensured.
上述数据库数据处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。其中,网络接口可以是以太网或无线网卡等。上述各模块可以硬件形式内嵌于或独立于服务器中的处理器中,也可以以软件形式存储于服务器的存储器中,以便于处理器调用执行以上各个模块对应的操作。该处理器可以为中央处理单元(CPU)、微处理器、单片机等。The various modules in the database data processing apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The network interface may be an Ethernet or a wireless network card. Each of the above modules may be embedded in a hardware form or independent of a processor in the server, or may be stored in a memory of the server in a software form, so that the processor calls to perform operations corresponding to the above modules. The processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可执行指令,所述计算机可执行指令被所述处理器执行时,可使得所述处理器 执行以下步骤:获取数据处理任务执行指令;提取数据处理任务执行指令中的任务标识;获取任务标识对应的任务脚本;提取任务脚本中的数据处理指令和数据获取条件;根据数据获取条件从各数据库类型对应的数据库中获取目标数据;根据各数据库类型对应的目标数据分别创建临时数据表;根据数据处理指令对临时数据表中的目标数据进行处理。A computer device comprising a memory and a processor, wherein the memory stores computer executable instructions that, when executed by the processor, cause the processor Performing the following steps: acquiring a data processing task execution instruction; extracting a task identifier in the data processing task execution instruction; acquiring a task script corresponding to the task identifier; extracting a data processing instruction and a data acquisition condition in the task script; and obtaining data from each database according to the data acquisition condition The target data is obtained in the database corresponding to the type; the temporary data table is separately created according to the target data corresponding to each database type; and the target data in the temporary data table is processed according to the data processing instruction.
在一个实施例中,获取任务标识对应的任务脚本,包括:根据数据处理任务执行指令中的任务依赖关系读取各任务标识;获取与读取到的任务标识对应的任务脚本。In one embodiment, the task script corresponding to the task identifier is obtained, including: reading each task identifier according to the task dependency relationship in the data processing task execution instruction; and acquiring a task script corresponding to the read task identifier.
在一个实施例中,根据各数据库类型对应的目标数据分别创建临时数据表,包括:获取各数据库类型对应的临时表创建指令;根据临时表创建指令分别对相应的数据库类型对应的目标数据创建临时数据表。In an embodiment, the temporary data table is separately created according to the target data corresponding to each database type, including: obtaining a temporary table creation instruction corresponding to each database type; and temporarily creating a temporary data corresponding to the corresponding database type according to the temporary table creation instruction. data sheet.
在一个实施例中,根据数据处理指令对临时数据表中的目标数据进行处理,包括:提取数据处理指令中的自定义函数标识;根据自定义函数标识从自定义函数库中获取数据处理函数;根据获取到的数据处理函数对临时数据表中的目标数据进行处理。In one embodiment, processing the target data in the temporary data table according to the data processing instruction comprises: extracting a custom function identifier in the data processing instruction; and acquiring a data processing function from the custom function library according to the custom function identifier; The target data in the temporary data table is processed according to the obtained data processing function.
在一个实施例中,根据数据处理指令对临时数据表中的目标数据进行处理之后,处理器还执行以下步骤:获取处理结果存储指令;提取处理结果存储指令中的数据库类型;将对目标数据进行处理得到的处理结果,转换为与提取到的数据库类型匹配的数据格式;将转换格式后的处理结果存储至提取到的数据库类型对应的数据库。In one embodiment, after processing the target data in the temporary data table according to the data processing instruction, the processor further performs the steps of: acquiring a processing result storage instruction; extracting a database type in the processing result storage instruction; performing the target data The processed processing result is converted into a data format that matches the extracted database type; the processed result after the converted format is stored in the database corresponding to the extracted database type.
本实施例中,根据数据处理任务执行指令获取编辑的任务脚本,对任务脚本解析生成数据处理任务,提取数据处理任务中的数据处理指令和数据获取条件,根据数据获取条件从各数据库类型对应的数据库中获取目标数据。根据各数据库类型对应的目标数据分别创建临时数据表,通过建立各数据库类型对应的临时数据表,根据数据处理指令对各数据库类型对应的通过临时数据表中的目标数据进行处理。无需单独对每个数据库类型对应的目标数据进行单独操作,提高了各数据库类型对应的数据的处理效率。 In this embodiment, the edited task script is acquired according to the data processing task execution instruction, the data processing task is parsed by the task script, and the data processing instruction and the data acquisition condition in the data processing task are extracted, and the data acquisition condition is corresponding to each database type according to the data acquisition condition. Get target data in the database. The temporary data table is respectively created according to the target data corresponding to each database type, and the temporary data table corresponding to each database type is established, and the target data in the temporary data table corresponding to each database type is processed according to the data processing instruction. It is not necessary to separately perform the separate operation on the target data corresponding to each database type, which improves the processing efficiency of the data corresponding to each database type.
一个或多个存储有计算机可执行指令的存储介质,计算机可执行指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:获取数据处理任务执行指令;提取数据处理任务执行指令中的任务标识;获取任务标识对应的任务脚本;提取任务脚本中的数据处理指令和数据获取条件;根据数据获取条件从各数据库类型对应的数据库中获取目标数据;根据各数据库类型对应的目标数据分别创建临时数据表;根据数据处理指令对临时数据表中的目标数据进行处理。One or more storage media storing computer executable instructions that, when executed by one or more processors, cause one or more processors to perform the steps of: acquiring data processing task execution instructions; extracting data processing tasks Executing the task identifier in the instruction; acquiring the task script corresponding to the task identifier; extracting the data processing instruction and the data acquisition condition in the task script; acquiring the target data from the database corresponding to each database type according to the data acquisition condition; corresponding to each database type The target data respectively creates a temporary data table; the target data in the temporary data table is processed according to the data processing instruction.
在一个实施例中,获取任务标识对应的任务脚本,包括:根据数据处理任务执行指令中的任务依赖关系读取各任务标识;获取与读取到的任务标识对应的任务脚本。In one embodiment, the task script corresponding to the task identifier is obtained, including: reading each task identifier according to the task dependency relationship in the data processing task execution instruction; and acquiring a task script corresponding to the read task identifier.
在一个实施例中,根据各数据库类型对应的目标数据分别创建临时数据表,包括:获取各数据库类型对应的临时表创建指令;根据临时表创建指令分别对相应的数据库类型对应的目标数据创建临时数据表。In an embodiment, the temporary data table is separately created according to the target data corresponding to each database type, including: obtaining a temporary table creation instruction corresponding to each database type; and temporarily creating a temporary data corresponding to the corresponding database type according to the temporary table creation instruction. data sheet.
在一个实施例中,根据数据处理指令对临时数据表中的目标数据进行处理,包括:提取数据处理指令中的自定义函数标识;根据自定义函数标识从自定义函数库中获取数据处理函数;根据获取到的数据处理函数对临时数据表中的目标数据进行处理。In one embodiment, processing the target data in the temporary data table according to the data processing instruction comprises: extracting a custom function identifier in the data processing instruction; and acquiring a data processing function from the custom function library according to the custom function identifier; The target data in the temporary data table is processed according to the obtained data processing function.
在一个实施例中,根据数据处理指令对临时数据表中的目标数据进行处理之后,处理器还执行以下步骤:获取处理结果存储指令;提取处理结果存储指令中的数据库类型;将对目标数据进行处理得到的处理结果,转换为与提取到的数据库类型匹配的数据格式;将转换格式后的处理结果存储至提取到的数据库类型对应的数据库。In one embodiment, after processing the target data in the temporary data table according to the data processing instruction, the processor further performs the steps of: acquiring a processing result storage instruction; extracting a database type in the processing result storage instruction; performing the target data The processed processing result is converted into a data format that matches the extracted database type; the processed result after the converted format is stored in the database corresponding to the extracted database type.
本实施例中,根据数据处理任务执行指令获取编辑的任务脚本,对任务脚本解析生成数据处理任务,提取数据处理任务中的数据处理指令和数据获取条件,根据数据获取条件从各数据库类型对应的数据库中获取目标数据。根据各数据库类型对应的目标数据分别创建临时数据表,通过建立各数据库 类型对应的临时数据表,根据数据处理指令对各数据库类型对应的通过临时数据表中的目标数据进行处理。无需单独对每个数据库类型对应的目标数据进行单独操作,提高了各数据库类型对应的数据的处理效率。In this embodiment, the edited task script is acquired according to the data processing task execution instruction, the data processing task is parsed by the task script, and the data processing instruction and the data acquisition condition in the data processing task are extracted, and the data acquisition condition is corresponding to each database type according to the data acquisition condition. Get target data in the database. Create a temporary data table according to the target data corresponding to each database type, and establish each database by The temporary data table corresponding to the type is processed by the target data in the temporary data table corresponding to each database type according to the data processing instruction. It is not necessary to separately perform the separate operation on the target data corresponding to each database type, which improves the processing efficiency of the data corresponding to each database type.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可执行指令来指令相关的硬件来完成,所述计算机可执行指令可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等。One of ordinary skill in the art can understand that all or part of the process of implementing the above embodiments can be completed by computer-executable instructions, which can be stored in a computer readable storage medium. Wherein, the program, when executed, may include the flow of an embodiment of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or the like.
上述内容,仅为本申请的较佳实施例,并非用于限制本申请的实施方案,本领域普通技术人员根据本申请的主要构思和精神,可以十分方便地进行相应的变通或修改,故本申请的保护范围应以权利要求书所要求的保护范围为准。 The above is only the preferred embodiment of the present application, and is not intended to limit the embodiments of the present application. Those skilled in the art can make corresponding modifications or modifications in accordance with the main concepts and spirit of the present application. The scope of protection of the application shall be subject to the scope of protection required by the claims.

Claims (20)

  1. 一种数据库数据处理方法,包括:A database data processing method, comprising:
    获取数据处理任务执行指令;Obtaining a data processing task execution instruction;
    提取所述数据处理任务执行指令中的任务标识;Extracting a task identifier in the data processing task execution instruction;
    获取所述任务标识对应的任务脚本;Obtaining a task script corresponding to the task identifier;
    提取所述任务脚本中的数据处理指令和数据获取条件;Extracting data processing instructions and data acquisition conditions in the task script;
    根据所述数据获取条件从各数据库类型对应的数据库中获取目标数据;Obtaining target data from a database corresponding to each database type according to the data acquisition condition;
    根据所述各数据库类型对应的目标数据分别创建临时数据表;及Creating a temporary data table according to the target data corresponding to each database type; and
    根据所述数据处理指令对所述临时数据表中的目标数据进行处理。Processing target data in the temporary data table according to the data processing instruction.
  2. 根据权利要求1所述的方法,其特征在于,所述获取所述任务标识对应的任务脚本,包括:The method according to claim 1, wherein the obtaining a task script corresponding to the task identifier comprises:
    根据所述数据处理任务执行指令中的任务依赖关系读取各任务标识;及Reading each task identifier according to a task dependency in the data processing task execution instruction; and
    获取与读取到的任务标识对应的任务脚本。Get the task script corresponding to the read task ID.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述各数据库类型对应的目标数据分别创建临时数据表,包括:The method according to claim 2, wherein the creating a temporary data table according to the target data corresponding to each database type comprises:
    获取各数据库类型对应的临时表创建指令;及Obtaining a temporary table creation instruction corresponding to each database type; and
    根据所述临时表创建指令分别对相应的数据库类型对应的目标数据创建临时数据表。And creating a temporary data table for the target data corresponding to the corresponding database type according to the temporary table creation instruction.
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述数据处理指令对所述临时数据表中的目标数据进行处理,包括:The method according to claim 3, wherein the processing the target data in the temporary data table according to the data processing instruction comprises:
    提取数据处理指令中的自定义函数标识;Extracting a custom function identifier in the data processing instruction;
    根据所述自定义函数标识从自定义函数库中获取数据处理函数;及Obtaining a data processing function from a custom function library according to the custom function identifier; and
    根据获取到的数据处理函数对所述临时数据表中的目标数据进行处理。The target data in the temporary data table is processed according to the acquired data processing function.
  5. 根据权利要求1所述的方法,其特征在于,所述根据所述数据处理指令对所述临时数据表中的目标数据进行处理之后,所述方法还包括:The method according to claim 1, wherein after the processing the target data in the temporary data table according to the data processing instruction, the method further comprises:
    获取处理结果存储指令;Obtaining a processing result storage instruction;
    提取所述处理结果存储指令中的数据库类型; Extracting a database type in the processing result storage instruction;
    将对所述目标数据进行处理得到的处理结果,转换为与提取到的数据库类型匹配的数据格式;及Converting the processed result obtained by processing the target data into a data format matching the extracted database type; and
    将转换格式后的处理结果存储至所述提取到的数据库类型对应的数据库。The processing result after the conversion format is stored to the database corresponding to the extracted database type.
  6. 一种数据库数据处理装置,包括:A database data processing device comprising:
    指令获取模块,用于获取数据处理任务执行指令;An instruction acquisition module, configured to acquire a data processing task execution instruction;
    标识提取模块,用于提取所述数据处理任务执行指令中的任务标识;An identifier extraction module, configured to extract a task identifier in the data processing task execution instruction;
    脚本获取模块,用于获取所述任务标识对应的任务脚本;a script obtaining module, configured to acquire a task script corresponding to the task identifier;
    脚本解析模块,用于提取所述任务脚本中的数据处理指令和数据获取条件;a script parsing module, configured to extract data processing instructions and data acquisition conditions in the task script;
    数据获取模块,用于根据所述数据获取条件从各数据库类型对应的数据库中获取目标数据;a data acquisition module, configured to acquire target data from a database corresponding to each database type according to the data acquisition condition;
    数据表创建模块,用于根据所述各数据库类型对应的目标数据分别创建临时数据表;及a data table creating module, configured to respectively create a temporary data table according to the target data corresponding to each database type; and
    数据处理模块,用于根据所述数据处理指令对所述临时数据表中的目标数据进行处理。And a data processing module, configured to process the target data in the temporary data table according to the data processing instruction.
  7. 根据权利要求6所述的装置,其特征在于,所述脚本获取模块根据所述数据处理任务执行指令中的任务依赖关系读取各任务标识;获取与读取到的任务标识对应的任务脚本。The device according to claim 6, wherein the script acquisition module reads each task identifier according to the task dependency relationship in the data processing task execution instruction; and acquires a task script corresponding to the read task identifier.
  8. 根据权利要求7所述的装置,其特征在于,所述数据表创建模块还用于获取各数据库类型对应的临时表创建指令;根据所述临时表创建指令分别对相应的数据库类型对应的目标数据创建临时数据表。The device according to claim 7, wherein the data table creation module is further configured to acquire a temporary table creation instruction corresponding to each database type; and to respectively generate target data corresponding to the corresponding database type according to the temporary table creation instruction Create a temporary data table.
  9. 根据权利要求8所述的装置,其特征在于,所述数据处理模块包括:The device according to claim 8, wherein the data processing module comprises:
    函数标识提取模块,用于提取数据处理指令中的自定义函数标识;a function identifier extraction module, configured to extract a custom function identifier in the data processing instruction;
    处理函数获取模块,用于根据所述自定义函数标识从自定义函数库中获取数据处理函数;及 a processing function obtaining module, configured to obtain a data processing function from the custom function library according to the custom function identifier; and
    处理结果得到模块,用于根据获取到的数据处理函数对所述临时数据表中的目标数据进行处理。The processing result obtaining module is configured to process the target data in the temporary data table according to the acquired data processing function.
  10. 根据权利要求6所述的装置,其特征在于,所述装置还包括:The device according to claim 6, wherein the device further comprises:
    指令获取模块,用于获取处理结果存储指令;An instruction acquisition module, configured to acquire a processing result storage instruction;
    类型提取模块,用于提取所述处理结果存储指令中的数据库类型;a type extraction module, configured to extract a database type in the processing result storage instruction;
    格式转换模块,用于将对所述目标数据进行处理得到的处理结果,转换为与提取到的数据库类型匹配的数据格式;及a format conversion module, configured to convert the processing result obtained by processing the target data into a data format that matches the extracted database type; and
    数据存储模块,用于将转换格式后的处理结果存储至所述提取到的数据库类型对应的数据库。And a data storage module, configured to store the processed result after the converted format to a database corresponding to the extracted database type.
  11. 一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可执行指令,所述计算机可执行指令被所述处理器执行时,可使得所述处理器执行以下步骤:A computer device comprising a memory and a processor, wherein the memory stores computer executable instructions that, when executed by the processor, cause the processor to perform the following steps:
    获取数据处理任务执行指令;Obtaining a data processing task execution instruction;
    提取所述数据处理任务执行指令中的任务标识;Extracting a task identifier in the data processing task execution instruction;
    获取所述任务标识对应的任务脚本;Obtaining a task script corresponding to the task identifier;
    提取所述任务脚本中的数据处理指令和数据获取条件;Extracting data processing instructions and data acquisition conditions in the task script;
    根据所述数据获取条件从各数据库类型对应的数据库中获取目标数据;Obtaining target data from a database corresponding to each database type according to the data acquisition condition;
    根据所述各数据库类型对应的目标数据分别创建临时数据表;Creating a temporary data table according to the target data corresponding to each database type;
    根据所述数据处理指令对所述临时数据表中的目标数据进行处理。Processing target data in the temporary data table according to the data processing instruction.
  12. 根据权利要求11所述的计算机设备,其特征在于,所述获取所述任务标识对应的任务脚本,包括:The computer device according to claim 11, wherein the obtaining a task script corresponding to the task identifier comprises:
    根据所述数据处理任务执行指令中的任务依赖关系读取各任务标识;及Reading each task identifier according to a task dependency in the data processing task execution instruction; and
    获取与读取到的任务标识对应的任务脚本。Get the task script corresponding to the read task ID.
  13. 根据权利要求12所述的计算机设备,其特征在于,所述根据所述各数据库类型对应的目标数据分别创建临时数据表,包括:The computer device according to claim 12, wherein the creating a temporary data table according to the target data corresponding to each database type comprises:
    获取各数据库类型对应的临时表创建指令;及 Obtaining a temporary table creation instruction corresponding to each database type; and
    根据所述临时表创建指令分别对相应的数据库类型对应的目标数据创建临时数据表。And creating a temporary data table for the target data corresponding to the corresponding database type according to the temporary table creation instruction.
  14. 根据权利要求13所述的方法,其特征在于,所述根据所述数据处理指令对所述临时数据表中的目标数据进行处理,包括:The method according to claim 13, wherein the processing the target data in the temporary data table according to the data processing instruction comprises:
    提取数据处理指令中的自定义函数标识;Extracting a custom function identifier in the data processing instruction;
    根据所述自定义函数标识从自定义函数库中获取数据处理函数;及Obtaining a data processing function from a custom function library according to the custom function identifier; and
    根据获取到的数据处理函数对所述临时数据表中的目标数据进行处理。The target data in the temporary data table is processed according to the acquired data processing function.
  15. 根据权利要求11所述的计算机设备,其特征在于,所述根据所述数据处理指令对所述临时数据表中的目标数据进行处理之后,所述处理器还执行以下步骤:The computer device according to claim 11, wherein after processing the target data in the temporary data table according to the data processing instruction, the processor further performs the following steps:
    获取处理结果存储指令;Obtaining a processing result storage instruction;
    提取所述处理结果存储指令中的数据库类型;Extracting a database type in the processing result storage instruction;
    将对所述目标数据进行处理得到的处理结果,转换为与提取到的数据库类型匹配的数据格式;及Converting the processed result obtained by processing the target data into a data format matching the extracted database type; and
    将转换格式后的处理结果存储至所述提取到的数据库类型对应的数据库。The processing result after the conversion format is stored to the database corresponding to the extracted database type.
  16. 一个或多个存储有计算机可执行指令的存储介质,所述计算机可执行指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more storage media storing computer executable instructions that, when executed by one or more processors, cause the one or more processors to perform the following steps:
    获取数据处理任务执行指令;Obtaining a data processing task execution instruction;
    提取所述数据处理任务执行指令中的任务标识;Extracting a task identifier in the data processing task execution instruction;
    获取所述任务标识对应的任务脚本;Obtaining a task script corresponding to the task identifier;
    提取所述任务脚本中的数据处理指令和数据获取条件;Extracting data processing instructions and data acquisition conditions in the task script;
    根据所述数据获取条件从各数据库类型对应的数据库中获取目标数据;Obtaining target data from a database corresponding to each database type according to the data acquisition condition;
    根据所述各数据库类型对应的目标数据分别创建临时数据表;Creating a temporary data table according to the target data corresponding to each database type;
    根据所述数据处理指令对所述临时数据表中的目标数据进行处理。 Processing target data in the temporary data table according to the data processing instruction.
  17. 根据权利要求16所述的存储介质,其特征在于,所述获取所述任务标识对应的任务脚本,包括:The storage medium according to claim 16, wherein the obtaining a task script corresponding to the task identifier comprises:
    根据所述数据处理任务执行指令中的任务依赖关系读取各任务标识;及Reading each task identifier according to a task dependency in the data processing task execution instruction; and
    获取与读取到的任务标识对应的任务脚本。Get the task script corresponding to the read task ID.
  18. 根据权利要求17所述的存储介质,其特征在于,所述根据所述各数据库类型对应的目标数据分别创建临时数据表,包括:The storage medium according to claim 17, wherein the creating a temporary data table according to the target data corresponding to each database type comprises:
    获取各数据库类型对应的临时表创建指令;及Obtaining a temporary table creation instruction corresponding to each database type; and
    根据所述临时表创建指令分别对相应的数据库类型对应的目标数据创建临时数据表。And creating a temporary data table for the target data corresponding to the corresponding database type according to the temporary table creation instruction.
  19. 根据权利要求18所述的存储介质,其特征在于,所述根据所述数据处理指令对所述临时数据表中的目标数据进行处理,包括:The storage medium according to claim 18, wherein the processing the target data in the temporary data table according to the data processing instruction comprises:
    提取数据处理指令中的自定义函数标识;Extracting a custom function identifier in the data processing instruction;
    根据所述自定义函数标识从自定义函数库中获取数据处理函数;及Obtaining a data processing function from a custom function library according to the custom function identifier; and
    根据获取到的数据处理函数对所述临时数据表中的目标数据进行处理。The target data in the temporary data table is processed according to the acquired data processing function.
  20. 根据权利要求16所述的存储介质,其特征在于,所述根据所述数据处理指令对所述临时数据表中的目标数据进行处理之后,所述处理器还执行以下步骤:The storage medium according to claim 16, wherein after the processing the target data in the temporary data table according to the data processing instruction, the processor further performs the following steps:
    获取处理结果存储指令;Obtaining a processing result storage instruction;
    提取所述处理结果存储指令中的数据库类型;Extracting a database type in the processing result storage instruction;
    将对所述目标数据进行处理得到的处理结果,转换为与提取到的数据库类型匹配的数据格式;及Converting the processed result obtained by processing the target data into a data format matching the extracted database type; and
    将转换格式后的处理结果存储至所述提取到的数据库类型对应的数据库。 The processing result after the conversion format is stored to the database corresponding to the extracted database type.
PCT/CN2017/104253 2017-07-24 2017-09-29 Method and apparatus for processing data of database, computer device, and storage medium WO2019019361A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710608523.8 2017-07-24
CN201710608523.8A CN107665233B (en) 2017-07-24 2017-07-24 Database data processing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2019019361A1 true WO2019019361A1 (en) 2019-01-31

Family

ID=61122580

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/104253 WO2019019361A1 (en) 2017-07-24 2017-09-29 Method and apparatus for processing data of database, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN107665233B (en)
WO (1) WO2019019361A1 (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108446175A (en) * 2018-03-12 2018-08-24 平安普惠企业管理有限公司 Task processing method, device, computer equipment and storage medium
CN108446371B (en) * 2018-03-15 2020-10-27 平安科技(深圳)有限公司 Data back-leading method and device, computer equipment and storage medium
CN110309214B (en) * 2018-04-10 2023-06-23 腾讯科技(深圳)有限公司 Instruction execution method and equipment, storage medium and server thereof
CN110489213B (en) 2018-05-15 2022-04-05 华为技术有限公司 Task processing method and processing device and computer system
CN110750597A (en) * 2018-07-23 2020-02-04 北京国双科技有限公司 Data processing method and device, storage medium and processor
CN110019434A (en) * 2018-08-23 2019-07-16 深圳市信锐网科技术有限公司 Internet of things data processing method, device, platform and storage medium
CN109284097B (en) * 2018-09-07 2022-02-15 武汉轻工大学 Method, device, system and storage medium for realizing complex data analysis
CN111339170A (en) * 2018-12-19 2020-06-26 深圳市优必选科技有限公司 Data processing method and device, computer equipment and storage medium
CN110020773A (en) * 2019-01-30 2019-07-16 阿里巴巴集团控股有限公司 A kind of data processing method, equipment and computer-readable medium
CN110750308B (en) * 2019-09-11 2024-03-01 东软集团股份有限公司 Task processing method and device, storage medium and electronic equipment
CN111078733B (en) * 2019-11-26 2024-02-09 金蝶软件(中国)有限公司 Batch task processing method, device, computer equipment and storage medium
CN112988806A (en) * 2019-12-17 2021-06-18 北京沃东天骏信息技术有限公司 Data processing method and device
CN111813783B (en) * 2020-07-27 2024-03-26 南方电网数字电网研究院有限公司 Data processing method, device, computer equipment and storage medium
CN112000644B (en) * 2020-08-21 2022-08-02 北京浪潮数据技术有限公司 Data processing method and system, electronic equipment and storage medium
CN113778999A (en) * 2021-09-29 2021-12-10 平安资产管理有限责任公司 Data modularization processing method and device, computer equipment and storage medium
CN114238286B (en) * 2022-02-28 2022-08-05 连连(杭州)信息技术有限公司 Data warehouse data processing method and device, electronic equipment and storage medium
CN115952172B (en) * 2023-03-08 2023-05-26 畅捷通信息技术股份有限公司 Data matching method and device based on database temporary table

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944128A (en) * 2010-09-25 2011-01-12 中兴通讯股份有限公司 Data export and import method and device
US20160246824A1 (en) * 2011-11-10 2016-08-25 Treasure Data, Inc. System and method for operating a big-data platform
CN105930389A (en) * 2016-04-14 2016-09-07 北京京东尚科信息技术有限公司 Method and system for transferring data
CN106815353A (en) * 2017-01-20 2017-06-09 星环信息科技(上海)有限公司 A kind of method and apparatus of data query

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102346775A (en) * 2011-09-26 2012-02-08 苏州博远容天信息科技有限公司 Method for synchronizing multiple heterogeneous source databases based on log
CN105989142A (en) * 2015-02-28 2016-10-05 华为技术有限公司 Data query method and device
CN106649355A (en) * 2015-10-30 2017-05-10 北京国双科技有限公司 Method and device for processing data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944128A (en) * 2010-09-25 2011-01-12 中兴通讯股份有限公司 Data export and import method and device
US20160246824A1 (en) * 2011-11-10 2016-08-25 Treasure Data, Inc. System and method for operating a big-data platform
CN105930389A (en) * 2016-04-14 2016-09-07 北京京东尚科信息技术有限公司 Method and system for transferring data
CN106815353A (en) * 2017-01-20 2017-06-09 星环信息科技(上海)有限公司 A kind of method and apparatus of data query

Also Published As

Publication number Publication date
CN107665233B (en) 2020-07-31
CN107665233A (en) 2018-02-06

Similar Documents

Publication Publication Date Title
WO2019019361A1 (en) Method and apparatus for processing data of database, computer device, and storage medium
WO2019085073A1 (en) Interface test method and apparatus, computer device, and storage medium
WO2019085079A1 (en) Interface test method and apparatus, computer device and storage medium
WO2020220638A1 (en) Method and apparatus for associating link system with log system, and storage medium
CN112527816B (en) Data blood relationship analysis method, system, computer equipment and storage medium
US9456229B2 (en) Parsing single source content for multi-channel publishing
TWI524206B (en) Program analysis/verification service providing system, method for controlling system, control program, control program for causing computer to operate, program analysis/verification device and program analysis/verification tool management device
WO2019227715A1 (en) Data processing method and apparatus, and computer-readable storage medium
WO2019019645A1 (en) Method and apparatus for executing information pushing task, and computer device and storage medium
WO2020015170A1 (en) Interface invoking method and apparatus, and computer-readable storage medium
WO2019019670A1 (en) Application accessing method and device, computer apparatus, and storage medium
US20160224554A1 (en) Search methods, servers, and systems
WO2019196260A1 (en) Method and device for automatically searching for logistics information, terminal device, and readable storage medium
GB2507552A (en) Improving local context search results
US11514240B2 (en) Techniques for document marker tracking
CN112199443B (en) Data synchronization method and device, computer equipment and storage medium
WO2019000697A1 (en) Information search method, system, server, and readable storage medium
US9537928B2 (en) Remote computing device use of unsupported local computing device components
US20160224553A1 (en) Search methods and terminals
CN112487218B (en) Content processing method, system, device, computing equipment and storage medium
CN115208951A (en) Request processing method and device, electronic equipment and computer readable storage medium
WO2018233365A1 (en) Information query method, terminal, device and storage medium
CN104407846B (en) Information processing method and device
CN112380828A (en) PDF document generation method and device, storage medium and electronic equipment
WO2020006930A1 (en) Data forgery method and apparatus, and computer storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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 28.05.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17919334

Country of ref document: EP

Kind code of ref document: A1