CN114528121A - Power grid standing book data distribution method and device - Google Patents

Power grid standing book data distribution method and device Download PDF

Info

Publication number
CN114528121A
CN114528121A CN202210014986.2A CN202210014986A CN114528121A CN 114528121 A CN114528121 A CN 114528121A CN 202210014986 A CN202210014986 A CN 202210014986A CN 114528121 A CN114528121 A CN 114528121A
Authority
CN
China
Prior art keywords
data
power grid
kafka
server
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210014986.2A
Other languages
Chinese (zh)
Inventor
林镇锋
何赞园
梁雷
王强
赵铭
周海
刘兆平
田松林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Digital Power Grid Research Institute of China Southern Power Grid Co Ltd
Original Assignee
Shenzhen Digital Power Grid Research Institute of China Southern Power Grid Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Digital Power Grid Research Institute of China Southern Power Grid Co Ltd filed Critical Shenzhen Digital Power Grid Research Institute of China Southern Power Grid Co Ltd
Priority to CN202210014986.2A priority Critical patent/CN114528121A/en
Publication of CN114528121A publication Critical patent/CN114528121A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Abstract

The invention discloses a power grid ledger data distribution method and a power grid ledger data distribution device, wherein the method comprises the following steps: acquiring a plurality of power grid standing book data; uploading the plurality of power grid standing book data to a server; generating a kafka message according to the plurality of power grid ledger data, and issuing the kafka message to kafka proxy service; the kafka proxy service is used for receiving the subscription of any target distribution terminal and sending the kafka message to the target distribution terminal; and the target distribution terminal is used for acquiring the corresponding power grid ledger data on the server according to the kafka message. Therefore, the method and the device can realize the arrangement and distribution of a large amount of power grid account data by utilizing the characteristics of the kafka mechanism, so that the distribution of the power grid account data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced, and the problem caused by the increasing of the power grid account data is solved.

Description

Power grid standing book data distribution method and device
Technical Field
The invention relates to the technical field of power grid data distribution, in particular to a power grid standing book data distribution method and device.
Background
In the existing power grid account data distribution scene, data uploading and downloading are only carried out by using a data server, and for the increasing of the existing account data, a large amount of on-line account data are increased every day, and the power grid data need to be synchronized in real time, so that the power grid account data distribution scene is completely unadaptable. Therefore, the existing power grid account data distribution technology has defects, and a more efficient and more convenient power grid account data distribution scheme needs to be provided urgently.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method and a device for distributing power grid account data, so that the distribution of the power grid account data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced, so that the problem caused by the increasing of the power grid account data is solved.
In order to solve the technical problem, a first aspect of the present invention discloses a power grid ledger data distribution method, including:
acquiring a plurality of power grid standing book data;
uploading the plurality of power grid standing book data to a server;
generating a kafka message according to the plurality of power grid ledger data, and issuing the kafka message to kafka proxy service; the kafka proxy service is used for receiving the subscription of any target distribution terminal and sending the kafka message to the target distribution terminal; and the target distribution terminal is used for acquiring the corresponding power grid ledger data on the server according to the kafka message.
As an optional implementation manner, in the first aspect of the present invention, the uploading the plurality of grid ledger data to a server includes:
screening the plurality of power grid account data to obtain a plurality of account attribute data;
and serializing the standing book attribute data to generate a plurality of sequence object files, and uploading the sequence object files to a server.
As an optional implementation manner, in the first aspect of the present invention, the ledger attribute data includes at least one of a function attribute, a location attribute, an equipment attribute, a component attribute, a hierarchical relationship attribute, a technical parameter attribute, and a change record attribute; and/or the naming of the sequence object file comprises at least one of a function attribute, a position attribute, an equipment attribute and a component attribute; and/or the sequence object file is a json object file; and/or, the uploading the plurality of sequence object files to a server comprises:
packaging the sequence object files into at least one compressed package file and uploading the compressed package file to a server; the server is an SFTP server.
As an optional implementation manner, in the first aspect of the present invention, the generating a kafka message according to the plurality of grid ledger data includes:
for any one compressed package file, determining data information corresponding to the compressed package file; the data information comprises data type information, a server directory path, a data service type and data time information;
and generating a kafka message corresponding to the compressed package file according to the data information.
As an optional implementation manner, in the first aspect of the present invention, after generating, according to the data information, a kafka message corresponding to the compressed package file, the method further includes:
grouping the generated kafka messages to obtain a plurality of groups;
an ID for each of the groups is determined.
As an optional implementation manner, in the first aspect of the present invention, the target distribution terminal is specifically configured to execute the following steps to obtain, on the server, the corresponding grid ledger data according to the kafka message:
subscribing to a message to the kafka proxy service and receiving the kafka message sent by the kafka proxy service based on the group ID;
and according to the kafka message, acquiring the corresponding compressed packet file on the server, decompressing the compressed packet file to obtain the sequence object file, and analyzing and objectifying the sequence object file to obtain the corresponding power grid ledger data.
As an optional implementation manner, in the first aspect of the present invention, the obtaining, according to the kafka message, the corresponding compressed packet file on the server, decompressing the compressed packet file to obtain the sequence object file, and performing parsing and objectification processing on the sequence object file to obtain the corresponding power grid ledger data includes:
according to the server directory path in the kafka message, acquiring the corresponding compressed package file on the server;
decompressing the compressed packet file to obtain the sequence object file;
and analyzing and objectifying the sequence object file according to the naming of the sequence object file to obtain the corresponding power grid ledger data.
The second aspect of the embodiment of the invention discloses a power grid ledger data distribution device, which comprises:
the acquisition module is used for acquiring a plurality of power grid ledger data;
the uploading module is used for uploading the plurality of power grid ledger data to a server;
the issuing module is used for generating kafka messages according to the plurality of power grid ledger data and issuing the kafka messages to kafka proxy services; the kafka proxy service is used for receiving subscription of any target distribution terminal and sending the kafka message to the target distribution terminal; and the target distribution terminal is used for acquiring the corresponding power grid ledger data on the server according to the kafka message.
As an optional implementation manner, in the second aspect of the present invention, a specific manner of uploading the plurality of grid ledger data to a server by the upload module includes:
screening the plurality of power grid account data to obtain a plurality of account attribute data;
and serializing the standing book attribute data to generate a plurality of sequence object files, and uploading the sequence object files to a server.
As an optional implementation manner, in the second aspect of the present invention, the ledger attribute data includes at least one of a function attribute, a location attribute, an equipment attribute, a component attribute, a hierarchical relationship attribute, a technical parameter attribute, and a change record attribute; and/or the naming of the sequence object file comprises at least one of a function attribute, a position attribute, an equipment attribute and a component attribute; and/or the sequence object file is a json object file; and/or the specific way of uploading the plurality of sequence object files to the server by the uploading module comprises the following steps:
packaging the sequence object files into at least one compressed package file and uploading the compressed package file to a server; the server is an SFTP server.
As an optional implementation manner, in the second aspect of the present invention, a specific manner in which the issuing module generates the kafka message according to the plurality of grid ledger data includes:
for any one compressed package file, determining data information corresponding to the compressed package file; the data information comprises data type information, a server directory path, a data service type and data time information;
and generating a kafka message corresponding to the compressed package file according to the data information.
As an optional implementation manner, in the second aspect of the present invention, the apparatus further includes a grouping module, configured to, after the publishing module generates the kafka message corresponding to the compressed package file according to the data information, perform the following steps:
grouping the generated plurality of kafka messages to obtain a plurality of groups;
an ID for each of the groups is determined.
As an optional implementation manner, in the second aspect of the present invention, the target distribution terminal is specifically configured to execute the following steps to obtain the corresponding grid ledger data on the server according to the kafka message:
subscribing to a message to the kafka proxy service and receiving the kafka message sent by the kafka proxy service based on the group ID;
and according to the kafka message, acquiring the corresponding compressed packet file on the server, decompressing the compressed packet file to obtain the sequence object file, and analyzing and objectifying the sequence object file to obtain the corresponding power grid ledger data.
As an optional implementation manner, in the second aspect of the present invention, a specific manner in which the target distribution terminal obtains the corresponding compressed package file from the server according to the kafka message, decompresses the compressed package file to obtain the sequence object file, and performs parsing and objectification processing on the sequence object file to obtain the corresponding grid ledger data includes:
acquiring the corresponding compressed package file on the server according to the server directory path in the kafka message;
decompressing the compressed packet file to obtain the sequence object file;
and analyzing and objectifying the sequence object file according to the naming of the sequence object file to obtain the corresponding power grid ledger data.
The third aspect of the invention discloses another power grid standing book data distribution device, which comprises:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program codes stored in the memory to execute part or all of the steps of the power grid standing book data distribution method disclosed by the first aspect of the invention.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the embodiment of the invention discloses a power grid ledger data distribution method and a power grid ledger data distribution device, wherein the method comprises the following steps: acquiring a plurality of power grid ledger data; uploading the plurality of power grid standing book data to a server; generating a kafka message according to the plurality of power grid ledger data, and issuing the kafka message to kafka proxy service; the kafka proxy service is used for receiving subscription of any target distribution terminal and sending the kafka message to the target distribution terminal; and the target distribution terminal is used for acquiring the corresponding power grid ledger data on the server according to the kafka message. Therefore, the embodiment of the invention can realize the arrangement and distribution of a large amount of power grid account data by utilizing the characteristic of the kafka mechanism, so that the distribution of the power grid account data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced, so that the problem caused by the increasing of the power grid account data is solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a power grid ledger data distribution method disclosed in an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of a power grid ledger data distribution apparatus disclosed in the embodiment of the present invention.
Fig. 3 is a schematic structural diagram of another power grid ledger data distribution apparatus disclosed in the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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 only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The terms "first," "second," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, product, or apparatus that comprises a list of steps or elements is not limited to those listed but may alternatively include other steps or elements not listed or inherent to such process, method, product, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The invention discloses a power grid account data distribution method and device, which can realize the arrangement and distribution of a large amount of power grid account data by utilizing the characteristic of a kafka mechanism, so that the distribution of the power grid account data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced, so that the problem caused by the increasing of the power grid account data is solved. The following are detailed below.
Example one
Referring to fig. 1, fig. 1 is a schematic flow chart of a power grid ledger data distribution method according to an embodiment of the present invention. The power grid standing book data distribution processing method described in fig. 1 may be applied to a power grid standing book data distribution processing chip, a power grid standing book data distribution processing terminal, or a power grid standing book data distribution processing server (where the power grid standing book data distribution processing server may be a local server or a cloud server).
As shown in fig. 1, the grid ledger data distribution method may include the operations of:
101. and acquiring a plurality of power grid standing book data.
Optionally, the grid ledger data may be work order data in the grid, such as operation data, processing result data, parameter data, or parameter change record data of the device, and may also include related information of the associated device.
102. And uploading the plurality of power grid standing book data to a server.
103. And generating a kafka message according to the plurality of power grid ledger data, and issuing the kafka message to a kafka proxy service.
Optionally, the kafka proxy service is configured to receive a subscription of any one target distribution terminal and send a kafka message to the target distribution terminal, where the target distribution terminal is configured to obtain corresponding power grid ledger data on the server according to the kafka message. Alternatively, the kafka proxy service may be deployed in a server cluster composed of one server or a plurality of server nodes, and connected to a plurality of target distribution terminals through a network. Optionally, the target distribution terminal may be a query system or a terminal of a third party.
The kafka proxy service has the following advantages:
1. high throughput, low latency: the kafka proxy service can handle hundreds of thousands of messages per second with a minimum delay of only a few milliseconds.
2. Expandability: the server cluster where the kafka proxy service resides supports hot-scaling.
3. Durability and reliability: the kafka message is persisted to local disk and supports data backup against data loss.
4. Fault tolerance: allowing the nodes in the server cluster where the kafka proxy service is located to fail (if the number of copies is n, allowing n-1 nodes to fail).
5. High concurrency: thousands of clients are supported to read and write simultaneously.
Therefore, the embodiment of the invention can realize the arrangement and distribution of a large amount of power grid account data by utilizing the characteristics of the kafka mechanism, so that the distribution of the power grid account data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced, so that the problem caused by the increasing of the power grid account data is solved.
As an optional implementation manner, in step 102, uploading the plurality of grid ledger data to the server includes:
screening the multiple power grid account data to obtain multiple account attribute data;
and serializing the standing book attribute data to generate a plurality of sequence object files, and uploading the sequence object files to a server.
Optionally, the ledger attribute data includes at least one of a function attribute, a location attribute, an equipment attribute, a component attribute, a hierarchical relationship attribute, a technical parameter attribute, and a change record attribute.
Optionally, the naming of the sequence object file includes at least one of a function attribute, a location attribute, a device attribute, and a component attribute.
Optionally, the sequence object file is a json object file.
Optionally, in the above step, uploading a plurality of sequence object files to a server includes:
and packaging the plurality of sequence object files into at least one compressed package file and uploading the compressed package file to a server.
Optionally, the server is an SFTP server. Optionally, the format of the compressed package file may be a ZIP format or an RAR format.
Therefore, by implementing the optional implementation mode, multiple pieces of power grid account data can be screened to obtain multiple pieces of account attribute data, multiple pieces of account attribute data are serialized to generate multiple sequence object files, and the multiple sequence object files are uploaded to the server, so that the sequence object files can be conveniently distributed and downloaded subsequently, and the serialized files are uniform in format and convenient to transmit, encrypt and check.
As an optional implementation manner, in the step 103, generating the kafka message according to the multiple grid ledger data includes:
for any compressed package file, determining data information corresponding to the compressed package file;
and generating a kafka message corresponding to the compressed package file according to the data information.
Optionally, the data information includes data type information, server directory path, data service type and data time information, and correspondingly, the kafka message may define information such as the data type information, the server directory path, the data service type and the data time information, so as to facilitate identification and processing of a subsequent target distribution terminal.
Therefore, by implementing the optional implementation mode, the data information corresponding to any compressed package file can be determined, and the kafka message corresponding to the compressed package file is generated according to the data information, so that the subsequent kafka message can be used for indicating the data information of the compressed package file during distribution and transmission, the serialized file formats are uniform, transmission and encryption inspection are facilitated, distribution of the power grid ledger data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced.
As an optional implementation manner, after generating the kafka message corresponding to the compressed package file according to the data information in the above step, the method further includes:
grouping the generated plurality of kafka messages to obtain a plurality of groups;
the ID of each group is determined.
Therefore, by implementing the optional implementation mode, the generated plurality of kafka messages can be grouped to obtain a plurality of groups, and the ID of each group is determined, so that the subsequent target distribution terminal can conveniently realize subscription and reception of the messages according to the ID of the group, the distribution of the grid ledger data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced.
As an optional implementation manner, the target distribution terminal is specifically configured to perform the following steps to obtain, on the server, corresponding grid ledger data according to the kafka message:
subscribing a message to the kafka proxy service, and receiving the kafka message sent by the kafka proxy service based on the group ID;
and according to the kafka message, acquiring a corresponding compressed package file on the server, decompressing the compressed package file to obtain a sequence object file, and analyzing and objectifying the sequence object file to obtain corresponding power grid ledger data.
Therefore, by implementing the optional implementation mode, the target distribution terminal can acquire the corresponding power grid account data on the server according to the kafka message, so that the distribution of the power grid account data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced.
As an optional implementation manner, in the above steps, according to the kafka message, obtaining a corresponding compressed packet file on the server, decompressing the compressed packet file to obtain a sequence object file, and performing parsing and objectification processing on the sequence object file to obtain corresponding power grid ledger data, includes:
acquiring a corresponding compressed package file on a server according to a server directory path in the kafka message;
decompressing the compressed packet file to obtain a sequence object file;
and analyzing and objectifying the sequence object file according to the naming of the sequence object file to obtain corresponding power grid ledger data.
Therefore, by implementing the optional implementation mode, the target distribution terminal can acquire the corresponding power grid account data on the server according to the kafka message, so that the distribution of the power grid account data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced.
In a specific embodiment, the invention can be implemented as a big data device ledger data synchronization service tool according to the above embodiment, which implements high concurrency based on the kafka technology, can implement that ten thousand levels of online work order data are synchronized and provided to a third party system in real time every day in the case that ledger data is increasing day by day, and has the characteristics of adopting kafka high concurrency, issuing subscriptions and the like.
Specifically, the entity objects such as the function position, the device, the component, the hierarchical relationship, the technical parameter, the change record and the like in the ledger data are serialized into JSON object files, the naming rule of the object files is that the function position (FL), the Device (DE), and the component (PA) are taken as the beginning, then all the object files are packaged into zip files to be uploaded into the SFTP service and generate kafka messages, and the kafka messages are defined with the data type, the SFTP directory path, the service type and the data time, and are grouped to define the group ID.
Specifically, the tool publishes the kafka message to kafka proxy service, a third-party system subscribes the message, receives the message according to the message group ID for consumption, analyzes the SFTP directory path in the message, downloads a zip file through the SFTP directory path, and analyzes the JSON file according to the file naming rule. And finally, performing objectification processing on the JSON file data and storing the JSON file data into a database.
Example two
Referring to fig. 2, fig. 2 is a schematic structural diagram of a power grid ledger data distribution apparatus according to an embodiment of the present invention. The power grid account data distribution processing apparatus described in fig. 2 may be applied to a power grid account data distribution processing chip, a power grid account data distribution processing terminal, or a power grid account data distribution processing server (where the power grid account data distribution processing server may be a local server or a cloud server).
As shown in fig. 2, the grid ledger data distribution apparatus may include:
the obtaining module 201 is configured to obtain a plurality of grid ledger data.
Optionally, the grid ledger data may be work order data in the grid, such as operation data, processing result data, parameter data, or parameter change record data of the device, and may also include related information of the associated device.
And an uploading module 202, configured to upload the multiple pieces of power grid ledger data to a server.
And the publishing module 203 is used for generating a kafka message according to the plurality of power grid ledger data and publishing the kafka message to the kafka proxy service.
Optionally, the kafka proxy service is configured to receive a subscription of any one target distribution terminal and send a kafka message to the target distribution terminal, where the target distribution terminal is configured to obtain corresponding power grid ledger data on the server according to the kafka message. Alternatively, the kafka proxy service may be deployed in a server cluster composed of one server or a plurality of server nodes, and connected to a plurality of target distribution terminals through a network. Optionally, the target distribution terminal may be a query system or a terminal of a third party.
The kafka proxy service has the following advantages:
1. high throughput, low latency: the kafka proxy service can handle hundreds of thousands of messages per second with a minimum delay of only a few milliseconds.
2. And (3) expandability: the server cluster where the kafka proxy service resides supports hot-scaling.
3. Durability and reliability: the kafka message is persisted to local disk and supports data backup against data loss.
4. Fault tolerance: allowing the nodes in the server cluster where the kafka proxy service is located to fail (if the number of copies is n, allowing n-1 nodes to fail).
5. High concurrency: thousands of clients are supported to read and write simultaneously.
Therefore, the embodiment of the invention can realize the arrangement and distribution of a large amount of power grid account data by utilizing the characteristic of the kafka mechanism, so that the distribution of the power grid account data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced, and the problem caused by the increasing of the power grid account data is solved.
As an optional implementation manner, a specific manner in which the uploading module 202 uploads the plurality of grid ledger data to the server includes:
screening the multiple power grid account data to obtain multiple account attribute data;
and serializing the standing book attribute data to generate a plurality of sequence object files, and uploading the sequence object files to a server.
Optionally, the ledger attribute data includes at least one of a function attribute, a location attribute, an equipment attribute, a component attribute, a hierarchical relationship attribute, a technical parameter attribute, and a change record attribute.
Optionally, the naming of the sequence object file includes at least one of a function attribute, a location attribute, a device attribute, and a component attribute.
Optionally, the sequence object file is a json object file.
Optionally, the specific manner for uploading the sequence object files to the server by the uploading module 202 includes:
and packaging the plurality of sequence object files into at least one compressed package file and uploading the compressed package file to a server.
Optionally, the server is an SFTP server. Optionally, the format of the compressed package file may be a ZIP format or an RAR format.
Therefore, by implementing the optional implementation mode, multiple pieces of power grid account data can be screened to obtain multiple pieces of account attribute data, multiple pieces of account attribute data are serialized to generate multiple sequence object files, and the multiple sequence object files are uploaded to the server, so that the sequence object files can be conveniently distributed and downloaded subsequently, and the serialized files are uniform in format and convenient to transmit, encrypt and check.
As an optional implementation manner, the specific manner in which the issuing module 203 generates the kafka message according to the plurality of grid ledger data includes:
for any compressed package file, determining data information corresponding to the compressed package file;
and generating a kafka message corresponding to the compressed package file according to the data information.
Optionally, the data information includes data type information, server directory path, data service type, and data time information, and correspondingly, the kafka message may define information such as the data type information, the server directory path, the data service type, and the data time information, so as to facilitate identification and processing of a subsequent target distribution terminal.
Therefore, by implementing the optional implementation mode, the data information corresponding to any compressed package file can be determined, and the kafka message corresponding to the compressed package file is generated according to the data information, so that the subsequent kafka message can be used for indicating the data information of the compressed package file during distribution and transmission, the serialized file formats are uniform, transmission and encryption inspection are facilitated, distribution of the power grid ledger data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced.
As an optional implementation manner, the apparatus further includes a grouping module, configured to, after the publishing module 203 generates the kafka message corresponding to the compressed package file according to the data information, perform the following steps:
grouping the generated plurality of kafka messages to obtain a plurality of groups;
the ID of each group is determined.
Therefore, by implementing the optional implementation manner, the generated plurality of kafka messages can be grouped to obtain a plurality of groups, and the ID of each group is determined, so that the subsequent target distribution terminal can conveniently realize subscription and reception of the messages according to the ID of the group, the distribution of the grid ledger data is more efficient and convenient, and the error rate of the data distribution can be effectively reduced.
As an optional implementation manner, the target distribution terminal is specifically configured to perform the following steps to obtain, on the server, corresponding grid ledger data according to the kafka message:
subscribing the message to the kafka proxy service and receiving the kafka message sent by the kafka proxy service based on the group ID;
and according to the kafka message, acquiring a corresponding compressed packet file on the server, decompressing the compressed packet file to obtain a sequence object file, and analyzing and objectifying the sequence object file to obtain corresponding power grid ledger data.
Therefore, by implementing the optional implementation mode, the target distribution terminal can acquire the corresponding power grid account data on the server according to the kafka message, so that the distribution of the power grid account data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced.
As an optional implementation manner, a specific manner in which the target distribution terminal acquires a corresponding compressed packet file from the server according to the kafka message, decompresses the compressed packet file to obtain a sequence object file, and performs analysis and objectification processing on the sequence object file to obtain corresponding power grid ledger data includes:
acquiring a corresponding compressed package file on a server according to a server directory path in the kafka message;
decompressing the compressed packet file to obtain a sequence object file;
and analyzing and objectifying the sequence object file according to the naming of the sequence object file to obtain corresponding power grid ledger data.
Therefore, by implementing the optional implementation mode, the target distribution terminal can acquire the corresponding power grid account data on the server according to the kafka message, so that the distribution of the power grid account data is more efficient and convenient, and meanwhile, the error rate of data distribution can be effectively reduced.
In a specific embodiment, the invention can be implemented as a big data device ledger data synchronization service tool according to the above embodiment, which implements high concurrency based on the kafka technology, can implement that ten thousand levels of online work order data are synchronized and provided to a third party system in real time every day in the case that ledger data is increasing day by day, and has the characteristics of adopting kafka high concurrency, issuing subscriptions and the like.
Specifically, it may first serialize the entity objects such as function location, device, component, hierarchy, technical parameter, change record, etc. in the ledger data into JSON object files, with the naming rule of the object files being with Function Location (FL), Device (DE), and component (PA) as the beginning, then pack all the object files into zip files to upload to SFTP service and generate kafka message, with data type, SFTP directory path, service type, and data time defined in the kafka message, and group the kafka messages to define group ID.
Specifically, the tool publishes the kafka message to kafka proxy service, a third-party system subscribes the message, receives the message according to the message group ID for consumption, analyzes the SFTP directory path in the message, downloads a zip file through the SFTP directory path, and analyzes the JSON file according to the file naming rule. And finally, performing objectification processing on the JSON file data and storing the JSON file data into a database.
EXAMPLE III
Referring to fig. 3, fig. 3 is a diagram of another grid ledger data distribution apparatus according to an embodiment of the present invention. The user profile determination apparatus described in fig. 3 may be applied to a power grid account data distribution processing chip, a power grid account data distribution processing terminal, or a power grid account data distribution processing server (where the server may be a local server or a cloud server). As shown in fig. 3, the grid ledger data distribution apparatus may include:
a memory 301 storing executable program code;
a processor 302 coupled to the memory 301;
the processor 302 calls the executable program code stored in the memory 301, so as to execute the steps of the grid ledger data distribution method described in the first embodiment.
Example four
The embodiment of the invention discloses a computer-readable storage medium which stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute the steps of the power grid ledger data distribution method described in the first embodiment.
EXAMPLE five
The embodiment of the invention discloses a computer program product, which comprises a non-transitory computer readable storage medium storing a computer program, wherein the computer program is operable to make a computer execute the steps of the power grid ledger data distribution method described in the first embodiment.
While certain embodiments of the present disclosure have been described above, other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily have to be in the particular order shown or in sequential order to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, device, and non-volatile computer-readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to some portions of the description of the method embodiments.
The apparatus, the device, the nonvolatile computer readable storage medium, and the method provided in the embodiments of the present specification correspond to each other, and therefore, the apparatus, the device, and the nonvolatile computer storage medium also have similar advantageous technical effects to the corresponding method.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain a corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardsradware (Hardware Description Language), vhjhd (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry for implementing the logical method flows can be readily obtained by a mere need to program the method flows with some of the hardware description languages described above and into an integrated circuit.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, the present specification embodiments may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should be noted that: the method and the device for distributing the grid ledger data disclosed in the embodiment of the present invention are only preferred embodiments of the present invention, and are only used for illustrating the technical solution of the present invention, not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art; the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A power grid ledger data distribution method, characterized in that the method comprises:
acquiring a plurality of power grid standing book data;
uploading the plurality of power grid standing book data to a server;
generating a kafka message according to the plurality of power grid ledger data, and issuing the kafka message to kafka proxy service; the kafka proxy service is used for receiving the subscription of any target distribution terminal and sending the kafka message to the target distribution terminal; and the target distribution terminal is used for acquiring the corresponding power grid ledger data on the server according to the kafka message.
2. The grid ledger data distribution method of claim 1, wherein the uploading of the plurality of grid ledger data to a server comprises:
screening the plurality of power grid account data to obtain a plurality of account attribute data;
and serializing the standing book attribute data to generate a plurality of sequence object files, and uploading the sequence object files to a server.
3. The power grid ledger data distribution method of claim 2, characterized in that the ledger attribute data comprises at least one of a function attribute, a location attribute, an equipment attribute, a component attribute, a hierarchy relationship attribute, a technical parameter attribute, and a change record attribute; and/or the naming of the sequence object file comprises at least one of a function attribute, a position attribute, an equipment attribute and a component attribute; and/or the sequence object file is a json object file; and/or, the uploading the plurality of sequence object files to a server comprises:
packaging the sequence object files into at least one compressed package file and uploading the compressed package file to a server; the server is an SFTP server.
4. The grid ledger data distribution method according to claim 3, characterized in that the generating of the kafka message from the plurality of grid ledger data includes:
for any one compressed package file, determining data information corresponding to the compressed package file; the data information comprises data type information, a server directory path, a data service type and data time information;
and generating a kafka message corresponding to the compressed package file according to the data information.
5. The power grid ledger data distribution method according to claim 4, wherein after generating the kafka message corresponding to the compressed package file according to the data information, the method further comprises:
grouping the generated plurality of kafka messages to obtain a plurality of groups;
an ID for each of the groups is determined.
6. The power grid standing book data distribution method according to claim 5, wherein the target distribution terminal is specifically configured to execute the following steps to obtain the corresponding power grid standing book data on the server according to the kafka message:
subscribing to a message to the kafka proxy service and receiving the kafka message sent by the kafka proxy service based on the group ID;
and according to the kafka message, acquiring the corresponding compressed packet file on the server, decompressing the compressed packet file to obtain the sequence object file, and analyzing and objectifying the sequence object file to obtain the corresponding power grid ledger data.
7. The power grid ledger data distribution method according to claim 6, wherein the acquiring, according to the kafka message, the corresponding compressed packet file on the server, decompressing the compressed packet file to obtain the sequence object file, and performing parsing and objectification processing on the sequence object file to obtain the corresponding power grid ledger data includes:
acquiring the corresponding compressed package file on the server according to the server directory path in the kafka message;
decompressing the compressed packet file to obtain the sequence object file;
and analyzing and objectifying the sequence object file according to the naming of the sequence object file to obtain the corresponding power grid ledger data.
8. A power grid ledger data distribution apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring a plurality of power grid ledger data;
the uploading module is used for uploading the plurality of power grid ledger data to a server;
the issuing module is used for generating kafka messages according to the plurality of power grid ledger data and issuing the kafka messages to kafka proxy services; the kafka proxy service is used for receiving the subscription of any target distribution terminal and sending the kafka message to the target distribution terminal; and the target distribution terminal is used for acquiring the corresponding power grid ledger data on the server according to the kafka message.
9. A power grid ledger data distribution apparatus, characterized in that the apparatus comprises:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the power grid ledger data distribution method of any of claims 1-7.
10. A computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to execute the power grid ledger data distribution method according to any one of claims 1 to 7.
CN202210014986.2A 2022-01-07 2022-01-07 Power grid standing book data distribution method and device Pending CN114528121A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210014986.2A CN114528121A (en) 2022-01-07 2022-01-07 Power grid standing book data distribution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210014986.2A CN114528121A (en) 2022-01-07 2022-01-07 Power grid standing book data distribution method and device

Publications (1)

Publication Number Publication Date
CN114528121A true CN114528121A (en) 2022-05-24

Family

ID=81621509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210014986.2A Pending CN114528121A (en) 2022-01-07 2022-01-07 Power grid standing book data distribution method and device

Country Status (1)

Country Link
CN (1) CN114528121A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242893A (en) * 2022-05-27 2022-10-25 国电南瑞科技股份有限公司 Multi-protocol data acquisition system and method suitable for power distribution Internet of things management system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242893A (en) * 2022-05-27 2022-10-25 国电南瑞科技股份有限公司 Multi-protocol data acquisition system and method suitable for power distribution Internet of things management system

Similar Documents

Publication Publication Date Title
CN107450979B (en) Block chain consensus method and device
CN108418851B (en) Policy issuing system, method, device and equipment
CN117932668A (en) File processing method, device, equipment and storage medium based on block chain
CN111355816B (en) Server selection method, device, equipment and distributed service system
CN110362547B (en) Method and device for encoding, analyzing and storing log file
CN107479868B (en) Interface loading method, device and equipment
CN112162915A (en) Test data generation method, device, equipment and storage medium
CN110602163B (en) File uploading method and device
CN114528121A (en) Power grid standing book data distribution method and device
CN115617799A (en) Data storage method, device, equipment and storage medium
CN114398217A (en) Massive simulation waveform data slicing method for FPGA parallel simulation
CN113873013A (en) Offline packet reassembly method and system
CN116436936B (en) Data storage system, method, storage medium and electronic equipment
CN109582776B (en) Model generation method and device, electronic device and storage medium
CN112019689A (en) Incoming call show service processing system and method
CN109842498B (en) Client configuration method, server, client and electronic equipment
CN111090974A (en) Report generation method, device and equipment
CN111338655A (en) Installation package distribution method and system
CN114327941A (en) Service providing method and device
CN111428128B (en) Method for generating pluggable recommendation system, service recommendation method, device and equipment
CN111796864A (en) Data verification method and device
CN107395486B (en) Data communication method, device and system and message middleware
CN109756550B (en) Intelligent internet driving vehicle cloud communication method, device and system
CN110704733B (en) Method and device for sending data
CN112019617B (en) Data storage method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination