Subprogram resource quota management method, device and system for smart meter
By introducing an embedded operating system into smart meters and adopting a preset resource quota management method, the resource allocation problem in the multi-application of smart meters is solved, and multiple subroutines are made to work collaboratively under resource constraints, thus meeting the functional requirements of smart grids and new energy use.
Patent Information
- Application Number
- CN202211250692.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-12
- Publication Date
- 2026-07-14
- Estimated Expiration
- 2042-10-12
AI Technical Summary
In existing technologies, the application software model of electricity meter based on the operating system-less mode is difficult to meet the multi-application requirements of the new generation of smart electricity meters in the ubiquitous power Internet of Things, and the resource allocation problem has not been effectively solved.
By introducing an embedded operating system into smart meters and adopting a preset resource quota management method, the resource usage of each executable subroutine is limited, and the executable subroutine is updated and loaded to meet the target resource quota, thereby enabling the collaborative work of multiple subroutines.
It enables multi-application of smart meters, ensures that each subroutine operates collaboratively under resource constraints, and meets the functional requirements of smart grids and new energy use.
Smart Images

Figure CN115525293B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power Internet of Things technology, and in particular to a method, apparatus and system for managing subroutine resource quotas in smart meters. Background Technology
[0002] The existing application software model for electricity meters based on an operating system-less model, as proposed in related technologies, struggles to meet the demands of expanding the business functions of next-generation smart meters in the ubiquitous power Internet of Things (IoT). Therefore, enhancing the processing power of hardware platforms, introducing embedded operating systems, and realizing the "multi-application" capabilities of next-generation smart meters are urgently needed to build a smart energy and smart home IoT system centered around these meters. With the increasing "multi-application" capabilities of smart meters, they will be endowed with more functions, raising the issue of resource allocation among applications. Summary of the Invention
[0003] This application aims to at least partially address one of the technical problems in the related art.
[0004] Therefore, the first objective of this application is to propose a subroutine resource quota management method for smart meters. This method can limit the resource quota of each executable subroutine, enabling multiple executable subroutines to work together and realize the multi-application of smart meters.
[0005] The second objective of this application is to propose an alternative method for managing subroutine resource quotas in smart meters.
[0006] The third objective of this application is to provide a computer-readable storage medium.
[0007] The fourth objective of this application is to propose a host computer.
[0008] The fifth objective of this application is to propose a smart meter.
[0009] The sixth objective of this application is to provide a subroutine resource quota management device for smart meters.
[0010] The seventh objective of this application is to propose another subroutine resource quota management device for smart meters.
[0011] The eighth objective of this application is to propose a subroutine resource quota management system for smart meters.
[0012] To achieve the above objectives, the first aspect of this application proposes a subroutine resource quota management method for smart meters, applied to a host computer. The method includes: obtaining an executable subroutine, wherein the executable subroutine is written using a preset resource quota during development; determining a target resource quota and updating the executable subroutine according to the target resource quota, wherein the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota; and sending the updated executable subroutine to the smart meter so that the smart meter loads and runs the updated executable subroutine according to the target resource quota.
[0013] According to one embodiment of this application, updating the executable subroutine includes: determining the code compilation file of the executable subroutine; and modifying the code compilation file to reduce the resource quota occupied by the executable subroutine.
[0014] According to one embodiment of this application, when the target resource quota is greater than or equal to the preset resource quota, the executable subroutine is directly sent to the smart meter.
[0015] According to one embodiment of this application, before sending the executable subroutine to the smart meter, the method further includes: signing the executable subroutine.
[0016] According to one embodiment of this application, before determining the target resource quota, the method further includes: responding to a subroutine loading request from the smart meter.
[0017] According to the subroutine resource quota management method of the smart meter in this embodiment, the executable subroutine is updated according to the target resource quota so that the resource quota occupied by the updated executable subroutine meets the actual needs. The smart meter loads the updated executable subroutine according to the target resource quota, so that multiple executable subroutines can work together to realize the multi-application of the smart meter.
[0018] To achieve the above objectives, the second aspect of this application proposes a subroutine resource quota management method for smart meters, applied to smart meters. The method includes: sending a subroutine loading request to a host computer, wherein the subroutine loading request instructs the host computer to obtain an executable subroutine and determine a target resource quota; updating the executable subroutine according to the target resource quota so that the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota, wherein the executable subroutine is written using a preset resource quota during development; receiving the updated executable subroutine from the host computer, and loading and running the updated executable subroutine according to the target resource quota.
[0019] According to one embodiment of this application, when the target resource quota is greater than or equal to the preset resource quota, the method further includes: receiving the executable subroutine issued by the host computer.
[0020] According to the subroutine resource quota management method of the smart meter in this embodiment, by receiving the updated executable subroutine sent by the host computer, loading and running the updated executable subroutine sent by the host computer according to the resource quota corresponding to the executable subroutine, the cooperation between the subroutines can be realized.
[0021] To achieve the above objectives, a computer-readable storage medium is provided in the third aspect of this application, which stores a subroutine resource quota management program for a smart meter. When the subroutine resource quota management program for a smart meter is executed by a processor, it implements the subroutine resource quota management method for a smart meter proposed in the first aspect of this application or the subroutine resource quota management method for a smart meter proposed in the second aspect of this application.
[0022] To achieve the above objectives, the host computer proposed in the fourth aspect of this application includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the subroutine resource quota management method for smart meters described in the first aspect of this application.
[0023] To achieve the above objectives, the smart meter proposed in the fifth aspect of this application includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the subroutine resource quota management method for the smart meter described in the second aspect of this application.
[0024] To achieve the above objectives, the sixth aspect of this application proposes a subroutine resource quota management device for smart meters, applied to a host computer. The device includes: an acquisition module for acquiring an executable subroutine, wherein the executable subroutine is written using a preset resource quota during development; an update module for determining a target resource quota and updating the executable subroutine according to the target resource quota, wherein the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota; and a distribution module for distributing the updated executable subroutine to the smart meter, so that the smart meter loads and runs the updated executable subroutine according to the target resource quota.
[0025] According to one embodiment of this application, the update module is specifically used to: determine the code compilation file of the executable subroutine; and modify the code compilation file to reduce the resource quota occupied by the executable subroutine.
[0026] According to one embodiment of this application, when the target resource quota is greater than or equal to the preset resource quota, the distribution module is specifically used to: directly distribute the executable subroutine to the smart meter.
[0027] According to one embodiment of this application, before determining the target resource quota, the update module is specifically configured to: respond to the subroutine loading request of the smart meter.
[0028] To achieve the above objectives, the seventh aspect of this application proposes a subroutine resource quota management device for smart meters, applied to smart meters. The device includes: a sending module for sending a subroutine loading request to a host computer, wherein the subroutine loading request instructs the host computer to obtain an executable subroutine, determine a target resource quota, and update the executable subroutine according to the target resource quota, wherein the updated executable subroutine occupies a resource quota less than or equal to the target resource quota, and the executable subroutine is written using a preset resource quota during development; a receiving module for receiving the updated executable subroutine from the host computer; and a loading module for loading and running the updated executable subroutine according to the target resource quota.
[0029] According to one embodiment of this application, when the target resource quota is greater than or equal to the preset resource quota, the receiving module is specifically used to: receive the executable subroutine sent by the host computer.
[0030] To achieve the above objectives, the eighth aspect of this application proposes a subroutine resource quota management system for smart meters, comprising a host computer and a smart meter. The host computer is configured to: acquire executable subroutines, wherein the executable subroutines are written using preset resource quotas during development; the host computer is further configured to: determine a target resource quota; update the executable subroutines according to the target resource quota, wherein the updated executable subroutines occupy resource quotas less than or equal to the target resource quota; and distribute the updated executable subroutines to the smart meter; the smart meter is configured to: load and run the updated executable subroutines according to the target resource quota.
[0031] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0032] Figure 1 This is a flowchart of a subroutine resource quota management method for a smart meter according to the first embodiment of this application;
[0033] Figure 2This is a flowchart of step S120 in the subroutine resource quota management method for smart meters according to the first embodiment of this application;
[0034] Figure 3 This is a flowchart of a subroutine resource quota management method for a smart meter according to the second embodiment of this application;
[0035] Figure 4 This is a schematic diagram of the subroutine resource quota management device for a smart meter according to the first embodiment of this application;
[0036] Figure 5 This is a schematic diagram of the subroutine resource quota management device for a smart meter according to the second embodiment of this application;
[0037] Figure 6 This is a structural diagram of a subroutine resource quota management system for a smart meter according to an embodiment of this application. Detailed Implementation
[0038] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0039] The following is a reference appendix. Figure 1-6 This application describes a subroutine resource quota management method, apparatus, and system for smart meters according to embodiments of the present application.
[0040] Figure 1 This is a flowchart of a subroutine resource quota management method for a smart meter according to the first embodiment of this application.
[0041] It should be noted that the subroutine resource quota management method for smart meters in this embodiment is applied to the host computer. By writing subroutines for each function in the host computer, the written subroutines are sent to the smart meter to realize the multi-functionality of the smart meter.
[0042] like Figure 1 As shown, the subroutine resource quota management method for this smart meter may include the following steps:
[0043] S110, Obtain the executable subroutine, wherein the executable subroutine is written using a preset resource quota during development.
[0044] Specifically, in the host computer, developers write code according to preset resource quotas when developing subroutines. After the code is written, it is compiled and the compiled executable subroutines are submitted to the administrator. The administrator can view the resource quotas occupied by each executable subroutine through the resource management tool in the host computer.
[0045] It should be noted that administrators can set preset resource quotas according to actual needs. When developing executable subroutines, developers should use the preset resource quota as the upper limit and ensure that the code does not exceed the preset resource quota.
[0046] S120, determine the target resource quota, and update the executable subroutine according to the target resource quota, wherein the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota.
[0047] Specifically, after obtaining the executable subroutine, the relationship between the resource quota occupied by the executable subroutine and the target resource quota is compared. If the resource quota occupied by the executable subroutine is greater than the target resource quota, the executable subroutine is updated so that the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota.
[0048] For example, the target resource quota can be the fixed resource quota allocated to each executable subroutine in the smart meter. After the developers write the executable subroutine based on the preset resource quota, if the resource quota occupied by the executable subroutine is greater than the target resource quota, the executable subroutine needs to be adjusted so that the resource quota occupied by the adjusted executable subroutine is less than or equal to the target resource quota. This allows multiple executable subroutines to work together as more and more subroutines are installed in the smart meter.
[0049] For example, the default memory allocation for the executable subroutine corresponding to the alarm function in a smart meter is set to 30MB. The developer writes an executable subroutine of 25MB based on this 30MB. In practical applications, assuming the target resource allocation is 20MB (meaning the user-specified alarm function occupies 20MB of memory on the smart meter), the executable subroutine can be adjusted and updated so that the updated 25MB subroutine occupies less than or equal to 20MB of memory on the smart meter. This means that writing the subroutine within the default resource allocation limits subsequent updates, ensuring a smaller adjustment range and thus guaranteeing the reliability and integrity of the subroutine's functionality.
[0050] S130, the updated executable subroutine is sent to the smart meter so that the smart meter can load and run the updated executable subroutine according to the target resource quota.
[0051] Specifically, after updating the executable subroutine according to the target resource quota, the updated executable subroutine is sent to the smart meter, which then loads and runs the updated executable subroutine upon receiving it.
[0052] In some embodiments, Figure 2 This is a flowchart of step S120 in the subroutine resource quota management method for a smart meter according to the first embodiment of this application. Figure 2 As shown, updating an executable subroutine may include the following steps:
[0053] S210, determine the code compilation file for the executable subroutine.
[0054] Specifically, the developer writes the subroutine source code in the host computer, compiles it to generate assembly code, and converts the assembly code into machine instructions to generate the target binary file, which is the compiled code file of the executable subroutine.
[0055] S220 modifies the code compilation file to reduce the resource quota used by the executable subroutine.
[0056] Specifically, the target binary file is modified to reduce the resource quota occupied by the executable subroutine, so that the resource quota occupied by the modified executable subroutine is less than or equal to the target quota.
[0057] As one possible implementation, when the target resource quota is greater than or equal to the preset resource quota, the executable subroutine is directly sent to the smart meter.
[0058] It is understandable that when the target resource quota is greater than or equal to the preset resource quota, if the resource quota occupied by the executable subroutine written according to the preset resource quota is less than or equal to the preset resource quota, that is, if the resource quota occupied by the executable subroutine is less than or equal to the target resource quota, then there is no need to update the executable subroutine, and the executable subroutine can be directly sent to the smart meter.
[0059] As an example, before distributing the executable subroutine to the smart meter, the process also includes signing the executable subroutine.
[0060] Specifically, when the target resource quota is less than the preset resource quota, the executable subroutine is modified and updated, and the updated executable subroutine is signed; when the target resource quota is greater than or equal to the preset minimum resource quota, the executable subroutine is directly signed. After signing the executable subroutine, the signed executable subroutine is sent to the smart meter.
[0061] It should be noted that an executable subroutine is in a development state before being signed, and in a signed state after being signed. An executable subroutine in the signed state cannot be modified.
[0062] In some embodiments, before determining the target resource quota, the method further includes responding to a subroutine loading request from the smart meter.
[0063] Understandably, upon receiving a subroutine loading request from a smart meter, the target resource quota is determined, and the executable subroutine is updated and loaded according to the target resource quota.
[0064] Figure 3 This is a flowchart of a subroutine resource quota management method for a smart meter according to a second embodiment of this application.
[0065] It should be noted that the subroutine resource quota management method for smart meters in this embodiment is applied to smart meters. Smart meters are advanced metering devices that collect, analyze, and manage electrical energy information data based on modern communication, computer, and measurement technologies. In addition to the basic electricity metering function of traditional meters, smart meters also possess intelligent functions such as bidirectional multi-rate metering, user-end control, bidirectional data communication with multiple data transmission modes, and anti-theft features to adapt to smart grids and the use of new energy sources. In this embodiment, the smart meter receives and runs executable subroutines from a host computer, thus realizing the multi-functionality of the smart meter.
[0066] like Figure 3 As shown, the subroutine resource quota management method for this smart meter may include the following steps:
[0067] S310, send a subroutine loading request to the host computer. The subroutine loading request is used to instruct the host computer to obtain the executable subroutine, determine the target resource quota, and update the executable subroutine according to the target resource quota so that the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota. The executable subroutine is written using the preset resource quota during development.
[0068] For example, the functions that need to be implemented in the smart meter can be selected according to actual needs. Based on the subroutines corresponding to the required functions, the target resource quotas corresponding to each subroutine are determined, and a subroutine loading request is sent to the host computer. The administrator determines the relationship between the target resource quota of the executable subroutine and the preset resource quota based on the subroutine request sent by the host computer. When the target resource quota is less than the preset resource quota, the executable subroutine is updated so that the resource quota corresponding to the updated executable subroutine is less than or equal to the target resource quota.
[0069] For example, the subroutines on a smart meter are used to implement various functions, such as automatic measurement, billing, and alarm functions. Each subroutine corresponds to a different resource quota after it is written.
[0070] S320 receives the updated executable subroutine from the host computer and loads and runs the updated executable subroutine according to the target resource quota.
[0071] Specifically, when the resource quota corresponding to the subroutine is less than or equal to the target resource quota, the updated executable subroutine sent by the host computer is received, and the updated executable subroutine is loaded and run based on the target resource quota.
[0072] As one possible implementation, when the target resource quota is greater than or equal to the preset resource quota, it also includes: receiving an executable subroutine sent by the host computer.
[0073] It is understandable that when the target resource quota is greater than or equal to the preset resource quota, it means that when the resource quota occupied by the executable subroutine is less than or equal to the target resource quota, the host computer will not modify or update the executable subroutine, but will directly send the executable subroutine to the smart meter.
[0074] It should be noted that after the host computer sends the signed executable subroutine to the smart meter, the status of the executable subroutine changes from the signed state to the installed state, and the status of the executable subroutine being run by the subroutine loader in the smart meter changes from the installed state to the running state.
[0075] To implement the above embodiments, this application also proposes a computer-readable storage medium storing a subroutine resource quota management program for a smart meter. When the subroutine resource quota management program for a smart meter is executed by a processor, it implements the subroutine resource quota management method for a smart meter according to any of the above embodiments of this application.
[0076] To implement the above embodiments, this application also proposes a host computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the subroutine resource quota management method for smart meters described in the first embodiment of this application.
[0077] To implement the above embodiments, this application also proposes a smart meter, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the subroutine resource quota management method for the smart meter described in the second embodiment of this application.
[0078] Corresponding to the subroutine resource quota management method for smart meters provided in the first embodiment above, an embodiment of this application also provides a subroutine resource quota management device for smart meters. Since the subroutine resource quota management device for smart meters provided in this embodiment corresponds to the subroutine resource quota management method for smart meters provided in the above embodiments, it will not be described in detail in this embodiment. Figure 4 This is a schematic diagram of the subroutine resource quota management device for a smart meter according to the first embodiment of this application.
[0079] It should be noted that the subroutine resource quota management device for the smart meter in this embodiment is applied to the host computer, such as... Figure 4 As shown, the subroutine resource quota management device 400 of the smart meter may include: an acquisition module 401, an update module 402, and a distribution module 403.
[0080] Specifically, the acquisition module 401 is used to acquire an executable subroutine, wherein the executable subroutine is written using a preset resource quota during development; the update module 402 is used to determine a target resource quota and update the executable subroutine according to the target resource quota, wherein the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota; and the distribution module 403 is used to distribute the updated executable subroutine to the smart meter so that the smart meter can load and run the updated executable subroutine according to the target resource quota.
[0081] Optionally, the update module is specifically used to: determine the code compilation file of the executable subroutine; and modify the code compilation file to reduce the resource quota occupied by the executable subroutine.
[0082] As an example, when the target resource quota is greater than or equal to the preset resource quota, the distribution module is specifically used to: directly distribute the executable subroutine to the smart meter.
[0083] As one possible implementation, before the executable subroutine is sent to the smart meter, the update module is specifically used to: sign the executable subroutine.
[0084] Optionally, before determining the target resource quota, the update module is specifically used to: respond to a subroutine loading request from a smart meter.
[0085] Corresponding to the subroutine resource quota management method for smart meters provided in the second embodiment above, another embodiment of this application also provides a subroutine resource quota management device for smart meters. Since the subroutine resource quota management device for smart meters provided in this embodiment corresponds to the subroutine resource quota management method for smart meters provided in the above embodiments, it will not be described in detail in this embodiment. Figure 5This is a schematic diagram of the structure of a subroutine resource quota management device for a smart meter according to the second embodiment of this application.
[0086] It should be noted that the subroutine resource quota management device for the smart meter in this embodiment is applied to the smart meter, such as... Figure 5 As shown, the subroutine resource quota management device 500 of the smart meter may include: a sending module 501, a receiving module 502, and a loading module 503.
[0087] Specifically, the sending module 501 is used to send a subroutine loading request to the host computer, wherein the subroutine loading request is used to instruct the host computer to obtain an executable subroutine, determine the target resource quota, and update the executable subroutine according to the target resource quota, wherein the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota, and the executable subroutine is written using a preset resource quota during development; the receiving module 502 is used to receive the updated executable subroutine sent by the host computer; and the loading module 503 is used to load and run the updated executable subroutine according to the target resource quota.
[0088] As one possible implementation, when the target resource quota is greater than or equal to the preset resource quota, the receiving module is specifically used to receive the executable subroutine sent by the host computer.
[0089] To implement the above embodiments, this application also proposes a subroutine resource quota management system for smart meters.
[0090] Figure 6 This is a structural diagram of a subroutine resource quota management system for a smart meter according to an embodiment of this application. Figure 6 As shown, the subroutine resource quota management system 600 of the smart meter includes: a host computer 601 and a smart meter 602.
[0091] Specifically, the host computer 601 is used to obtain the executable subroutine, wherein the executable subroutine is written using a preset resource quota during development; the host computer 601 is also used to determine the target resource quota, and update the executable subroutine according to the target resource quota, wherein the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota, and to send the updated executable subroutine to the smart meter; the smart meter 602 is used to load and run the updated executable subroutine according to the target resource quota.
[0092] Furthermore, the other components and functions of the smart meters in the embodiments of this application are known to those skilled in the art, and will not be described in detail here to reduce redundancy.
[0093] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0094] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0095] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0096] In the description of this application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicating the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, 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, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0097] Furthermore, the terms "first," "second," etc., used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying relative importance, or implicitly specifying the number of technical features indicated in this embodiment. Therefore, features defined with terms such as "first" and "second" in the embodiments of this application can explicitly or implicitly indicate that the embodiment includes at least one of those features. In the description of this application, the word "multiple" means at least two or more, such as two, three, four, etc., unless otherwise explicitly and specifically defined in the embodiments.
[0098] In this application, unless otherwise explicitly specified or limited in the embodiments, the terms "installation," "connection," "joining," and "fixing" appearing in the embodiments should be interpreted broadly. For example, a connection can be a fixed connection, a detachable connection, or an integral part; it can also be a mechanical connection, an electrical connection, etc. Of course, it can also be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication between two components, or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific implementation.
[0099] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0100] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A subroutine resource quota management method for smart meters, characterized in that, Applied to a host computer, the method includes: Obtain an executable subroutine, wherein the executable subroutine is written using a preset resource quota during development; Determine the target resource quota, and update the executable subroutine according to the target resource quota, wherein the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota; The target resource quota is the fixed resource quota allocated to each of the executable subroutines in the smart meter. After the executable subroutines are written based on the preset resource quota, if the resource quota occupied by the executable subroutines is greater than the target resource quota, the executable subroutines are adjusted so that the resource quota occupied by the adjusted executable subroutines is less than or equal to the target resource quota. The updated executable subroutine is distributed to the smart meter so that the smart meter can load and run the updated executable subroutine according to the target resource quota.
2. The subroutine resource quota management method for smart meters according to claim 1, characterized in that, Updating the executable subroutine includes: Determine the compiled code file of the executable subroutine; The compiled code file is modified to reduce the resource quota used by the executable subroutine.
3. The subroutine resource quota management method for smart meters according to claim 1 or 2, characterized in that, When the target resource quota is greater than or equal to the preset resource quota, the executable subroutine is directly sent to the smart meter.
4. The subroutine resource quota management method for smart meters according to claim 3, characterized in that, Before sending the executable subroutine to the smart meter, the method further includes: The executable subroutine is signed.
5. The subroutine resource quota management method for smart meters according to claim 1, characterized in that, Before determining the target resource quota, the method further includes: In response to the subroutine loading request of the smart meter.
6. A subroutine resource quota management method for smart meters, characterized in that, Applied to smart meters, the method includes: Send a subroutine loading request to the host computer, wherein the subroutine loading request is used to instruct the host computer to obtain the executable subroutine, determine the target resource quota, and update the executable subroutine according to the target resource quota so that the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota. The executable subroutine is written using a preset resource quota during development. The target resource quota is the fixed resource quota allocated to each of the executable subroutines in the smart meter. After the executable subroutines are written based on the preset resource quota, if the resource quota occupied by the executable subroutines is greater than the target resource quota, the executable subroutines are adjusted so that the resource quota occupied by the adjusted executable subroutines is less than or equal to the target resource quota. The system receives the updated executable subroutine from the host computer and loads and runs the updated executable subroutine according to the target resource quota.
7. The subroutine resource quota management method for smart meters according to claim 6, characterized in that, When the target resource quota is greater than or equal to the preset resource quota, the method further includes: Receive the executable subroutine sent by the host computer.
8. A computer-readable storage medium, characterized in that, It stores a subroutine resource quota management program for a smart meter. When the processor executes the subroutine resource quota management program for a smart meter, it implements the subroutine resource quota management method for a smart meter according to any one of claims 1-5 or according to any one of claims 6-7.
9. A host computer, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the subroutine resource quota management method for smart meters according to any one of claims 1-5.
10. A smart meter, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the subroutine resource quota management method for smart meters according to any one of claims 6-7.
11. A subroutine resource quota management device for a smart meter, characterized in that, Applied to a host computer, the device includes: The acquisition module is used to acquire executable subroutines, wherein the executable subroutines are written using preset resource quotas during development; An update module is used to determine a target resource quota and update the executable subroutine according to the target resource quota, wherein the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota; The target resource quota is the fixed resource quota allocated to each of the executable subroutines in the smart meter. After the executable subroutines are written based on the preset resource quota, if the resource quota occupied by the executable subroutines is greater than the target resource quota, the executable subroutines are adjusted so that the resource quota occupied by the adjusted executable subroutines is less than or equal to the target resource quota. The distribution module is used to distribute the updated executable subroutine to the smart meter so that the smart meter can load and run the updated executable subroutine according to the target resource quota.
12. The subroutine resource quota management device for smart meters according to claim 11, characterized in that, The update module is specifically used for: Determine the compiled code file of the executable subroutine; The compiled code file is modified to reduce the resource quota used by the executable subroutine.
13. The subroutine resource quota management device for smart meters according to claim 11 or 12, characterized in that, When the target resource quota is greater than or equal to the preset resource quota, the distribution module is specifically used to: directly distribute the executable subroutine to the smart meter.
14. The subroutine resource quota management device for smart meters according to claim 13, characterized in that, Before the executable subroutine is sent to the smart meter, the update module is specifically used to: sign the executable subroutine.
15. The subroutine resource quota management device for smart meters according to claim 11, characterized in that, Before determining the target resource quota, the update module is specifically used to: respond to the subroutine loading request of the smart meter.
16. A subroutine resource quota management device for a smart meter, characterized in that, The device, used in smart meters, includes: The sending module is used to send a subroutine loading request to the host computer. The subroutine loading request is used to instruct the host computer to obtain an executable subroutine, determine the target resource quota, and update the executable subroutine according to the target resource quota. The updated executable subroutine occupies a resource quota that is less than or equal to the target resource quota. The executable subroutine is written using a preset resource quota during development. The target resource quota is the fixed resource quota allocated to each of the executable subroutines in the smart meter. After the executable subroutines are written based on the preset resource quota, if the resource quota occupied by an executable subroutine is greater than the target resource quota, the executable subroutine is adjusted so that the resource quota occupied by the adjusted executable subroutine is less than or equal to the target resource quota. The receiving module is used to receive the updated executable subroutine sent by the host computer; A loading module is used to load and run the updated executable subroutine according to the target resource quota.
17. The subroutine resource quota management device according to claim 16, characterized in that, When the target resource quota is greater than or equal to the preset resource quota, the receiving module is specifically used to: receive the executable subroutine sent by the host computer.
18. A subroutine resource quota management system for smart meters, comprising a host computer and smart meters, wherein, The host computer is used to obtain executable subroutines, wherein the executable subroutines are written using preset resource quotas during development; The host computer is also used to determine the target resource quota, update the executable subroutine according to the target resource quota, wherein the resource quota occupied by the updated executable subroutine is less than or equal to the target resource quota, and send the updated executable subroutine to the smart meter. The target resource quota is the fixed resource quota allocated to each of the executable subroutines in the smart meter. After the executable subroutines are written based on the preset resource quota, if the resource quota occupied by the executable subroutines is greater than the target resource quota, the executable subroutines are adjusted so that the resource quota occupied by the adjusted executable subroutines is less than or equal to the target resource quota. The smart meter is used to load and run the updated executable subroutine according to the target resource quota.
Citation Information
Patent Citations
Resource management method, device and equipment
CN110134655A
Dynamic loading method and dynamic loading device of double-core intelligent electric meter management unit
CN111562952A