CN114629967B - Communication conversion method, device, electronic equipment and storage medium - Google Patents
Communication conversion method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114629967B CN114629967B CN202210240002.2A CN202210240002A CN114629967B CN 114629967 B CN114629967 B CN 114629967B CN 202210240002 A CN202210240002 A CN 202210240002A CN 114629967 B CN114629967 B CN 114629967B
- Authority
- CN
- China
- Prior art keywords
- time
- data
- target
- modbus
- data request
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40228—Modbus
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Selective Calling Equipment (AREA)
Abstract
The application relates to a communication conversion method, a device and electronic equipment, which are applied to a digital substation scene. The method comprises the following steps: acquiring a Modbus data set in a first time period at a first moment, wherein each Modbus data in the Modbus data set comprises a starting address and an address field of the Modbus data; receiving a first data request in a second time period, wherein the first data request is used for requesting target IEC618590 data, and the data request carries a target object reference for indexing the target IEC618590 data; determining a target starting address and a target address field corresponding to the target object reference according to the target object reference; determining target Modbus data from the Modbus data set according to the target starting address and the target address field; and transmitting the target IEC618590 data obtained after the target Modbus data are converted to a client side sending a first data request. By adopting the method, the data interaction time can be reduced, and the communication efficiency between devices with different protocols is improved.
Description
Technical Field
The present application relates to the field of digital substation communication management technologies, and in particular, to a communication conversion method, a device, an electronic device, and a storage medium.
Background
With the development of industrial network communication technology, the international electrotechnical commission (International Electro technical Commission, IEC) 61850 standard is the most complete communication standard protocol of the transformer substation system so far, and all devices in the transformer substation adopting the IEC618590 standard can communicate with each other, that is, exchange data between all devices through an intercommunication protocol (Interworking Protocol, IP) network, and the relay protection, automation, power quality and the like in the transformer substation system are related.
Currently, a traditional battery management unit system uses a Modbus communication protocol, so that devices of different manufacturers adopt a protocol converter to convert the Modbus communication protocol used by the existing devices into an IEC61850 communication protocol. Specifically, when the transformer substation with the IEC61850 standard needs data access, firstly, the transformer substation with the IEC61850 standard sends a data request for target IEC61850 data to a protocol converter, the protocol converter determines corresponding target Modbus data based on the data request and sends the data request for the target Modbus data to a Modbus battery management unit, so that the protocol converter obtains the target Modbus data from the Modbus battery management unit, and after converting the target Modbus data into the target IEC61850 data, the protocol converter sends the target IEC61850 data to the transformer substation with the IEC61850 standard, thereby completing communication among all devices in the transformer substation.
However, the protocol converter needs to process and forward based on the data request, and needs to wait for the Modbus battery management unit to respond in the process of requesting the Modbus data, thereby improving the duration of acquiring the target Modbus data, that is, improving the time of acquiring the target IEC61850 data, so as to improve the data interaction time, and thus reduce the efficiency of communication between devices with different protocols.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a communication conversion method, apparatus, electronic device, and storage medium capable of improving efficiency of communication between apparatuses of different protocols.
In a first aspect, the present application provides a communication conversion method. The method comprises the following steps:
acquiring a Modbus data set in a first time period at a first moment, wherein each Modbus data in the Modbus data set comprises a starting address and an address field of the Modbus data, and the ending moment of the first time period is the first moment;
receiving a first data request in a second time period, wherein the first data request is used for requesting target IEC618590 data, the data request carries a target object reference for indexing the target IEC618590 data, and the starting time of the second time period is a first time;
Determining a target starting address and a target address field corresponding to the target object reference according to the target object reference;
determining target Modbus data from the Modbus data set according to the target starting address and the target address field;
and transmitting the target IEC618590 data obtained after the target Modbus data are converted to a client side sending a first data request.
In one embodiment, the method further comprises:
counting N data requests received in a first time period, wherein each data request carries a time identifier for sending out the data request, the time identifier is used for uniquely identifying a moment, and N is an integer greater than 0;
calculating the time intervals among the N time marks, and obtaining (N-1) time intervals;
when (N-1) is 0, determining the end time of the second time period through the first time and the preset adjustment time;
when (N-1) is greater than 0, then the end time of the second time period is determined by the first time and the (N-1) time intervals.
In one embodiment, when (N-1) is 0, determining the end time of the second time period through the first time and the preset adjustment time includes:
when (N-1) is 0, determining a plurality of moments to be adjusted through the first moment and the preset adjustment time;
Determining a plurality of time differences to be adjusted corresponding to the data request according to the plurality of time to be adjusted and the time sent by the data request;
determining feedback rewarding results of the data request under the plurality of time differences to be adjusted according to the plurality of time differences to be adjusted, the operation load, the preset real-time percentage and the preset resource percentage corresponding to the data request;
and determining the ending time of the second time period from the plurality of time points to be adjusted based on the feedback rewarding results of the data request under the plurality of time differences to be adjusted.
In one embodiment, when (N-1) is greater than 0, then determining the end of the second time period from the first time and the (N-1) time intervals comprises:
when (N-1) is greater than 0, then calculating an average of (N-1) time intervals;
determining a plurality of time points to be adjusted through the average value of the first time point and the (N-1) time intervals;
determining a plurality of time differences to be adjusted corresponding to each data request according to the plurality of time differences to be adjusted and the time sent by each data request;
determining feedback rewarding results of each data request under a plurality of time differences to be adjusted according to a plurality of time differences to be adjusted, an operation load, a preset real-time percentage and a preset resource percentage corresponding to each data request;
And determining the end time of the second time period from the plurality of time to be adjusted based on the feedback rewards results of each data request under the plurality of time differences to be adjusted.
In one embodiment, the method further comprises:
constructing a mapping relation between an initial address and an address field of Modbus data and object references;
determining a target starting address and a target address domain corresponding to the target object reference according to the target object reference, including:
and according to the target object reference, determining a target starting address and a target address field mapped by the target object reference through the starting address of Modbus data and the mapping relation between the address field and the object reference.
In one embodiment, the method further comprises:
acquiring a function set of the Modbus battery management unit;
dividing the function set to obtain an IEC61850 logic structure, wherein the IEC61850 logic structure comprises logic equipment, logic nodes and IEC61850 data;
constructing an object reference based on an IEC61850 logical structure, wherein the object reference comprises a plurality of logical devices, an index relation between each logical device and a plurality of logical nodes, and an index relation between each logical node and a plurality of IEC618590 data;
the construction of the mapping relation between the starting address and the address domain of Modbus data and the object reference comprises the following steps:
Constructing a mapping relation between an address field and logic equipment and a mapping relation between a starting address and logic nodes and IEC618590 data;
according to the target object reference, determining the target starting address and the target address field mapped by the target object reference through the starting address of Modbus data and the mapping relation between the address field and the object reference, wherein the method comprises the following steps:
determining a target initial address according to the index relation between a target logical node and target IEC618590 data in the target object reference and the mapping relation between the initial address and the logical node and IEC618590 data;
and determining the target address domain according to the index relation between the target logic device and the target logic node in the target object reference and the mapping relation between the address domain and the logic device.
In a second aspect, the application also provides a communication conversion device. The device comprises:
the communication module is used for acquiring a Modbus data set in a first time period at a first time, wherein each Modbus data in the Modbus data set comprises a starting address and an address field of the Modbus data, and the ending time of the first time period is the first time; receiving a first data request in a second time period, wherein the first data request is used for requesting target IEC618590 data, the data request carries a target object reference for indexing the target IEC618590 data, and the starting time of the second time period is a first time;
The processing module is used for determining a target starting address and a target address field corresponding to the target object reference according to the target object reference; determining target Modbus data from the Modbus data set according to the target starting address and the target address field;
and the communication module is also used for transmitting the target IEC618590 data obtained after the target Modbus data are converted to the client side which sends the first data request.
In a third aspect, the application further provides electronic equipment. The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the following steps:
acquiring a Modbus data set in a first time period at a first moment, wherein each Modbus data in the Modbus data set comprises a starting address and an address field of the Modbus data, and the ending moment of the first time period is the first moment;
receiving a first data request in a second time period, wherein the first data request is used for requesting target IEC618590 data, the data request carries a target object reference for indexing the target IEC618590 data, and the starting time of the second time period is a first time;
determining a target starting address and a target address field corresponding to the target object reference according to the target object reference;
Determining target Modbus data from the Modbus data set according to the target starting address and the target address field;
and transmitting the target IEC618590 data obtained after the target Modbus data are converted to a client side sending a first data request.
In a fourth aspect, the present application also provides a computer-readable storage medium. A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring a Modbus data set in a first time period at a first moment, wherein each Modbus data in the Modbus data set comprises a starting address and an address field of the Modbus data, and the ending moment of the first time period is the first moment;
receiving a first data request in a second time period, wherein the first data request is used for requesting target IEC618590 data, the data request carries a target object reference for indexing the target IEC618590 data, and the starting time of the second time period is a first time;
determining a target starting address and a target address field corresponding to the target object reference according to the target object reference;
determining target Modbus data from the Modbus data set according to the target starting address and the target address field;
And transmitting the target IEC618590 data obtained after the target Modbus data are converted to a client side sending a first data request. In a fifth aspect, the present application also provides a computer program product. Computer program product comprising a computer program which, when executed by a processor, realizes the steps of:
acquiring a Modbus data set in a first time period at a first moment, wherein each Modbus data in the Modbus data set comprises a starting address and an address field of the Modbus data, and the ending moment of the first time period is the first moment;
receiving a first data request in a second time period, wherein the first data request is used for requesting target IEC618590 data, the data request carries a target object reference for indexing the target IEC618590 data, and the starting time of the second time period is a first time;
determining a target starting address and a target address field corresponding to the target object reference according to the target object reference;
determining target Modbus data from the Modbus data set according to the target starting address and the target address field;
and transmitting the target IEC618590 data obtained after the target Modbus data are converted to a client side sending a first data request.
According to the communication conversion method, the device, the electronic equipment, the storage medium and the computer program product, a Modbus data set in a first time period is obtained at a first time, each Modbus data set comprises a starting address and an address field of the Modbus data, then a first data request is received in a second time period, the first data request is used for requesting target IEC618590 data, the data request carries a target object reference for indexing the target IEC618590 data, the starting time of the second time period is the first time, a target starting address and a target address field corresponding to the target object reference are determined according to the target object reference, then target Modbus data is determined from the Modbus data set according to the target starting address and the target address field, and finally target IEC618590 data obtained after conversion of the target Modbus data is sent to a client side sending the first data request. According to the method, the Modbus data set in the first time period is obtained at the end time of the first time period, so that Modbus data from the Modbus battery management unit can be stored locally, when a data request for indicating the request target IEC618590 data is obtained in the second time period, the target Modbus data is directly obtained from the locally stored Modbus data set, the response time of data reading can be reduced by regularly obtaining the Modbus data set, the program operation pressure is reasonably distributed to the communication conversion device, the time of data interaction is reduced, and the communication efficiency between devices in different protocols is improved.
Drawings
FIG. 1 is a diagram of an application environment for a communication transformation method in one embodiment;
FIG. 2 is a diagram of an application environment for communication conversion based on a communication conversion device in one embodiment;
FIG. 3 is a schematic diagram of a Modbus battery management unit according to one embodiment;
FIG. 4 is a flow diagram of a communication conversion method in one embodiment;
FIG. 5 is a flow chart of a communication conversion method in another embodiment;
FIG. 6 is a flowchart illustrating determining an end time of the second time period according to the first time and the preset adjustment time when (N-1) is 0 in one embodiment;
FIG. 7 is a flow chart of determining the ending time of the second time period by the first time and the (N-1) time intervals when (N-1) is greater than 0 in one embodiment;
FIG. 8 is a flow chart of a communication conversion method in another embodiment;
FIG. 9 is a flow chart of a communication conversion method in another embodiment;
FIG. 10 is a diagram of an embodiment in which the IEC61850 standard defines data in one embodiment;
FIG. 11 is a block diagram of a communication conversion device in one embodiment;
fig. 12 is an internal structural diagram of an electronic device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The communication conversion method provided by the embodiment of the application can be applied to an application environment shown in figure 1. In the technical field of digital substation communication management, the IEC61850 client 102 communicates with the communication conversion device 104 through a network, and the communication conversion device 104 communicates with the Modbus battery management unit 106 through the network. The data that the communication translation device 104 needs to store is stored in a local database. The IEC61850 client 102 is a client in the transformer substation, which accords with the IEC61850 standard, and the IEC61850 client 102 includes, but is not limited to, an electronic transformer, an intelligent switch, and the like.
Based on the application environment of fig. 1, the manner in which the IEC61850 client 102, the communication conversion device 104, and the Modbus battery management unit 106 communicate with each other will be described. As shown in fig. 2, the communication conversion device 104 first constructs an intelligent electronic device (Intelligent Electronic Device, IED) model including an information model and a service model according to the Modbus battery management unit 106. The communication conversion device 104 then builds a Modbus control (Master) module 202, a data mapping module 204, and an IEC61850 server 206 based on the IED model. Based on this, the communication conversion device 104 builds a Modbus server simulator and builds the IEC61850 client 102.
Specifically, the communication conversion device 104 first constructs the Modbus Master module 202,Modbus Master module 202 for performing the data transceiving function, that is, the Modbus battery management unit 106 encapsulates according to the format of Modbus to obtain Modbus data, and transmits the Modbus data to the Modbus Master module 202, and the Modbus Master module 202 obtains the Modbus data. The communication conversion device 104 converts the built IED model into a static_model.h file and a static_model.c file by using a preset writing program, and builds the IEC61850 server 206 according to the static_model.h file and the static_model.c file as handle files, so that the IEC61850 server 206 can start services according to the handle files. Based on this, the communication conversion device 104 analyzes the Modbus data uploaded by the Modbus battery management unit 106 through the constructed Modbus Master module 202, the communication conversion device 104 maps the Modbus data into the information model and the service model through the data mapping module 204, maps the Modbus data into IEC61850 data through the information model and the service model, and finally sends the mapped IEC61850 data to the IEC61850 client 102 through the IEC61850 server 206, thereby realizing communication with the IEC61850 client 102.
Next, the communication conversion device 104 constructs a Modbus server simulator according to the offset addresses in the input register and the holding register in the Modbus battery management unit 106, and simulates the input register and the holding register in the Modbus battery management unit through the Modbus server simulator.
Further, as shown in fig. 3, the Modbus battery management unit 106 in fig. 1 specifically includes a battery management module 304, a network card 306, and a battery control module 308. The battery management module 304 is configured to monitor a voltage of the monomer, monitor a temperature of the monomer and monitor an equilibrium state, that is, the battery management module 304 can obtain the voltage of the monomer by monitoring the voltage of the monomer, obtain the temperature of the monomer by monitoring the temperature of the monomer, and obtain the equilibrium state of the monomer by monitoring the equilibrium state, where the voltage of the monomer, the temperature of the monomer and the equilibrium state of the monomer are Modbus data. Second, the battery control module 308 contains many logical nodes, each of which contains many data, and classification of the actual device can be accomplished by the battery control module 308, thereby enabling modeling based on a Source list (SCL) configuration language based on a plurality of logical nodes included in the battery control module 308. The network card 306 is used for detecting the network card status, that is, detecting the network card status of each Modbus data, and the Modbus battery management unit 106 accesses the network through the network card 306, so as to complete the communication with the communication conversion device 104.
In one embodiment, as shown in fig. 4, a communication conversion method is provided, and the method is applied to the communication conversion device 104 in fig. 1 for illustration, and includes the following steps:
step 402, a set of Modbus data in a first time period is obtained at a first time, where each Modbus data in the set of Modbus data includes a start address and an address field of the Modbus data, and an end time of the first time period is the first time.
The communication conversion method provided by the application is applied to a digital substation scene, and Modbus data are encapsulated data according to a Modbus format. As can be seen from fig. 3, the communication conversion device specifically communicates with the network card in the Modbus battery management unit, so as to obtain, at a first time, data from the input register of each battery cell in the Modbus battery management unit, and then decode and store the returned Modbus data into the database, thereby obtaining a Modbus data set, where the Modbus data set includes data such as cell voltage, cell temperature, cell equilibrium state, and the like, which are packaged into a Modbus format.
Specifically, the first time is specifically an end time of the first time period, for example, if the first time period is 0 seconds to 10 seconds, the first time is 10 seconds, and if the first time period is 10 seconds to 25 seconds, the first time is 25 seconds. And the time interval of the first time period is a preset time interval, for example, 10 seconds, 15 seconds or 20 seconds. It should be appreciated that the foregoing examples are all used to understand the present solution, the preset time interval is determined according to actual requirements and a lot of experimental data, and the first time is determined according to the starting time of the first time period and the preset time interval, and thus the foregoing should not be construed as limiting the present solution.
Next, the address field of the Modbus data is used to identify which cell (battery) from which the Modbus data originates, e.g., address field 10001 identifies cell 1 from which the Modbus data originates, address field 10002 identifies cell 2 from which the Modbus data originates, and address field 10003 identifies cell 3 from which the Modbus data originates.
Again, the starting address of the Modbus data is constructed according to the fixed address for reading the Modbus data, for example, the starting address 30001 represents the total voltage of the storage battery, 30002 represents the total current of the storage battery, the starting address 30003 represents the average temperature of the storage battery, the starting address 30004 represents the highest cell voltage, the total voltage of the storage battery, the total current of the storage battery, the average temperature of the storage battery and the highest cell voltage are all data with different data attributes, and the Modbus data can be obtained by packaging the data according to the format of the Modbus. It should be understood that the foregoing examples are only for understanding the present solution, and the correspondence between address fields and unit cells, and the relationship of the start address representation of Modbus data storing different data attributes need to be determined based on actual situations, and should not be construed as limiting the present application.
Step 404, a first data request is received during a second time period, the first data request being for requesting target IEC618590 data, the data request carrying a target object reference for indexing the target IEC618590 data, the beginning of the second time period being the first time.
In this embodiment, when the IEC61850 client in fig. 1 needs to acquire the target IEC618590 data in the second time period, the first data request is sent to the communication conversion device in fig. 1 through the network, so that the communication conversion device acquires the first data request, the second time period is a time period adjacent to the first time period, and the starting time of the second time period is the first time, for example, the first time period is 0 to 10 seconds, and the second time period is 10 to 20 seconds, so that the first time 10 seconds is the ending time of the first time period and is also the starting time of the second time period. And the first data request is for requesting target IEC618590 data, the data request carrying a target object reference for indexing the target IEC618590 data.
Specifically, the target IEC618590 data is data packaged in the format of IEC618590, i.e., the target IEC618590 data may include, but is not limited to, data of total battery voltage, total battery current, average battery temperature, and highest cell voltage packaged in the format of IEC 618590.
Step 406, determining a target starting address and a target address field corresponding to the target object reference according to the target object reference.
As can be seen from the foregoing description, since the IED model includes an information model and a service model, and the target object reference is used to index the target IEC618590 data, the data mapping module in the communication conversion apparatus is referenced by the target object and is capable of determining the target start address and the target address field based on the information model.
In step 408, target Modbus data is determined from the Modbus data set according to the target start address and the target address field.
Specifically, since the destination address field indicates a battery cell from which the destination Modbus data is derived and the destination start address indicates specific data of the destination Modbus data, the destination Modbus data carrying the destination start address and the destination address field can be determined from the set of Modbus data by the destination start address and the destination address field.
Further, after the communication conversion device acquires the Modbus data set in step 402, the Modbus data set is stored in the database, so that the target Modbus data corresponding to the target start address and the target address field can be further determined according to the information model through the target start address and the target address field.
In step 410, the target IEC618590 data obtained after the conversion of the target Modbus data is sent to the client that sends the first data request.
After the communication conversion device determines target Modbus data, the target Modbus data are updated into an IEC61850 server, the IEC61850 server is required to be called, then the IEC61850 server analyzes the target Modbus data to obtain target data, the target data are packaged according to the format of IEC618590 to obtain target IEC618590 data, and the communication conversion device sends the obtained target IEC618590 data to an IEC61850 client which sends a first data request.
Specifically, the communication conversion device calls an IEC61850 server to convert target Modbus data into a named variable of a corresponding member management system (Membership Management System, MMS), maps the target Modbus data into a target update function of the MMS protocol using the ACSI protocol, and converts a target object reference into a target domain (domain) and a target named variable, then determines target update data in the MMS server, and determines whether the target object reference and the target update data are of the same data type, and then determines whether the target update data satisfies a trigger condition including updatable, readable and modifiable. Based on the above, after the target object reference and the target update data are of the same data type and the trigger condition is met, the target update data are updated to the MMS server by using a target update function of the MMS protocol, and the IEC61850 server is obtained by externally packaging the MMS server. Therefore, when the target data is specifically packaged, the data obtained by packaging the MMS protocol is packaged based on the IEC61850 protocol, and then the target IEC61850 data is obtained by packaging the MMS protocol again.
According to the communication conversion method, the Modbus data set in the first time period is acquired at the end time of the first time period, so that Modbus data from the Modbus battery management unit can be stored locally, when a data request indicating the request target IEC618590 data is acquired in the second time period, the target Modbus data is directly acquired from the locally stored Modbus data set, the response time of data reading can be reduced by acquiring the Modbus data set at regular time, the program operation pressure is reasonably distributed to the communication conversion device, the time of data interaction is reduced, and the communication efficiency between devices in different protocols is improved.
Because the request frequency of sending data requests cannot be estimated in actual production, the load of the Modbus server and the IEC61850 server is increased if the time period is too short, and the read data cannot be ensured to be the latest data if the time period is too long. It is therefore necessary to adjust the time interval of the second time period, i.e. to adjust the end time of the second time period, based on the data request situation of the first time period. How the end time of the second time period is adjusted will be described in detail below.
In one embodiment, as shown in fig. 5, the method further comprises the steps of:
step 502, counting N data requests received in a first time period, where each data request carries a time identifier for sending out the data request, where the time identifier is used to uniquely identify a moment, and N is an integer greater than 0.
In particular, the communication conversion device is further capable of counting N data requests received in the first time period, N being an integer greater than 0, i.e. in particular counting at least one data request received in the first time period. Thus, the communication conversion device obtains a= [ a 1 ,A 2 ,…,A N ]A is the time of each data request, A 1 A for the instant of the first data request 2 For the moment of the second data request, and so on, A N The time of issue for the nth data request.
Specifically, each data request carries a time identifier for issuing the data request, which is used to uniquely identify a time instant. For example, the time interval of the first time period is specifically 0 seconds to 10 seconds, the data request 1, the data request 2 and the data request 3 are received in the first time period, the time identifier 1 carried by the data request 1 is used for identifying the 3 th second, the time identifier 2 carried by the data request 2 is used for identifying the 6 th second, and the time identifier 3 carried by the data request 3 is used for identifying the 9 th second.
It should be understood that, in practical applications, the time interval of each period may be adjusted according to the actual number of data requests in the previous adjacent period, so the time interval of the first time period may be a preset time interval, or may be a time interval obtained after the actual number of data requests in the previous adjacent period is adjusted, which is not limited herein.
Step 504, calculating time intervals between the identified moments of the N time identifiers, to obtain (N-1) time intervals.
The communication conversion device specifically calculates the time intervals between adjacent time points in the N time marks to obtain (N-1) time intervals. A= [ A ] obtained based on communication conversion device 1 ,A 2 ,…,A N ]It is known that A i -A i-1 (i > 1) is the time interval between two adjacent instants, then there is c= [ a ] for N data requests 2 -A 1 ,A 3 -A2, …, AN-AN-1, C (N-1) time intervals. It should be understood that if N is 1, the time identified by the time identifier carried by the data request does not have an adjacent time, so the time interval is 0, and step 506 will be performed. If N is a positive integer greater than 1, then step 508 is performed.
For example, if time stamp 1 carried by data request 1 is used to stamp 3 rd second, time stamp 2 carried by data request 2 is used to stamp 6 th second, and time stamp 3 carried by data request 3 is used to stamp 9 th second, 3 rd second and 6 th second are adjacent time instants, and 6 th second and 9 th second are adjacent time instants, so the time interval between 3 rd second and 6 th second is calculated to be 3 seconds, and the time interval between 6 th second and 9 th second is calculated to be 3 seconds.
In step 506, when (N-1) is 0, the end time of the second time period is determined through the first time and the preset adjustment time.
Specifically, when (N-1) is 0, it is indicated that the communication conversion device receives only 1 data request in the first time period. Based on this, the communication conversion device also needs to acquire the operation load of the IEC61850 server in the communication conversion device in the first time period, and then specifically determine the end time of the second time period by the first time, the preset adjustment time, the operation load of the IEC61850 server in the first time period, the preset real-time percentage and the preset resource percentage, that is, adjust the time interval of the second time period.
The preset adjustment time may be 0.05 seconds, 0.1 seconds, etc., and is determined by a large amount of experimental data, which is not limited herein.
In step 508, when (N-1) is greater than 0, then the end time of the second time period is determined by the first time and the (N-1) time intervals.
Specifically, when (N-1) is greater than 0, the communication conversion device obtains the operation load of the IEC61850 server in the communication conversion device in the first time period, and then determines the end time of the second time period by the first time, (N-1) time intervals, the operation load of the IEC61850 server in the first time period, the preset instantaneity percentage and the preset resource percentage, namely, adjusts the time interval of the second time period.
It should be understood that the foregoing examples are used to understand the present solution, and the foregoing preset real-time percentage and the preset resource percentage are determined according to actual requirements, and are not limited herein.
In the communication conversion method, the time interval of the data request is determined in real time by counting the times of the data request received in the first time period, so that the end time of the second time period is determined for the next period (the second time period) through the data request condition of the previous period (the first time period), namely, the time interval of the next period is adjusted, the problem that the running load is aggravated due to the fact that the preset time interval is too short is avoided, and the instantaneity of the read data can be improved.
A method of how the end time of the second time period is determined in the case where (N-1) is 0 will be specifically described below. In one embodiment, as shown in fig. 6, step 506, when (N-1) is 0, determining the end time of the second time period through the first time and the preset adjustment time includes:
in step 516, when (N-1) is 0, a plurality of time points to be adjusted are determined by the first time point and the preset adjustment time.
Specifically, the communication conversion device calculates at least one moment after adding the first moment and at least one preset adjustment time, and calculates at least one moment after subtracting the first moment and the at least one preset adjustment time, thereby obtaining a plurality of moments to be adjusted. For example, taking the first time as 10 seconds and the preset adjustment time as 0.1 seconds as an example, 10 seconds are added to one 0.1 second to obtain 10.1 seconds, 10 seconds are added to two 0.1 seconds to obtain 10.2 seconds, and 10 seconds are subtracted from one 0.1 second to obtain 9.9 seconds, 10 seconds are subtracted from two 0.1 seconds to obtain 9.8 seconds, so that the obtained multiple adjustment time periods are 10.1 seconds, 10.2 seconds, 9.9 seconds and 9.8 seconds.
In step 526, a plurality of time differences to be adjusted corresponding to the data request are determined according to the plurality of time to be adjusted and the time when the data request is sent.
Specifically, when the N-1 bit is 0, it indicates that only 1 data request is received in the first time period, so the communication conversion device subtracts the time to be adjusted from the time when the data request is sent, and takes the subtracted absolute value as a plurality of time differences to be adjusted corresponding to the data request. Specifically, the formula (1):
V=|A-T|; (1)
wherein V is the time difference to be adjusted corresponding to the data request, A is the time when the data request is sent out, and T is the time to be adjusted.
For example, describing equation (1) in detail based on examples of the plurality of times to be adjusted of 10.1 seconds, 10.2 seconds, 9.9 seconds, and 9.8 seconds, if the time at which the data request is issued is 7 seconds, the first time to be adjusted is 10.1 seconds, then the corresponding one of the time differences to be adjusted for the data request is 3.1 seconds, the second time to be adjusted is 10.1 seconds, then the corresponding another time difference to be adjusted for the data request is 3.2 seconds, the third time to be adjusted is 9.9 seconds, then the corresponding another time difference to be adjusted for the data request is 2.9 seconds, and the second time to be adjusted is 9.8 seconds, then the corresponding another time difference to be adjusted for the data request is 2.8 seconds.
Step 536, determining feedback rewarding results of the data request under the multiple time differences to be adjusted according to the multiple time differences to be adjusted, the running load, the preset real-time percentage and the preset resource percentage corresponding to the data request.
The communication conversion device also needs to obtain the operation load of the IEC61850 server in the communication conversion device in the first time period. Specifically, the formula (2):
S=W+L; (2)
wherein S is an operation load, W is a network bandwidth of the IEC61850 server in a first time period, and L is a server load of the IEC61850 server in the first time period.
Based on the feedback rewarding results, the communication conversion device specifically determines feedback rewarding results of the data request under a plurality of time differences to be adjusted according to the formula (3) and the formula (4).
The load is an operation load of the data request, V is a plurality of time differences to be adjusted corresponding to the data request, S is the operation load, rp is a preset instantaneity percentage, and lp is a preset resource percentage.
Wherein, reward is the feedback rewarding result of the data request under a time difference to be adjusted, load_A i load_A is the load of the data request i-1 For the running load of the last data request adjacent to the data request, A i A for the instant of the ith data request, a i-1 The time of issuance of the data request (i-1) is the time of issuance of the data request.
Specifically, the communication conversion device calculates a plurality of time differences to be adjusted corresponding to the data request through formulas (2) to (4), and can determine feedback rewarding results of the data request under one time difference to be adjusted, so that similar calculation of formulas (2) to (4) is performed on the data request, and feedback rewarding results of the data request under a plurality of time differences to be adjusted can be determined.
It should be understood that the sum of the preset real-time percentage and the preset resource percentage is equal to 1, and the larger the preset real-time percentage is, the more prone to optimization of the real-time of the system, the larger the preset resource percentage is, the more prone to optimization of the system load, so the setting of the preset real-time percentage and the preset resource percentage needs to be determined according to the actual requirements.
Step 546, determining an end time of the second time period from the plurality of time instants to be adjusted based on the feedback rewards results of the data request under the plurality of time differences to be adjusted.
The communication conversion device firstly needs to determine the condition that the data request is reacted to by the feedback rewarding results under a plurality of time differences to be adjusted. Specifically, when the feedback rewards result is larger than 0 at a certain time difference to be adjusted, the feedback rewards are positive feedback rewards, which indicates that the system performance is optimized when the time interval is adjusted to the time difference to be adjusted. And a feedback reward result less than 0 at a certain time difference to be adjusted represents positive feedback reward, which indicates that the system performance is reduced when the time interval is adjusted to the time difference to be adjusted.
Next, a target adjustment time difference having the largest value of the feedback bonus result is selected as the data request. For example, if the feedback reward result of the data request under the time difference to be adjusted (10.1 seconds) is 0.5 and the feedback reward result of the data request under the time difference to be adjusted (9.9 seconds) is 1.2, then it may be determined that the time difference to be adjusted (9.9 seconds) is the target adjustment time difference of the data request, thereby determining the time interval of 9.9 seconds as the end time of the second time period, that is, the second time period starts from the first time (10 seconds) and ends from 19.9 (10+9.9 seconds).
In the communication conversion method, the feedback rewarding result is determined specifically through the time difference to be adjusted, the operation load, the preset real-time percentage and the preset resource percentage, the operation load can accurately reflect the network condition and the operation condition in one time period, so that the accuracy and the real-time performance of the feedback rewarding result are ensured, the actual conditions of the preset real-time percentage and the preset resource percentage need to be flexibly changed, and the finally determined end time of the second time period is accurate and has the real-time performance.
A method of how the end time of the second time period is determined in the case where (N-1) is greater than 0 will be specifically described below. In one embodiment, as shown in FIG. 7, when (N-1) is greater than 0, then determining the end of the second time period from the first time and the (N-1) time intervals includes:
In step 518, when (N-1) is greater than 0, then an average of (N-1) time intervals is calculated.
Since (N-1) is greater than 0, that is, the communication conversion device receives at least 2 data requests in the first time period, the time interval between each adjacent time can be counted by the foregoing embodiment, such as c= [ a ] 2 -A 1 ,A 3 -A 2 ,…,A N -A N - 1 ]C is (N-1) time intervals. Based on this, the average of (N-1) time intervals is calculated specifically by equation (5):
wherein A is N -A N-1 For the time interval between adjacent moments, N is the number of received data requests.
For example, if the time stamp 1 carried by the data request 1 is used to stamp the 3 rd second, the time stamp 2 carried by the data request 2 is used to stamp the 6 th second, and the time stamp 3 carried by the data request 3 is used to stamp the 7 th second, the calculated time interval between the 3 rd second and the 6 th second is 3 seconds, and the time interval between the 6 th second and the 7 th second is 1 second, and the average value of 2 time intervals is 2 as shown by the formula (5).
In step 528, a plurality of time instances to be adjusted are determined by the average of the first time instance and the (N-1) time intervals.
Specifically, the communication conversion device determines a plurality of time points to be adjusted according to the average value of the first time point and the (N-1) time intervals through a formula (6):
Wherein T is the time to be adjusted, T 0 For the end time of the first time period, A N -A N-1 Is the adjacent timeAnd N is the number of received data requests.
Based on the above, the communication conversion device specifically calculates at least one time after adding the first time and the value calculated by at least one of the foregoing formulas, and calculates at least one time after subtracting the first time and the value calculated by at least one of the foregoing formulas, thereby obtaining a plurality of time to be adjusted. For example, taking the first time as 10 seconds and the average value as 2 seconds as an example, it is known from the formula (6) that 0.4 seconds are obtained after the average value calculation, so that 10 seconds are added to one 0.4 seconds to obtain 10.4 seconds, 10 seconds are added to two 0.4 seconds to obtain 10.8 seconds, and 10 seconds are subtracted from one 0.4 seconds to obtain 9.6 seconds, and 10 seconds are subtracted from two 0.4 seconds to obtain 9.2 seconds, so that the obtained plurality of time points to be adjusted are 10.4 seconds, 10.8 seconds, 9.6 seconds and 9.2 seconds.
Step 538, determining a plurality of time differences to be adjusted corresponding to each data request according to the plurality of time to be adjusted and the time sent by each data request.
Specifically, the communication conversion device subtracts the time to be adjusted from the time sent by each data request, and takes the subtracted absolute value as a plurality of time differences to be adjusted corresponding to each data request. Specifically, as shown in the foregoing formula (1), the time of each data request and the multiple time to be adjusted are calculated as shown in the formula (1), so that multiple time differences to be adjusted corresponding to each data request can be obtained.
In step 548, a feedback rewarding result of each data request under the multiple time differences to be adjusted is determined according to the multiple time differences to be adjusted, the running load, the preset real-time percentage and the preset resource percentage corresponding to each data request.
The communication conversion device also needs to obtain the operation load of the IEC61850 server in the communication conversion device in the first time period. Specifically, the formula (2) is as described above. And the communication conversion device determines feedback rewarding results of the data request under a plurality of time differences to be adjusted according to the formula (3) and the formula (4). The communication conversion device calculates a plurality of time differences to be adjusted corresponding to the data request through formulas (2) to (4), and can determine feedback rewarding results of the data request under one time difference to be adjusted, so that similar calculation of formulas (2) to (4) is performed on N data requests, and feedback rewarding results of the N data requests under the plurality of time differences to be adjusted can be determined.
In step 558, an end time of the second time period is determined from the plurality of time instants to be adjusted based on the feedback reward result for each data request at the plurality of time differences to be adjusted.
Similar to step 546, the communication conversion device first determines the situation in which each data request is reflected by the feedback reward results at a plurality of time differences to be adjusted. Specifically, when the feedback rewards result is larger than 0 at a certain time difference to be adjusted, the feedback rewards are positive feedback rewards, which indicates that the system performance is optimized when the time interval is adjusted to the time difference to be adjusted. And a feedback reward result less than 0 at a certain time difference to be adjusted represents positive feedback reward, which indicates that the system performance is reduced when the time interval is adjusted to the time difference to be adjusted.
Next, a target adjustment time difference, which is a second time period, is selected, wherein the value of the feedback rewards result of each data request under a plurality of time differences to be adjusted is the largest. For example, if the feedback reward result of data request 1 under the time difference to be adjusted (10.4 seconds) is 0.5, and the feedback reward result of data request 1 under the time difference to be adjusted (9.6 seconds) is-0.3, the feedback reward result of data request 2 under the time difference to be adjusted (10.4 seconds) is 0.2, and the feedback reward result of data request 2 under the time difference to be adjusted (9.6 seconds) is 0.1, then it may be determined that the time difference to be adjusted (10.4 seconds) is the target adjustment time difference of the second time period, that is, the second time period starts from the first time (10 seconds) and ends from 20.1 (10+10.4 seconds).
In the communication conversion method, the time difference to be adjusted is determined through the average value of the time intervals sent by each data request, and the accuracy of the time difference to be adjusted is guaranteed, so that the feedback rewarding result is determined through the time difference to be adjusted, the running load, the preset real-time percentage and the preset resource percentage, and the accuracy and the real-time of the determined end time of the second time period are further improved.
In one embodiment, as shown in fig. 8, the following steps are further included:
in step 802, a mapping relationship between the address field and the object reference is constructed for the start address of Modbus data.
Specifically, the communication conversion device constructs the starting address and the mapping relation between the address field and the object reference of the Modbus data so as to realize the communication conversion device and convert and communicate the Modbus data of at least one actual single battery. The object references include index relationships between logical devices, logical nodes, and IEC61850 data.
Step S406, determining a target start address and a target address field corresponding to the target object reference according to the target object reference, including:
in step 416, the target start address and the target address field mapped by the target object reference are determined according to the target object reference by the start address of the Modbus data and the mapping relationship between the address field and the object reference.
Specifically, the communication conversion device firstly obtains the target starting address of the target Modbus data and the mapping relation between the target address field and the target object reference based on the starting address of the Modbus data and the mapping relation between the address field and the object reference, so that the target starting address and the target address field mapped by the target object reference are determined according to the target object reference, specifically through the target starting address of the target Modbus data and the mapping relation between the target address field and the target object reference.
In this embodiment, the mapping relationship between the starting address and the address domain and the object reference can ensure that the starting address and the address domain are in one-to-one correspondence with the object reference, so as to ensure accuracy and realizability of the determined target starting address and the target address domain, and the mapping relationship can reduce the time for determining the target starting address and the target address domain by means of query and search, so as to improve the efficiency of determining the target starting place and the target address domain address.
Since it is necessary to construct the starting address of the Modbus data and the mapping relationship between the address field and the object reference in step 802, it is known from the foregoing embodiment that the address field of the Modbus data is used to characterize the cell from which the Modbus data originates, and the starting address of the Modbus data is constructed according to the fixed address of the read Modbus data, and how to obtain the object reference described in the foregoing embodiment will be described in detail below. In one embodiment, as shown in fig. 9, the method further comprises the steps of:
in step 902, a function set of the Modbus battery management unit is obtained.
Specifically, the communication conversion device obtains a function set of the Modbus battery management unit, the function set comprises a plurality of functions of the Modbus battery management unit, the functions comprise but are not limited to an operation function, a parameter configuration function and a read-write function, the operation function comprises but is not limited to forced closing, forced opening, single-box balance control and the like, the parameter configuration function comprises but is not limited to parameters such as a configuration temperature excessively low three-level alarm value and a single-voltage excessively high three-level alarm value, and the read-write function comprises but is not limited to readable parameters such as a read-write battery total voltage, a battery total current battery average temperature, a charge temperature excessively high number and a discharge temperature excessively high number.
And 904, dividing the function set to obtain an IEC61850 logic structure, wherein the IEC61850 logic structure comprises logic equipment, logic nodes and IEC61850 data.
The communication conversion device divides the function set into IEC61850 logic structures comprising an IEC61850 server, logic devices, logic nodes, IEC61850 data and data attributes of the IEC61850 data according to the IEC61850 standard.
Specifically, as shown in fig. 10, the battery management unit is modeled using an extensible markup language (Extensible Markup Language, XML) file format according to an SCL configuration language specified by IEC61850, a device network of an IED model is first constructed, an IEC61850 server is then constructed, at this time, specific services that can be provided by the IEC61850 server are determined, and the constructed IEC61850 server includes a logic device, a logic node, IEC61850 data, data attributes of each IEC61850 data, and in practical application, an IEC61850 data set, a report, and the like. The name of each logic node, the name of IEC61850 data and the like are defined in 7-2, 7-3 and 7-4 in the IEC61850 standard, and are flexibly determined based on actual conditions and requirements in the range which is not specified by the IEC61850 standard.
For easy understanding, taking IEC61850 data as the highest cell voltage number as an example, for the read-only parameter highest cell voltage number in the input register, the communication conversion device needs to determine that the communication conversion device belongs to the logic device a, belongs to the logic node class a, and has the name of MaxVolNum of IEC61850 data, and has the data type of a, so that the data attribute a in the data object is determined according to the common data class in the IEC61850 standard, and based on this, the data attribute a of the highest cell voltage number in the IEC61850 standard and the corresponding function constraint a are determined.
In step 908, an object reference is constructed based on the IEC61850 logical structure, the object reference including a plurality of logical devices, an index relationship of each logical device with a plurality of logical nodes, and an index relationship of each logical node with a plurality of IEC618590 data.
In particular, since the IEC61850 logical structure includes an IEC61850 server, a logical device, a logical node, IEC61850 data, and data attributes of the IEC61850 data, one logical device includes a plurality of logical nodes, and one logical node includes a plurality of IEC61850 data.
Based on this, when the communication conversion apparatus performs only communication connection and protocol conversion between one IEC618590 client and one battery management unit, the object reference includes one IEC618590 server in communication with the IEC618590 client, the IEC618590 server has an index relationship with a plurality of logical devices, each logical device has an index relationship with a plurality of logical nodes, each logical node has an index relationship with a plurality of IEC618590 data, and each IEC618590 data has a corresponding data attribute.
For ease of understanding, the IEC61850 data is taken as the highest cell voltage number again as an example, and since the highest cell voltage number belongs to the logic device a, belongs to the logic node class a, and the name of the IEC61850 data is MaxVolNum, the object of the highest cell voltage number refers to the index relationship between the logic device a and the logic node class a, and the index relationship between the logic node class a and MaxVolNum.
In practical application, if the communication conversion device can perform communication connection and protocol conversion between a plurality of IEC618590 clients and a plurality of battery management units, the object reference can include a plurality of IEC618590 servers in communication with the IEC618590 clients, each IEC618590 server has an index relationship with a plurality of logic devices, each logic device has an index relationship with a plurality of logic nodes, each logic node has an index relationship with a plurality of IEC618590 data, and each IEC618590 data has a corresponding data attribute. The specific examples are not limited herein.
Since the communication conversion means 104 is capable of further constructing a mapping relationship of the start address and each level index by the multi-level index relationship included in the object reference. Based on this, step 802, constructing the starting address of Modbus data and the mapping relationship between the address field and the object reference, includes:
812, a mapping relationship between the address field and the logical device, and a mapping relationship between the start address and the logical node and IEC618590 data are constructed.
Specifically, when the communication conversion device constructs the data mapping module, the Modbus TCP is used to map an address field included in the Modbus data to a logic device in the created information model, and map a start address included in the Modbus data to a logic node in an object reference of IEC61850 and IEC61850 data.
For example, address field a is mapped to logical device a, address field B is mapped to logical device B, and starting address 30001 is mapped to logical node a and IEC61850 data a, and starting address 30002 is mapped to logical node B and IEC61850 data B. It is to be understood that the foregoing examples are provided merely for the purpose of understanding the present application and are not to be construed as limiting the application.
Step 416, determining, according to the target object reference, the target start address and the target address field mapped by the target object reference according to the start address of the Modbus data and the mapping relationship between the address field and the object reference, including:
in step 426, the target starting address is determined according to the index relationship between the target logical node and the target IEC618590 data, and the mapping relationship between the starting address and the logical node and the IEC618590 data.
On the basis of the constructed mapping relationship between the starting address and the logical node and the IEC618590 data, the object reference comprises the index relationship between the logical device and the logical node and comprises the index relationship between the logical node and the IEC61850 data, so that the target object reference can comprise the index relationship between the target logical node and the target IEC618590 data. Secondly, the mapping relation between the initial address and the logical node and the IEC618590 data specifically comprises the mapping relation between the target initial address and the target logical node and the target IEC618590 data.
Based on the above, the communication conversion device determines the target logical node according to the index relation between the target logical node and the target IEC618590 data, so that the target starting address which can be mapped with the target logical node and the target IEC618590 data is determined through the mapping relation between the target starting address and the target logical node and the target IEC618590 data.
In step 436, the target address domain is determined according to the index relationship between the target logical device and the target logical node in the target object reference, and the mapping relationship between the address domain and the logical device.
After determining the target logical node in step 426, the communication conversion apparatus can further determine the target logical device according to the index relationship between the target logical device in the target object reference and the target logical node. Secondly, the mapping relation between the address field and the logic device specifically comprises the mapping relation between the target address field and the target logic device. Based on the above, the communication conversion apparatus determines, from the determined target logical device, a target address field that can be mapped with the target logical device by a mapping relationship between the target address field and the target logical device.
In this embodiment, by dividing the IEC61850 logic structure obtained according to the function of the Modbus battery management unit, the IEC61850 logic structure can be defined more accurately, and the obtained EC61850 logic structure can correspond to the function in the Modbus battery management unit, so as to ensure the accuracy and reliability of the IEC61850 logic structure. The object references constructed based on the IEC61850 logical structure comprise multi-level index relationships, and the data in each index are stored after being ordered according to the index key values, so that the reliability and the accuracy of each level of index relationship in the object references can be ensured. Secondly, determining the target start address and the target address field through the multi-level index relation can reduce the time for sequencing and grouping in retrieval, and secondly, the multi-level index relation and the multi-level mapping relation can further reduce the retrieval time, so that the efficiency of determining the target start address and the target address field is improved.
It should be understood that, in practical application, when the data mapping module is constructed, for the Modbus data of each function code, the IEC61850 server returns the requested data in a predefined buffer (buffer), then takes out the Modbus data in the buffer, determines the object reference of the IEC61850 information model corresponding to the Modbus data according to the data start address of the Modbus data and the address field of the Modbus data, and maps the specific function of the service model according to the function code of the Modbus data, that is, one function code corresponds to one service operation function. Based on this, constructing the data mapping module requires constructing different function call functions for different function codes, that is, constructing different parameter address fields for different function codes, server addresses, server listening ports, physical device network cards, connection timeout times, and maximum connection numbers, so as to perform unused function operations based on different function codes.
Based on this, in one embodiment, the communication conversion device, after determining the target Modbus data, obtains the stored target Modbus data from the local database, the target Modbus data including the function code. And then the communication conversion device calls a service operation function through the function code of the target Modbus data, specifically calls a corresponding parameter address field, a server address, a server monitoring port, a physical equipment network card, a connection timeout time and a maximum connection number through the function code of the target Modbus data, so that service operation is carried out on the target Modbus data through the service operation function. The specific service operation on the target Modbus data in this embodiment is to parse the target Modbus data, obtain the target data, and then obtain the target IEC618590 data by encapsulating the target data according to the format of IEC 618590.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a communication conversion device for realizing the above-mentioned communication conversion method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of one or more communication conversion devices provided below may refer to the limitation of the communication conversion method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 11, there is provided a communication conversion apparatus including: a communication module 1102 and a processing module 1104, wherein:
the communication module 1102 is configured to obtain, at a first time, a set of Modbus data in a first time period, where each Modbus data in the set of Modbus data includes a start address and an address field of the Modbus data, and an end time of the first time period is a first time; receiving a first data request in a second time period, wherein the first data request is used for requesting target IEC618590 data, the data request carries a target object reference for indexing the target IEC618590 data, and the starting time of the second time period is a first time;
a processing module 1104, configured to determine, according to the target object reference, a target start address and a target address field corresponding to the target object reference; determining target Modbus data from the Modbus data set according to the target starting address and the target address field;
The communication module 1102 is further configured to send target IEC618590 data obtained after the conversion of the target Modbus data to a client that sends the first data request.
In one embodiment, the processing module 1104 is further configured to count N data requests received in a first time period, where each data request carries a time identifier for sending out the data request, and the time identifier is used for uniquely identifying a time, and N is an integer greater than 0; calculating the time intervals among N time marks, and obtaining (N-1) time intervals; when (N-1) is 0, determining the end time of the second time period through the first time and the preset adjustment time; when (N-1) is greater than 0, then the end time of the second time period is determined by the first time and the (N-1) time intervals.
In one embodiment, the processing module 1104 is specifically configured to:
when (N-1) is 0, determining a plurality of moments to be adjusted through the first moment and the preset adjustment time;
determining a plurality of time differences to be adjusted corresponding to the data request according to the plurality of time to be adjusted and the time sent by the data request;
determining feedback rewarding results of the data request under the plurality of time differences to be adjusted according to the plurality of time differences to be adjusted, the operation load, the preset real-time percentage and the preset resource percentage corresponding to the data request;
And determining the ending time of the second time period from the plurality of time points to be adjusted based on the feedback rewarding results of the data request under the plurality of time differences to be adjusted.
In one embodiment, the processing module 1104 is specifically configured to:
the end time of the cycle comprises:
when (N-1) is greater than 0, then calculating an average of (N-1) time intervals;
determining a plurality of time points to be adjusted through the average value of the first time point and the (N-1) time intervals;
determining a plurality of time differences to be adjusted corresponding to each data request according to the plurality of time differences to be adjusted and the time sent by each data request;
determining a feedback rewarding result according to a plurality of time differences to be adjusted, an operation load, a preset real-time percentage and a preset resource percentage corresponding to each data request;
and determining the ending time of the second time period from the plurality of to-be-adjusted time points based on the feedback rewarding result.
In one embodiment, the processing module 1104 is further configured to construct a starting address of the Modbus data and a mapping relationship between an address field and an object reference; and determining a target starting address and a target address field mapped by the target object reference according to the target object reference through the starting address of Modbus data and the mapping relation between the address field and the object reference.
In one embodiment, the communication module 1102 is further configured to obtain a function set of the Modbus battery management unit;
the processing module 1104 is further configured to divide the function set to obtain an IEC61850 logic structure, where the IEC61850 logic structure includes a logic device, a logic node, and IEC61850 data; constructing an object reference based on an IEC61850 logic structure, wherein the object reference comprises a plurality of logic devices, an index relation between each logic device and a plurality of logic nodes, and an index relation between each logic node and a plurality of IEC618590 data; the mapping relation between the address field and the logic device and the mapping relation between the initial address and the logic node and IEC618590 data are constructed; determining a target initial address according to the index relation between the target logical node and target IEC618590 data in the target object reference and the mapping relation between the initial address and the logical node and IEC618590 data; and determining the target address domain according to the index relation between the target logic device and the target logic node in the target object reference and the mapping relation between the address domain and the logic device.
The modules in the communication conversion device may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or independent of a processor in the electronic device, or may be stored in software in a memory in the electronic device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, an electronic device is provided, which may be a server, and the internal structure thereof may be as shown in fig. 12. The electronic device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the electronic device is used for storing Modbus data. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a communication conversion method.
It will be appreciated by those skilled in the art that the structure shown in fig. 12 is merely a block diagram of a portion of the structure associated with the present inventive arrangements and is not limiting of the electronic device to which the present inventive arrangements are applied, and that a particular electronic device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, an electronic device is provided that includes a memory having a computer program stored therein and a processor that when executing the computer program performs the steps of the method embodiments described above.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.
Claims (8)
1. A method of communication conversion, the method comprising:
acquiring a Modbus data set in a first time period at a first time, wherein each Modbus data set comprises a starting address and an address field of the Modbus data, and the ending time of the first time period is the first time;
receiving a first data request in a second time period, wherein the first data request is used for requesting target IEC61850 data, the data request carries a target object reference for indexing the target IEC61850 data, and the starting time of the second time period is the first time;
Determining a target starting address and a target address field corresponding to the target object reference according to the target object reference;
determining target Modbus data from the Modbus data set according to the target starting address and the target address field;
the target IEC61850 data obtained after the target Modbus data are converted is sent to a client side sending the first data request;
counting N data requests received in the first time period, wherein each data request carries a time identifier for sending out the data request, the time identifier is used for uniquely identifying a moment, and N is an integer greater than 0;
calculating the time intervals among the N time marks, and obtaining (N-1) time intervals;
when the (N-1) is 0, determining a plurality of moments to be adjusted through the first moment and preset adjustment time; determining a plurality of time differences to be adjusted corresponding to the data request according to the plurality of time differences to be adjusted and the time sent by the data request; determining feedback rewarding results of the data request under a plurality of time differences to be adjusted according to the plurality of time differences to be adjusted, the operation load, the preset real-time percentage and the preset resource percentage corresponding to the data request; determining the ending time of the second time period from the plurality of time to be adjusted based on the feedback rewarding results of the data request under the plurality of time differences to be adjusted;
When the (N-1) is greater than 0, then calculating an average of the (N-1) time intervals; determining a plurality of moments to be adjusted by means of the average value of the first moment and the (N-1) time intervals; determining a plurality of time differences to be adjusted corresponding to each data request according to the plurality of time differences to be adjusted and the time sent by each data request; determining feedback rewarding results of each data request under a plurality of time differences to be adjusted according to the plurality of time differences to be adjusted, the running load, the preset real-time percentage and the preset resource percentage corresponding to each data request; and determining the ending time of the second time period from the plurality of time points to be adjusted based on feedback rewards results of each data request under a plurality of time differences to be adjusted.
2. The method according to claim 1, wherein the method further comprises:
constructing a mapping relation between an initial address and an address domain of the Modbus data and an object reference;
the determining, according to the target object reference, a target start address and a target address field corresponding to the target object reference includes:
and determining the target starting address and the target address field mapped by the target object reference according to the target object reference through the starting address of the Modbus data and the mapping relation between the address field and the object reference.
3. The method according to claim 1, wherein the method further comprises:
acquiring a function set of the Modbus battery management unit;
dividing the function set to obtain an IEC61850 logic structure, wherein the IEC61850 logic structure comprises logic equipment, logic nodes and IEC61850 data;
constructing the object reference based on the IEC61850 logic structure, wherein the object reference comprises a plurality of logic devices, an index relation between each logic device and a plurality of logic nodes, and an index relation between each logic node and a plurality of IEC61850 data;
the construction of the starting address of the Modbus data and the mapping relation between the address field and the object reference comprises the following steps:
constructing a mapping relation between the address field and the logic device and a mapping relation between the initial address and the logic node and the IEC61850 data;
the determining, according to the target object reference, the target start address and the target address field mapped by the target object reference according to the start address of the Modbus data and the mapping relationship between the address field and the object reference, includes:
determining the target initial address according to the index relation between the target logical node and the target IEC61850 data in the target object reference and the mapping relation between the initial address and the logical node and the IEC61850 data;
And determining the target address domain according to the index relation between the target logic device and the target logic node in the target object reference through the mapping relation between the address domain and the logic device.
4. A communication conversion device, characterized in that the communication conversion device comprises:
the communication module is used for acquiring a Modbus data set in a first time period at a first time, wherein each Modbus data in the Modbus data set comprises a starting address and an address field of the Modbus data, and the ending time of the first time period is the first time; receiving a first data request in a second time period, wherein the first data request is used for requesting target IEC61850 data, the data request carries a target object reference for indexing the target IEC61850 data, and the starting time of the second time period is the first time;
the processing module is used for determining a target starting address and a target address field corresponding to the target object reference according to the target object reference; determining target Modbus data from the Modbus data set according to the target starting address and the target address field;
The communication module is further used for transmitting the target IEC61850 data obtained after the target Modbus data are converted to a client side which sends the first data request;
the processing module is further configured to:
counting N data requests received in the first time period, wherein each data request carries a time identifier for sending out the data request, the time identifier is used for uniquely identifying a moment, and N is an integer greater than 0;
calculating the time intervals among the N time marks, and obtaining (N-1) time intervals;
when the (N-1) is 0, determining a plurality of moments to be adjusted through the first moment and preset adjustment time; determining a plurality of time differences to be adjusted corresponding to the data request according to the plurality of time differences to be adjusted and the time sent by the data request; determining feedback rewarding results of the data request under a plurality of time differences to be adjusted according to the plurality of time differences to be adjusted, the operation load, the preset real-time percentage and the preset resource percentage corresponding to the data request; determining the ending time of the second time period from the plurality of time to be adjusted based on the feedback rewarding results of the data request under the plurality of time differences to be adjusted;
When the (N-1) is greater than 0, then calculating an average of the (N-1) time intervals; determining a plurality of moments to be adjusted by means of the average value of the first moment and the (N-1) time intervals; determining a plurality of time differences to be adjusted corresponding to each data request according to the plurality of time differences to be adjusted and the time sent by each data request; determining feedback rewarding results of each data request under a plurality of time differences to be adjusted according to the plurality of time differences to be adjusted, the running load, the preset real-time percentage and the preset resource percentage corresponding to each data request; and determining the ending time of the second time period from the plurality of time points to be adjusted based on feedback rewards results of each data request under a plurality of time differences to be adjusted.
5. The apparatus of claim 4, wherein the processing module is further configured to construct a starting address of the Modbus data and a mapping relationship of an address field and an object reference; and determining the target starting address and the target address field mapped by the target object reference according to the target object reference through the starting address of the Modbus data and the mapping relation between the address field and the object reference.
6. The apparatus of claim 4, wherein the communication module is further configured to obtain a set of functions of the Modbus battery management unit;
the processing module is further used for dividing the function set to obtain an IEC61850 logic structure, and the IEC61850 logic structure comprises logic equipment, logic nodes and IEC61850 data; constructing the object reference based on the IEC61850 logic structure, wherein the object reference comprises a plurality of logic devices, an index relation between each logic device and a plurality of logic nodes, and an index relation between each logic node and a plurality of IEC61850 data; constructing a mapping relation between the address field and the logic device and a mapping relation between the initial address and the logic node and the IEC61850 data; determining the target initial address according to the index relation between the target logical node and the target IEC61850 data in the target object reference and the mapping relation between the initial address and the logical node and the IEC61850 data; and determining the target address domain according to the index relation between the target logic device and the target logic node in the target object reference through the mapping relation between the address domain and the logic device.
7. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 3 when the computer program is executed.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210240002.2A CN114629967B (en) | 2022-03-10 | 2022-03-10 | Communication conversion method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210240002.2A CN114629967B (en) | 2022-03-10 | 2022-03-10 | Communication conversion method, device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114629967A CN114629967A (en) | 2022-06-14 |
CN114629967B true CN114629967B (en) | 2023-09-26 |
Family
ID=81902525
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210240002.2A Active CN114629967B (en) | 2022-03-10 | 2022-03-10 | Communication conversion method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114629967B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104363214A (en) * | 2014-11-03 | 2015-02-18 | 许继电气股份有限公司 | Configurable conversion method for IEC61850 protocol and TCPModbus protocol |
CN204291043U (en) * | 2014-12-30 | 2015-04-22 | 深圳市行健自动化股份有限公司 | Multi-functional protocol conversion device |
KR101579928B1 (en) * | 2014-07-31 | 2015-12-23 | 서경대학교 산학협력단 | METHOD AND RECORDING MEDIUM FOR COMPATIBILITY BETWEEN IEC61850 AND CoAP |
CN106453071A (en) * | 2016-12-22 | 2017-02-22 | 南京因泰莱电器股份有限公司 | Intelligent power gateway meeting IEC61850 standard |
CN212183548U (en) * | 2020-05-29 | 2020-12-18 | 西安和其光电科技股份有限公司 | IEC61850 protocol and Modbus protocol keysets |
CN112866207A (en) * | 2020-12-31 | 2021-05-28 | 西安交通大学 | Protocol conversion method for substation automation |
CN113259425A (en) * | 2021-04-30 | 2021-08-13 | 广东顺畅科技有限公司 | 61850 standard-based data conversion method, transformer substation gateway and storage medium |
CN113810492A (en) * | 2021-09-16 | 2021-12-17 | 南方电网数字电网研究院有限公司 | Data point table generation method and device based on intelligent gateway and computer equipment |
KR102345082B1 (en) * | 2020-07-31 | 2021-12-31 | 서경대학교 산학협력단 | Cloud based iec61850 information processing method |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7051143B2 (en) * | 2001-06-25 | 2006-05-23 | Schneider Automation Inc. | Method, system and program for the transmission of modbus messages between networks |
CN111949605B (en) * | 2019-05-15 | 2024-07-19 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer program product for implementing a file system |
-
2022
- 2022-03-10 CN CN202210240002.2A patent/CN114629967B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101579928B1 (en) * | 2014-07-31 | 2015-12-23 | 서경대학교 산학협력단 | METHOD AND RECORDING MEDIUM FOR COMPATIBILITY BETWEEN IEC61850 AND CoAP |
CN104363214A (en) * | 2014-11-03 | 2015-02-18 | 许继电气股份有限公司 | Configurable conversion method for IEC61850 protocol and TCPModbus protocol |
CN204291043U (en) * | 2014-12-30 | 2015-04-22 | 深圳市行健自动化股份有限公司 | Multi-functional protocol conversion device |
CN106453071A (en) * | 2016-12-22 | 2017-02-22 | 南京因泰莱电器股份有限公司 | Intelligent power gateway meeting IEC61850 standard |
CN212183548U (en) * | 2020-05-29 | 2020-12-18 | 西安和其光电科技股份有限公司 | IEC61850 protocol and Modbus protocol keysets |
KR102345082B1 (en) * | 2020-07-31 | 2021-12-31 | 서경대학교 산학협력단 | Cloud based iec61850 information processing method |
CN112866207A (en) * | 2020-12-31 | 2021-05-28 | 西安交通大学 | Protocol conversion method for substation automation |
CN113259425A (en) * | 2021-04-30 | 2021-08-13 | 广东顺畅科技有限公司 | 61850 standard-based data conversion method, transformer substation gateway and storage medium |
CN113810492A (en) * | 2021-09-16 | 2021-12-17 | 南方电网数字电网研究院有限公司 | Data point table generation method and device based on intelligent gateway and computer equipment |
Non-Patent Citations (2)
Title |
---|
基于IEC61850 规约转换的研究与实现;郭振宇等;《电子质量》;全文 * |
蓄电池管理系统接入边缘物联代理 Modbus-tcp 协议设计与实现;李井泉等;《信息通信》(第9期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114629967A (en) | 2022-06-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111835842B (en) | Gateway resource updating method and device and Internet of things control platform | |
CN107016056B (en) | Distributed storage system and method for large-volume heterogeneous sensing data in Internet of things | |
CN109800270B (en) | Data storage and query method and Internet of things system | |
CN106909641B (en) | Real-time data memory | |
EA019680B1 (en) | Service access method and system | |
CN111260505B (en) | Big data analysis method and device based on power Internet of things and computer equipment | |
CN109672668B (en) | Mapping method of GDA interface and OPC UA service | |
CN112235389A (en) | Intelligent terminal data processing method and device based on Internet of things | |
WO2024198889A1 (en) | Data processing method and apparatus based on thing specification language model and electronic device | |
CN114422873B (en) | Method, device and equipment for dynamically accessing industrial Internet identification analysis platform | |
CN114629967B (en) | Communication conversion method, device, electronic equipment and storage medium | |
WO2021147319A1 (en) | Data processing method, apparatus, device, and medium | |
US11310353B2 (en) | Data transmission method for creating data structure facilitating data transmission and reception | |
CN116743790B (en) | Device data acquisition, device data analysis method and device and computer device | |
CN109194519B (en) | Configuration method and device of network equipment, controller and computer storage medium | |
CN111708521A (en) | Software construction method and software construction device for intelligent terminal of power system distribution room | |
CN112230929A (en) | Data analysis method and device of CIM (common information model) and storage medium | |
CN117271480B (en) | Data processing method, device, electronic equipment and medium | |
CN117978893B (en) | Method, device and equipment for analyzing universal Modbus protocol | |
CN117439853B (en) | Cloud edge end-based data operation and maintenance management system | |
CN111177977B (en) | Data model construction method and device of energy system | |
CN109783247B (en) | Bus control system based on COV data processing | |
TW202207673A (en) | Gateway capable of converting IEC 61850 and DNP3, conversion method, computer program product and computer-readable recording medium performing a conversion method including a screening step and a mapping step | |
CN115473343A (en) | Intelligent gateway multi-master-station parallel access test method | |
CN118520641A (en) | Power grid data model optimization method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |