CN102546557B - Method and device for customizing protocol - Google Patents

Method and device for customizing protocol Download PDF

Info

Publication number
CN102546557B
CN102546557B CN201010610154.4A CN201010610154A CN102546557B CN 102546557 B CN102546557 B CN 102546557B CN 201010610154 A CN201010610154 A CN 201010610154A CN 102546557 B CN102546557 B CN 102546557B
Authority
CN
China
Prior art keywords
data
agreement
label
coding
protocol
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.)
Expired - Fee Related
Application number
CN201010610154.4A
Other languages
Chinese (zh)
Other versions
CN102546557A (en
Inventor
于兴晗
侯煜
盖优普
安波
郭易
陆玉忠
胡宇峰
李琳
徐海卿
马岚
李长江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING IWHR TECHNOLOGY Co Ltd
China Three Gorges Corp
China Institute of Water Resources and Hydropower Research
Original Assignee
BEIJING IWHR TECHNOLOGY Co Ltd
China Three Gorges Corp
China Institute of Water Resources and Hydropower Research
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEIJING IWHR TECHNOLOGY Co Ltd, China Three Gorges Corp, China Institute of Water Resources and Hydropower Research filed Critical BEIJING IWHR TECHNOLOGY Co Ltd
Priority to CN201010610154.4A priority Critical patent/CN102546557B/en
Publication of CN102546557A publication Critical patent/CN102546557A/en
Application granted granted Critical
Publication of CN102546557B publication Critical patent/CN102546557B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a method and a device for customizing a protocol. The method comprises the following steps of: determining the information of label data members; by setting an interface which is interacted with a user, establishing a corresponding relationship between original data which are used by a system and coded data in the protocol; and coding data of the protocol through a label coding function, and identifying the original data through a label analytic function. By the invention, the protocol can be conveniently added or corrected and can be more flexibly used.

Description

A kind of agreement method for customizing and device
Technical field
The present invention relates to Forecast of Water Regime technical field, particularly relate to a kind of agreement method for customizing and device.
Background technology
At present, for domestic Forecast of Water Regime field, the known agreement by 8 bit data harvesters of domestic independent research is all be fixed in program, and the agreement that namely transmission data in hydrologic tele-metering station use is all changeless, single.When agreement needs change or add New Deal, just need whole system software again to develop.Generally, only systematic developer just can add or revise the agreement of system, and the user not yet done to whole system software cannot add or revise the agreement of system.
Therefore, by above-mentioned known, the agreement being applied to data acquisition unit in prior art cannot realize customization, add or amendment agreement all pretty troublesome, lack the flexibility that agreement uses.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of agreement method for customizing and device, can realize interpolation or the amendment of agreement easily, considerably increases the flexibility that agreement uses.
For solving the problems of the technologies described above, the invention provides following technical scheme:
A kind of agreement method for customizing, comprising:
Determine label data information about firms;
By arranging with the interface of user interactions, the corresponding relation between the coded data in the initial data that system of setting up is used and agreement;
Realized the coding of protocol data by label coding function, and realize the identification of initial data by label analytical function.
Preferably, describedly determine that the step of label data information about firms comprises: the number of the function supported according to system and the practical application specification determination label data member of agreement; Set the title of each label data member.
Preferably, the number of the practical application specification determination label data member of the described function according to system support and agreement is specially six; The title of described setting each label data member specifically comprises: the data type that data upload state description corresponding to command code corresponding to the corresponding in the protocol coding of transducer name, transducer name, corresponding protocol dynamic link library name, described agreement, system, data agreement used are corresponding.
Preferably, when the initial data that system is used is transducer name, described by arranging with the interface of user interactions, the step of the corresponding relation between the coded data in the initial data that system of setting up is used and agreement is specially: by arranging with the interface of user interactions, set up the corresponding relation between the coding in described transducer name and this transducer name agreement.
Preferably, the described coding being realized protocol data by label coding function, and the step of the identification being realized initial data by label analytical function is comprised: during transmission, import initial data used for system into protocol layer, convert described initial data to protocol code form by the corresponding relation set up, send by equipment; During reception, by system acceptance to coded data import protocol layer into, convert described coded data to system discernible data, for subsequent treatment by the corresponding relation set up.
Meanwhile, the present invention also provides a kind of agreement customizing device, comprising:
Determination module, for determining label data information about firms;
Module is set, for by arranging with the interface of user interactions, the corresponding relation between the coded data in the initial data that system of setting up is used and agreement;
Coding/identification module, for being realized the coding of protocol data by label coding function, and realizes the identification of initial data by label analytical function.
Preferably, described determination module comprises: determining unit, for the number of the practical application specification determination label data member of the function supported according to system and agreement; Setup unit, for setting the title of each label data member.
Preferably, described determining unit, for being specially six according to the number of the function of system support and the practical application specification determination label data member of agreement; Described setup unit, for setting the title of each label data member, specifically comprise: the data type that data upload state description corresponding to command code corresponding to the corresponding in the protocol coding of transducer name, transducer name, corresponding protocol dynamic link library name, described agreement, system, data agreement used are corresponding.
Preferably, when the initial data that system is used is transducer name, the described module that arranges is arranged particular by the interface with user interactions, sets up the corresponding relation between the coding in described transducer name and this transducer name agreement.
Preferably, described coding/identification module specifically comprises: coding unit, for when sending, imports initial data used for system into protocol layer, convert described initial data to protocol code form by the corresponding relation set up, send by equipment; Recognition unit, for receive time, by system acceptance to coded data import protocol layer into, convert described coded data to system discernible data, for subsequent treatment by the corresponding relation set up.
Compared with prior art, agreement method for customizing provided by the invention and device, can realize interpolation or the amendment of agreement easily, considerably increases the flexibility that agreement uses.In addition, the program can also provide the template of exploitation custom protocol to user, makes user can add the original agreement of self-defining agreement or amendment and add-on system according to the requirement of template.In addition, scheme provided by the invention can also be integrated in 32 embedded data acquisition devices of independent research and be applied.
Below in conjunction with the drawings and specific embodiments, technical scheme of the present invention is described in detail, to make characteristic of the present invention and advantage more obvious.
Accompanying drawing explanation
The schematic flow sheet of the agreement method for customizing provided according to the embodiment of the present invention is provided;
The relation schematic diagram between initial data and protocol code provided according to the embodiment of the present invention is provided;
The block diagram of the agreement customizing mechanism provided according to the embodiment of the present invention is provided;
Figure 4 shows that and that provide according to the embodiment of the present invention schematic diagram is set with interface that is user interactions;
Figure 5 shows that a kind of application example schematic diagram of Fig. 4;
The agreement customizing device structural representation provided according to the embodiment of the present invention is provided;
Another concrete structure schematic diagram of agreement customizing device provided according to the embodiment of the present invention is provided.
Embodiment
Below will provide detailed description to embodiments of the invention.Although the present invention will carry out setting forth and illustrating in conjunction with some embodiments, it should be noted that the present invention is not merely confined to these execution modes.On the contrary, the amendment carry out the present invention or equivalent replacement, all should be encompassed in the middle of right of the present invention.
In addition, in order to better the present invention is described, in embodiment hereafter, give numerous details.It will be understood by those skilled in the art that do not have these details, the present invention can implement equally.
To be described in detail specific implementation of the present invention by multiple embodiment below.
Figure 1 shows that the schematic flow sheet of the agreement method for customizing that the embodiment of the present invention provides.Described agreement method for customizing, can comprise the steps:
In a step 101, label data information about firms is determined;
In a step 102, by arranging with the interface of user interactions, the corresponding relation between the coded data in the initial data that system of setting up is used and agreement;
In step 103, realized the coding of protocol data by label coding function, and realize the identification of data by label analytical function.
Specifically, described step 101 comprises further: the number of the function supported according to system and the practical application specification determination label data member of agreement; Set the title of each label data member.Wherein, pay particular attention to when determining label data membership, this is because the process of the setting of label data membership on user and protocol layer has larger impact.Specifically, on the one hand, the main purpose due to agreement be in order to data encryption and ensure the reliability of transfer of data, so typically, an agreement all comprises protocol header, data and verification three part.When data are transmitted on physical link, all to binary code must be converted, and just will must know at receiving terminal restoring data and if label data member is very few, be then not enough to corresponding relation between initial data and binary number (namely receiving data) indicate this corresponding relation completely.On the other hand, data then process owing to all first must be read in internal memory by the process of any data in systems in which again, so when label data member is too much, the time read in and process will be elongated, the efficiency of protocol layer to tag data process can be reduced like this.So determine suitable label data membership, the efficiency of the practice of whole agreement customized solution finally can be had influence on.
In a particular application, initial data described in the embodiment of the present invention can be transducer name, so described step 102 is further: by arranging with the interface of user interactions, sets up the corresponding relation between the coding in described transducer name and this transducer name agreement.As shown in Figure 2, the relation schematic diagram between the initial data provided for the embodiment of the present invention and protocol code.See from the teeth outwards, the value of label equals transducer name coding in the protocol.The coding adopted for different transducer names due to different vendor in prior art may be different, and result just causes the result that obtains transducer name analysis also different.Corresponding relation between the transducer name set up by the embodiment of the present invention and this transducer name coding in the protocol, just can well avoid these problems.
The block diagram of the agreement customizing mechanism provided according to the embodiment of the present invention is provided.In conjunction with the flow chart shown in above-mentioned Fig. 1, the described coding being realized protocol data by label coding function can be known, and the step of the identification being realized initial data by label analytical function is more specifically: when sending, import initial data used for system into protocol layer, convert described initial data to protocol code form by the aforementioned corresponding relation set up and become protocol data, relend and sent by equipment; Receive time, by system acceptance to protocol-encoded data import protocol layer into, convert described protocol-encoded data to system discernible data by the corresponding relation set up, i.e. initial data, for subsequent treatment.
Figure 4 shows that and that provide according to the embodiment of the present invention schematic diagram is set with interface that is user interactions.The number of the practical application specification determination label data member of the described function according to system support and agreement is specially six; The title setting each label data member specifically comprises: the data type (Type) that data upload state description (Status) corresponding to command code (Op code) corresponding to the corresponding in the protocol coding (Tag) of transducer name (Name), transducer name, corresponding protocol dynamic link library name (Protocol), described agreement, system, data agreement used are corresponding.Here it should be noted that, for some simple agreements, set six label data members and just can meet the demands, when agreement used is too complicated, suitably can increase member variable.
Figure 5 shows that a kind of application example schematic diagram of Fig. 4.It is a kind of specific implementation of the present invention program, by being integrated in one of application interface in 32 embedded data acquisition devices of independent research.As can see from Figure 5, add SMS on agreement one hurdle, generate dynamic link library SMS.dll corresponding with it simultaneously, thus achieve the support of the embodiment of the present invention to SMS agreement.SMS agreement described here is a kind of agreement developed separately, its title is self-defining, can be understood as a kind of short message protocol, is only illustrate herein, one of ordinary skill in the art will appreciate that technical scheme provided by the invention is not limited to this kind of agreement.
The agreement customizing device structural representation provided according to the embodiment of the present invention is provided.Agreement customizing device provided by the invention can comprise: determination module 610, arrange module 620 and coding/identification module 630; Wherein, described determination module 610 is for determining label data information about firms; The described module 620 that arranges for by arranging with the interface of user interactions, the corresponding relation between the coded data in the initial data that system of setting up is used and agreement; Described coding/identification module 630 for being realized the coding of protocol data by label coding function, and realizes the identification of initial data by label analytical function.
Another concrete structure schematic diagram of agreement customizing device provided according to the embodiment of the present invention is provided.Agreement customizing device provided by the invention can comprise: determination module 610, arrange module 620 and coding/identification module 630.Wherein, described determination module 610 more specifically can comprise: determining unit 611 and setup unit 612.Described determining unit 611 is for the number of the practical application specification determination label data member of the function supported according to system and agreement; Described setup unit 612 is for setting the title of each label data member.In one embodiment, described determining unit 611 is for being specially six according to the number of the function of system support and the practical application specification determination label data member of agreement; Described setup unit 612, for setting the title of each label data member, specifically comprises: the data type that data upload state description corresponding to command code corresponding to the corresponding in the protocol coding of transducer name, transducer name, corresponding protocol dynamic link library name, described agreement, system, data agreement used are corresponding.In another embodiment, when the initial data that system is used is transducer name, the described module 620 that arranges specifically by arranging with the interface of user interactions, can set up the corresponding relation between the coding in described transducer name and this transducer name agreement.In another embodiment, described coding/identification module 630 specifically can comprise: coding unit 631 and recognition unit 632.Wherein, described coding unit 631, for when sending, importing initial data used for system into protocol layer, converting described initial data to protocol code form, send by equipment by the corresponding relation set up; Described recognition unit 632 for receive time, by system acceptance to coded data import protocol layer into, convert described coded data to system discernible data, for subsequent treatment by the corresponding relation set up.
In addition, supplementary notes, the description of each embodiment of the method aforementioned is applicable to each device embodiment too.
In sum, as can be seen from each embodiment above-mentioned, agreement method for customizing provided by the invention and device, can realize interpolation or the amendment of agreement easily, considerably increases the flexibility that agreement uses.In addition, the program can also provide the template of exploitation custom protocol to user, makes user can add the original agreement of self-defining agreement or amendment and add-on system according to the requirement of template.In addition, scheme provided by the invention can also be integrated in 32 embedded data acquisition devices of independent research and be applied.
Embodiment and accompanying drawing are only conventional embodiment of the present invention above.Obviously, various supplement, amendment and replacement can be had under the prerequisite not departing from the present invention's spirit that claims define and invention scope.It should be appreciated by those skilled in the art that the present invention can change in form, structure, layout, ratio, material, element, assembly and other side under the prerequisite not deviating from invention criterion according to concrete environment and job requirement in actual applications to some extent.Therefore, embodiment disclosed here is only illustrative rather than definitive thereof, and scope of the present invention is defined by claims and legal equivalents thereof, and the description before being not limited thereto.

Claims (2)

1. an agreement method for customizing, is characterized in that, comprising:
Determine label data information about firms;
By arranging with the interface of user interactions, the corresponding relation between the coded data in the initial data that system of setting up is used and agreement;
Realized the coding of protocol data by label coding function, and realize the identification of initial data by label analytical function,
Describedly determine that the step of label data information about firms comprises:
The number of the function supported according to system and the practical application specification determination label data member of agreement, sets the title of each label data member; The number of the practical application specification determination label data member of the described function according to system support and agreement is specially six,
The title of described setting each label data member specifically comprises: the data type that data upload state description corresponding to command code corresponding to the corresponding in the protocol coding of transducer name, transducer name, corresponding protocol dynamic link library name, described agreement, system, data agreement used are corresponding; When the initial data that system is used is transducer name, described by arranging with the interface of user interactions, the step of the corresponding relation between the coded data in the initial data that system of setting up is used and agreement is specially:
By arranging with the interface of user interactions, set up the corresponding relation between the coding in described transducer name and this transducer name agreement;
The described coding being realized protocol data by label coding function, and the step of the identification being realized initial data by label analytical function is comprised: during transmission, import initial data used for system into protocol layer, convert described initial data to protocol code form by the corresponding relation set up, send by equipment; During reception, by system acceptance to coded data import protocol layer into, convert described coded data to system discernible data, for subsequent treatment by the corresponding relation set up.
2. an agreement customizing device, is characterized in that, comprising:
Determination module, for determining label data information about firms;
Module is set, for by arranging with the interface of user interactions, the corresponding relation between the coded data in the initial data that system of setting up is used and agreement;
Coding/identification module, for being realized the coding of protocol data by label coding function, and realizes the identification of initial data by label analytical function; Described determination module comprises: determining unit, for the number of the practical application specification determination label data member of the function supported according to system and agreement; Setup unit, for setting the title of each label data member;
Described determining unit, for being specially six according to the number of the function of system support and the practical application specification determination label data member of agreement;
Described setup unit, for setting the title of each label data member, specifically comprise: the data type that data upload state description corresponding to command code corresponding to the corresponding in the protocol coding of transducer name, transducer name, corresponding protocol dynamic link library name, described agreement, system, data agreement used are corresponding;
When the initial data that system is used is transducer name, the described module that arranges is arranged particular by the interface with user interactions, sets up the corresponding relation between the coding in described transducer name and this transducer name agreement;
Described coding/identification module specifically comprises:
Coding unit, for importing initial data used for system into protocol layer when sending, converting described initial data to protocol code form by the corresponding relation set up, sending by equipment;
Recognition unit, for receive time by system acceptance to coded data import protocol layer into, convert described coded data to system discernible data, for subsequent treatment by the corresponding relation set up.
CN201010610154.4A 2010-12-17 2010-12-17 Method and device for customizing protocol Expired - Fee Related CN102546557B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010610154.4A CN102546557B (en) 2010-12-17 2010-12-17 Method and device for customizing protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010610154.4A CN102546557B (en) 2010-12-17 2010-12-17 Method and device for customizing protocol

Publications (2)

Publication Number Publication Date
CN102546557A CN102546557A (en) 2012-07-04
CN102546557B true CN102546557B (en) 2015-04-15

Family

ID=46352527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010610154.4A Expired - Fee Related CN102546557B (en) 2010-12-17 2010-12-17 Method and device for customizing protocol

Country Status (1)

Country Link
CN (1) CN102546557B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109547234A (en) * 2018-10-18 2019-03-29 广州市百果园信息技术有限公司 A kind of data processing, report method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004234405A (en) * 2003-01-31 2004-08-19 Fujitsu Ltd Protocol encoder/decoder
US20070043818A1 (en) * 2000-02-09 2007-02-22 Microsoft Corporation Creation and delivery of customized content
CN101370003A (en) * 2007-08-14 2009-02-18 大唐移动通信设备有限公司 Method and apparatus for customizing communication protocol, method and apparatus for converting communication protocol description

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070043818A1 (en) * 2000-02-09 2007-02-22 Microsoft Corporation Creation and delivery of customized content
JP2004234405A (en) * 2003-01-31 2004-08-19 Fujitsu Ltd Protocol encoder/decoder
CN101370003A (en) * 2007-08-14 2009-02-18 大唐移动通信设备有限公司 Method and apparatus for customizing communication protocol, method and apparatus for converting communication protocol description

Also Published As

Publication number Publication date
CN102546557A (en) 2012-07-04

Similar Documents

Publication Publication Date Title
CN104902019B (en) A kind of application method, server and terminal
CN101795270B (en) Server control method based on serial port
CN104754062B (en) Information popularization method, server and user terminal based on internet
CN106843828A (en) interface display, loading method and device
CN102929645B (en) A kind of embedded Python interpreter realizes the method for software systems secondary development
CN105812479A (en) Request and device of permission and acquisition method and device
CN101807205B (en) Processing module, device, and method for processing of xml data
CN104360937A (en) Intelligent parameter checking device
CN103186455B (en) Page automatic test script generates method and system
CN107133064A (en) The hot update method of the page and device of native applications
CN109639737A (en) Agreement generating device, the method for converting protocol of data collection station and configuration method
CN105471968A (en) Data exchange method, data exchange system and data platform server
CN103491071A (en) Wireless communication system
CN103677814A (en) Procedure acquiring method, procedure acquiring device and procedure acquiring system
CN103888346A (en) Information sending method and information sending device
CN101409717A (en) Protocol-independent SOA system and method for processing business
CN111563075A (en) Service checking system, method and equipment and storage medium
CN103761121A (en) Embedded system and implementation method thereof
CN102546557B (en) Method and device for customizing protocol
CN112199186B (en) Data processing method, device, equipment and storage medium based on intelligent contract
CN102609253B (en) A kind of application implementation method of smart card and system
CN108509396A (en) Pdf document turns method, electronic device and the computer readable storage medium of picture
US8917760B2 (en) Manufacturing process
CN106951288B (en) Development and application method and device of hot upgrade resource
CN106559470A (en) A kind of method for pushing and device of account information

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150415

Termination date: 20151217

EXPY Termination of patent right or utility model