A report updating method and device based on data storage
By using the data offset as an identifier in the data storage and sending the target offset to the data calculation module, the problem of inconsistent calculation results on the same report page is solved, and the dynamic consistency and strong correlation display of data are achieved.
Patent Information
- Application Number
- CN202211129884.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-16
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-09-16
AI Technical Summary
On the same report page, the calculation results of each data calculation module cannot be dynamically kept consistent and the data correlation is poor, resulting in inconsistent displayed data.
By using the data offset as the unique sequence identifier of the data in the data storage, the target data offset is sent to the data calculation module to ensure that each module reads the same data offset at the same time, stops reading and then performs calculations, and updates the report after receiving the results of all modules.
The consistency of calculation results and data correlation of the data calculation modules on the same report page are achieved, ensuring the accuracy and consistency of the displayed data.
Smart Images

Figure CN115658703B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a report updating method and device based on a data storage device, an electronic device, and a computer-readable storage medium. Background Art
[0002] In the era of big data, data has become a crucial factor in business production. To better understand the dynamics of business data, real-time reports that automatically update when business systems update relevant data have emerged.
[0003] In the related art, multiple different sub-reports are usually displayed simultaneously on the same report page. Among them, the sub-report corresponds to the data calculation module one by one. Each data calculation module reads data from the data storage (such as Kafka), performs calculations based on the data read, and generates a sub-report based on the calculation results, thereby displaying the sub-reports on the same report page. For example, on the same report page, sub-report 1 shows the number of purchases by people under 30 years old, sub-report 2 shows the number of purchases by people over 30 years old, and sub-report 3 shows the total number of purchases by everyone.
[0004] However, since the data storage device updates data in real time and each data calculation module is independent, each data calculation module ends reading data from the data storage device at a different time, resulting in inconsistent total amounts of data read by each data calculation module and incomplete data. This, in turn, makes it impossible for the calculation results of each data calculation module displayed on the same report page to remain dynamically consistent and the data correlation is poor. In conjunction with the above example, when the cutoff times for the three data calculation modules to read data from the data storage device on the same day are 16:05:03, 16:08:00, and 16:10:08, respectively, since the data in the data storage device is updated in real time, the data obtained by the three data calculation modules are inconsistent, resulting in the number of purchases displayed in Report 1 plus the number of purchases displayed in Report 2 not being equal to the total number of purchases displayed in Report 3. Summary of the Invention
[0005] The present application provides a report updating method and device based on a data storage device to solve the problem in the prior art that the calculation results of various data calculation modules displayed on the same report page cannot be dynamically kept consistent and the data correlation is poor.
[0006] In a first aspect, an embodiment of the present application provides a report updating method based on a data storage device, wherein the data storage device includes at least two data partitions, the data partitions use data offsets as unique sequence identifiers for the stored data, a data calculation module reads data from the corresponding data partitions and performs calculations on the data, and the report is displayed on a graphical user interface of a terminal, the report being used to simultaneously display calculation results corresponding to at least two of the data calculation modules, characterized in that the method includes:
[0007] In response to the report update instruction, a calculation version identifier of the current data calculation task is sent to each of the data calculation modules, wherein the calculation version identifier includes at least a target data offset of the data partition corresponding to each data calculation module; the target data offset is used to instruct all the data calculation modules to stop reading data from the data partition when the data offset corresponding to the latest data read from the data partition is the target data offset; wherein different data calculation modules read data with a data offset of the target data offset from the corresponding data partition at the same time;
[0008] receiving a calculation result corresponding to the data calculation module sent by each data calculation module; wherein, when the offset of the data currently read from the data partition by the data calculation module reaches the target data offset, the data calculation module calculates according to the read data to obtain the calculation result;
[0009] When the calculation results of all the data calculation modules are received, the report is updated and displayed according to the calculation results of all the data calculation modules.
[0010] In a second aspect, an embodiment of the present application provides a report updating device based on a data storage device, wherein the data storage device includes at least two data partitions, the data partitions use data offsets as unique sequence identifiers for the stored data, a data calculation module reads data from the corresponding data partitions and performs calculations on the data, and the report is displayed on a graphical user interface of a terminal, the report being used to simultaneously display calculation results corresponding to at least two of the data calculation modules, characterized in that the device includes:
[0011] a processing module, configured to send a calculation version identifier of a current data calculation task to each of the data calculation modules in response to a report update instruction, wherein the calculation version identifier includes at least a target data offset of the data partition corresponding to each data calculation module; the target data offset is used to instruct all of the data calculation modules to stop reading data from the data partition when the data offset corresponding to the latest data read from the data partition is the target data offset; wherein different data calculation modules respectively read data with a data offset of the target data offset from the corresponding data partition at the same time;
[0012] a receiving module, configured to receive a calculation result corresponding to the data calculation module sent by each data calculation module; wherein, when the offset of the data currently read from the data partition by the data calculation module reaches the target data offset, the data calculation module calculates according to the read data to obtain the calculation result;
[0013] The updating module is used to update and display the report according to the calculation results of all the data calculation modules when the calculation results of all the data calculation modules are received.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising:
[0015] A memory and a processor, wherein the memory and the processor are coupled;
[0016] The memory is used to store one or more computer instructions;
[0017] The processor is configured to execute the one or more computer instructions to implement the report updating method based on the data storage device as described in any one of the first aspects above.
[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having one or more computer instructions stored thereon, characterized in that the instruction is executed by a processor to implement the report updating method based on the data storage device as described in any one of the first aspects above.
[0019] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the report update method based on the data storage device as described in any one of the first aspects above.
[0020] Compared with the prior art, this application has the following advantages:
[0021] The report update method based on data storage provided by the present application includes: in response to a report update instruction, sending a calculation version identifier of the current data calculation task to each data calculation module, the calculation version identifier including at least the target data offset of the data partition corresponding to each data calculation module; the target data offset is used to indicate to all data calculation modules that when the data offset corresponding to the latest data read from the data partition is the target data offset, the reading of data from the data partition is stopped; wherein, different data calculation modules read data with a data offset of the target data offset from the corresponding data partition at the same time. For the data calculation task, each data calculation module reads data from the corresponding data partition until the data offset corresponding to the latest data read is the target data offset, and then stops reading data from the data partition. This can ensure that the data obtained by each data calculation module for the same data partition is completely consistent. Receive the calculation results corresponding to the data calculation modules sent by each data calculation module; when the offsets of the data currently read from the data partition by the data calculation modules reach the target data offset, the data calculation modules calculate based on the read data to obtain the calculation results; for the same data calculation task, when the calculation results of all the data calculation modules are received, the report is updated and displayed based on the calculation results of all the data calculation modules, which can ensure the consistency and strong correlation of the data displayed in the report. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0023] Figure 1 A schematic diagram of an application scenario of the report updating method based on a data storage device provided in the first embodiment of the present application;
[0024] Figure 2 A flowchart of a report updating method based on a data storage device according to a second embodiment of the present application;
[0025] Figure 3 A schematic diagram of a flow chart for determining the target data offset corresponding to each data partition in a data calculation task provided in the second embodiment of the present application;
[0026] Figure 4 A schematic diagram of a process for determining a calculation version identifier corresponding to each data calculation module provided in the second embodiment of the present application;
[0027] Figure 5 A schematic diagram of a process for determining a target task version number provided in the second embodiment of the present application;
[0028] Figure 6 A schematic diagram of the structure of a report updating device based on a data storage device provided in the third embodiment of the present application;
[0029] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in the fourth embodiment of the present application.
[0030] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0031] To make the objects, advantages, and features of the present invention more clearly apparent, the present invention is described clearly and completely below with reference to the accompanying drawings and specific embodiments. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the embodiments described are only some of the embodiments of the present invention, not all of them. All other embodiments obtained by persons of ordinary skill in the art without inventive effort are intended to fall within the scope of protection of the present invention.
[0032] It should be noted that, in the description of this application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance, or a specific order or precedence. For those skilled in the art, the specific meanings of the above terms in this application can be understood in specific circumstances. In addition, in the description of this application, unless otherwise specified, the term "plurality" refers to two or more. The term "and / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. The terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or devices.
[0033] In order to facilitate understanding of the technical solution of this application, the relevant concepts involved in this application are first introduced.
[0034] A data storage device is a data storage tool composed of hardware and / or software. It is used to collect data from data producers and store the collected data for data consumers to query. For example, it can be a data storage device that can store new data in real time, such as Kafka, RabbitMQ, Redis, etc.
[0035] Kafka, as a message queue middleware, collects data from producers and delivers it to consumers. In Kafka, data is typically categorized by topic, with each topic corresponding to at least one partition. Each partition is analogous to a table in a database. Each topic is a category or subscribeable entry. Each partition is an ordered, immutable sequence of data to which data can be appended continuously. Each data entry within a partition has a sequential number (called an offset), which uniquely identifies the stored data. Data producers can publish data to a specific partition corresponding to a specific topic, depending on the specific situation. Conversely, consumers can choose to read data from a specific partition corresponding to a specific topic.
[0036] As an open-source message queue service, RabbitMQ includes multiple topics and at least one message queue for each topic. Message queues in RabbitMQ can be thought of as data partitions in Kafka. Similarly, messages are organized into a file list for each data partition in the RabbitMQ middleware. When pulling data, data consumers must specify the data offset within the file.
[0037] Below, the existing technology and the problems existing in the existing technology are described:
[0038] Kafka, a messaging middleware platform that provides a unified, high-throughput, and low-latency platform for processing real-time data, has been adopted by many enterprises as a diverse data channel and messaging system. To better understand the dynamics of enterprise business data, real-time reports that automatically update when relevant data is updated in business systems have emerged.
[0039] In related technologies, multiple subreports are typically displayed simultaneously on the same report page. Each subreport corresponds to a data calculation module. Each data calculation module reads data from a data storage device (e.g., Kafka), performs calculations based on the data, and generates a subreport based on the calculation results, thereby displaying the subreports on the same report page.
[0040] However, since the data storage device updates data in real time and each data calculation module is independent, each data calculation module ends reading data from the data storage device at different times, resulting in inconsistent total amounts of data read by each data calculation module and incomplete data. As a result, the calculation results of each data calculation module displayed on the same report page cannot be dynamically kept consistent and the data correlation is poor.
[0041] To address the aforementioned issues and maintain dynamic consistency in the calculation results of various data calculation modules displayed on the same report page while ensuring strong data correlation, this application provides a data storage-based report update method, a corresponding data storage-based report update device, an electronic device capable of implementing the data storage-based report update method, and a computer-readable storage medium. The following examples provide detailed descriptions of the aforementioned method, device, electronic device, and computer-readable storage medium.
[0042] In order to make the purpose and technical solution of this application clearer and more intuitive, the method provided by the embodiment of this application will be described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar content will not be repeated in different embodiments.
[0043] The data storage-based report update method of the embodiment of the present application can be executed by a computer device, wherein the computer device can be a terminal or a server. The terminal can be a terminal device such as a tablet computer, a laptop computer, or a personal computer (PC). The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0044] It should be noted that the following description of the technical solutions provided by this application uses a terminal as an example of an execution subject. In other possible implementations, a data processing device provided in the terminal may also be used as the execution subject to execute the technical solutions provided by this application. The embodiments of this application do not limit the type of execution subject. Alternatively, the data processing device may be implemented by software or a combination of software and hardware.
[0045] Next, combine Figure 1, introduces the application scenario of a report update method based on a data storage provided by the first embodiment of the present application, Figure 1 A schematic diagram of an application scenario of the report updating method based on data storage provided in the first embodiment of the present application.
[0046] like Figure 1 As shown, the application scenario includes a first terminal 101, a data server 102, and a second terminal 103. The first terminal 101, the data server 102, and the second terminal 103 can be connected via the same or different networks. The network can be a wireless network or a wired network, such as a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc. The data server includes a data storage device. The first terminal 101 can act as a data producer to produce data. The data server 102 can collect data from the first terminal 101 and store the collected data in a data partition of the data storage device Kafka. The second terminal 103 includes multiple data computing modules. Each data computing module can act as a data consumer to read data from the data partition of Kafka on the data server 102. Specifically, each data computing module reads data from the corresponding data partition and stops reading data from the data partition when the data offset corresponding to the latest data read from the data partition by the data computing module reaches the target data offset corresponding to the data partition. Afterward, when the data offsets of the data calculation modules reading data from the corresponding data partitions all reach the target offsets corresponding to each data partition, the data calculation modules perform data calculations based on the read data to obtain corresponding calculation results. Second terminal 103 also includes a report. When all data calculation modules complete the data calculations and obtain their respective calculation results, the report is updated and displayed based on the calculation results of all data calculation modules.
[0047] It should be understood that the above application scenarios are merely examples and are not limitations of the present application. In addition, for any content not disclosed in the application scenarios, please refer to the following embodiments.
[0048] Next, combine Figure 2 , the report updating method based on the data storage provided in the second embodiment of the present application is described, Figure 2 A flowchart of a report updating method based on a data storage device according to the second embodiment of the present application is provided.
[0049] like Figure 2 As shown, the report updating method based on the data storage includes:
[0050] S201 : In response to a report update instruction, a calculation version identifier of a current data calculation task is sent to each data calculation module.
[0051] In the embodiment of the present application, a report page includes multiple subreports, each of which corresponds to a data calculation module. Each subreport is used to display the calculation results of the corresponding data calculation module in the form of a graph, table, etc. It should be noted that report update refers to the simultaneous and synchronous update of each subreport in the report.
[0052] In an embodiment of the present application, the report can be updated regularly, and the update operation of the report can be triggered by creating and sending a report update instruction.
[0053] The following is an exemplary description of a possible implementation of creating a report update instruction during a periodic update of a report.
[0054] Optionally, a task generation period for the data computing task is obtained; a task generation time is determined based on the obtained task generation period; the data computing task is triggered at the task generation time, and a report update instruction is created for the computing task. It should be noted that report update involves displaying the calculation results of the same data computing task to all data computing modules at the same time after each data computing module completes the data computing task, thereby updating the report data.
[0055] The above optional implementation is exemplarily described below with reference to a specific example.
[0056] For example, if the task generation cycle of the acquired data calculation task is 4 hours, then the task generation time on a certain day can be determined based on the task generation cycle of 4 hours. Please refer to Table 1, which is an example of the task generation time within a day.
[0057] Table 1
[0058]
[0059] The above description is merely an example of the value of the task generation period and is not intended to be limiting. The value of the task generation period can be set according to actual needs.
[0060] Optionally, after the data calculation task is triggered at the time of task generation, the target data offset corresponding to each data partition in the new data calculation task is determined. The target data offset is used to indicate all data calculation modules, and when the data offset corresponding to the latest data read from the data partition is the target data offset, the reading of data from the data partition is stopped. It should be emphasized that different data calculation modules read data with a data offset of the target data offset from the corresponding data partition at the same time. In other words, for the same data calculation task, the cutoff reading time for different data calculation modules to read data from the same or different data partitions is consistent, which can ensure the consistency or correlation of the data obtained between different data calculation modules.
[0061] Next, combine Figure 3 , a possible implementation method of the step of "determining the target data offset corresponding to each data partition in the data calculation task" is exemplified. Figure 3 A schematic diagram of a flow chart for determining the target data offset corresponding to each data partition in a data calculation task provided in the second embodiment of the present application.
[0062] like Figure 3 As shown, the process includes the following steps S2011 and S2012:
[0063] S2011. Determine the data consumption change within a unit time interval for each data partition in the data storage device.
[0064] In the embodiment of the present application, the data consumption variation represents the amount of data read from the data partition by the data calculation module corresponding to the data partition within a unit time interval.
[0065] Optionally, for each of the at least two data partitions, a first data offset corresponding to the data partition at the first moment and a second data offset corresponding to the data partition at the second moment are obtained; a second duration is determined based on the first moment and the second moment; and a change in data consumption within a unit time interval of the data partition is determined based on the first data offset, the second data offset, and the second duration. It should be noted that the first data offset is the data offset of the data read from the corresponding data partition by the data consumption module at the first moment. The second data offset is the data offset of the data read from the corresponding data partition by the data consumption module at the second moment.
[0066] The above optional implementation is exemplarily described below with reference to a specific example.
[0067] For example, if the data storage device includes three data partitions, a data consumption module can be used to obtain the data consumption offset of each data partition by the data calculation module at different times. It should be noted that the data consumption module is primarily used to obtain the data offset of each data partition by the data calculation module at different times. This module can be any data calculation module, or it can be a module that does not perform any data calculations but simply continuously consumes the data offsets of each data partition in the data storage device. This application does not impose any restrictions on this. For the same data partition, the data consumption amount is consistent between different data calculation modules.
[0068] For example, when using the data consumption module to obtain the data offsets corresponding to the three data partitions at the first moment of 4:00:01 and the second moment of 4:00:02, the data consumption module can refer to Table 2, which shows the data offsets of different data partitions at different times of the data consumption module.
[0069] Table 2
[0070] Data partitioning The first data offset at the first moment The second data offset at the second moment Data partition 1 1057623129 1057623161 Data partition 2 1063853473 1063853488 Data partition 3 1063730817 1063731005
[0071] As shown in Table 2, at the first moment of 4:00:01, the first data offsets corresponding to the three data partitions (data partition 1, data partition 2, and data partition 3) of the data calculation module are: 1057623129, 1063853473, and 1063730817 respectively; and at the second moment of 4:00:02, the second data offsets corresponding to the three data partitions of the data calculation module are: 1057623161, 1063853488, and 1063731005 respectively.
[0072] The data consumption change of each data partition between the first and second moments in the data consumption module is the difference between the second data offset of each data partition at the second moment and the first data offset of each data partition at the first moment. Therefore, the data consumption changes of the three data partitions between the first and second moments in the data consumption module are: 32 = 1057623161 - 1057623129, 15 = 1063853488 - 1063853473, and 188 = 1063731005 - 1063730817.
[0073] Since the time interval between the first moment 4:00:01 and the second moment 4:00:02 is 1 second, it can be seen that the data consumption changes of the data consumption module in the three data partitions within the unit time interval (per second) are: 32, 15, and 188 respectively.
[0074] S2012: Determine a target data offset corresponding to each data partition according to the current data offset, data consumption change, and the first duration of each data partition at the current moment.
[0075] Optionally, for each of all data partitions, the following steps are performed to obtain the target data offset corresponding to each data partition: first, the current data offset of the data partition at the current moment is obtained; then, the data consumption change of the data partition within the first time period is determined as the product of the data consumption change within the unit time interval and the first time period; finally, the target data offset corresponding to the data partition is determined as the sum of the current data offset of the data partition at the current moment and the data consumption change of the data partition within the first time period.
[0076] It is understandable that the target data offset is the data offset corresponding to the data read from the data partition by the data calculation module at the target time. Wherein, the target time refers to the time when the time starts from the current time and reaches the end time of the first time.
[0077] The optional implementation described above is exemplarily described below with reference to a specific example.
[0078] In conjunction with the example in step S2011, taking the current time of 4:00:02 as an example, at 4:00:02, the current data offsets of the data consumption module in the three data partitions are: 1057623161, 1063853488, and 1063731005. Furthermore, the data consumption changes of the data consumption module in the three data partitions within a unit time interval are: 32, 15, and 188, respectively.
[0079] Taking the first duration as 60 seconds as an example, the data consumption changes of the data consumption module in the first duration of the three data partitions are: 1920=32*60, 900=15*60, 11280=188*60 respectively.
[0080] The sum of the current data offset of each data partition at the current moment and the data consumption change of the data partition within the first time period is determined as the target data offset corresponding to each data partition. Therefore, the target data offsets corresponding to the three data partitions are: 1057625081=1057623161+1920, 1063854388=1063853488+900, 1063742285=1063731005+11280.
[0081] Optionally, the first duration is less than or equal to the task generation cycle of the data calculation task. Taking into account that a data calculation task is generated every task generation cycle, and the target data offset for each data partition in the data calculation task is determined based on the first duration (that is, relative to the previous data calculation task, the amount of new data in the current data calculation task is the change in data consumption of each data partition within the first duration), the first duration is less than or equal to the task generation cycle, which can ensure to the greatest extent possible that the calculation results of each data calculation task can be used to update the report. Otherwise, if the task generation cycle is less than the first duration, the calculation results of some data calculation tasks are not used to update the report, resulting in a waste of some computing resources.
[0082] In an embodiment of the present application, after responding to a report update instruction, a task version identifier of the current data calculation task is sent to each data calculation module. The calculation version identifier is used to identify and distinguish different data calculation tasks, and the calculation version identifier includes at least the target data offset of the data partition corresponding to each data calculation module.
[0083] Optionally, each data computing module has a corresponding target data partition, depending on the data required for calculation by each data computing module. The target data partition is the data partition from which each data computing module reads data among the multiple data partitions. For each data computing module, the target data partition corresponding to each data computing module is obtained.
[0084] Next, combine Figure 4 A possible implementation of the step of "determining the calculation version identifier corresponding to each data calculation module" is exemplified. Figure 4 A schematic diagram of a flow chart for determining the calculation version identifier corresponding to each data calculation module provided in the second embodiment of the present application.
[0085] like Figure 4 As shown, the following steps S201-1 and S201-2 are included:
[0086] S201-1. Determine the target data partition corresponding to each data calculation module according to a preset corresponding relationship.
[0087] In the embodiment of the present application, the preset correspondence is used to indicate the correspondence between the data calculation module and the data partition.
[0088] The following describes step S201 - 1 with reference to a specific example.
[0089] For example, a report corresponds to three data calculation modules, and the three data calculation modules need to obtain data from five data partitions. The preset correspondence between the three data calculation modules and the five data partitions can be referred to Table 3, which is an example of the preset correspondence.
[0090] Table 3
[0091] Data calculation module Target data partition Data calculation module 1 Data partition 1, data partition 3, data partition 4 Data calculation module 2 Data partition 1, data partition 2, data partition 3, data partition 4 Data calculation module 3 Data partition 2, data partition 3, data partition 5
[0092] As shown in Table 3, it can be seen that the target data partitions corresponding to data calculation module 1 include: data partition 1, data partition 3, data partition 4; the target data partitions corresponding to data calculation module 2 include: data partition 1, data partition 2, data partition 3 and data partition 4; the target data partitions corresponding to data calculation module 3 include: data partition 2, data partition 3, data partition 5.
[0093] S201 - 2 . For each data computing module, determine a computing version identifier corresponding to the data computing module according to the target data partition corresponding to the data computing module and the target data offsets corresponding to each target data partition.
[0094] Based on the above step S2012, the target data offset corresponding to each data partition in the current computing task is determined. In order to ensure the usefulness of sending data to the data computing module and avoid the information transmission pressure caused by sending too much useless information, the target data offset included in the computing version identifier sent to the data computing module is considered to be the target data offset of the target data partition corresponding to the data computing module.
[0095] In conjunction with the above Table 3, taking the data calculation module 1 as an example, the implementation method of the step of “determining the calculation version identifier corresponding to the data calculation module” is exemplarily described.
[0096] As shown in Table 3, the target data partitions corresponding to data calculation module 1 include: data partition 1, data partition 3, and data partition 4. Therefore, the calculation version identifier corresponding to the data calculation module includes: the target data offset of data partition 1, the target data offset of data partition 3, and the target data offset of data partition 4.
[0097] S202: Receive the calculation result corresponding to the data calculation module sent by each data calculation module.
[0098] When the offsets of the data currently read from the data partition by the data calculation module all reach the target data offsets, the data calculation module performs calculations based on the read data to obtain calculation results.
[0099] Optionally, the computation version identifier includes a task version number corresponding to the data computation task. The task version number is used to identify the data computation task and distinguish between different data computation tasks. The task version number may be in the form of a combination of numbers and / or uppercase and lowercase letters and / or other characters, and this embodiment of the present application does not impose any limitations on this. Preferably, the task version numbers of each data computation task may form an ordered sequence that increases or decreases according to the order in which the data computation tasks were generated.
[0100] Optionally, before the step of "sending the calculation version identifier of the current data calculation task to each data calculation module in response to the report update instruction," calculation version identifiers of multiple different data calculation tasks have been sent to each data calculation module. For each data calculation task, the data calculation module calculates the target data offset of the target data partition in the task version identifier of the data calculation task based on the target data offset. When the offset of the data currently being read from all target data partitions reaches the target data offset, the data calculation module calculates the result based on the read data.
[0101] The optional implementation described above is exemplarily described below in conjunction with Table 4 and a specific example.
[0102] For example, data computing module 1 receives task version identifiers for three data computing tasks, where the task version identifiers include the task version number and the target offset of the target data partition corresponding to data computing module 1. For details, see Table 4. As shown in Table 3 above, the target data partitions corresponding to data computing module 1 include: data partition 1, data partition 3, and data partition 4.
[0103] Table 4
[0104]
[0105] In this embodiment of the present application, for example, the task version numbers of data computing tasks are sorted in ascending order by task generation time. That is, the earlier the task generation time of a data computing task, the smaller the task version number; the later the task generation time of a data computing task, the larger the task version number. In conjunction with Table 4, it can be seen that the task version numbers of data computing tasks in Table 4 are sorted in ascending order by task generation time: 1000, 1001, 1002.
[0106] In an embodiment of the present application, for each data calculation module, when the data offset of the data read from each target data partition by the data calculation module is the target offset, and when the offset of the currently read data from all target data partitions by the data calculation module reaches the target data offset, the data calculation module calculates based on the read data to obtain a calculation result.
[0107] In the following, in combination with Table 4 and a specific example, the data calculation module 1 processes the data calculation task with the task version number 1000 as an example to exemplify the implementation method of obtaining the calculation result by the data calculation module according to the received data.
[0108] As shown in Table 4, the target data partitions corresponding to data calculation module 1 include: data partition 1, data partition 3, and data partition 4. When the data offset of the data read from data partition 1 by data calculation module 1 reaches the target data offset 1-1, data reading from data partition 1 ends. Similarly, when the data offset of the data read from data partition 3 by data calculation module 1 reaches the target data offset 3-1, data reading from data partition 3 ends. When the data offset of the data read from data partition 4 by data calculation module 1 reaches the target data offset 4-1, data reading from data partition 4 ends. When the data offsets of the data read from data partition 1, data partition 3, and data partition 4 by data calculation module 1 all reach the target data offsets corresponding to each data partition, the data calculation module performs calculations based on the data read from data partition 1, data partition 3, and data partition 4, obtaining the calculation results of data calculation module 1 for the data calculation task with task version number 1000.
[0109] Optionally, after receiving the calculation result corresponding to the data calculation module sent by each data calculation module, a corresponding relationship between the task version number and the corresponding calculation result in each data calculation module is established.
[0110] The above optional implementation is exemplarily described below with reference to a specific example.
[0111] For example, the following situations have been reported for calculation results sent by data calculation modules: Data calculation module 1 sends calculation results 1-1000 and 1-1001 for data calculation tasks with task version numbers 1000 and 1001; Data calculation module 2 sends calculation result 2-1000 for data calculation tasks with task version number 1000; and Data calculation module 3 sends calculation results 3-1000, 3-1001, and 3-1002 for data calculation tasks with task version numbers 1000, 1001, and 1002. Therefore, based on the calculation results corresponding to the data calculation modules sent by the above-mentioned data calculation modules, the corresponding relationship between the task version number and the corresponding calculation result in each data calculation module can be established with reference to Table 5, which is an example of the corresponding relationship between the task version number and the corresponding calculation result in each data calculation module.
[0112] Table 5
[0113]
[0114]
[0115] S203: When the calculation results of all the data calculation modules are received, the report is updated and displayed according to the calculation results of all the data calculation modules.
[0116] In an embodiment of the present application, for any data calculation task, when the calculation results of all data calculation modules are received, the report is updated and displayed according to the calculation results of all data calculation modules. For example, as shown in Table 5, for a data calculation task with a task version number of 1000, the calculation results of all data calculation modules for the data calculation task have been received. Then, according to the calculation results 1-1000 of data calculation module 1, the calculation results 2-1000 of data calculation module 2, and the calculation results 3-1000 of data calculation module 3, the report is updated and displayed, that is, the sub-report corresponding to data calculation module 1 is updated using the calculation results 1-1000, the sub-report corresponding to data calculation module 2 is updated using the calculation results 2-1000, and the sub-report corresponding to data calculation module 3 is updated using the calculation results 3-1000.
[0117] Optionally, to better update the report in a timely and regular manner, a report update cycle can be determined. Based on the report update cycle, the report update time is determined. At the update time, the task version numbers included in the corresponding relationship are sequentially traversed to determine whether the task version number corresponds to the calculation results of all data calculation modules. If so, the report is updated and displayed based on the calculation results of all data calculation modules.
[0118] The above optional implementation method is exemplified below with reference to a specific example.
[0119] For example, if the acquired report update cycle is 1 hour, then the task generation time on a certain day can be determined based on the report update cycle of 1 hour. Table 6 is an example of the update time of the report within a day.
[0120] Table 6
[0121]
[0122] Optionally, when traversing the task version numbers included in the corresponding relationship, the task version numbers can be traversed in reverse order of the task generation times corresponding to the task version numbers. The calculation results corresponding to the data calculation tasks whose task generation times are closer to the current time are calculated based on more and newer data. Therefore, the report is updated preferentially based on the calculation results corresponding to the data calculation tasks whose task generation times are closer to the current time. For example, for the three task version numbers included in the corresponding relationship shown in Table 5, the order of traversal for these three task version numbers is: 1002, 1001, and 1000.
[0123] Optionally, when it is determined in the correspondence that there is a task version number corresponding to the calculation results of all data calculation modules, the task version number is determined as the target task version number; and the report is updated and displayed based on the calculation results of all data calculation modules corresponding to the target task version number. For example, in the correspondence shown in Table 5, the task version number 1000 corresponds to the calculation results of all data calculation modules (i.e., data calculation modules 1, 2, and 3). Therefore, the report is updated and displayed based on the calculation results of all data calculation modules corresponding to the task version number 1000.
[0124] For another example, the above optional implementation manner is exemplarily described in conjunction with Table 7, which is another example of the correspondence between the task version number and the corresponding calculation result in each data calculation module.
[0125] Table 7
[0126]
[0127] As shown in the corresponding relationship in Table 7, task version numbers 1000 and 1001 both correspond to the calculation results of all data calculation modules (i.e., data calculation modules 1, 2, and 3). Furthermore, since the task version numbers are traversed in reverse order of the task generation moments corresponding to the task version numbers, that is, the order of traversal for the three task version numbers is: 1002, 1001, and 1000, task version number 1001 will be traversed first compared to task version number 1000. When the calculation results of all data calculation modules (i.e., data calculation modules 1, 2, and 3) corresponding to task version number 1001 are traversed, task version number 1001 is determined as the target task version number. Therefore, the report is updated and displayed based on the calculation results of all data calculation modules corresponding to the target task version number 1001.
[0128] Optionally, the implementation of the above step of "when it is determined in the correspondence relationship that there is a task version number corresponding to the calculation results of all data calculation modules, determining the task version number as the target task version number" may include steps S2031 to S2033, Figure 5 A flowchart for determining the target task version number provided in the second embodiment of the present application.
[0129] like Figure 5 As shown, including:
[0130] S2031. Determine a first data calculation task according to a first task version number corresponding to a calculation result currently displayed in the report.
[0131] In this embodiment of the present application, the first task version number corresponding to the calculation result currently displayed in the report is obtained. Referring to Table 7, for example, if the calculation result currently displayed in the report corresponds to task version number 1000, task version number 1000 is determined as the first task version number. Therefore, the data calculation task corresponding to task version number 1000 is determined as the first data calculation task.
[0132] S2032: When it is determined in the correspondence relationship that there is a second task version number corresponding to the calculation results of all the data calculation modules, determine the second data calculation task corresponding to the task version number.
[0133] In the embodiment of the present application, in combination with the corresponding relationship shown in Table 7 above, the task version numbers are traversed in reverse order of the task generation time corresponding to the task version number. First, it is determined that the calculation results of all data calculation modules (i.e., data calculation modules 1, 2, and 3) corresponding to task version number 1001 exist. Therefore, task version number 1001 is determined as the second task version number. Then, the data calculation task corresponding to task version number 1001 is determined as the second data calculation task.
[0134] S2033: When the task generation time of the second data computing task is later than the task generation time of the first data computing task, determine the second task version number as the target task version number.
[0135] Based on the above steps S2031 - S2032 , it is determined that the data computing task corresponding to the task version number 1000 is determined to be the first data computing task, and the data computing task corresponding to the task version number 1001 is determined to be the second data computing task.
[0136] When the data computing task corresponding to the task version number 1001 is determined as the second data computing task because the task generation time of the data computing task corresponding to the task version number 1000 is later than that of the task corresponding to the task version number 1000, the task version number 1001 is determined as the target task version number.
[0137] Among them, by judging the order of the task generation time of the second data calculation task and the task generation time of the first data calculation task, if the task generation time of the second data calculation task is later than the task generation time of the first data calculation task, the second task version number is determined as the target task version number. This can ensure that the calculation results of the data calculation task that is later than the task generation time of the first data report are always used to update the current report, thereby avoiding repeated and invalid updates of the report using the calculation results corresponding to the same data calculation task. For example, the content currently displayed in the report is the calculation result of the data calculation task with task version number 1000. If the target version number is 1000 after traversing the task version number, the calculation result of the data calculation task with task version number 1000 will not be used for updating.
[0138] The report update method based on the data storage provided in the embodiment of the present application sends the calculation version identifier of the current data calculation task to each data calculation module in response to the report update instruction. The calculation version identifier includes at least the target data offset of the data partition corresponding to each data calculation module; the target data offset is used to indicate all data calculation modules that when the data offset corresponding to the latest data read from the data partition is the target data offset, the reading of data from the data partition is stopped; wherein, different data calculation modules read data with a data offset of the target data offset from the corresponding data partition at the same time. For the data calculation task, each data calculation module reads data from the corresponding data partition until the data offset corresponding to the latest data read is the target data offset, and then stops reading data from the data partition. This can ensure that the data obtained by each data calculation module for the same data partition is completely consistent. Receive the calculation results corresponding to the data calculation modules sent by each data calculation module; when the offsets of the data currently read from the data partition by the data calculation modules reach the target data offset, the data calculation modules calculate based on the read data to obtain the calculation results; for the same data calculation task, when the calculation results of all the data calculation modules are received, the report is updated and displayed based on the calculation results of all the data calculation modules, which can ensure the consistency and strong correlation of the data displayed in the report.
[0139] The report updating device based on the data storage provided by the present invention is described below. The report updating device based on the data storage described below and the report updating method based on the data storage described above can be referenced to each other.
[0140] Figure 6This is a schematic diagram of the structure of a report updating device based on a data storage provided in the third embodiment of the present application. In the report updating device based on a data storage, the data storage includes at least two data partitions, the data partitions use data offsets as unique sequence identifiers for the stored data, a data calculation module reads data from the corresponding data partitions and performs calculations on the data, and the report is displayed on the graphical user interface of the terminal, and the report is used to simultaneously display the calculation results corresponding to at least two of the data calculation modules, such as Figure 6 As shown, the device includes: a processing module 601, a receiving module 602 and an updating module 603.
[0141] Processing module 601 is configured to, in response to a report update instruction, send a calculation version identifier of the current data calculation task to each data calculation module, wherein the calculation version identifier includes at least a target data offset of the data partition corresponding to each data calculation module; the target data offset is used to instruct all the data calculation modules to stop reading data from the data partition when the data offset corresponding to the latest data read from the data partition is the target data offset; wherein different data calculation modules respectively read data with a data offset of the target data offset from the corresponding data partition at the same time;
[0142] A receiving module 602 is configured to receive a calculation result corresponding to the data calculation module sent by each data calculation module; wherein, when the offset of the data currently read from the data partition by the data calculation module reaches the target data offset, the data calculation module calculates the calculation result based on the read data;
[0143] The updating module 603 is configured to update and display the report according to the calculation results of all the data calculation modules when the calculation results of all the data calculation modules are received.
[0144] Optionally, the processing module 601 is further configured to:
[0145] Get the task generation cycle of the data computing task;
[0146] Determining a task generation time according to the task generation cycle;
[0147] The data calculation task is triggered to be generated at the task generation moment, and a report update instruction is created for the data calculation task.
[0148] Optionally, the processing module 601 is further configured to:
[0149] Determine a data consumption change within a unit time interval for each data partition in the data storage, where the data consumption change represents an amount of data read from the data partition by a data computing module corresponding to the data partition within a unit time interval;
[0150] Based on the current data offset of each data partition at the current moment, the data consumption change and the first duration, the target data offset corresponding to each data partition is determined. The target moment refers to the moment when the timing starts from the current moment and the duration reaches the end of the first duration. The target data offset is the data offset corresponding to the last data read from the data partition by the data calculation module at the target moment.
[0151] Optionally, the processing module 601 is specifically configured to:
[0152] For each of the at least two data partitions, obtaining a first data offset corresponding to the data partition at a first moment and a second data offset corresponding to the data partition at a second moment;
[0153] determining a second duration according to the first moment and the second moment;
[0154] A data consumption change within a unit time interval of the data partition is determined according to the first data offset, the second data offset, and the second duration.
[0155] Optionally, the device further includes a determination module, wherein the determination module is specifically configured to:
[0156] For each of the data computing modules, obtaining a target data partition corresponding to each of the data computing modules, wherein the target data partition is a data partition from which each of the data computing modules reads data among the multiple data partitions;
[0157] The determining module is further configured to:
[0158] Determining the target data partition corresponding to each of the data computing modules according to a preset correspondence relationship, wherein the preset correspondence relationship is used to indicate the correspondence between the data computing modules and the data partitions;
[0159] For each of the data calculation modules, a calculation version identifier corresponding to the data calculation module is determined according to the target data partition corresponding to the data calculation module and the target data offsets respectively corresponding to the target data partitions.
[0160] Optionally, the calculation version identifier further includes a task version number corresponding to the data calculation task, and the receiving module 602 is further configured to:
[0161] Establishing a correspondence between the task version number and the corresponding calculation result in each data calculation module;
[0162] The updating module 603 is further configured to:
[0163] Determining a report update cycle for the report;
[0164] Determining the update time of the report according to the report update cycle;
[0165] At the updating time, the task version numbers included in the corresponding relationship are traversed in sequence to determine whether the task version numbers correspond to the calculation results of all the data calculation modules.
[0166] Optionally, the updating module 603 is specifically configured to:
[0167] Traverse the task version numbers in reverse order of the task generation time corresponding to the task version number;
[0168] The updating module 603 is specifically used for:
[0169] When it is determined in the correspondence relationship that there is a task version number corresponding to the calculation results of all the data calculation modules, the task version number is determined as the target task version number;
[0170] The report is updated and displayed according to the calculation results of all the data calculation modules corresponding to the target task version number.
[0171] Optionally, the updating module 603 is specifically configured to:
[0172] Determine the first data calculation task according to the first task version number corresponding to the calculation result currently displayed in the report;
[0173] When it is determined that there is a second task version number corresponding to the calculation results of all the data calculation modules in the corresponding relationship, determining a second data calculation task corresponding to the task version number;
[0174] In a case where the task generation time of the second data computing task is later than the task generation time of the first data computing task, the second task version number is determined as the target task version number.
[0175] The data storage-based report updating device provided in the embodiment of the present application can be used to execute the technical solution of the above-mentioned data storage-based report updating method embodiment. Its implementation principle and technical effects are similar, and will not be repeated here in this embodiment.
[0176] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in the fourth embodiment of the present application is shown in FIG. Figure 7 As shown, the electronic device 700 of this embodiment includes: a processor 701 and a memory 702;
[0177] Memory 702, for storing computer-executable instructions;
[0178] The processor 701 is configured to execute computer-executable instructions stored in the memory to implement the various steps of the report updating method based on the data storage in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0179] Optionally, the memory 702 may be independent or integrated with the processor 701 .
[0180] When the memory 702 is independently provided, the electronic device further includes a bus 703 for connecting the memory 702 and the processor 701 .
[0181] A fifth embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the electronic device implements the technical solution corresponding to the report update method based on the data storage in any of the above embodiments, and performs the following operations:
[0182] In response to the report update instruction, a calculation version identifier of the current data calculation task is sent to each of the data calculation modules, wherein the calculation version identifier includes at least a target data offset of the data partition corresponding to each data calculation module; the target data offset is used to instruct all the data calculation modules to stop reading data from the data partition when the data offset corresponding to the latest data read from the data partition is the target data offset; wherein different data calculation modules read data with a data offset of the target data offset from the corresponding data partition at the same time;
[0183] receiving a calculation result corresponding to the data calculation module sent by each data calculation module; wherein, when the offset of the data currently read from the data partition by the data calculation module reaches the target data offset, the data calculation module calculates according to the read data to obtain the calculation result;
[0184] When the calculation results of all the data calculation modules are received, the report is updated and displayed according to the calculation results of all the data calculation modules.
[0185] Optionally, before sending the calculation version information to each of the data calculation modules, the method further includes:
[0186] Get the task generation cycle of the data computing task;
[0187] Determining a task generation time according to the task generation cycle;
[0188] The data calculation task is triggered to be generated at the task generation moment, and a report update instruction is created for the data calculation task.
[0189] Optionally, the method further includes:
[0190] Determine a data consumption change within a unit time interval for each data partition in the data storage, where the data consumption change represents an amount of data read from the data partition by a data computing module corresponding to the data partition within a unit time interval;
[0191] Based on the current data offset of each data partition at the current moment, the data consumption change and the first duration, the target data offset corresponding to each data partition is determined. The target data offset is the data offset of the data read from the data partition by the data calculation module at the target moment. The target moment refers to the moment when the timing starts from the current moment and the duration reaches the end of the first duration.
[0192] Optionally, determining the data consumption change within a unit time interval of each data partition in the data storage device includes:
[0193] For each of the at least two data partitions, obtaining a first data offset corresponding to the data partition at a first moment and a second data offset corresponding to the data partition at a second moment;
[0194] determining a second duration according to the first moment and the second moment;
[0195] A data consumption change within a unit time interval of the data partition is determined according to the first data offset, the second data offset, and the second duration.
[0196] Optionally, the method further includes:
[0197] For each of the data computing modules, obtaining a target data partition corresponding to each of the data computing modules, wherein the target data partition is a data partition from which each of the data computing modules reads data among the multiple data partitions;
[0198] After determining the target data offset corresponding to each data partition according to the current data offset of each data partition at the current moment, the data consumption change, and the first duration, the method further includes:
[0199] Determining the target data partition corresponding to each of the data computing modules according to a preset correspondence relationship, wherein the preset correspondence relationship is used to indicate the correspondence between the data computing modules and the data partitions;
[0200] For each of the data calculation modules, a calculation version identifier corresponding to the data calculation module is determined according to the target data partition corresponding to the data calculation module and the target data offsets respectively corresponding to the target data partitions.
[0201] Optionally, the calculation version identifier further includes a task version number corresponding to the data calculation task, and after receiving the calculation result corresponding to the data calculation module sent by each data calculation module, the method further includes:
[0202] Establishing a correspondence between the task version number and the corresponding calculation result in each data calculation module;
[0203] The method further comprises:
[0204] Determining a report update cycle for the report;
[0205] Determining the update time of the report according to the report update cycle;
[0206] At the updating time, the task version numbers included in the corresponding relationship are traversed in sequence to determine whether the task version numbers correspond to the calculation results of all the data calculation modules.
[0207] Optionally, the sequentially traversing the task version numbers included in the corresponding relationship includes:
[0208] Traverse the task version numbers in reverse order of the task generation time corresponding to the task version number;
[0209] When the calculation results of all the data calculation modules are received, the report is updated and displayed according to the calculation results of all the data calculation modules, including:
[0210] When it is determined in the correspondence relationship that there is a task version number corresponding to the calculation results of all the data calculation modules, the task version number is determined as the target task version number;
[0211] The report is updated and displayed according to the calculation results of all the data calculation modules corresponding to the target task version number.
[0212] Optionally, when it is determined in the correspondence relationship that there is a task version number corresponding to the calculation results of all the data calculation modules, determining the task version number as the target task version number includes:
[0213] Determine the first data calculation task according to the first task version number corresponding to the calculation result currently displayed in the report;
[0214] When it is determined that there is a second task version number corresponding to the calculation results of all the data calculation modules in the corresponding relationship, determining a second data calculation task corresponding to the task version number;
[0215] In a case where the task generation time of the second data computing task is later than the task generation time of the first data computing task, the second task version number is determined as the target task version number.
[0216] The sixth embodiment of the present application also provides a computer program product, which includes: a computer program, which is stored in a readable storage medium, and at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the technical solution corresponding to the report update method based on the data storage in any of the above embodiments.
[0217] It should be noted that for the detailed description of the devices, electronic devices, computer-readable storage media, and computer program products provided in the third, fourth, fifth, and sixth embodiments of the present application, reference can be made to the relevant description of the second embodiment of the present application, and no further details will be given here.
[0218] Although the present application is disclosed as above with the preferred embodiments, it is not intended to limit the present application. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0219] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or module, which can be electrical, mechanical or other forms.
[0220] The above-mentioned integrated module implemented in the form of a software functional module can be stored in a computer-readable storage medium. The above-mentioned software functional module is stored in a storage medium and includes a number of instructions for causing an electronic device (which can be a personal computer, server, or network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.
[0221] It should be understood that the processor described above may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), or application-specific integrated circuits (ASICs). A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.
[0222] The memory may include a high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk.
[0223] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be classified into address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0224] The storage medium may be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0225] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0226] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A report updating method based on a data storage device, wherein the data storage device includes at least two data partitions, wherein the data partitions use data offsets as unique sequence identifiers for the stored data, and a data calculation module reads data from the corresponding data partition and performs calculations on the data. The report is displayed on a graphical user interface of a terminal, and is used to simultaneously display the calculation results corresponding to at least two of the data calculation modules, characterized in that: The method comprises: In response to the report update instruction, a calculation version identifier of the current data calculation task is sent to each of the data calculation modules, wherein the calculation version identifier includes at least a target data offset of the data partition corresponding to each data calculation module; the target data offset is used to instruct all the data calculation modules to stop reading data from the data partition when the data offset corresponding to the latest data read from the data partition is the target data offset; wherein different data calculation modules read data with a data offset of the target data offset from the corresponding data partition at the same time; receiving a calculation result corresponding to the data calculation module sent by each data calculation module; wherein, when the offset of the data currently read from the data partition by the data calculation module reaches the target data offset, the data calculation module calculates according to the read data to obtain the calculation result; When the calculation results of all the data calculation modules are received, the report is updated and displayed according to the calculation results of all the data calculation modules.
2. The method according to claim 1, characterized in that Before sending the calculation version information to each of the data calculation modules, the method further includes: Get the task generation cycle of the data computing task; Determining a task generation time according to the task generation cycle; The data calculation task is triggered to be generated at the task generation moment, and a report update instruction is created for the data calculation task.
3. The method according to claim 2, characterized in that The method further comprises: Determine a data consumption change within a unit time interval for each data partition in the data storage, where the data consumption change represents an amount of data read from the data partition by a data computing module corresponding to the data partition within a unit time interval; Based on the current data offset of each data partition at the current moment, the data consumption change and the first duration, the target data offset corresponding to each data partition is determined. The target data offset is the data offset of the data read from the data partition by the data calculation module at the target moment. The target moment refers to the moment when the timing starts from the current moment and the duration reaches the end of the first duration.
4. The method according to claim 3, characterized in that The determining of the data consumption change within a unit time interval of each data partition in the data storage device includes: For each of the at least two data partitions, obtaining a first data offset corresponding to the data partition at a first moment and a second data offset corresponding to the data partition at a second moment; determining a second duration according to the first moment and the second moment; A data consumption change within a unit time interval of the data partition is determined according to the first data offset, the second data offset, and the second duration.
5. The method according to claim 3, characterized in that The method further comprises: For each of the data computing modules, obtaining a target data partition corresponding to each of the data computing modules, wherein the target data partition is a data partition from which each of the data computing modules reads data among the multiple data partitions; After determining the target data offset corresponding to each data partition according to the current data offset of each data partition at the current moment, the data consumption change, and the first duration, the method further includes: Determining the target data partition corresponding to each of the data computing modules according to a preset correspondence relationship, wherein the preset correspondence relationship is used to indicate the correspondence between the data computing modules and the data partitions; For each of the data calculation modules, a calculation version identifier corresponding to the data calculation module is determined according to the target data partition corresponding to the data calculation module and the target data offsets respectively corresponding to the target data partitions.
6. The method according to claim 1, wherein The calculation version identifier also includes a task version number corresponding to the data calculation task. After receiving the calculation result corresponding to the data calculation module sent by each data calculation module, the method further includes: Establishing a correspondence between the task version number and the corresponding calculation result in each data calculation module; The method further comprises: Determining a report update cycle for the report; Determining the update time of the report according to the report update cycle; At the updating time, the task version numbers included in the corresponding relationship are traversed in sequence to determine whether the task version numbers correspond to the calculation results of all the data calculation modules.
7. The method according to claim 6, characterized in that The sequentially traversing the task version numbers included in the corresponding relationship includes: Traverse the task version numbers in reverse order of the task generation time corresponding to the task version number; When the calculation results of all the data calculation modules are received, the report is updated and displayed according to the calculation results of all the data calculation modules, including: When it is determined in the correspondence relationship that there is a task version number corresponding to the calculation results of all the data calculation modules, the task version number is determined as the target task version number; The report is updated and displayed according to the calculation results of all the data calculation modules corresponding to the target task version number.
8. The method according to claim 7, characterized in that When it is determined in the corresponding relationship that there is a task version number corresponding to the calculation results of all the data calculation modules, determining the task version number as the target task version number includes: Determine the first data calculation task according to the first task version number corresponding to the calculation result currently displayed in the report; When it is determined that there is a second task version number corresponding to the calculation results of all the data calculation modules in the corresponding relationship, determining a second data calculation task corresponding to the task version number; In a case where the task generation time of the second data computing task is later than the task generation time of the first data computing task, the second task version number is determined as the target task version number.
9. A report updating device based on a data storage device, wherein the data storage device includes at least two data partitions, the data partitions use data offsets as unique sequence identifiers for the stored data, a data calculation module reads data from the corresponding data partition and performs calculations on the data, the report is displayed on a graphical user interface of a terminal, and the report is used to simultaneously display the calculation results corresponding to at least two of the data calculation modules, characterized in that: The device comprises: a processing module, configured to send a calculation version identifier of a current data calculation task to each of the data calculation modules in response to a report update instruction, wherein the calculation version identifier includes at least a target data offset of the data partition corresponding to each data calculation module; the target data offset is used to instruct all of the data calculation modules to stop reading data from the data partition when the data offset corresponding to the latest data read from the data partition is the target data offset; wherein different data calculation modules respectively read data with a data offset of the target data offset from the corresponding data partition at the same time; a receiving module, configured to receive a calculation result corresponding to the data calculation module sent by each data calculation module; wherein, when the offset of the data currently read from the data partition by the data calculation module reaches the target data offset, the data calculation module calculates according to the read data to obtain the calculation result; The updating module is used to update and display the report according to the calculation results of all the data calculation modules when the calculation results of all the data calculation modules are received.
10. An electronic device, characterized in that: include: processor; as well as The memory is used to store a data processing program. After the electronic device is powered on and the program is run by the processor, the report updating method based on the data memory as described in any one of claims 1 to 8 is executed.
11. A computer-readable storage medium, characterized in that A data processing program is stored, and the program is run by a processor to execute the report updating method based on the data storage as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Data management method and device and electronic equipment
CN114116908A
Data display method and device, computer equipment and storage medium
CN114676190A