Method and device for updating service data, computer device and readable storage medium
Patent Information
- Application Number
- CN202211552033.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-05
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-12-05
AI Technical Summary
但此种方式对系统有较高的性能负荷,占用资源较多,进而导致系统运营成本较高
[0015]本发明实施例公开的业务数据的更新方法中,服务器将根据当前周期的第一时间段内不断接收到的实时处理数据交互请求,对目标业务数据进行更新,进而得到第一业务数据,并记录每个实时处理数据交互请求对应的更新信息以生成业务数据更新记录;接着,基于业务数据更新记录和在当前时期的预设时间点接收到的离线批量数据交互请求,对目标业务数据进行离线批量数据的更新,及利用第一时间段内的数据进行补录,从而得到第二业务数据;然后,实时根据当前周期的第二时间段内接收到的实时处理数据交互请求,实时对第二业务数据进行更新以得到第三业务数据;最后,在第二时间段的末尾时间点,将第三业务数据设置为下个周期的目标业务数据。
Smart Images

Figure CN115774726B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing, and more particularly to a method, apparatus, computer device, and readable storage medium for updating business data. Background Technology
[0002] In online analytical processing (OLAP) operations, data typically undergoes complex analysis and processing, resulting in lengthy processing times. Therefore, the timeliness requirement for data is relatively low, and data updates are usually performed offline in batch processing with a low update frequency. In contrast, online transaction processing (OLTP) operations have a higher requirement for real-time data processing, and because the business logic for data processing is simpler, the data update frequency is higher.
[0003] In real-world operating environments such as financial transaction data processing, online analytical processing (OLAP) and online transaction processing (OLTP) are typically performed in parallel. To ensure the correct execution of OLTP, a real-time stream-batch processing approach is often used to complete both OLAP and OLTP. However, this approach places a high performance load on the system, consumes significant resources, and consequently leads to high system operating costs. Summary of the Invention
[0004] In view of this, the present invention provides a method, apparatus, computer equipment and readable storage medium for updating business data that can be applied to fields such as financial technology or other technology fields, in order to improve the current situation where real-time batch processing has a high performance load on the system, consumes a lot of resources, and thus leads to high system operating costs.
[0005] In a first aspect, embodiments of the present invention provide a method for updating business data, applied to a server, wherein the server stores target business data for the current period, the server is used to receive real-time processing data interaction requests generated in real time and offline batch data interaction requests generated at a preset time point, a period includes a first time period and a second time period, the end time point of the first time period is the preset time point, the method includes updating the target business data to obtain first business data when the real-time processing data interaction request is received in the first time period of the current period, and generating a business data update record; Based on the business data update record and the offline batch data interaction request received at a preset time point in the current period, the target business data is updated to generate second business data; When the real-time processing data interaction request is received during the second time period of the current cycle, the second business data is updated to obtain the third business data; At the end of the second time period within the current cycle, the third business data is set as the target business data for the next cycle.
[0006] Optionally, in one feasible embodiment of the present invention, updating the target business data to generate second business data based on the business data update record and the offline batch data interaction request received at a preset time point in the current period includes: Based on the offline batch data interaction request received at a preset time point in the current period, the target business data is updated to obtain the data to be supplemented. Based on the business data update record, the data to be supplemented is supplemented to obtain the second business data.
[0007] Optionally, in one feasible embodiment of the present invention, the server is equipped with database software, which is used to store the target business data and the first business data respectively using two partition tables. The server completes the processing of the real-time data interaction request or the offline batch data interaction request through the partition table pointed to by the data address pointer of the database software. The step of updating the target business data based on the offline batch data interaction request received at a preset time point in the current period to obtain the data to be supplemented includes: When an offline batch data interaction request is received at a preset time point in the current period, a partition table exchange operation is performed to point the data address pointer of the database software to the partition table to which the target business data belongs. Based on the received offline batch data interaction request, the target business data is updated to obtain the data to be supplemented.
[0008] Optionally, in one feasible embodiment of the present invention, the business data update record includes the changed data and change time corresponding to each real-time processing data interaction request within the first time period of the current cycle; The process of supplementing the data to be supplemented based on the business data update record to obtain the second business data includes: Based on the changed data and change time corresponding to each real-time processing data interaction request in the data update record, the data to be supplemented is changed sequentially according to the time order of the change time to obtain the second business data.
[0009] Secondly, embodiments of the present invention provide a business data updating device applied to a server. The server stores target business data for the current period. The server is used to receive real-time processing data interaction requests generated in real time and offline batch data interaction requests generated at a preset time point. A period includes a first time period and a second time period, the end time point of the first time period being the preset time point. The device includes: The first update module is used to update the target business data to obtain the first business data and generate a business data update record when the real-time processing data interaction request is received in the first time period of the current cycle. The second update module is used to update the target business data based on the business data update record and the offline batch data interaction request received at a preset time point in the current period to generate second business data. The third update module is used to update the second business data to obtain the third business data when the real-time processing data interaction request is received during the second time period of the current cycle. The setting module is used to set the third business data as the target business data for the next period at the end of the second time period within the current cycle.
[0010] Optionally, in one feasible embodiment of the present invention, the second update module includes: The data to be supplemented generation submodule is used to update the target business data based on the offline batch data interaction request received at a preset time point in the current period to obtain the data to be supplemented. The supplementary recording submodule is used to supplement the data to be supplemented based on the business data update record, so as to obtain the second business data.
[0011] Optionally, in one feasible embodiment of the present invention, the server is equipped with database software, which is used to store the target business data and the first business data respectively using two partition tables. The server completes the processing of the real-time data interaction request or the offline batch data interaction request through the partition table pointed to by the data address pointer of the database software. The data to be supplemented generation submodule includes: The exchange unit is used to perform a partition table exchange operation when an offline batch data interaction request is received at a preset time point in the current period, so as to point the data address pointer of the database software to the partition table to which the target business data belongs. The request processing unit is used to update the target business data based on the received offline batch data interaction request to obtain the data to be supplemented.
[0012] Optionally, in one feasible embodiment of the present invention, the business data update record includes the changed data and change time corresponding to each real-time processing data interaction request within the first time period of the current cycle; The data supplementation submodule is also used to modify the data to be supplemented sequentially according to the chronological order of the change times, based on the changed data and change time corresponding to each real-time data interaction request in the data update record, to obtain the second business data.
[0013] Thirdly, embodiments of the present invention provide a computer device, including a memory and a processor. The memory stores a computer program, and the computer program, when running on the processor, executes a business data update method as disclosed in any of the first aspects.
[0014] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when run on a processor, executes a method for updating business data as disclosed in any of the first aspects.
[0015] In the business data update method disclosed in this embodiment of the invention, the server updates the target business data based on the real-time processing data interaction requests continuously received within the first time period of the current cycle, thereby obtaining the first business data, and records the update information corresponding to each real-time processing data interaction request to generate a business data update record; then, based on the business data update record and the offline batch data interaction requests received at a preset time point in the current period, the target business data is updated offline batch data, and supplemented using the data within the first time period, thereby obtaining the second business data; then, based on the real-time processing data interaction requests received within the second time period of the current cycle, the second business data is updated in real time to obtain the third business data; finally, at the end of the second time period, the third business data is set as the target business data for the next cycle.
[0016] Based on this, embodiments of the present invention enable the alternating processing of offline batch data interaction requests in online analytical processing (OLAP) scenarios and real-time data interaction requests in online transaction processing (OLTP) scenarios. This allows the server to complete offline batch data interaction requests and real-time data interaction requests in parallel with lower hardware costs and performance. Furthermore, embodiments of the present invention also utilize data processing records to supplement the data corresponding to the data processing records during the processing of offline batch data interaction requests, ensuring data consistency across different time periods. Attached Figure Description
[0017] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope of protection of the present invention. In the various drawings, similar components are numbered similarly.
[0018] Figure 1 A flowchart illustrating the first method for updating business data provided in an embodiment of the present invention is shown; Figure 2 A flowchart illustrating a second method for updating business data provided in an embodiment of the present invention is shown; Figure 3 A flowchart illustrating the third method for updating business data provided in an embodiment of the present invention is shown; Figure 4 A schematic diagram of the structure of the business data updating device provided in an embodiment of the present invention is shown. Detailed Implementation
[0019] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0020] The components of the embodiments of the invention described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0021] In the following, the terms “comprising,” “having,” and their cognates, which may be used in various embodiments of the invention, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as excluding, firstly, the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations thereof.
[0022] Furthermore, the terms "first," "second," and "third" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0023] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of the invention pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be interpreted as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of the invention.
[0024] To better illustrate the technical solutions of the various embodiments of the present invention, the prior art is briefly described as follows: In online transaction processing systems, there are often two types of business requirements: online transaction processing (OLAP) and online analytical processing (OLAP).
[0025] In the business logic of online transaction processing (OLTP), most business requests involve timely data updates and other timely processing; therefore, requests need to be processed / responded to within a short period of time. Simultaneously, OLTP business logic typically supports a large number of concurrent users periodically adding / modifying data, involving numerous data addition, deletion, and modification operations.
[0026] Furthermore, in online transaction processing (OLTP) business scenarios, data is updated frequently, resulting in good real-time performance. Typically, the data in OLTP is continuously updated throughout the day.
[0027] It's easy to imagine that online transaction processing (OLTP) can be used in various business scenarios, including but not limited to ticket booking in ticketing systems, teller transactions in banking systems, and transaction records in the market.
[0028] Online analytical processing (OLAP) is typically used for data analysis, involving multi-dimensional and multi-level in-depth analysis of data and querying massive amounts of data.
[0029] Meanwhile, because data analysis takes time and typically analyzes data within a specific time period, online analytical processing (OLAP) requests have lower real-time requirements and do not require immediate responses, and the corresponding data update frequency is also low. Therefore, OLAP data is usually updated offline in batch processing.
[0030] Therefore, in parallel processing systems of online transaction processing and online analytical processing, it is usually necessary to design corresponding requests for the two types of processing. The real-time stream batch processing is often used to complete the two types of processing, but this method has high requirements for server performance and high hardware costs.
[0031] Example 1 Reference Figure 1The diagram illustrates a flowchart of a first method for updating business data according to an embodiment of the present invention. The method for updating business data according to an embodiment of the present invention is applied to a server. The server stores target business data for the current period. The server is used to receive real-time processing data interaction requests generated in real time and offline batch data interaction requests generated at a preset time point. A period includes a first time period and a second time period. The end time point of the first time period is the preset time point.
[0032] It should be noted that the real-time data interaction request in this embodiment of the invention can be understood as a business processing request in an online transaction processing scenario. This request is generated continuously throughout the entire cycle and needs to be processed and responded to promptly, thus requiring high real-time performance. In contrast, the offline batch data interaction request can be understood as a business processing request under online analytical processing (OLAP), which is generated only at specific points in time.
[0033] It should also be noted that the period in the embodiments of the present invention can be set according to the actual situation. For example, in one instance, the aforementioned period is from 0 to 24 o'clock in a day, and the preset time point is 6 o'clock. Therefore, the first time period is from 0 to 6 o'clock, and the second time period is from 6 to 24 o'clock.
[0034] In another feasible embodiment of the present invention, the aforementioned cycle is Monday to Sunday of a week, with the preset time point being 0:00 on Wednesday. Therefore, the first time period is from 0:00 on Monday to 24:00 on Tuesday, and the second time period is from 0:00 on Wednesday to 24:00 on Sunday.
[0035] Furthermore, it is understood that the target business data in this embodiment of the invention refers to the data that needs to be updated and accessed, and there is a corresponding set of target business data for each period. It should be clarified that in the current period, when the server completes the update of the target business data according to the received request, the updated target business data becomes the target business data for the next period. That is, the target business data for the next period depends on the update of the target business data for the previous period.
[0036] Furthermore, it is not difficult to imagine that the target business data in the embodiments of the present invention is stored in database software, and therefore, the server in the embodiments of the present invention is equipped with database software.
[0037] Based on this, the method for updating business data provided in this embodiment of the invention specifically includes the following steps S110 to S140, as follows: Step S110: When the real-time processing data interaction request is received within the first time period of the current cycle, the target business data is updated to obtain the first business data, and a business data update record is generated.
[0038] As an example, using a period of 0:00 to 24:00 within a day, with a preset time point of 6:00, the first time period is from 0:00 to 6:00, and the second time period is from 6:00 to 24:00. When the server receives a real-time data interaction request from the front-end system or client system between 0:00 and 6:00 today, it will determine the target data to be updated / deleted / added in the target business data based on the information carried in the real-time data interaction request, and after determining the business logic corresponding to the target data, it will execute the corresponding business logic operation on the target data in the target business data, thereby completing the processing of the real-time data interaction request.
[0039] It is understandable that real-time data interaction requests will be generated continuously from 0:00 to 24:00. Before 6:00, that is, during the first time period from 0:00 to 6:00, the server does not receive offline batch data interaction requests. In other words, the target business data in the first time period is actually unreal / untimely data because the offline batch data interaction requests in the current period have not been processed and the corresponding data has not been updated. Therefore, the processing results corresponding to the real-time data interaction requests in the first time period may deviate from the actual situation.
[0040] To address this issue, in this embodiment of the invention, during the first time period, each time a real-time data interaction request is received and processed, the processing details are recorded, i.e., a business data update record is generated. Then, after subsequent operations to update the target business data using offline batch data interaction requests are executed, the updated data is supplemented / re-run based on the recorded content.
[0041] Understandably, the content to be recorded is set according to the actual situation, which may include the identifier of the target data to be processed and the update / deletion / addition time of the target data.
[0042] Step S120: Based on the business data update record and the offline batch data interaction request received at a preset time point in the current period, update the target business data to generate second business data.
[0043] As an example, taking the aforementioned period as 0:00 to 24:00 within a day, with a preset time of 6:00, at the end of the first data segment of the day and the beginning of the second time segment, i.e., at 6:00, this embodiment of the invention will update the data related to online analytical processing in the target business data according to the received offline batch data interaction request.
[0044] Meanwhile, to avoid data loss due to changes caused by real-time data interaction requests processed before 6 o'clock, this embodiment of the invention will supplement the updated data based on the processing records of real-time data interaction requests from 0 to 6 o'clock, i.e., business data update records.
[0045] Therefore, after updating the target business data based on the business data update record and the offline batch data interaction request target data, that is, after generating the second business data, any real-time processing data interaction request within the second time period can complete the request processing with today's latest data, making the processing result of the real-time processing data interaction request more realistic.
[0046] Furthermore, it should be noted that the update of the target data based on the business data update record and the offline batch data interaction request is for the target business data, not for the first business data. That is, the embodiment of the present invention will update the target business data at 0 o'clock, rather than the first business data generated by the real-time processing data interaction request from 0 to 6 o'clock.
[0047] Step S130: When the real-time processing data interaction request is received during the second time period of the current cycle, the second business data is updated to obtain the third business data.
[0048] In other words, the server will continuously update the second business data based on the real-time data interaction requests received from 6 to 24 o'clock to generate the corresponding third business data.
[0049] It is understood that the third business data in this embodiment of the invention does not refer to the data generated by the server after updating the aforementioned second business data based on a real-time processing data interaction request, but rather to the data generated / obtained by the server after updating the second business data based on all real-time processing data interaction requests received within the entire second data segment.
[0050] It is also understandable that the aforementioned first business data is also the data obtained by the server continuously updating the target business data based on the real-time processing data interaction requests received continuously within the first time period.
[0051] Step S140: At the end of the second time period within the current cycle, the third business data is set as the target business data for the next cycle.
[0052] As an example, using the aforementioned cycle of 0:00 to 24:00 within a day, with a preset time of 6:00, the server will set the aforementioned second business data as the target business data for the next day / tomorrow at 24:00 today. Thus, when the next cycle begins, the server will start a new round of target business data updates.
[0053] Based on this, embodiments of the present invention enable the alternating processing of offline batch data interaction requests in online analytical processing (OLAP) scenarios and real-time data interaction requests in online transaction processing (OLTP) scenarios. This allows the server to complete offline batch data interaction requests and real-time data interaction requests in parallel with lower hardware costs and performance. Furthermore, embodiments of the present invention also utilize data processing records to supplement the data corresponding to the data processing records during the processing of offline batch data interaction requests, ensuring data consistency across different time periods.
[0054] Optionally, in one feasible embodiment of the present invention, please refer to the following: Figure 2 This illustrates a flowchart of a second method for updating business data provided by an embodiment of the present invention. Specifically, for step S120 above, this feasible method includes: Step S121: Based on the offline batch data interaction request received at a preset time point in the current period, update the target business data to obtain the data to be supplemented. Step S122: Based on the business data update record, supplement the data to be supplemented to obtain the second business data.
[0055] In other words, when updating data at a preset time point, this embodiment of the invention first uses offline batch data interaction requests to update the target business data to ensure that data related to online analytical processing (OLAP) can be modified, added, or deleted. It is understood that the data generated in this update does not include the updated data from the first time period; therefore, the data generated at this time is data to be supplemented.
[0056] After generating the data to be supplemented, the server adds / modifies / deletes the data corresponding to each real-time data interaction request within the first time period into the data to be supplemented, based on the business data update record generated in step S110. Thus, except for the data corresponding to the offline batch data interaction request, the first business data and the second business data will remain consistent.
[0057] Optionally, in one feasible embodiment of the present invention, please refer to the following: Figure 3 The diagram illustrates a flowchart of a second method for updating business data provided in an embodiment of the present invention. In this feasible mode, the server is equipped with database software, which is used to store the target business data and the first business data in two partition tables respectively. The server completes the processing of the real-time data interaction request or the offline batch data interaction request through the partition table pointed to by the data address pointer of the database software. Furthermore, regarding step S121 above, this feasible method specifically includes: Step S123: When an offline batch data interaction request is received at a preset time point in the current period, a partition table exchange operation is performed to point the data address pointer of the database software to the partition table to which the target business data belongs. Step S124: Based on the received offline batch data interaction request, update the target business data to obtain the data to be supplemented.
[0058] In other words, the server in this embodiment of the invention will complete the corresponding business logic based on the data pointed to by the data address pointer. Therefore, this embodiment of the invention will complete the data alternation based on the modification of the data address pointer.
[0059] Specifically, at the beginning of the first time period, the data address pointer in the server points to the target business data. At the end of the first time period, that is, at the preset time point, the data address pointer in the server points to the first business data.
[0060] Furthermore, since the first business data deviates from the actual situation and there is no updated data corresponding to the offline batch data interaction request, this embodiment of the invention will make the data address pointer point to the partition table of the target business data, that is, point to the target business data, based on the change of the data address pointer.
[0061] Therefore, subsequent data update operations will be based on the target business data, ensuring the effective processing of offline batch data interaction requests and efficiently completing changes to business data, thereby improving the efficiency of alternating processing of the two types of offline batch data interaction requests and real-time data interaction requests.
[0062] Optionally, in one feasible approach provided by an embodiment of the present invention, the server will complete the aforementioned change of the data address pointer based on ElasticSearch's index alias switching function.
[0063] Optionally, in one feasible embodiment of the present invention, the business data update record includes the changed data and change time corresponding to each real-time processing data interaction request within the first time period of the current cycle; Furthermore, regarding the aforementioned step S122, this feasible method specifically includes: Based on the changed data and change time corresponding to each real-time processing data interaction request in the data update record, the data to be supplemented is changed sequentially according to the time order of the change time to obtain the second business data.
[0064] That is, in the first time period, when the server in the embodiment of the present invention receives a real-time data interaction request and processes the received real-time data interaction request, it will determine the corresponding data to be updated, i.e., the changed data, according to the real-time data interaction request; and record the update time of the changed data, i.e. the change time.
[0065] Therefore, in subsequent data supplementation operations, the server in this embodiment of the invention will update the data to be supplemented in the order of the change time, one by one, to ensure that the update time of the data to be supplemented is consistent with the processing time of the corresponding real-time data interaction request, thereby further ensuring the consistency between the second business data and the first business data.
[0066] Example 2 Corresponding to the business data updating method provided in Embodiment 1 of the present invention, Embodiment 2 of the present invention also provides a business data updating device, referring to... Figure 4 This diagram illustrates the structure of a business data updating device provided in an embodiment of the present invention. The business data updating device 200 provided in this embodiment is applied to a server. The server stores target business data for the current period. The server is used to receive real-time processing data interaction requests generated in real time and offline batch data interaction requests generated at a preset time point. A period includes a first time period and a second time period, with the end of the first time period being the preset time point. The device includes: The first update module 210 is used to update the target business data to obtain the first business data and generate a business data update record when the real-time processing data interaction request is received in the first time period of the current cycle. The second update module 220 is used to update the target business data based on the business data update record and the offline batch data interaction request received at a preset time point in the current period to generate second business data. The third update module 230 is used to update the second business data to obtain the third business data when the real-time processing data interaction request is received during the second time period of the current cycle. The setting module 240 is used to set the third business data as the target business data for the next period at the end of the second time period within the current period.
[0067] Optionally, in one feasible embodiment of the present invention, the second update module includes: The data to be supplemented generation submodule is used to update the target business data based on the offline batch data interaction request received at a preset time point in the current period to obtain the data to be supplemented. The supplementary recording submodule is used to supplement the data to be supplemented based on the business data update record, so as to obtain the second business data.
[0068] Optionally, in one feasible embodiment of the present invention, the server is equipped with database software, which is used to store the target business data and the first business data respectively using two partition tables. The server completes the processing of the real-time data interaction request or the offline batch data interaction request through the partition table pointed to by the data address pointer of the database software. The data to be supplemented generation submodule includes: The exchange unit is used to perform a partition table exchange operation when an offline batch data interaction request is received at a preset time point in the current period, so as to point the data address pointer of the database software to the partition table to which the target business data belongs. The request processing unit is used to update the target business data based on the received offline batch data interaction request to obtain the data to be supplemented.
[0069] Optionally, in one feasible embodiment of the present invention, the business data update record includes the changed data and change time corresponding to each real-time processing data interaction request within the first time period of the current cycle; The data supplementation submodule is also used to modify the data to be supplemented sequentially according to the chronological order of the change times, based on the change data and change time corresponding to each real-time data interaction request in the data update record, to obtain the second business data.
[0070] The business data updating device 200 provided in this application embodiment can implement each process of the business data updating method corresponding to Embodiment 1 and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0071] This invention also provides a computer device, including a memory and a processor. The memory stores a computer program, and the computer program executes a business data update method as described in Embodiment 1 when it runs on the processor.
[0072] This invention also provides a computer-readable storage medium storing a computer program, which executes a business data update method as described in Embodiment 1 when run on a processor.
[0073] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that, as an alternative implementation, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0074] In addition, the functional modules or units in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0075] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a smartphone, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0076] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for updating business data, characterized in that, Applied to a server, the server stores target business data for the current period. The server is used to receive real-time data processing interaction requests generated in real time and offline batch data interaction requests generated at a preset time point. A period includes a first time period and a second time period, the end time point of the first time period being the preset time point. The method includes: During the first time period, each time a real-time data interaction request is received and the received real-time data interaction request is processed, the corresponding required change data will be determined according to the real-time data interaction request, and the update time of the change data will be recorded as the change time. When the real-time data interaction request is received within the first time period of the current cycle, the target business data is updated to obtain the first business data, and a business data update record is generated. The business data update record includes the changed data and change time corresponding to each real-time data interaction request within the first time period of the current cycle. The server is equipped with database software, which is used to store the target business data and the first business data using two partition tables respectively. The server completes the processing of the real-time data interaction request or the offline batch data interaction request through the partition table pointed to by the data address pointer of the database software. When an offline batch data interaction request is received at a preset time point in the current period, a partition table exchange operation is performed to point the data address pointer of the database software to the partition table to which the target business data belongs; based on the received offline batch data interaction request, the target business data is updated to obtain the data to be supplemented. Based on the changed data and change time corresponding to each real-time processing data interaction request in the business data update record, the data to be supplemented is changed sequentially according to the time order of the change time to obtain the second business data; When the real-time processing data interaction request is received during the second time period of the current cycle, the second business data is updated to obtain the third business data; At the end of the second time period within the current cycle, the third business data is set as the target business data for the next cycle.
2. A business data updating device, characterized in that, An application is made to a server that stores target business data for the current period. The server receives real-time data processing interaction requests generated in real-time and offline batch data interaction requests generated at preset time points. A period includes a first time period and a second time period, with the end of the first time period being the preset time point. The device includes: The first update module is used to, within the first time period, whenever a real-time data interaction request is received and the received real-time data interaction request is processed, determine the corresponding required change data according to the real-time data interaction request, and record the update time of the change data as the change time. When the real-time data interaction request is received within the first time period of the current cycle, the target business data is updated to obtain the first business data, and a business data update record is generated. The business data update record includes the changed data and change time corresponding to each real-time data interaction request within the first time period of the current cycle. The server is equipped with database software, which is used to store the target business data and the first business data using two partition tables respectively. The server completes the processing of the real-time data interaction request or the offline batch data interaction request through the partition table pointed to by the data address pointer of the database software. The second update module includes a data to be supplemented sub-module, which includes an exchange unit and a request processing unit. The exchange unit is used to perform a partition table exchange operation when an offline batch data interaction request is received at a preset time point in the current period, so as to point the data address pointer of the database software to the partition table to which the target business data belongs. The request processing unit is used to update the target business data based on the received offline batch data interaction request to obtain the data to be supplemented. The supplementary recording submodule is used to supplement the data to be supplemented based on the business data update record to obtain the second business data; The supplementary recording submodule is also used to modify the data to be supplemented in sequence according to the chronological order of the change time, based on the change data and change time corresponding to each real-time processing data interaction request in the business data update record, to obtain the second business data; The third update module is used to update the second business data to obtain the third business data when the real-time processing data interaction request is received during the second time period of the current cycle. The setting module is used to set the third business data as the target business data for the next period at the end of the second time period within the current cycle.
3. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program that, when run on the processor, executes the business data update method as described in claim 1.
4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed on a processor, performs the business data update method as described in claim 1.
Citation Information
Patent Citations
Real-time request receiving system, method and program, and medium
JP2004171339A