Communication method and device of power protocol, storage medium and electronic equipment

Connecting with the client program through the socket pipeline, sending configuration data and collecting power equipment operation data, solving the problem that third parties cannot provide customized support, and achieving efficient and flexible data processing and system expansion.

CN119766903AActive Publication Date: 2025-04-04DONGTU TECH (YICHANG) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411817577.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-04
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

Third parties are unable to provide customized development, modification and upgrade support, which affects customers' development efficiency and flexibility.

Method used

Establish a connection with the client program through a socket pipeline, send custom configuration data, collect the operation data of the power equipment, and send its unique identifier and data values ​​to the socket pipeline for the client program to parse and process.

Benefits of technology

It has achieved improved the flexibility of data processing, supported customized development of customers, met with diverse application scenarios, and ensured the scalability and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766903A_ABST
    Figure CN119766903A_ABST
Patent Text Reader

Abstract

The invention relates to a communication method and device of a power protocol, a storage medium and electronic equipment. The method is applied to an electronic data processing system and comprises the following steps: establishing connection with a client program through a socket pipeline; the configuration data is sent to the socket pipeline, so that the client program obtains the configuration data from the socket pipeline, and the configuration data is data customized by a client; collecting first operation data generated by each I < O > point location of the first power equipment; the unique identifier and the data value of each piece of first operation data are sent to a socket pipeline, so that a client program obtains the unique identifier and the data value of each piece of first operation data from the socket pipeline, and the first operation data of each I < O > point location is obtained through analysis according to each unique identifier, each data value and the configuration data. The technical problem that the development efficiency and flexibility of customers are affected due to the fact that a third party cannot provide customized development, modification and upgrading support is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of embedded systems, and in particular to a communication method, device, storage medium and electronic device of a power protocol. Background Art

[0002] With the continuous development of the power industry, the types and complexity of power protocols are gradually increasing. This change is not only reflected in the improvement of existing international standards and general protocols, but also in the increasing demand for customized private protocols. Customers often use private protocols in power systems to meet the needs of unique business processes and special scenarios. However, these private protocols are usually highly private and need to be upgraded and functionally modified at any time in the system. Due to the privacy and real-time update characteristics of the protocol, customers are usually reluctant to host the source code to a third-party company. This situation leads to a series of challenges for customers when customizing the development, modification and upgrading of their private protocol-related acquisition, processing or upload programs. Due to the lack of control over the source code, third-party companies cannot directly intervene and help customers efficiently carry out development support and maintenance, which forces customers to rely on internal teams or other third-party developers, increasing the complexity of development and management costs. In addition, private acquisition and processing programs involve a large amount of customized logic, such as data acquisition and protocol parsing, which often need to be frequently adjusted in combination with customers' real-time changing business needs. If customers cannot share their core code with partners, this will directly affect the flexibility of development and the efficiency of upgrades, thereby limiting the scalability and competitiveness of the system. Summary of the invention

[0003] The present application provides a communication method, device, storage medium and electronic device for an electric power protocol to solve the technical problem that a third party is unable to provide customized development, modification and upgrade support, thereby affecting the customer's development efficiency and flexibility.

[0004] In a first aspect, the present application provides a communication method of an electric power protocol, which is applied to an electronic data processing system, comprising: establishing a connection with a client program through a socket pipe; sending configuration data to the socket pipe so that the client program obtains the configuration data from the socket pipe, wherein the configuration data is customer-defined data, including configuration items and their unique identifiers, and the configuration items include IO points, device parameters and protocol information of a first electric power device; collecting first operating data generated by each IO point of the first electric power device; sending the unique identifier and data value of each of the first operating data to the socket pipe so that the client program obtains the unique identifier and data value of each of the first operating data from the socket pipe, and obtains the first operating data of each IO point according to each of the unique identifiers and data values ​​and the configuration data.

[0005] In a second aspect, the present application provides a communication device of an electric power protocol, which is applied to an electronic data processing system, comprising: a connection module, which is used to establish a connection with a client program through a socket pipe; a first sending module, which is used to send configuration data to the above-mentioned socket pipe, so that the above-mentioned client program obtains the above-mentioned configuration data from the above-mentioned socket pipe, wherein the above-mentioned configuration data is customer-defined data, including configuration items and their unique identifiers, and the above-mentioned configuration items include IO points, equipment parameters and protocol information of the first electric device; an acquisition module, which is used to collect the first operation data generated by each IO point of the above-mentioned first electric device; a second sending module, which is used to send the unique identifier and data value of each of the above-mentioned first operation data to the above-mentioned socket pipe, so that the above-mentioned client program obtains the unique identifier and data value of each of the above-mentioned first operation data from the above-mentioned socket pipe, and parses the first operation data of each IO point according to each of the above-mentioned unique identifiers and data values ​​and the configuration data.

[0006] As an optional example, the above-mentioned device also includes: an acquisition module, which is used to obtain second operating data from the above-mentioned socket pipe after establishing a connection with the client program through the socket pipe, wherein the above-mentioned second operating data is the operating data generated by each IO point of the second power equipment, which is collected by the above-mentioned client program and sent to the above-mentioned socket pipe; a processing module, which is used to process the above-mentioned second operating data and display the processed second operating data.

[0007] As an optional example, the connection module includes: a creation unit, used to create a socket and specify the type of the socket as a stream socket; a binding unit, used to bind the socket to the local address of the electronic data processing system; a connection unit, used to establish a connection with the client program according to the connection request when receiving a connection request from the client program, wherein the connection request is a request for connecting to the socket of the electronic data processing system issued by the client program to the electronic data processing system according to the socket address of the electronic data processing system after the socket is created.

[0008] As an optional example, the first sending module includes: a first sending unit, configured to send the configuration data to the socket address, so that the client program obtains the configuration data from the socket address.

[0009] As an optional example, the above-mentioned device also includes: a generation module, which is used to generate a unique identifier, data type and data length for each IO point of the above-mentioned first power equipment before sending the configuration data to the above-mentioned socket pipe; a determination module, which is used to determine each IO point and its unique identifier, data type and data length as a configuration data pair, wherein the above-mentioned configuration data includes all the above-mentioned configuration data pairs.

[0010] As an optional example, the second sending module includes: a conversion unit, used to convert one or more unique identifiers and data values ​​of the first running data into a byte stream according to a target format, to obtain at least one byte stream, wherein the number of bytes of each of the byte streams is less than or equal to a target threshold; a second sending unit, used to send the at least one byte stream to the socket pipe, so that the client program obtains the at least one byte stream from the socket pipe, and parses each of the byte streams and the configuration data to obtain the first running data of each IO point.

[0011] As an optional example, the above-mentioned conversion unit includes: a processing subunit, which is used to convert the unique identifier and data value of the target running data into a first byte stream according to the above-mentioned target format, and when the number of bytes of the above-mentioned first byte stream is greater than the above-mentioned target threshold, perform frame processing on the above-mentioned first byte stream to obtain multiple second byte streams, wherein the above-mentioned target running data is any one or more running data in the above-mentioned first running data, and the number of bytes of the above-mentioned second byte stream is less than or equal to the above-mentioned target threshold.

[0012] In a third aspect, the present application provides a storage medium storing a computer program, wherein the computer program executes the communication method of the above-mentioned power protocol when executed by a processor.

[0013] In a fourth aspect, the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the communication method of the above-mentioned power protocol through the computer program.

[0014] In an embodiment of the present application, a method is adopted in which a connection is established with a client program through a socket pipe; configuration data is sent to the socket pipe so that the client program obtains the configuration data from the socket pipe, wherein the configuration data is customer-defined data, including configuration items and their unique identifiers, and the configuration items include IO points, equipment parameters and protocol information of the first power equipment; the first operation data generated by each IO point of the first power equipment is collected; the unique identifier and data value of each of the first operation data are sent to the socket pipe so that the client program obtains the unique identifier and data value of each of the first operation data from the socket pipe, and the first operation data of each IO point is obtained by parsing the unique identifier and data value and the configuration data. In the above method, the powerful data processing function of EDPS is utilized to collect data and forward it to the client program process through the socket, and the client program further processes the received data. This improves the flexibility of data processing, supports customers in customized development based on specific needs, meets diverse application scenarios, ensures the scalability and efficiency of the system, and provides customers with a better user experience, thereby solving the technical problem of third parties being unable to provide customized development, modification and upgrade support, which affects customers' development efficiency and flexibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0017] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0018] Figure 1is a flow chart of an optional communication method of a power protocol according to an embodiment of the present application;

[0019] Figure 2 is a processing flow chart of an optional communication method of an electric power protocol according to an embodiment of the present application;

[0020] Figure 3 is a processing flow chart of an optional communication method of an electric power protocol according to an embodiment of the present application;

[0021] Figure 4 It is a data format diagram of a byte stream of an optional communication method of an electric power protocol according to an embodiment of the present application;

[0022] Figure 5 It is a data transmission format diagram of an optional communication method of an electric power protocol according to an embodiment of the present application;

[0023] Figure 6 is a schematic structural diagram of a communication device of an optional power protocol according to an embodiment of the present application;

[0024] Figure 7 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0026] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0027] Embodiment 1, in order to solve the technical problem that a third party cannot provide customized development, modification and upgrade support, which affects the development efficiency and flexibility of customers, according to the first aspect of the embodiment of the present application, a communication method of a power protocol is provided, which is applied to an electronic data processing system, and optionally, Figure 1 As shown, the above method includes:

[0028] S102, establishing a connection with the client program through a socket pipe;

[0029] S104, sending the configuration data to the socket pipe so that the client program obtains the configuration data from the socket pipe, wherein the configuration data is customer-defined data, including configuration items and their unique identifiers, and the configuration items include IO points, device parameters, and protocol information of the first power device;

[0030] S106, collecting first operation data generated by each IO point of the first power equipment;

[0031] S108, sending the unique identifier and data value of each first operation data to the socket pipe, so that the client program obtains the unique identifier and data value of each first operation data from the socket pipe, and obtains the first operation data of each IO point according to each unique identifier and data value and configuration data.

[0032] Optionally, in the first embodiment, under the premise that the third party does not need to modify and open the source code, the customer can use the powerful data processing function of EDPS to simply and efficiently develop and update customized and private protocols, while only focusing on its customized or private parts and following the rules set by the third party. EDPS (Electronic Data Processing System) is a system for electronic data processing, which is usually used to automatically receive, store, process and transmit data. It can be used for centralized or distributed data processing in different industries and applications, supporting various business logic and data processing tasks. EDPS is used as a "black box" for data processing and runs independently as a process to ensure the security and integrity of its core functions. The customer's customized program runs in another independent process and exchanges data with EDPS through inter-process communication (IPC). Such an architecture enables the client program to freely develop and run customized upper-level applications without exposing the internal mechanism. EDPS is responsible for collecting data and forwarding it to the client program process, while the client program reprocesses the received data, including data conversion, encryption processing, and uploading to the cloud, thereby realizing flexible application expansion and data security processing. EDPS mainly includes data processing processes of three modules: acquisition, advanced application, and protocol forwarding. Among them, the protocol forwarding module can forward the acquired data and data processed by advanced applications to the remote node through the network or serial port in the form of a specific power protocol.

[0033] Specifically, Figure 2In the processing flow shown, in the initialization phase, EDPS and the client program are initialized at the same time. The EDPS end creates a Unix domain socket, ready to serve as a server, listen to the connection request of the client program, and configure the relevant parameters of the socket, including the binding address and port, to ensure that the request can be received correctly. The client program creates a Unix domain socket to initiate a connection request to EDPS, ensuring that the parameters of the socket match the settings of the EDPS end. The client program uses the socket it created to send a connection request to EDPS. The listening thread in EDPS detects the connection request, accepts the request and establishes a connection. After the connection is successful, the two parties can start data communication. EDPS prepares configuration data containing the unique identifier of each IO point of the first power device and other related customer-defined configuration information, including device parameters and protocol information, and sends the configuration data to the client program through the established socket connection. The first power device is EDPS, which can directly collect its operating data, such as smart meters, transformer monitoring equipment, distribution automation equipment, etc., and can convert and forward it to the client program, which is customized by the customer for specific applications. During the operation phase, EDPS continuously monitors each IO point of the first power equipment, collects operation data in real time, and associates each data point with its unique identifier. EDPS sends the operation data and its unique identifier of each IO point to the client program through the socket pipeline and the inter-process forwarding module. The client program receives the operation data and the corresponding unique identifier sent by EDPS from the socket pipeline. The client program uses the configuration data to parse the received unique identifier and data value, and maps the parsed data to the specific IO point to form the final operation data. The client program processes the received data according to business needs, including data conversion, encryption, and data upload to the cloud. Once the data processing is completed, the client program can continue with other tasks or return to the data receiving state to prepare to receive new data. In the end stage, when the client program completes all processing tasks, it sends an offline notification message to EDPS to inform it that it will end the operation. After receiving the offline notification from the client program, EDPS confirms the notification and prepares to release resources. The client program closes its Unix socket connection with EDPS to ensure that there is no further data transmission. After receiving the closing request, EDPS will also close its corresponding socket connection to ensure that the connection between the two parties is disconnected normally. The client program releases the memory, file handles and other system resources occupied during operation to avoid resource leakage. EDPS cleans up the threads, data buffers and other resources used in EDPS to ensure that they do not occupy excess system resources. Once both parties confirm the offline notification and the resource release is complete, the process officially ends and the system enters standby mode, ready to accept the next connection or task.

[0034] Optionally, in the first embodiment of the present invention, by using EDPS as an independent "black box", the client program can focus on upper-level application development and achieve better modularization and separation of duties. EDPS runs independently as a server, which enhances the security and integrity of the data and reduces the risk of core data exposure. The client program can customize and adjust the processing logic as needed to adapt to different application scenarios, and realize inter-process communication through Unix sockets to ensure fast and reliable transmission of data between EDPS and the client program. EDPS can promptly pass the collected operation data to the client program, which helps to achieve real-time monitoring and processing.

[0035] Embodiment 2, after establishing a connection with the client program through the socket pipe, the method further includes:

[0036] Acquire second operation data from the socket pipeline, wherein the second operation data is operation data generated by each IO point of the second power device, collected by the client program and sent to the socket pipeline;

[0037] The second operation data is processed and the processed second operation data is displayed.

[0038] Optionally, in the second embodiment, after EDPS and the client program have established a stable communication channel, the client program uses its customized collection protocol to collect operation data from each IO point of the second power device, obtains the second operation data, and sends it to EDPS through the established Unix socket pipeline. The second power device is the one that EDPS cannot directly collect operation data from, such as non-intelligent meters, power devices that cannot be connected to the Internet, etc. The client program directly collects and forwards it to EDPS, and EDPS implements data processing, forwarding, display and other functions. Figure 3The processing flow shown in the figure adds an "inter-process acquisition module" to EDPS, which is responsible for receiving the second operation data sent by the client program from the Unix socket pipe. The module continuously monitors the socket pipe and immediately performs data parsing and verification when receiving data. EDPS performs a series of processing on the received second operation data, including data cleaning, format conversion and verification, etc. The processed data will be stored in the internal data structure of EDPS for subsequent use. After processing the data, EDPS forwards the processed data to the client program or other required services through the "inter-process forwarding module". The forwarding process still uses the Unix socket to ensure the reliability and real-time nature of data transmission. EDPS can display the processed second operation data in a visual way, which is convenient for users to view and analyze. The display interface can be customized according to customer needs to provide a better user experience. By adding the inter-process acquisition and forwarding modules, the functions of EDPS are expanded to support customers to customize the data processing process according to specific needs. Customers can flexibly use the original functional modules of EDPS and seamlessly integrate them with their customized programs to achieve efficient data collection, processing, forwarding and display.

[0039] Embodiment 3, establishing a connection with a client program through a socket pipeline includes:

[0040] Create a socket and specify the socket type as a stream socket;

[0041] Binding the socket to a local address of the electronic data processing system;

[0042] When a connection request is received from a client program, a connection is established with the client program according to the connection request, wherein the connection request is a request for connecting to the socket of the electronic data processing system issued by the client program to the electronic data processing system according to the socket address of the electronic data processing system after the socket is created.

[0043] Optionally, in the third embodiment, in the process of establishing a connection with the client program through the socket pipe, first, EDPS calls the socket API provided by the system to create a new socket. At this time, EDPS specifies the type of the socket as a stream socket, which means that it will use the TCP protocol for data transmission and provide reliable, connection-oriented services. The selection of the stream socket ensures the integrity and order of the data, so that EDPS can safely communicate with the client program in both directions. Once the socket is created, EDPS will bind it to the local address (including IP address and port number). This process involves specifying a unique network identifier for EDPS so that the client program can find it and establish a connection. The binding operation enables EDPS to listen for connection requests from client programs on a specific IP address and port to ensure the effectiveness of network communication. By selecting an appropriate port number, EDPS avoids conflicts with other services. After completing the binding, EDPS sets the socket to a listening state, allowing EDPS to accept connection requests from client programs and set a queue for incoming connection requests. After creating its own socket, the client program sends a connection request to the socket address of EDPS, which contains the IP address of EDPS and the previously bound port number. Once the connection is established, two-way data transmission can begin between EDPS and the client program, and both parties can send and receive data to each other.

[0044] In the fourth embodiment, sending the configuration data to the socket pipeline includes:

[0045] Send configuration data to the socket address so that the client program can obtain configuration data from the socket address.

[0046] Optionally, in the fourth embodiment of the present invention, in EDPS, configuration data must first be prepared. These configuration data may include information such as parameter settings of various power equipment, data acquisition strategies, and unique identifiers for each IO point. After the configuration data is prepared, EDPS needs to ensure that the socket connection with the client program has been established. At this time, EDPS will use the previously created connection socket to ensure that the communication channel between the two parties is active. EDPS uses the send function to send the configuration data to the client program through the socket. The client program uses the receive function on its own socket connection to obtain the configuration data. After successfully receiving the configuration data, the client program needs to parse the data to extract useful information. According to the format of the configuration data, the client program can use the corresponding parsing method to convert the data into a usable structure. The parsed data will be applied to the logic of the client program, such as initializing IO points, setting data acquisition strategies, etc.

[0047] Embodiment 5, before sending the configuration data to the socket pipe, the method further includes:

[0048] Generate a unique identifier, data type, and data length for each IO point of the first power device;

[0049] Each IO point and its unique identifier, data type and data length are determined as a configuration data pair, wherein the configuration data includes all configuration data pairs.

[0050] Optionally, in the fifth embodiment of the present invention, during the initialization phase, EDPS needs to process multiple configuration items, including driver information, protocol configuration, device configuration, and IO point configuration. For each configuration item, EDPS generates a unique global management point identifier (GMPID). GMPID can use a timestamp-based algorithm, a random number generator, or combine information on device characteristics to ensure the uniqueness of each identifier. Each generated GMPID will be transmitted to the client program together with its corresponding configuration item. The transmitted data includes the GMPID of each configuration item and related configuration parameters. The structure of the configuration data may include: {GMPID, configuration type, configuration parameters}, which enables the client program to identify and store each configuration item. After receiving these configuration data, the client program needs to store each configuration pair in its local database or memory for subsequent use. As a result, in the data transmission phase, in order to improve efficiency, EDPS will only transmit the GMPID and real-time data value of each IO point, and no longer transmit the complete point configuration. In this way, the burden of each data transmission is reduced and only necessary information is transmitted.

[0051] In embodiment 6, sending the unique identifier and data value of each first running data to the socket pipe includes:

[0052] Converting the unique identifier and data value of the one or more first operation data into a byte stream according to a target format to obtain at least one byte stream, wherein the number of bytes of each byte stream is less than or equal to a target threshold;

[0053] At least one byte stream is sent to the socket pipe, so that the client program obtains at least one byte stream from the socket pipe, and parses each byte stream and the configuration data to obtain the first operation data of each IO point.

[0054] Converting the unique identifier and data value of the one or more first running data into a byte stream according to the target format, obtaining at least one byte stream includes:

[0055] When the unique identifier and data value of the target running data are converted into a first byte stream according to the target format, and the number of bytes of the first byte stream is greater than the target threshold, the first byte stream is framed to obtain multiple second byte streams, wherein the target running data is any one or more running data in the first running data, and the number of bytes of the second byte stream is less than or equal to the target threshold.

[0056] Optionally, in the sixth embodiment, all the first operation data are collected, including the unique identifier of each IO point and its corresponding data value. The structure of each data record can be defined as: {unique identifier, data value}, and these data records are converted into byte stream format for transmission through the socket. A suitable serialization method is selected to convert the data record into a byte stream to ensure that the converted byte stream conforms to the target format so that the receiving end can parse it correctly. In order to meet the requirements of network transmission, the generated byte stream is cut according to the target threshold. The number of bytes of each byte stream should be less than or equal to the threshold. For example, if the target threshold is 255 bytes, the byte stream exceeding the number of bytes can be divided into multiple parts, each of which does not exceed 255 bytes. The prepared one or more byte streams are sent to the client program through the socket pipe. The client program receives the byte stream data sent from the EDPS through the established socket connection. The client program parses each received byte stream, extracts the first operation data of each IO point according to the pre-defined configuration data, parses the content in the byte stream, recovers the unique identifier and data value, and corresponds the recovered data to the configuration data to complete the complete data record of the IO point.

[0057] Optionally, in this sixth embodiment, if Figure 4The data format of a byte stream shown in the figure is a byte stream. When transferring data between EDPS and the client process, the overall format is a byte stream. The maximum length of each data frame is 255 bytes. If the data content exceeds 255 bytes, it is necessary to restart a new frame and increase the transmission sequence number by 1 in the new frame. The end of each frame of data is indicated by a specific terminator to ensure that the receiver can correctly identify the end of data transmission. When the data type is TEXT, the data length information will occupy two bytes. If the data type is other types, the data length does not need to be transmitted separately. The data value is transmitted directly after the data type. All transmitted data is encoded in UTF-8 format to ensure compatibility with multiple character sets and languages. Each data unit in the byte stream follows the following general template: Sequence number: identifies the order of each transmission, ranging from [1-10000]. When the sequence number reaches 10000, the next sequence number sent will be reset to 1; module: identifies the module to which the data item belongs, including the driver, communication port, and device configuration; GMID: globally unique identifier, used to uniquely identify the configuration item; configuration name: the name that uniquely identifies the configuration item, usually in English; configuration alias: the display name of the configuration, which can be used for Chinese display, can be empty, the data type is TEXT, and the length is 0; configuration description: a detailed description of the configuration item, providing context information; data type: different data items will have different data types. The processing method of each data type will vary according to the above regulations, for example, the TEXT type requires additional transmission of data length.

[0058] Optionally, in this sixth embodiment, the extended configuration is a customizable configuration item. After being added in the ICT configuration tool, it is transmitted to the customer process by EDPS to realize the function of the customizable protocol and ensure the universality of the secondary development function. In the extended configuration, table configuration can be nested. In principle, at most one layer of tables can be nested, that is, a table contains one layer of tables. The data transmission format is as follows: Figure 5As shown. Extended configuration is in the form of configuration table items. A new configuration item can be added by adding a new row. The configuration items include configuration name, configuration type (such as edit box, drop-down selection, etc.), data type, optional value, and configuration value to achieve customized extension of the power protocol. In the configuration of IO parameters, there are 5 basic types of extended configuration parameters, which can be customized by users. The assigned data format type is string type. If the 5 basic types of extended configuration parameters still cannot meet the customized requirements, you can add rows in the extended configuration table item to continue the customized configuration. Basic configuration: point name, description, associated point, value type. Among them, the associated point is configured in ICT, but does not need to be transmitted to the client process. The point type needs to be transmitted to the client process, but does not need to be manually configured. Extended configuration: customer customization, such as in the modbus protocol, including function code, register address, start address, data length, etc. For the configuration of value type, the data type is the value corresponding to the value type, the data value is also the value corresponding to the value type, and the data length is the length corresponding to the value type. The 5 basic parameters are transmitted in sequence. During operation, the data format of the transmission is also a byte stream. The customer uses the GMID to find the configuration of the point, perform corresponding processing and display, and the data contains fields. Multiple points can be transmitted in one frame. The frame length of a single frame cannot exceed the maximum limit. In the data block, for single-group points such as AI and DI, the number of groups is 1, and the data block is parsed according to the configured data type and data format; for the fixed value group, the data of all customized groups of the point is transmitted in the data block, and the data block is parsed according to the configured number of groups, data type and data format. The protocol configuration can be configured in the EDPS ICT tool or in the client program. The IO points must have basic configuration in the ICT tool. If you want to configure in a customized program, the configuration order of the IO points in the ICT tool and the customized program must be consistent. Each type of configuration, such as protocol configuration, device configuration, and IO configuration, has general configuration and extended configuration. Customers can complete customized configuration requirements through extended configuration.

[0059] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0060] According to another aspect of the embodiment of the present application, a communication device of a power protocol is also provided, which is applied to an electronic data processing system, such as Figure 6 As shown, including:

[0061] A connection module 602 is used to establish a connection with a client program through a socket pipe;

[0062] The first sending module 604 is used to send the configuration data to the socket pipe so that the client program obtains the configuration data from the socket pipe, wherein the configuration data is customer-defined data, including configuration items and their unique identifiers, and the configuration items include IO points, device parameters, and protocol information of the first power device;

[0063] A collection module 606, used for collecting first operation data generated by each IO point of the first power equipment;

[0064] The second sending module 608 is used to send the unique identifier and data value of each first operating data to the socket pipe, so that the client program obtains the unique identifier and data value of each first operating data from the socket pipe, and parses each unique identifier and data value and configuration data to obtain the first operating data of each IO point.

[0065] It should be noted that the connection module 602 in this embodiment can be used to execute step S102 in the embodiment of the present application, the first sending module 604 in this embodiment can be used to execute step S104 in the embodiment of the present application, the acquisition module 606 in this embodiment can be used to execute step S106 in the embodiment of the present application, and the second sending module 608 in this embodiment can be used to execute step S108 in the embodiment of the present application.

[0066] As an optional example, the above device further includes:

[0067] an acquisition module, configured to acquire second operation data from the socket pipeline after establishing a connection with the client program through the socket pipeline, wherein the second operation data is operation data generated by each IO point of the second power device, collected by the client program and sent to the socket pipeline;

[0068] The processing module is used to process the second operation data and display the processed second operation data.

[0069] As an optional example, the connection module includes:

[0070] The creation unit is used to create a socket and specify the type of the socket as a stream socket;

[0071] a binding unit for binding the socket to a local address of the electronic data processing system;

[0072] The connection unit is used to establish a connection with the client program according to the connection request when receiving the connection request from the client program, wherein the connection request is a request for connecting to the socket of the electronic data processing system issued by the client program to the electronic data processing system according to the socket address of the electronic data processing system after creating the socket.

[0073] As an optional example, the first sending module includes:

[0074] The first sending unit is used to send the configuration data to the socket address, so that the client program obtains the configuration data from the socket address.

[0075] As an optional example, the above device further includes:

[0076] A generating module, for generating a unique identifier, a data type, and a data length for each IO point of the first power device before sending the configuration data to the socket pipe;

[0077] The determination module is used to determine each IO point and its unique identifier, data type and data length as a configuration data pair, wherein the configuration data includes all configuration data pairs.

[0078] As an optional example, the second sending module includes:

[0079] a conversion unit, configured to convert the unique identifier and the data value of the one or more first operation data into a byte stream according to a target format, to obtain at least one byte stream, wherein the number of bytes of each byte stream is less than or equal to a target threshold;

[0080] The second sending unit is used to send at least one byte stream to the socket pipe, so that the client program obtains at least one byte stream from the socket pipe, and parses each byte stream and configuration data to obtain the first operation data of each IO point.

[0081] As an optional example, the conversion unit includes:

[0082] A processing subunit is used to convert the unique identifier and data value of the target running data into a first byte stream according to a target format, and when the number of bytes of the first byte stream is greater than a target threshold, perform frame processing on the first byte stream to obtain multiple second byte streams, wherein the target running data is any one or more running data in the first running data, and the number of bytes of the second byte stream is less than or equal to the target threshold.

[0083] For other examples of this embodiment, please refer to the above examples and will not be repeated here.

[0084] Figure 7is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 7 As shown, it includes a processor 702, a communication interface 704, a memory 706 and a communication bus 708, wherein the processor 702, the communication interface 704 and the memory 706 communicate with each other through the communication bus 708, wherein,

[0085] Memory 706, used to store computer programs;

[0086] The processor 702 is used to implement the following steps when executing the computer program stored in the memory 706:

[0087] Establish a connection with the client program through the socket pipe;

[0088] Sending configuration data to the socket pipe so that the client program obtains the configuration data from the socket pipe, wherein the configuration data is customer-defined data, including configuration items and their unique identifiers, and the configuration items include IO points, device parameters, and protocol information of the first power device;

[0089] Collecting first operation data generated by each IO point of the first power equipment;

[0090] The unique identifier and data value of each first operation data are sent to the socket pipe, so that the client program obtains the unique identifier and data value of each first operation data from the socket pipe, and parses each unique identifier and data value and configuration data to obtain the first operation data of each IO point.

[0091] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The communication interface is used for communication between the above electronic device and other devices.

[0092] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0093] As an example, the memory 706 may include, but is not limited to, the connection module 602, the first sending module 604, the acquisition module 606, and the second sending module 608 in the communication device of the power protocol. In addition, other module units in the communication device of the power protocol may also be included but are not limited to, which will not be repeated in this example.

[0094] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0095] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0096] It can be understood by those skilled in the art that Figure 7 The structure shown is for illustration only. The device for implementing the communication method of the above-mentioned power protocol may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 7 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 7 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 7 Different configurations shown.

[0097] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0098] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the communication method of the above-mentioned power protocol when executed by a processor.

[0099] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0100] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0101] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0102] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0103] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0104] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0105] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0106] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A communication method of power protocol, applied to electronic data processing system, characterized in that: include: Establish a connection with the client program through the socket pipe; Sending configuration data to the socket pipe so that the client program obtains the configuration data from the socket pipe, wherein the configuration data is customer-defined data, including configuration items and their unique identifiers, and the configuration items include IO points, device parameters, and protocol information of the first power device; Collecting first operation data generated by each IO point of the first power equipment; The unique identifier and data value of each first operating data are sent to the socket pipe, so that the client program obtains the unique identifier and data value of each first operating data from the socket pipe, and obtains the first operating data of each IO point according to each unique identifier and data value and configuration data.

2. The method according to claim 1, characterized in that After establishing a connection with the client program through the socket pipe, the method further comprises: Acquire second operation data from the socket pipeline, wherein the second operation data is operation data generated by each IO point of the second power device, collected by the client program and sent to the socket pipeline; The second operation data is processed, and the processed second operation data is displayed.

3. The method according to claim 1, characterized in that The step of establishing a connection with a client program through a socket pipeline includes: Create a socket and specify the type of the socket as a stream socket; binding the socket to a local address of the electronic data processing system; Upon receiving a connection request from the client program, a connection is established with the client program according to the connection request, wherein the connection request is a request for connecting to the socket of the electronic data processing system issued by the client program to the electronic data processing system according to the socket address of the electronic data processing system after the socket is created.

4. The method according to claim 3, characterized in that The sending of configuration data to the socket pipe comprises: The configuration data is sent to the socket address, so that the client program obtains the configuration data from the socket address.

5. The method according to claim 1, characterized in that: Before sending the configuration data to the socket pipe, the method further comprises: Generate a unique identifier, data type and data length for each IO point of the first power device; Each IO point and its unique identifier, data type and data length are determined as a configuration data pair, wherein the configuration data includes all the configuration data pairs.

6. The method according to claim 1, characterized in that The sending the unique identifier and the data value of each of the first running data to the socket pipe comprises: Converting one or more unique identifiers and data values ​​of the first operation data into a byte stream according to a target format to obtain at least one byte stream, wherein the number of bytes of each of the byte streams is less than or equal to a target threshold; The at least one byte stream is sent to the socket pipe, so that the client program obtains the at least one byte stream from the socket pipe, and obtains the first operation data of each IO point according to each byte stream and configuration data.

7. The method according to claim 6, characterized in that The converting the unique identifiers and data values ​​of one or more of the first operation data into a byte stream according to a target format to obtain at least one byte stream comprises: When the unique identifier and data value of the target running data are converted into a first byte stream according to the target format, and the number of bytes of the first byte stream is greater than the target threshold, the first byte stream is framed to obtain multiple second byte streams, wherein the target running data is any one or more running data in the first running data, and the number of bytes of the second byte stream is less than or equal to the target threshold.

8. A communication device for an electric power protocol, applied to an electronic data processing system, characterized in that: include: A connection module is used to establish a connection with a client program through a socket pipe; A first sending module, used for sending configuration data to the socket pipe, so that the client program obtains the configuration data from the socket pipe, wherein the configuration data is customer-defined data, including configuration items and their unique identifiers, and the configuration items include IO points, device parameters and protocol information of the first power device; A collection module, used for collecting first operation data generated by each IO point of the first power equipment; The second sending module is used to send the unique identifier and data value of each of the first operating data to the socket pipe, so that the client program obtains the unique identifier and data value of each of the first operating data from the socket pipe, and parses the first operating data of each IO point according to each of the unique identifiers and data values ​​and the configuration data.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Multi-platform integrated data processing method, server and storage medium

    CN117081791A

  • Protocol file analysis method and device, equipment and storage medium

    CN117255042A

  • High-concurrency multi-protocol communication method and device, electronic equipment and storage medium

    CN118214786A

  • Network access method, and computing device and computing device cluster

    WO2024230431A1