Method and device for calculating indexes in real time based on dynamic configuration
By monitoring the change log of the data table and synchronizing it to the search cluster, the problem of inefficient data processing in traditional technology is solved, real-time update and efficient calculation of data is realized, the indicator calculation and management process is simplified, and the real-time performance of modern business environment is met. Decision-making needs.
Patent Information
- Application Number
- CN202411313004.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-13
AI Technical Summary
Traditional technologies are inefficient in data processing when processing huge data sets, and the response time is too long, making it difficult to meet the demand for immediate decision-making support in modern business environments, especially in industrial and commercial, operation, financing, finance and science and technology data processing.
Through the method of dynamically configuring real-time calculation indicators, listen to the change log of the data table, extract the field values of the configuration fields, synchronize to the preset search cluster, record delay information and push it to the message queue, ensure the real-time and accuracy of the data, and Use Nacos as the configuration center to simplify the metric calculation and management process.
Real-time update and efficient calculation of data are realized, ensuring data accuracy and response speed, simplifying the process of metric calculation and management, making metric calculation more flexible and easy to maintain.
Smart Images

Figure CN119127901A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for real-time calculation of indicators based on dynamic configuration. Background Art
[0002] With the continuous leap forward of information technology, when faced with complex and ever-changing data fields such as industrial and commercial information, operating performance, financing activities, financial statements and technological innovation, enterprises and institutions have unprecedented requirements for the speed, accuracy and real-time nature of data processing.
[0003] In traditional technologies, data processing efficiency for large data sets is low and response time is too long. Therefore, traditional technologies cannot meet the needs of real-time decision support in modern business environments. At present, there is an urgent need for a computer method that can efficiently calculate, quickly store and update key data indicators such as industry and commerce, operations, financing, finance and science and technology in real time. Summary of the invention
[0004] Based on this, it is necessary to provide a method and device that can calculate indicators in real time based on dynamic configuration to address the above technical problems.
[0005] In a first aspect, the present application provides a method for calculating an indicator in real time based on dynamic configuration, comprising:
[0006] Determine a first data table, and configure configuration fields of the first data table;
[0007] Monitoring a first change log of the first data table, and extracting a field value of the configuration field based on the first change log;
[0008] Storing the field value of the configuration field in the second data table;
[0009] Monitor a second change log of the second data table to determine a change event of the second change log.
[0010] In one of the embodiments, the configuration field includes a synchronization field;
[0011] The monitoring of the first change log of the first data table and extracting the field value of the configuration field based on the first change log includes:
[0012] Synchronize the field value of the synchronization field to a preset search cluster;
[0013] Record the delay information of synchronizing the field value of the synchronization field to the preset search cluster;
[0014] Pushing the delay information to a message queue;
[0015] The storing the field value of the configuration field into the second data table includes:
[0016] The message queue is stored in a second data table.
[0017] In one embodiment, pushing the delay information to a message queue includes:
[0018] Determining a query statement in determining the synchronization field;
[0019] Based on the field value of the query statement, querying the preset search cluster for data corresponding to the field value of the query statement;
[0020] The data corresponding to the field value of the query statement is pushed to the message queue.
[0021] In one embodiment, pushing the delay information to a message queue includes:
[0022] Determining an indicator name in determining the synchronization field;
[0023] Based on the field value of the indicator name, querying the preset search cluster for data corresponding to the field value of the indicator name;
[0024] The data corresponding to the field value of the indicator name is pushed to the message queue.
[0025] In one embodiment, the monitoring the second change log of the second data table and determining the change event of the second change log includes:
[0026] Sending a change event of the second change log.
[0027] In one of the embodiments, the configuration field includes a priority field;
[0028] The sending of the change event of the second change log includes:
[0029] Based on the field value of the priority field, a plurality of change events of the second change log are sent.
[0030] In a second aspect, the present application also provides a device for calculating an indicator in real time based on dynamic configuration, comprising:
[0031] A configuration module, used to determine a first data table and configure configuration fields of the first data table;
[0032] A monitoring module, configured to monitor a first change log of the first data table, and extract a field value of the configuration field based on the first change log;
[0033] A storage module, used for storing the field value of the configuration field in a second data table;
[0034] The determination module is used to monitor the second change log of the second data table and determine the change event of the second change log.
[0035] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0036] Determine a first data table, and configure configuration fields of the first data table;
[0037] Monitoring a first change log of the first data table, and extracting a field value of the configuration field based on the first change log;
[0038] Storing the field value of the configuration field in the second data table;
[0039] Monitor a second change log of the second data table to determine a change event of the second change log.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0041] Determine a first data table, and configure configuration fields of the first data table;
[0042] Monitoring a first change log of the first data table, and extracting a field value of the configuration field based on the first change log;
[0043] Storing the field value of the configuration field in the second data table;
[0044] Monitor a second change log of the second data table to determine a change event of the second change log.
[0045] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0046] Determine a first data table, and configure configuration fields of the first data table;
[0047] Monitoring a first change log of the first data table, and extracting a field value of the configuration field based on the first change log;
[0048] Storing the field value of the configuration field in the second data table;
[0049] Monitor a second change log of the second data table to determine a change event of the second change log.
[0050] The above-mentioned method and device for calculating indicators in real time based on dynamic configuration can obtain data changes in real time by setting a first change log for monitoring the first data table and a second change log for monitoring the second data table, thereby ensuring the real-time and accuracy of the data. Furthermore, the present application can use Nacos as the configuration center, simplifying the indicator calculation and management process, making the indicator calculation more flexible and easy to maintain. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0052] Figures 1 to 6 A schematic diagram of a flow chart of a method for calculating an indicator in real time based on dynamic configuration in different embodiments;
[0053] Figure 7 is a structural block diagram of a device for calculating an indicator in real time based on dynamic configuration in one embodiment;
[0054] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] The method for calculating real-time indicators based on dynamic configuration provided by the embodiment of the present application can be applied in a server environment. The terminal can communicate with the server through a network. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, etc. 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 cloud computing services.
[0057] In one embodiment, a method for calculating an indicator in real time based on dynamic configuration is provided. This embodiment uses the method applied to a terminal as an example. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, please refer to Figure 1 and Figure 2 , the method comprises the following steps:
[0058] Step S100: determine a first data table, and configure configuration fields of the first data table.
[0059] Step S200: monitoring a first change log of a first data table, and extracting a field value of a configuration field based on the first change log.
[0060] Step S300: storing the field value of the configuration field into the second data table.
[0061] Step S400: monitoring a second change log of a second data table, and determining a change event of the second change log.
[0062] In step S100, as an example, a database table that needs to be monitored and the index that needs to be calculated can be set in the Nacos configuration center, and the database table that needs to be monitored and the index that needs to be calculated is a first data table. The first data table may include TiDB, MongoDB, etc.
[0063] The configuration fields of the first data table may include a business table update time field (updateTimeField), a field that needs to be synchronized to a search engine (elasticsearch) (syncFields), whether to calculate a field (isCalculate), or a priority field (priority). As an example, configuring the configuration fields of the first data table may include setting a business table update time field to real-time update (update_date).
[0064] In step S200, as an example, the change log of TiDB can be binlog, and the change log of MongoDB can be oplog. At this time, binlog or oplog can be monitored.
[0065] When the first data table changes, a first change log appears. At this time, the field value of the configuration field in the first change log can reflect the change.
[0066] In step S300, the second data table may be MongoDB. Of course, the second data table may also be TiDB, etc.
[0067] In step S400, the oplog of MongoDB can be monitored to capture data change events, obtain the latest data changes, and push these changes to the advanced search system for further search and analysis. For example, full / incremental Kafka can be obtained, and then the indicator type can be distinguished and inserted into MongoDB, and downstream notifications can be pushed.
[0068] In this embodiment, by setting the first change log of the first data table to monitor and the second change log of the second data table to monitor, the data changes can be obtained in real time, thereby ensuring the real-time and accuracy of the data. Furthermore, in this embodiment, Nacos can be used as the configuration center to simplify the index calculation and management process, making the index calculation more flexible and easy to maintain.
[0069] In one embodiment, see Figure 3 , the configuration fields include synchronization fields.
[0070] Accordingly, step S200 includes:
[0071] Step S210: Synchronize the field value of the synchronization field to the preset search cluster.
[0072] Step S220: Record the delay information of synchronizing the field value of the synchronization field to the preset search cluster.
[0073] Step S230: Push the delay information to the message queue.
[0074] Meanwhile, step S300 includes:
[0075] Step S310: Store the message queue into the second data table.
[0076] The synchronization fields can be fields that need to be synchronized to elasticsearch (syncFields). As an example, the fields that need to be synchronized to elasticsearch can specifically include fields that identify keynos such as company organizations (keynoFieldName), fields corresponding to indicators (indexFieldName), key values corresponding to indicators (indexKey), indicator type fields (indexType), indicator query time fields (timeFieldName), indicator query time range fields (indexTime), SQL query statements (sql), specific implementation class fields for indicator calculations (className), or calculation indicator type fields (calculateType), etc. Specifically, the indicator type field (indexType) can include industry and commerce, operation, financing, finance, and science and technology innovation, etc. The calculation indicator type field (calculateType) can include ratios, changes, and values, etc.
[0077] In step S210 to step S230, the preset search cluster can be elasticsearch, etc. As an example, according to the dynamic configuration in Nacos, the content of the specified field can be extracted from binlog and oplog, and the index can be dynamically created in elasticsearch based on the content of these fields (create elasticsearch index and mapping, and then insert elasticsearch in bulk mode). At the same time, this example will record the delay of data from the database to elasticsearch (i.e., keyno delay). After that, the calculated keyno delay information is pushed to the message queue (Kafka) for subsequent indicator calculation. For example, elasticsearch can be queried in batches and the full / incremental kafka can be pushed. For another example, the indicator calculation results can also be recorded and pushed offline.
[0078] In this embodiment, first, the field value of the synchronization field is synchronized to the preset search cluster by setting, so as to accurately obtain important data. Secondly, this embodiment records the delay information (keyno delay) so as to monitor the efficiency of the flow of the field value of the synchronization field in real time. In the process of synchronizing from the database to elasticsearch, there may be a risk of loss or inconsistency of the field value of the synchronization field. Recording delays can help track the synchronization status and ensure the consistency and integrity of the field value of the synchronization field. When the delay is too high or the synchronization fails, this embodiment can decide whether to trigger the retry mechanism based on the delay data to ensure that the field value of the synchronization field can be successfully synchronized to elasticsearch, thereby ensuring the real-time nature of the field value of the synchronization field.
[0079] In one embodiment, see Figure 4 , step S310 includes:
[0080] Step S311: determine the query statement in the synchronization field.
[0081] Step S312: Based on the field value of the query statement, search for data corresponding to the field value of the query statement in a preset search cluster.
[0082] Step S313: Push the data corresponding to the field value of the query statement to the message queue.
[0083] and / or, see Figure 5 In another embodiment, step S310 includes:
[0084] Step S314: Determine the indicator name in the synchronization field.
[0085] Step S315: Based on the field value of the indicator name, query the data corresponding to the field value of the indicator name in the preset search cluster.
[0086] Step S316: Push the data corresponding to the field value of the indicator name to the message queue.
[0087] In steps S311 to S313, if the synchronization field contains an SQL query statement (sql), the SQL query elasticsearch is executed to query the data corresponding to the field value of the query statement in the preset search cluster. As an example, if the input SQL statement is for a traditional relational database, it may be necessary to convert it into a query statement that elasticsearch can understand. If the input SQL statement is for elasticsearch, no conversion is required. Afterwards, the data corresponding to the field value of the elasticsearch query statement is pushed to the message queue (Kafka) in an appropriate format.
[0088] In steps S314 to S316, if the synchronization field contains the indicator name (className), the Java reflection mechanism can be used to dynamically load this class. According to the needs, these methods can be called through reflection and the necessary parameters can be passed in. After that, the data corresponding to the field value of the indicator name obtained by the method call is pushed to the message queue (Kafka) in an appropriate format.
[0089] In the above two embodiments, by encapsulating the interaction between SQL queries and elasticsearch, and calling methods in the class through the reflection mechanism, a more general data processing component can be created. These components can be reused across multiple projects or applications, improving the reusability of the code. Furthermore, when the data contains SQL queries, the execution of these queries can directly utilize the indexing and query optimization technology of elasticsearch, thereby efficiently retrieving and processing large amounts of data. Moreover, by reflecting the logical processing in the calling class, this embodiment can support almost any type of custom data processing logic. This enables this embodiment to flexibly adapt to different business needs and data processing scenarios, so that the design of this embodiment has good scalability and can be expanded horizontally or vertically as needed.
[0090] Of course, if the query statement or indicator name is empty, the relevant steps will not be executed.
[0091] In one embodiment, see Figure 6 , after step S400, including:
[0092] Step S500: Sending a change event of the second change log.
[0093] Further, the configuration field includes a priority field. Step S500 may include:
[0094] Step S510: sending change events of multiple second change logs based on the field value of the priority field.
[0095] As an example, when the field value of the priority field is less than or equal to 5, it indicates that the change event of the second change log is of high priority; when the field value of the priority field is greater than 5, it indicates that the change event of the second change log is of low priority.
[0096] This embodiment can actively push the calculation and storage of multiple indicators in multiple scenarios through binlog or oplog to meet the needs of different scenarios. Further, when the change events of multiple second change logs have different priorities, the change events of multiple second change logs can be sent based on the field value of the priority field, so that by sending multiple detailed change logs, it can be ensured that the content and impact of the second change logs are understood in a timely and accurate manner.
[0097] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0098] Based on the same inventive concept, the embodiment of the present application also provides a device based on dynamically configured real-time calculation indicators for implementing the method based on dynamically configured real-time calculation indicators involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more devices based on dynamically configured real-time calculation indicators provided below can refer to the limitations of the method based on dynamically configured real-time calculation indicators above, and will not be repeated here.
[0099] In an exemplary embodiment, Figure 7 As shown, a device for calculating an indicator in real time based on dynamic configuration is provided, comprising: a configuration module, a monitoring module, a storage module and a determination module, wherein:
[0100] The configuration module is used to determine the first data table and configure the configuration fields of the first data table.
[0101] The monitoring module is used to monitor a first change log of a first data table, and extract a field value of a configuration field based on the first change log.
[0102] The storage module is used to store the field value of the configuration field in the second data table.
[0103] The determination module is used to monitor the second change log of the second data table and determine the change event of the second change log.
[0104] In one embodiment, the configuration field includes a synchronization field, the monitoring module includes a synchronization unit, a recording unit, a pushing unit, and the storage module includes a storage unit.
[0105] The synchronization unit is used to synchronize the field value of the synchronization field to the preset search cluster.
[0106] The recording unit is used to record the delay information of synchronizing the field value of the synchronization field to the preset search cluster.
[0107] The push unit is used to push the delay information to the message queue.
[0108] The storage unit is used to store the message queue in the second data table.
[0109] In one embodiment, the push unit is also used to determine the query statement in the determined synchronization field, query the data corresponding to the field value of the query statement in the preset search cluster based on the field value of the query statement, and push the data corresponding to the field value of the query statement to the message queue.
[0110] In one embodiment, the push unit is also used to determine the indicator name in the synchronization field, based on the field value of the indicator name, query the data corresponding to the field value of the indicator name in the preset search cluster, and push the data corresponding to the field value of the indicator name to the message queue.
[0111] In one embodiment, the device for calculating indicators in real time based on dynamic configuration further includes: a sending module.
[0112] The sending module is used to send the change event of the second change log.
[0113] In one embodiment, the configuration field includes a priority field, and the sending module includes a sending unit.
[0114] The sending unit is used to send the change events of multiple second change logs based on the field value of the priority field.
[0115] Each module in the above-mentioned device for calculating real-time indicators based on dynamic configuration can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0116] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store XX data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for calculating indicators in real time based on dynamic configuration is implemented.
[0117] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0118] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0119] Step S100: determine a first data table, and configure configuration fields of the first data table.
[0120] Step S200: monitoring a first change log of a first data table, and extracting a field value of a configuration field based on the first change log.
[0121] Step S300: storing the field value of the configuration field into the second data table.
[0122] Step S400: monitoring a second change log of a second data table, and determining a change event of the second change log.
[0123] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0124] Step S210: Synchronize the field value of the synchronization field to the preset search cluster.
[0125] Step S220: Record the delay information of synchronizing the field value of the synchronization field to the preset search cluster.
[0126] Step S230: Push the delay information to the message queue.
[0127] Step S310: Store the message queue into the second data table.
[0128] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0129] Step S311: determine the query statement in the synchronization field.
[0130] Step S312: Based on the field value of the query statement, search for data corresponding to the field value of the query statement in a preset search cluster.
[0131] Step S313: Push the data corresponding to the field value of the query statement to the message queue.
[0132] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0133] Step S314: Determine the indicator name in the synchronization field.
[0134] Step S315: Based on the field value of the indicator name, query the data corresponding to the field value of the indicator name in the preset search cluster.
[0135] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0136] Step S500: Sending a change event of the second change log.
[0137] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0138] Step S510: sending change events of multiple second change logs based on the field value of the priority field.
[0139] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0140] Step S100: determine a first data table, and configure configuration fields of the first data table.
[0141] Step S200: monitoring a first change log of a first data table, and extracting a field value of a configuration field based on the first change log.
[0142] Step S300: storing the field value of the configuration field into the second data table.
[0143] Step S400: monitoring a second change log of a second data table, and determining a change event of the second change log.
[0144] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0145] Step S210: Synchronize the field value of the synchronization field to the preset search cluster.
[0146] Step S220: Record the delay information of synchronizing the field value of the synchronization field to the preset search cluster.
[0147] Step S230: Push the delay information to the message queue.
[0148] Step S310: Store the message queue into the second data table.
[0149] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0150] Step S311: determine the query statement in the synchronization field.
[0151] Step S312: Based on the field value of the query statement, search for data corresponding to the field value of the query statement in a preset search cluster.
[0152] Step S313: Push the data corresponding to the field value of the query statement to the message queue.
[0153] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0154] Step S314: Determine the indicator name in the synchronization field.
[0155] Step S315: Based on the field value of the indicator name, query the data corresponding to the field value of the indicator name in the preset search cluster.
[0156] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0157] Step S500: Sending a change event of the second change log.
[0158] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0159] Step S510: sending change events of multiple second change logs based on the field value of the priority field.
[0160] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0161] Step S100: determine a first data table, and configure configuration fields of the first data table.
[0162] Step S200: monitoring a first change log of a first data table, and extracting a field value of a configuration field based on the first change log.
[0163] Step S300: storing the field value of the configuration field into the second data table.
[0164] Step S400: monitoring a second change log of a second data table, and determining a change event of the second change log.
[0165] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0166] Step S210: Synchronize the field value of the synchronization field to the preset search cluster.
[0167] Step S220: Record the delay information of synchronizing the field value of the synchronization field to the preset search cluster.
[0168] Step S230: Push the delay information to the message queue.
[0169] Step S310: Store the message queue into the second data table.
[0170] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0171] Step S311: determine the query statement in the synchronization field.
[0172] Step S312: Based on the field value of the query statement, search for data corresponding to the field value of the query statement in a preset search cluster.
[0173] Step S313: Push the data corresponding to the field value of the query statement to the message queue.
[0174] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0175] Step S314: Determine the indicator name in the synchronization field.
[0176] Step S315: Based on the field value of the indicator name, query the data corresponding to the field value of the indicator name in the preset search cluster.
[0177] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0178] Step S500: Sending a change event of the second change log.
[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0180] Step S510: sending change events of multiple second change logs based on the field value of the priority field.
[0181] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0182] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0183] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0184] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for real-time calculation of indicators based on dynamic configuration, characterized in that: The method comprises: Determine a first data table, and configure configuration fields of the first data table; Monitoring a first change log of the first data table, and extracting a field value of the configuration field based on the first change log; Storing the field value of the configuration field in the second data table; Monitor a second change log of the second data table to determine a change event of the second change log.
2. The method for calculating indicators in real time based on dynamic configuration according to claim 1, characterized in that: The configuration field includes a synchronization field; The monitoring of the first change log of the first data table and extracting the field value of the configuration field based on the first change log includes: Synchronize the field value of the synchronization field to a preset search cluster; Record the delay information of synchronizing the field value of the synchronization field to the preset search cluster; Pushing the delay information to a message queue; The storing the field value of the configuration field into the second data table includes: The message queue is stored in a second data table.
3. The method for calculating indicators in real time based on dynamic configuration according to claim 2, characterized in that: The pushing the delay information to a message queue includes: Determining a query statement in determining the synchronization field; Based on the field value of the query statement, querying the preset search cluster for data corresponding to the field value of the query statement; The data corresponding to the field value of the query statement is pushed to the message queue.
4. The method for calculating indicators in real time based on dynamic configuration according to claim 2, characterized in that: The pushing the delay information to a message queue includes: Determining an indicator name in determining the synchronization field; Based on the field value of the indicator name, querying the preset search cluster for data corresponding to the field value of the indicator name; The data corresponding to the field value of the indicator name is pushed to the message queue.
5. The method for calculating indicators in real time based on dynamic configuration according to claim 1, characterized in that: After monitoring the second change log of the second data table and determining the change event of the second change log, the method includes: Sending a change event of the second change log.
6. The method for calculating indicators in real time based on dynamic configuration according to claim 5, characterized in that: The configuration field includes a priority field; The sending of the change event of the second change log includes: Based on the field value of the priority field, a plurality of change events of the second change log are sent.
7. A device for real-time calculation of indicators based on dynamic configuration, characterized in that: The device comprises: A configuration module, used to determine a first data table and configure configuration fields of the first data table; A monitoring module, configured to monitor a first change log of the first data table, and extract a field value of the configuration field based on the first change log; A storage module, used for storing the field value of the configuration field in a second data table; The determination module is used to monitor the second change log of the second data table and determine the change event of the second change log.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
