Processing method and device for identifying charging abnormal state
By configuring event list and billing exception status check interface for the computing nodes of the scientific computing platform, and identifying and correcting billing exceptions, the cost abnormality caused by the computing nodes being suspended or ended is solved, and the user experience and platform stickiness is improved.
Patent Information
- Application Number
- CN202411887322.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-20
AI Technical Summary
In scientific computing platforms, due to factors such as the complexity of the platform's asynchronous architecture and abnormal program operation, billing abnormalities may occur, that is, the computing nodes continue to time when they are suspended or ended, resulting in continuous increase in fees and causing additional economic losses to users.
Configure a list of node events for each compute node and record the corresponding events when the node performs a start, pause, resume, or end operations. Through the billing exception status check interface and identification and processing mechanism, confirm whether the billing exception occurs in the node and task, and generate an exception report to correct the cost.
It effectively eliminates the economic losses of billing abnormalities to users, improves the user experience of the platform, and enhances the user stickiness of the platform.
Smart Images

Figure CN119766582A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a processing method and device for identifying abnormal billing status. Background Art
[0002] There are usually two types of billing objects on scientific computing platforms: computing tasks and computing nodes, where computing tasks consist of one or more computing nodes. The node real-time fee of each computing node = node timing unit price × running time. The task real-time fee of each computing task is the sum of the node real-time fees of all corresponding computing nodes. In actual applications, we found that in the billing process of the scientific computing platform, due to the complexity of the platform's asynchronous architecture and program operation abnormalities, a billing anomaly may occur, that is, when a computing node has been suspended or the computing process has ended, its running time is still continuously counted, resulting in the continuous growth of the node real-time fee of the current node and the task real-time fee of the upper computing task. This billing anomaly will cause additional economic losses to platform users and reduce the user experience of the platform.
[0003] To solve this problem, we propose a platform improvement plan: 1) configure an additional node event list for each computing node, and add a node event record with event types of start / pause / resume / end to the table in real time when each computing node is started / pause / resume / end computing operation; 2) add an additional billing abnormal state check interface, and configure a corresponding billing abnormal state identification and processing mechanism for the interface. The processing process of this billing abnormal state identification and processing mechanism is roughly as follows: first, estimate the actual running time of each computing node under a specified user based on the node event list and calculate another node estimated cost, and confirm whether each computing node has billing abnormality based on the comparison of the node estimated cost and the real-time cost, and thus obtain a corresponding abnormal node report; then obtain the task estimated cost of each computing task under the current specified user by accumulating the node estimated cost, and confirm whether each computing task has billing abnormality based on the comparison of the task estimated cost and the real-time cost, and thus obtain a corresponding abnormal task report; finally, the abnormal node report and the abnormal task report form the final identification report and return it. After adding the above platform improvement function to the scientific computing platform, the user account management component of the platform can obtain the abnormal billing status and corresponding normal billing fees of each computing task / computing node under each user by calling the above billing abnormality status check interface during or after the computing task execution of each user, thereby actively correcting the abnormal task / node fees, thereby achieving the purpose of eliminating additional economic losses of users and improving user experience. The specific technical solution of this platform improvement solution is the technical problem that the present invention needs to solve. Summary of the invention
[0004] The purpose of the present invention is to provide a processing method, device, electronic device and computer-readable storage medium for identifying abnormal billing status in response to the defects of the prior art. When creating a new computing task for any user, the present invention assigns a corresponding task identifier and task billing account to the current computing task, and binds the current user to the current computing task; creates one or more corresponding computing nodes for the current computing task based on the computing node setting of the current user, binds each newly created computing node to the current computing task, and assigns a corresponding node identifier, node timer, node billing account, node timing unit price and node event list to each computing node; and when each computing node is started, paused, resumed or ended, the timing operation of the node timer is started, paused, resumed or ended accordingly, and a node event record with the event type of corresponding start, pause, resume or end and the event time being the current time is added to the corresponding node event list; and in the computing from start to end of each computing node, the node event record is recorded. During the process, the node billing account is updated once based on the timing duration of the node timer × the node timing unit price at regular intervals, and the node billing account is updated once based on the timing duration of the node timer × the node timing unit price when each computing node ends the calculation; and when a fee update occurs in any node billing account corresponding to each computing task, the account fees of all node billing accounts corresponding to the current computing task are calculated in total, and the fee update is performed on the task billing account corresponding to the current computing task based on the total calculation result; and the interface request is received on the billing abnormality status check interface, and the designated user of the first check request received each time is taken as the first user, and the billing abnormality status of all computing tasks and all computing nodes that have a binding relationship with the first user is identified to obtain the corresponding first identification report and sent back to the first request address specified by the current request. The present invention can eliminate the additional economic losses caused to users by billing abnormalities, improve the platform usage experience of users, and enhance the user stickiness of the platform.
[0005] To achieve the above object, a first aspect of an embodiment of the present invention provides a method for identifying an abnormal billing state, the method comprising:
[0006] When a new computing task is created for any user, a corresponding task identifier and task billing account are assigned to the current computing task; and a binding relationship is established between the current user and the current computing task; and based on the computing node settings of the current user, one or more corresponding computing nodes are created for the current computing task; and a binding relationship is established between each newly created computing node and the current computing task; and a corresponding node identifier, node timer, node billing account, node timing unit price and node event list are assigned to each computing node; and the task billing account, each node timer and each node billing account are reset to zero; the node event list is an empty table when it is created, and when the node event list is not empty, it is composed of one or more node event records; the node event record includes event type and event time; the event type includes start, pause, resume and end;
[0007] When the computing operation is started, paused, resumed or ended on each computing node, the timing operation of the node timer is started, paused, resumed or ended accordingly; and a node event record is added to the corresponding node event list, with the event type being the corresponding start, pause, resume or end and the event time being the current time;
[0008] During the calculation process of each computing node from start to end, the node billing account is updated once based on the product of the corresponding node timer and the node timing unit price every first preset time period; and when each computing node ends the calculation, the node billing account is updated once based on the product of the corresponding node timer and the node timing unit price;
[0009] When a fee update occurs to any of the node billing accounts corresponding to each of the computing tasks, a sum calculation is performed on the account fees of all the node billing accounts corresponding to the current computing task, and a fee update is performed on the task billing account corresponding to the current computing task based on the sum calculation result;
[0010] An interface request is received on a preset billing abnormality status check interface, and each time a first check request is received, the first check request received at that time is used as the corresponding current request; and the corresponding user of the first user identifier of the current request is used as the first user; and the billing abnormality status of all computing tasks and all computing nodes that have a binding relationship with the first user is identified to obtain a corresponding first identification report; and the first identification report is sent back to the first request address of the current request; the first check request at least includes the first request address and the first user identifier.
[0011] Preferably, the identifying the abnormal billing status of all computing tasks and all computing nodes that are bound to the first user to obtain a corresponding first identification report specifically includes:
[0012] Step 21, grouping all the computing tasks that have a binding relationship with the first user into a corresponding computing task set; and grouping all the computing nodes corresponding to the computing task set into a corresponding computing node set;
[0013] Step 22, identifying whether the computing node set is empty; if so, setting the corresponding abnormal node report to be empty, and going to step 24; if not, going to step 23;
[0014] Step 23, perform a round of traversal on all the computing nodes in the computing node set; and in this round of traversal, use the computing node currently traversed as the corresponding current node; and estimate the node cost according to the node timing unit price corresponding to the current node and the node event list to obtain the corresponding first estimated cost; and use the account cost of the node billing account corresponding to the current node as the corresponding first billing cost; and calculate the corresponding first difference ratio = |first estimated cost-first billing cost| / first estimated cost according to the first estimated cost and the first billing cost; and when the first difference ratio exceeds the preset first difference ratio threshold, the current node The node identifier of the current node is used as the corresponding abnormal node identifier, and the task identifier of the computing task corresponding to the current node is used as the corresponding belonging task identifier, and the first billing fee and the first estimated fee are used as the corresponding abnormal node fee and normal node fee, and the abnormal node identifier, the belonging task identifier, the abnormal node fee and the normal node fee obtained this time form a corresponding abnormal node record; and at the end of this round of traversal, it is identified whether the total number of the abnormal node records obtained is zero, if so, the corresponding abnormal node report is set to be empty, otherwise, all the abnormal node records obtained form the corresponding abnormal node report;
[0015] Wherein, when the abnormal node report is not empty, it is composed of one or more abnormal node records; the abnormal node record includes the abnormal node identifier, the task identifier, the abnormal node fee and the normal node fee;
[0016] Step 24, identifying whether the computing task set is empty; if so, setting the corresponding abnormal task report to empty, and going to step 26; if not, going to step 25;
[0017] Step 25, perform a round of traversal on all the computing tasks in the computing task set; and in this round of traversal, take the computing task currently traversed as the corresponding current task; and calculate the sum of the first estimated costs of all the computing nodes of the current task and use the calculation result as the corresponding second estimated cost; and use the account cost of the task billing account corresponding to the current task as the corresponding second billing cost; and calculate the corresponding second difference ratio = |second estimated cost-second billing cost| / second estimated cost according to the second estimated cost and the second billing cost; and when the second difference ratio exceeds the preset second difference ratio threshold, use the task identifier of the current task as the corresponding abnormal task identifier, and use the second billing cost and the second estimated cost as the corresponding abnormal task cost and normal task cost, and use the abnormal task identifier, the abnormal task cost and the normal task cost obtained this time to form a corresponding abnormal task record; and at the end of this round of traversal, identify whether the total number of the abnormal task records obtained is zero, if so, set the corresponding abnormal task report to be empty, otherwise, all the abnormal task records obtained form the corresponding abnormal task report;
[0018] Wherein, when the abnormal task report is not empty, it is composed of one or more abnormal task records; the abnormal task record includes the abnormal task identifier, the abnormal task fee and the normal task fee;
[0019] Step 26: The abnormal node report and the abnormal task report obtained form the corresponding first identification report.
[0020] Further, the node cost estimation is performed according to the node timing unit price corresponding to the current node and the node event list to obtain the corresponding first estimated cost, specifically including:
[0021] Step 31, taking the event time of the node event record with the event type of start in the node event list as the corresponding start time; and identifying whether the node event record with the event type of end in the node event list exists; if it exists, taking the event time of the node event record with the event type of end as the corresponding end time; if it does not exist, taking the current time as the corresponding end time;
[0022] Step 32, identifying whether the total number of the node event records of the event type of pause in the node event list is zero; if so, setting the corresponding total pause duration to 0, and going to step 34; if not, going to step 33;
[0023] Step 33, perform a round of traversal of all the node event records in the node event list whose event type is pause; and in this round of traversal, take the node event record currently traversed as the corresponding current pause record; and record the node event record in the node event list whose event type is resume as the corresponding resume record; and count the total number of records of the resume records whose event time is after the event time of the current pause record to obtain the corresponding total number of statistical records; and identify the total number of statistical records; if the total number of statistical records is greater than zero, then take the resume record whose event time is after the event time of the current pause record and closest to the event time of the current pause record as the corresponding next-step resume record, and take the time difference between the two event times of the current pause record and the next-step resume record as the corresponding first pause duration; if the total number of statistical records is equal to zero, then take the time difference between the end time and the event time of the current pause record as the corresponding first pause duration; and at the end of this round of traversal, calculate the sum of all the first pause durations obtained and use the calculated result as the corresponding total pause duration;
[0024] Step 34, taking the time difference between the start time and the end time as the corresponding first total duration; and taking the difference between the first total duration and the pause total duration as the corresponding first running duration; and taking the product of the node timing unit price and the first running duration as the corresponding first estimated fee.
[0025] A second aspect of an embodiment of the present invention provides a device for implementing the processing method for identifying a billing abnormality state described in the first aspect, the device comprising: a computing task and node creation module, a timer and event record processing module, a node cost update module, a task cost update module and a billing abnormality state checking module;
[0026] The computing task and node creation module is used to assign a corresponding task identifier and task billing account to the current computing task when creating a new computing task for any user; and establish a binding relationship between the current user and the current computing task; and based on the computing node settings of the current user, create one or more corresponding computing nodes for the current computing task; and establish a binding relationship between each newly created computing node and the current computing task; and assign a corresponding node identifier, node timer, node billing account, node timing unit price and node event list to each computing node; and reset the task billing account, each node timer and each node billing account to zero; the node event list is an empty table when created, and when the node event list is not empty, it is composed of one or more node event records; the node event record includes event type and event time; the event type includes start, pause, resume and end;
[0027] The timer and event record processing module is used to start, pause, resume or end the timing operation of the node timer correspondingly when the computing operation is started, paused, resumed or ended on each computing node; and add a node event record whose event type is the corresponding start, pause, resume or end and whose event time is the current time to the corresponding node event list;
[0028] The node fee update module is used to update the node billing account once based on the product of the corresponding node timer and the node timing unit price every first preset time period during the calculation process of each computing node from start to end; and to update the node billing account once based on the product of the corresponding node timer and the node timing unit price when each computing node ends calculation;
[0029] The task fee update module is used to perform a sum calculation of the account fees of all the node billing accounts corresponding to the current computing task and perform a fee update on the task billing account corresponding to the current computing task based on the sum calculation result when a fee update occurs to any of the node billing accounts corresponding to each computing task;
[0030] The billing abnormality status check module is used to receive interface requests on a preset billing abnormality status check interface, and when each first check request is received, the first check request received at that time is used as the corresponding current request; and the corresponding user of the first user identifier of the current request is used as the first user; and the billing abnormality status of all computing tasks and all computing nodes that have a binding relationship with the first user is identified to obtain a corresponding first identification report; and the first identification report is sent back to the first request address of the current request; the first check request at least includes the first request address and the first user identifier.
[0031] A third aspect of an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a transceiver;
[0032] The processor is used to be coupled to the memory, read and execute instructions in the memory, so as to implement the method steps described in the first aspect above;
[0033] The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
[0034] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed by a computer, the computer executes the instructions of the method described in the first aspect above.
[0035] The embodiments of the present invention provide a processing method, device, electronic device and computer-readable storage medium for identifying abnormal billing status. As can be seen from the above content, when creating a new computing task for any user, the embodiments of the present invention assign a corresponding task identifier and task billing account to the current computing task, and bind the current user to the current computing task; and create one or more corresponding computing nodes for the current computing task based on the computing node setting of the current user, and bind each newly created computing node to the current computing task, and assign a corresponding node identifier, node timer, node billing account, node timing unit price and node event list to each computing node; and when each computing node is started, paused, resumed or ended, the timing operation of the node timer is started, paused, resumed or ended accordingly, and a node event record with the event type of corresponding start, pause, resume or end and the event time being the current time is added to the corresponding node event list; and from the start to the end of each computing node, a node event record is created. During the calculation process that has been completed, the node billing account is updated periodically based on the timing duration of the node timer × the node timing unit price, and when each computing node ends the calculation, the node billing account is updated based on the timing duration of the node timer × the node timing unit price; and when a fee update occurs in any node billing account corresponding to each computing task, the account fees of all node billing accounts corresponding to the current computing task are calculated in total, and the fee update is performed on the task billing account corresponding to the current computing task based on the total calculation result; and the interface request is received on the billing abnormality status check interface, and the designated user of the first check request received each time is used as the first user, and the billing abnormality status of all computing tasks and all computing nodes that have a binding relationship with the first user is identified to obtain the corresponding first identification report and sent back to the first request address specified by the current request. The embodiment of the present invention eliminates the additional economic losses caused to users by billing abnormalities, improves the platform usage experience of users, and enhances the user stickiness of the platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of a processing method for identifying abnormal billing status provided in the first embodiment of the present invention;
[0037] Figure 2 A module structure diagram of a processing device for identifying abnormal billing status provided in Embodiment 2 of the present invention;
[0038] Figure 3 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] Embodiment 1 of the present invention provides a method for identifying abnormal billing status. Figure 1 A schematic diagram of a method for identifying abnormal billing status provided in the first embodiment of the present invention is shown. The method mainly includes the following steps:
[0041] Step 1, when creating a new computing task for any user, assign a corresponding task identifier and task billing account to the current computing task; establish a binding relationship between the current user and the current computing task; and based on the computing node settings of the current user, create one or more corresponding computing nodes for the current computing task; and establish a binding relationship between each newly created computing node and the current computing task; and assign a corresponding node identifier, node timer, node billing account, node timing unit price and node event list to each computing node; and reset the task billing account, each node timer and each node billing account to zero.
[0042] Here, the task identifier, task billing account, node identifier, node timer, node billing account and node time unit price are all conventional configurations of conventional scientific computing platforms; the node event list is an additional configuration of the embodiment of the present invention. It should be noted that the node event list of the embodiment of the present invention is an empty table when it is created; when the node event list is not empty, it should be composed of one or more node event records; each node event record includes at least two data items: event type and event time; wherein the event type includes start, pause, resume and end.
[0043] Step 2, when each computing node is started, paused, resumed or ended, the timing operation of the node timer is started, paused, resumed or ended accordingly; and a node event record with the event type of the corresponding start, pause, resume or end and the event time being the current time is added to the corresponding node event list.
[0044] Step 3: During the calculation process of each computing node from startup to completion, the node billing account is updated once every first preset time period based on the product of the corresponding node timer and the node timing unit price; and when the calculation of each computing node ends, the node billing account is updated once based on the product of the corresponding node timer and the node timing unit price.
[0045] Here, the first preset duration is a pre-set time length parameter; the product of the node timer and the node timing unit price is actually the product of the node timer timing duration and the node timing unit price. It should be noted that when each computing node ends the calculation, the time difference between the current end time point and the last fee update time point may be less than the first preset duration, so the computing costs generated during this period are not included in the node billing account. Therefore, when each computing node ends the calculation, the node billing account must be updated again according to the product of the node timer timing duration and the node timing unit price.
[0046] Step 4: When a fee update occurs in any node billing account corresponding to each computing task, the account fees of all node billing accounts corresponding to the current computing task are summed up and the task billing account corresponding to the current computing task is updated based on the summed up result.
[0047] Here, from the previous text, we can know that the task fee of each computing task is actually the accumulation / sum of the node fees of all the computing nodes under it. Therefore, every time a fee update occurs in any node billing account under each computing task, the task billing account of the current computing task must be updated based on the sum of the fees of all the node billing accounts under the current computing task.
[0048] Step 5: receiving an interface request on a preset abnormal billing status check interface, and taking the first check request received at that time as the corresponding current request each time a first check request is received; taking the corresponding user of the first user identifier of the current request as the first user; identifying the abnormal billing status of all computing tasks and all computing nodes that are bound to the first user to obtain a corresponding first identification report; and sending the first identification report back to the first request address of the current request;
[0049] Specifically, the method comprises: step 51, receiving an interface request on a preset abnormal charging status check interface, and taking the first check request received at that time as the corresponding current request each time a first check request is received;
[0050] The first inspection request at least includes a first request address and a first user identifier;
[0051] Here, the billing abnormal state check interface is a processing interface newly added by the embodiment of the present invention outside the conventional internal / external processing interface set of the conventional scientific computing platform; the interface request of the interface, i.e., the request data of the first check request, should include at least two data items: a first request address and a first user identifier;
[0052] Step 52, and taking the user corresponding to the first user identifier of the current request as the first user;
[0053] Step 53, identifying the abnormal billing status of all computing tasks and all computing nodes that are bound to the first user to obtain a corresponding first identification report;
[0054] Wherein, the first identification report includes an abnormal node report and an abnormal task report; when the abnormal node report is not empty, it is composed of one or more abnormal node records; each abnormal node record includes at least an abnormal node identifier, a corresponding task identifier, an abnormal node fee, and a normal node fee; when the abnormal task report is not empty, it is composed of one or more abnormal task records; each abnormal task record includes at least an abnormal task identifier, an abnormal task fee, and a normal task fee;
[0055] Specifically, it includes: step 531, forming all computing tasks that have a binding relationship with the first user into a corresponding computing task set; and forming all computing nodes corresponding to the computing task set into a corresponding computing node set;
[0056] Step 532, identifying whether the computing node set is empty; if so, setting the corresponding abnormal node report to be empty, and going to step 534; if not, going to step 533;
[0057] Step 533, perform a round of traversal on all computing nodes in the computing node set; and in this round of traversal, take the currently traversed computing node as the corresponding current node; and estimate the node cost according to the node timing unit price and node event list corresponding to the current node to obtain the corresponding first estimated cost; and take the account cost of the node billing account corresponding to the current node as the corresponding first billing cost; and calculate the corresponding first difference ratio = |first estimated cost-first billing cost| / first estimated cost according to the first estimated cost and the first billing cost; and when the first difference ratio exceeds the preset first difference ratio threshold, take the node identifier of the current node as the corresponding abnormal node identifier, and take the task identifier of the computing task corresponding to the current node as the corresponding task identifier, and take the first billing cost and the first estimated cost as the corresponding abnormal node cost and normal node cost, and form a corresponding abnormal node record with the abnormal node identifier, the task identifier, the abnormal node cost and the normal node cost obtained this time; and at the end of this round of traversal, identify whether the total number of abnormal node records obtained is zero, if so, set the corresponding abnormal node report to be empty, otherwise, form the corresponding abnormal node report with all the abnormal node records obtained;
[0058] Here, the first difference ratio threshold is a preset ratio parameter;
[0059] It should be noted that in the current step 533, the specific processing steps of performing node cost estimation according to the node timing unit price and the node event list corresponding to the current node to obtain the corresponding first estimated cost are composed of the following steps A1-A4:
[0060] Step A1, taking the event time of the node event record with the event type of start in the node event list as the corresponding start time; and identifying whether there is a node event record with the event type of end in the node event list; if there is, taking the event time of the node event record with the event type of end as the corresponding end time; if not, taking the current time as the corresponding end time;
[0061] Step A2, identifying whether the total number of node event records with the event type of pause in the node event list is zero; if so, setting the corresponding total pause duration to 0, and going to step A4; if not, going to step A3;
[0062] Step A3, perform a round of traversal of all node event records in the node event list whose event type is pause; and in this round of traversal, take the currently traversed node event record as the corresponding current pause record; and record the node event record in the node event list whose event type is resume as the corresponding resume record; and count the total number of resume records whose event time is after the event time of the current pause record to obtain the corresponding total number of statistical records; and identify the total number of statistical records; if the total number of statistical records is greater than zero, then take the resume record whose event time is after the event time of the current pause record and closest to the event time of the current pause record as the corresponding next-step resume record, and take the time difference between the two event times of the current pause record and the next-step resume record as the corresponding first pause duration; if the total number of statistical records is equal to zero, then take the time difference between the end time and the event time of the current pause record as the corresponding first pause duration; and at the end of this round of traversal, calculate the sum of all the first pause durations obtained and use the calculated result as the corresponding total pause duration;
[0063] Step A4, taking the time difference between the start time and the end time as the corresponding first total duration; taking the difference between the first total duration and the total pause duration as the corresponding first running duration; and taking the product of the node timing unit price and the first running duration as the corresponding first estimated cost;
[0064] Step 534, identifying whether the computing task set is empty; if so, setting the corresponding abnormal task report to empty, and going to step 536; if not, going to step 535;
[0065] Step 535, perform a round of traversal on all computing tasks in the computing task set; and in this round of traversal, take the currently traversed computing task as the corresponding current task; and calculate the sum of the first estimated costs of all computing nodes of the current task and use the calculation result as the corresponding second estimated cost; and use the account cost of the task billing account corresponding to the current task as the corresponding second billing cost; and calculate the corresponding second difference ratio = |second estimated cost-second billing cost| / second estimated cost based on the second estimated cost and the second billing cost; and when the second difference ratio exceeds the preset second difference ratio threshold, use the task identifier of the current task as the corresponding abnormal task identifier, and use the second billing cost and the second estimated cost as the corresponding abnormal task cost and normal task cost, and use the abnormal task identifier, abnormal task cost and normal task cost obtained this time to form a corresponding abnormal task record; and at the end of this round of traversal, identify whether the total number of abnormal task records obtained is zero, if so, set the corresponding abnormal task report to empty, otherwise, all the abnormal task records obtained form the corresponding abnormal task report;
[0066] Here, the second difference ratio threshold is a preset ratio parameter;
[0067] Step 536, composing a corresponding first identification report by using the obtained abnormal node report and abnormal task report;
[0068] Step 54, and send the first identification report back to the first request address of the current request.
[0069] Figure 2 The module structure diagram of a processing device for identifying abnormal billing status provided in the second embodiment of the present invention, the device is a terminal device or server that implements the aforementioned method embodiment, and can also be a device that enables the aforementioned terminal device or server to implement the aforementioned method embodiment, for example, the device can be a device or chip system of the aforementioned terminal device or server. Figure 2 As shown, the device includes: a computing task and node creation module 201, a timer and event record processing module 202, a node cost update module 203, a task cost update module 204 and a billing abnormal status checking module 205.
[0070] The computing task and node creation module 201 is used to assign a corresponding task identifier and task billing account to the current computing task when a new computing task is created for any user; and establish a binding relationship between the current user and the current computing task; and based on the computing node settings of the current user, create one or more corresponding computing nodes for the current computing task; and establish a binding relationship between each newly created computing node and the current computing task; and assign a corresponding node identifier, node timer, node billing account, node timing unit price and node event list to each computing node; and reset the task billing account, each node timer and each node billing account to zero; the node event list is an empty table when it is created, and when the node event list is not empty, it is composed of one or more node event records; the node event record includes event type and event time; event types include start, pause, resume and end.
[0071] The timer and event record processing module 202 is used to start, pause, resume or end the timing operation of the node timer when each computing node is started, paused, resumed or ended. And a node event record with an event type of corresponding start, pause, resume or end and an event time of the current time is added to the corresponding node event list.
[0072] The node fee update module 203 is used to update the node billing account once based on the product of the corresponding node timer and the node timing unit price every first preset time period during the calculation process of each computing node from startup to completion; and when each computing node ends the calculation, the node billing account is updated once based on the product of the corresponding node timer and the node timing unit price.
[0073] The task fee update module 204 is used to perform a total calculation of the account fees of all node billing accounts corresponding to the current computing task when a fee update occurs in any node billing account corresponding to each computing task, and based on the total calculation result, perform a fee update on the task billing account corresponding to the current computing task.
[0074] The billing abnormality status check module 205 is used to receive interface requests on a preset billing abnormality status check interface, and when each first check request is received, the first check request received at that time is used as the corresponding current request; and the corresponding user of the first user identifier of the current request is used as the first user; and the billing abnormality status of all computing tasks and all computing nodes that have a binding relationship with the first user is identified to obtain a corresponding first identification report; and the first identification report is sent back to the first request address of the current request; the first check request at least includes the first request address and the first user identifier.
[0075] An embodiment of the present invention provides a processing device for identifying abnormal billing status, which can execute the method steps in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0076] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the billing abnormal state inspection module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above determination module. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in software form.
[0077] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0078] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the above method embodiments are generated. The above computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, Bluetooth, microwave, etc.) methods. The above-mentioned computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The above-mentioned available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0079] Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device may be a terminal device or a server for implementing the method of the aforementioned embodiment, or may be a terminal device or a server for implementing the method of the aforementioned embodiment connected to the aforementioned terminal device or server. Figure 3 As shown, the electronic device may include: a processor 301 (such as a CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiver 303. Various instructions may be stored in the memory 302 to complete various processing functions and implement the processing steps described in the aforementioned embodiment method. Preferably, the electronic device involved in the embodiment of the present invention also includes: a power supply 304, a system bus 305 and a communication port 306. The system bus 305 is used to realize the communication connection between components. The above-mentioned communication port 306 is used for connecting and communicating between the electronic device and other peripherals.
[0080] exist Figure 3The system bus 305 mentioned in the figure can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM), and may also include non-volatile memory (Non-Volatile Memory), such as at least one disk storage.
[0081] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (Network Processor, NP), a graphics processing unit (Graphics Processing Unit, GPU), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0082] It should be noted that an embodiment of the present invention further provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the method and processing process provided in the above embodiments.
[0083] The embodiments of the present invention provide a processing method, device, electronic device and computer-readable storage medium for identifying abnormal billing status. As can be seen from the above content, when creating a new computing task for any user, the embodiments of the present invention assign a corresponding task identifier and task billing account to the current computing task, and bind the current user to the current computing task; and create one or more corresponding computing nodes for the current computing task based on the computing node setting of the current user, and bind each newly created computing node to the current computing task, and assign a corresponding node identifier, node timer, node billing account, node timing unit price and node event list to each computing node; and when each computing node is started, paused, resumed or ended, the timing operation of the node timer is started, paused, resumed or ended accordingly, and a node event record with the event type of corresponding start, pause, resume or end and the event time being the current time is added to the corresponding node event list; and from the start to the end of each computing node, a node event record is created. During the calculation process that has been completed, the node billing account is updated periodically based on the timing duration of the node timer × the node timing unit price, and when each computing node ends the calculation, the node billing account is updated based on the timing duration of the node timer × the node timing unit price; and when a fee update occurs in any node billing account corresponding to each computing task, the account fees of all node billing accounts corresponding to the current computing task are calculated in total, and the fee update is performed on the task billing account corresponding to the current computing task based on the total calculation result; and the interface request is received on the billing abnormality status check interface, and the designated user of the first check request received each time is used as the first user, and the billing abnormality status of all computing tasks and all computing nodes that have a binding relationship with the first user is identified to obtain the corresponding first identification report and sent back to the first request address specified by the current request. The embodiment of the present invention eliminates the additional economic losses caused to users by billing abnormalities, improves the platform usage experience of users, and enhances the user stickiness of the platform.
[0084] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0085] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for identifying abnormal billing status, characterized in that: The method comprises: When a new computing task is created for any user, a corresponding task identifier and task billing account are assigned to the current computing task; and a binding relationship is established between the current user and the current computing task; and based on the computing node settings of the current user, one or more corresponding computing nodes are created for the current computing task; and a binding relationship is established between each newly created computing node and the current computing task; and a corresponding node identifier, node timer, node billing account, node timing unit price and node event list are assigned to each computing node; and the task billing account, each node timer and each node billing account are reset to zero; the node event list is an empty table when it is created, and when the node event list is not empty, it is composed of one or more node event records; the node event record includes event type and event time; the event type includes start, pause, resume and end; When the computing operation is started, paused, resumed or ended on each computing node, the timing operation of the node timer is started, paused, resumed or ended accordingly; and a node event record is added to the corresponding node event list, with the event type being the corresponding start, pause, resume or end and the event time being the current time; During the calculation process of each computing node from start to end, the node billing account is updated once based on the product of the corresponding node timer and the node timing unit price every first preset time period; and when each computing node ends the calculation, the node billing account is updated once based on the product of the corresponding node timer and the node timing unit price; When a fee update occurs to any of the node billing accounts corresponding to each of the computing tasks, a sum calculation is performed on the account fees of all the node billing accounts corresponding to the current computing task, and a fee update is performed on the task billing account corresponding to the current computing task based on the sum calculation result; An interface request is received on a preset billing abnormality status check interface, and each time a first check request is received, the first check request received at that time is used as the corresponding current request; and the corresponding user of the first user identifier of the current request is used as the first user; and the billing abnormality status of all computing tasks and all computing nodes that have a binding relationship with the first user is identified to obtain a corresponding first identification report; and the first identification report is sent back to the first request address of the current request; the first check request at least includes the first request address and the first user identifier.
2. The method for identifying abnormal billing status according to claim 1, characterized in that: The identifying the abnormal billing status of all computing tasks and all computing nodes that are bound to the first user to obtain a corresponding first identification report specifically includes: Step 21, grouping all the computing tasks that have a binding relationship with the first user into a corresponding computing task set; and grouping all the computing nodes corresponding to the computing task set into a corresponding computing node set; Step 22, identifying whether the computing node set is empty; if so, setting the corresponding abnormal node report to be empty, and going to step 24; if not, going to step 23; Step 23, perform a round of traversal on all the computing nodes in the computing node set; and in this round of traversal, use the computing node currently traversed as the corresponding current node; and estimate the node cost according to the node timing unit price corresponding to the current node and the node event list to obtain the corresponding first estimated cost; and use the account cost of the node billing account corresponding to the current node as the corresponding first billing cost; and calculate the corresponding first difference ratio = |first estimated cost-first billing cost| / first estimated cost according to the first estimated cost and the first billing cost; and when the first difference ratio exceeds the preset first difference ratio threshold, the current node The node identifier of the current node is used as the corresponding abnormal node identifier, and the task identifier of the computing task corresponding to the current node is used as the corresponding belonging task identifier, and the first billing fee and the first estimated fee are used as the corresponding abnormal node fee and normal node fee, and the abnormal node identifier, the belonging task identifier, the abnormal node fee and the normal node fee obtained this time form a corresponding abnormal node record; and at the end of this round of traversal, it is identified whether the total number of the abnormal node records obtained is zero, if so, the corresponding abnormal node report is set to be empty, otherwise, all the abnormal node records obtained form the corresponding abnormal node report; Wherein, when the abnormal node report is not empty, it is composed of one or more abnormal node records; the abnormal node record includes the abnormal node identifier, the task identifier, the abnormal node fee and the normal node fee; Step 24, identifying whether the computing task set is empty; if so, setting the corresponding abnormal task report to empty, and going to step 26; if not, going to step 25; Step 25, perform a round of traversal on all the computing tasks in the computing task set; and in this round of traversal, take the computing task currently traversed as the corresponding current task; and calculate the sum of the first estimated costs of all the computing nodes of the current task and use the calculation result as the corresponding second estimated cost; and use the account cost of the task billing account corresponding to the current task as the corresponding second billing cost; and calculate the corresponding second difference ratio = |second estimated cost-second billing cost| / second estimated cost according to the second estimated cost and the second billing cost; and when the second difference ratio exceeds the preset second difference ratio threshold, use the task identifier of the current task as the corresponding abnormal task identifier, and use the second billing cost and the second estimated cost as the corresponding abnormal task cost and normal task cost, and use the abnormal task identifier, the abnormal task cost and the normal task cost obtained this time to form a corresponding abnormal task record; and at the end of this round of traversal, identify whether the total number of the abnormal task records obtained is zero, if so, set the corresponding abnormal task report to be empty, otherwise, all the abnormal task records obtained form the corresponding abnormal task report; Wherein, when the abnormal task report is not empty, it is composed of one or more abnormal task records; the abnormal task record includes the abnormal task identifier, the abnormal task fee and the normal task fee; Step 26: The abnormal node report and the abnormal task report obtained form the corresponding first identification report.
3. The method for identifying abnormal billing status according to claim 2, characterized in that: The step of estimating the node cost according to the node timing unit price corresponding to the current node and the node event list to obtain the corresponding first estimated cost specifically includes: Step 31, taking the event time of the node event record with the event type of start in the node event list as the corresponding start time; and identifying whether the node event record with the event type of end in the node event list exists; if it exists, taking the event time of the node event record with the event type of end as the corresponding end time; if it does not exist, taking the current time as the corresponding end time; Step 32, identifying whether the total number of the node event records of the event type of pause in the node event list is zero; if so, setting the corresponding total pause duration to 0, and going to step 34; if not, going to step 33; Step 33, perform a round of traversal of all the node event records in the node event list whose event type is pause; and in this round of traversal, take the node event record currently traversed as the corresponding current pause record; and record the node event record in the node event list whose event type is resume as the corresponding resume record; and count the total number of records of the resume records whose event time is after the event time of the current pause record to obtain the corresponding total number of statistical records; and identify the total number of statistical records; if the total number of statistical records is greater than zero, then take the resume record whose event time is after the event time of the current pause record and closest to the event time of the current pause record as the corresponding next-step resume record, and take the time difference between the two event times of the current pause record and the next-step resume record as the corresponding first pause duration; if the total number of statistical records is equal to zero, then take the time difference between the end time and the event time of the current pause record as the corresponding first pause duration; and at the end of this round of traversal, calculate the sum of all the first pause durations obtained and use the calculated result as the corresponding total pause duration; Step 34, taking the time difference between the start time and the end time as the corresponding first total duration; and taking the difference between the first total duration and the pause total duration as the corresponding first running duration; and taking the product of the node timing unit price and the first running duration as the corresponding first estimated fee.
4. A device for executing the method for identifying abnormal billing status according to any one of claims 1 to 3, characterized in that: The device comprises: a computing task and node creation module, a timer and event record processing module, a node cost update module, a task cost update module and a charging abnormal state checking module; The computing task and node creation module is used to assign a corresponding task identifier and task billing account to the current computing task when creating a new computing task for any user; and establish a binding relationship between the current user and the current computing task; and based on the computing node settings of the current user, create one or more corresponding computing nodes for the current computing task; and establish a binding relationship between each newly created computing node and the current computing task; and assign a corresponding node identifier, node timer, node billing account, node timing unit price and node event list to each computing node; and reset the task billing account, each node timer and each node billing account to zero; the node event list is an empty table when created, and when the node event list is not empty, it is composed of one or more node event records; the node event record includes event type and event time; the event type includes start, pause, resume and end; The timer and event record processing module is used to start, pause, resume or end the timing operation of the node timer correspondingly when the computing operation is started, paused, resumed or ended on each computing node; and add a node event record whose event type is the corresponding start, pause, resume or end and whose event time is the current time to the corresponding node event list; The node fee update module is used to update the node billing account once based on the product of the corresponding node timer and the node timing unit price every first preset time period during the calculation process of each computing node from start to end; and to update the node billing account once based on the product of the corresponding node timer and the node timing unit price when each computing node ends calculation; The task fee update module is used to perform a sum calculation of the account fees of all the node billing accounts corresponding to the current computing task and perform a fee update on the task billing account corresponding to the current computing task based on the sum calculation result when a fee update occurs to any of the node billing accounts corresponding to each computing task; The billing abnormality status check module is used to receive interface requests on a preset billing abnormality status check interface, and when each first check request is received, the first check request received at that time is used as the corresponding current request; and the corresponding user of the first user identifier of the current request is used as the first user; and the billing abnormality status of all computing tasks and all computing nodes that have a binding relationship with the first user is identified to obtain a corresponding first identification report; and the first identification report is sent back to the first request address of the current request; the first check request at least includes the first request address and the first user identifier.
5. An electronic device, characterized in that: include: memory, processors, and transceivers; The processor is used to couple with the memory, read and execute instructions in the memory, so as to implement the method according to any one of claims 1 to 3; The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is enabled to execute the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Payment method, payment client, and charging device and control method and system thereof
CN106033569A
Charging exception identification method and device
CN109658082A
Charging method and device based on calculation management platform, equipment and medium
CN113986658A
High-precision real-time charging method, settlement method and system based on intelligent electric energy meter
CN115862224A
Flat fee and interim bills for professional services firm
WO2016004126A1