Electric meter data processing method and device, computer device and storage medium
Patent Information
- Application Number
- CN202310023939.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-09
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-01-09
AI Technical Summary
[0004]然而,由于抄核收业务的数据量较大,电费业务系统在执行任务出现异常的情况下,容易导致任务中断,采用定时任务的方式,难以保证流程的正常流转,导致业务处理不及时的问题,从而导致电费抄核收的效率较低
[0015]第五方面,本申请还提供了一种计算机程序产品。所述计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述电表数据处理方法中的步骤。
Smart Images

Figure CN116257339B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, and storage medium for processing electricity meter data. Background Technology
[0002] With the development of the power sector, the power grid coverage is expanding, and the number of users served by power supply companies is constantly increasing. Electricity bill collection is the main business of power supply companies, and electricity bill reading and verification are means and measures for power supply companies to ensure electricity bill collection, including processes such as meter reading, calculation, and billing.
[0003] In traditional technology, the electricity billing system handles the electricity billing and collection for a massive number of users. The electricity billing system mainly uses scheduled tasks to sequentially execute the meter reading, calculation, and billing tasks for a massive number of users, thereby obtaining the electricity bill information of a massive number of users and completing the electricity bill collection.
[0004] However, due to the large amount of data involved in the electricity billing and collection business, the electricity billing system is prone to task interruption when abnormalities occur during task execution. The use of scheduled tasks makes it difficult to ensure the normal flow of the process, resulting in untimely business processing and thus low efficiency in electricity billing and collection. Summary of the Invention
[0005] Therefore, it is necessary to provide a meter data processing method, device, computer equipment, computer-readable storage medium, and computer program product that can improve the efficiency of electricity bill reading and collection in response to the above-mentioned technical problems.
[0006] In a first aspect, this application provides a method for processing electricity meter data. The method includes: for each processing stage following the first processing stage in an electricity meter data processing chain, adding a task created based on the execution result of a task in the previous processing stage to a task set corresponding to that processing stage; the electricity meter data processing chain includes multiple sequentially arranged processing stages; sending tasks from the task set corresponding to the processing stage to a task execution node corresponding to the processing stage, so that the corresponding task execution node executes the task and returns a corresponding execution result; creating a task based on the execution result, adding the created task to the task set corresponding to the next processing stage, and removing the task from the task set corresponding to the processing stage.
[0007] Secondly, this application also provides an electricity meter data processing apparatus. The apparatus includes: a task grouping module, used to add tasks created based on the execution results of tasks in the previous processing stage to a task set corresponding to the processing stage for each processing stage following the first processing stage in the electricity meter data processing chain; the electricity meter data processing chain includes multiple sequentially arranged processing stages; a task scheduling module, used to send tasks in the task set corresponding to the processing stage to the task execution node corresponding to the processing stage, so that the corresponding task execution node executes the tasks and returns the corresponding execution results; and a task creation module, used to create tasks based on the execution results, add the created tasks to the task set corresponding to the next processing stage of the processing stage, and remove the tasks from the task set corresponding to the processing stage.
[0008] In some embodiments, the task execution node corresponding to the processing stage includes multiple sub-nodes; the task scheduling module is further configured to: sequentially determine the task to be executed from the task set corresponding to the processing stage; determine the target sub-node from the multiple sub-nodes based on the node states corresponding to the multiple sub-nodes respectively; and send the task to be executed to the target sub-node.
[0009] In some embodiments, the tasks in the task set have execution priorities; the task scheduling module is further configured to: determine candidate tasks from the task set corresponding to the processing stage in sequence according to the execution priorities; and determine the candidate task as a task to be executed if the candidate task meets the execution conditions; the execution conditions include at least one of the following: the candidate task has associated tasks and the associated tasks have been completed, or the candidate task does not have associated tasks.
[0010] In some embodiments, the meter data processing device further includes a priority adjustment module, which is used to: reduce the execution priority of the candidate task if the candidate task does not meet the execution conditions; and return to the step of determining candidate tasks from the task set corresponding to the processing stage in order of execution priority.
[0011] In some embodiments, the task creation module is further configured to: extract meter-related data from the execution result if the execution is successful based on the execution result; create a task based on the meter-related data; the meter data processing device further includes an exception handling module, which is configured to: generate an exception message to indicate execution failure if the execution is failed based on the execution result.
[0012] In some embodiments, the meter data processing device is further configured to: for the first processing stage in the meter data processing link, obtain at least one preset task from a pre-created task set; add the obtained at least one preset task to the task set corresponding to the first processing stage; send the preset task in the task set to the task execution node corresponding to the first processing stage, so that the task execution node corresponding to the first processing stage executes the preset task and returns the execution result corresponding to the preset task; and create a task corresponding to the next processing stage of the first processing stage based on the execution result corresponding to the preset task.
[0013] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in the above-described electricity meter data processing method.
[0014] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps in the above-described meter data processing method.
[0015] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps in the above-described electricity meter data processing method.
[0016] The aforementioned meter data processing method, apparatus, computer equipment, storage medium, and computer program product automatically schedule tasks in each processing stage of the meter data processing chain by sending tasks from the corresponding task sets of each processing stage to the corresponding task execution nodes of each processing stage. Based on the execution results, tasks are created and added to the task set corresponding to the next processing stage, forming a pipeline-like operation of the meter data processing chain. This changes the traditional centralized, timed task operation method, allowing task execution nodes corresponding to different processing stages to execute simultaneously, improving data processing efficiency in each processing stage, and thus improving the efficiency of electricity billing and collection. Attached Figure Description
[0017] Figure 1 This is an application environment diagram of a meter data processing method in one embodiment;
[0018] Figure 2 This is a flowchart illustrating a method for processing electricity meter data in one embodiment;
[0019] Figure 3 This is a schematic diagram of the system scheduling process in one embodiment;
[0020] Figure 4A This is a schematic diagram of an electricity bill meter reading and collection process in one embodiment.
[0021] Figure 4B This is a schematic diagram of task scheduling in the meter data processing link in one embodiment;
[0022] Figure 5A This is a structural block diagram of an electricity meter data processing device in one embodiment;
[0023] Figure 5B This is a structural block diagram of the meter data processing device in another embodiment;
[0024] Figure 6 This is an internal structural diagram of a computer device in one embodiment;
[0025] Figure 7 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0027] The meter data processing method provided in this application embodiment can be applied to, for example... Figure 1 The application environment shown includes a terminal 102, a scheduling server 104, and an execution server 106. The scheduling server 104 creates tasks and assigns corresponding execution servers to them; therefore, it can also be called a task scheduling node. The execution server 106 executes tasks and returns the corresponding execution results. The execution server 106 includes multiple task execution nodes, each executing tasks at different processing stages. The scheduling server 104 communicates with the terminal 102 and the execution server 106 via a network. A data storage system can store the data that the scheduling server 104 needs to process. The data storage system can be integrated on the server 104 or placed in the cloud or on other network servers.
[0028] Specifically, in response to the electricity billing service platform's call to begin processing meter data, terminal 102 sends a meter data processing request to dispatch server 104. Dispatch server 104, in response to the meter data processing request from terminal 102, begins creating tasks for the first processing stage corresponding to each meter. For each processing stage following the first processing stage in the meter data processing chain, dispatch server 104 adds tasks created based on the execution results of the tasks in the previous processing stage to the corresponding task set for that processing stage; the meter data processing chain includes multiple sequentially arranged processing stages; tasks in the task set corresponding to each processing stage are sent to the corresponding task execution nodes in the processing stage execution server 106, so that the corresponding task execution nodes execute the tasks and return the corresponding execution results; dispatch server 104 creates tasks based on the execution results and adds the created tasks to the task set corresponding to the next processing stage, and removes tasks from the task set corresponding to the next processing stage.
[0029] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The scheduling server 104 or execution server 106 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0030] In some embodiments, such as Figure 2 As shown, a method for processing electricity meter data is provided, which can be applied to... Figure 1 Taking scheduling server 104 as an example, the following steps are included:
[0031] Step 202: For each processing stage after the first processing stage in the meter data processing link, add the task created based on the execution result of the task of the previous processing stage to the task set corresponding to the processing stage; the meter data processing link includes multiple sequentially arranged processing stages.
[0032] The electricity meter data refers to the data from users' electricity meters. Each user corresponds to at least one electricity meter. The power supply company supplies electricity to users and collects corresponding electricity fees. The electricity meter data is processed through the power supply company's electricity billing platform to obtain the electricity fees for each user. The electricity meter data processing link is the process of processing electricity meter data to obtain electricity bills, also known as the electricity bill reading, verification, and collection business process. Electricity bill reading, verification, and collection is a means and measure for power supply companies to ensure electricity fee collection, including meter reading, billing, and collection. The electricity meter data processing link includes multiple sequentially arranged processing stages. For example, it can be arranged in the order of processing as the meter reading stage, meter reading calculation stage, electricity fee calculation stage, electricity fee verification stage, electricity fee issuance stage, and bill sending stage. That is, the first processing stage of the electricity meter processing link is the meter reading stage.
[0033] Each processing stage corresponds to a task set, which can be a queue of tasks from different processing stages, also known as a task thread pool. One task corresponds to one meter data, for example... Figure 4B As shown, the set of tasks corresponding to the meter reading stage is the meter reading task queue. The meter reading task queue is a first-in-first-out queue, which includes multiple meter reading tasks. Head represents the head of the queue, and Tail represents the tail of the queue.
[0034] Specifically, for each processing stage following the first processing stage in the meter data link, the scheduling server creates a task based on the execution result of the previous processing stage and adds the created task to the task set corresponding to that processing stage. For example, Figure 4B As shown, for the meter reading verification stage, the previous processing stage is determined, that is, if meter reading task 1 in the meter reading stage is successfully executed, the corresponding meter reading data is obtained from the execution result of meter reading task 1, and a meter reading verification task corresponding to meter reading task 1 is created, the meter reading verification task is added to the meter reading verification queue, and meter reading task 1 is removed from the meter reading task queue.
[0035] Step 204: Send the tasks in the task set corresponding to the processing stage to the task execution node corresponding to the processing stage, so that the corresponding task execution node can execute the task and return the corresponding execution result.
[0036] The task execution nodes include at least one of the following stages: meter reading, meter reading calculation, electricity bill calculation, electricity bill verification, electricity bill issuance, and bill sending. Each task execution node in each processing stage executes the tasks in its corresponding task set to obtain the execution result. Each processing stage's task execution node includes multiple sub-nodes, and each sub-node corresponds to one execution server; that is, one task execution node includes multiple execution servers. The execution servers included in task execution nodes differ between different processing stages.
[0037] The execution result is generated after the task execution node executes the task, including the result corresponding to either successful execution or failure. For example, in the meter reading stage, the task execution node executes the meter reading task for user 1. If the execution is successful, the execution result includes the meter reading data for user 1; if the execution fails, the execution result can be empty.
[0038] Specifically, for each processing stage in the meter data processing chain, the scheduling server determines the task execution node corresponding to that processing stage and sends the tasks in the task set corresponding to that processing stage to the corresponding task execution node. The task execution node corresponding to the processing stage executes the task and generates the task execution result, and returns the execution result to the scheduling server.
[0039] In some embodiments, the scheduling server can evaluate the performance of each execution server and determine the execution servers included in the task execution nodes corresponding to each processing stage based on the performance evaluation results. For example, the CPU (central processing unit) computing power and storage space of the execution servers can be evaluated. For different processing stages, such as the meter reading stage and the electricity bill calculation stage, since the meter reading task in the meter reading stage needs to store a large amount of meter reading data from a large number of users, and the electricity bill calculation task in the electricity bill calculation stage needs to perform a large amount of computation, the execution server with larger storage space can be used as the task execution node corresponding to the meter reading stage, and the execution server with stronger computing power can be used as the task execution node corresponding to the electricity bill calculation stage.
[0040] Step 206: Create a task based on the execution result, add the created task to the task set corresponding to the next processing stage, and remove the task from the task set corresponding to the processing stage.
[0041] Specifically, the scheduling server receives the execution result corresponding to the processing stage returned by the task execution node. If the execution is successful, it creates a task corresponding to the execution result and adds the created task to the task set corresponding to the next processing stage. For example, Figure 4B As shown, during the meter reading verification phase, the scheduling server receives the execution result of meter reading verification task 1 returned by the task execution node corresponding to the meter reading verification phase. If the execution is successful and the execution result is that the verification is correct, the scheduling server creates an electricity bill calculation task corresponding to meter reading verification task 1, adds the created electricity bill calculation task to the task set corresponding to the electricity bill calculation phase, i.e., the electricity bill calculation task queue, and removes meter reading verification task 1 from the meter reading verification task queue.
[0042] In some embodiments, if a task execution fails, the scheduling server can add the user corresponding to the task to the list of abnormal users, generate an exception message for the task, and then send the exception message to the terminal. The exception message indicates that the task execution failed. The terminal receives the exception message and displays it as a session message or a pop-up window to remind the relevant personnel to handle the issue promptly.
[0043] In some embodiments, for the final processing stage of the electricity meter data processing chain, namely the bill sending stage, the scheduling server receives the execution result returned by the task execution node corresponding to the bill sending stage. If the execution is successful, meaning the scheduling server has completed the task of each processing stage for that user according to the meter reading and billing pipeline, the user is added to the processed user list; if the execution fails, the user is added to the abnormal user list. The processed user list stores users whose electricity bills have been sent, while the abnormal user list stores users corresponding to tasks where abnormal situations occurred during task execution in the electricity meter data processing chain.
[0044] In some embodiments, the scheduling server divides the electricity billing and collection process into multiple processing stages in the meter data processing chain. By automatically triggering the scheduling of tasks in the next processing stage, a rolling billing and collection pipeline operation is achieved. The scheduling server can also divide the processing stages included in the meter data processing chain according to actual business needs, resulting in pipelines including different processing stages, for example, such as... Figure 4A As shown, Figure 4A In this context, (a) represents a pipeline consisting of the processing stages corresponding to meter reading, meter reading calculation, electricity bill calculation, electricity bill issuance, and bill sending, respectively. Figure 4A (b) in the diagram represents a pipeline consisting of the processing stages corresponding to electricity bill calculation, electricity bill accounting, electricity bill issuance, and bill sending, respectively. Figure 4A (c) in the diagram represents the pipeline consisting of the processing stages corresponding to electricity bill issuance and bill sending, respectively.
[0045] In some embodiments, such as Figure 3The diagram illustrates the system scheduling process. The scheduling server dynamically allocates data to corresponding execution servers to perform tasks. Based on the provided data, tasks for different processing stages are grouped and managed, and a task thread pool is established for each task group. This forms a task set corresponding to each processing stage, and the server can maintain and manage information for each business group, such as editing or deleting groups. The scheduling server then schedules task execution based on the task groups and task thread pools, sending tasks from different processing stages to different execution servers (task execution nodes), allowing tasks from different groups to execute in parallel and automatically triggering the scheduling of tasks for the next processing stage. Furthermore, the scheduling server can monitor the execution status of each processing stage, including the number of executed tasks, the number of exceptions, the number of cancellations, the execution server groups, and a line graph showing the real-time task queues for each group. For users who experience exceptions in each processing stage, the server can generate a list of exception users and generate exception notification messages to notify personnel for handling.
[0046] In the above-mentioned meter data processing method, by sending the tasks from the corresponding task sets of each processing stage of the meter data processing link to the corresponding task execution nodes of the processing stage, the automatic scheduling of tasks in each processing stage of the meter data processing link is realized. Based on the execution results, tasks are created and added to the task set corresponding to the next processing stage, forming a pipeline operation of the meter data processing link. This changes the traditional centralized timed task operation mode, allowing task execution nodes corresponding to different processing stages to execute simultaneously, improving the data processing efficiency in each processing stage, and thus improving the efficiency of electricity bill reading and collection.
[0047] In some embodiments, the task execution node corresponding to the processing stage includes multiple child nodes; step 204 further includes: sequentially determining the task to be executed from the task set corresponding to the processing stage; determining the target child node from the multiple child nodes based on the node states corresponding to the multiple child nodes respectively; and sending the task to be executed to the target child node.
[0048] The task execution node comprises multiple child nodes, each corresponding to an execution server. The node status refers to the current task status of the child node, representing the number of tasks to be executed within that child node. The target child node is the child node selected from the multiple child nodes to execute the task. Tasks to be executed are those that meet the execution conditions within the task set corresponding to the processing stage.
[0049] Specifically, the scheduling server sequentially determines the tasks to be executed from the task set corresponding to the processing stage, identifies the task execution node corresponding to the processing stage, obtains the node status of each of the multiple child nodes included in the task execution node, identifies the child nodes with an idle status as target child nodes, and then sends the task to be executed to the target child node. The target child node receives the task to be executed and returns the execution result to the scheduling server after the task is completed.
[0050] In this embodiment, the target sub-node is determined based on the node status corresponding to multiple sub-nodes, and the task to be executed is sent to the target sub-node. This realizes reasonable task scheduling and distributed operation, improves data processing efficiency, and thus improves the efficiency of electricity bill meter reading and collection.
[0051] In some embodiments, tasks in the task set have execution priorities; determining the tasks to be executed from the task set corresponding to the processing stage in sequence includes: determining candidate tasks from the task set corresponding to the processing stage in sequence according to execution priorities; if a candidate task meets the execution conditions, determining the candidate task as the task to be executed; the execution conditions include at least one of the following: the candidate task has an associated task and the associated task has been completed, or the candidate task does not have an associated task.
[0052] Execution priority is used to characterize the order in which tasks are executed within the task set, i.e., their order in the task queue. For example, a task with a higher execution priority is more likely to be in the task set. Candidate tasks are tasks, for example, the task with the highest execution priority in the task set can be considered a candidate task. Execution conditions are used to determine whether a candidate task can be executed. Related tasks are tasks that are related to the execution of candidate tasks. For example, some electricity meters have related relationships. For instance, a certain electricity user unit might have three meters: meter 1, meter 2, and meter 3. These meters have related relationships, and the electricity bill calculation and electricity bill issuance tasks corresponding to these related meters need to be executed simultaneously. Therefore, the electricity bill calculation task for meter 1 has related tasks, and the related tasks for meters 2 and 3 are also related tasks.
[0053] Specifically, the scheduling server identifies the task with the highest execution priority in the task set corresponding to the processing stage as a candidate task. If the candidate task has no associated task, or if the candidate task has an associated task and the associated task has been completed, the candidate task is determined to meet the execution conditions. In this case, the candidate task is identified as a task to be executed and sent to the task execution node corresponding to the task. The process of determining candidate tasks from the task set corresponding to the processing stage in order of execution priority is then returned.
[0054] In some embodiments, if the execution time of a task exceeds a preset execution time, the task execution node will suspend the currently executing task, generate an execution timeout message, and return the execution timeout message to the scheduling server. Upon receiving the execution timeout message, the scheduling server will lower the execution priority of the task and return the steps of determining candidate tasks from the task set corresponding to the processing stage according to their execution priorities.
[0055] In this embodiment, the execution order of each task in the task set is determined by the execution priority of the task, and candidate tasks are determined as tasks to be executed when the execution conditions are met, so as to reduce the problem of pause caused by the execution failure of task execution nodes during the task execution process, thereby improving the efficiency of data processing.
[0056] In some embodiments, the meter data processing method further includes: if a candidate task does not meet the execution conditions, reducing the execution priority of the candidate task; and returning to the step of determining candidate tasks from the task set corresponding to the processing stage in order of execution priority.
[0057] Specifically, if the scheduling server determines that a candidate task does not meet the execution conditions (i.e., the candidate task has related tasks that have not been completed), it lowers the execution priority of the candidate task. For example, it can adjust the execution priority of the candidate task to the lowest level, thus moving the candidate task to the end of the task queue. Then, it returns to the step of determining candidate tasks from the task set corresponding to the processing stage according to their execution priorities. For example, for the electricity bill calculation task corresponding to the electricity bill calculation stage, if it is determined that a user's electricity bill calculation task has related tasks that have not been completed, the execution priority of that electricity bill calculation task is lowered.
[0058] In some embodiments, the scheduling server can group the meter data to be processed according to the district bureau, power supply unit, or meter reading section. For example, assuming that the meter data to be processed includes 3 million meter data, 20,000 meter data corresponding to the same power supply unit can be grouped together. A group is also called a job unit, which allows the task execution node to process the meter data of a group in batches. This changes the traditional method of processing all meter data centrally, reduces the task granularity of meter data processing, and allows the task execution node to execute the tasks corresponding to the meters that have a relationship at the same time, reducing the problem of pause caused by task execution failure.
[0059] In this embodiment, when a task does not meet the execution conditions, the execution priority of the task is reduced to reduce the problem of task execution nodes failing to execute due to not meeting the execution conditions and thus pausing. This achieves multi-level feedback scheduling of tasks, ensures high-performance execution of the task set, and improves the efficiency of data processing.
[0060] In some embodiments, step 206 further includes: if the execution is successful based on the execution result, extracting meter-related data from the execution result; creating a task based on the meter-related data; the meter data processing method further includes: if the execution fails based on the execution result, generating an exception message to indicate the execution failure.
[0061] The meter-related data is extracted from the task execution results and used to create tasks for the next processing stage. The meter-related data differs for different processing stages; for example, in the meter reading stage, the data might be the meter reading data, while in the electricity bill calculation stage, it might be the user's electricity consumption and electricity bill. Error messages are used to indicate task execution failure.
[0062] Specifically, if the execution is successful based on the execution result, the scheduling server extracts meter-related data from the task execution result. For example, it extracts meter reading data from the execution result of the meter reading stage task and creates a meter reading accounting task based on the meter reading data. The created meter reading accounting task is then added to the task set corresponding to the meter reading accounting stage. If the execution fails based on the execution result, the scheduling server generates an exception message for the task and can send the exception message to the terminal.
[0063] In some embodiments, the scheduling server will use data in the database and cache to resume tasks that were not scheduled to finish last time, thereby ensuring that scheduling information is not lost when the scheduling server restarts and that it has automatic recovery capabilities.
[0064] In this embodiment, by generating exception message to indicate execution failure, exception notification is implemented, thereby improving the efficiency of exception handling.
[0065] In some embodiments, the meter data processing method further includes: for the first processing stage in the meter data processing chain, obtaining at least one preset task from a pre-created task set; adding the obtained at least one preset task to the task set corresponding to the first processing stage; sending the preset task in the task set to the task execution node corresponding to the first processing stage, so that the task execution node corresponding to the first processing stage executes the preset task and returns the execution result corresponding to the preset task; and creating a task corresponding to the next processing stage of the first processing stage based on the execution result corresponding to the preset task.
[0066] The first processing stage in the electricity meter data processing chain is the meter reading stage. The pre-created task set is the meter reading task set corresponding to the meter reading stage. The preset task is the meter reading task. The task execution node corresponding to the first processing stage is the task execution node corresponding to the meter reading stage.
[0067] Specifically, in response to a meter data processing request, the scheduling server creates multiple meter reading tasks corresponding to the meter data to be processed, resulting in a pre-created task set. For the first processing stage in the meter data processing chain, the server retrieves at least one preset task from the pre-created task set. For example, the scheduling server retrieves a preset number of preset tasks from the pre-created meter reading task set. The preset number is a pre-set number of tasks, which can be set to 20,000. Then, the scheduling server adds the retrieved preset tasks to the task set corresponding to the first processing stage, i.e., the task set corresponding to the meter reading stage, determines the task execution node corresponding to the meter reading stage, and sequentially sends the tasks in the task set corresponding to the meter reading stage to the corresponding task execution node.
[0068] In this embodiment, for the first processing stage of the electricity meter data processing link, at least one preset task is obtained from a pre-created task set and added to the task set corresponding to the first processing stage to start the automatic scheduling of the pipeline, thereby improving the efficiency of electricity meter data processing and thus improving the efficiency of electricity bill reading and collection.
[0069] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0070] Based on the same inventive concept, this application also provides a meter data processing apparatus for implementing the meter data processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more meter data processing apparatus embodiments provided below can be found in the limitations of the meter data processing method described above, and will not be repeated here.
[0071] In some embodiments, such as Figure 5A As shown, an electricity meter data processing device is provided, including: a task grouping module 502, a task scheduling module 504, and a task creation module 506, wherein:
[0072] The task grouping module 502 is used to add the tasks created based on the execution results of the tasks in the previous processing stage to the task set corresponding to each processing stage in the meter data processing link; the meter data processing link includes multiple sequentially arranged processing stages.
[0073] The task scheduling module 504 is used to send tasks from the task set corresponding to the processing stage to the task execution node corresponding to the processing stage, so that the corresponding task execution node can execute the task and return the corresponding execution result.
[0074] The task creation module 506 is used to create tasks based on the execution results, add the created tasks to the task set corresponding to the next processing stage of the processing stage, and remove tasks from the task set corresponding to the processing stage.
[0075] In some embodiments, the task execution node corresponding to the processing stage includes multiple child nodes; the task scheduling module 504 is further configured to: determine the task to be executed from the task set corresponding to the processing stage in sequence; determine the target child node from the multiple child nodes based on the node status corresponding to the multiple child nodes respectively; and send the task to be executed to the target child node.
[0076] In some embodiments, tasks in the task set have execution priorities; the task scheduling module 504 is further configured to: determine candidate tasks from the task set corresponding to the processing stage in sequence according to the execution priority; and determine the candidate task as a task to be executed if the candidate task meets the execution conditions; the execution conditions include at least one of the following: the candidate task has an associated task and the associated task has been completed, or the candidate task does not have an associated task.
[0077] In some embodiments, the meter data processing device further includes a priority adjustment module, which is used to: reduce the execution priority of a candidate task when the candidate task does not meet the execution conditions; and return to the step of determining candidate tasks from the task set corresponding to the processing stage in order of execution priority.
[0078] In some embodiments, the task creation module 506 is further configured to: extract meter-related data from the execution result if the execution is successful based on the execution result; create a task based on the meter-related data; the meter data processing device further includes an exception handling module, which is configured to: generate an exception message to indicate execution failure if the execution is failed based on the execution result.
[0079] In some embodiments, the meter data processing device is further configured to: for the first processing stage in the meter data processing link, obtain at least one preset task from a pre-created task set; add the obtained at least one preset task to the task set corresponding to the first processing stage; send the preset task in the task set to the task execution node corresponding to the first processing stage, so that the task execution node corresponding to the first processing stage executes the preset task and returns the execution result corresponding to the preset task; and create a task corresponding to the next processing stage of the first processing stage based on the execution result corresponding to the preset task.
[0080] In some embodiments, such as Figure 5B As shown, another meter data processing device is provided, including: a data grouping module and an execution processing module, wherein:
[0081] The data grouping module is used for grouping and managing massive amounts of tasks. Through resource balancing, different servers execute different tasks, achieving high-concurrency business processing. It includes: a server configuration management unit, a task grouping management unit, a task thread pool unit, and a business grouping management unit. The server configuration management unit configures internal server parameters, such as CPU and memory parameters, providing the data foundation for task grouping. The task grouping management unit groups tasks according to different task stages and server performance evaluation. The task thread pool unit establishes the task thread pool. The business grouping management unit manages process tasks, maintains detailed business group information, including group name, parent name, description, and the number of processes within the group. It can also modify group information and clean up useless groups.
[0082] The execution processing module is used to schedule and execute grouped tasks, send the execution results of tasks in parallel, and trigger the task scheduling and execution of the next stage. It includes: a task execution unit, a task scheduling unit, a monitoring and scheduling unit, an exception handling unit, and an automatic task scheduling processing unit. The task execution unit executes tasks and generates execution results based on task grouping, task thread pool, and business group configuration, and sends the execution results in parallel to trigger the task scheduling and execution of the next stage. The task scheduling unit dynamically schedules the job queue based on a multi-level feedback algorithm, and downgrades the priority of jobs whose execution time exceeds the configured maximum execution time, job units do not meet the unified calculation requirements for associated users, or job units do not meet the unified issuance requirements. The monitoring and scheduling unit monitors the task execution status of each stage and the statistical and exception information of the execution server group. The exception handling unit, when the scheduling server starts, uses data from the database and cache to restore tasks that were not completed in the previous scheduling, and generates a list of exception users for users who experience exceptions in each business stage. The automatic task scheduling processing unit statistically analyzes and stores the execution results of task scheduling, monitors the metering automation code push status, and automatically triggers automated meter reading core tasks.
[0083] Each module in the aforementioned electricity meter data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0084] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores relevant data related to the meter data processing method. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a meter data processing method.
[0085] In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for processing electricity meter data. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0086] Those skilled in the art will understand that Figure 6 and Figure 7The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0087] In some embodiments, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described electricity meter data processing method.
[0088] In some embodiments, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described meter data processing method.
[0089] In some embodiments, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described electricity meter data processing method.
[0090] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0091] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0092] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0093] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for processing electricity meter data, characterized in that, The method includes: For each processing stage following the first processing stage in the meter data processing chain, the task created based on the execution result of the task in the previous processing stage is added to the task set corresponding to the processing stage. The meter data processing chain includes multiple sequentially arranged processing stages, and the task set corresponding to each processing stage is a queue composed of tasks of the processing stage. The queue composed of tasks of the processing stage includes at least one of the following: meter reading task queue, meter reading verification task queue, and electricity bill calculation task queue. The tasks in the task set corresponding to the processing stage are sent to the task execution node corresponding to the processing stage, so that the corresponding task execution node executes the task and returns the corresponding execution result. The task execution node includes multiple execution servers, and the execution servers included in the task execution nodes corresponding to different processing stages are different. The performance of each execution server is evaluated by the scheduling server. The execution server with larger storage space is used as the task execution node for the meter reading stage, and the execution server with stronger computing power is used as the task execution node for the electricity bill calculation stage. Based on the execution result, a task is created, and the created task is added to the task set corresponding to the next processing stage of the processing stage, and the task is removed from the task set corresponding to the processing stage. The process of creating a task based on the execution result includes: If the execution is successful based on the execution result, extract the relevant data of the electricity meter from the execution result; A task is created based on the meter-related data.
2. The method according to claim 1, characterized in that, The task execution node corresponding to the processing stage includes multiple sub-nodes; Sending tasks from the task set corresponding to the processing stage to the task execution node corresponding to the processing stage includes: The tasks to be executed are determined sequentially from the task set corresponding to the processing stage; Based on the node states corresponding to the plurality of child nodes, the target child node is determined from the plurality of child nodes; The task to be executed is sent to the target child node.
3. The method according to claim 2, characterized in that, The tasks in the task set have execution priorities; the step of determining the tasks to be executed from the task set corresponding to the processing stage in sequence includes: Candidate tasks are determined sequentially from the task set corresponding to the processing stage according to their execution priority; If the candidate task meets the execution conditions, the candidate task is determined as a task to be executed; the execution conditions include at least one of the following: the candidate task has an associated task and the associated task has been completed, or the candidate task does not have an associated task.
4. The method according to claim 3, characterized in that, The method further includes: If the candidate task does not meet the execution conditions, the execution priority of the candidate task shall be reduced. Return to the step of determining candidate tasks from the task set corresponding to the processing stage in order of execution priority.
5. The method according to claim 1, characterized in that, The method further includes: If execution fails based on the execution result, an exception message is generated to indicate the execution failure.
6. The method according to claim 1, characterized in that, The method further includes: For the first processing stage in the meter data processing chain, at least one preset task is obtained from a pre-created task set; Add the at least one preset task obtained to the task set corresponding to the first processing stage; The preset task in the task set is sent to the task execution node corresponding to the first processing stage, so that the task execution node corresponding to the first processing stage executes the preset task and returns the execution result corresponding to the preset task; Based on the execution result of the preset task, create the task corresponding to the next processing stage of the first processing stage.
7. A data processing device for electricity meters, characterized in that, The device includes: The task grouping module is used to add tasks created based on the execution results of the tasks in the previous processing stage to the task set corresponding to the processing stage for each processing stage after the first processing stage in the meter data processing link. The meter data processing link includes multiple sequentially arranged processing stages, and the task set corresponding to each processing stage is a queue composed of the tasks of the processing stage. The task scheduling module is used to send tasks from the task set corresponding to the processing stage to the task execution node corresponding to the processing stage, so that the corresponding task execution node executes the task and returns the corresponding execution result. The task execution node includes multiple execution servers, and the execution servers included in the task execution nodes corresponding to different processing stages are different. The performance of each execution server is evaluated by the scheduling server, and the execution server with larger storage space is used as the task execution node corresponding to the meter reading stage, and the execution server with stronger computing power is used as the task execution node for the electricity bill calculation stage. The task creation module is used to create a task based on the execution result, add the created task to the task set corresponding to the next processing stage of the processing stage, and remove the task from the task set corresponding to the processing stage. The task creation module is also used to extract meter-related data from the execution result if the execution is successful based on the execution result; and to create a task based on the meter-related data.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Electric charge reading and checking business automatic processing system and method based on distributed calculation
CN112330320A
Data task scheduling method and device, storage medium and scheduling tool
CN112749221A
Task scheduling method and device and computer readable storage medium
CN113238838A