Low-voltage electricity utilization information acquisition method and device, electronic equipment and storage medium
By determining the completion rate of the thread pool in the power grid system and reassigning low-priority tasks, the problem of difficult to complete low-priority tasks is solved, and the timely completion of tasks and timely viewing of results is achieved.
Patent Information
- Application Number
- CN202510145791.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-05-30
AI Technical Summary
Traditional methods in power grid systems have made it difficult to complete low-priority tasks and the results of low-priority tasks cannot be viewed in time.
By determining the completion rate of each task corresponding to the thread pool, if there are low-priority tasks, the target threads are filtered in the high-priority tasks and reassigned these low-priority tasks to improve their processing efficiency.
It realizes the timely completion of low-priority tasks, improves the overall completion rate of tasks, and ensures timely viewing of the results of low-priority tasks.
Smart Images

Figure CN120066719A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data acquisition, and particularly to a method, device, electronic device and storage medium for collecting low-voltage electricity consumption information. Background Art
[0002] With the continuous upgrading of the power grid system, the power grid system has a more comprehensive data acquisition range for each electric energy meter, thereby realizing the intelligent development of the power grid.
[0003] However, the wider the data acquisition range, the more inevitable it is to increase the difficulty of data acquisition and the dependence on data acquisition efficiency. The traditional method divides tasks into priorities to ensure data acquisition efficiency, and processes high-priority tasks first and then low-priority tasks. This results in the long-term inability to complete low-priority tasks and the inability to view the results of low-priority tasks in a timely manner. Summary of the Invention
[0004] The present invention provides a method, device, electronic device and storage medium for collecting low-voltage electricity consumption information to solve the problem that it is difficult to complete low-priority tasks.
[0005] According to one aspect of the present invention, there is provided a method for collecting low-voltage electricity consumption information, the method comprising:
[0006] Determine the completion rate of each first task corresponding to the thread pool; the first task is a task that has been processed in the thread pool; the task is a task of pre-determining to read data of at least one electric energy meter for the electric energy meter;
[0007] If there is a second task among the first tasks, determine a third task among the first tasks; the second task is a task with a task completion efficiency lower than a preset efficiency and a task priority lower than a preset priority; the third task is a task with a task priority higher than the preset priority and a task completion efficiency higher than the preset efficiency;
[0008] Determine at least one target thread, and process the second task based on each target thread; the target thread is a thread used to complete the third task; the target thread is selected from the threads executing the third task.
[0009] According to another aspect of the present invention, there is provided a device for collecting low-voltage electricity consumption information, the device comprising:
[0010] A completion rate determination module, configured to determine the completion rate of each first task corresponding to the thread pool; the first task is a task that has been processed in the thread pool; the task is a task of pre-determining to read data of at least one electric energy meter for the electric energy meter;
[0011] A third task determination module, configured to determine a third task among each first task if there is a second task in each first task; the second task is a task with a task completion efficiency lower than a preset efficiency and a task priority lower than a preset priority; the third task is a task with a task priority higher than a preset priority and a task completion efficiency higher than a preset efficiency.
[0012] A thread conversion module, configured to determine at least one target thread, and process the second task based on each target thread; the target thread is a thread used to complete the third task; the target thread is screened from the threads executing the third task.
[0013] According to another aspect of the present invention, there is provided an electronic device, including:
[0014] At least one processor; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the low-voltage power consumption information acquisition method according to any embodiment of the present invention.
[0017] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the low-voltage power consumption information acquisition method according to any embodiment of the present invention when executed.
[0018] The technical solution of the embodiment of the present invention realizes interspersing low-priority tasks into high-priority tasks for processing by determining the completion rate of each first task corresponding to the thread pool; if there is a second task in each first task, determining a third task in each first task; determining at least one target thread, and processing the second task based on each target thread, thereby ensuring that the processing of low-priority tasks can also be completed in a timely manner, and thus ensuring the overall completion rate of tasks.
[0019] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 is a flowchart of a low - voltage power consumption information collection method provided by Embodiment 1 of the present invention;
[0022] Figure 2 is a flowchart of another low - voltage power consumption information collection method provided by Embodiment 2 of the present invention;
[0023] Figure 3 is a schematic structural diagram of a low - voltage power consumption information collection device provided by Embodiment 3 of the present invention;
[0024] Figure 4 is a schematic structural diagram of an electronic device for implementing the low - voltage power consumption information collection method of the embodiments of the present invention. Detailed implementation manners
[0025] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above - mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order different from those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non - exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0027] Embodiment 1
[0028] Figure 1 A flowchart of a low - voltage power consumption information collection method is provided for Embodiment 1 of the present invention. This embodiment is applicable to the situation where low - priority tasks are difficult to complete due to their low priority. This method can be executed by a low - voltage power consumption information collection device, which can be implemented in the form of hardware and / or software and can be configured in an electronic device with data - processing capabilities. As Figure 1 shown, the method includes:
[0029] S110. Determine the completion rate of each first task corresponding to the thread pool.
[0030] The first task is a task that has been processed in the thread pool; the task is a pre-determined task of reading electricity meters for at least one electricity meter data.
[0031] The completion rate can be used to describe the degree of completion of the first task at a certain moment. The first task can be a task processed in the thread pool. The task can be to read data from low-voltage electricity meters in the area. The electricity meter data includes but is not limited to voltage, current, and power, etc. The thread pool can be understood as a set composed of multiple threads. In this thread pool, each thread can obtain at least one item of data, such as obtaining current or obtaining voltage, etc.
[0032] In the past, when reading voltage meters, due to certain differences in the priorities of the tasks themselves, when reading, tasks with lower priorities often have low completion rates due to priority issues. And because tasks with lower priorities are at the end in the execution order, therefore, when viewing the processing results of low-priority tasks, it often takes a long time. Therefore, how to improve the processing efficiency of low-priority tasks and ensure the completion rate of low-priority tasks has become a problem in the processing.
[0033] Therefore, in the processing process, this application introduces the concept of completion rate. When low-priority tasks are queuing and waiting, the completion rate of low-priority tasks will be calculated. If the completion rate is lower than the preset value, it indicates that the low-priority task may not be completed. It is necessary to adjust the task order in a timely manner, and which task's order to adjust also needs to be determined through the completion rate. Therefore, it is necessary to determine the completion rate of each first task corresponding to the thread pool.
[0034] S120. If there is a second task among the first tasks, determine a third task among the first tasks.
[0035] The second task is a task with a task completion efficiency lower than the preset efficiency and a task priority lower than the preset priority; the third task is a task with a task priority higher than the preset priority and a task completion efficiency higher than the preset efficiency.
[0036] In the thread pool, not only one task is processed, but multiple tasks are processed together. For example, in a thread pool with 50 threads, 5 threads may be allocated to process task A, 5 threads to process task B, and the remaining 40 threads are dynamically increased or decreased according to the progress of task processing. Thus, while ensuring the processing efficiency, it avoids overloading the processing device.
[0037] In a thread pool, if there are multiple first tasks, each first task can be detected to find the second tasks and third tasks among them. Among them, the second task is a task with a task completion efficiency lower than the preset efficiency and a task priority lower than the preset priority; the third task is a task with a task priority higher than the preset priority and a task completion efficiency higher than the preset efficiency.
[0038] The second task is a low-priority task that needs to improve the processing efficiency and be completed as soon as possible. The third task is a high-priority task with a high completion rate and can be paused.
[0039] S130. Determine at least one target thread, and based on each target thread, process the second task.
[0040] The target thread is a thread used to complete the third task; the target thread is selected from the threads executing the third task.
[0041] When obtaining the adjusted thread, it is necessary to determine which threads can be allocated to process the second task. Therefore, it is necessary to select from the threads executing the third task to determine which threads can process the second task. When determining the target thread, threads that have completed the task or can be paused can be used as the target thread to process the second task. The determination of the target thread can be set according to different situations.
[0042] In an alternative solution, after processing the second task based on each target thread, it further includes steps A1 - A3:
[0043] Step A1. If the second task cannot be completed by the task deadline, determine the maximum number of threads in the thread pool and the current number of running threads.
[0044] Step A2. Determine the first quantity according to the maximum number of threads and the current number of running threads.
[0045] Step A3. Start the first quantity of threads to execute the second task.
[0046] After processing the second task, it can be judged whether the second task can be completed in time after adding the target thread. If it still cannot be completed in time, it can be considered to let the spare or restricted threads process it.
[0047] Since different thread pools can accommodate different numbers of threads, it is necessary to determine the maximum number of threads in the thread pool and the current number of running threads. Through the maximum number of threads and the current number of running threads, determine the specific number of threads that can be provided, that is, the first quantity. And start the first quantity of threads to execute the second task.
[0048] In an alternative solution, determining a first quantity according to the maximum number of threads and the current number of running threads may include steps B1 - B2:
[0049] Step B1: If the difference in the number of threads is less than a second preset difference in the number of threads, then determine the difference in the number of threads as the first quantity; the difference in the number of threads is the difference between the maximum number of threads and the current number of running threads.
[0050] Step B2: If the difference in the number of threads is greater than the second preset difference in the number of threads, then determine the second preset difference in the number of threads as the first quantity.
[0051] When determining the first quantity, there are two cases. One is that the number of threads that can be provided is greater than the second preset difference in the number of threads, that is, the remaining threads can provide the same number of threads as the second preset difference in the number of threads. The other is that the number of threads that can be provided is less than the second preset difference in the number of threads, that is, the remaining threads cannot provide the same number of threads as the second preset difference in the number of threads.
[0052] For the first case, the same number of threads as the second preset difference in the number of threads can be directly provided. For the second case, only the remaining threads can be all provided for the second task to process.
[0053] Optionally, after starting the first quantity of threads to execute the second task, it further includes:
[0054] If the second task cannot be completed by the task deadline, then adjust the number of threads of the second task to a first preset quantity, and the preset quantity is the default number of threads allocated at the start of the task.
[0055] After providing new threads, if the second task still cannot be completed by the task deadline, it indicates that the second task cannot be completed under the existing threads. To avoid waste of threads, the focus will no longer be on the second task, but rather the number of threads of the second task will be adjusted to the initial default allocated number of threads. The other threads will be given to other tasks for processing.
[0056] Adopting the technical solution of the present application, by determining the completion rate of each first task corresponding to the thread pool; if there is a second task among each first task, then determining a third task among each first task; determining at least one target thread, and processing the second task based on each target thread, it realizes that low - priority tasks are interspersed into high - priority tasks for processing, thereby ensuring that the processing of low - priority tasks can also be completed in a timely manner, and thus ensuring the overall completion rate of the tasks.
[0057] Embodiment 2
[0058] Figure 2The present invention provides a flowchart of another low-voltage power consumption information acquisition method. Based on the foregoing embodiments, this embodiment further optimizes the process of determining at least one target thread in the foregoing embodiments, and this embodiment can be combined with various alternative solutions in the foregoing one or more embodiments. As Figure 2 shown, the low-voltage power consumption information acquisition method of this embodiment may include the following steps:
[0059] S210. Determine the completion rate of each first task corresponding to the thread pool.
[0060] The first task is a task that has been processed in the thread pool; the task is to pre-determine to read the electric energy meter for at least one electric energy meter data.
[0061] S220. If there is a second task among the first tasks, then determine a third task among the first tasks.
[0062] The second task is a task with a task completion efficiency lower than the preset efficiency and a task priority lower than the preset priority; the third task is a task with a task priority higher than the preset priority and a task completion efficiency higher than the preset efficiency.
[0063] S230. If there is at least one first thread in the corresponding thread of the third task, then use each first thread as the target thread.
[0064] The first thread is a thread that has completed the work assigned to it by the third task.
[0065] When determining the target thread, since the threads executing the tasks do not end at the same time, the reason is that the task sends the acquisition requirements to each thread, and each thread obtains them separately. Due to network problems, the completion times of each thread are different. Therefore, if there is a first thread, the first thread can be directly used as the target thread.
[0066] Optionally, determining at least one target thread includes:
[0067] If there is at least one second thread in the corresponding thread of the third task, then use each second thread as the target thread.
[0068] The second thread is a thread with a completion rate of the work assigned to it by the third task greater than the preset completion rate.
[0069] During task processing, since different tasks have different priorities, tasks with higher priorities are often processed first. For this, these threads with a completion rate greater than the preset completion rate and belonging to the third task can be paused and used as the target threads.
[0070] Optionally, determining at least one target thread includes:
[0071] If there is at least one third thread in the corresponding threads of the third task, each second thread is used as a target thread.
[0072] The third thread is a thread whose work assigned by the third task is completed after a preset time.
[0073] In addition to the previous two cases, there is a third case, that is, the thread will complete the task of the thread after a preset time. At this time, the thread can be processed normally, and the thread is used as a target thread after the processing is completed.
[0074] S240. Process the second task based on each target thread.
[0075] Adopting the technical solution of the present application, if there is at least one first thread in the corresponding threads of the third task, each first thread is used as a target thread, which clarifies the determination conditions and judgment basis of the target thread, thereby ensuring the reasonable selection of the target thread, and further ensuring that while adjusting the target thread, the execution of high-priority tasks is not affected as much as possible.
[0076] Embodiment III
[0077] Figure 3 This embodiment of the present invention provides a structural block diagram of a low-voltage power consumption information acquisition device. This embodiment is applicable to the situation where low-priority tasks are difficult to complete due to their low task priorities. The low-voltage power consumption information acquisition device can be implemented in the form of hardware and / or software, and the low-voltage power consumption information acquisition device can be configured in an electronic device with data processing capabilities. As Figure 3 shown, the low-voltage power consumption information acquisition device of this embodiment may include: a completion rate determination module 310, a third task determination module 320, and a thread conversion module 330. Among them:
[0078] The completion rate determination module 310 is used to determine the completion rate of each first task corresponding to the thread pool; the first task is a task that has been processed in the thread pool; the task is a task of pre-determining to read data of at least one electric energy meter;
[0079] The third task determination module 320 is used to determine a third task among each first task if there is a second task among each first task; the second task is a task whose task completion efficiency is lower than a preset efficiency and whose task priority is less than a preset priority; the third task is a task whose task priority is greater than a preset priority and whose task completion efficiency is higher than a preset efficiency;
[0080] A thread conversion module 330 is configured to determine at least one target thread and process the second task based on each target thread; the target thread is a thread used to complete the third task; the target thread is selected from the threads executing the third task.
[0081] Based on the above embodiments, optionally, after the thread conversion module 330, further included is:
[0082] If the second task cannot be completed by the task deadline, determine the maximum number of threads in the thread pool and the current number of running threads;
[0083] Determine a first quantity according to the maximum number of threads and the current number of running threads;
[0084] Start the first quantity of threads to execute the second task.
[0085] Based on the above embodiments, optionally, after starting the first quantity of threads to execute the second task, further included is:
[0086] If the second task cannot be completed by the task deadline, adjust the number of threads of the second task to a first preset quantity, where the preset quantity is the default number of allocated threads at the start of the task.
[0087] Based on the above embodiments, optionally, determining the first quantity according to the maximum number of threads and the current number of running threads includes:
[0088] If the difference in the number of threads is less than a second preset difference in the number of threads, determine the difference in the number of threads as the first quantity; the difference in the number of threads is the difference between the maximum number of threads and the current number of running threads;
[0089] If the difference in the number of threads is greater than the second preset difference in the number of threads, determine the second preset difference in the number of threads as the first quantity.
[0090] Based on the above embodiments, optionally, the thread conversion module 330 includes:
[0091] If there is at least one first thread among the corresponding threads in the third task, use each first thread as a target thread; the first thread is a thread that has completed the work assigned to it by the third task.
[0092] Based on the above embodiments, optionally, the thread conversion module 330 includes:
[0093] If there is at least one second thread among the corresponding threads in the third task, use each second thread as a target thread; the second thread is a thread whose completion rate of the work assigned to it by the third task is greater than a preset completion rate.
[0094] Based on the above embodiments, optionally, the thread conversion module 330 includes:
[0095] If there is at least one third thread in the corresponding threads of the third task, each second thread is used as a target thread; the third thread is a thread for which the work assigned by the third task to this thread is completed after a preset time.
[0096] The low-voltage power consumption information acquisition device provided by the embodiments of the present invention can execute the low-voltage power consumption information acquisition method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.
[0097] Embodiment 4
[0098] Figure 4 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device (such as a helmet, glasses, a watch, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present invention described herein and / or claimed.
[0099] As Figure 4 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by the at least one processor, and the processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0100] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0101] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the low-voltage power consumption information acquisition method.
[0102] In some embodiments, the low-voltage power consumption information acquisition method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the low-voltage power consumption information acquisition method described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the low-voltage power consumption information acquisition method by any other suitable means (e.g., by means of firmware).
[0103] The various embodiments of the systems and technologies described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0104] A computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, a special purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on a remote machine or server.
[0105] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0106] In order to provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0107] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected with each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0108] A computing system can include a client and a server. The client and the server are generally remote from each other and typically interact via a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0109] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is imposed herein.
[0110] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for collecting low-voltage electricity consumption information, characterized in that: include: Determine the completion rate of each first task corresponding to the thread pool; the first task is a task that has been processed in the thread pool; The task is to read the electric energy meter predetermined to be at least one electric energy meter data; If there is a second task in each of the first tasks, a third task is determined in each of the first tasks; the second task is a task whose task completion efficiency is lower than a preset efficiency and whose task priority is lower than a preset priority; the third task is a task whose task priority is higher than a preset priority and whose task completion efficiency is higher than a preset efficiency; Determine at least one target thread, and process the second task based on each target thread; The target thread is a thread used to complete the third task; The target thread is obtained by screening out threads executing the third task.
2. The method according to claim 1, characterized in that After processing the second task based on each target thread, the method further includes: If the second task cannot be completed within the task deadline, determining the maximum number of threads in the thread pool and the number of currently running threads; Determine a first number according to the maximum number of threads and the number of currently running threads; A first number of threads are started to execute the second task.
3. The method according to claim 2, characterized in that After starting the first number of threads to execute the second task, the method further includes: If the second task cannot be completed within the task deadline, the number of threads of the second task is adjusted to a first preset number, where the preset number is the default number of threads allocated when the task starts.
4. The method according to claim 2, characterized in that: Determining a first quantity according to the maximum number of threads and the number of currently running threads includes: If the difference in the number of threads is less than a second preset difference in number, determining the difference in the number of threads to be the first number; the difference in the number of threads is the difference between the maximum number of threads and the number of currently running threads; If the thread quantity difference is greater than a second preset quantity difference, the second preset quantity difference is determined to be the first quantity.
5. The method according to claim 1, characterized in that Determine at least one target thread, including: If there is at least one first thread among the threads corresponding to the third task, each first thread is used as a target thread; the first thread is a thread that has completed the work assigned to the thread by the third task.
6. The method according to claim 1, characterized in that Determine at least one target thread, including: If there is at least one second thread in the threads corresponding to the third task, each second thread is used as a target thread; the second thread is a thread whose completion rate of the work assigned to the thread by the third task is greater than a preset completion rate.
7. The method according to claim 1, characterized in that Determine at least one target thread, including: If there is at least one third thread in the threads corresponding to the third task, each second thread is used as a target thread; the third thread is a thread for which the work assigned to the thread by the third task is completed after a preset time.
8. A low voltage electricity information collection device, characterized in that: include: A completion rate determination module, used to determine the completion rate of each first task corresponding to the thread pool; the first task is a task that has been processed in the thread pool; The task is to read the electric energy meter predetermined to be at least one electric energy meter data; A third task determination module is used to determine a third task in each of the first tasks if there is a second task in each of the first tasks; the second task is a task whose task completion efficiency is lower than a preset efficiency and whose task priority is lower than a preset priority; the third task is a task whose task priority is higher than the preset priority and whose task completion efficiency is higher than the preset efficiency; A thread conversion module, used for determining at least one target thread and processing the second task based on each target thread; The target thread is a thread used to complete the third task; The target thread is obtained by screening out threads executing the third task.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the low-voltage electricity consumption information collection method described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the low-voltage electricity consumption information collection method according to any one of claims 1 to 7 when executed.