Business data recalculation method and device, electronic equipment and storage medium
By receiving recalculation instructions, matching tasks, determining models and updating database results, the problem of low efficiency in historical data recalculation in ERP system is solved, and fast and accurate recalculation processing is achieved, improving user experience.
Patent Information
- Application Number
- CN202510504761.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-01
AI Technical Summary
The prior art cannot quickly and accurately recalculate the historical service data in the ERP system, especially when the calculation rules change, the processing efficiency is low.
By receiving recalculation instructions, matching the target recalculation task and obtaining historical and new business data, determining the target recalculation model using the set number threshold, processing the data and updating the database results.
It realizes fast and accurate recalculation of business data, improving user experience.
Smart Images

Figure CN120407566A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for recalculating business data. Background Art
[0002] In the Enterprise Resource Planning (ERP) industry, a large amount of data is usually involved, such as sales data of various merchants or distributors, order data of different products, logistics data, or log data.
[0003] At present, when the calculation rules of the system configuration change or the merchant wants to calculate a certain calculation indicator, only the subsequent new business data can be processed, and the historical business data cannot be recalculated accordingly, and the processing efficiency is low.
[0004] How to quickly and accurately recalculate relevant business data and improve user experience is a key research issue in the industry. Summary of the Invention
[0005] The present invention provides a business data recalculation method, device, electronic device and storage medium to quickly and accurately recalculate relevant business data and improve user experience.
[0006] According to one aspect of the present invention, a method for recalculating service data is provided, the method comprising:
[0007] Receive a recalculation instruction for a target calculation indicator, add a target recalculation task matching the recalculation instruction to a recalculation record table, and obtain historical business data and newly added business data associated with the target calculation indicator;
[0008] If it is determined based on the recalculation record table that the number of recalculation tasks currently being processed is less than a set number threshold, determining a target recalculation model, and processing the historical business data and the newly added business data based on the target recalculation model to obtain a target recalculation result that matches the target calculation indicator;
[0009] The last calculation result matching the target calculation index stored in the target database is updated based on the target recalculation result.
[0010] According to another aspect of the present invention, there is provided a ... device, the device comprising:
[0011] A recalculation instruction receiving module, configured to receive a recalculation instruction for a target calculation metric, add a target recalculation task matching the recalculation instruction to a recalculation record table, and obtain historical service data associated with the target calculation metric and new service data;
[0012] A calculation module, configured to determine a target recalculation model when the number of recalculation tasks currently being processed is less than a set number threshold based on the recalculation record table, and process the historical service data and the new service data based on the target recalculation model to obtain a target recalculation result matching the target calculation metric;
[0013] An update module, configured to update a previous calculation result stored in a target database and matching the target calculation metric based on the target recalculation result.
[0014] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the recalculation method of service data according to any embodiment of the present invention.
[0018] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the recalculation method of service data according to any embodiment of the present invention when executed.
[0019] According to another aspect of the present invention, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the recalculation method of service data according to any embodiment of the present invention.
[0020] The technical solution of the embodiment of the present invention is as follows: by receiving a recalculation instruction for a target calculation index, adding a target recalculation task matching the recalculation instruction to a recalculation record table, and obtaining historical business data associated with the target calculation index and new business data; when it is determined based on the recalculation record table that the number of recalculation tasks currently being processed is less than a set number threshold, determining a target recalculation model, and processing the historical business data and the new business data based on the target recalculation model to obtain a target recalculation result matching the target calculation index; updating the previous calculation result stored in the target database and matching the target calculation index based on the target recalculation result, which can perform fast and accurate recalculation processing on relevant business data and improve the user experience.
[0021] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0023] Figure 1 is a flowchart of a method for recalculating business data according to Embodiment 1 of the present invention;
[0024] Figure 2 is a flowchart of a method for recalculating business data according to Embodiment 2 of the present invention;
[0025] Figure 3 is a flowchart of a method for recalculating business data according to Embodiment 3 of the present invention;
[0026] Figure 4 is a flowchart of another method for recalculating business data according to Embodiment 3 of the present invention;
[0027] Figure 5 is a schematic diagram of a processing flow for profit recalculation according to Embodiment 3 of the present invention;
[0028] Figure 6 is a schematic diagram of data interaction during the task creation stage according to Embodiment 3 of the present invention;
[0029] Figure 7 is a schematic diagram of the execution stage of a recalculation task according to Embodiment 3 of the present invention;
[0030] Figure 8 It is a schematic diagram of the state transition of a recalculation task provided in Embodiment 3 of the present invention;
[0031] Figure 9 It is a schematic structural diagram of a recalculation device for service data provided in Embodiment 4 of the present invention;
[0032] Figure 10 It is a schematic structural diagram of an electronic device for implementing the service data recalculation method of the embodiments of the present invention. Detailed implementation manners
[0033] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0035] Embodiment 1
[0036] Figure 1 It is a flowchart of a service data recalculation method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of recalculating relevant service data. This method can be executed by a service data recalculation device, which can be implemented in the form of hardware and / or software, and the service data recalculation device can be configured in an electronic device such as a computer, a server, or a tablet computer. As Figure 1 shown, the method includes:
[0037] Step 110: Receive a recalculation instruction for the target calculation indicator, add a target recalculation task matching the recalculation instruction to a recalculation record table, and obtain historical business data associated with the target calculation indicator and newly added business data.
[0038] The target calculation indicator may be freight calculation, profit calculation, cost analysis, or advertising fee statistics, which is not limited in this embodiment.
[0039] In this embodiment, the recalculation instruction of the target calculation indicator can be triggered by the target user (for example, a merchant in the ERP system) or by the calculation logic change instruction of the target calculation indicator; illustratively, the target merchant can click the recalculation button of the target calculation indicator on the corresponding page of the system, and will receive the recalculation instruction for the target calculation indicator at this time; when the calculation rules of the target calculation indicators configured by the system (for example, the calculation rules of freight) change, the recalculation instruction of the target calculation indicator (freight calculation) can be automatically triggered.
[0040] Optionally, in this embodiment, after receiving the recalculation instruction of the target calculation indicator, a target recalculation task matching the recalculation instruction can be further determined, and the target recalculation task can be added to the recalculation record table; illustratively, identification information of the target recalculation task or other information that can uniquely identify the target recalculation task can be added to the recalculation record table.
[0041] The recalculation record table may record identification information of each recalculation task that is being recalculated, and may also record identification information of each recalculation task that has completed recalculation, which is not limited in this embodiment.
[0042] It can be understood that the target recalculation task is the recalculation task corresponding to the target calculation indicator; for example, if the target calculation indicator is the freight calculation instruction proposed by the target merchant, then the target recalculation task is the freight recalculation task for the target merchant, that is, the freight can be recalculated for the relevant orders of the target merchant.
[0043] Optionally, in this embodiment, after receiving the recalculation instruction of the target calculation indicator, the historical business data associated with the target calculation indicator and the new business data after receiving the target calculation indicator can be obtained immediately, or after the target recalculation task is completed, the historical business data associated with the target calculation indicator and the new business data after receiving the target calculation indicator can be obtained. This is not limited in this embodiment.
[0044] Exemplarily, in the above example, if the target calculation metric is a freight calculation instruction proposed by the target merchant, historical business data (such as logistics data, order data, return data, or exchange data, etc., which are not limited in this embodiment) within the configured time period of the target merchant (which can be configured by the target merchant when issuing the recalculation instruction for the target calculation metric) can be obtained, as well as new business data (such as new logistics data, order data, return data, or exchange data, etc., which are not limited in this embodiment) after receiving the recalculation instruction for the target calculation metric.
[0045] Optionally, in another alternative implementation of this embodiment, a recalculation instruction for the target calculation metric can also be received, the target recalculation task matching the recalculation instruction can be added to the recalculation record table (awaiting scheduling), and business data and configuration data associated with the target calculation metric can be obtained, where the business data is dynamically determined by the recalculation time range and metrics selected by the merchant, and the configuration data refers to the configuration rules for the merchant's definition of the metrics.
[0046] Step 120: In the case where it is determined based on the recalculation record table that the number of recalculation tasks currently being processed is less than the set quantity threshold, determine the target recalculation model, and process the historical business data and the new business data based on the target recalculation model to obtain a target recalculation result matching the target calculation metric.
[0047] Among them, the set quantity threshold can be 2, 3, 5, etc., which are not limited in this embodiment; in this embodiment, the target recalculation model can be a machine learning model, for example, a deep learning model that can perform complex calculations, or it can be a calculation function, for example, a freight calculation function, which is also not limited in this embodiment.
[0048] Optionally, in this embodiment, after adding the target recalculation task to the recalculation record table, the number of recalculation tasks currently being processed can be further determined based on the recalculation record table. Exemplarily, the label information (such as processed, unprocessed, or being processed, etc.) of each recalculation task in the recalculation record table can be queried, and further, the label information can be statistically analyzed to determine the number of recalculation tasks currently being processed.
[0049] Furthermore, if it is determined that the number of recalculation tasks currently being processed is less than the set quantity threshold, then the target recalculation model can be further determined. Exemplarily, a recalculation model matching its calculation target can be retrieved from the model library based on the identification information of the target recalculation task.
[0050] Further, the obtained historical business data and newly added business data can be processed by the determined target recalculation model to obtain a target recalculation result that matches the target calculation indicator, that is, the calculation result of the target recalculation task. In this embodiment, the historical business data and the newly added business data can be directly input into the target recalculation model to obtain the recalculation result.
[0051] Optionally, in another alternative implementation of this embodiment, after obtaining the business data and configuration data associated with the target calculation indicator, there is no need to judge the data volume of the business data and the configuration data (the calculation engine can automatically batch for large data volume calculations). The target recalculation model can be directly determined based on the task type recorded in the recalculation record table. Further, the business data and configuration rules can be calculated based on the target recalculation model to obtain a target recalculation result that matches the target calculation indicator.
[0052] The advantage of such a setting is that there is no need to judge the data volume, and the recalculation result that matches the target calculation indicator can be quickly determined, improving the user experience.
[0053] Step 130: Update the previous calculation result stored in the target database and matching the target calculation indicator based on the target recalculation result.
[0054] Among them, the previous calculation result that matches the target calculation indicator is the calculation result of the target calculation indicator obtained before receiving the recalculation instruction of the target calculation indicator. Exemplarily, if the target calculation indicator is freight calculation, then the previous calculation result is the freight calculation result before recalculating the freight of the target merchant, and the results of the two are usually different.
[0055] Optionally, in this embodiment, after obtaining the target recalculation result, the calculation result of the target calculation indicator stored in the database can be further replaced with the target recalculation result, and the target recalculation result can be fed back to the target user or the target merchant.
[0056] In the technical solution of this embodiment, by receiving a recalculation instruction for a target calculation metric, adding a target recalculation task matching the recalculation instruction to a recalculation record table, and obtaining historical business data associated with the target calculation metric and new business data; when it is determined based on the recalculation record table that the number of recalculation tasks being processed currently is less than a set number threshold, determining a target recalculation model, and processing the historical business data and the new business data based on the target recalculation model to obtain a target recalculation result matching the target calculation metric; updating the previous calculation result stored in a target database and matching the target calculation metric based on the target recalculation result, it is possible to perform a fast and accurate recalculation process on relevant business data and improve the user experience.
[0057] Embodiment 2
[0058] Figure 2 It is a flowchart of a method for recalculating business data according to Embodiment 2 of the present invention. This embodiment further refines the above technical solution, and the technical solution in this embodiment can be combined with each optional solution in one or more of the above embodiments. As Figure 2 shown, the method includes:
[0059] Step 210, receive a recalculation instruction for a target calculation metric, add a target recalculation task matching the recalculation instruction to a recalculation record table, and obtain historical business data associated with the target calculation metric and new business data.
[0060] Among them, the recalculation instruction is triggered by a target user, or the recalculation instruction is triggered by a calculation logic change instruction for the target calculation metric.
[0061] Optionally, in this embodiment, receiving a recalculation instruction for a target calculation metric and adding a target recalculation task matching the recalculation instruction to a recalculation record table may include: receiving a recalculation instruction for a target calculation metric issued by a target user, obtaining the user information of the target user and the identification information of the target calculation metric, and adding the user information and the identification information to the recalculation record table; or, in response to a calculation logic change instruction for the target calculation metric, obtaining the identification information of the target calculation metric and the reference user information of each reference user associated with the target calculation metric, and adding the identification information and each reference user information to the recalculation record table.
[0062] In an alternative implementation of this embodiment, after receiving a recalculation instruction for a target calculation metric issued by a target user (e.g., any merchant in an ERP system), the user information of the target user and the identification information of the target calculation metric can be further obtained. Further, the user information of the target user and the identification information of the target calculation metric can be added to a recalculation record table.
[0063] Among them, the user information of the target user may include the identity identification information of the target user, e.g., the registration information, username, or ID of the target user, etc.; it may also include the configuration information of the recalculation task of the target user for the target calculation metric, e.g., start time, end time, commission configuration, or fee configuration, etc., which is not limited in this embodiment; the identification information of the target calculation metric may be the identification information identifying the target calculation metric, e.g., a unique string or ID, etc., which is also not limited in this embodiment.
[0064] In another alternative implementation of this embodiment, after the calculation logic of the target calculation metric is changed, a recalculation instruction for the target calculation metric can be automatically triggered. Further, the identification information of the target calculation metric and the reference user information of each reference user associated with the target calculation metric can be obtained, and the identification information and each reference user information can be added to a recalculation record table.
[0065] Exemplarily, if the calculation logic of freight calculation is changed, a freight recalculation instruction can be automatically triggered, and the identification information of the freight calculation metric and the user information of all users who need to perform freight calculation (which may also include the identity identification information or configuration information of each user) can be further obtained. In this embodiment, it is referred to as the reference user information of the reference users; further, the identification information of the target calculation metric and the reference user information of each reference user can be added to the corresponding recalculation record table.
[0066] Further, obtaining the historical business data and the new business data associated with the target calculation metric may include: screening each historical business data and new business data based on the user information of the target user or the reference user information of each reference user to obtain the historical business data and new business data associated with the target calculation metric; among them, the user information of the target user includes the identification information and configuration information of the target user; the reference user information of each reference user includes the identification information and configuration execution of the reference user.
[0067] In an alternative implementation of this embodiment, if the recalculation instruction for the target calculation is issued by the target user, then the historical business data and the newly added business data can be filtered based on the user information (identity identification information or configuration information) of the target user. For example, the historical business data and the newly added business data can be filtered based on the start time and the end time in the configuration information, that is, the business data outside the "start time - end time" range is filtered out; at the same time, the filtered business data can be further filtered based on the identity identification information of the target user, that is, the business data unrelated to the target user is filtered out.
[0068] In an alternative implementation of this embodiment, if the recalculation instruction for the target calculation is automatically triggered by the calculation logic change instruction of the target calculation index, then the historical business data and the newly added business data can be filtered based on the reference user information of each reference user to obtain the historical business data and the newly added business data associated with the target calculation index. The specific filtering method can be the same as the process of filtering the historical business data and the newly added business data based on the user information of the target user, and this embodiment will not elaborate on it here.
[0069] Optionally, in this embodiment, the historical business data and the newly added business data can also be filtered based on the identification information of the target calculation index, that is, the identification information of the target recalculation task. For example, the business data unrelated to the identification information of the target recalculation task can be filtered out, and only the business data related to the identification information of the target recalculation task is retained.
[0070] The solution of this embodiment can trigger the recalculation process in different ways, which can prevent omission of recalculation tasks; at the same time, it can quickly filter the historical business data and the newly added business data, providing a basis for ensuring the accuracy of the recalculation result.
[0071] Step 220: Determine the number of recalculation tasks currently being processed based on the recalculation record table.
[0072] Optionally, in this embodiment, after adding the target recalculation task to the recalculation record table, the number of recalculation tasks currently being processed can be further determined based on the recalculation record table; in this embodiment, the attribute information of the recalculation record table can be obtained, and the number of recalculation tasks currently being processed can be obtained from the attribute information of the recalculation record table.
[0073] In this way, the number of recalculation tasks currently being processed by the system can be quickly determined, providing a basis for ensuring the overall calculation efficiency of the system.
[0074] Step 230: When it is determined that the number of recalculation tasks being currently processed is less than the set quantity threshold based on the recalculation record table, determine the target recalculation model, and process the historical business data and the newly added business data based on the target recalculation model to obtain a target recalculation result that matches the target calculation indicator.
[0075] Optionally, in this embodiment, determining the target recalculation model and processing the historical business data and the newly added business data based on the target recalculation model to obtain a target recalculation result that matches the target calculation indicator may include: determining the target recalculation model based on the identification information of the target calculation indicator; inputting the historical business data and the newly added business data into the target recalculation model for calculation to obtain the target recalculation result, and adding the processing status of the target recalculation model to the recalculation record status table; the processing status includes: running, running successfully, or running failed.
[0076] In an alternative implementation manner of this embodiment, if it is determined based on the above steps that the number of recalculation tasks being currently processed is less than the set quantity threshold, then further determine the target recalculation model based on the identification information of the target calculation indicator, or the target recalculation model may also be determined based on the identification information of the target recalculation task; for example, if the identification information of the target calculation indicator or the identification information of the target recalculation task indicates that the task is a freight recalculation task, then the freight calculation model may be determined as the target recalculation model; if the identification information of the target calculation indicator or the identification information of the target recalculation task indicates that the task is a profit recalculation task, then the freight calculation model determined as the target recalculation model is the profit calculation model.
[0077] Furthermore, the above-screened historical business data and newly added business data can be input into the target recalculation model for calculation to obtain the target recalculation result. Furthermore, the processing status of the target recalculation model can be added to the recalculation record table; among them, the processing status of the target recalculation model may include running, running successfully, or running failed.
[0078] The advantage of such a setting is that the running status of the target recalculation model can be quickly determined, providing a basis for the subsequent repair of business data.
[0079] In another alternative implementation manner of this embodiment, during the process of inputting the above-screened historical business data and newly added business data into the target recalculation model for calculation, each business data can be used as an independent variable to obtain the final calculation result through iterative calculation.
[0080] Step 240: When the processing status of the target recalculation model is a failure, obtain the processing log data of the target recalculation model, and determine the error log data in the processing log; analyze the error log data, and determine the abnormal business data according to the analysis result; repair the abnormal business data, and reprocess the business data after repair based on the target recalculation model until the processing status of the target recalculation model is a success.
[0081] Optionally, in this embodiment, if the processing status of the target recalculation model for the obtained historical business data and newly added business data is a failure, then the processing log data of the target recalculation model can be further obtained, and the error log data reporting errors in the processing log data can be determined; further, the error log data can be analyzed to obtain an abnormal analysis result, and further, the abnormal business data can be determined based on the analysis result.
[0082] Further, the abnormal business data can be repaired. For example, the abnormal business data can be repaired by means of extraction, conversion, or loading, etc.; further, the processed business data (including historical business data and newly added business data) after repair can be reprocessed based on the target recalculation model until the processing status of the target recalculation model recorded in the recalculation record table is a success.
[0083] The solution of this embodiment, when the processing status of the target recalculation model is a failure, obtains the processing log data of the target recalculation model, and determines the error log data in the processing log; analyzes the error log data, and determines the abnormal business data according to the analysis result; repairs the abnormal business data, and reprocesses the business data after repair based on the target recalculation model until the processing status of the target recalculation model is a success, can ensure that the target recalculation model processes each business data completely, and provides a basis for obtaining an accurate recalculation result.
[0084] Embodiment III
[0085] Figure 3 is a flowchart of a method for recalculating business data according to Embodiment III of the present invention. This embodiment further refines the above technical solution, and the technical solution in this embodiment can be combined with each optional solution in one or more of the above embodiments. As Figure 3 shown, the method includes:
[0086] Step 310: Receive a recalculation instruction for a target calculation index, add a target recalculation task matching the recalculation instruction to a recalculation record table, and obtain historical business data and newly added business data associated with the target calculation index.
[0087] Step 320: Determine the number of recalculation tasks being currently processed based on the recalculation record table.
[0088] Step 330: When the number of recalculation tasks being currently processed determined based on the recalculation record table is greater than or equal to a set quantity threshold, add the target recalculation task to the target waiting queue; when there are no other recalculation tasks in the target waiting queue except the target recalculation task, continue to perform the operation of determining the target recalculation model.
[0089] Optionally, in this embodiment, if the number of recalculation tasks being currently processed determined based on the recalculation record table is greater than or equal to a set quantity threshold, for example, the set quantity threshold is 3 and the number of recalculation tasks being currently processed is 3, then if the target recalculation task is continued to be processed, it will cause too many resources in the target system to be used for recalculation tasks. At this time, the target recalculation task cannot be executed immediately and needs to be added to the target waiting queue, where the target waiting queue can be a first-in-first-out queue.
[0090] Furthermore, if it is determined that all the recalculation tasks that entered the queue earlier than the target recalculation task in the target waiting queue have dequeued, that is, when the priority of the target recalculation task is the highest in the target waiting queue, the operation of determining the target recalculation model can be continued, and the historical business data and newly added business data related to the target recalculation task can be processed based on the target recalculation model.
[0091] The advantage of such a setting is that once other recalculation tasks are completed, it can be monitored and the corresponding recalculation tasks can be executed, which not only ensures the computing efficiency of the system but also ensures the recalculation efficiency of the recalculation tasks, providing a basis for improving the user experience.
[0092] Exemplarily, Figure 4 is a flowchart of another method for recalculating business data according to Embodiment 3 of the present invention. As Figure 4 shown, it mainly includes the following processes: a merchant initiates recalculation, recalculation task monitoring, concurrent control, recalculation task execution, status update and communication, and system resource monitoring.
[0093] On the basis of the above technical solution, after obtaining the historical business data associated with the target calculation metric and the new business data, it may further include: determining the first resource information required for the target recalculation task based on the historical business data and the new business data; determining the second resource information currently available in the business system; when the first resource information is less than the second resource information, determining the target recalculation model and processing the historical business data and the new business data based on the target recalculation model to obtain a target recalculation result that matches the target calculation metric; when the first resource information is greater than or equal to the second resource information, performing a wait until it is determined that the first resource information is less than the second resource information.
[0094] Optionally, in this embodiment, after filtering out the historical business data and the new business data related to the target recalculation task, the first resource information required for executing the target recalculation task may be further determined based on the historical business data and the new business data. For example, the first resource information may be determined based on the data volume of the historical business data and the new business data. Further, the second resource information currently available in the business system may be determined. Exemplarily, the resource information required for the tasks currently being executed in the business system may be obtained, and the second resource information may be obtained by subtracting the required resource information from the total resource information of the business system; alternatively, the current parameter information of the business system may be directly obtained, and the second resource information may be directly determined based on the current parameter information.
[0095] Further, when the first resource information is less than the second resource information, it means that the business system can process the target recalculation task. At this time, the operation of determining the target recalculation model and processing the historical business data and the new business data based on the target recalculation model to obtain a target recalculation result that matches the target calculation metric may be performed.
[0096] In another alternative implementation of this embodiment, if it is determined that the first resource information is greater than or equal to the second resource information, the target recalculation task may not be immediately executed to avoid excessive use of the computing resources of the business system until it is determined that the first resource information is less than the second resource information.
[0097] For the solution of this embodiment, after obtaining the historical business data associated with the target calculation metric and the new business data, it may further include: determining the first resource information required for the target recalculation task based on the historical business data and the new business data; determining the second resource information currently available in the business system; when the first resource information is less than the second resource information, determining the target recalculation model and processing the historical business data and the new business data based on the target recalculation model to obtain a target recalculation result that matches the target calculation metric; when the first resource information is greater than or equal to the second resource information, performing a wait until it is determined that the first resource information is less than the second resource information, and recalculating the target recalculation task when the computing resources of the business system are sufficient, which can ensure that the mainstream tasks of the business system are not affected, and immediately process the target recalculation task when the conditions are met, ensuring the processing timeliness of the target recalculation task.
[0098] To better understand the recalculation method of business data involved in the embodiments of the present invention, Figure 5 FIG. is a schematic diagram of a processing flow for profit recalculation provided in Embodiment III of the present invention, which mainly includes an access layer, a control layer, a calculation layer, a monitoring layer, and a data layer.
[0099] Figure 6 FIG. is a schematic diagram of data interaction during the task creation stage provided in Embodiment III of the present invention; Figure 7 FIG. is a schematic diagram of the execution stage of a recalculation task provided in Embodiment III of the present invention; Figure 8 FIG. is a schematic diagram of the state transition of a recalculation task provided in Embodiment III of the present invention.
[0100] From Figures 7 - 8 it can be seen that during the processing of the recalculation task, storage anomalies, calculation anomalies, and data anomalies can be determined in real time and these anomalies can be repaired.
[0101] The embodiments of the present invention adopt the producer-consumer mode to decouple task submission and execution; adopt a distributed computing architecture; at the same time, the calculation results can be submitted in batches (processing orders in batches to reduce calculation time); the final state update and transaction submission are atomic operations; it is also possible to record checkpoints at each calculation step to support resuming calculations from the most recent valid checkpoint; the computing thread pool limits the maximum resource consumption; the computing process monitors the time consumption and resource consumption of each link, and at the same time, merchants can perceive the recalculation progress in real time.
[0102] Embodiment IV
[0103] Figure 9 FIG. is a schematic structural diagram of a recalculation device for business data provided in Embodiment IV of the present invention. As Figure 9As shown in the figure, the device includes: a recalculation instruction receiving module 910, a calculation module 920, and an update module 930.
[0104] Among them, the recalculation instruction receiving module 910 is configured to receive a recalculation instruction for a target calculation metric, add a target recalculation task matching the recalculation instruction to a recalculation record table, and obtain historical service data associated with the target calculation metric, as well as new service data;
[0105] The calculation module 920 is configured to determine a target recalculation model when the number of recalculation tasks currently being processed is less than a set number threshold based on the recalculation record table, and process the historical service data and the new service data based on the target recalculation model to obtain a target recalculation result matching the target calculation metric;
[0106] The update module 930 is configured to update a previous calculation result stored in a target database and matching the target calculation metric based on the target recalculation result.
[0107] In the solution of this embodiment, the recalculation instruction receiving module receives a recalculation instruction for a target calculation metric, adds a target recalculation task matching the recalculation instruction to a recalculation record table, and obtains historical service data associated with the target calculation metric, as well as new service data; when the calculation module determines that the number of recalculation tasks currently being processed is less than a set number threshold based on the recalculation record table, it determines a target recalculation model, and processes the historical service data and the new service data based on the target recalculation model to obtain a target recalculation result matching the target calculation metric; the update module updates a previous calculation result stored in a target database and matching the target calculation metric based on the target recalculation result, so as to perform fast and accurate recalculation processing on relevant service data and improve the user experience.
[0108] In an optional implementation manner of this embodiment, the recalculation instruction is triggered by a target user, or the recalculation instruction is triggered by a calculation logic change instruction for a target calculation metric;
[0109] Correspondingly, the recalculation instruction receiving module 910 is specifically configured to receive a recalculation instruction for a target calculation metric issued by a target user, obtain the user information of the target user and the identification information of the target calculation metric, and add the user information and the identification information to the recalculation record table;
[0110] Or, in response to a calculation logic change instruction for a target calculation metric, obtain the identification information of the target calculation metric, as well as the reference user information of each reference user associated with the target calculation metric, and add the identification information and each reference user information to the recalculation record table.
[0111] In an alternative implementation of this embodiment, the recalculation instruction receiving module 910 is further specifically configured to screen the historical service data and the newly added service data based on the user information of the target user or the reference user information of each reference user, so as to obtain the historical service data associated with the target calculation index and the newly added service data;
[0112] Wherein, the user information of the target user includes the identification information and configuration information of the target user;
[0113] The reference user information of each reference user includes the identification information and configuration execution of the reference user.
[0114] In an alternative implementation of this embodiment, the calculation module 920 is specifically configured to determine a target recalculation model based on the identification information of the target calculation index;
[0115] Input the historical service data and the newly added service data into the target recalculation model for calculation to obtain the target recalculation result, and add the processing status of the target recalculation model to the recalculation record status table;
[0116] The processing status includes: running, running successfully or running failed.
[0117] In an alternative implementation of this embodiment, the device further includes: a repair module, configured to, when the processing status of the target recalculation model is running failed, obtain the processing log data of the target recalculation model and determine the error log data in the processing log;
[0118] Analyze the error log data and determine the abnormal service data according to the analysis result;
[0119] Repair the abnormal service data and reprocess the service data after the target recalculation model is repaired until the processing status of the target recalculation model is running successfully.
[0120] In an alternative implementation of this embodiment, the device further includes: a waiting module, configured to, when it is determined based on the recalculation record table that the number of recalculation tasks being currently processed is greater than or equal to a set number threshold, add the target recalculation task to the target waiting queue;
[0121] When there are no other recalculation tasks in the target waiting queue except the target recalculation task, continue to perform the operation of determining the target recalculation model.
[0122] In an alternative implementation of this embodiment, the device further includes a "computing resource determination module" for
[0123] Determine the first resource information required for the target recalculation task based on the historical service data and the newly added service data;
[0124] Determine the second resource information currently available in the service system;
[0125] When the first resource information is less than the second resource information, determine the target recalculation model, and process the historical service data and the newly added service data based on the target recalculation model to obtain a target recalculation result that matches the target calculation index;
[0126] When the first resource information is greater than or equal to the second resource information, perform waiting until it is determined that the first resource information is less than the second resource information.
[0127] The recalculation device for service data provided by the embodiments of the present invention can execute the recalculation method for service data provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
[0128] In the technical solution of the embodiments of the present invention, the collection, storage, use, processing, transmission, provision, and disclosure of the involved service data all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0129] Embodiment 4
[0130] Figure 10 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0131] As Figure 10As shown, the electronic device 10 includes at least one processor 11 and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by the at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0132] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0133] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for recalculating business data, which includes: receiving a recalculation instruction for a target calculation metric, adding a target recalculation task matching the recalculation instruction to a recalculation record table, and obtaining historical business data and new business data associated with the target calculation metric; in the case where it is determined based on the recalculation record table that the number of recalculation tasks currently being processed is less than a set number threshold, determining a target recalculation model, and processing the historical business data and the new business data based on the target recalculation model to obtain a target recalculation result matching the target calculation metric; updating a previous calculation result stored in a target database and matching the target calculation metric based on the target recalculation result.
[0134] In some embodiments, the method for recalculating business data may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for recalculating business data described above may be executed. Alternatively, in other embodiments, the processor 11 may be configured to execute the method for recalculating business data by any other suitable means (e.g., by means of firmware).
[0135] The various embodiments of the systems and techniques described above in this document may be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0136] The computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0137] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0138] To provide for interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic, speech, or tactile input).
[0139] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0140] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is created by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0141] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0142] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
[0143] The embodiment of the present invention also provides a computer program product, including a computer program, which when executed by a processor, implements the method for detecting a database provided in any embodiment of the present application.
[0144] In the process of implementing the computer program product, computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0145] It should be noted that in the embodiments of the present application, some industry-existing solutions such as certain software, components, models, etc. may be mentioned. They should be considered exemplary. The purpose is only to illustrate the feasibility in the implementation of the technical solution of the present application, but it does not mean that the applicant has already or necessarily used this solution.
[0146] Note that the above are only the preferred embodiments of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments here, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments only. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for recalculating service data, characterized in that Including: Receiving a recalculation instruction for a target calculation metric, adding a target recalculation task matching the recalculation instruction to a recalculation record table, and obtaining historical business data associated with the target calculation metric and new business data; When it is determined based on the recalculation record table that the number of recalculation tasks being processed currently is less than a set quantity threshold, determining a target recalculation model, and processing the historical business data and the new business data based on the target recalculation model to obtain a target recalculation result matching the target calculation metric; Updating a previous calculation result stored in a target database and matching the target calculation metric based on the target recalculation result.
2. The recalculation method of service data according to claim 1, wherein The recalculation instruction is triggered by a target user, or the recalculation instruction is triggered by a calculation logic change instruction for the target calculation metric; Correspondingly, the step of receiving a recalculation instruction for a target calculation metric and adding a target recalculation task matching the recalculation instruction to a recalculation record table includes: Receiving a recalculation instruction for a target calculation metric issued by a target user, obtaining the user information of the target user and the identification information of the target calculation metric, and adding the user information and the identification information to the recalculation record table; Or, In response to a calculation logic change instruction for a target calculation metric, obtaining the identification information of the target calculation metric and the reference user information of each reference user associated with the target calculation metric, and adding the identification information and each reference user information to the recalculation record table.
3. The recalculation method of service data according to claim 2, characterized in that Obtaining historical business data associated with the target calculation metric and new business data includes: Filtering each piece of historical business data and new business data based on the user information of the target user or the reference user information of each reference user to obtain historical business data associated with the target calculation metric and new business data; Wherein, the user information of the target user includes the identification information and configuration information of the target user; The reference user information of each reference user includes the identification information and configuration execution of the reference user.
4. The recalculation method of service data according to claim 1, characterized in that The step of determining a target recalculation model and processing the historical business data and the new business data based on the target recalculation model to obtain a target recalculation result matching the target calculation metric includes: Determining a target recalculation model based on the identification information of the target calculation metric; Inputting the historical business data and the new business data into the target recalculation model for calculation to obtain the target recalculation result, and adding the processing status of the target recalculation model to a recalculation record status table; The processing status includes: running, running successfully, or running failed.
5. The recalculation method of service data according to claim 4, wherein The method further includes: When the processing status of the target recalculation model is running failed, obtaining the processing log data of the target recalculation model and determining the error log data in the processing log; Analyzing the error log data and determining abnormal business data according to the analysis result. Repair the abnormal service data, and reprocess the service data after repair based on the target recalculation model until the processing status of the target recalculation model is successfully running.
6. The recalculation method of service data according to claim 1, wherein The method further includes: When it is determined based on the recalculation record table that the number of recalculation tasks currently being processed is greater than or equal to the set number threshold, add the target recalculation task to the target waiting queue; When there are no other recalculation tasks in the target waiting queue except the target recalculation task, continue to perform the operation of determining the target recalculation model.
7. The recalculation method of service data according to claim 1, characterized in that After obtaining the historical service data associated with the target calculation metric and the new service data, it further includes: Determine the first resource information required for the target recalculation task based on the historical service data and the new service data; Determine the second resource information currently available in the business system; When the first resource information is less than the second resource information, determine the target recalculation model, and process the historical service data and the new service data based on the target recalculation model to obtain a target recalculation result that matches the target calculation metric; When the first resource information is greater than or equal to the second resource information, perform a wait until it is determined that the first resource information is less than the second resource information.
8. A recalculation device for service data, characterized in that, It includes: A recalculation instruction receiving module, configured to receive a recalculation instruction for a target calculation metric, add a target recalculation task that matches the recalculation instruction to the recalculation record table, and obtain historical service data associated with the target calculation metric and new service data; A calculation module, configured to determine a target recalculation model when it is determined based on the recalculation record table that the number of recalculation tasks currently being processed is less than the set number threshold, and process the historical service data and the new service data based on the target recalculation model to obtain a target recalculation result that matches the target calculation metric; An update module, configured to update the previous calculation result stored in the target database that matches the target calculation metric based on the target recalculation result.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor can execute the recalculation method of the service data according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to implement the recalculation method of the service data according to any one of claims 1-7 when executed.
Citation Information
Patent Citations
Data refreshing method, device and system
CN110928884A
Batch data processing method and device, electronic equipment and computer program product
CN119379414A