System resource scheduling method and device of power terminal equipment, and power terminal equipment

By dynamically monitoring the system resource occupancy rate in the power terminal equipment and sending a message to the application that occupies a lot of resources, the problem of heating and crash caused by the high resource occupancy rate of the power terminal equipment system is solved, and the effect of reducing the system resource occupancy rate and heat generation is achieved, and the stability of the equipment is improved.

CN119988003APending Publication Date: 2025-05-13SHENZHEN CLOU ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510018263.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-05-13

Smart Images

  • Figure CN119988003A_ABST
    Figure CN119988003A_ABST
Patent Text Reader

Abstract

The invention provides a system resource scheduling method and device of power terminal equipment and the power terminal equipment, and relates to the technical field of the power terminal equipment. The method comprises the steps that under the condition that the power terminal equipment runs at least one application program, the occupancy rate of system resources of the power terminal equipment is acquired; under the condition that the occupancy rate is greater than an occupancy rate threshold value, determining a target application program in the at least one application program; sending a first message to the target application program; wherein the first message is used for indicating the target application program to reduce the occupation of system resources. In the operation process of the power terminal equipment, the system resource occupancy rate of the power terminal equipment is dynamically monitored, and when the system resource occupancy rate of the power terminal equipment is high, part of occupied system resources are released by sending the first message to part of the application programs, so that the purposes of reducing the system resource occupancy rate and improving the system resource utilization rate are achieved. Therefore, the operation stability of the power terminal equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of power terminal equipment, and in particular to a system resource scheduling method and device for power terminal equipment, and power terminal equipment. Background Art

[0002] In the related technology, power terminal equipment is used to realize functions such as data collection, monitoring and control, and thus plays a vital role in the power system. In order to realize these functions, multiple applications need to be run on the power terminal equipment at the same time, and different functions are realized through different applications.

[0003] As the functional requirements for power terminal equipment increase, the number of applications that need to run simultaneously on power terminal equipment also increases. This leads to high utilization of system resources on power terminal equipment, overheating and system crashes, and affects stability. Summary of the invention

[0004] The present application aims to solve at least one of the technical problems existing in the prior art or related art.

[0005] To this end, the first aspect of the present application proposes a system resource scheduling method for power terminal equipment.

[0006] A second aspect of the present application provides a system resource scheduling device for power terminal equipment.

[0007] A third aspect of the present application provides a system resource scheduling device for a power terminal device.

[0008] A fourth aspect of the present application provides a readable storage medium.

[0009] A fifth aspect of the present application provides a power terminal device.

[0010] In view of this, the first aspect of the present application provides a system resource scheduling method for a power terminal device, the method comprising: when the power terminal device runs at least one application, obtaining the occupancy rate of the system resources of the power terminal device; when the occupancy rate is greater than an occupancy rate threshold, determining a target application from at least one application; and sending a first message to the target application; wherein the first message is used to instruct the target application to reduce its occupancy of system resources.

[0011] In this technical solution, the power terminal equipment includes but is not limited to electric energy meters, electric metering equipment, power metering equipment, etc. The power terminal equipment can collect, monitor and control the power consumption data of power-consuming equipment and power-consuming units according to demand. In order to achieve the above functions, the power terminal equipment installs and runs the corresponding system and application program.

[0012] When the power terminal device runs applications, these applications will occupy the system resources of the power terminal device, where the system resources include but are not limited to the processor (Central Processing Unit, CPU), memory (Random Access Memory, RAM), etc. When the power terminal device runs more applications, the total system resources required by these applications are also higher. However, the system resources of the power terminal device are limited. As the occupancy rate of system resources increases, the heat generated by the CPU and memory of the power terminal device will also increase, which will cause the temperature of the CPU or memory to rise. When the temperature is too high, it is easy to cause adverse effects such as system crashes.

[0013] In response to the above problems, the present application proposes a system resource scheduling method for a power terminal device, which can schedule resources for one or more applications running on the power terminal device based on the real-time occupancy rate of the system resources of the power terminal device, thereby releasing some of the occupied system resources, thereby reducing the system resource occupancy rate and reducing the heat generation problem.

[0014] For example, taking the case where the power terminal device runs Linux (a UNIX-like operating system) or other operating systems developed based on Linux, when the power terminal device runs one or more applications, the current occupancy rate of the system resources of the power terminal device is obtained in real time according to the set acquisition cycle, and it is determined whether the current occupancy rate exceeds the preset occupancy rate threshold.

[0015] For example, the power terminal equipment executes Linux system commands such as top or vmstat (commands used to report statistical information about kernel threads, virtual memory, disks, traps, and CPU activities) once every 10 minutes to obtain the system resource occupancy of the power terminal equipment, thereby obtaining information on the utilization rate of the implemented system resources.

[0016] When it is detected that the occupancy rate is greater than the preset occupancy rate threshold, it is determined that the system load of the power terminal device is large at this time, and a target application is determined in the applications currently in operation. Exemplarily, the target application may be an application that occupies more system resources. Exemplarily, the target application may be an application of lower importance.

[0017] After determining the target application, by sending a first message to the target application, the target application that receives the first message actively reduces its occupancy of system resources, thereby releasing some system resources, reducing the occupancy rate of the system resources of the power terminal device, and further reducing the heat generated by the CPU and memory of the power terminal device.

[0018] Exemplarily, the first message may be an MQTT (Message Queuing Telemetry Transport) message.

[0019] The present application dynamically monitors the system resource occupancy rate of the power terminal device during its operation, and when the system resource occupancy rate of the power terminal device is high, releases some of the occupied system resources by sending a first message to some applications, thereby achieving the purpose of reducing the system resource occupancy rate, reducing equipment heat generation, and improving the operating stability of the power terminal device.

[0020] In addition, the system resource scheduling method in the above technical solution provided by this application may also have the following additional technical features:

[0021] In some technical solutions of the present application, optionally, before obtaining the occupancy rate of system resources of the power terminal device, the method also includes: obtaining the occupancy of system resources by each application; sorting the applications in order from large to small according to the occupancy to obtain an application list; determining a target application from at least one application, including: determining the first N applications in the application list as target applications; N is a positive integer.

[0022] In this technical solution, the applications of the power terminal device include system applications and functional applications. Among them, the system applications are applications necessary for the power terminal device to work, which are of high importance, and the system resources occupied by these applications are generally not scheduled. Functional applications are applications that run to achieve specific functions, and the technical solution of this application mainly schedules resources for functional applications.

[0023] Exemplarily, the power terminal device sets functional applications as applications to be detected, and stores the program names or program identifiers of these applications in a list to obtain a list of applications to be monitored. Exemplarily, the list of applications to be monitored is recorded as a first list.

[0024] Whenever the power terminal device runs an application in the first list, the power terminal device continuously detects the running status of the application, thereby obtaining the system resources occupied by each running application.

[0025] At the same time, the system of the power terminal device sorts the running applications according to the order of the amount of system resources occupied by each running application from large to small, and obtains another application list. Exemplarily, this application records this application list as the second list.

[0026] When it is determined that the occupancy rate of the system resources exceeds the occupancy rate threshold, the N applications with the highest occupancy of the system resources are selected from the second list as the target objects of this system resource scheduling, i.e., the target applications. The first message is sent to the N target applications to allow them to release the occupied system resources, thereby reducing the heat generated by the device.

[0027] Exemplarily, N=1. Exemplarily, N=2. Exemplarily, N=3. Exemplarily, N=4.

[0028] In some technical solutions of the present application, optionally, before obtaining the amount of system resources occupied by each application, the method also includes: creating a first thread and a second thread; wherein the first thread is used to obtain the amount of system resources occupied by each application and generate an application list; the second thread is used to obtain the occupancy rate of system resources of the power terminal device and send a first message to the target application.

[0029] In this technical solution, after the power terminal device is started, the power terminal device first creates two independent threads, namely the first thread and the second thread. The program name or program identifier of the application to be detected is stored in a list through the first thread to obtain a first list.

[0030] Whenever an application in the first list starts running, the first thread will also monitor the application, periodically execute Linux commands such as top or vmstat, analyze the amount of system resources occupied by the monitored application, and sort the applications according to the amount of system resources occupied to obtain the above application list.

[0031] The second thread is used to periodically read the information in the application list and determine whether the system resources of the current power terminal device, including the CPU occupancy rate and the memory occupancy rate, exceed the set occupancy rate threshold. When it is determined that the occupancy rate of the system resources exceeds the occupancy rate threshold, the N applications in the application list that occupy the highest amount of system resources are determined as target applications. The second thread sends a first message to the target application, so that the target application that receives the first message reduces the occupancy of system resources, thereby realizing dynamic scheduling of system resources.

[0032] The present application dynamically schedules the system resources of the power terminal device by creating an independent first thread and a second thread, thereby reducing the heat generated by the power terminal device and improving the reliability and stability of the power terminal device.

[0033] In some technical solutions of the present application, optionally, the power terminal device also includes a third thread, and the third thread is used to run the target application; after sending the first message to the target application, the method includes: controlling the third thread to reduce the running frequency.

[0034] In this technical solution, the third thread is specifically a thread allocated to the target application program. The third thread runs the target application program at a fixed running frequency, thereby realizing the program function corresponding to the target application program.

[0035] When the target application receives the first message, the third thread actively increases the periodic running time, thereby reducing the running frequency of the target application, thereby reducing the target application's occupation of system resources such as CPU and memory.

[0036] In some technical solutions of the present application, optionally, the target application is associated with at least one functional thread; after sending a first message to the target application, the method includes: controlling the target application to send a second message to the functional thread; wherein the second message is used to instruct the functional thread to reduce the operating frequency.

[0037] In this technical solution, the target application may have one or more program functions, wherein each independent program function corresponds to an independent function thread. When the target application receives the above-mentioned first message, the target application sends a second message to each function thread associated with itself, thereby reducing the running frequency of these function threads, so that the target application can reduce the occupation of system resources such as CPU and memory.

[0038] In some technical solutions of the present application, optionally, the power terminal equipment includes a message queue telemetry transmission agent module; the first message is a message queue telemetry transmission message; sending the first message to the target application includes: sending the first message to the target application through the message queue telemetry transmission agent module.

[0039] In this technical solution, taking the power terminal equipment running the Linux operating system as an example, the power terminal equipment implements the MQTT function through the message queue telemetry transmission agent module. When it is detected that the current system resource occupancy rate of the power terminal equipment exceeds the preset occupancy rate threshold, the MQTT agent module sends MQTT messages to the first N target applications in the application list, that is, the first message mentioned above. These target applications are controlled to reduce the operating frequency through MQTT messages, thereby reducing the occupancy of system resources, reducing system heating, and improving the operating stability of the power terminal equipment.

[0040] The second aspect of the present application provides a system resource scheduling device for an electric terminal device, comprising: an acquisition module, used to acquire the occupancy rate of the system resources of the electric terminal device when the electric terminal device runs at least one application; a determination module, used to determine a target application in at least one application when the occupancy rate is greater than an occupancy rate threshold; a sending module, used to send a first message to the target application; wherein the first message is used to instruct the target application to reduce its occupancy of system resources.

[0041] In this technical solution, the power terminal equipment includes but is not limited to electric energy meters, electric metering equipment, power metering equipment, etc. The power terminal equipment can collect, monitor and control the power consumption data of power-consuming equipment and power-consuming units according to demand. In order to achieve the above functions, the power terminal equipment installs and runs the corresponding system and application program.

[0042] When the power terminal device runs applications, these applications will occupy the system resources of the power terminal device, where the system resources include but are not limited to the processor (Central Processing Unit, CPU), memory (Random Access Memory, RAM), etc. When the power terminal device runs more applications, the total system resources required by these applications are also higher. However, the system resources of the power terminal device are limited. As the occupancy rate of system resources increases, the heat generated by the CPU and memory of the power terminal device will also increase, which will cause the temperature of the CPU or memory to rise. When the temperature is too high, it is easy to cause adverse effects such as system crashes.

[0043] In response to the above problems, the present application proposes a system resource scheduling method for a power terminal device, which can schedule resources for one or more applications running on the power terminal device based on the real-time occupancy rate of the system resources of the power terminal device, thereby releasing some of the occupied system resources, thereby reducing the system resource occupancy rate and reducing the heat generation problem.

[0044] For example, taking the case where the power terminal device runs Linux (a UNIX-like operating system) or other operating systems developed based on Linux, when the power terminal device runs one or more applications, the current occupancy rate of the system resources of the power terminal device is obtained in real time according to the set acquisition cycle, and it is determined whether the current occupancy rate exceeds the preset occupancy rate threshold.

[0045] For example, the power terminal equipment executes Linux system commands such as top or vmstat (commands used to report statistical information about kernel threads, virtual memory, disks, traps, and CPU activities) once every 10 minutes to obtain the system resource occupancy of the power terminal equipment, thereby obtaining information on the utilization rate of the implemented system resources.

[0046] When it is detected that the occupancy rate is greater than the preset occupancy rate threshold, it is determined that the system load of the power terminal device is large at this time, and a target application is determined in the applications currently in operation. Exemplarily, the target application may be an application that occupies more system resources. Exemplarily, the target application may be an application of lower importance.

[0047] After determining the target application, by sending a first message to the target application, the target application that receives the first message actively reduces its occupancy of system resources, thereby releasing some system resources, reducing the occupancy rate of the system resources of the power terminal device, and further reducing the heat generated by the CPU and memory of the power terminal device.

[0048] Exemplarily, the first message may be an MQTT (Message Queuing Telemetry Transport) message.

[0049] The present application dynamically monitors the system resource occupancy rate of the power terminal device during its operation, and when the system resource occupancy rate of the power terminal device is high, releases some of the occupied system resources by sending a first message to some applications, thereby achieving the purpose of reducing the system resource occupancy rate, reducing equipment heat generation, and improving the operating stability of the power terminal device.

[0050] The third aspect of the present application provides a system resource scheduling device for an electric power terminal device, comprising: a memory for storing programs or instructions; a processor for implementing the steps of the system resource scheduling method for an electric power terminal device provided in any of the above-mentioned technical solutions when executing the programs or instructions, thereby being able to achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0051] The fourth aspect of the present application provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the system resource scheduling method for power terminal equipment provided in any of the above technical solutions are implemented, and thus the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0052] The fifth aspect of the present application provides an electric power terminal device, including a system resource scheduling device for the electric power terminal device as provided in any of the above technical solutions; and / or a readable storage medium as provided in any of the above technical solutions, and therefore also has the same technical effect, and will not be repeated here to avoid repetition. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0054] Figure 1 A flowchart showing a method for scheduling system resources of a power terminal device in some embodiments of the present application;

[0055] Figure 2 A flowchart showing a method for scheduling system resources of a power terminal device in some embodiments of the present application;

[0056] Figure 3 A system thread operation flow chart of a power terminal device in some embodiments of the present application is shown;

[0057] Figure 4 A flowchart showing a first thread of a power terminal device in some embodiments of the present application;

[0058] Figure 5 A flowchart showing a second thread of a power terminal device in some embodiments of the present application;

[0059] Figure 6 A schematic diagram showing system threads of power terminal equipment in some embodiments of the present application is shown;

[0060] Figure 7 A flowchart showing the operation of an application program in some embodiments of the present application is shown;

[0061] Figure 8 A flowchart showing the operation of the functional threads of some embodiments of the present application is shown;

[0062] Fig. 9 A schematic diagram of MTQQ message forwarding in some embodiments of the present application is shown;

[0063] Fig.10 A structural block diagram showing a system resource scheduling device for a power terminal device in some embodiments of the present application;

[0064] Fig.11 A structural block diagram of a system resource scheduling device for a power terminal device in some embodiments of the present application is shown. DETAILED DESCRIPTION

[0065] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0066] In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present application is not limited to the specific embodiments disclosed below.

[0067] Refer to the following Figures 1 to 11 A system resource scheduling method and apparatus for power terminal equipment and power terminal equipment according to some embodiments of the present application are described.

[0068] In some embodiments of the present application, a system resource scheduling method for a power terminal device is provided. Figure 1 A flowchart of a system resource scheduling method for a power terminal device in some embodiments of the present application is shown. Figure 1 As shown, the method includes:

[0069] Step 102, when the power terminal device runs at least one application, obtaining the occupancy rate of the system resources of the power terminal device;

[0070] Step 104, when the occupancy rate is greater than the occupancy rate threshold, determining a target application from at least one application;

[0071] Step 106, sending a first message to the target application; wherein the first message is used to instruct the target application to reduce the occupation of system resources.

[0072] In this embodiment, the power terminal device includes but is not limited to an energy meter, an electricity metering device, a power metering device, etc. The power terminal device can collect, monitor and control the power consumption data of the power consumption devices and power consumption units according to the needs. In order to realize the above functions, the power terminal device installs and runs the corresponding system and application program.

[0073] When the power terminal device runs applications, these applications will occupy the system resources of the power terminal device, where the system resources include but are not limited to the processor (Central Processing Unit, CPU), memory (Random Access Memory, RAM), etc. When the power terminal device runs more applications, the total system resources required by these applications are also higher. However, the system resources of the power terminal device are limited. As the occupancy rate of system resources increases, the heat generated by the CPU and memory of the power terminal device will also increase, which will cause the temperature of the CPU or memory to rise. When the temperature is too high, it is easy to cause adverse effects such as system crashes.

[0074] In response to the above problems, the present application proposes a system resource scheduling method for a power terminal device, which can schedule resources for one or more applications running on the power terminal device based on the real-time occupancy rate of the system resources of the power terminal device, thereby releasing some of the occupied system resources, thereby reducing the system resource occupancy rate and reducing the heat generation problem.

[0075] For example, taking the case where the power terminal device runs Linux (a UNIX-like operating system) or other operating systems developed based on Linux, when the power terminal device runs one or more applications, the current occupancy rate of the system resources of the power terminal device is obtained in real time according to the set acquisition cycle, and it is determined whether the current occupancy rate exceeds the preset occupancy rate threshold.

[0076] For example, the power terminal equipment executes Linux system commands such as top or vmstat (commands used to report statistical information about kernel threads, virtual memory, disks, traps, and CPU activities) once every 10 minutes to obtain the system resource occupancy of the power terminal equipment, thereby obtaining information on the utilization rate of the implemented system resources.

[0077] When it is detected that the occupancy rate is greater than the preset occupancy rate threshold, it is determined that the system load of the power terminal device is large at this time, and a target application is determined in the applications currently in operation. Exemplarily, the target application may be an application that occupies more system resources. Exemplarily, the target application may be an application of lower importance.

[0078] After determining the target application, by sending a first message to the target application, the target application that receives the first message actively reduces its occupancy of system resources, thereby releasing some system resources, reducing the occupancy rate of the system resources of the power terminal device, and further reducing the heat generated by the CPU and memory of the power terminal device.

[0079] Exemplarily, the first message may be an MQTT (Message Queuing Telemetry Transport) message.

[0080] For example, Figure 2 A flowchart of a system resource scheduling method for a power terminal device in some embodiments of the present application is shown. Figure 2 As shown, the method includes:

[0081] Step 202, monitoring system resource utilization;

[0082] Step 204, cyclically monitoring the system resource usage of each application;

[0083] Step 206, determine whether the set conditions are met; if yes, go to step 208, otherwise return to step 202;

[0084] Step 208: Send an MQTT message to the target application.

[0085] The set condition is that the CPU usage is greater than 95%.

[0086] The present application dynamically monitors the system resource occupancy rate of the power terminal device during its operation, and when the system resource occupancy rate of the power terminal device is high, releases some of the occupied system resources by sending a first message to some applications, thereby achieving the purpose of reducing the system resource occupancy rate, reducing equipment heat generation, and improving the operating stability of the power terminal device.

[0087] In some embodiments of the present application, optionally, before obtaining the occupancy rate of system resources of the power terminal device, the method also includes: obtaining the occupancy of system resources by each application; sorting the applications in order from large to small according to the occupancy to obtain an application list; determining a target application from at least one application, including: determining the first N applications in the application list as target applications; N is a positive integer.

[0088] In this embodiment, the applications of the power terminal device include system applications and functional applications. Among them, the system applications are applications necessary for the power terminal device to work, which are of high importance, and the system resources occupied by these applications are generally not scheduled. Functional applications are applications that run to achieve specific functions, and the embodiment of this application mainly performs resource scheduling on functional applications.

[0089] Exemplarily, the power terminal device sets functional applications as applications to be detected, and stores the program names or program identifiers of these applications in a list to obtain a list of applications to be monitored. Exemplarily, the list of applications to be monitored is recorded as a first list.

[0090] Whenever the power terminal device runs an application in the first list, the power terminal device continuously detects the running status of the application, thereby obtaining the system resources occupied by each running application.

[0091] At the same time, the system of the power terminal device sorts the running applications according to the order of the amount of system resources occupied by each running application from large to small, and obtains another application list. Exemplarily, this application records this application list as the second list.

[0092] When it is determined that the occupancy rate of the system resources exceeds the occupancy rate threshold, the N applications with the highest occupancy of the system resources are selected from the second list as the target objects of this system resource scheduling, i.e., the target applications. The first message is sent to the N target applications to allow them to release the occupied system resources, thereby reducing the heat generated by the device.

[0093] Exemplarily, N=1. Exemplarily, N=2. Exemplarily, N=3. Exemplarily, N=4.

[0094] In some embodiments of the present application, optionally, before obtaining the amount of system resources occupied by each application, the method also includes: creating a first thread and a second thread; wherein the first thread is used to obtain the amount of system resources occupied by each application and generate an application list; the second thread is used to obtain the occupancy rate of system resources of the power terminal device and send a first message to the target application.

[0095] In this embodiment, after the power terminal device is started, the power terminal device first creates two independent threads, namely the first thread and the second thread. The first thread stores the program name or program identifier of the application to be detected in a list to obtain a first list.

[0096] Whenever an application in the first list starts running, the first thread will also monitor the application, periodically execute Linux commands such as top or vmstat, analyze the amount of system resources occupied by the monitored application, and sort the applications according to the amount of system resources occupied to obtain the above application list.

[0097] The second thread is used to periodically read the information in the application list and determine whether the system resources of the current power terminal device, including the CPU occupancy rate and the memory occupancy rate, exceed the set occupancy rate threshold. When it is determined that the occupancy rate of the system resources exceeds the occupancy rate threshold, the N applications in the application list that occupy the highest amount of system resources are determined as target applications. The second thread sends a first message to the target application, so that the target application that receives the first message reduces the occupancy of system resources, thereby realizing dynamic scheduling of system resources.

[0098] For example, Figure 3 The system thread operation flow chart of the power terminal device of some embodiments of the present application is shown as follows: Figure 3 As shown, including:

[0099] Step 302, running the main thread;

[0100] Step 304A, running the first thread;

[0101] Step 304B, running the second thread.

[0102] Figure 4 A flowchart of a first thread of a power terminal device in some embodiments of the present application is shown, such as Figure 4 As shown, including:

[0103] Step 402, obtaining the program name of the application to be detected in the first list;

[0104] Step 404, executing the command once every 10 minutes to analyze the system resource usage of each application;

[0105] Step 406, generating a list of applications in descending order of system resource usage.

[0106] Figure 5 A flowchart of a second thread of a power terminal device in some embodiments of the present application is shown, such as Figure 5 As shown, including:

[0107] Step 502, regularly obtain the CPU occupancy rate in the first list;

[0108] Step 504, determine whether the CPU occupancy rate exceeds the threshold; if yes, proceed to step 506, otherwise return to step 502;

[0109] Step 506: Send MQTT messages to the first three target applications in the application list to reduce the running frequency of the threads of the target applications.

[0110] The present application dynamically schedules the system resources of the power terminal device by creating an independent first thread and a second thread, thereby reducing the heat generated by the power terminal device and improving the reliability and stability of the power terminal device.

[0111] In some embodiments of the present application, optionally, the power terminal device further includes a third thread, and the third thread is used to run the target application; after sending the first message to the target application, the method includes: controlling the third thread to reduce the running frequency.

[0112] In this embodiment, the third thread is specifically a thread allocated to the target application program. The third thread runs the target application program at a fixed running frequency, thereby realizing the program function corresponding to the target application program.

[0113] When the target application receives the first message, the third thread actively increases the periodic running time, thereby reducing the running frequency of the target application, thereby reducing the target application's occupation of system resources such as CPU and memory.

[0114] In some embodiments of the present application, optionally, the target application is associated with at least one functional thread; after sending a first message to the target application, the method includes: controlling the target application to send a second message to the functional thread; wherein the second message is used to instruct the functional thread to reduce the operating frequency.

[0115] In this embodiment, the target application may have one or more program functions, wherein each independent program function corresponds to an independent function thread. After the target application receives the first message, the target application sends a second message to each function thread associated with itself, thereby reducing the operating frequency of these function threads, so that the target application can reduce the occupation of system resources such as CPU and memory.

[0116] For example, Figure 6 A schematic diagram of a system thread of a power terminal device in some embodiments of the present application is shown. Figure 6 As shown, the system main thread of the power terminal device includes a thread for sending and receiving MQTT messages, as well as the first thread and the second thread mentioned above, and also includes a functional thread occupied by the application.

[0117] Figure 7 The operation flow chart of the application program of some embodiments of the present application is shown as follows: Figure 7 As shown, including:

[0118] Step 702, determine whether an MQTT message is received; if yes, proceed to step 704, otherwise, loop through step 702;

[0119] Step 704: Send a second message to the functional thread to reduce the operating frequency of the functional thread.

[0120] Figure 8 The operation flow chart of the functional threads of some embodiments of the present application is shown as follows: Figure 8 As shown, including:

[0121] Step 802, determine whether the second message is received; if yes, proceed to step 804, otherwise proceed to step 806;

[0122] Step 804, reducing the operating frequency of the function thread itself;

[0123] Step 806, executing the business function.

[0124] In some embodiments of the present application, optionally, Fig. 9 Schematic diagram of MTQQ message forwarding in some embodiments of the present application is shown, such as Fig. 9 As shown, the power terminal equipment includes a message queue telemetry transmission agent module; the first message is a message queue telemetry transmission message; sending the first message to the target application includes: sending the first message to the target application through the message queue telemetry transmission agent module.

[0125] In this embodiment, taking the Linux operating system as an example, the power terminal device implements the MQTT function through the message queue telemetry transmission agent module. When it is detected that the current system resource occupancy rate of the power terminal device exceeds the preset occupancy rate threshold, the message queue telemetry transmission agent module (i.e. Fig. 9 The MQTT proxy module shown in the figure) sends MQTT messages, i.e., the first message, to the first N target applications in the application list. These target applications are controlled to reduce their operating frequency through MQTT messages, thereby reducing the occupation of system resources, reducing system heating, and improving the operating stability of power terminal equipment.

[0126] In some embodiments of the present application, a system resource scheduling device for a power terminal device is provided. Fig.10 The structural block diagram of the system resource scheduling device of the power terminal equipment in some embodiments of the present application is shown as follows Fig.10 As shown, the system resource scheduling device 1000 includes: an acquisition module 1002, used to obtain the occupancy rate of the system resources of the power terminal device when the power terminal device runs at least one application; a determination module 1004, used to determine the target application in at least one application when the occupancy rate is greater than the occupancy rate threshold; a sending module 1006, used to send a first message to the target application; wherein the first message is used to instruct the target application to reduce the occupancy of the system resources.

[0127] In this embodiment, the power terminal device includes but is not limited to an energy meter, an electricity metering device, a power metering device, etc. The power terminal device can collect, monitor and control the power consumption data of the power consumption devices and power consumption units according to the needs. In order to realize the above functions, the power terminal device installs and runs the corresponding system and application program.

[0128] When the power terminal device runs applications, these applications will occupy the system resources of the power terminal device, where the system resources include but are not limited to the processor (Central Processing Unit, CPU), memory (Random Access Memory, RAM), etc. When the power terminal device runs more applications, the total system resources required by these applications are also higher. However, the system resources of the power terminal device are limited. As the occupancy rate of system resources increases, the heat generated by the CPU and memory of the power terminal device will also increase, which will cause the temperature of the CPU or memory to rise. When the temperature is too high, it is easy to cause adverse effects such as system crashes.

[0129] In response to the above problems, the present application proposes a system resource scheduling method for a power terminal device, which can schedule resources for one or more applications running on the power terminal device based on the real-time occupancy rate of the system resources of the power terminal device, thereby releasing some of the occupied system resources, thereby reducing the system resource occupancy rate and reducing the heat generation problem.

[0130] For example, taking the case where the power terminal device runs Linux (a UNIX-like operating system) or other operating systems developed based on Linux, when the power terminal device runs one or more applications, the current occupancy rate of the system resources of the power terminal device is obtained in real time according to the set acquisition cycle, and it is determined whether the current occupancy rate exceeds the preset occupancy rate threshold.

[0131] For example, the power terminal equipment executes Linux system commands such as top or vmstat (commands used to report statistical information about kernel threads, virtual memory, disks, traps, and CPU activities) once every 10 minutes to obtain the system resource occupancy of the power terminal equipment, thereby obtaining information on the utilization rate of the implemented system resources.

[0132] When it is detected that the occupancy rate is greater than the preset occupancy rate threshold, it is determined that the system load of the power terminal device is large at this time, and a target application is determined in the applications currently in operation. Exemplarily, the target application may be an application that occupies more system resources. Exemplarily, the target application may be an application of lower importance.

[0133] After determining the target application, by sending a first message to the target application, the target application that receives the first message actively reduces its occupancy of system resources, thereby releasing some system resources, reducing the occupancy rate of the system resources of the power terminal device, and further reducing the heat generated by the CPU and memory of the power terminal device.

[0134] Exemplarily, the first message may be an MQTT (Message Queuing Telemetry Transport) message.

[0135] The present application dynamically monitors the system resource occupancy rate of the power terminal device during its operation, and when the system resource occupancy rate of the power terminal device is high, releases some of the occupied system resources by sending a first message to some applications, thereby achieving the purpose of reducing the system resource occupancy rate, reducing equipment heat generation, and improving the operating stability of the power terminal device.

[0136] In some embodiments of the present application, a system resource scheduling device for a power terminal device is provided. Fig.11 The structural block diagram of the system resource scheduling device of the power terminal equipment in some embodiments of the present application is shown as follows Fig.11 As shown, the system resource scheduling device 1100 includes: a memory 1102, which is used to store programs or instructions; a processor 1104, which is used to implement the steps of the system resource scheduling method for power terminal equipment provided in any of the above embodiments when executing the programs or instructions, and thus can also achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0137] In some embodiments of the present application, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the system resource scheduling method for the power terminal equipment provided in any of the above embodiments are implemented, and thus the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0138] In some embodiments of the present application, a power terminal device is provided, including a system resource scheduling device for the power terminal device as provided in any of the above embodiments; and / or a readable storage medium as provided in any of the above embodiments, and therefore also has the same technical effect, which will not be described here to avoid repetition.

[0139] The methods may be implemented in various ways according to specific features and / or example applications. For example, the methods may be implemented by a combination of hardware, firmware, and / or software. For example, in a hardware implementation, the processor may be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, electronic devices, other equipment units for performing the above functions, and / or combinations thereof.

[0140] A computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer readable storage medium may be an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above devices, but is not limited thereto. A non-exhaustive list of more specific examples of computer readable storage media includes: a portable computer floppy disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or flash memory, a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory card, a floppy disk, a coding mechanical device (such as a punch card or a groove with a raised structure with instructions recorded thereon), and any suitable combination of the above devices. The computer-readable storage medium used herein should not be understood as a transmission signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagated through wave guides or other transmission media, or electrical signals transmitted through wires.

[0141] In the description of this application, the term "plurality" refers to two or more than two. Unless otherwise clearly defined, the terms "upper" and "lower" indicate positions or positional relationships based on the positions or positional relationships described in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, they cannot be understood as limitations on this application. The terms "connect", "install", "fixed", etc. should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0142] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present application, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0143] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A system resource scheduling method for power terminal equipment, characterized in that: The method comprises: When the power terminal device runs at least one application, obtaining an occupancy rate of system resources of the power terminal device; In a case where the occupancy rate is greater than an occupancy rate threshold, determining a target application program from at least one of the applications; A first message is sent to the target application; wherein the first message is used to instruct the target application to reduce the occupation of the system resources.

2. The system resource scheduling method according to claim 1, characterized in that: Before obtaining the occupancy rate of the system resources of the power terminal device, the method further includes: Obtaining the amount of system resources occupied by each of the applications; Sort the applications according to the order of the occupied amounts from large to small to obtain an application list; Determining a target application in at least one of the applications comprises: The first N applications in the application list are determined as the target applications; N is a positive integer.

3. The system resource scheduling method according to claim 2, characterized in that: Before obtaining the amount of the system resources occupied by each application, the method further includes: Create a first thread and a second thread; wherein the first thread is used to obtain the amount of system resources occupied by each of the applications and to generate the application list; the second thread is used to obtain the occupancy rate of the system resources of the power terminal device and to send a first message to the target application.

4. The system resource scheduling method according to claim 1, characterized in that: The power terminal device further includes a third thread, and the third thread is used to run the target application; After sending the first message to the target application, the method includes: The third thread is controlled to reduce the running frequency.

5. The system resource scheduling method according to claim 1, characterized in that: The target application is associated with at least one functional thread; After sending the first message to the target application, the method includes: Control the target application to send a second message to the functional thread; wherein the second message is used to instruct the functional thread to reduce the operating frequency.

6. The system resource scheduling method according to any one of claims 1 to 5, characterized in that: The electric power terminal device comprises a message queue telemetry transmission agent module; the first message is a message queue telemetry transmission message; The sending a first message to the target application comprises: A first message is sent to the target application via the message queue telemetry transmission agent module.

7. A system resource scheduling device for power terminal equipment, characterized in that: include: An acquisition module, configured to acquire the occupancy rate of the system resources of the power terminal device when the power terminal device runs at least one application program; a determination module, configured to determine a target application from at least one of the applications when the occupancy rate is greater than an occupancy rate threshold; A sending module is used to send a first message to the target application; wherein the first message is used to instruct the target application to reduce the occupation of the system resources.

8. A system resource scheduling device for power terminal equipment, characterized in that: include: Memory, used to store programs or instructions; A processor, configured to implement the steps of the system resource scheduling method according to any one of claims 1 to 6 when executing the program or instruction.

9. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the steps of the system resource scheduling method according to any one of claims 1 to 6 are implemented.

10. A power terminal device, characterized in that: include: The system resource scheduling device of the power terminal equipment as claimed in claim 7 or 8; and / or The readable storage medium as claimed in claim 9.