Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for allocating electric energy meter resources, so as to solve the technical problems mentioned in the foregoing background art, or at least partially solve the technical problems mentioned in the foregoing background art.
In a first aspect, an embodiment of the present invention provides a method for allocating resources of an electric energy meter, including:
acquiring delivery application information and unit inventory information;
establishing an inventory safety deviation degree function according to the distribution application information and the unit inventory information;
and solving the stock safety deviation degree function through a genetic algorithm, and obtaining target allocation scheme information according to the fitness information of the genetic algorithm.
More specifically, the step of solving the stock safety deviation degree function through a genetic algorithm to obtain the target deployment scenario information specifically includes:
performing population initialization operation according to the distribution application information to obtain initialized population information;
naturally selecting the initialized population information according to the stock safety degree deviation function to obtain selected individual information;
carrying out variation processing on the selected individual information to obtain variant individual information; and updating the initialized population information according to the variant individual information until the initialized population information meets a preset target condition, and obtaining a target allocation scheme according to the fitness information of the genetic algorithm.
More specifically, the step of naturally selecting the initialized population information according to the stock safety degree deviation function to obtain the selected individual information specifically includes:
calculating the cost index of each individual in the initialized population information according to the stock safety degree deviation function, and initializing a population information cost index set;
sorting the cost indexes of each individual in the initialized population information cost index set to obtain sorting result information;
and obtaining the selected individual information according to the sorting result information.
More specifically, after obtaining the delivery application information, the method further includes:
auditing and analyzing the distribution application information to obtain analysis result information;
and if the analysis result information is qualified, establishing an inventory safety deviation degree function according to the distribution application information and the unit inventory information.
More specifically, the inventory safety deviation degree function is specifically:
St.
j represents a certain type of electric energy meter, and k represents the type and the number of electric energy meter equipment; x is the number ofidThe d-day delivery of unit i, CIiLower limit of safety stock of i units, MiIs the existing stock of unit i; CM (compact message processor)iThe unit I is the upper limit of the safety stock, T is the daily transport capacity of a metering center, and R is the monthly total demand of the city unit; pidThe safety stock deviation for day d of unit i.
In a second aspect, an embodiment of the present invention provides an electric energy meter resource allocating device, including:
the acquisition module is used for acquiring distribution application information and unit inventory information;
the analysis module is used for establishing an inventory safety deviation degree function according to the distribution application information and the unit inventory information;
and the distribution module is used for solving the stock safety deviation degree function through a genetic algorithm and obtaining target allocation scheme information according to the fitness information of the genetic algorithm.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method for allocating electric energy meter resources according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for allocating resources of an electric energy meter according to the first aspect.
According to the electric energy meter resource allocation method and device provided by the embodiment of the invention, the distribution application information and the unit inventory information are regularly acquired, so that the effectiveness of the acquired unit inventory information and the distribution application information can be effectively ensured, the inventory safety deviation degree function is established according to the effective unit inventory information and the distribution application information, the inventory safety deviation degree function is used for solving the minimum safety inventory deviation degree, then the inventory safety deviation degree function is solved through a genetic algorithm, the optimal target allocation scheme information is determined, and the accumulated electric energy meter resources are effectively allocated to the scarce city units of the electric energy meter through the optimal target allocation scheme information, so that the efficient utilization of the inventory electric energy meter is realized.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The electric energy meter resource allocation method described in the embodiment of the invention is implemented in a preset security deployment framework, and the preset security deployment framework comprises a security terminal layer, a security channel layer, a security access layer and a mobile application layer.
Wherein, the security terminal layer: the mobile terminal uses a special encryption algorithm and stores a private key or a digital certificate, a secure channel is established with a secure access gateway group through a mobile public network during communication, the digital certificate is adopted for identity authentication, and key communication data are encrypted and transmitted.
The safe channel layer realizes the connection of each external link and the system access network, realizes the network-level identity authentication through the route access control and the encrypted virtual special channel constructed by the VPN, and ensures the confidentiality and the integrity of data; access control of the boundary region is carried out through a firewall, and access application of illegal equipment is prevented; and configuring corresponding security monitoring systems for vulnerability scanning, intrusion detection and the like, and monitoring, protecting and managing access application potential safety hazards.
And the safety access layer is a middle area for external information issuing, information acquisition and data exchange, is a connection end point for the mobile terminal to access a safety intranet, and all application access is terminated at a safety authentication gateway. The security authentication gateway realizes SSL encryption and equipment identity authentication, and prevents illegal access and information leakage.
And the mobile application layer is used for acquiring services by a mobile application development platform deployed in the intranet after the data security penetration is finished and supporting the service application of the mobile terminal.
Fig. 1 is a schematic flow chart of a method for allocating resources of an electric energy meter according to an embodiment of the present invention, as shown in fig. 1, including:
step S1, obtaining distribution application information and unit stock information;
step S2, establishing a stock safety deviation degree function according to the distribution application information and the unit stock information;
and step S3, solving the stock safety deviation degree function through a genetic algorithm, and obtaining target allocation scheme information according to the fitness information of the genetic algorithm.
Specifically, the distribution application information described in the embodiment of the present invention refers to the electric energy meter demand amount application information submitted to the central server by each local market company.
The unit inventory information described in the embodiment of the invention refers to the electric energy meter inventory information of each local city unit, the safety inventory lower limit and the safety inventory upper limit of each local city unit, which are periodically submitted to the central server by each local city unit.
The stock safety deviation degree described in the embodiment of the invention refers to a preset deviation value related to the stock of each city unit electric energy meter.
The genetic algorithm fitness information described in the embodiment of the invention refers to the fitness information of each genetic algorithm individual finally obtained after the genetic algorithm is executed.
Step S1 is to report the distribution application information and unit inventory information of each local city unit to the central server periodically to ensure the real-time performance of the information.
Step S2 is specifically to establish an inventory safety deviation degree function according to the delivery application information and the unit inventory information, where the inventory safety deviation degree of a certain city unit i on the d-th day can be expressed as:
therefore, the stock deviation degree of all city units, i.e. the stock safety deviation degree function, is:
and the daily delivery amount x should satisfy the following constraint conditions:
wherein i represents a certain city unit, and m represents the number of total demand city units; d represents a certain day, and n represents the number of times of the current month; x is a radical of a fluorine atomidThe delivery volume of the unit of i city on d day, CIiIs the lower limit of i units of safety stock, MiIs the existing stock of unit i; CMiThe unit I is the upper limit of the safety stock, T is the daily transport capacity of a metering center, and R is the monthly total demand of the city unit; pidThe safety stock deviation for day d of unit i.
Then, through a genetic algorithm, N individuals are randomly generated within a transport capacity bearing range on the basis of meeting the requirements of each unit, each individual represents a daily distribution scheme capable of meeting the total requirements of the whole province, and then an initialized population is obtained according to a plurality of individuals.
Calculating the cost index of each individual in the initialized population through an inventory safety deviation degree function, taking the cost index as the fitness in a genetic algorithm to obtain a fitness calculation result, then sequencing the fitness, and selecting individual information according to sequencing result information.
After the individual information is selected, the selected individual information is processed to obtain variant individual information, then the variant individual information is naturally selected until a preset condition is met, and finally target allocation scheme information is obtained according to the fitness information of the genetic algorithm.
After the preset conditions are met, selecting the individual with the highest fitness information as the target deployment plan information from the remaining variant individual information.
The target allocation scheme information described in the embodiment of the invention is solved through a genetic algorithm, so that the deviation degree of the safety stock can be effectively controlled.
The embodiment of the invention can effectively ensure the effectiveness of the acquired unit inventory information and the delivery application information by regularly acquiring the delivery application information and the unit inventory information, thereby establishing an inventory safety deviation degree function according to the effective unit inventory information and the delivery application information, wherein the inventory safety deviation degree function is used for solving the minimum safety inventory deviation degree, then solving the inventory safety deviation degree function through a genetic algorithm, determining the optimal target allocation scheme information, and effectively allocating the overstocked electric energy meter resources to scarce city units of the electric energy meter through the optimal target allocation scheme information, thereby realizing the efficient utilization of the inventory electric energy meter.
On the basis of the above embodiment, the step of solving the stock safety deviation degree function through the genetic algorithm to obtain the target deployment scenario information specifically includes:
carrying out population initialization operation according to the distribution application information to obtain initialized population information;
naturally selecting the initialized population information according to the stock safety degree deviation function to obtain selected individual information;
carrying out variation processing on the selected individual information to obtain variant individual information; and updating the initialized population information according to the variant individual information until a preset target condition is met, and obtaining the target allocation scheme according to the fitness information of the genetic algorithm.
Specifically, the delivery application information for performing the population initialization operation described in the embodiment of the present invention may refer to any delivery application information.
The random distribution application information described in the embodiment of the invention is specifically subjected to population initialization operation, namely, randomly selecting any local city unit to obtain distribution demand application information of the local city unit; if the total demand of the city unit is less than the cargo capacity of one transport vehicle, all the vehicles are loaded, if the total demand of the city unit is greater than the cargo capacity of one vehicle, the vehicles randomly acquire electric energy to acquire the electric energy until the total demand of the city unit is met, and the steps are repeated until all the vehicles are full of the cargo; the initialization operation is repeated until a preset number of individuals are generated to form initialization population information, where the preset number of individuals described herein may refer to 1500 individuals.
Solving the cost index of an individual in the initialized population information through an inventory safety deviation degree function, taking the cost index as the fitness in a genetic algorithm to obtain a fitness calculation result, then sequencing the fitness, and selecting the individual information according to the sequencing result information.
The preset target condition described in the embodiments of the present invention may be that a preset training time is met, for example, training is completed for 30 minutes, or a preset iteration is met, for example, 40 iterations of the loop are met.
Naturally selecting the initialized population information according to an inventory safety degree deviation function to obtain selected individual information;
carrying out variation processing on the selected individual information to obtain variant individual information; and updating the initialized population information according to the variant individual information, and performing natural selection again, so as to repeat loop iteration.
The planning problem of the optimal solution can be effectively solved through the genetic algorithm, the requirement on the specialty of the computing equipment is not high, the problem requirement scene is met, the target allocation scheme information can be effectively determined, and therefore the deviation degree of the safety stock of the electric energy meter is controlled.
On the basis of the above embodiment, the step of naturally selecting the initialized population information according to the stock safety degree deviation function to obtain the selected individual information specifically includes:
calculating the cost index of each individual in the initialized population information according to an inventory safety degree deviation function to obtain an initialized population information cost index set;
sorting the cost indexes of each individual in the initialized population information cost index set to obtain sorting result information;
and obtaining the selected individual information according to the sorting result information.
Specifically, the selecting individual information according to the sorting result information is to sort the sorting result information from small to large, eliminate 80% of the individuals after the ranking, and reserve 20% of the individuals before the ranking, where the individuals that reserve 20% of the ranking described herein are the selecting individual information.
The embodiment of the invention takes the cost index as the fitness, so that the initialized population information is naturally selected, and the individual information with higher fitness is selected as the selected individual information, thereby being beneficial to the implementation of the subsequent steps.
On the basis of the above embodiment, after obtaining the delivery application information, the method further includes:
auditing and analyzing the distribution application information to obtain analysis result information;
and if the analysis result information is qualified, establishing the stock safety deviation degree function according to the distribution application information and the unit stock information.
Specifically, the checking and analyzing of the delivery application information described in the embodiment of the present invention means that whether the delivery application information is sent from an authorized legal terminal is analyzed, if the delivery application information is not sent from an authorized legal terminal, the analysis result information is unqualified, the delivery application information is invalid information, at this time, subsequent steps are not performed, and alarm information is sent out, and if the delivery application information is sent from an authorized legal terminal, the analysis result information is qualified, and an inventory safety deviation degree function is established according to the delivery application information and the unit inventory information.
According to the embodiment of the invention, the reliability of the distribution application information is effectively ensured and the safety is improved by verifying the distribution application information.
On the basis of the above embodiment, the inventory safety deviation degree function specifically includes:
St.
j represents a certain type of electric energy meter, and k represents the type and the number of electric energy meter equipment; x is the number ofidThe d-day delivery of unit i, CIiIs the lower limit of i units of safety stock, MiIs the existing stock of unit i; CM (compact message processor)iThe unit I is the upper limit of the safety stock, T is the daily transport capacity of a metering center, and R is the monthly total demand of the city unit; pidThe safety stock deviation degree of the d unit day.
Fig. 2 is a schematic structural diagram of a resource allocation device for an electric energy meter according to an embodiment of the present invention, as shown in fig. 2, including: an acquisition module 210, an analysis module 220, and a distribution module 230; the obtaining module 210 is configured to obtain delivery application information and unit inventory information; the analysis module 220 is configured to establish an inventory safety deviation degree function according to the delivery application information and the unit inventory information; the distribution module 230 is configured to solve the stock safety deviation degree function through a genetic algorithm, and obtain target allocation scheme information according to the fitness information of the genetic algorithm.
The apparatus provided in the embodiment of the present invention is used for executing the above method embodiments, and for details of the process and the details, reference is made to the above embodiments, which are not described herein again.
The embodiment of the invention can effectively ensure the effectiveness of the acquired unit inventory information and the acquired delivery application information by regularly acquiring the delivery application information and the unit inventory information, thereby establishing an inventory safety deviation degree function according to the effective unit inventory information and the delivery application information, wherein the inventory safety deviation degree function is used for solving the minimum safety inventory deviation degree, then solving the inventory safety deviation degree function through a genetic algorithm to determine the optimal target allocation scheme information, and effectively allocating the overstocked electric energy meter resources to the scarce city units of the electric energy meter through the optimal target allocation scheme information to realize the efficient utilization of the inventory electric energy meter.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 3, the electronic device may include: a processor (processor)310, a communication Interface (communication Interface)320, a memory (memory)330 and a communication bus 340, wherein the processor 310, the communication Interface 320 and the memory 330 communicate with each other via the communication bus 340. The processor 310 may call logic instructions in the memory 330 to perform the following method: acquiring distribution application information and unit inventory information; establishing an inventory safety deviation degree function according to the delivery application information and the unit inventory information; and solving the stock safety deviation degree function through a genetic algorithm, and obtaining target allocation scheme information according to the fitness information of the genetic algorithm.
In addition, the logic instructions in the memory 330 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
An embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the methods provided by the above method embodiments, for example, the method includes: acquiring distribution application information and unit inventory information; establishing an inventory safety deviation degree function according to the distribution application information and the unit inventory information; and solving the stock safety deviation degree function through a genetic algorithm, and obtaining target allocation scheme information according to the fitness information of the genetic algorithm.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing server instructions, where the server instructions cause a computer to execute the method provided by the foregoing embodiments, for example, including: acquiring distribution application information and unit inventory information; establishing an inventory safety deviation degree function according to the distribution application information and the unit inventory information; and solving the stock safety deviation degree function through a genetic algorithm, and obtaining target allocation scheme information according to the fitness information of the genetic algorithm.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on the understanding, the above technical solutions substantially or otherwise contributing to the prior art may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.