Search

CN-116246450-B - Ammeter data processing method, ammeter data processing device, computer equipment and storage medium

CN116246450BCN 116246450 BCN116246450 BCN 116246450BCN-116246450-B

Abstract

The application relates to an ammeter data processing method, an ammeter data processing device, computer equipment, a storage medium and a computer program product. The method comprises the steps of creating terminal objects corresponding to a plurality of electric meters respectively, enabling the terminal objects to be used for collecting electric meter data of the electric meters, obtaining current load rates corresponding to a plurality of servers respectively, connecting each terminal object with a corresponding server based on each current load rate, creating a terminal handle corresponding to the terminal object based on a handle red-black tree corresponding to the server connected with the terminal object, adding the created terminal handle into the corresponding handle red-black tree, and writing the electric meter data collected by the terminal object into a memory pool corresponding to the server connected with the terminal object based on the terminal handle corresponding to the terminal object. By adopting the method, the data processing efficiency of the ammeter can be improved.

Inventors

  • WEI HUAJIE
  • CHEN MIN
  • XUE BING
  • ZHUANG WANLING
  • LIU DI
  • LIU JUNWEI

Assignees

  • 深圳供电局有限公司

Dates

Publication Date
20260512
Application Date
20230104

Claims (10)

  1. 1. A method for processing ammeter data, the method comprising: creating terminal objects corresponding to the electric meters respectively, wherein the terminal objects are used for collecting electric meter data of the electric meters; Acquiring current load rates corresponding to the servers respectively, and connecting each terminal object with the corresponding server based on each current load rate; Creating a terminal handle corresponding to the terminal object based on a handle red-black tree corresponding to a server connected with the terminal object, and adding the created terminal handle into the corresponding handle red-black tree; based on the terminal handle corresponding to the terminal object, writing the ammeter data acquired by the terminal object into a memory pool corresponding to a server connected with the terminal object; The method comprises the steps of obtaining a kernel task corresponding to a current server, wherein the kernel task refers to an ammeter data processing task realized based on information transmission in kernel space and data processing directly performed in a memory pool; the method comprises the steps of transmitting supplementary data corresponding to a kernel task into a memory pool of a current server, wherein the supplementary data are other data which are not contained in the memory pool and are required by completing the kernel task, and the supplementary data are ammeter alarm information when the kernel task is ammeter alarm response; And processing the kernel task in the memory pool of the current server based on the ammeter data and the supplementary data in the memory pool of the current server to obtain a corresponding processing result.
  2. 2. The method of claim 1, wherein the obtaining the current load rates respectively corresponding to the plurality of servers includes: Obtaining the current connection number and the maximum connection number corresponding to each server respectively; And taking the ratio between the current connection number and the maximum connection number corresponding to the same server as the current load rate corresponding to the server, and obtaining the current load rates respectively corresponding to the servers.
  3. 3. The method according to claim 1, wherein the connecting each terminal object with a corresponding server based on each current load factor, comprises: Determining a current terminal object from all terminal objects, wherein the determining process of the current terminal object comprises the steps of determining the priority corresponding to the terminal object based on the importance degree of the geographical area of the ammeter corresponding to the terminal object; Determining the priority corresponding to the terminal object based on the importance degree of the ammeter corresponding to the terminal object in the power system; Determining the priority corresponding to the terminal object based on the emergency degree of the ammeter data recorded by the terminal object in the corresponding data processing task; when determining a current terminal object from all terminal objects, determining the current terminal object based on priorities corresponding to all terminal objects respectively; connecting the current terminal object with the target server; updating the current load rate corresponding to the target server; and returning to the step of determining the current terminal from the terminal objects until the terminal objects are connected with the corresponding servers.
  4. 4. The method according to claim 1, wherein the method further comprises: And after the ammeter data acquired by the terminal object are written into the memory pool corresponding to the server connected with the terminal object, the connection between the terminal object and the corresponding server is disconnected.
  5. 5. The method according to claim 1, wherein the method further comprises: respectively creating corresponding monitoring threads for each terminal object; based on each monitoring thread, the ammeter operation of each ammeter is monitored in parallel through each terminal object.
  6. 6. The method according to claim 1, wherein the method further comprises: Acquiring an asynchronous read request queue; Determining a target asynchronous read request from the asynchronous read request queue, and determining a target terminal handle corresponding to the target asynchronous read request; reading ammeter data from a corresponding memory pool based on the target terminal handle; When the read ammeter data is empty, sending an ammeter data acquisition request to a terminal object associated with the target terminal handle; And reading the ammeter data from the corresponding memory pool again based on the target terminal handle.
  7. 7. The method of claim 6, wherein the determining a target asynchronous read request from the asynchronous read request queue, determining a target terminal handle corresponding to the target asynchronous read request, comprises: Recording the time of receiving the asynchronous read request, and giving higher priority to the asynchronous read request with earlier receiving time; Determining the quantity of the data of the electric meter required in the asynchronous read request, and giving higher priority to the asynchronous read request with the smaller quantity of the data of the electric meter required; Determining the predicted processing time of the asynchronous read request, and giving higher priority to the asynchronous read request with shorter predicted processing time; And determining the target asynchronous read request from each asynchronous read request in an asynchronous read request queue based on the priority corresponding to each asynchronous read request.
  8. 8. An electricity meter data processing device, the device comprising: the terminal object creating module is used for creating terminal objects corresponding to the electric meters respectively, wherein the terminal objects are used for collecting the electric meter data of the electric meters; The terminal object connection module is used for acquiring current load rates corresponding to the servers respectively and connecting each terminal object with the corresponding server based on each current load rate; the terminal handle creation module is used for creating a terminal handle corresponding to the terminal object based on the handle red-black tree corresponding to the server connected with the terminal object, and adding the created terminal handle into the corresponding handle red-black tree; The ammeter data writing module is used for writing ammeter data acquired by the terminal object into a memory pool corresponding to a server connected with the terminal object based on the terminal handle corresponding to the terminal object; the system comprises a core task response module, a core task processing module and a processing module, wherein the core task response module is used for acquiring a core task corresponding to a current server, the core task refers to an ammeter data processing task realized based on message transmission of a core space and data processing directly performed in a memory pool, the core task comprises ammeter data analysis, ammeter alarm response and ammeter state analysis, supplementary data corresponding to the core task are transmitted to the memory pool of the current server, the supplementary data refer to other data which are not contained in the memory pool and are required for completing the core task, when the core task is an ammeter alarm response, the supplementary data are ammeter alarm information, when the core task is ammeter state analysis, the supplementary data are ammeter state information, and the core task is processed in the memory pool of the current server based on ammeter data and the supplementary data in the memory pool of the current server to obtain a corresponding processing result.
  9. 9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
  10. 10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.

Description

Ammeter data processing method, ammeter data processing device, computer equipment and storage medium Technical Field The present application relates to the field of electric power technology, and in particular, to an electric meter data processing method, an electric meter data processing device, a computer device, a storage medium, and a computer program product. Background Along with the construction and perfection of the electric power information system, an electric meter data acquisition technology appears, wherein the electric meter acquisition technology is used for acquiring electric meter data of each electric meter in the electric power information system and transmitting the data to a corresponding system. However, the traditional method is to manually collect and transmit the ammeter data, and the mode of manually processing the ammeter data is time-consuming and labor-consuming, so that the problem of low ammeter data processing efficiency exists. Disclosure of Invention In view of the foregoing, it is desirable to provide an ammeter data processing method, apparatus, computer device, computer readable storage medium, and computer program product that can improve ammeter data processing efficiency. The application provides an ammeter data processing method. The method comprises the following steps: Creating terminal objects corresponding to the electric meters respectively, wherein the terminal objects are used for collecting electric meter data of the electric meters; Acquiring current load rates corresponding to the servers respectively, and connecting each terminal object with the corresponding server based on each current load rate; Creating a terminal handle corresponding to the terminal object based on a handle red-black tree corresponding to a server connected with the terminal object, and adding the created terminal handle into the corresponding handle red-black tree; and writing the ammeter data acquired by the terminal object into a memory pool corresponding to a server connected with the terminal object based on the terminal handle corresponding to the terminal object. The application also provides an ammeter data processing device. The device comprises: The terminal object creating module is used for creating terminal objects corresponding to the electric meters respectively, wherein the terminal objects are used for collecting electric meter data of the electric meters; The terminal object connection module is used for acquiring current load rates corresponding to the servers respectively and connecting each terminal object with the corresponding server based on each current load rate; the terminal handle creation module is used for creating a terminal handle corresponding to the terminal object based on the handle red-black tree corresponding to the server connected with the terminal object, and adding the created terminal handle into the corresponding handle red-black tree; and the ammeter data writing module is used for writing ammeter data acquired by the terminal object into a memory pool corresponding to a server connected with the terminal object based on the terminal handle corresponding to the terminal object. A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps of the ammeter data processing method when executing the computer program. A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the above-described meter data processing method. A computer program product comprising a computer program which, when executed by a processor, performs the steps of the above-described meter data processing method. The ammeter data processing method, the ammeter data processing device, the computer equipment, the storage medium and the computer program product are used for respectively creating corresponding terminal objects for each ammeter and collecting ammeter data of the ammeter based on the terminal objects. And then the current load rates corresponding to the servers are obtained, the servers respectively connected with the terminal objects are determined based on the current load rates, and the server resources can be fully utilized, so that the data processing efficiency of the ammeter is improved. Creating a terminal handle corresponding to the terminal object based on the handle red-black tree corresponding to the server connected with the terminal object, adding the terminal handle corresponding to each terminal object into the corresponding red-black tree, and writing the ammeter data acquired by the terminal object into a memory pool corresponding to the server connected with the terminal object based on the terminal handle corresponding to the terminal object. And creating corresponding terminal handles for each terminal object, adding corresponding handle red-black trees, and managing the terminal objects corre