Index calculation task scheduling method and device, electronic equipment and storage medium

By building indicator dependency links and generating indicator calculation tasks with priority identification, and using multiple processing threads to process these tasks asynchronously, the problem of low indicator calculation efficiency in the existing technology is solved, and efficient and reliable indicator calculation scheduling is achieved.

CN120179356APending Publication Date: 2025-06-20CISDI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510242764.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

In the prior art, the calculation efficiency of indicators is low, mainly because business personnel need to manually configure the calculation method of each indicator, resulting in complex indicator relationships and a large number of repeated calculations.

Method used

By obtaining indicator data, dividing it into atomic indicators and compound indicators, and building indicator-dependent links based on their dependencies, metric calculation tasks with priority identification are generated based on these data and links, and multiple processing threads are used to process these tasks asynchronously to achieve efficient indicator calculation scheduling.

Benefits of technology

Through the automated metric calculation task scheduling method, we ensure the correct scheduling sequence of the upstream and downstream relationships of metrics, improve the efficiency and reliability of metric calculations, and support cluster deployment to achieve maximum resource utilization and load balancing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179356A_ABST
    Figure CN120179356A_ABST
Patent Text Reader

Abstract

The invention provides an index calculation task scheduling method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining index data, dividing the index data into an atomic index and a composite index, obtaining an index dependency link according to the dependency relationship between the atomic index and the composite index, and obtaining a target index; according to the method, the index calculation task with the priority identifier is obtained on the basis of the index data and the index dependency link, a plurality of processing threads are set to carry out asynchronous processing on the index calculation task on the basis of the priority identifier so as to schedule the index calculation task, and therefore the technical problem that the calculation efficiency of the index is low is solved according to the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a method, apparatus, electronic device, and storage medium for scheduling index calculation tasks. Background Art

[0002] In daily industrial production management, a large number of reports will be generated, such as equipment operation logs, production management reports, laboratory test record forms, daily inventory statistics tables, etc. With the rapid development of digital technology, many reports can already be filled in by connecting devices or sensors and collecting and processing relevant data. In this context, building an efficient and intelligent index management system has become a core link in many digital transformation projects and is indispensable. This index management system can integrate and standardize report resources, making the data easier to understand and use, so that the performance and trends of various business indicators can be clearly understood, providing more timely, comprehensive, and powerful data support for decision-making.

[0003] In the related art, business personnel manually configure the calculation method for each index, and it is necessary for business personnel to clarify the upstream and downstream relationships between various indexes. Once the index relationships become complex, the calculation scheduling will be more intensive, resulting in duplicate calculations of a large number of indexes and low calculation efficiency of the indexes. Summary of the Invention

[0004] In view of the above-mentioned deficiencies of the related art, this application provides a method, apparatus, electronic device, and storage medium for scheduling index calculation tasks to solve the technical problem of low calculation efficiency of indexes.

[0005] This application provides a method for scheduling index calculation tasks, and the method includes: obtaining index data, dividing the index data into atomic indexes and composite indexes, and obtaining an index dependency link according to the dependency relationship between the atomic indexes and the composite indexes; obtaining an index calculation task with a priority identifier based on the index data and the index dependency link; setting multiple processing threads to asynchronously process the index calculation task based on the priority identifier to schedule the index calculation task.

[0006] In an embodiment of this application, obtaining an index dependency link according to the dependency relationship between the atomic indexes and the composite indexes includes: obtaining original report data, determining at least one atomic index based on the data items in the original report data; using the atomic index as the most upstream node of the index dependency link; determining the upstream dependent indexes of the composite indexes according to the calculation parameters of the composite indexes, and determining the dependency relationship between the atomic indexes and the composite indexes according to the upstream dependent indexes of each composite index to determine the index dependency link.

[0007] In an embodiment of the present application, obtaining the metric calculation task with a priority identifier based on the metric data and the metric dependency link includes: setting the priority identifier of the atomic metric to the highest priority; determining the priority of the composite metric based on the upstream dependent metrics of the composite metric; determining the priority identifier of the metric calculation task according to the metric data corresponding to the metric calculation task, and determining the calculation parameters corresponding to the metric calculation task according to the corresponding metric data and the metric dependency link.

[0008] In an embodiment of the present application, setting multiple processing threads to asynchronously process the metric calculation task based on the priority identifier includes: if there is at least one available thread, querying the priority identifiers of at least one metric calculation task being processed; if there is at least one pending metric calculation task whose priority identifier is the same as that of the metric calculation task being processed, asynchronously processing the pending metric calculation task based on the available thread.

[0009] In an embodiment of the present application, after querying the priority identifiers of at least one metric calculation task being processed, it further includes: detecting the locked state of the metric calculation task being processed; if the locked state of the metric calculation task being processed is locked, asynchronously processing the pending metric calculation task based on the available thread; if the locked state of the metric calculation task being processed is unlocked, re-querying the priority identifiers of at least one metric calculation task being processed.

[0010] In an embodiment of the present application, asynchronously processing the pending metric calculation task based on the available thread further includes: locking the metric calculation task being processed, if the locking is successful, asynchronously processing the pending metric calculation task based on the available thread; if the locking fails, re-selecting at least one pending metric calculation task whose priority identifier is the same as that of the metric calculation task being processed.

[0011] In an embodiment of the present application, after asynchronously processing the pending metric calculation task based on the available thread, it further includes: updating the task state of the metric calculation task in asynchronous processing to being processed; calculating the metric calculation task, and after the calculation is completed, updating the task state of the metric calculation task to processing success or processing failure according to the calculation result; unlocking the metric calculation task after asynchronous processing, and updating the locked state of the metric calculation task to unlocked.

[0012] Embodiments of the present application further provide an index calculation task scheduling device, which includes: a data input module, configured to obtain index data, divide the index data into atomic indexes and composite indexes, and obtain an index dependency link according to the dependency relationship between the atomic indexes and the composite indexes; a task creation module, configured to obtain an index calculation task with a priority identifier based on the index data and the index dependency link; a calculation scheduling module, configured to set multiple processing threads to asynchronously process the index calculation task based on the priority identifier, so as to schedule the index calculation task.

[0013] Embodiments of the present application further provide an electronic device, which includes: one or more processors; a storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, enable the electronic device to implement the index calculation task scheduling method according to any one of the above embodiments.

[0014] Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor of a computer, enable the computer to execute the index calculation task scheduling method according to any one of the above embodiments.

[0015] Advantages of the present application: Embodiments of the present application provide an index calculation task scheduling method, device, electronic device and storage medium. The method includes obtaining index data, dividing the index data into atomic indexes and composite indexes, obtaining an index dependency link according to the dependency relationship between the atomic indexes and the composite indexes, obtaining an index calculation task with a priority identifier based on the index data and the index dependency link, setting multiple processing threads to asynchronously process the index calculation task based on the priority identifier, so as to schedule the index calculation task. By this method, the correct scheduling order of the upstream and downstream relationships of the indexes is ensured, so as to achieve efficient and reliable index calculation scheduling. Through asynchronous processing, cluster deployment can also be supported.

[0016] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. Brief Description of the Drawings

[0017] Figure 1 It is a schematic diagram of an index dependency link of an index calculation task scheduling method shown in an exemplary embodiment of the present application;

[0018] Figure 2 It is a flowchart of an index calculation task scheduling method shown in an exemplary embodiment of the present application;

[0019] Figure 3It is a flowchart for generating a to-be-processed metric calculation task shown in an exemplary embodiment of the present application;

[0020] Figure 4 It is a flowchart for scheduling multi-threaded metric calculation tasks shown in an exemplary embodiment of the present application;

[0021] Figure 5 It is a block diagram of a metric calculation task scheduling device shown in an exemplary embodiment of the present application;

[0022] Figure 6 It is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present application. Detailed implementation manners

[0023] The following uses specific specific examples to illustrate the implementation manners of the present application. Those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.

[0024] It should be noted that the drawings provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner. Therefore, only the components related to the present application are shown in the drawings, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.

[0025] It should be noted that in the present application, "first", "second", etc. are only used to distinguish similar objects, and are not used to limit the order or sequence of similar objects. The described "including", "having", etc. are deformed, indicating that the scope covered by the subject of this word is not exclusive except for the examples shown by this word.

[0026] It can be understood that the various digital numbers, step numbers, etc. recorded in the present application are for the convenience of description and are not used to limit the scope of the present application. The size of the labels in the present application does not mean the sequence of execution order. The execution order of each process should be determined by its function and internal logic.

[0027] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0028] Embodiments of the present application respectively propose a method for scheduling index calculation tasks, an apparatus for scheduling index calculation tasks, an electronic device, a computer-readable storage medium, and a computer program product. The following will describe these embodiments in detail.

[0029] Please refer to Figure 1 , Figure 1 which is a schematic diagram of an index dependency link of a method for scheduling index calculation tasks shown in an exemplary embodiment of the present application.

[0030] As Figure 1 shown, Figure 1 is a directed acyclic graph (DAG). A complex task is split into calculation tasks with a single index as the granularity through the Figure 1 data structure. The atomic indexes in Figure 1 are data indexes that can be directly obtained based on the original report (original data). The basic indexes that can be quickly obtained by configuring aggregation fields and filtering conditions are used as atomic indexes. The composite indexes are index data obtained by combining the formulas of multiple atomic indexes or composite indexes through one or more other indexes. Thus, the upstream and downstream relationships between various indexes are constructed based on the Figure 1 dependency link graph. The completion of the calculation of the upstream index is the premise and basis for the calculation of the downstream index. For example, in Figure 1 , atomic index 1 and atomic index 2 are the upstream indexes of composite index 1, and composite index 4 is the downstream index of composite index 1.

[0031] Please refer to Figure 2 , Figure 2 which is a flowchart of a method for scheduling index calculation tasks shown in an exemplary embodiment of the present application.

[0032] As Figure 2 shown, in an exemplary embodiment, the method for scheduling index calculation tasks at least includes steps S210 to S230, which are introduced in detail as follows:

[0033] Step S210, obtain index data, divide the index data into atomic indexes and composite indexes, and obtain an index dependency link according to the dependency relationship between the atomic indexes and the composite indexes.

[0034] In one embodiment of the present application, obtaining an indicator dependency link according to the dependency relationship between atomic indicators and composite indicators includes: obtaining original report data, and determining at least one atomic indicator based on data items in the original report data; taking the atomic indicator as the most upstream node of the indicator dependency link; determining the upstream dependency indicators of the composite indicator according to the calculation parameters of the composite indicator, and determining the dependency relationship between the atomic indicator and the composite indicator according to the upstream dependency indicators of each composite indicator, so as to determine the indicator dependency link.

[0035] Exemplarily, the method for constructing an indicator dependency link diagram as shown in Figure 1 includes first splitting a complex calculation task into multiple indicator data, where the indicator data includes atomic indicators and composite indicators. The atomic indicator is the basic data that can be obtained by directly aggregating or filtering the original report. The atomic data is used as the first layer of the indicator dependency link. The composite indicator is an indicator that depends on atomic indicators or other composite indicators for calculation. For example, Figure 1 in, the calculation parameters of composite indicator 1 depend on atomic indicator 1 and atomic indicator 2, then composite indicator 1 is used as the second layer of the indicator dependency link. The calculation parameters of composite indicator 2 depend on atomic indicator 1 and atomic indicator 2, then composite indicator 2 is used as the second layer of the indicator dependency link. The calculation parameters of composite indicator 3 depend on atomic indicator 1 and composite indicator 2, then composite indicator 3 is used as the third layer of the indicator dependency link. The calculation parameters of composite indicator 4 depend on composite indicator 1 and composite indicator 3, then composite indicator 4 is used as the fourth layer of the indicator dependency link.

[0036] Exemplarily, according to Figure 1 the shown indicator dependency link schematic diagram assigns priorities to each indicator data. The priorities of all atomic indicators (the first layer) are set to the first priority (the highest priority), and the priority identifier is set to 0. The priorities of composite indicator 1 and composite indicator 2 (the second layer) are set to the second priority, and the priority identifier is set to 1. The priority of composite indicator 3 (the third layer) is set to the third priority, and the priority identifier is set to 2. The priority of composite indicator 4 (the fourth layer) is set to the fourth priority, and the priority identifier is set to 3.

[0037] Exemplarily, the priority of a downstream indicator depends on the priority of an upstream indicator, and the priority of the downstream indicator is the next priority of the upstream indicator with the lowest priority. For example, the upstream indicators of composite indicator 3 are atomic indicator 1 and composite indicator 2. The upstream indicator with the lowest priority of composite indicator 3 is composite indicator 2. The priority of composite indicator 2 is the second priority, so the priority of composite indicator 3 is the third priority.

[0038] Step S220, obtaining an indicator calculation task with a priority identifier based on the indicator data and the indicator dependency link.

[0039] Exemplarily, as shown in Table 1, Table 1 is a list of metric calculation tasks with priority identifiers and calculation parameters. As shown in Table 1, the priority identifier corresponding to atomic metric 1 is 0, indicating the first priority (highest priority). The meaning of the calculation parameter JSON string corresponding to atomic metric 1 is to sum the original report through the aggregation function sum. The priority identifier corresponding to atomic metric 2 is 0, indicating the first priority (highest priority). The meaning of the calculation parameter JSON string corresponding to atomic metric 2 is to count the number of cells in the original report through the aggregation function count. The priority identifier corresponding to composite metric 1 is 1, indicating the second priority. The meaning of the calculation parameter JSON string corresponding to composite metric 1 is atomic metric 1 + atomic metric 2, and atomic metric 1 and atomic metric 2 are the upstream metrics of composite metric 1. The priority identifier corresponding to composite metric 2 is 1, indicating the second priority. The meaning of the calculation parameter JSON string corresponding to composite metric 2 is atomic metric 1 - atomic metric 2. The priority identifier corresponding to composite metric 3 is 2, indicating the third priority. The meaning of the calculation parameter JSON string corresponding to composite metric 3 is atomic metric 1 × composite metric 2. The priority identifier corresponding to composite metric 4 is 3, indicating the fourth priority. The meaning of the calculation parameter JSON string corresponding to composite metric 4 is composite metric 1 / composite metric 3.

[0040] Table 1

[0041]

[0042] Execution status: pending, in progress, successful, failed

[0043] In an embodiment of the present application, obtaining metric calculation tasks with priority identifiers based on metric data and metric dependency links includes: setting the priority identifier of atomic metrics to the highest priority; determining the priority of composite metrics based on the upstream dependent metrics of the composite metrics; determining the priority identifier of the metric calculation task according to the metric data corresponding to the metric calculation task, and determining the calculation parameters corresponding to the metric calculation task according to the corresponding metric data and metric dependency links.

[0044] Step S230, set multiple processing threads to asynchronously process the metric calculation tasks based on the priority identifiers to schedule the metric calculation tasks.

[0045] In an embodiment of the present application, setting multiple processing threads to asynchronously process the metric calculation tasks based on the priority identifiers includes: if there is at least one available thread, query the priority identifiers of at least one metric calculation task in progress; if there is at least one pending metric calculation task with the same priority identifier as the metric calculation task in progress, asynchronously process the pending metric calculation task based on the available threads.

[0046] In an embodiment of the present application, after querying the priority identifiers of at least one in - process metric calculation task, the following steps are further included: detecting the lock status of the in - process metric calculation task; if the lock status of the in - process metric calculation task is locked, asynchronously processing the metric calculation tasks to be processed based on available threads; if the lock status of the in - process metric calculation task is unlocked, re - querying the priority identifiers of at least one in - process metric calculation task.

[0047] Exemplarily, locking the metric calculation task can adopt the watchdog mechanism of the distributed lock, which is a monitoring and maintenance mechanism for distributed locks. It starts a timing task after the thread holding the lock successfully acquires the lock, and periodically sends a renewal request to the storage system (such as Redis) on which the distributed lock depends to extend the validity period of the lock. When the thread holding the lock encounters an exception or crashes, the watchdog mechanism stops renewing the lease and automatically releases the lock after a period of time. This mechanism effectively avoids the problem of lock loss caused by accidental release of the thread, and improves the stability and reliability of the distributed system.

[0048] In an embodiment of the present application, asynchronously processing the metric calculation tasks to be processed based on available threads further includes: locking the in - process metric calculation task, if the locking is successful, asynchronously processing the metric calculation tasks to be processed based on available threads; if the locking fails, re - selecting at least one metric calculation task to be processed with the same priority identifier as the in - process metric calculation task.

[0049] In an embodiment of the present application, after asynchronously processing the metric calculation tasks to be processed based on available threads, the following steps are further included: updating the task status of the metric calculation task in asynchronous processing to in - process; calculating the metric calculation task based on the calculation parameters, and after the calculation is completed, updating the task status of the metric calculation task to processing successful or processing failed according to the calculation result; unlocking the metric calculation task after asynchronous processing, and updating the lock status of the metric calculation task to unlocked.

[0050] Please refer to Figure 3 , Figure 3 which is a flowchart for generating metric calculation tasks to be processed shown in an exemplary embodiment of the present application. According to Figure 3As shown when the scheduling starts (the start time of the scheduling plan is set according to the update period of the original report), query the list of atomic metric configurations in the database, add the atomic metrics to the list of metric configurations to be processed, query the corresponding list of downstream composite metric configurations, and add the corresponding downstream composite metrics to the list of metric configurations to be processed. Keep querying in a loop until all downstream composite metrics of all atomic metrics are added to the list of metric configurations to be processed, so as to obtain all the atomic metrics and composite metrics required for this scheduling. Construct the list of metric configurations to be processed into a directed acyclic graph (DAG) data structure to obtain the metric dependency link, assign priorities to each node of the metric dependency link, assign the same priority to the nodes that can be processed in parallel (the same layer), and generate a batch of metric calculation tasks with priority identifiers based on the metric dependency link and store them in the database, waiting for the thread to process.

[0051] Please refer to Figure 4 , Figure 4 which is the multi-threaded metric calculation task scheduling flowchart shown in an exemplary embodiment of the present application. According to Figure 4 as shown, start a consumer thread following the start of the metric calculation task scheduling to process the metric calculation tasks in parallel, start the loop scheduling of the thread, and set a short sleep time for the loop scheduling to reduce resource consumption. The following is the internal logic of the loop scheduling.

[0052] Exemplarily, first check for available worker threads. If there are available worker threads, query the tasks with execution statuses of to be processed and in processing, judge the number of tasks queried. If the number of tasks queried is greater than 0, then judge that there is at least one metric calculation task with the status of in processing among the tasks queried. If there is, take out a task with the status of in processing, check the actual lock status of this task in processing. If it has been locked, it means that this task is being executed normally. Use the priority identifier of this metric calculation task in normal execution as a parameter to query a pending task with the same priority. If there is, take out a pending metric calculation task with the same priority as the task being executed and lock this task using a distributed lock, and submit it to the worker thread pool for asynchronous processing. The asynchronous processing includes, first setting the execution status of this task to in processing, and then starting the calculation until after the calculation, update the execution status to success or failure based on the calculation result, and unlock the distributed lock of this task.

[0053] Exemplarily, if the number of tasks queried is less than or equal to 0, it means that there are no tasks, skip the subsequent code, and wait for the next loop iteration of the loop scheduling.

[0054] Exemplarily, if there is none, then take out a pending metric calculation task with the highest priority, lock it, and submit it to the worker thread pool for processing.

[0055] Exemplarily, if the task in progress is not locked, it means that the instance executing the task has unexpectedly gone offline. Update the task status of this task to failed, skip the subsequent code, and wait for the next loop iteration.

[0056] Exemplarily, with this metric calculation task scheduling method, there is no need for business personnel to manually configure the scheduling for each metric. Just based on the update cycle of the original report, batch-set the scheduling plan for atomic metrics. Subsequently, the system will automatically schedule according to these plans. Instead of directly starting with metric calculation, it takes these batch-configured atomic metrics as the starting point, circularly queries the downstream metric configurations, constructs the metric configuration dependency link from the uppermost to the lowermost, and forms a data structure of a directed acyclic graph (DAG). Subsequently, according to the characteristics of this data structure, calculate the execution priority of each node in the graph, and assign the same priority to the nodes that can be processed in parallel. After construction, store these batches of nodes and their corresponding metric calculation parameters in the database, thus generating a batch of pending metric calculation tasks containing priorities.

[0057] Exemplarily, to efficiently process these pending metric calculation tasks, the metric management system has an asynchronous thread that starts with the application. This thread is specifically used to obtain and allocate pending metric calculation tasks. First, it checks whether there are still available worker threads in the current instance. If there are spare worker threads, it will search for and obtain the pending task with the highest priority, and check the completion status of all prerequisite tasks of this task. Once it is confirmed that the prerequisite task list has been completely completed, it will lock this task and submit it to a pre-defined worker thread pool for metric calculation. With this efficient mechanism of generating and consuming tasks, this solution perfectly supports cluster deployment and can achieve the maximization of resource utilization and load balancing in a distributed environment. No matter how large the task scale is, it can be evenly distributed to each server instance, thus ensuring the efficient and stable execution of metric calculation tasks.

[0058] Please refer to Figure 5 , Figure 5 which is a block diagram of a metric calculation task scheduling device shown in an exemplary embodiment of the present application.

[0059] As Figure 5 shown, this exemplary metric calculation task scheduling device includes:

[0060] A data input module 501, configured to obtain metric data, divide the metric data into atomic metrics and composite metrics, and obtain a metric dependency link according to the dependency relationship between the atomic metrics and the composite metrics;

[0061] A task creation module 502, configured to obtain metric calculation tasks with priority identifiers based on the metric data and the metric dependency link;

[0062] A calculation scheduling module 503 is configured to set multiple processing threads to asynchronously process metric calculation tasks based on priority identifiers, so as to schedule the metric calculation tasks.

[0063] Figure 6 FIG. shows a schematic structural diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application. It should be noted that Figure 6 The computer system 600 of the electronic device shown is only an example, and should not impose any limitation on the functions and usage scope of the embodiments of the present application.

[0064] As Figure 6 shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage section 608 into the random access memory (RAM) 603, such as executing the method described in the above embodiments. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0065] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as required. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as required, so that a computer program read from it can be installed into the storage section 608 as required.

[0066] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 609 and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, various functions defined in the system of the present application are executed.

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

[0068] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0069] The units involved in the embodiments described in the present application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not, in some cases, constitute a limitation on the unit itself.

[0070] Another aspect of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor of the computer, the computer is caused to execute the index calculation task scheduling method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist alone without being assembled into the electronic device.

[0071] Another aspect of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to execute the index calculation task scheduling method provided in the above various embodiments.

[0072] The above embodiments are only used to exemplarily illustrate the principles and effects of the present application, rather than to limit the present application. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes completed by those with ordinary knowledge in the technical field without departing from the spirit and technical idea disclosed in the present application should still be covered by the claims of the present application.

Claims

1. A method for scheduling index calculation tasks, characterized in that: The method comprises: Acquire indicator data, divide the indicator data into atomic indicators and composite indicators, and obtain an indicator dependency link according to a dependency relationship between the atomic indicators and the composite indicators; Obtaining an indicator calculation task with a priority identifier based on the indicator data and the indicator dependency link; Multiple processing threads are set to asynchronously process the indicator calculation task based on the priority identifier to schedule the indicator calculation task.

2. The method for scheduling index calculation tasks according to claim 1, characterized in that: Obtaining an indicator dependency link according to the dependency relationship between the atomic indicator and the composite indicator includes: Acquire original report data, and determine at least one atomic indicator based on data items in the original report data; Using the atomic indicator as the most upstream node of the indicator dependency link; The upstream dependent indicator of the composite indicator is determined according to the calculation parameters of the composite indicator, and the dependency relationship between the atomic indicator and the composite indicator is determined according to the upstream dependent indicator of each composite indicator to determine the indicator dependency link.

3. The method for scheduling index calculation tasks according to claim 2, characterized in that: Obtaining an indicator calculation task with a priority identifier based on the indicator data and the indicator dependency link includes: Setting the priority identifier of the atomic indicator to the highest priority; Determining the priority of the composite indicator based on the upstream dependent indicators of the composite indicator; The priority identifier of the indicator calculation task is determined according to the indicator data corresponding to the indicator calculation task, and the calculation parameters corresponding to the indicator calculation task are determined according to the corresponding indicator data and the indicator dependency link.

4. The method for scheduling index calculation tasks according to claim 1, characterized in that: Setting multiple processing threads to asynchronously process the indicator calculation task based on the priority identifier includes: If there is at least one available thread, query the priority identifier of at least one indicator calculation task being processed; If there is at least one pending indicator calculation task whose priority identifier is the same as the indicator calculation task being processed, the pending indicator calculation task is asynchronously processed based on the available thread.

5. The method for scheduling index calculation tasks according to claim 4, characterized in that: After querying the priority identifier of at least one indicator calculation task being processed, the following is further included: detecting a locking state of the indicator calculation task being processed; If the lock state of the indicator calculation task being processed is locked, asynchronously processing the indicator calculation task to be processed based on the available thread; If the locking state of the indicator calculation task being processed is unlocked, the priority identifier of at least one indicator calculation task being processed is re-queried.

6. The method for scheduling index calculation tasks according to claim 4, characterized in that: Then asynchronously processing the to-be-processed indicator calculation task based on the available thread further includes: The indicator calculation task to be processed is locked, and if the locking is successful, the indicator calculation task to be processed is asynchronously processed based on the available thread; If the locking fails, at least one to-be-processed indicator calculation task having the same priority identifier as the indicator calculation task being processed is reselected.

7. The method for scheduling index calculation tasks according to claim 4, characterized in that: Then after asynchronously processing the to-be-processed indicator calculation task based on the available thread, the method further includes: Update the task status of the indicator calculation task in asynchronous processing to processing; Calculate the indicator calculation task, and after the calculation is completed, update the task status of the indicator calculation task to processing success or processing failure according to the calculation result; Unlock the indicator calculation task after asynchronous processing, and update the lock state of the indicator calculation task to unlock.

8. An indicator calculation task scheduling device, characterized in that: The indicator calculation task scheduling device comprises: A data input module, used to obtain indicator data, divide the indicator data into atomic indicators and composite indicators, and obtain an indicator dependency link according to the dependency relationship between the atomic indicators and the composite indicators; A task creation module, used to obtain an indicator calculation task with a priority identifier based on the indicator data and the indicator dependency link; The calculation scheduling module is used to set multiple processing threads to asynchronously process the indicator calculation task based on the priority identifier so as to schedule the indicator calculation task.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the indicator calculation task scheduling method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the indicator calculation task scheduling method as described in any one of claims 1-7.