CN101902457B - System for configuring external communication protocol and method thereof - Google Patents
System for configuring external communication protocol and method thereof Download PDFInfo
- Publication number
- CN101902457B CN101902457B CN201010112353.2A CN201010112353A CN101902457B CN 101902457 B CN101902457 B CN 101902457B CN 201010112353 A CN201010112353 A CN 201010112353A CN 101902457 B CN101902457 B CN 101902457B
- Authority
- CN
- China
- Prior art keywords
- module
- communication protocol
- text
- communication
- plug
- 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
Landscapes
- Computer And Data Communications (AREA)
Abstract
The invention discloses a system for configuring an external communication protocol and a method thereof. The system comprises a platform core module and at least one plug-in module for configuring a communication protocol, wherein the platform core module comprises a core communication module, a database interactive module and a communication management module; and the core communication module is respectively connected with the plug-in module and the communication management module, transmits a user request to the communication management module and receives a respond request sent by the communication management module. The method for configuring the external communication protocol comprises an operation method for configuring a communication protocol plug-in server terminal and the operation method for configuring a communication protocol plug-in client terminal. The invention can well achieve division development of software modules and can multiplex codes; the use of a plug-in technology leads the expansion and upgrading of functions of communication platform core software to be convenient and simple; and the invention reduces the trouble and time of rewrite, compilation and issue of communication protocol software and provides a simple, rapid and uniform method and an interface for webpage configuration.
Description
Technical field
The present invention relates to communications protocol field, especially a kind of system of configuring external communication protocol and method thereof.
Background technology
In many large enterprises, there are some to be distributed in various levels of management and to control computer.Between them, need to communicate by transfer of data.Because the variation of equipment kind, the difference of manufacturing the age and each supplier are in the difference realizing on interconnection mode, cause the interior each compunication platform of original system and the SOCKET communication interface stipulations of periphery based on TCP/IP various.
In addition, original most communication middleware software systems need to realize program for the flow process of a set of agreement of use customized development of every kind of communication protocol.Because different user desired data content, data format and the quality of data vary, make programming personnel in the time developing relevant communication protocol program, spend plenty of time and energy, bring much inconvenience also to software maintenance personnel in the future.
This programme has been realized the various communication data transfer management agreements based on TCP/IP SOCKET technology by communication middleware software systems by plug-in type software module, and by providing unified collocation method and interface to realize the configuration to various communication protocols.
Concerning user, even if do not possess the professional knowledge of network and tcp/ip communication stipulations, the simple protocol mechanism of a GPRS and collocation method, just can realize corresponding communication protocol, for providing data communication between different computers.
In view of this, this area inventor, for the problems referred to above, provides a kind of system and method thereof being applied to based on TCP/IP SOCKET technology, point-to-point distributed frame configuring external communication protocol.
Summary of the invention
The object of the invention is to, a kind of system and method thereof of configuring external communication protocol are provided, be applied to based on TCP/IP SOCKET technology, point-to-point distributed frame, to reach by providing unified collocation method and interface to realize the object of the configuration to various communication protocols.
The present invention adopts following technical scheme:
The system of a kind of configuring external communication protocol of the present invention, distinguishes connection data storehouse and outer computer, comprises the plug-in type module of platform nucleus module and at least one configuration protocol;
Described platform nucleus module comprises core communication module, database interactive module and communication management module;
Described core communication module connects respectively described plug-in type module and described communication management module, sends user and asks described communication management module, and receive the response request that described communication management module is sent;
Described database interactive module connects respectively described core communication module, plug-in type module and database, two-way interactive data, and described core communication module is processed the task with database intercorrelation;
Described plug-in type module connects described outer computer, resolves communication protocol and also transmits data, and described plug-in type module comprises that the plug-in unit of communication protocol configuration module, configuration communication stipulations realizes module, web interface Configuration Manager;
Described communication protocol configuration module has been described realizing details and realizing the configuration of communication service flow process of every kind of communication protocol by multinomial protocol parameter;
It is that the peer node successfully connecting generates an object that described plug-in unit is realized module, in the time of object activation, described plug-in unit is realized module and is accepted and process all data transmit-receive processing in this communication connection and from communication protocol configuration module, read all messaging parameters of corresponding stipulations and realize the Data Analysis, final decision of this kind of communication protocol whether communication close connects;
Described web interface Configuration Manager provide web interface to communication protocol configuration module carry out stipulations parameter, communication service flow process is configured and preserves, and the initial conditions of every contents value is limited.
Preferably, described platform nucleus module also comprises log management module, and described log management module connects described core communication module, sends log management information to described core communication module.
Preferably, in described communication protocol configuration module, every text forms by text head, telegraph text data, end mark.
Preferably, in described communication protocol configuration module, the head of text is all to be formed by following field combination: text length, electric code, time, transmitting terminal main frame code name, receiving terminal main frame code name, sequence number, function code, reserved field.
Preferably, described field is ASCII coding or binary coding mode.
Preferably, in described communication protocol configuration module, at least comprise electronic message, also comprise that heartbeat text replys text with communicating by letter.
Preferably, in described communication protocol configuration module, the interception way of text is to be intercepted or intercepted by appointment end mark by text length.
Preferably, the one in communication protocol, static stipulations or dynamic stipulations in described communication protocol configuration module.
Preferably, in described communication protocol configuration module, communication connection is the one in client mode, server mode or customer end/server mode.
Preferably, described plug-in unit is realized module and is comprised client and server end module;
Described client modules connects the server end of described outer computer, and data are encapsulated to head and the end mark of text by communication protocol requirement, then sends electronic message;
Described server end module connects the client of described outer computer, and by the initial data receiving by communication protocol requirement, send corresponding confirm text, the head of removing again electronic message and end mark, finally by data data inserting storehouse.
A kind of method of configuring external communication protocol is also provided, comprises configuration communication protocol plug-in server end operation method and configuration communication protocol plug-in client operation method;
Described configuration communication protocol plug-in server end operation method comprises the following steps:
Step 1A) startup configuration communication protocol plug-in server end;
Step 1B) Conn_Status=connect is set;
Step 1C) letter of transfer counts get_protocolconfig, obtains all configuration parameters corresponding to stipulations;
Step 1D) letter of transfer counts init_%s (header fields title) function, to the each field kind of stipulations head, generates corresponding format identifier;
Step 1E) when the fd of this communication connection handle arranges heartbeat timeout, AliveTimeOut () is set, execution step 1G), finish;
Be overtime when the fd of this communication connection handle arranges heartbeat, execution step 1F);
Step 1F) read signal event is set for the fd handle of this communication connection;
Step 1G) finish;
Described configuration communication protocol plug-in client operation method comprises the following steps:
Step 2A) startup configuration communication protocol plug-in client;
Step 2B) Conn_Status=connect is set;
Step 2C) client timing connection event is set for the fd handle of this communication connection;
Step 2D) judge that whether connection is successful, if so, performs step 2E);
Step 2E) Conn_Status=connect is set;
Step 2F) letter of transfer counts get_protocolconfig, obtains all configuration parameters corresponding to stipulations;
Step 2G) letter of transfer counts init_%s (header fields title) function, to the each field kind of stipulations head, generates corresponding format identifier;
Step 2H) timed sending heartbeat text event is set for the fd handle of this communication connection, sendAlive () is set, organize heartbeat text, the different field kind of corresponding text head, call corresponding pack_%s (field name) function, generate corresponding data by different coding mode, send heartbeat text, execution step step 2K);
Step 2I) for the successful fd handle of this communication connection, read signal event is set, Raw_dataCallback () is set;
Step 2J) judge whether this loop line has outgoing data, as nothing, execution step 2K), if any, sendDataMessage () is set, organising data text, the different field kind of corresponding text head, calls corresponding pack_%s (field name) function, generates corresponding data by different coding mode, send electronic message, execution step 2K);
Step 2K) finish.
Preferably, the described step 1F in described configuration communication protocol plug-in server end operation method) comprise the following steps:
Step 1F1) Raw_dataCallback () is set;
Step 1F2) judge that whether data arrive, and if so, perform step 1F3), if not, execution step 1F10);
Step 1F3) receive data;
Step 1F4) the field kind different to text, call corresponding unpack_%s (field name) function, resolve corresponding field by different coding mode;
Step 1F5) judge whether it is electronic message, if so, perform step 1F6), if not, execution step 1F11);
Step 1F6) write into Databasce;
Step 1F7) judgement writes whether success, if so, performs step 1F8), if not, execution step 1F14);
Step 1F8) judge whether agreement has acknowledgement mechanism, if there is execution step 1F9), if not, execution step 1G);
Step 1F9) reply when overtime execution step 1F15 when data loading), otherwise, execution step 1G);
Step 1F10) close this connection, perform step 1G);
Step 1F11) judge whether it is heartbeat text, if so, perform step 1F12), if not, execution step 1F13);
Step 1F12) cancel the heartbeat event last time arranging, next heartbeat timeout event is set, execution step 1G);
Step 1F13) abandon text;
Step 1F14) judge whether agreement replys, if having, execution step 1F17), if nothing, execution step 1G);
Step 1F15) DBAckTimeOut () is set;
Step 1F16) the different field kind of corresponding text head, call corresponding pack_%s (field name) function, generate corresponding data by different coding mode, organize negative acknowledge text;
Step 1F17) send negative acknowledge text, perform step 1G).
Preferably, the described step 2I in described configuration communication protocol plug-in client operation method) comprise the following steps:
Step 2I1) judge whether that data arrive, if nothing is closed connection, if having, execution step 2I2);
Step 2I2) judge whether agreement replys, if nothing is closed connection, if having, execution step 2I3);
Step 2I3) the field kind different to text, call corresponding unpack_%s (field name) function, resolve corresponding data by different coding mode;
Step 2I4) judge whether to reply text, if nothing, close connection, if having, cancel the overtime event of replying, Status=received_ack is set, send and upgrade text request, receive and upgrade the complete notice of text, send request lower the literary composition notice of waiting to generate electricity, Status=gettingmsg is set, execution step 2K).
Owing to having adopted above-mentioned technology, the present invention can finely realize the division of labor exploitation of software module, can a large amount of multiplexing codes; The use of plug-in part technology makes the Function Extension of communications platform kernel software and upgrading all become convenient and simple; Reduce a large amount of communication protocol software and again write, compile and issue trouble and time; Simple, fast, uniform webpage collocation method and interface is provided.
Further illustrate the present invention below in conjunction with drawings and Examples.
Brief description of the drawings
Fig. 1 is the module connection diagram of the system of configuring external communication protocol of the present invention;
Fig. 2 is the module connection diagram that in the present invention, plug-in unit is realized module;
Fig. 3 is configuration communication protocol plug-in server end operational flow diagram in embodiment;
Fig. 4 joins configuration communication protocol plug-in client operational flow diagram in embodiment.
Embodiment
Introduce a kind of specific embodiment of the present invention below by Fig. 1 to 4.
As shown in Figure 1, the system of configuring external communication protocol of the present invention, distinguishes connection data storehouse and outer computer, comprises the plug-in type module of platform nucleus module and at least one configuration protocol;
Described platform nucleus module comprises core communication module, database interactive module and communication management module;
Described core communication module connects respectively described plug-in type module and described communication management module, sends user and asks described communication management module, and receive the response request that described communication management module is sent;
Described database interactive module connects respectively described core communication module, plug-in type module and database, two-way interactive data, and described core communication module is processed the task with database intercorrelation;
Described plug-in type module connects described outer computer, resolves communication protocol and also transmits data, and described plug-in type module comprises that the plug-in unit of communication protocol configuration module, configuration communication stipulations realizes module, web interface Configuration Manager;
Described communication protocol configuration module has been described realizing details and realizing the configuration of communication service flow process of every kind of communication protocol by multinomial protocol parameter;
It is that the peer node successfully connecting generates an object that described plug-in unit is realized module, in the time of object activation, described plug-in unit is realized module and is accepted and process all data transmit-receive processing in this communication connection and from communication protocol configuration module, read all messaging parameters of corresponding stipulations and realize the Data Analysis, final decision of this kind of communication protocol whether communication close connects;
Described web interface Configuration Manager provide web interface to communication protocol configuration module carry out stipulations parameter, communication service flow process is configured and preserves, and the initial conditions of every contents value is limited.
Described platform nucleus module also comprises log management module, and described log management module connects described core communication module, sends log management information to described core communication module.
As shown in Figure 2, described plug-in unit is realized module and is comprised client and server end module; Described client modules connects the server end of described outer computer, and data are encapsulated to head and the end mark of text by communication protocol requirement, then sends electronic message; Described server end module connects the client of described outer computer, and by the initial data receiving by communication protocol requirement, send corresponding confirm text, the head of removing again electronic message and end mark, finally by data data inserting storehouse.
By to various analysis and the summaries based on TCP/IP SOCKET communication protocol that use in bulk information System Integration Engineering project, in described communication protocol configuration module, the stipulations feature of most communication protocols is summed up to rule as follows:
Every text forms by text head, telegraph text data, end mark.
The head of text is all to be formed by following field combination: text length, electric code, time, transmitting terminal main frame code name, receiving terminal main frame code name, sequence number, function code, reserved field.
These fields may be ASCII codings, may be also binary coding modes.
Except electronic message, there is heartbeat text to reply text with communicating by letter.
The interception way of text or intercept by text length, or by specifying end mark to intercept.
Communication protocol or static stipulations or dynamically stipulations.
One in communication connection or client mode, server mode or customer end/server mode.
Abstract based on above stipulations characteristic, this functional module adopts the details that realizes of every kind of communication protocol of description that following multinomial protocol parameter is complete.
Isbyheadlength:1 represents to intercept text by head length, and 0 represents to intercept text with end mark;
Byetx: the character of using when expression intercepts text by end mark;
Headsectionsum: represent that text head is made up of several fields;
Headsize: represent that text head has several bytes;
Head_section: represent the constitution content of text head, comprise coded system and the length of each field;
Connectiontype: the connection type that represents stipulations is C/S/CS structure;
Hasalive: represent that stipulations have Lungs from Non-Heart-Beating;
Alivemessage: the form that represents heartbeat text;
Alive_body: the content that represents heartbeat text;
Etx: the end mark that represents text;
Hasack: represent that stipulations have or not acknowledgement mechanism;
Ack_messageid: the electric code that represents to reply text;
Ack_body: the content of just replying text;
Nack_body: the content of negative acknowledge text;
Isdynamic: it is dynamic or static representing to connect.
As shown in Figures 3 and 4, the method for configuring external communication protocol of the present invention comprises configuration communication protocol plug-in server end operation method and configuration communication protocol plug-in client operation method;
As shown in Figure 3, configuration communication protocol plug-in server end operation main flow:
Step 1A) startup configuration communication protocol plug-in server end;
Step 1B) Conn_Status=connect is set;
Step 1C) letter of transfer counts get_protocolconfig, obtains all configuration parameters corresponding to stipulations;
Step 1D) letter of transfer counts init_%s (header fields title) function, to the each field kind of stipulations head, generates corresponding format identifier;
Step 1E) when the fd of this communication connection handle arranges heartbeat timeout, AliveTimeOut () is set, execution step 1G), finish; Be overtime when the fd of this communication connection handle arranges heartbeat, execution step 1F);
Step 1F) read signal event is set for the fd handle of this communication connection;
Step 1F1) Raw_dataCallback () is set;
Step 1F2) judge that whether data arrive, and if so, perform step 1F3), if not, execution step 1F10);
Step 1F3) receive data;
Step 1F4) the field kind different to text, call corresponding unpack_%s (field name) function, resolve corresponding field by different coding mode;
Step 1F5) judge whether it is electronic message, if so, perform step 1F6), if not, execution step 1F11);
Step 1F6) write into Databasce;
Step 1F7) judgement writes whether success, if so, performs step 1F8), if not, execution step 1F14);
Step 1F8) judge whether agreement has acknowledgement mechanism, if there is execution step 1F9), if not, execution step 1G);
Step 1F9) reply when overtime execution step 1F15 when data loading), otherwise, execution step 1G);
Step 1F10) close this connection, perform step 1G);
Step 1F11) judge whether it is heartbeat text, if so, perform step 1F12), if not, execution step 1F13);
Step 1F12) cancel the heartbeat event last time arranging, next heartbeat timeout event is set, execution step 1G);
Step 1F13) abandon text;
Step 1F14) judge whether agreement replys, if having, execution step 1F17), if nothing, execution step 1G);
Step 1F15) DBAckTimeOut () is set;
Step 1F16) the different field kind of corresponding text head, call corresponding pack_%s (field name) function, generate corresponding data by different coding mode, organize negative acknowledge text;
Step 1F17) send negative acknowledge text, perform step 1G);
Step 1G) finish.
As shown in Figure 4, the flow process of configuration communication protocol plug-in client operation method is as follows:
Step 2A) startup configuration communication protocol plug-in client;
Step 2B) Conn_Status=connect is set;
Step 2C) client timing connection event is set for the fd handle of this communication connection;
Step 2D) judge that whether connection is successful, if so, performs step 2E);
Step 2E) Conn_Status=connect is set;
Step 2F) letter of transfer counts get_protocolconfig, obtains all configuration parameters corresponding to stipulations;
Step 2G) letter of transfer counts init_%s (header fields title) function, to the each field kind of stipulations head, generates corresponding format identifier;
Step 2H) timed sending heartbeat text event is set for the fd handle of this communication connection, sendAlive () is set, organize heartbeat text, the different field kind of corresponding text head, call corresponding pack_%s (field name) function, generate corresponding data by different coding mode, send heartbeat text, execution step 2K);
Step 2I) for the successful fd handle of this communication connection, read signal event is set, Raw_dataCallback () is set, execution step 2I1);
Step 2I1) judge whether that data arrive, if nothing is closed connection, if having, execution step 2I2);
Step 2I2) judge whether agreement replys, if nothing is closed connection, if having, execution step 2I3);
Step 2I3) the field kind different to text, call corresponding unpack_%s (field name) function, resolve corresponding data by different coding mode;
Step 2I4) judge whether to reply text, if nothing, close connection, if having, cancel the overtime event of replying, Status=received_ack is set, send and upgrade text request, receive and upgrade the complete notice of text, send request lower the literary composition notice of waiting to generate electricity, Status=gettingmsg is set, execution step 2K);
Step 2J) judge whether this loop line has outgoing data, as nothing, execution step 2K), if any, sendDataMessage () is set, organising data text, the different field kind of corresponding text head, calls corresponding pack_%s (field name) function, generates corresponding data by different coding mode, send electronic message, execution step 2K);
Step 2K) finish.
Web interface Configuration Manager in the present invention be responsible for hommization, change mode alternately provide web interface to communication protocol configuration module carry out stipulations parameter, communication service flow process is configured and preserves, the initial conditions of every contents value is limited simultaneously.
This configurationization external communication protocol card module is in use to stipulations configuration simple and flexible.
Following profile instance is the test data of the configuration to the common plc communication stipulations of secondary machine:
[plc]
[connection]
connectiontype=c
isdynamic=0
isbyheadlength=1
byetx=[]
[head_format]
head_size=4
head_section_number=2
head_section_1=length
head_section_2=messageid
head_section_3=[]
head_section_4=[]
head_section_5=[]
head_section_6=[]
head_section_7=[]
Length=BIN1-2/*BIN represents binary coding, ASC represent ascii coding */
messageid=BIN3-4
time=[]
localdc=[]
remotedc=[]
func=[]
reserved=[]
[alive]
hasalive=0
Alive_messageid=[] #[] the electric code of expression application
alive_body=[]
alive_func=[]
[ack]
hasack=0
ack_messageid=[]
ack_body=[]
Nack_body=[]
ack_func=[]
nack_func=[]
[etx_format]
etx_length=[]
etx_format=[]
etx=[]
Following profile instance is the configuration to three grades of machine standard traffic stipulations:
By sufficient test, the system of this configuring external communication protocol all reaches performance requirement at indices such as the reliabilities of the flexibility of stipulations configurations, diversity, transfer of data, has realized design object completely, and scheme has obtained success.
In summary, owing to having adopted above-mentioned technology, the present invention can finely realize the division of labor exploitation of software module, can a large amount of multiplexing codes; The use of plug-in part technology makes the Function Extension of communications platform kernel software and upgrading all become convenient and simple; Reduce a large amount of communication protocol software and again write, compile and issue trouble and time; Simple, fast, uniform webpage collocation method and interface is provided.
Above-described embodiment is only for illustrating technological thought of the present invention and feature, its object is to make those skilled in the art can understand content of the present invention and implement according to this, can not only limit the scope of the claims of the present invention with the present embodiment, be all equal variation or modifications of doing according to disclosed spirit, still drop in the scope of the claims of the present invention.
Claims (13)
1. a system for configuring external communication protocol, connection data storehouse and outer computer, is characterized in that: the plug-in type module that comprises platform nucleus module and at least one configuration protocol respectively;
Described platform nucleus module comprises core communication module, database interactive module and communication management module;
Described core communication module connects respectively described plug-in type module and described communication management module, sends user and asks described communication management module, and receive the response request that described communication management module is sent;
Described database interactive module connects respectively described core communication module, plug-in type module and database, two-way interactive data, and described core communication module is processed the task with database intercorrelation;
Described plug-in type module connects described outer computer, resolves communication protocol and also transmits data, and described plug-in type module comprises that the plug-in unit of communication protocol configuration module, configuration communication stipulations realizes module, web interface Configuration Manager;
Described communication protocol configuration module has been described realizing details and realizing the configuration of communication service flow process of every kind of communication protocol by multinomial protocol parameter;
It is that the peer node successfully connecting generates an object that described plug-in unit is realized module, in the time of object activation, described plug-in unit is realized module and is accepted and process all data transmit-receive processing in this communication connection and from communication protocol configuration module, read all messaging parameters of corresponding stipulations and realize the Data Analysis, final decision of this kind of communication protocol whether communication close connects;
Described web interface Configuration Manager provide web interface to communication protocol configuration module carry out stipulations parameter, communication service flow process is configured and preserves, and the initial conditions of every contents value is limited.
2. the system of configuring external communication protocol as claimed in claim 1, it is characterized in that: described platform nucleus module also comprises log management module, described log management module connects described core communication module, sends log management information to described core communication module.
3. the system of configuring external communication protocol as claimed in claim 1, is characterized in that: in described communication protocol configuration module, every text is by text head, telegraph text data, end mark composition.
4. the system of configuring external communication protocol as claimed in claim 3, is characterized in that: in described communication protocol configuration module, the head of text is all to be formed by following field combination: text length, electric code, time, transmitting terminal main frame code name, receiving terminal main frame code name, sequence number, function code, reserved field.
5. the system of configuring external communication protocol as claimed in claim 4, is characterized in that: described text length, electric code, time, transmitting terminal main frame code name, receiving terminal main frame code name, sequence number, function code, reserved field are all ASCII coding or binary coding mode.
6. the system of configuring external communication protocol as claimed in claim 1, is characterized in that: in described communication protocol configuration module, at least comprise electronic message, also comprise that heartbeat text replys text with communicating by letter.
7. the system of configuring external communication protocol as claimed in claim 1, is characterized in that: in described communication protocol configuration module, the interception way of text is to be intercepted or intercepted by appointment end mark by text length.
8. the system of configuring external communication protocol as claimed in claim 1, is characterized in that: the communication protocol in described communication protocol configuration module is the one in static stipulations or dynamic stipulations ".
9. the system of configuring external communication protocol as claimed in claim 1, is characterized in that: in described communication protocol configuration module, communication connection is the one in client mode, server mode or customer end/server mode.
10. the system of configuring external communication protocol as claimed in claim 1, is characterized in that: described plug-in unit is realized module and comprised client and server end module;
Described client modules connects the server end of described outer computer, and data are encapsulated to head and the end mark of text by communication protocol requirement, then sends electronic message;
Described server end module connects the client of described outer computer, and by the initial data receiving by communication protocol requirement, send corresponding confirm text, the head of removing again electronic message and end mark, finally by data data inserting storehouse.
The method of 11. 1 kinds of configuring external communication protocols, is characterized in that: comprise configuration communication protocol plug-in server end operation method and configuration communication protocol plug-in client operation method;
Described configuration communication protocol plug-in server end operation method comprises the following steps:
Step 1A) startup configuration communication protocol plug-in server end;
Step 1B) Conn_Status=connect is set;
Step 1C) letter of transfer counts get_protocolconfig, obtains all configuration parameters corresponding to stipulations;
Step 1D) letter of transfer counts init_%s (header fields title) function, to the each field kind of stipulations head, generates corresponding format identifier;
Step 1E) when the fd handle of communication connection arranges heartbeat timeout, Alive TimeOut () is set, execution step 1G), finish;
Be overtime when the fd handle of communication connection arranges heartbeat, execution step 1F);
Step 1F) be that the fd handle communicating to connect arranges read signal event;
Step 1G) finish;
Described configuration communication protocol plug-in client operation method comprises the following steps:
Step 2A) startup configuration communication protocol plug-in client;
Step 2B) Conn_Status=connect is set;
Step 2C) be that the fd handle communicating to connect arranges client timing connection event;
Step 2D) judge that whether connection is successful, if so, performs step 2E);
Step 2E) Conn_Status=connect is set;
Step 2F) letter of transfer counts get_protocolconfig, obtains all configuration parameters corresponding to stipulations;
Step 2G) letter of transfer counts init_%s (header fields title) function, to the each field kind of stipulations head, generates corresponding format identifier;
Step 2H) be that the fd handle communicating to connect arranges timed sending heartbeat text event, sendAlive () is set, organize heartbeat text, the different field kind of corresponding text head, call corresponding pack_%s (field name) function, generate corresponding data by different coding mode, send heartbeat text, execution step 2K);
Step 2I) for the successful fd handle of communication connection arranges read signal event, Raw_dataCallback () is set;
Step 2J) judge whether this communication protocol plug-ins client has outgoing data, as nothing, execution step 2K), if any, sendDataMessage () is set, organising data text, the different field kind of corresponding text head, calls corresponding pack_%s (field name) function, generates corresponding data by different coding mode, send electronic message, execution step 2K);
Step 2K) finish.
The method of 12. configuring external communication protocols according to claim 11, is characterized in that: the described step 1F in described configuration communication protocol plug-in server end operation method) comprise the following steps:
Step 1F1) Raw_dataCallback () is set;
Step 1F2) judge that whether data arrive, and if so, perform step 1F3), if not, execution step 1F10);
Step 1F3) receive data;
Step 1F4) the field kind different to text, call corresponding unpack_%s (field name) function, resolve corresponding field by different coding mode;
Step 1F5) judge whether it is electronic message, if so, perform step 1F6), if not, execution step 1F11);
Step 1F6) write into Databasce;
Step 1F7) judgement writes whether success, if so, performs step 1F8), if not, execution step 1F14);
Step 1F8) judge whether agreement has acknowledgement mechanism, if there is execution step 1F9), if not, execution step 1G);
Step 1F9) reply when overtime execution step 1F15 when data loading), otherwise, execution step 1G);
Step 1F10) close this connection, perform step 1G);
Step 1F11) judge whether it is heartbeat text, if so, perform step 1F12), if not, execution step 1F13);
Step 1F12) cancel the heartbeat event last time arranging, next heartbeat timeout event is set, execution step 1G);
Step 1F13) abandon text;
Step 1F14) judge whether agreement replys, if having, execution step 1F17), if nothing, execution step 1G);
Step 1F15) DBAckTimeOut () is set;
Step 1F16) the different field kind of corresponding text head, call corresponding pack_%s (field name) function, generate corresponding data by different coding mode, organize negative acknowledge text;
Step 1F17) send negative acknowledge text, perform step 1G).
The method of 13. configuring external communication protocols according to claim 11, is characterized in that: the described step 2I in described configuration communication protocol plug-in client operation method) comprise the following steps:
Step 2I1) judge whether that data arrive, if nothing is closed connection, if having, execution step 2I2);
Step 2I2) judge whether agreement replys, if nothing is closed connection, if having, execution step 2I3);
Step 2I3) the field kind different to text, call corresponding unpack_%s (field name) function, resolve corresponding data by different coding mode;
Step 2I4) judge whether to reply text, if nothing, close connection, if having, cancel the overtime event of replying, Status=received_ack is set, send and upgrade text request, receive and upgrade the complete notice of text, send request lower the literary composition notice of waiting to generate electricity, Status=gettingmsg is set, execution step 2K).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010112353.2A CN101902457B (en) | 2010-02-23 | 2010-02-23 | System for configuring external communication protocol and method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010112353.2A CN101902457B (en) | 2010-02-23 | 2010-02-23 | System for configuring external communication protocol and method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101902457A CN101902457A (en) | 2010-12-01 |
CN101902457B true CN101902457B (en) | 2014-11-19 |
Family
ID=43227659
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010112353.2A Active CN101902457B (en) | 2010-02-23 | 2010-02-23 | System for configuring external communication protocol and method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101902457B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102710467B (en) * | 2012-06-29 | 2016-05-11 | 北京天地云箱科技有限公司 | Method for supervising and device |
CN102868691B (en) * | 2012-09-13 | 2015-09-09 | 北京佰能电气技术有限公司 | A kind of full configurationization data communications method and system |
CN104320415B (en) * | 2014-11-13 | 2018-11-20 | 国家电网公司 | A kind of substation equipment kinematic insert formula specification analytic method |
CN107947982A (en) * | 2017-11-24 | 2018-04-20 | 合肥维博自动化科技有限公司 | A kind of device software management system |
CN110086745B (en) * | 2018-01-25 | 2022-09-02 | 上海北玻自动化技术有限公司 | Automatic change line data acquisition control system |
CN113259404B (en) * | 2020-02-12 | 2022-11-11 | 上海宝信软件股份有限公司 | Industrial communication middleware based on TCP/IP protocol and use method thereof |
CN113472810B (en) * | 2021-07-22 | 2023-05-02 | 广东昆仑信息科技有限公司 | Method and system for SOCKET communication based on TCP/IP protocol |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1698329A (en) * | 2003-03-26 | 2005-11-16 | 日本电信电话株式会社 | GMPLS+IP/MPLS node and IP/MPLS node |
CN1984089A (en) * | 2005-12-12 | 2007-06-20 | 阿尔卡特公司 | Method for setting up a connection between portions of a application distributed in nodes |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7561586B2 (en) * | 2003-09-19 | 2009-07-14 | Nortel Networks Limited | Method and apparatus for providing network VPN services on demand |
-
2010
- 2010-02-23 CN CN201010112353.2A patent/CN101902457B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1698329A (en) * | 2003-03-26 | 2005-11-16 | 日本电信电话株式会社 | GMPLS+IP/MPLS node and IP/MPLS node |
CN1984089A (en) * | 2005-12-12 | 2007-06-20 | 阿尔卡特公司 | Method for setting up a connection between portions of a application distributed in nodes |
Also Published As
Publication number | Publication date |
---|---|
CN101902457A (en) | 2010-12-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101902457B (en) | System for configuring external communication protocol and method thereof | |
CN100591073C (en) | Home network system | |
Clarke et al. | Practical modern SCADA protocols: DNP3, 60870.5 and related systems | |
US7215887B2 (en) | Method and apparatus for infrared data communication | |
CN101461194B (en) | A method and system for remotely accessing devices in a network | |
CN101375558A (en) | Network device | |
US20080233922A1 (en) | System and Method for Remotely Monitoring Equipment with the Aid of at Control, Device, Radiocommunications Module and Corresponding Program | |
CN105978860B (en) | A kind of implementation method of electric system software interface adapter | |
KR20050032313A (en) | Home network system | |
WO2006091040A1 (en) | Layer structure of network control protocol and interface method | |
CN101686145A (en) | Equipment capable of upgrading, upgrading method and system | |
US6766296B1 (en) | Data conversion system | |
CN105183452A (en) | Spring AOP based remote protocol service middleware for monitoring power distribution device | |
US20040078286A1 (en) | Integrated web browsing service apparatus and method thereof | |
CN103973763A (en) | Terminal control system and gateway | |
CN1981541A (en) | Integrated management of a wireless network | |
CN206922798U (en) | A kind of Multi-protocol converter, data transmitting equipment and communication system | |
CN101296232A (en) | Adapting device and method with multi-network management and multi-north interface | |
KR100412365B1 (en) | Home Appliance Network System Including Bridge device and Its Operating Method | |
CN107872431B (en) | Data transmitting and receiving method, device and base station | |
CN103039056A (en) | A method for providing data from a resource weak device to a computer client | |
CN100502301C (en) | Node controlling method in network management system | |
CN101330664A (en) | Method, system and apparatus for realizing multimedia business | |
CN108289165A (en) | A kind of implementation method, device and terminal device controlling camera based on mobile phone | |
CN1232915C (en) | Field bus network controller |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |