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

By connecting to customer programs via socket pipes and utilizing the EDPS system to process and forward power equipment data, the problem of third parties being unable to provide customized support is solved, thereby achieving flexibility and efficiency in the power system and supporting customized development and data security for customers.

CN119766903BActive Publication Date: 2025-11-28DONGTU TECH (YICHANG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Third parties cannot provide customized development, modification, and upgrade support, which limits customers' development efficiency and flexibility. This is especially true for the customization requirements and real-time update characteristics of proprietary protocols in power systems, affecting the system's scalability and competitiveness.

Method used

The system establishes a connection with the client program through socket pipes, sends configuration data and collects operating data of power equipment, and uses the EDPS system for data processing and forwarding. This ensures that the client program can be developed and updated independently. EDPS, as an independent 'black box', communicates with the client program through inter-process communication, achieving data security and flexibility.

Benefits of technology

It enhances the flexibility of data processing and the scalability of the system, supports customized development by customers according to specific needs, ensures the efficiency and security of the system, and meets the needs of diverse application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766903B_ABST
    Figure CN119766903B_ABST
Patent Text Reader

Abstract

The application relates to a communication method and device of an electric power protocol, a storage medium and electronic equipment. The method is applied to an electronic data processing system and comprises the following steps: 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 data customized by the client; collecting first running data generated by each I / O point of a first electric power device; sending a unique identifier and a data value of each first running data to the socket pipe, so that the client program obtains the unique identifier and the data value of each first running data from the socket pipe, and obtains the first running data of each I / O point according to each unique identifier, the data value and the configuration data. The application solves the technical problem that a third party cannot provide customized development, modification and upgrade support, thereby affecting the development efficiency and flexibility of the client.
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 particularly relates to a communication method and device of a power protocol, a storage medium and an electronic device. BACKGROUND

[0002] With the continuous development of the power industry, the types and complexity of power protocols are gradually increasing. This change not only reflects in the improvement of existing international standards and general protocols, but also reflects in the increasing customization needs of customers for 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 usually have high privacy and need to be upgraded and functionally modified in the system at any time. Due to the privacy and real-time updating characteristics of the protocol, customers are usually unwilling to host the source code to a third-party company. This situation leads customers to face a series of challenges when customizing the development, modification and upgrade of their private protocol related acquisition, processing or uploading programs. Due to the lack of control over the source code, the third-party company cannot directly intervene and help customers efficiently develop support and maintenance, which makes customers have 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. Such programs often need to be adjusted frequently in combination with the real-time changes of customers' business needs. If customers cannot share their core code with partners, this will directly affect the flexibility of development and the efficiency of upgrade, thereby limiting the scalability and competitiveness of the system. SUMMARY

[0003] The present application provides a communication method and device of a power protocol, a storage medium and an electronic device to solve the technical problem that the third party cannot provide customized development, modification and upgrade support, which affects the development efficiency and flexibility of customers.

[0004] In a first aspect, the application provides a communication method of a power protocol, 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 custom data of the client, comprising configuration items and unique identifiers thereof, and the configuration items comprise IO points of a first power device, device parameters and protocol information; collecting first running data generated by each IO point of the first power device; sending unique identifiers and data values of each first running data to the socket pipe, so that the client program obtains the unique identifiers and data values of each first running data from the socket pipe, and obtains the first running data of each IO point according to each unique identifier and data value and the configuration data.

[0005] In a second aspect, the application provides a communication device of a power protocol, applied to an electronic data processing system, comprising: a connection module, configured to establish a connection with a client program through a socket pipe; a first sending module, configured to send configuration data to the socket pipe, so that the client program obtains the configuration data from the socket pipe, wherein the configuration data is custom data of the client, comprising configuration items and unique identifiers thereof, and the configuration items comprise IO points of a first power device, device parameters and protocol information; a collection module, configured to collect first running data generated by each IO point of the first power device; and a second sending module, configured to send unique identifiers and data values of each first running data to the socket pipe, so that the client program obtains the unique identifiers and data values of each first running data from the socket pipe, and obtains the first running data of each IO point according to each unique identifier and data value and the configuration data.

[0006] As an optional example, the device further comprises: an acquisition module, configured to acquire second running data from the socket pipe after establishing the connection with the client program through the socket pipe, wherein the second running data is running data generated by each IO point of a second power device, collected by the client program and sent to the socket pipe; and a processing module, configured to perform data processing on the second running data, and display the processed second running data.

[0007] As an optional example, the connection module comprises: a creation unit configured to create a socket and specify a type of the socket as a stream socket; a binding unit configured to bind the socket to a local address of the electronic data processing system; and a connection unit configured to, in response to receiving a connection request from the client program, establish a connection with the client program according to the connection request, wherein the connection request is a request from the client program to the electronic data processing system to connect to the socket of the electronic data processing system after the client program creates the socket and according to a socket address of the electronic data processing system.

[0008] As an optional example, the first sending module comprises: 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 device further comprises: a generation module configured to generate, for each IO point of the first power device, a unique identifier, a data type, and a data length before sending the configuration data to the socket pipe; and a determination module configured to determine each IO point and the unique identifier, the data type, and the data length of the IO point as a configuration data pair, wherein the configuration data comprises all the configuration data pairs.

[0010] As an optional example, the second sending module comprises: a conversion unit configured to convert the unique identifier and the data value of one or more of the first running data into a byte stream according to a target format to obtain at least one byte stream, wherein a number of bytes of each byte stream is less than or equal to a target threshold; and a second sending unit configured 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 analyzes each IO point according to each byte stream and the configuration data to obtain the first running data of the IO point.

[0011] As an optional example, the conversion unit comprises: a processing subunit configured to, in response to converting the unique identifier and the data value of the target running data into a first byte stream according to the target format and the number of bytes of the first byte stream being greater than the target threshold, perform frame processing on the first byte stream to obtain a plurality of second byte streams, wherein the target running data is any one or more of the first running data, and a number of bytes of each second byte stream is less than or equal to the target threshold.

[0012] In a third aspect, the present application provides a storage medium having a computer program stored therein, wherein the computer program is run by a processor to execute the communication method of the power protocol.

[0013] In a fourth aspect, the present application 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 power protocol by using the computer program.

[0014] In the embodiments of the present application, a socket pipe is used to establish a connection with a client program; 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 custom data of the client, including configuration items and their unique identifiers, and the configuration items include IO points of the first power device, device parameters and protocol information; first running data generated by each IO point of the first power device is collected; the unique identifier and data value of each first running data are sent to the socket pipe, so that the client program obtains the unique identifier and data value of each first running data from the socket pipe, and the first running data of each IO point is parsed according to each unique identifier and data value and configuration data. In the above method, the powerful data processing function of EDPS is used to collect data and forward it to the client program process through the socket, and the client program further processes the received data. Thus, the flexibility of data processing is improved, customized development of the client according to specific needs is supported, diversified application scenarios are met, the scalability and efficiency of the system are ensured, and better user experience is provided for the client, thereby solving the technical problem that the third party cannot provide customized development, modification and upgrade support, which affects the development efficiency and flexibility of the client. BRIEF DESCRIPTION OF DRAWINGS

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

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, those skilled in the art can obtain other drawings from these drawings without any creative effort.

[0017] One or more embodiments are exemplarily illustrated by pictures in the drawings corresponding thereto, and these exemplary illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, unless otherwise specified. The drawings in the drawings do not constitute a proportional limitation.

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

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

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

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

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

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

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

[0025] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0026] The following disclosure provides many different embodiments, or examples, for implementing different structures of the present application. For the purpose of simplicity and clarity, the description in the following text describes the components and settings of specific examples. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeatedly refer to numbers and / or letters in different examples. Such repetition is for the purpose of simplification and clarity, and it does not indicate the relationship between the various embodiments and / or settings discussed.

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

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

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

[0030] S106, collect first running data generated by each IO point of the first power device;

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

[0032] Optionally, in the first embodiment, on the premise that the third party does not need to modify and open the source code, the client can develop and update the customized and private protocol simply and efficiently by using the powerful data processing function of the EDPS, only by focusing on the customized or private part and following the rules made 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, and supports various business logic and data processing tasks. EDPS is used as a "black box" for data processing, and is run as a separate process to ensure the security and integrity of its core functions. The customized program of the client runs in another independent process and exchanges data with EDPS through inter-process communication (IPC). Such architecture enables the client program to freely develop and run customized upper-layer applications without exposing internal mechanisms. EDPS is responsible for collecting data and forwarding it to the client program process, while the client program processes the received data, including data conversion, encryption processing, uploading to the cloud and other operations, thereby realizing flexible application expansion and data security processing. EDPS mainly includes data processing processes of three modules of collection, advanced application and protocol forwarding, wherein the protocol forwarding module can forward the collected data and the data processed by the advanced application to the remote node in the form of a specific power protocol through the network or the serial port.

[0033] Specifically, as Figure 2The processing flow shown, in the initialization phase, the EDPS is initialized at the same time as the client program, the EDPS end creates a Unix domain socket, prepares to serve as a server, listens to the connection request of the client program, configures the related parameters of the socket, including binding address and port, to ensure that the request can be correctly received. The client program end creates a Unix domain socket, which is used to initiate a connection request to the EDPS, and ensures that the parameters of the socket match the settings of the EDPS end. The client program uses the socket it creates to send a connection request to the EDPS, and the listening thread in the EDPS detects the connection request, accepts the request and establishes a connection, after the connection is successful, both parties can start data communication. The 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 an EDPS that can directly collect its running data, such as smart meters, transformer monitoring devices, power distribution automation devices, etc., and can convert and forward it to the client program, which is customized by the client for specific applications. In the running phase, the EDPS continuously monitors each IO point of the first power device, and collects running data in real time, each data point is associated with its unique identifier. The EDPS sends the running data of each IO point and its unique identifier to the client program through the socket pipe and the inter-process forwarding module, the client program receives the running data and the corresponding unique identifier sent by the EDPS from the socket pipe, and the client program uses the configuration data to parse the received unique identifier and data value, maps the parsed data to the specific IO point, and forms the final running data. The client program processes the received data according to business requirements, including data conversion, encryption, and data upload to the cloud, etc. Once the data processing is completed, the client program can continue to perform other tasks or return to the data receiving state, and prepare to receive new data. In the end phase, when the client program completes all processing tasks, it sends an offline notification message to the EDPS, informing it that it will end running, and the EDPS confirms the notification after receiving the offline notification of the client program and prepares to release resources. The client program closes its Unix socket connection with the EDPS to ensure that there is no further data transmission, and the EDPS also closes its corresponding socket connection after receiving the closing request to ensure that the connection between the two parties is properly disconnected. The client program releases the memory, file handle and other system resources occupied during running to avoid resource leakage. The EDPS cleans up the threads, data buffers and other resources used in the EDPS to ensure that it does not occupy excess system resources, and once both parties confirm the offline notification and resource release, the process is officially ended, and the system enters standby state, preparing to accept the next connection or task.

[0034] Optionally, in the first embodiment, by taking EDPS as an independent "black box", the client program can focus on upper application development, realizing better modularization and responsibility separation. EDPS runs independently as a server, enhancing the security and integrity of data and reducing 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 realizes inter-process communication through Unix socket, ensuring fast and reliable data transmission between EDPS and the client program. EDPS can timely deliver the collected operation data to the client program, which helps to realize real-time monitoring and processing.

[0035] In the second embodiment, after establishing a connection with the client program through the socket pipe, the above method further comprises:

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

[0037] Performing data processing on the second operation data, and displaying the processed second operation data.

[0038] Optionally, in the second embodiment, after the EDPS and the client program establish a stable communication channel, the client program collects operation data from each IO point of the second power equipment using its customized collection protocol, obtains second operation data, and sends it to the EDPS through the established Unix socket pipe. The second power equipment is unable to directly collect operation data, such as non-intelligent electric meters, power equipment that cannot be connected to the network, etc. The client program directly collects and forwards the operation data to the EDPS, and the EDPS realizes data processing, forwarding, display and other functions. For example, Figure 3The processing flow shown, in the EDPS, an "inter-process acquisition module" is added, which is responsible for receiving the second running data sent by the client program from the Unix socket pipe. The module continuously listens to the socket pipe, and when data is received, it immediately performs data parsing and verification. The EDPS performs a series of processing on the received second running data, including data cleaning, format conversion and verification, etc. The processed data will be stored in the internal data structure of the EDPS for subsequent use. After processing the data, the EDPS transmits the processed data to the client program or other required services through the "inter-process forwarding module". The forwarding process still uses Unix socket to ensure the reliability and real-time performance of data transmission. The EDPS can display the processed second running 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 better user experience. By adding the inter-process acquisition and forwarding module, the function of the EDPS is expanded to support customers to customize the data processing flow according to specific needs. Customers can flexibly use the original function modules of the EDPS to seamlessly integrate with their customized programs, thereby realizing efficient data acquisition, processing, forwarding and display.

[0039] In embodiment three, the connection with the client program through the socket pipe includes:

[0040] Creating a socket and specifying the type of socket as a stream socket;

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

[0042] In the case of receiving a connection request issued by the client program, a connection is established with the client program according to the connection request, wherein the connection request is a request issued by the client program to connect to the socket of the electronic data processing system after creating the socket, according to the socket address of the electronic data processing system.

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

[0044] In embodiment four, sending the configuration data to the socket pipe includes:

[0045] Sending the configuration data to the socket address so that the client program obtains the configuration data from the socket address.

[0046] Optionally, in this embodiment four, in the EDPS, first, the configuration data needs to be prepared, which may contain parameter settings of various power equipment, data acquisition strategies, unique identifiers of each IO point, and other information. After the configuration data is prepared, the EDPS needs to ensure that the socket connection with the client program has been established, at which time the EDPS will use the previously created connection socket to ensure that the communication pipe between the two parties is active. The EDPS uses a sending function to send the configuration data to the client program through the socket, and the client program uses a receiving 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, and the parsed data will be applied to the logic of the client program, such as initializing the IO point, setting the data acquisition strategy, etc.

[0047] In embodiment five, before sending the configuration data to the socket pipe, the above method further includes:

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

[0049] determining each IO point and the unique identifier, the data type, and the data length thereof as a configuration data pair, wherein the configuration data comprises all configuration data pairs.

[0050] Optionally, in the fifth embodiment, in the initialization phase, the EDPS needs to process multiple configuration items, including driver information, protocol configuration, device configuration, and IO point configuration. For each configuration item, the EDPS generates a unique global management point identifier (GMPID). The GMPID can be generated based on a timestamp algorithm, a random number generator, or combined with device characteristics information to ensure the uniqueness of each identifier. Each generated GMPID is transmitted to the client program together with its corresponding configuration item. The transmitted data includes the GMPID of each configuration item and the related configuration parameters. The structure of the configuration data can include: {GMPID, configuration type, configuration parameters}, which enables the client program to identify and store each configuration item. After receiving the configuration data, the client program needs to store each configuration pair in its local database or memory for subsequent use. Thus, in the data transmission phase, in order to improve efficiency, the 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 the sixth embodiment, transmitting the unique identifier and the data value of each first running data to the socket pipe comprises:

[0052] converting the unique identifier and the data value of one or more 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 byte stream is less than or equal to a target threshold;

[0053] transmitting 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 IO point of the first running data according to each byte stream and the configuration data.

[0054] converting the unique identifier and the data value of one or more first running data into a byte stream according to a target format to obtain at least one byte stream comprises:

[0055] In a case that the unique identifier and the data value of the target running data are converted into the 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 subjected to frame processing to obtain a plurality of second byte streams, wherein 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 running data is collected, including the unique identifier of each IO point and the corresponding data value, and the structure of each data record can be defined as: {unique identifier, data value}. The data records are converted into a byte stream format for transmission through a socket. A suitable serialization method is selected to convert the data records into a byte stream, and the converted byte stream is ensured to conform to the target format so as to be correctly parsed by the receiving end. 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 part not exceeding 255 bytes. The prepared byte stream or byte streams are sent to the client program through a 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 running data of each IO point according to the pre-defined configuration data, parses the content in the byte stream, restores the unique identifier and the data value, and corresponds the restored data with the configuration data to complete the complete data record of the IO point.

[0057] Optionally, in the sixth embodiment, as Figure 4The data format of one byte stream is shown. When data is transmitted between EDPS and the client process, the overall format is a byte stream, and the maximum length of each data frame is 255 bytes. If the data content exceeds 255 bytes, a new frame needs to be restarted, and the transmission sequence number is incremented by 1 in the new frame. The end of each frame of data is indicated by a specific end symbol to ensure that the receiving party can correctly identify the end of data transmission. When the data type is TEXT, the data length information occupies two bytes. If the data type is other types, the data length does not need to be transmitted separately, and the data value is transmitted directly after the data type. All transmitted data uses UTF-8 encoding 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 sequence number of the next transmission will be reset to 1; Belonging 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 of the configuration item, usually in English; Configuration alias: the display name of the configuration, which can be used for Chinese display, and can be empty, with a data type of TEXT and a length of 0; Configuration description: 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 be different according to the above provisions, for example, the TEXT type needs to transmit the data length additionally.

[0058] Optionally, in this embodiment six, the extended configuration is a configuration item that can be customized by the client. After being added in the ICT configuration tool, it is transmitted to the client process by the EDPS to realize the function of customizable protocol and ensure the universality of secondary development function. In the extended configuration, table configuration can be nested. In principle, at most one layer of table can be nested, i.e. a table contains one layer of table. The data transmission format is as follows Figure 5The extension configuration is in the form of a configuration table item, and a configuration item can be added by adding a row. The configuration item includes a configuration name, a configuration type (such as an edit box, a drop-down selection, etc.), a data type, optional values, and a configuration value, thereby realizing customized extension of the power protocol. In the configuration of the IO parameter, five basic types of extension configuration parameters are included, and the user can customize the configuration. The data format type associated with the configuration is a string type. If the five basic types of extension configuration parameters still cannot meet the customized requirements, a row can be added in the extension configuration table item to continue the customized configuration. The basic configuration includes a point name, a description, an associated point, and a value type. The associated point is configured in the 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. The extension configuration includes customization by the client, such as the function code, the register address, the start address, the data length, and the like in the modbus protocol. For the configuration of the value type, the data type is a numerical value corresponding to the value type, the data value is also a numerical value corresponding to the value type, the data length is a length corresponding to the value type, and the five basic parameters are transmitted in sequence. During runtime, the transmitted data format is also a byte stream. The client searches for the configuration of the point through the GMID, performs corresponding processing and display, and the data includes a field. In a frame, multiple points can be transmitted. 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 group quantity is 1, and the data block is parsed according to the configured data type and data format. For the fixed value group, the data transmitted in the data block is the data of all customized groups of the point, and the data block is parsed according to the configured group quantity, data type, and data format. The protocol configuration can be configured in the EDPS ICT tool or in the client program. The IO point must be configured in the ICT tool. If it is desired to be configured in the customized program, the configuration sequence of the IO point in the ICT tool and in the customized program must be consistent. Each type of configuration, such as the protocol configuration, the device configuration, and the IO configuration, has a general configuration and an extension configuration, and the client can complete the customized configuration requirement through the extension configuration.

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

[0060] According to another aspect of the embodiments 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, and includes:

[0061] The connection module 602 is configured to establish a connection with the client program through a socket pipe.

[0062] The first sending module 604 is configured to send configuration data to the socket pipe, so that the client program acquires the configuration data from the socket pipe, wherein the configuration data is custom data of the client, and the configuration data includes configuration items and unique identifiers of the configuration items, and the configuration items include IO points of the first power device, device parameters, and protocol information.

[0063] The collection module 606 is configured to collect first running data generated by each IO point of the first power device.

[0064] The second sending module 608 is configured to send unique identifiers and data values of each first running data to the socket pipe, so that the client program acquires the unique identifiers and data values of each first running data from the socket pipe, and acquires first running data of each IO point according to each unique identifier and data value and the configuration data.

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

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

[0067] The acquisition module is configured to acquire second running data from the socket pipe after establishing the connection with the client program through the socket pipe, wherein the second running data is running data generated by each IO point of the second power device, and the second running data is collected by the client program and sent to the socket pipe.

[0068] The processing module is configured to perform data processing on the second running data, and display the processed second running data.

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

[0070] The creating unit is configured to create a socket, and specify a type of the socket as a stream socket.

[0071] The binding unit is configured to bind the socket with a local address of the electronic data processing system.

[0072] The connection unit is configured to establish a connection with the client program according to the connection request when receiving the connection request sent by the client program, wherein the connection request is a request for connecting the socket of the electronic data processing system sent 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.

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

[0074] The first sending unit is configured 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 apparatus further comprises:

[0076] The generating module is configured to generate 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 determining module is configured to determine each IO point and its unique identifier, data type and data length as a configuration data pair, wherein the configuration data comprises all configuration data pairs.

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

[0079] The converting unit is configured to convert the unique identifier and the data value of one or more 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 byte stream is less than or equal to a target threshold.

[0080] The second sending unit is configured 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 IO point of the first running data according to each byte stream and the configuration data.

[0081] As an optional example, the converting unit comprises:

[0082] The processing sub-unit is configured to perform frame processing on the first byte stream to obtain a plurality of second byte streams when the unique identifier and the data value of the target running data are converted into the first byte stream according to the target format and the number of bytes of the first byte stream is greater than the target threshold, 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] Other examples of the embodiment can be found in the above examples, which will not be repeated here.

[0084] Figure 7is a schematic diagram of an optional electronic device according to an embodiment of the present application, as shown in Figure 7 The electronic device shown in FIG. 7 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 complete communication with each other through the communication bus 708, wherein,

[0085] The memory 706 is configured to store a computer program.

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

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

[0088] Send configuration data to the socket pipe, so that the client program obtains the configuration data from the socket pipe, wherein the configuration data is custom data of the client, including configuration items and unique identifiers thereof, and the configuration items include IO points of the first power device, device parameters, and protocol information.

[0089] Collect first running data generated by each IO point of the first power device.

[0090] Send the unique identifier and data value of each first running data to the socket pipe, so that the client program obtains the unique identifier and data value of each first running data from the socket pipe, and obtains the first running data of each IO point according to each unique identifier and data value and the configuration data.

[0091] Optionally, in the embodiment, the communication bus can be a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 7 In FIG. 7, only one thick line is used to represent the communication bus, but it does not mean that there is only one bus or only one type of bus. The communication interface is used for communication between the electronic device and other devices.

[0092] The memory can include a RAM, and can also include a non-volatile memory, for example, at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0093] As an example, the memory 706 can include, but is not limited to, the connection module 602, the first sending module 604, the collection 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 can also be included, which will not be described herein.

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

[0095] Optionally, the specific examples in the embodiments can refer to the examples described in the above embodiments, which will not be described herein.

[0096] Those skilled in the art can understand that the above-mentioned embodiments can be implemented by hardware, software or a combination of hardware and software. Figure 7 The structure shown is only schematic, and the device implementing the communication method of the power protocol can be a terminal device, which can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, etc. Figure 7 The structure of the electronic device is not limited. For example, the electronic device can further include more or less components (such as a network interface, a display device, etc.) than those shown in the figure, or have a different configuration from that shown in the figure. Figure 7 The structure of the electronic device is not limited. For example, the electronic device can further include more or less components (such as a network interface, a display device, etc.) than those shown in the figure, or have a different configuration from that shown in the figure. ​ The structure of the electronic device is not limited. For example, the electronic device can further include more or less components (such as a network interface, a display device, etc.) than those shown in the figure, or have a different configuration from that shown in the figure.

[0097] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiments can be completed by a program instructing the hardware of the terminal device, and the program can be stored in a computer readable storage medium, which can include a flash disk, a ROM, a RAM, a magnetic disk or an optical disk, etc.

[0098] According to another aspect of the embodiments of the present application, a computer readable storage medium is also provided, which stores a computer program, and when the computer program is run by a processor, the steps of the communication method of the power protocol are executed.

[0099] Optionally, in the embodiment, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiments can be completed by instructing the terminal device related hardware through a program, and the program can be stored in a computer readable storage medium, and the storage medium can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0100] The serial numbers of the embodiments of the application described above are only for description, not representing the advantages or disadvantages of the embodiments.

[0101] The integrated units in the above-mentioned embodiments, if realized in the form of software function units and sold or used as independent products, can be stored in the above-mentioned computer readable storage medium. Based on such understanding, the technical solutions of the application essentially or the parts that make contributions to the prior art or the whole or part of the technical solutions can be embodied in the form of software products, and the computer software products are stored in the storage medium, including a plurality of instructions for causing one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods described in the embodiments of the application.

[0102] In the above-mentioned embodiments of the application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0103] In the several embodiments provided by the present application, it should be understood that the disclosed client can be implemented in other ways. Of course, the above device embodiment is only illustrative, for example, the division of units is only a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or modules shown or discussed can be indirect coupling or communication connection through some interface, unit or module, and can be electrical or other forms.

[0104] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0105] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing unit, or each of the units can exist physically, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0106] The above only describes the preferred embodiments of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should also be considered as the protection scope of the present application.

Claims

1. A communication method for a power protocol, applied to an electronic data processing system, characterized in that, include: During the initialization phase, multiple configuration items are processed, including driver information, protocol configuration, device configuration, and I / O point configuration. For each configuration item, a unique global management point identifier is generated. Establish a connection with the client program via socket pipes; The configuration data is sent to the socket pipe so that the client program can obtain the configuration data from the socket pipe. The configuration data is client-defined data, including configuration items and their unique identifiers. The configuration items include the I / O points of the first power device, device parameters, and protocol information. Collect the first operating data generated by each I / O point of the first power equipment; The unique identifier and data value of each first running data are sent to the socket pipe, so that the client program can obtain the unique identifier and data value of each first running data from the socket pipe, and parse the first running data of each IO point according to each unique identifier and data value and configuration data. The step of sending the unique identifier and data value of each of the first running data to the socket pipe includes: converting the unique identifier and data value of one or more of the first running data into a byte stream according to a target format to obtain at least one byte stream, wherein each data unit in the byte stream follows the following general template: sequence number; module to which it belongs; globally unique identifier; configuration name; configuration alias; configuration description; data type; sending the at least one byte stream to the socket pipe so that the client program can obtain the at least one byte stream from the socket pipe and parse the first running data of each IO point according to each byte stream and configuration data.

2. The method according to claim 1, characterized in that, After establishing a connection with the client program via a socket pipe, the method further includes: The second operating data is obtained from the socket pipeline, wherein the second operating data is the operating data generated by each IO point of the second power equipment, which is collected by the client program and sent to the socket pipeline; The second running data is processed, and the processed second running data is displayed.

3. The method according to claim 1, characterized in that, The process of establishing a connection with the client program via socket pipes includes: Create a socket and specify the type of the socket as a stream socket; Bind the socket to the 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. The connection request is a request from the client program to connect to the socket of the electronic data processing system after creating the socket, based on the socket address of the electronic data processing system.

4. The method according to claim 3, characterized in that, Sending configuration data to the socket pipe includes: The configuration data is sent to the socket address so that the client program can obtain 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 includes: Generate a unique identifier, data type, and data length for each I / O point of the first power device; Each IO point, its unique identifier, data type, and data length are defined as a configuration data pair, wherein the configuration data includes all of the configuration data pairs.

6. The method according to claim 1, characterized in that, The number of bytes in each of the byte streams is less than or equal to the target threshold.

7. The method according to claim 6, characterized in that, The step of converting the unique identifiers and data values ​​of one or more of the first running data into a byte stream according to a target format to obtain at least one byte stream includes: If 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 in the first byte stream is greater than the target threshold, the first byte stream is framed to obtain multiple second byte streams. The target running data is any one or more running data in the first running data, and the number of bytes in the second byte stream is less than or equal to the target threshold.

8. A communication device based on a power protocol, applied to an electronic data processing system, characterized in that, include: The connection module is used to establish a connection with the client program via socket pipes; The first sending module is used to send configuration data to the socket pipe so that the client program can obtain the configuration data from the socket pipe. The configuration data is client-defined data, including configuration items and their unique identifiers. The configuration items include the I / O points of the first power device, device parameters, and protocol information. The acquisition module is used to acquire the first operating data generated by each I / O point of the first power equipment; The second sending module is used to send the unique identifier and data value of each first running data to the socket pipe, so that the client program can obtain the unique identifier and data value of each first running data from the socket pipe, and parse the first running data of each IO point according to each unique identifier and data value and configuration data. The electronic data processing system is also used to process multiple configuration items during the initialization phase, including driver information, protocol configuration, device configuration and IO point configuration, and to generate a unique global management point identifier for each configuration item. The step of sending the unique identifier and data value of each of the first running data to the socket pipe includes: converting the unique identifier and data value of one or more of the first running data into a byte stream according to a target format to obtain at least one byte stream, wherein each data unit in the byte stream follows the following general template: sequence number; module to which it belongs; globally unique identifier; configuration name; configuration alias; configuration description; data type; sending the at least one byte stream to the socket pipe so that the client program can obtain the at least one byte stream from the socket pipe and parse the first running data of each IO point according to each byte stream and configuration data.

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

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in 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

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

    WO2024230431A1