A financial data processing method, device, electronic equipment and processing medium

By adaptively adjusting the data window, a time-continuous target window is built, which solves the loss and abnormal problems caused by overlap and discontinuity of data windows in the prior art, and improves the integrity and reliability of financial data processing.

CN118643031BActive Publication Date: 2024-12-17KMERIT SUZHOU INFORMATION SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411075724.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-12-17
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

Existing financial data processing methods are based on fixed timestamps and window sizes, resulting in overlap or time discontinuity of data windows, resulting in data loss or exceptions.

Method used

By obtaining the arrival timestamp of the pending financial data and the current data window, we can determine whether it is beyond the time range. If it is exceeded, a new target data window will be built to make it continuous with the current window time, and the data will be processed in the target window.

Benefits of technology

It solves the problems of loss and exceptions when receiving and processing financial data in the data window, and improves the integrity and reliability of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643031B_ABST
    Figure CN118643031B_ABST
Patent Text Reader

Abstract

The present invention discloses a financial data processing method, device, electronic device and processing medium, and relates to the field of financial technology. A specific implementation of the method includes: being able to obtain the arrival timestamp of the financial data to be processed and obtaining the current data window; when it is determined that the arrival timestamp exceeds the time range, constructing a new target data window for the financial data to be processed; the target data window is time-continuous with the current data window; and processing the financial data within the target data window. The embodiments of the present invention overcome the problem of data loss or data anomaly caused by receiving and processing financial data in a data window constructed based on the existing method by adaptively adjusting the data window and constructing a time-continuous data window; and improve the integrity and reliability of financial data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology, and in particular to a financial data processing method, device, electronic equipment and processing medium. Background Art

[0002] In the financial industry, as the scale of financial data increases, distributed big data technology is often used to process large amounts of financial data. One method of processing financial data is to group data based on data windows. Data windows can group data based on the time or number of elements in the data stream. Usually, data windows divide financial data streams into windows of fixed size or fixed time intervals, so that data can be aggregated, analyzed, or otherwise operated on according to these windows.

[0003] Existing methods usually determine the window start time to the window end time of the data window based on the current timestamp and a fixed window size. The existing methods have the problem that the determined data windows may overlap or be time discontinuous, which leads to data loss or data anomalies when receiving and processing financial data in the data window constructed based on the existing method. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a financial data processing method, device, electronic device and processing medium, which can obtain the arrival timestamp of the financial data to be processed and obtain the current data window; when it is determined that the arrival timestamp exceeds the time range, a new target data window is constructed for the financial data to be processed; the target data window is time-continuous with the current data window; and the financial data is processed within the target data window. The embodiment of the present invention overcomes the problem of data loss or data anomaly caused by receiving and processing financial data based on the data window constructed by the existing method by adaptively adjusting the data window and constructing a time-continuous data window; and improves the integrity and reliability of financial data processing.

[0005] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, a financial data processing method is provided, which is characterized by comprising: obtaining an arrival timestamp of the financial data to be processed; and obtaining a current data window; wherein the current data window is a time range that can receive multiple batches of financial data; determining whether the arrival timestamp belongs to the time range of the current data window; if it is determined that the arrival timestamp exceeds the time range, constructing a new target data window for the financial data to be processed; the target data window is time-continuous with the current data window; and processing the financial data within the target data window.

[0006] Optionally, the determining whether the arrival timestamp belongs to the current data window further includes: in a case where it is determined that the arrival timestamp belongs to the time range, processing the financial data within the time range corresponding to the current data window.

[0007] Optionally, the data volume of the financial data to be processed is obtained; the constructing of a new target data window for the financial data includes: when the data volume exceeds a set data volume threshold, re-determining the duration corresponding to a new target time range for the target data window, otherwise determining the duration of the time range of the current data window as the duration of the target time range; and constructing a new target data window based on the duration of the target time range.

[0008] Optionally, constructing a new target data window for the financial data includes: obtaining the duration of a target time range corresponding to the target data window; determining the start time of the target data window, and calculating the end time of the target data window based on the start time of the target data window and the duration of the target time range; and constructing the target data window according to the start time of the target data window and the end time of the target data window.

[0009] Optionally, determining the start time of the target data window includes: calculating the start time of the target data window based on obtaining an arrival timestamp of the financial data to be processed, the duration of the time range corresponding to the current data window, and the start time of the receivable financial data included in the time range of the current data window.

[0010] Optionally, the re-determining a new target time range further includes: determining a time range of a subsequent data window according to the duration of the new target time range and a start time at which financial data can be received within the target time range.

[0011] Optionally, the financial data processing method further includes: when it is determined that the arrival timestamp exceeds the time range, determining unprocessed financial data from multiple batches of financial data received within the time range; and performing processing operations on the unprocessed financial data.

[0012] To achieve the above object, according to a second aspect of an embodiment of the present invention, a financial data processing device is provided, which is characterized by comprising: a data acquisition module, a window determination module and a window construction module; wherein:

[0013] The data acquisition module is used to obtain the arrival timestamp of the financial data to be processed; and to obtain the current data window; wherein the current data window is a time range that can receive multiple batches of financial data;

[0014] The window determination module is used to determine whether the arrival timestamp belongs to the time range of the current data window;

[0015] The window building module is used to build a new target data window for the financial data to be processed when it is determined that the arrival timestamp exceeds the time range; the target data window is time continuous with the current data window; and the financial data is processed within the target data window.

[0016] Optionally, the financial data processing device is used to determine whether the arrival timestamp belongs to the current data window, further comprising: when it is determined that the arrival timestamp belongs to the time range, processing the financial data within the time range corresponding to the current data window.

[0017] Optionally, the financial data processing device is used to obtain the data volume of the financial data to be processed; the construction of a new target data window for the financial data includes: when the data volume exceeds a set data volume threshold, re-determining the duration corresponding to a new target time range for the target data window, otherwise determining the duration of the time range of the current data window as the duration of the target time range; and constructing a new target data window based on the duration of the target time range.

[0018] Optionally, the financial data processing device is used to construct a new target data window for the financial data, including: obtaining the duration of a target time range corresponding to the target data window; determining the start time of the target data window, and calculating the end time of the target data window based on the start time of the target data window and the duration of the target time range; and constructing the target data window according to the start time of the target data window and the end time of the target data window.

[0019] Optionally, the financial data processing device is used to determine the starting time of the target data window, including: calculating the starting time of the target data window based on obtaining the arrival timestamp of the financial data to be processed, the duration of the time range corresponding to the current data window, and the starting time of the receivable financial data included in the time range of the current data window.

[0020] Optionally, the re-determining a new target time range further includes: determining a time range of a subsequent data window according to the duration of the new target time range and a start time at which financial data can be received within the target time range.

[0021] Optionally, the financial data processing device is further used to determine unprocessed financial data from multiple batches of financial data received within the time range when it is determined that the arrival timestamp exceeds the time range; and perform processing operations on the unprocessed financial data.

[0022] To achieve the above-mentioned purpose, according to the third aspect of an embodiment of the present invention, there is provided an electronic device for processing financial data, characterized in that it includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement any method as described in the above-mentioned financial data processing method.

[0023] To achieve the above-mentioned purpose, according to a fourth aspect of an embodiment of the present invention, a computer-readable medium (processing medium) is provided, on which a computer program is stored, characterized in that when the program is executed by a processor, a method as described in any one of the above-mentioned financial data processing methods is implemented.

[0024] An embodiment of the above invention has the following advantages or beneficial effects: it is possible to obtain the arrival timestamp of the financial data to be processed and the current data window; when it is determined that the arrival timestamp exceeds the time range, a new target data window is constructed for the financial data to be processed; the target data window is time-continuous with the current data window; and the financial data is processed within the target data window. The embodiment of the present invention overcomes the problem of data loss or data anomaly in receiving and processing financial data based on the data window constructed by the existing method by adaptively adjusting the data window and constructing a time-continuous data window; and improves the integrity and reliability of financial data processing.

[0025] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0027] Figure 1 It is a flowchart of a financial data processing method provided by an embodiment of the present invention;

[0028] Figure 2 It is a schematic diagram of a process for determining a target data window provided by an embodiment of the present invention;

[0029] Figure 3 is a schematic diagram of the structure of a financial data processing device provided by an embodiment of the present invention;

[0030] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0031] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0033] It should be noted that the collection, use, storage, sharing and transfer of user personal information involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, and it is necessary to inform the user and obtain the user's consent or authorization. When applicable, the user's personal information is de-identified and / or anonymized and / or encrypted. After collecting financial data, we will de-identify the data through technical means.

[0034] In Flink (a distributed data stream engine), there is a data processing mechanism called rolling windows (i.e., data windows), which allows data to be grouped and processed based on the time or number of elements in the data stream. This mechanism divides the data stream into windows of fixed size or fixed time interval, so that data can be aggregated, analyzed, or otherwise operated on these windows. Rolling windows play an important role in real-time data stream processing. It allows developers to divide data into multiple small blocks for batch-like calculations. This makes processing large-scale data (such as financial data) more efficient, and also allows batch-like operations to be performed on streaming data, such as aggregate statistics and time series analysis. Rolling windows allow developers to better control and organize data when processing real-time data to meet specific business needs. However, since Flink's default rolling window adjustment method is to obtain the timestamp of the current time, and then modulo the timestamp with the set rolling window size, the start and end times of the rolling window are determined. This default method has problems such as confusion in the start and end times of the window and incomplete calculations in specific financial scenarios.

[0035] In view of this, if Figure 1 As shown, an embodiment of the present invention provides a financial data processing method, which may include the following steps:

[0036] Step S101: Obtain the arrival timestamp of the financial data to be processed; and obtain the current data window; wherein the current data window is a time range that can receive multiple batches of financial data.

[0037] Specifically, an embodiment of the present invention provides an adaptive adjustment method for a data window (ie, a rolling window). The data window provided by the embodiment of the present invention overcomes the problem of financial data loss or anomaly caused by the data window in the existing method.

[0038] Get the arrival timestamp of the financial data to be processed. For example, you can use the function corresponding to the Flink context to get the data in the time range of the current window and the arrival timestamp of the financial data to be processed. For example, the arrival timestamp of the financial data to be processed obtained by the function is 15:03.

[0039] Furthermore, the current data window is a time range associated with the current time, which includes a time range consisting of a start time and an end time, for example: the current time window is [15:00-15:05], that is, the time range of the current time window is 5 minutes; it can be understood that within this time range, multiple batches of financial data can be received, and the timestamps of receiving each batch of financial data are different, for example: 15:01 to receive one batch of financial data, 15:02 to receive another batch of financial data. That is, the current data window is a time range that can receive multiple batches of financial data.

[0040] Step S102: Determine whether the arrival timestamp belongs to the time range of the current data window.

[0041] Specifically, according to the arrival timestamp of the financial data to be processed obtained in step S101, it is further determined whether the arrival timestamp belongs to the time range of the current data window; still taking the current time window in step S101 as an example, the current time window is [15:00-15:05]. If the arrival timestamp of the financial data to be processed obtained is 15:03, it means that the arrival timestamp of the financial data belongs to the time range of the current data window; further, in the case of determining that the arrival timestamp belongs to the time range, the financial data is processed within the time range corresponding to the current data window. If the arrival timestamp of the financial data to be processed obtained is 15:06, it means that the arrival timestamp of the financial data exceeds the time range of the current data window, and subsequent processing is performed according to the judgment result. It can be understood that the arrival timestamp of the financial data usually obtained is a time point after the current timestamp.

[0042] Step S103: when it is determined that the arrival timestamp exceeds the time range, construct a new target data window for the financial data to be processed; the target data window is time-continuous with the current data window; and the financial data is processed within the target data window.

[0043] Specifically, in addition to the situation described in the example of step S102, it is determined that the arrival timestamp exceeds the time range, and there is also a situation where the current data window is invalid, for example, the current timestamp exceeds the range of the current data window.

[0044] Furthermore, when it is determined that the arrival timestamp exceeds the time range, a new target data window is constructed for the financial data to be processed; the method for constructing a new target data window provided in an embodiment of the present invention makes the new target data window and the current data window continuous in time, that is, there is no overlap between adjacent data windows, and they are continuous and uninterrupted in time, that is, the target data window and the current data window are continuous in time.

[0045] Furthermore, the method for constructing a new target data window for the financial data to be processed is consistent with the description of step S201 to step S205, and will not be repeated here.

[0046] In financial business scenarios, since the data traffic volume reaches different sizes at different times, it is necessary to set an appropriate data window size based on the data volume to receive and process it, to prevent the downstream data processing system from crashing due to processing too much data in a short period of time, thereby preventing financial data loss and errors.

[0047] Furthermore, in an embodiment of the present invention, when it is determined that the arrival timestamp exceeds the time range, unprocessed financial data is determined from multiple batches of financial data received within the time range; and processing operations on the unprocessed financial data are performed. In an embodiment of the present invention, when it is determined that the arrival timestamp exceeds the time range, in addition to constructing a new target data window for the financial data to be processed, an operation of sending the unprocessed financial data in the current data window to a downstream data processing unit is performed, thereby improving the consistency and integrity of financial data processing.

[0048] like Figure 2 As shown, an embodiment of the present invention provides a schematic diagram of a process for determining a target data window, and the process may include the following steps:

[0049] Step S201: Acquire the data volume of the financial data to be processed.

[0050] Step S202: Determine whether the data volume exceeds the set data volume threshold, if yes, execute step S203, otherwise execute step S204.

[0051] Step S203: re-determine a new target time range for the target data window.

[0052] Step S204: Determine the time range of the current data window as the target time range.

[0053] Step S205: constructing a new target data window based on the target time range.

[0054] Steps S201 to S205 describe: obtaining the data volume of the financial data to be processed; constructing a new target data window for the financial data, including: when the data volume exceeds a set data volume threshold, re-determining the duration corresponding to a new target time range for the target data window, otherwise determining the duration of the time range of the current data window as the duration of the target time range; and constructing a new target data window based on the duration of the target time range.

[0055] Specifically, in an embodiment of the present invention, after determining to construct a new target data window for the financial data, the size of the new target data window (i.e., the duration of the target time range) is determined according to the amount of financial data to be processed. The duration of the new target time range can be obtained through the function corresponding to the Flink context, or determined according to the corresponding relationship between the amount of historical financial data and the time range of the data window. The data volume threshold can also be set according to the application scenario of the financial data. If the data volume exceeds the set data volume threshold, a new target time range is re-determined for the target data window, otherwise the duration of the time range of the current data window is determined as the duration of the target time range; a new target data window is constructed based on the duration of the target time range; for example: if the data volume of the financial data to be processed does not exceed the set data volume threshold, the duration (5 minutes) of the time range of the current data window (assuming [15:00-15:05]) is used as the duration of the target time range of the new target data window. For example, the target time range of the newly constructed target data window is [15:05-15:10]; it can be understood that if the data volume exceeds the set data volume threshold, the duration of the target time range corresponding to the new target data window can be greater than the duration (5 minutes) of the time range of the current data window. Assuming that the duration of the new target time range is 8 minutes, the target time range of the new target data window is determined to be [15:05-15:13].

[0056] Furthermore, when determining a new target data window, in order to make each data window continuous in time, it is necessary to determine a corresponding start time for the new target data window, and then calculate the end time of the target data window based on the start time and the duration of the target time range; that is, constructing a new target data window for the financial data, including: obtaining the duration of the target time range corresponding to the target data window; determining the start time of the target data window, and calculating the end time of the target data window based on the start time of the target data window and the duration of the target time range; constructing the target data window according to the start time of the target data window and the end time of the target data window.

[0057] Furthermore, determining the start time of the target data window includes: calculating the start time of the target data window based on obtaining the arrival timestamp of the financial data to be processed, the duration of the time range corresponding to the current data window, and the start time of the receivable financial data included in the time range of the current data window.

[0058] The following example illustrates the process of determining the target data window, as shown in steps 1) to 7):

[0059] Through the specified function in the context of Flink window computing processing, you can obtain: the data reception start time start of the current data window, the data reception end time end, the arrival timestamp now of the financial data to be processed, and the duration W of the current data window old And the length of the new target data window W new .

[0060] 1) Compare W old With W new Are they equal? ​​If they are equal, execute 4), otherwise execute 2);

[0061] 2) Compare end and now. If now is greater than or equal to end, execute 3). Otherwise, execute 5);

[0062] 3) Calculate the start time of the new target data window start_new, the calculation formula is start_new = modulo ((now-start) / W old )*W old +start, and further calculate the end time of the new target data window end_new based on start_new. The calculation formula is end_new=start_new+W old That is, redefine the new target time range of the new target data window.

[0063] 4) Use the same method as 3) to calculate the start_new and end_new of the new target data window; and set the W of the new target data window new Assign to W old , will soon new The basis for subsequent adjustment of the duration of the data window, i.e., the re-determination of the new target time range, further includes: determining the time range of the subsequent data window according to the duration of the new target time range and the starting time when financial data can be received within the target time range.

[0064] 5) The duration of the current data window is used as the duration of the new target data window;

[0065] 6) Create a new target data window based on start_new and end_new;

[0066] 7) Output various data of the new target data window.

[0067] like Figure 3 As shown, the embodiment of the present invention provides a financial data processing device 300, including: a data acquisition module 301, a window determination module 302 and a window construction module 303; wherein,

[0068] The data acquisition module 301 is used to acquire the arrival timestamp of the financial data to be processed; and to acquire the current data window; wherein the current data window is a time range that can receive multiple batches of financial data;

[0069] The determining window module 302 is used to determine whether the arrival timestamp belongs to the time range of the current data window;

[0070] The window building module 303 is used to build a new target data window for the financial data to be processed when it is determined that the arrival timestamp exceeds the time range; the target data window is time-continuous with the current data window; and the financial data is processed within the target data window.

[0071] An embodiment of the present invention also provides a financial data processing electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in any of the above embodiments.

[0072] An embodiment of the present invention further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method provided in any of the above embodiments is implemented.

[0073] Figure 4An exemplary system architecture 400 is shown to which the financial data processing method or financial data processing device according to the embodiment of the present invention can be applied.

[0074] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0075] The user can use the terminal devices 401, 402, 403 to interact with the server 405 through the network 404 to receive or send messages, etc. Various client applications, such as financial product client applications, can be installed on the terminal devices 401, 402, 403.

[0076] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting various client applications, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0077] The server 405 may be a server that provides various services, such as a background management server that provides support for client applications used by users using terminal devices 401, 402, and 403. The background management server may process the received financial data, obtain the arrival timestamp of the financial data to be processed, and obtain the current data window; determine whether the arrival timestamp belongs to the time range of the current data window; if it is determined that the arrival timestamp exceeds the time range, construct a new target data window for the financial data to be processed; the target data window is time-continuous with the current data window; and process the financial data within the target data window.

[0078] It should be noted that the financial data processing method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the financial data processing device is generally disposed in the server 405 .

[0079] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0080] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0081] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0082] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0083] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0084] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0085] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0086] The modules and / or units involved in the embodiments of the present invention may be implemented in software or hardware. The modules and / or units described may also be set in a processor, for example, they may be described as: a processor includes a data acquisition module, a window determination module, and a window construction module. The names of these modules do not, in some cases, constitute a limitation on the modules themselves, for example, the data acquisition module may also be described as a "module for acquiring the arrival timestamp of the financial data to be processed and acquiring the current data window".

[0087] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining the arrival timestamp of the financial data to be processed; and obtaining the current data window; wherein the current data window is a time range that can receive multiple batches of financial data; determining whether the arrival timestamp belongs to the time range of the current data window; if it is determined that the arrival timestamp exceeds the time range, constructing a new target data window for the financial data to be processed; the target data window is time-continuous with the current data window; and processing the financial data within the target data window.

[0088] The embodiments of the present invention can obtain the arrival timestamp of the financial data to be processed and the current data window; when it is determined that the arrival timestamp exceeds the time range, a new target data window is constructed for the financial data to be processed; the target data window is time-continuous with the current data window; and the financial data is processed within the target data window. The embodiments of the present invention overcome the problem of data loss or data anomaly in receiving and processing financial data based on the data window constructed by the existing method by adaptively adjusting the data window and constructing a time-continuous data window; and improve the integrity and reliability of financial data processing.

[0089] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for processing financial data, It is characterized in that include: Get the arrival timestamp of the financial data to be processed; and obtaining a current data window; wherein the current data window is a time range that can receive multiple batches of financial data; Determine whether the arrival timestamp belongs to the time range of the current data window; In the case where it is determined that the arrival timestamp exceeds the time range, constructing a new target data window for the financial data to be processed; the target data window is time continuous with the current data window; The method further includes: obtaining the data volume of the financial data to be processed; wherein, constructing a new target data window for the financial data to be processed includes: when the data volume exceeds a set data volume threshold, re-determining the duration corresponding to a new target time range for the target data window; wherein the duration corresponding to the target time range of the new target data window is greater than the duration of the time range of the current data window; The financial data is processed within the target data window.

2. The method according to claim 1, It is characterized in that The determining whether the arrival timestamp belongs to the time range of the current data window further includes: in the case where it is determined that the arrival timestamp belongs to the time range, processing the financial data within the time range corresponding to the current data window.

3. The method according to claim 1, It is characterized in that The step of constructing a new target data window for the financial data to be processed includes: When the data volume does not exceed the set data volume threshold, determining the duration of the time range of the current data window as the duration of the target time range; A new target data window is constructed based on the duration of the target time range.

4. The method according to claim 1 or 3, It is characterized in that Constructing a new target data window for the financial data to be processed, including: Obtaining the duration of the target time range corresponding to the target data window; Determine the start time of the target data window, and calculate the end time of the target data window based on the start time of the target data window and the duration of the target time range; The target data window is constructed according to the start time of the target data window and the end time of the target data window.

5. The method according to claim 4, It is characterized in that Determining the start time of the target data window includes: The start time of the target data window is calculated based on the arrival timestamp of the financial data to be processed, the duration of the time range corresponding to the current data window, and the start time of the receivable financial data included in the time range of the current data window.

6. The method according to claim 3, It is characterized in that The re-determining the duration corresponding to the new target time range for the target data window further includes: The time range of the subsequent data window is determined according to the duration of the new target time range and the starting time when the financial data can be received within the target time range.

7. The method according to claim 1, It is characterized in that Further including: In the case where it is determined that the arrival timestamp exceeds the time range, unprocessed financial data is determined from multiple batches of financial data received within the time range; and a processing operation is performed on the unprocessed financial data.

8. A financial data processing device, It is characterized in that include: Get data module, determine window module and build window module; among them, The data acquisition module is used to obtain the arrival timestamp of the financial data to be processed; and to obtain the current data window; wherein the current data window is a time range that can receive multiple batches of financial data; The window determination module is used to determine whether the arrival timestamp belongs to the time range of the current data window; The window building module is used to build a new target data window for the financial data to be processed when it is determined that the arrival timestamp exceeds the time range; the target data window is time-continuous with the current data window; and the financial data is processed within the target data window; The device is also used to obtain the data volume of the financial data to be processed; the construction of a new target data window for the financial data to be processed includes: when the data volume exceeds a set data volume threshold, re-determining the duration corresponding to a new target time range for the target data window; wherein the duration of the target time range corresponding to the new target data window is greater than the duration of the time range of the current data window.

9. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Data aggregation method and device, electronic equipment and computer storage medium

    CN116755584A

  • Data processing method and device, electronic equipment and storage medium

    CN118427220A