WO2022237764A1 - 一种数据加工方法和系统 - Google Patents

一种数据加工方法和系统 Download PDF

Info

Publication number
WO2022237764A1
WO2022237764A1 PCT/CN2022/091922 CN2022091922W WO2022237764A1 WO 2022237764 A1 WO2022237764 A1 WO 2022237764A1 CN 2022091922 W CN2022091922 W CN 2022091922W WO 2022237764 A1 WO2022237764 A1 WO 2022237764A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
wide table
processing
processing module
real time
Prior art date
Application number
PCT/CN2022/091922
Other languages
English (en)
French (fr)
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 WO2022237764A1 publication Critical patent/WO2022237764A1/zh

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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/283Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP

Definitions

  • the present disclosure relates to the technical field of big data, and in particular to a data processing method and system.
  • the underlying data models are inconsistent, so the application layer needs to do a lot of splicing logic, resulting in low output timeliness and high error probability; the two systems have their own data models and storage layers, and both calculate and store the full amount of data, resulting in high costs.
  • embodiments of the present disclosure provide a data processing method and system to solve technical problems such as low resource utilization, low output timeliness, difficult code maintenance, and poor data consistency.
  • a data processing method including:
  • the first preset time window is smaller than the second preset time window.
  • the business data is received in real time, and the business data is processed in real time to output the data model and wide table detailed data, including:
  • Receive the business data pushed by the data source in real time clean the business data in real time, obtain the dimension data from the dimension table, combine the dimension data to process the cleaned business data, and output the data model and width table details data.
  • the business data is received in real time, and the business data within the first preset time window is processed to output the data model and wide table detailed data, including:
  • the wide table detail data is sent to the batch processing framework.
  • the stream processing framework is the Apache Flink framework
  • the batch processing framework is the Hive framework
  • a data processing system including a stream processing framework and a batch processing framework, wherein the stream processing framework includes a first processing module and a second processing module;
  • the first processing module is used to receive business data in real time, and process the business data in real time, so as to output data model and wide table detailed data;
  • the second processing module is used to receive business data in real time, and process the business data within the first preset time window to output data models and wide table detail data;
  • the batch processing framework is configured to receive the wide table detailed data sent by the first processing module and/or the second processing module, process the wide table detailed data within a second preset time window, and output a data model and width table detail data.
  • the first preset time window is smaller than the second preset time window.
  • the first processing module is also used for:
  • Receive the business data pushed by the data source in real time clean the business data in real time, obtain the dimension data from the dimension table, combine the dimension data to process the cleaned business data, and output the data model and width table details data.
  • the first processing module is also used for:
  • the detailed data of the wide table is sent to the second processing module of the stream processing framework and/or the batch processing framework.
  • the second processing module is also used for:
  • the second processing module is also used for:
  • the wide table detail data is sent to the batch processing framework.
  • the stream processing framework is the Apache Flink framework
  • the batch processing framework is the Hive framework
  • an electronic device including:
  • processors one or more processors
  • the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the foregoing embodiments.
  • a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method described in any of the above-mentioned embodiments is implemented.
  • An embodiment of the above invention has the following advantages or beneficial effects: because the business data is processed jointly by the flow processing framework and the batch processing framework, thereby outputting the technical means of the data model and the detailed data of the wide table, it overcomes the prior art There are technical problems such as low resource utilization, low output timeliness, difficult code maintenance, and poor data consistency.
  • the embodiment of the present disclosure processes the data in stages, only needs one full amount of data, and only needs to be processed once, and there is no overlap, thereby improving resource utilization and output timeliness; and the code of each link is unified, and finally the whole code is achieved Unification, data consistency is guaranteed, which can reduce the difficulty of code maintenance; the data caliber is unified, no matter whether it is later requirement modification, iteration, or application landing, there is no need to refer to multiple sets of templates. Therefore, the embodiments of the present disclosure can solve problems such as inconsistency of data models, which lead to low landing efficiency and error-proneness of the application layer. It should be noted that, in the embodiments of the present disclosure, data is processed in stages, thereby improving resource utilization and output timeliness.
  • Fig. 1 is a schematic diagram of the main flow of the data processing method in the prior art
  • FIG. 2 is a schematic diagram of the main flow of a data processing method according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of the main flow of a data processing method according to a reference embodiment of the present disclosure
  • Fig. 4 is a schematic diagram of the main flow of a data processing method according to another reference embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of main modules of a data processing system according to an embodiment of the present disclosure.
  • FIG. 6 is an exemplary system architecture diagram to which embodiments of the present disclosure can be applied.
  • Fig. 7 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present disclosure.
  • Fig. 2 is a schematic diagram of a main flow of a data processing method according to an embodiment of the disclosure.
  • the data processing method may include:
  • the first processing module of the stream processing framework receives business data in real time, and processes the business data in real time to output a data model and wide table detail data.
  • the first processing module of the stream processing framework receives business data pushed by various data sources in real time. These business data are incremental data, and the first processing module of the stream processing framework processes the business data to obtain and output data Model and width table detail data.
  • the data source may be a business system, which continuously generates business data and pushes the generated business data to the first processing module of the stream processing framework in real time.
  • the data source may also be a data warehouse, and the data warehouse continuously pushes new business data to the first processing module of the stream processing framework.
  • the data source may also be a subject domain, and the subject domain pushes related incremental business data to the first processing module of the stream processing framework.
  • the first processing module of the stream processing framework performs real-time stream processing on business data, and the processing time for a single piece of data is at the second level.
  • the business data is received in real time, and the business data is processed in real time to output the data model and wide table detailed data, including: receiving the business data pushed by the data source in real time, and cleaning the business data in real time to output The data model and the detailed data of the wide table; or, receive the business data pushed by the data source in real time, clean the business data in real time, obtain the dimension data from the dimension table, and combine the dimension data to perform the cleaning on the business data after cleaning Process to output data model and wide table detail data.
  • the first processing module of the stream processing framework receives the incremental business data pushed by the data source in real time, and performs data cleaning on the business data, thereby obtaining and outputting the data model and wide table detailed data.
  • the data The flow process is: -> flow.
  • the first processing module of the stream processing framework receives the incremental business data pushed by the data source in real time, first performs data cleaning on the business data, and then obtains dimension data from dimension tables, and combines The dimension data processes the cleaned business data, so as to obtain and output the data model and width table detail data.
  • the data transfer process is: -> flow -> Details.
  • the method further includes: sending the detailed data of the wide table to a second processing module of a stream processing framework and/or a batch processing framework.
  • the first processing module of the stream processing framework outputs the data model and the detailed data of the wide table
  • it may further send the detailed data of the wide table to the second processing module of the stream processing framework, by The second processing module of the stream processing framework continues to process the detailed data of the wide table.
  • the flow of detailed data is transferred to small batches, which can realize daily reports.
  • the data flow process is: ->flow->details->small batches.
  • the first processing module of the stream processing framework after the first processing module of the stream processing framework outputs the data model and the detailed data of the wide table, it may further send the detailed data of the wide table to the batch processing framework, and the batch processing framework
  • the width indicates that the detailed data is processed.
  • the data transfer process is: -> Stream -> Detail -> Batch.
  • the ranking of inflow places can be analyzed to provide reference for which regions to choose. If it is data processing at the daily and weekly level, it can be sent to the flow
  • step 202 the second processing module of the stream processing framework receives the business data in real time, processes the business data within the first preset time window, and outputs the data model and wide table detailed data.
  • the second processing module of the stream processing framework receives incremental business data in real time, and performs data processing on each business data within the window size according to the first preset time window, so as to obtain and output the data model and wide table detailed data.
  • the second processing module of the stream processing framework performs light-weight summary data, such as 10-minute achievement rate and hourly outbound volume, through the "small batch" processing in Figure 3, and the time limit is M (minutes) + N or H ( hours)+N.
  • receiving business data in real time, and processing the business data within the first preset time window to output the data model and wide table detailed data including: receiving the business data pushed by the data source in real time, and processing the business data in the first preset time window
  • the business data in the window is processed to output the data model and the detailed data of the wide table; and/or, the detailed data of the wide table sent by the first processing module is received, and the detailed data of the wide table in the first preset time window is processed Process to output data model and wide table detail data.
  • the second processing module of the stream processing framework receives business data pushed by various data sources in real time, and these business data are all incremental data, and the second processing module of the stream processing framework performs the first preset time
  • the business data in the window is processed to obtain and output the data model and the detailed data of the wide table.
  • the data source may be a business system that continuously generates business data and pushes the generated business data to the second processing module of the stream processing framework in real time.
  • the data source may also be a data warehouse, and the data warehouse continuously pushes new business data to the second processing module of the stream processing framework.
  • the data source may also be a subject domain, and the subject domain pushes related incremental business data to the second processing module of the stream processing framework.
  • the second processing module of the stream processing framework receives the wide table detailed data sent by the first processing module, and then performs the wide table detailed data within the window size according to the first preset time window Data processing, so as to obtain and output the data model and the detailed data of the wide table.
  • the flow process of data is: -> stream -> detail -> small batch. For example, assuming that the demand is the sales volume per hour in a day, then the data flow process is: -> flow -> detail -> small batch.
  • the stream processing framework may be one of Apache Storm, Trident, Spark Streaming, Samza and Apache Flink.
  • the stream processing framework is the Apache Flink framework, which can not only process business data in real time, but also batch process business data.
  • the method further includes: sending the detailed data of the wide table to the batch processing framework.
  • the second processing module of the stream processing framework outputs the data model and the detailed data of the wide table, it may further send the detailed data of the wide table to the batch processing framework.
  • the data transfer process is: -> Stream -> Detail -> Small batch -> Batch.
  • Step 203 Receive the wide table detailed data sent by the first processing module and/or the second processing module through the batch processing framework, and process the wide table detailed data within a second preset time window to output a data model and width table detail data.
  • the batch processing framework no longer receives the full amount of data pushed by the data source, but receives the wide table details sent by the first processing module of the stream processing framework and/or the wide table details sent by the second processing module
  • the batch processing framework performs data processing on the detailed data of the wide table within the second preset time window, so as to obtain and output the data model and the detailed data of the wide table.
  • the first preset time window is smaller than the second preset time window.
  • the data processed by the second processing module of the stream processing framework is called a small batch
  • the data processed by the batch processing framework is called a batch
  • the time window of the small batch is smaller than the time window of the batch.
  • the batch processing framework directly summarizes business settlement data, such as weekly/monthly/quarterly/yearly summary reports and index cards, with a time limit of T (days)+N, no longer processing zipper data (chain) and dimension table data, and no longer Integrate and process large amounts of data.
  • the stream processing framework can be one of spring-batch and Hive.
  • the batch processing framework is a Hive framework, which can be combined with the stream processing framework to receive the data sent by the stream processing framework.
  • the detailed data of the wide table is used for batch processing of the detailed data of the wide table.
  • the data model generated in steps 201-203 and the detailed data of the width table can be stored in the database, and after all the links are completed, an interface is uniformly provided externally.
  • the embodiments of the present disclosure jointly process business data through the stream processing framework and the batch processing framework, thereby outputting the data model and the technical means of wide and detailed data, which solves the problem of the prior art
  • There are technical problems such as low resource utilization, low output timeliness, difficult code maintenance, and poor data consistency.
  • Fig. 4 is a schematic diagram of a main flow of a data processing method according to another reference embodiment of the present disclosure.
  • the data processing method may include:
  • the first processing module of the stream processing framework receives business data pushed by various data sources in real time. These business data are incremental data, and the first processing module of the stream processing framework processes the business data to obtain and output data Model and width table detail data. For example, the first processing module of the stream processing framework receives the incremental business data pushed by the data source in real time, and performs data cleaning on the business data, so as to obtain and output the data model and wide table detailed data.
  • the data transfer process is as follows: -> stream.
  • the first processing module of the stream processing framework receives the incremental business data pushed by the data source in real time, first performs data cleaning on the business data, then obtains dimension data from the dimension table, and combines the dimension data to clean the Business data is processed to obtain and output the data model and wide table detail data.
  • the flow process of the data is: ->flow ->details.
  • the first processing module of the stream processing framework outputs the data model and the detailed data of the wide table
  • it sends the detailed data of the wide table to the second processing module of the stream processing framework
  • the second processing module of the stream processing framework continues to process
  • the detailed data of the wide table is processed, and the flow process of the data is: -> stream -> details -> small batch.
  • the first processing module of the stream processing framework outputs the data model and the detailed data of the wide table, it sends the detailed data of the wide table to the batch processing framework, and the batch processing framework continues to process the detailed data of the wide table.
  • the transfer process is:->flow->details->batch.
  • the second processing module of the stream processing framework receives the business data pushed by each data source in real time, and these business data are all incremental data, and the second processing module of the stream processing framework performs data processing on the business data within the first preset time window Processing, so as to obtain and output the data model and wide table detailed data, the flow process of the data is: -> small batch.
  • the second processing module of the stream processing framework receives the wide table detailed data sent by the first processing module, and then performs data processing on the wide table detailed data within the window size according to the first preset time window, thereby obtaining and outputting the data model and Wide table detail data, the flow process of this data is: -> flow -> detail -> small batch.
  • the second processing module of the stream processing framework outputs the data model and the detailed data of the wide table, it can further send the detailed data of the wide table to the batch processing framework.
  • the flow process of the data is: -> stream -> details -> Small batch -> batch.
  • the batch processing framework no longer receives the full amount of data pushed by the data source, but receives the wide table details sent by the first processing module of the stream processing framework and/or the wide table details sent by the second processing module
  • the batch processing framework performs data processing on the detailed data of the wide table within the second preset time window, so as to obtain and output the data model and the detailed data of the wide table.
  • the first preset time window is smaller than the second preset time window.
  • the data processed by the second processing module of the stream processing framework is called a small batch
  • the data processed by the batch processing framework is called a batch
  • the time window of the small batch is smaller than the time window of the batch.
  • the generated data model and width table detail data can be stored in the database. After all the links are completed, the interface will be provided externally, and the corresponding data model can be obtained by calling the interface.
  • FIG. 5 is a schematic diagram of main modules of a data processing system according to an embodiment of the present disclosure.
  • the data processing system 500 includes a stream processing framework 501 and a batch processing framework 502, wherein the stream processing framework 501 includes a first processing module and a second processing module;
  • the first processing module is used to receive business data in real time, and process the business data in real time, so as to output data model and wide table detail data;
  • the second processing module is used to receive business data in real time, and process the business data within the first preset time window to output data models and wide table detail data;
  • the batch processing framework is configured to receive the wide table detailed data sent by the first processing module and/or the second processing module, process the wide table detailed data within a second preset time window, and output a data model and width table detail data.
  • the first preset time window is smaller than the second preset time window.
  • the first processing module is also used for:
  • Receive the business data pushed by the data source in real time clean the business data in real time, obtain the dimension data from the dimension table, combine the dimension data to process the cleaned business data, and output the data model and width table details data.
  • the first processing module is also used for:
  • the detailed data of the wide table is sent to the second processing module of the stream processing framework and/or the batch processing framework.
  • the second processing module is also used for:
  • the second processing module is also used for:
  • the wide table detail data is sent to the batch processing framework.
  • the stream processing framework is the Apache Flink framework
  • the batch processing framework is the Hive framework
  • the embodiments of the present disclosure jointly process business data through the stream processing framework and the batch processing framework, thereby outputting the data model and the technical means of wide and detailed data, which solves the problem of the prior art
  • There are technical problems such as low resource utilization, low output timeliness, difficult code maintenance, and poor data consistency.
  • FIG. 6 shows an exemplary system architecture 600 to which the data processing method or data processing system of the embodiments of the present disclosure can be applied.
  • a system architecture 600 may include terminal devices 601 , 602 , and 603 , a network 604 and a server 605 .
  • the network 604 is used as a medium for providing communication links between the terminal devices 601 , 602 , 603 and the server 605 .
  • Network 604 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.
  • terminal devices 601 , 602 , 603 Users can use terminal devices 601 , 602 , 603 to interact with server 605 via network 604 to receive or send messages and the like.
  • Various communication client applications can be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (just for example).
  • the terminal devices 601, 602, 603 may be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers and the like.
  • the server 605 may be a server that provides various services, such as a background management server that provides support for shopping websites browsed by users using the terminal devices 601 , 602 , 603 (just an example).
  • the background management server can analyze and process the received data such as item information query requests, and feed back the processing results (such as target push information, item information—just an example) to the terminal device.
  • the data processing method provided by the embodiment of the present disclosure is generally executed by the server 605 , and correspondingly, the data processing system is generally set in the server 605 .
  • terminal devices, networks and servers in FIG. 6 are only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.
  • FIG. 7 shows a schematic structural diagram of a computer system 700 suitable for implementing a terminal device according to an embodiment of the present disclosure.
  • the terminal device shown in FIG. 7 is only an example, and should not limit the functions and scope of use of this embodiment of the present disclosure.
  • a computer system 700 includes a central processing unit (CPU) 701 that can operate according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage section 708 into a random-access memory (RAM) 703 Instead, various appropriate actions and processes are performed.
  • ROM read-only memory
  • RAM random-access memory
  • various programs and data required for the operation of the system 700 are also stored.
  • the CPU 701, ROM 702, and RAM 703 are connected to each other via a bus 704.
  • An input/output (I/O) interface 705 is also connected to the bus 704 .
  • the following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 708 including a hard disk, etc. and a communication section 709 including a network interface card such as a LAN card, a modem, or the like.
  • the communication section 709 performs communication processing via a network such as the Internet.
  • a drive 710 is also connected to the I/O interface 705 as needed.
  • a removable medium 711 such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc. is mounted on the drive 710 as necessary so that a computer program read therefrom is installed into the storage section 708 as necessary.
  • the processes described above with reference to the flowcharts can be implemented as computer software programs.
  • the embodiments of the present disclosure include a computer program, including a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts.
  • the computer program may be downloaded and installed from a network via communication portion 709 and/or installed from removable media 711 .
  • this computer program is executed by a central processing unit (CPU) 701
  • CPU central processing unit
  • the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that includes one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block in the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a A combination of dedicated hardware and computer instructions.
  • the modules involved in the embodiments described in the present disclosure may be implemented by software or by hardware.
  • the described modules can also be set in a processor, for example, it can be described as: a processor includes a first processing module and a second processing module, wherein the names of these modules do not constitute the its own limitations.
  • the present disclosure also provides a computer-readable medium, which may be included in the device described in the above embodiments, or may exist independently without being assembled into the device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the device, the device implements the following method: the first processing module of the stream processing framework receives service data in real time, and the The business data is processed in real time to output the data model and width table detail data; the business data is received in real time through the second processing module of the stream processing framework, and the business data within the first preset time window is processed to output the data model and width Show detailed data; receive the wide table detailed data sent by the first processing module and/or the second processing module through the batch processing framework, and process the wide table detailed data in the second preset time window to output data Model and width table detail data.
  • the business data is processed jointly by the flow processing framework and the batch processing framework, thereby outputting the technical means of the data model and the detailed data of the wide table, it overcomes the low utilization rate of resources in the prior art , low output timeliness, difficult code maintenance and poor data consistency and other technical problems.
  • the embodiment of the present disclosure processes the data in stages, only needs one full amount of data, and only needs to be processed once, and there is no overlap, thereby improving resource utilization and output timeliness; and the code of each link is unified, and finally the whole code is achieved Unified, data consistency is guaranteed, which can reduce the difficulty of code maintenance; the data caliber is unified, no matter whether it is later requirement modification, iteration, or application landing, there is no need to refer to multiple sets of templates. Therefore, the embodiments of the present disclosure can solve the problems of inconsistency in data models, which lead to low landing efficiency and error-proneness of the application layer. It should be noted that, in the embodiments of the present disclosure, data is processed in stages, thereby improving resource utilization and output timeliness.

Landscapes

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

Abstract

一种数据加工方法和系统,涉及大数据技术领域。该方法包括:通过流处理框架的第一处理模块实时接收业务数据,对所述业务数据进行实时处理,以输出数据模型和宽表明细数据(S201);通过流处理框架的第二处理模块实时接收业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据(S202);通过批处理框架接收所述第一处理模块和/或所述第二处理模块发送的宽表明细数据,对第二预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据(S203)。该方法能够解决资源利用率低、产出时效低、代码维护困难和数据一致性差等技术问题。

Description

一种数据加工方法和系统
相关申请的交叉引用
本申请要求享有2021年5月10日提交的申请号为202110507204.4的中国发明专利申请的优先权,其全部内容通过引用并入本文。
技术领域
本公开涉及大数据技术领域,尤其涉及一种数据加工方法和系统。
背景技术
在现有的数据加工过程中,根据不同的业务场景,数据的处理会分为实时数据(流系统处理增量数据)和离线数据(批系统处理全量数据),分别满足实时和T+N的数据查看需求。如图1所示,在这两种方式下,使用的技术和语言也不同,而且往往环境独立,中间数据及数据模型也是独立的。
在实现本公开过程中,发明人发现实时数据加工和离线数据加工这两种方式存在如下问题:
底层数据模型不一致,因此应用层需要做大量的拼接逻辑,导致产出时效低,出错概率大;两套系统分别有自己的数据模型及存储层,均计算和存储了全量数据,导致成本高,资源利用率低;一个业务逻辑,两套代码,逻辑不能复用,数据一致性和质量难以保证;任务执行上,集群无法做到错峰,资源利用率较低。
发明内容
有鉴于此,本公开实施例提供一种数据加工方法和系统,以解决资源利用率低、产出时效低、代码维护困难和数据一致性差等技术问题。
为实现上述目的,根据本公开实施例的一个方面,提供了一种数 据加工方法,包括:
通过流处理框架的第一处理模块实时接收业务数据,对所述业务数据进行实时处理,以输出数据模型和宽表明细数据;
通过流处理框架的第二处理模块实时接收业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据;
通过批处理框架接收所述第一处理模块和/或所述第二处理模块发送的宽表明细数据,对第二预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
可选地,所述第一预设时间窗口小于所述第二预设时间窗口。
可选地,实时接收业务数据,对所述业务数据进行实时处理,以输出数据模型和宽表明细数据,包括:
实时接收数据源推送的业务数据,对所述业务数据进行实时清洗,以输出数据模型和宽表明细数据;或者,
实时接收数据源推送的业务数据,对所述业务数据进行实时清洗,从维表中获取维度数据,结合所述维度数据对清洗后的所述业务数据进行处理,以输出数据模型和宽表明细数据。
可选地,输出数据模型和宽表明细数据之后,还包括:
将所述宽表明细数据发送至所述流处理框架的第二处理模块和/或所述批处理框架。
可选地,实时接收业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据,包括:
实时接收数据源推送的业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据;和/或,
接收所述第一处理模块发送的宽表明细数据,对第一预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
可选地,输出数据模型和宽表明细数据之后,还包括:
将所述宽表明细数据发送至所述批处理框架。
可选地,所述流处理框架为Apache Flink框架,所述批处理框架为Hive框架。
另外,根据本公开实施例的另一个方面,提供了一种数据加工系统,包括流处理框架和批处理框架,其中,所述流处理框架包括第一处理模块和第二处理模块;
所述第一处理模块用于实时接收业务数据,对所述业务数据进行实时处理,以输出数据模型和宽表明细数据;
所述第二处理模块用于实时接收业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据;
所述批处理框架用于接收所述第一处理模块和/或所述第二处理模块发送的宽表明细数据,对第二预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
可选地,所述第一预设时间窗口小于所述第二预设时间窗口。
可选地,所述第一处理模块还用于:
实时接收数据源推送的业务数据,对所述业务数据进行实时清洗,以输出数据模型和宽表明细数据;或者,
实时接收数据源推送的业务数据,对所述业务数据进行实时清洗,从维表中获取维度数据,结合所述维度数据对清洗后的所述业务数据进行处理,以输出数据模型和宽表明细数据。
可选地,所述第一处理模块还用于:
输出数据模型和宽表明细数据之后,将所述宽表明细数据发送至所述流处理框架的第二处理模块和/或所述批处理框架。
可选地,所述第二处理模块还用于:
实时接收数据源推送的业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据;和/或,
接收所述第一处理模块发送的宽表明细数据,对第一预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
可选地,所述第二处理模块还用于:
输出数据模型和宽表明细数据之后,将所述宽表明细数据发送至所述批处理框架。
可选地,所述流处理框架为Apache Flink框架,所述批处理框架为Hive框架。
根据本公开实施例的另一个方面,还提供了一种电子设备,包括:
一个或多个处理器;
存储装置,用于存储一个或多个程序,
当所述一个或多个程序被所述一个或多个处理器执行时,所述一个或多个处理器实现上述任一实施例所述的方法。
根据本公开实施例的另一个方面,还提供了一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现上述任一实施例所述的方法。
上述发明中的一个实施例具有如下优点或有益效果:因为采用通过流处理框架和批处理框架共同对业务数据进行处理,从而输出数据模型和宽表明细数据的技术手段,所以克服了现有技术中资源利用率低、产出时效低、代码维护困难和数据一致性差等技术问题。本公开实施例对数据分阶段处理,只需要一份全量数据,而且只需要处理一次,不存在重叠,从而提高了资源利用率和产出时效;而且每个环节代码统一,最终整体做到代码统一,数据一致性得到保证,能够降低 代码维护难度;数据口径得到统一,无论是后期需求修改、迭代,还是应用落地不用再引用多套模版。因此,本公开实施例能够解决数据模型不一致,导致应用层落地效率低、易出错等问题。需要说明的是,在本公开的实施例中,数据分阶段处理,从而提高资源利用率和产出时效。
上述的非惯用的可选方式所具有的进一步效果将在下文中结合具体实施方式加以说明。
附图说明
附图用于更好地理解本公开,不构成对本公开的不当限定。其中:
图1是现有技术中的数据加工方法的主要流程的示意图;
图2是根据本公开实施例的数据加工方法的主要流程的示意图;
图3是根据本公开一个可参考实施例的数据加工方法的主要流程的示意图;
图4是根据本公开另一个可参考实施例的数据加工方法的主要流程的示意图;
图5是根据本公开实施例的数据加工系统的主要模块的示意图;
图6是本公开实施例可以应用于其中的示例性系统架构图;
图7是适于用来实现本公开实施例的终端设备或服务器的计算机系统的结构示意图。
具体实施方式
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。
图2是根据本公开实施例的数据加工方法的主要流程的示意图。 作为本公开的一个实施例,如图2所示,所述数据加工方法可以包括:
步骤201,通过流处理框架的第一处理模块实时接收业务数据,对所述业务数据进行实时处理,以输出数据模型和宽表明细数据。
流处理框架的第一处理模块实时接收各个数据源推送的业务数据,这些业务数据均为增量数据,流处理框架的第一处理模块对所述业务数据进行数据加工处理,从而得到并输出数据模型和宽表明细数据。可选地,数据源可以是业务系统,所述业务系统不断地产生业务数据,并实时地将产生的业务数据推送至流处理框架的第一处理模块。可选地,数据源也可以是数据仓库,所述数据仓库不断地将新增的业务数据推送至流处理框架的第一处理模块。可选地,所述数据源还可以主题域,所述主题域将相关的增量业务数据推送至流处理框架的第一处理模块。流处理框架的第一处理模块对业务数据进行实时流处理,单条数据处理时间为秒级。
可选地,实时接收业务数据,对所述业务数据进行实时处理,以输出数据模型和宽表明细数据,包括:实时接收数据源推送的业务数据,对所述业务数据进行实时清洗,以输出数据模型和宽表明细数据;或者,实时接收数据源推送的业务数据,对所述业务数据进行实时清洗,从维表中获取维度数据,结合所述维度数据对清洗后的所述业务数据进行处理,以输出数据模型和宽表明细数据。
在本公开的一个实施例中,流处理框架的第一处理模块实时接收数据源推送的增量业务数据,并对所述业务数据进行数据清洗,从而得到并输出数据模型和宽表明细数据。如图3所示,假设对某品牌的物品有日常运营监管的需求,那么当增量业务数据入流时,清洗掉其他品牌的业务数据,只保留该品牌的业务数据,在该实施例中数据的流转过程为:->流。
在本公开的另一个实施例中,流处理框架的第一处理模块实时接 收数据源推送的增量业务数据,先对所述业务数据进行数据清洗,然后从维表中获取维度数据,并结合所述维度数据对清洗后的所述业务数据进行处理,从而得到并输出数据模型和宽表明细数据。如图3所示,假设对某品牌的物品有日常运营监管的需求,那么当增量业务数据入流时,清洗掉其他品牌的业务数据,只保留该品牌的业务数据,作为订单流入明细,然后从维表中获取物品数量、物品金额、发货地、收货地等维度数据,结合这些维度数据可以得到订单明细数据,作为日常监控,在该实施例中数据的流转过程为:->流->明细。
可选地,输出数据模型和宽表明细数据之后,还包括:将所述宽表明细数据发送至流处理框架的第二处理模块和/或批处理框架。在本公开的一个实施例中,流处理框架的第一处理模块输出数据模型和宽表明细数据之后,还可以进一步地将所述宽表明细数据发送至流处理框架的第二处理模块,由流处理框架的第二处理模块继续对宽表明细数据进行加工处理。如图3所示,明细数据流转到小批,可实现日报告,在该实施例中数据的流转过程为:->流->明细->小批。在本公开的另一个实施例中,流处理框架的第一处理模块输出数据模型和宽表明细数据之后,还可以进一步地将所述宽表明细数据发送至批处理框架,由批处理框架对宽表明细数据进行加工处理。如图3所示,月、季、年等周期太大,流或小批的处理效能比太低,转由批处理,可以提高处理效率,在该实施例中数据的流转过程为:->流->明细->批。
例如,通过从维表中获取的发货地、收货地等维度数据,可以分析出流入地排行,从而为选择哪几个地区提供参考,如果是日周级别的数据加工,可以发送给流处理框架的第二处理模块(即小批),如果是其他级别的数据加工,则发送给批处理框架(即批)。
步骤202,通过流处理框架的第二处理模块实时接收业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据。
流处理框架的第二处理模块实时接收增量业务数据,并按照第一预设时间窗口,对该窗口大小内的各个业务数据进行数据加工,从而得到并输出数据模型和宽表明细数据。流处理框架的第二处理模块进行轻量级的汇总数据,如10分钟达成率、每小时出库量,经由图3中的“小批”处理,时效为M(分钟)+N或H(小时)+N。
可选地,实时接收业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据,包括:实时接收数据源推送的业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据;和/或,接收所述第一处理模块发送的宽表明细数据,对第一预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
在本公开的一个实施例中,流处理框架的第二处理模块实时接收各个数据源推送的业务数据,这些业务数据均为增量数据,流处理框架的第二处理模块对第一预设时间窗口内的所述业务数据进行数据加工处理,从而得到并输出数据模型和宽表明细数据。可选地,数据源可以是业务系统,所述业务系统不断地产生业务数据,并实时地将产生的业务数据推送至流处理框架的第二处理模块。可选地,数据源也可以是数据仓库,所述数据仓库不断地将新增的业务数据推送至流处理框架的第二处理模块。可选地,所述数据源还可以主题域,所述主题域将相关的增量业务数据推送至流处理框架的第二处理模块。
在本公开的另一个实施例中,流处理框架的第二处理模块接收第一处理模块发送的宽表明细数据,然后按照第一预设时间窗口,对该窗口大小内的宽表明细数据进行数据加工,从而得到并输出数据模型和宽表明细数据。在该实施例中,数据的流转过程为:->流->明细->小批。例如,假设需求为一天内每小时销量,那么数据的流转过程为:->流->明细->小批。
可选地,所述流处理框架可以是Apache Storm,Trident,Spark Streaming,Samza和Apache Flink中的一种。较佳地,所述流处理框架为Apache Flink框架,该框架不但可以对业务数据进行实时处理,还可以对业务数据进行批处理。
可选地,输出数据模型和宽表明细数据之后,还包括:将所述宽表明细数据发送至所述批处理框架。流处理框架的第二处理模块输出数据模型和宽表明细数据之后,还可以进一步将宽表明细数据发送至批处理框架。如图3所示,月、季、年等周期太大,流或小批的处理效能比太低,转由批处理,可以提高处理效率,在该实施例中数据的流转过程为:->流->明细->小批->批。
步骤203,通过批处理框架接收所述第一处理模块和/或所述第二处理模块发送的宽表明细数据,对第二预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
在本公开的实施例中,批处理框架不再接收数据源推送的全量数据,而是接收流处理框架的第一处理模块发送的宽表明细数据和/或第二处理模块发送的宽表明细数据,批处理框架对第二预设时间窗口内的宽表明细数据进行数据加工,从而得到并输出数据模型和宽表明细数据。
可选地,所述第一预设时间窗口小于所述第二预设时间窗口。为了便于理解,本公开实施例将流处理框架的第二处理模块处理的数据称为小批,将批处理框架处理的数据称为批,小批的时间窗口小于批的时间窗口。
批处理框架直接汇总出业务结算类数据,如周/月/季/年汇总报表、指标卡,时效为T(天)+N,不再处理拉链数据(chain)和维表数据, 也不再处理大量数据的整合加工工作。
可选地,所述流处理框架可以是spring-batch和Hive中的一种,较佳地,所述批处理框架为Hive框架,该框架可以与流处理框架结合,接收流处理框架发送过来的宽表明细数据,对宽表明细数据进行批处理。
如图3所示,如果需求是仓库基础信息,比如区域省市地归属信息,这类信息变化不是很频繁,可以直接生成维表,那么数据的流转过程为:->流->明细->维表或者->流->明细->批->维表。
步骤201-203中生成数据模型和宽表明细数据可以存储到数据库中,所有环节完成后,统一对外提供接口。
根据上面所述的各种实施例,可以看出本公开实施例通过流处理框架和批处理框架共同对业务数据进行处理,从而输出数据模型和宽表明细数据的技术手段,解决了现有技术中资源利用率低、产出时效低、代码维护困难和数据一致性差等技术问题。通过以上流程可看出,在本公开的实施例中,数据分阶段处理,只需要一份全量数据,而且只需要处理一次,不存在重叠,从而提高了资源利用率和产出时效;而且每个环节代码统一,最终整体做到代码统一,数据一致性得到保证,能够降低代码维护难度;数据口径得到统一,无论是后期需求修改、迭代,还是应用落地不用再引用多套模版。因此,本公开实施例能够解决数据模型不一致,导致应用层落地效率低、易出错等问题。需要说明的是,在本公开的实施例中,数据分阶段处理,从而提高资源利用率和产出时效。
图4是根据本公开另一个可参考实施例的数据加工方法的主要流程的示意图。作为本公开的另一个实施例,如图4所示,所述数据加工方法可以包括:
流处理框架的第一处理模块实时接收各个数据源推送的业务数据,这些业务数据均为增量数据,流处理框架的第一处理模块对所述业务数据进行数据加工处理,从而得到并输出数据模型和宽表明细数据。例如,流处理框架的第一处理模块实时接收数据源推送的增量业务数据,并对所述业务数据进行数据清洗,从而得到并输出数据模型和宽表明细数据,该数据的流转过程为:->流。
流处理框架的第一处理模块实时接收数据源推送的增量业务数据,先对所述业务数据进行数据清洗,然后从维表中获取维度数据,并结合所述维度数据对清洗后的所述业务数据进行处理,从而得到并输出数据模型和宽表明细数据,该数据的流转过程为:->流->明细。
进一步地,流处理框架的第一处理模块输出数据模型和宽表明细数据之后,将所述宽表明细数据发送至流处理框架的第二处理模块,由流处理框架的第二处理模块继续对宽表明细数据进行加工处理,该数据的流转过程为:->流->明细->小批。
进一步地,流处理框架的第一处理模块输出数据模型和宽表明细数据之后,将所述宽表明细数据发送至批处理框架,由批处理框架继续对宽表明细数据进行加工处理,该数据的流转过程为:->流->明细->批。
流处理框架的第二处理模块实时接收各个数据源推送的业务数据,这些业务数据均为增量数据,流处理框架的第二处理模块对第一预设时间窗口内的所述业务数据进行数据加工处理,从而得到并输出数据模型和宽表明细数据,该数据的流转过程为:->小批。
流处理框架的第二处理模块接收第一处理模块发送的宽表明细数据,然后按照第一预设时间窗口,对该窗口大小内的宽表明细数据进行数据加工,从而得到并输出数据模型和宽表明细数据,该数据的流 转过程为:->流->明细->小批。
进一步地,流处理框架的第二处理模块输出数据模型和宽表明细数据之后,还可以进一步将宽表明细数据发送至批处理框架,该数据的流转过程为:->流->明细->小批->批。
在本公开的实施例中,批处理框架不再接收数据源推送的全量数据,而是接收流处理框架的第一处理模块发送的宽表明细数据和/或第二处理模块发送的宽表明细数据,批处理框架对第二预设时间窗口内的宽表明细数据进行数据加工,从而得到并输出数据模型和宽表明细数据。
可选地,所述第一预设时间窗口小于所述第二预设时间窗口。为了便于理解,本公开实施例将流处理框架的第二处理模块处理的数据称为小批,将批处理框架处理的数据称为批,小批的时间窗口小于批的时间窗口。
需要指出的是,在本公开的实施例中,上述数据流转过程可以只执行其中的任意一条,可以执行其中的任意多条,还可以执行上述全部数据流转过程,根据业务需求来决定。复杂的需求执行全部的数据流转过程,而简单的需求可能只需要执行一条数据流转过程。
生成数据模型和宽表明细数据可以存储到数据库中,所有环节完成后,统一对外提供接口,应用调用接口就可以获得对应的数据模型。
另外,在本公开另一个可参考实施例中数据加工方法的具体实施内容,在上面所述数据加工方法中已经详细说明了,故在此重复内容不再说明。
图5是根据本公开实施例的数据加工系统的主要模块的示意图, 如图5所示,所述数据加工系统500包括流处理框架501和批处理框架502,其中,所述流处理框架501包括第一处理模块和第二处理模块;
所述第一处理模块用于实时接收业务数据,对所述业务数据进行实时处理,以输出数据模型和宽表明细数据;
所述第二处理模块用于实时接收业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据;
所述批处理框架用于接收所述第一处理模块和/或所述第二处理模块发送的宽表明细数据,对第二预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
可选地,所述第一预设时间窗口小于所述第二预设时间窗口。
可选地,所述第一处理模块还用于:
实时接收数据源推送的业务数据,对所述业务数据进行实时清洗,以输出数据模型和宽表明细数据;或者,
实时接收数据源推送的业务数据,对所述业务数据进行实时清洗,从维表中获取维度数据,结合所述维度数据对清洗后的所述业务数据进行处理,以输出数据模型和宽表明细数据。
可选地,所述第一处理模块还用于:
输出数据模型和宽表明细数据之后,将所述宽表明细数据发送至所述流处理框架的第二处理模块和/或所述批处理框架。
可选地,所述第二处理模块还用于:
实时接收数据源推送的业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据;和/或,
接收所述第一处理模块发送的宽表明细数据,对第一预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
可选地,所述第二处理模块还用于:
输出数据模型和宽表明细数据之后,将所述宽表明细数据发送至所述批处理框架。
可选地,所述流处理框架为Apache Flink框架,所述批处理框架为Hive框架。
根据上面所述的各种实施例,可以看出本公开实施例通过流处理框架和批处理框架共同对业务数据进行处理,从而输出数据模型和宽表明细数据的技术手段,解决了现有技术中资源利用率低、产出时效低、代码维护困难和数据一致性差等技术问题。通过以上流程可看出,在本公开的实施例中,数据分阶段处理,只需要一份全量数据,而且只需要处理一次,不存在重叠,从而提高了资源利用率和产出时效;而且每个环节代码统一,最终整体做到代码统一,数据一致性得到保证,能够降低代码维护难度;数据口径得到统一,无论是后期需求修改、迭代,还是应用落地不用再引用多套模版。因此,本公开实施例能够解决数据模型不一致,导致应用层落地效率低、易出错等问题。需要说明的是,在本公开的实施例中,数据分阶段处理,从而提高资源利用率和产出时效。
需要说明的是,在本公开所述数据加工系统的具体实施内容,在上面所述数据加工方法中已经详细说明了,故在此重复内容不再说明。
图6示出了可以应用本公开实施例的数据加工方法或数据加工系统的示例性系统架构600。
如图6所示,系统架构600可以包括终端设备601、602、603,网络604和服务器605。网络604用以在终端设备601、602、603和服务器605之间提供通信链路的介质。网络604可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
用户可以使用终端设备601、602、603通过网络604与服务器605交互,以接收或发送消息等。终端设备601、602、603上可以安装有各种通讯客户端应用,例如购物类应用、网页浏览器应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等(仅为示例)。
终端设备601、602、603可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。
服务器605可以是提供各种服务的服务器,例如对用户利用终端设备601、602、603所浏览的购物类网站提供支持的后台管理服务器(仅为示例)。后台管理服务器可以对接收到的物品信息查询请求等数据进行分析等处理,并将处理结果(例如目标推送信息、物品信息——仅为示例)反馈给终端设备。
需要说明的是,本公开实施例所提供的数据加工方法一般由服务器605执行,相应地,所述数据加工系统一般设置在服务器605中。
应该理解,图6中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。
下面参考图7,其示出了适于用来实现本公开实施例的终端设备的计算机系统700的结构示意图。图7示出的终端设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图7所示,计算机系统700包括中央处理单元(CPU)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储部分708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM 703中,还存储有系统700操作所需的各种程序和数据。CPU 701、ROM 702以及RAM703通过总线704彼此相连。输入/ 输出(I/O)接口705也连接至总线704。
以下部件连接至I/O接口705:包括键盘、鼠标等的输入部分706;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分707;包括硬盘等的存储部分708;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分709。通信部分709经由诸如因特网的网络执行通信处理。驱动器710也根据需要连接至I/O接口705。可拆卸介质711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器710上,以便于从其上读出的计算机程序根据需要被安装入存储部分708。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分709从网络上被下载和安装,和/或从可拆卸介质711被安装。在该计算机程序被中央处理单元(CPU)701执行时,执行本公开的系统中限定的上述功能。
需要说明的是,本公开所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机 可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的模块也可以设置在处理器中,例如,可以描述为:一种处理器包括第一处理模块和第二处理模块,其中,这些模块的名称在某种情况下并不构成对该模块本身的限定。
作为另一方面,本公开还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,该设备实现 如下方法:通过流处理框架的第一处理模块实时接收业务数据,对所述业务数据进行实时处理,以输出数据模型和宽表明细数据;通过流处理框架的第二处理模块实时接收业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据;通过批处理框架接收所述第一处理模块和/或所述第二处理模块发送的宽表明细数据,对第二预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
根据本公开实施例的技术方案,因为采用通过流处理框架和批处理框架共同对业务数据进行处理,从而输出数据模型和宽表明细数据的技术手段,所以克服了现有技术中资源利用率低、产出时效低、代码维护困难和数据一致性差等技术问题。本公开实施例对数据分阶段处理,只需要一份全量数据,而且只需要处理一次,不存在重叠,从而提高了资源利用率和产出时效;而且每个环节代码统一,最终整体做到代码统一,数据一致性得到保证,能够降低代码维护难度;数据口径得到统一,无论是后期需求修改、迭代,还是应用落地不用再引用多套模版。因此,本公开实施例能够解决数据模型不一致,导致应用层落地效率低、易出错等问题。需要说明的是,在本公开的实施例中,数据分阶段处理,从而提高资源利用率和产出时效。
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,取决于设计要求和其他因素,可以发生各种各样的修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。

Claims (10)

  1. 一种数据加工方法,其特征在于,包括:
    通过流处理框架的第一处理模块实时接收业务数据,对所述业务数据进行实时处理,以输出数据模型和宽表明细数据;
    通过流处理框架的第二处理模块实时接收业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据;
    通过批处理框架接收所述第一处理模块和/或所述第二处理模块发送的宽表明细数据,对第二预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
  2. 根据权利要求1所述的方法,其特征在于,所述第一预设时间窗口小于所述第二预设时间窗口。
  3. 根据权利要求1所述的方法,其特征在于,实时接收业务数据,对所述业务数据进行实时处理,以输出数据模型和宽表明细数据,包括:
    实时接收数据源推送的业务数据,对所述业务数据进行实时清洗,以输出数据模型和宽表明细数据;或者,
    实时接收数据源推送的业务数据,对所述业务数据进行实时清洗,从维表中获取维度数据,结合所述维度数据对清洗后的所述业务数据进行处理,以输出数据模型和宽表明细数据。
  4. 根据权利要求3所述的方法,其特征在于,输出数据模型和宽表明细数据之后,还包括:
    将所述宽表明细数据发送至所述流处理框架的第二处理模块和/或所述批处理框架。
  5. 根据权利要求4所述的方法,其特征在于,实时接收业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表 明细数据,包括:
    实时接收数据源推送的业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据;和/或,
    接收所述第一处理模块发送的宽表明细数据,对第一预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
  6. 根据权利要求5所述的方法,其特征在于,输出数据模型和宽表明细数据之后,还包括:
    将所述宽表明细数据发送至所述批处理框架。
  7. 根据权利要求1所述的方法,其特征在于,所述流处理框架为Apache Flink框架,所述批处理框架为Hive框架。
  8. 一种数据加工系统,其特征在于,包括流处理框架和批处理框架,其中,所述流处理框架包括第一处理模块和第二处理模块;
    所述第一处理模块用于实时接收业务数据,对所述业务数据进行实时处理,以输出数据模型和宽表明细数据;
    所述第二处理模块用于实时接收业务数据,对第一预设时间窗口内的业务数据进行处理,以输出数据模型和宽表明细数据;
    所述批处理框架用于接收所述第一处理模块和/或所述第二处理模块发送的宽表明细数据,对第二预设时间窗口内的宽表明细数据进行处理,以输出数据模型和宽表明细数据。
  9. 一种电子设备,其特征在于,包括:
    一个或多个处理器;
    存储装置,用于存储一个或多个程序,
    当所述一个或多个程序被所述一个或多个处理器执行时,所述一个或多个处理器实现如权利要求1-7中任一所述的方法。
  10. 一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1-7中任一所述的方法。
PCT/CN2022/091922 2021-05-10 2022-05-10 一种数据加工方法和系统 WO2022237764A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110507204.4A CN113190558A (zh) 2021-05-10 2021-05-10 一种数据加工方法和系统
CN202110507204.4 2021-05-10

Publications (1)

Publication Number Publication Date
WO2022237764A1 true WO2022237764A1 (zh) 2022-11-17

Family

ID=76980991

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/091922 WO2022237764A1 (zh) 2021-05-10 2022-05-10 一种数据加工方法和系统

Country Status (2)

Country Link
CN (1) CN113190558A (zh)
WO (1) WO2022237764A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190558A (zh) * 2021-05-10 2021-07-30 北京京东振世信息技术有限公司 一种数据加工方法和系统
CN114116162A (zh) * 2021-11-18 2022-03-01 支付宝(杭州)信息技术有限公司 数据处理方法、系统及非暂时性存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140280142A1 (en) * 2013-03-14 2014-09-18 Science Applications International Corporation Data analytics system
CN109684352A (zh) * 2018-12-29 2019-04-26 江苏满运软件科技有限公司 数据分析系统、方法、存储介质及电子设备
CN110019397A (zh) * 2017-12-06 2019-07-16 北京京东尚科信息技术有限公司 用于进行数据处理的方法及装置
CN110362622A (zh) * 2019-07-22 2019-10-22 江苏满运软件科技有限公司 基于实时数仓的实时流处理系统、方法、设备及存储介质
CN110502566A (zh) * 2019-08-29 2019-11-26 江苏满运软件科技有限公司 近实时数据采集方法、装置、电子设备、存储介质
CN113190558A (zh) * 2021-05-10 2021-07-30 北京京东振世信息技术有限公司 一种数据加工方法和系统

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667368A (zh) * 2019-10-16 2021-04-16 北京京东乾石科技有限公司 一种任务数据处理方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140280142A1 (en) * 2013-03-14 2014-09-18 Science Applications International Corporation Data analytics system
CN110019397A (zh) * 2017-12-06 2019-07-16 北京京东尚科信息技术有限公司 用于进行数据处理的方法及装置
CN109684352A (zh) * 2018-12-29 2019-04-26 江苏满运软件科技有限公司 数据分析系统、方法、存储介质及电子设备
CN110362622A (zh) * 2019-07-22 2019-10-22 江苏满运软件科技有限公司 基于实时数仓的实时流处理系统、方法、设备及存储介质
CN110502566A (zh) * 2019-08-29 2019-11-26 江苏满运软件科技有限公司 近实时数据采集方法、装置、电子设备、存储介质
CN113190558A (zh) * 2021-05-10 2021-07-30 北京京东振世信息技术有限公司 一种数据加工方法和系统

Also Published As

Publication number Publication date
CN113190558A (zh) 2021-07-30

Similar Documents

Publication Publication Date Title
US10055426B2 (en) System and method transforming source data into output data in big data environments
WO2022237764A1 (zh) 一种数据加工方法和系统
US11681651B1 (en) Lineage data for data records
US10713090B2 (en) Context aware prioritization in a distributed environment using tiered queue allocation
Sawant et al. Big data application architecture Q&A: A problem-solution approach
US10249070B2 (en) Dynamic interaction graphs with probabilistic edge decay
US10872097B2 (en) Data resolution system for management of distributed data
US11514090B2 (en) Comments-ordering method, apparatus, device and computer storage medium
CN111429241A (zh) 一种账务处理方法和装置
WO2021093423A1 (zh) 一种标记用户的方法和装置
WO2020088050A1 (zh) 生成信息的方法和装置
WO2021120000A1 (en) System and method for generating highly scalable temporal graph database
US20210089649A1 (en) Machine learning anomaly detection mechanism
CN113761350A (zh) 一种数据推荐方法、相关装置和数据推荐系统
CN107729394A (zh) 基于Hadoop集群的数据集市管理系统及其使用方法
CN114817297A (zh) 一种处理数据的方法和装置
CN110781238B (zh) 基于Redis、Hbase结合的客户视图缓存方法和装置
CN114925343A (zh) 一种处理权限数据的方法和装置
CN114138758A (zh) 一种基于多源系统的数据清洗合并方法、装置及可读介质
US11928090B2 (en) Anomaly detection mechanism
US11216490B2 (en) Method and system for the creation and maintenance of a web presence data store built automatically for all entities with a social media presence
CN110705935A (zh) 一种物流单据的处理方法和装置
US11863622B2 (en) Cross-device data distribution with modular architecture
US20240039857A1 (en) Systems and method for improving network traffic
CN107665241A (zh) 一种实时数据多维度去重方法和装置

Legal Events

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

Ref document number: 22806727

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE