CN104158903A - Method and system of encoding OAM (Operation Administration and Maintenance) protocol stack - Google Patents

Method and system of encoding OAM (Operation Administration and Maintenance) protocol stack Download PDF

Info

Publication number
CN104158903A
CN104158903A CN201410427666.5A CN201410427666A CN104158903A CN 104158903 A CN104158903 A CN 104158903A CN 201410427666 A CN201410427666 A CN 201410427666A CN 104158903 A CN104158903 A CN 104158903A
Authority
CN
China
Prior art keywords
oam
value
protocol stack
message
code
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.)
Granted
Application number
CN201410427666.5A
Other languages
Chinese (zh)
Other versions
CN104158903B (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.)
Huzhou Yinglie Intellectual Property Operation Co ltd
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201410427666.5A priority Critical patent/CN104158903B/en
Publication of CN104158903A publication Critical patent/CN104158903A/en
Application granted granted Critical
Publication of CN104158903B publication Critical patent/CN104158903B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a method of encoding an OAM (Operation Administration and Maintenance) protocol stack. The method of encoding the OAM protocol stack comprises the following steps of: setting an object definition module; defining OAM object association attribute values of an OAM object according to an object definition template; and generating codes related to the OAM protocol stack according to the defined OAM object association attribute values. The codes related to the OAM protocol stack include a public function source code of the protocol stack, a setting function code of a protocol stack object and a value function code of the protocol stack object. According to the technical scheme provided by the invention, automatic generation of some codes related to the OAM protocol stack can be automatically implemented, so that the writing efficiency of the codes is greatly provided, the project development period is shortened, and accuracy and clearness of the automatically generated codes are enhanced for providing great convenience for later secondary development and maintenance.

Description

The coding method of OAM protocol stack and system
Technical field
The present invention relates to a kind of protocol code, particularly relate to a kind of OAM protocol coding method and system.
Background technology
In communication system, the exploitation of protocol stack is software engineer's a hard work task always.Due to the particularity of protocol stack, the code that inevitably has a lot of repeatability need to be write, and this has increased software engineer's workload greatly, has usually therefore elongated the construction cycle of project, increases the development difficulty of project.
At EPON (Ethernet Passive Optical Network, Ethernet passive optical network) in system, ONU (Optical Network Unit, optical network unit) by OAM (Operation Administation and Maintenance, Operations, Administration and Maintenance) registration discovery mechanism, is registered to OLT (Optical Line Terminal, optical line terminal), if now OLT assert that ONU identity is legal effectively, ONU reaches the standard grade.OLT can manage the ONU reaching the standard grade, and comprises and ONU is carried out to the operations such as software upgrading, Dynamic Bandwidth Allocation, but wherein the most important thing is that issuing with the monitoring of state information of business the operation such as read.Issue and the monitoring of state information of ordinary business practice the action need such as read and all by setup of attribute and the value of OAM object, operated.Owing to needing to use in a large number OAM protocol stack in EPON system, thereby make the workload that OAM protocol stack is write in EPON system huge.
Given this, how meeting on the basis of OAM protocol stack function realization, reduce the coding work amount of OAM protocol stack, become those skilled in the art's problem demanding prompt solution.
Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide the coding method of a kind of OAM protocol stack and system, huge for solving the workload of prior art OAM protocol stack development, code is write the problem that efficiency code low and exploitation is not easy to follow-up maintenance.
For achieving the above object and other relevant objects, the invention provides the coding method of a kind of OAM protocol stack.The coding method of described OAM protocol stack comprises: object definition module is set; According to described object definition template, OAM object is defined to OAM object correlation attribute value; According to the described OAM object correlation attribute value of definition, generate the relevant code of OAM protocol stack.
Alternatively, described object definition template comprises: the definition to the parameter of the global property of object and object; The global property of described object comprises: the title of object, object B ranch value and object Leaf value; The parameter attribute of described object comprises: the length that the title of parameter, the data type of parameter and parameter take in internal memory.
Alternatively, the relevant code of described OAM protocol stack comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure of protocol stack object; The generation of described structure code is to generate a structure example according to OAM object definition described in each
Alternatively, the relevant code of described OAM protocol stack comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure array statement of protocol stack object and gets number of objects function; The generation of described structure array statement code is to generate a structure example according to OAM object definition described in each, and all described structure examples form the statement of structure array; The described number of objects function of getting returns to the object number in described structure array.
Alternatively, the described specific implementation according to a structure of OAM object definition generation described in each comprises: according to the title of described object, described object B ranch value, object Leaf value, generate a structure example; Described structure example comprise corresponding object Branch, Leaf, function and value function are set.
Alternatively, the relevant code of described OAM protocol stack comprises: protocol stack object function code is set; The described parameter that function input is set comprises reply message internal memory pointer, message valid data field pointer and object instance number is set; Described object instance number is for determining described OAM object; The global property of described OAM object also comprises: message id is set, message structure body is set, mark and object process ID are manually set; When described OAM object, sign is manually set for default when sign is manually set, the described function code that arranges generating comprises: according to described, the respective attributes value that message valid data field pointer obtains described OAM object is set, and the respective attributes value of described OAM object is filled up to arranging in message structure body of described OAM object; Message id being set, message structure body and object process ID are set generate and message is set sends to target process according to described OAM object; According to arranging of described target process, reply definite setting of message and reply code; The Branch value of described OAM object, Leaf value and the described reply code that arranges are filled up to the definite relevant position of described reply message internal memory pointer.
Alternatively, when the object of described OAM object manually arranges, be designated defaultly when sign is manually set, the described function that arranges generating is do-nothing function, and now the described function that arranges needs artificial treatment.
Alternatively, the relevant code of described OAM protocol stack comprises: the value function code of protocol stack object; The parameter of described value function input comprises replys message internal memory pointer, value message valid data field pointer and object instance number; Described object instance number is for determining described OAM object; The global property of described OAM object also comprises: value message id, value message structure body, manual value mark and object process ID; When the manual value of described OAM object is designated default manual value sign, the described value function code of generation comprises: according to the value message id of described OAM object, value message structure body and object process ID, generate value message and send to target process; According to the value of described target process, reply the respective attributes value that message is obtained described OAM object, and the respective attributes value of described OAM object B ranch value, Leaf value and the described OAM object that obtains is filled into the definite relevant position of described reply message internal memory pointer.
Alternatively, work as described OAM object the manual value of object while being designated default manual value sign, the described value function generating is do-nothing function, now the described function that arranges needs artificial treatment.
The present invention also provides a kind of OAM protocol stack coded system.Described OAM protocol stack coded system comprises: template definition module, for object definition module is set; Object definition module, is connected with described template definition module, for OAM object being defined to OAM object correlation attribute value according to described object definition template; Code generation module, is connected with described object definition module, for the described OAM object correlation attribute value according to definition, generates the relevant code of OAM protocol stack.
Alternatively, the described object definition template in described template definition module comprises: the definition to the parameter of the global property of object and object; The global property of described object comprises: the title of object, object B ranch value and object Leaf value; The parameter attribute of described object comprises: the length that the title of parameter, the data type of parameter and parameter take in internal memory.
Alternatively, the relevant code of described OAM protocol stack in described code generation module comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure array statement of protocol stack object and gets object function; The generation of described structure array statement code is to generate a structure example according to OAM object definition described in each, and all described structure examples form the statement of structure array; The described object function of getting returns to the object number in described structure array.
Alternatively, the relevant code of described OAM protocol stack in described code generation module comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure of protocol stack object; The generation of described structure code is to generate a structure example according to OAM object definition described in each.
Alternatively, described structure example comprise corresponding object Branch, Leaf, function and value function are set; The relevant code of described OAM protocol stack in described code generation module comprises: protocol stack object function code is set; The described parameter that function input is set comprises reply message internal memory pointer, message valid data field pointer and object instance number is set; Described object instance number is for determining described OAM object; The global property of described OAM object also comprises: message id is set, message structure body is set, mark and object process ID are manually set; When described OAM object, sign is manually set for default when sign is manually set, the described function code that arranges generating comprises: according to described, the respective attributes value that message valid data field pointer obtains described OAM object is set, and the respective attributes value of described OAM object is filled up to arranging in message structure body of described OAM object; Message id being set, message structure body and object process ID are set generate and message is set sends to target process according to described OAM object; According to arranging of described target process, reply definite setting of message and reply code; The Branch value of described OAM object, Leaf value and the described reply code that arranges are filled up to the definite relevant position of described reply message internal memory pointer.
Alternatively, described structure example comprise corresponding object Branch, Leaf, function and value function are set; The relevant code of described OAM protocol stack in described code generation module comprises: the value function code of protocol stack object; The parameter of described value function input comprises replys message internal memory pointer, value message valid data field pointer and object instance number; Described object instance number is for determining described OAM object; The global property of described OAM object also comprises: value message id, value message structure body, manual value mark and object process ID; When the manual value of described OAM object is designated default manual value sign, the described value function code of generation comprises: according to the value message id of described OAM object, value message structure body and object process ID, generate value message and send to target process; According to the value of described target process, reply the respective attributes value that message is obtained described OAM object, and the respective attributes value of described OAM object B ranch value, Leaf value and the described OAM object that obtains is filled into the definite relevant position of described reply message internal memory pointer.
As mentioned above, a kind of OAM protocol stack of the present invention coding method and system, there is following beneficial effect: can automatically realize the automatic generation of part OAM protocol stack correlative code, the efficiency of writing of code is not only provided greatly, shortened the project development cycle, and accuracy, the clarity of the code automatically generating also obtained enhancing, for secondary development and the maintenance in later stage provides a great convenience.
Accompanying drawing explanation
Fig. 1 is shown as the method flow schematic diagram of an embodiment of a kind of OAM protocol stack of the present invention coding method.
Fig. 2 is shown as the method flow schematic diagram of an embodiment of a kind of OAM protocol stack of the present invention coding method.
Fig. 3 is shown as the method flow schematic diagram of an embodiment of a kind of OAM protocol stack of the present invention coding method.
Fig. 4 is shown as the modular structure schematic diagram of an embodiment of a kind of OAM protocol stack coded system of the present invention.
Element numbers explanation
1 OAM protocol stack coded system
11 template definition modules
12 object definition modules
13 code generation modules
S1~S3 step
Embodiment
Below, by specific instantiation explanation embodiments of the present invention, those skilled in the art can understand other advantages of the present invention and effect easily by the disclosed content of this specification.The present invention can also be implemented or be applied by other different embodiment, and the every details in this specification also can be based on different viewpoints and application, carries out various modifications or change not deviating under spirit of the present invention.
It should be noted that, the diagram providing in the present embodiment only illustrates basic conception of the present invention in a schematic way, satisfy and only show with assembly relevant in the present invention in graphic but not component count, shape and size drafting while implementing according to reality, during its actual enforcement, kenel, quantity and the ratio of each assembly can be a kind of random change, and its assembly layout kenel also may be more complicated.
For achieving the above object and other relevant objects, the invention provides the coding method of a kind of OAM protocol stack.As shown in Figure 1, in one embodiment, the coding method of described OAM protocol stack comprises:
Step S1, arranges object definition module.Particularly, described object definition template comprises: the definition to the parameter of the global property of object and object; The global property of described object comprises: the title of object (objectName), object B ranch value (Branch) and object Leaf value (Leaf); The parameter attribute of described object comprises: the data type (dataType) of the title of parameter (varlname), parameter and the length (len) that parameter takies in internal memory.In one embodiment, the global property of described object also comprises: message id (setMsgId) is set, message structure body (setStruct) is set, mark (setspechandler) is manually set, value message id (getMsgId), value message structure body (getStruct), manually value mark (getspechandler) and object process ID (APPL_ID).
In one embodiment, described object definition template specific as follows shown in:
Wherein:
Step S2, defines OAM object correlation attribute value according to described object definition template to OAM object.Particularly, the OAM object of listing according to IEEE802.3 codes and standards, defines described OAM object correlation attribute value in accordance with described object definition template.Particularly, described parameter attribute SET_OBJECT_VARIALBE depends on protocol specification standard to the definition of parameter, can comprise the situation of 1 parameter or a plurality of parameters.Under special circumstances, can be also sky, there is no the situation of parameter.In one embodiment, as OAM protocol operation object aFECmode, it in codes and standards by Branch value and the unique identity of determining it of Leaf value; And having a parameter attribute fecmode, data type is unsigned int.So, shown in described OAM protocol operation object aFECmode object association attributes being defined as follows in accordance with described object definition template:
It should be noted that and according to the system of OAM protocol stack practical application, determine as MSG_ID_EPON_PORT_SET_fecMode (message id is set), do not belong to the content of protocol specification standard.When OAM object properties exist correspondingly when message id is set in the system of our practical application, mean and have system operation-interface, now, we need to use this that message id is set.Otherwise if there is not the corresponding message id that arranges in system, we only need to retain " setMsgId " keyword in template.The processing of other correlation attribute value is also similar, if described property value has corresponding correlation in system, gets its value; Otherwise, retain the keyword in template.In one embodiment, described parameter attribute can be sky, now represents that this OAM object does not exist parametric variable.
Step S3, generates the relevant code of OAM protocol stack according to the described OAM object correlation attribute value of definition.In one embodiment, the relevant code of described OAM protocol stack comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure of protocol stack object; The generation of described structure code is to generate a structure example according to OAM object definition described in each.In one embodiment, the relevant code of described OAM protocol stack comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure array statement of protocol stack object and gets number of objects function; The generation of described structure array statement code is to generate a structure example according to OAM object definition described in each, and all described structure examples form the statement of structure array; The described number of objects function of getting returns to the object number in described structure array.In one embodiment, realize the code generation script of the method by the defined described OAM object correlation attribute value of read step 2, and process.OAM object described in each is processed, and described processing comprises: while reading " OBJECT_START ", complete the initialization of some overall script variable.While reading " SET_OBJECT ", by read its after relevant global variable property value remain in corresponding global variable.While reading " SET_OBJECT_VARIABLE ", by read its after relevant parameter variable's attribute value remain in corresponding global variable.While reading " OBJECT_END ", illustrate that a complete object definition is finished, the required global variable assignment of generating code completes.In this way or similarly mode can generate a structure example by OAM object definition described in each simultaneously.In one embodiment, code generation script generates a structure example according to the object oriented of described OAM object, described object B ranch value, object Leaf value; Described structure example comprise corresponding object Branch, Leaf, function and value function are set.The generation that the described OAM object correlation attribute value of each definition is corresponding a structure example, these all structure examples have formed structure volume data.The described number of objects function of getting returns to the structure object number in described structure array, and this can simply add up and generate the realization of structure example number, also can be by the length of described structure array is obtained divided by single structure body length.In one embodiment, described code generation script is realized by TCL script.
In one embodiment, the relevant code of described OAM protocol stack also comprises: protocol stack object function code is set.Particularly, the generation that function code is set can be when reading " OBJECT_END ", when the required global variable assignment of generating code has completed, carried out.The described parameter that function input is set comprises reply message internal memory pointer, replys the displacement of message internal memory, message valid data field pointer and object instance number is set; Wherein, described object instance number is for determining described OAM object.In one embodiment, generate one function code is set for each OAM object, all setting can be kept at after function code generates that object is privately owned to be arranged in function interface source file.
The global property of described OAM object also comprises: message id is set, message structure body is set, mark and object process ID are manually set.Generate protocol stack object function code is set time, code generation script first judge described OAM object manually arrange sign be whether preset sign (preset sign is manually set can be defaulted as this attribute keyword setspechandler) is manually set.If the manual setting of described OAM object is designated the default sign that manually arranges, illustrate that the function that arranges of this OAM object needs artificial treatment, now, the function that arranges of the described OAM object of generation is do-nothing function.When described OAM object, sign is manually set for default when sign is manually set, the described function code that arranges generating comprises: first judge that described whether message id is set effective, if effectively, according to described, the respective attributes value that message valid data field pointer obtains described OAM object is set, and the respective attributes value of described OAM object is filled up to arranging in message structure body of described OAM object.When described property value is while being a plurality of, by described successively, the respective attributes value (obtaining described property value according to object properties order and the described valid data field that message is set of length circulation parsing in message corresponding to attribute) that message valid data field pointer obtains described OAM object is set, and the respective attributes value of described OAM object is filled up to arranging in message structure body of described OAM object.Message id being set, message structure body and object process ID are set generate and message is set sends to target process according to described OAM object; According to arranging of described target process, reply definite setting of message and reply code; The Branch value of described OAM object, Leaf value and the described reply code that arranges are filled up to the definite relevant position of described reply message internal memory pointer.If described, message id is set invalid, does not carry out the operation of getattr, directly the Branch value of described OAM object, Leaf value and invalid return code are filled up to the definite relevant position of described reply message internal memory pointer.The described function that arranges can also comprise transmission described reply message (being generally OAM message).When the described message id that arranges is when invalid, reply the OAM message with invalid return code; When the described message id that arranges is when effective, correctly reply OAM message.In one embodiment, described code generation script is realized by TCL script.
In one embodiment, the relevant code of described OAM protocol stack also comprises: the value function code of protocol stack object.Particularly, the generation of value function code can be when reading " OBJECT_END ", when the required global variable assignment of generating code has completed, carried out.The parameter of described value function input comprises replys message internal memory pointer, the displacement of reply message internal memory, value message valid data field pointer and object instance number.Wherein, described object instance number is for determining described OAM object.In one embodiment, for each OAM object, generate a value function code, all value function code can be kept in the privately owned value function interface of object source file after generating.
The global property of described OAM object also comprises: value message id, value message structure body, manual value mark and object process ID.When generating the value function code of protocol stack object, first code generation script judges whether the manual value sign of described OAM object is the manual value sign (default manual value sign can be defaulted as this attribute keyword getspechandler) of presetting.If the manual value of described OAM object is designated default manual value sign, illustrate that the value function of this OAM object needs artificial treatment, now, the value function of the described OAM object of generation is do-nothing function.When the manual value of described OAM object is designated default manual value sign, the described value function code generating comprises: judge that whether described value message id is effective, if effectively, generate value message according to the value message id of described OAM object, value message structure body and object process ID, send to target process; According to the value of described target process, reply the respective attributes value that message is obtained described OAM object, and the respective attributes value of described OAM object B ranch value, Leaf value and the described OAM object that obtains is filled into the definite relevant position of described reply message internal memory pointer.If described value message id is invalid, do not carry out the operation of getattr, directly the Branch value of described OAM object, Leaf value and invalid return code are filled up to the definite relevant position of described reply message internal memory pointer.Described value function can also comprise transmission described reply message (being generally OAM message).When described value message is replied the OAM message with invalid return code; When described value message id is effective, correct OAM message of replying with content of parameter.In one embodiment, described code generation script is realized by TCL script.
In one embodiment, as shown in Figure 2, the coding method of described OAM protocol stack comprises that generation arranges function code.First, in object definition script according to the OAM object in default object definition template definition agreement.Then, object definition script is imported to function and realize script (being code generation script).In function, realize in script, first according to the sign that manually arranges of described OAM object, judge whether to need manual handle, if answer is YES, need manual handle that function code is set.If answer is No, now, first by message id judgement is set, whether effectively message (whether by judgement, message id is set effectively judges) is set, if answer is YES, to being set, message packet resolves, obtain the respective attributes value of described OAM object, and be filled up to the arranging in message structure body of described OAM object, according to message id is set, message structure body and object process ID are set generate and message is set sends to target process of described OAM object, according to arranging of described target process, reply message and determine to arrange and reply code.According to reply code is set, fills in correct OAM message and reply.If answer is No, reply invalid OAM message.
In one embodiment, as shown in Figure 3, the coding method of described OAM protocol stack comprises generation value function code.First, in object definition script according to the OAM object in default object definition template definition agreement.Then, object definition script is imported to function and realize script (being code generation script).In function, realize in script, first according to the manual value sign of described OAM object, judge whether to need manual handle, if answer is YES, need manual handle value function code, need artificial treatment.If answer is No, now, first by the judgement of value message id, whether effectively message (by judging whether value message id effectively comes to determine) is set, if answer is YES, according to the value message id of described OAM object, value message structure body and object process ID, generates value message and send to target process.According to the value of described target process, reply the respective attributes value that message is obtained described OAM object, and the respective attributes value of described OAM object B ranch value, Leaf value and the described OAM object that obtains is filled on correct OAM message, and reply described correct OAM message.If answer is No, reply invalid OAM message.
The present invention also provides a kind of OAM protocol stack coded system.Described OAM protocol stack coded system can be applied the coding method of foregoing OAM protocol stack.As shown in Figure 4, in one embodiment, described OAM protocol stack coded system 1 comprises: template definition module 11, object definition module 12 and code generation module 13.Wherein:
Template definition module 11, for arranging object definition module.Described object definition template in described template definition module comprises: the definition to the parameter of the global property of object and object; The global property of described object comprises: the title of object, object B ranch value and object Leaf value; The parameter attribute of described object comprises: the length that the title of parameter, the data type of parameter and parameter take in internal memory.
Object definition module 12, is connected with described template definition module 11, for OAM object being defined to OAM object correlation attribute value according to described object definition template.
Code generation module 13, is connected with described object definition module 12, for the described OAM object correlation attribute value according to definition, generates the relevant code of OAM protocol stack.In one embodiment, the relevant code of described OAM protocol stack in described code generation module 13 comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure of protocol stack object; The generation of described structure code is to generate a structure example according to OAM object definition described in each.In one embodiment, described structure example comprise corresponding object Branch, Leaf, function and value function are set.
In one embodiment, the relevant code of described OAM protocol stack in described code generation module 13 comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure array statement of protocol stack object and gets object function; The generation of described structure array statement code is to generate a structure example according to OAM object definition described in each, and all described structure examples form the statement of structure array; The described object function of getting returns to the object number in described structure array.In one embodiment, described structure example comprise corresponding object Branch, Leaf, function and value function are set.
In one embodiment, the relevant code of described OAM protocol stack in described code generation module 13 comprises: protocol stack object function code is set; The described parameter that function input is set comprises reply message internal memory pointer, message valid data field pointer and object instance number is set; Described object instance number is for determining described OAM object; The global property of described OAM object also comprises: message id is set, message structure body is set, mark and object process ID are manually set.When the manual setting of described OAM object is designated the default sign that manually arranges, illustrate that the function that arranges of this OAM object needs artificial treatment, now, the value function of the described OAM object of generation is do-nothing function.When described OAM object, sign is manually set for default when sign is manually set, the described function code that arranges generating comprises: judge that described whether message id is set effective, if effectively, according to described, the respective attributes value that message valid data field pointer obtains described OAM object is set, and the respective attributes value of described OAM object is filled up to arranging in message structure body of described OAM object; Message id being set, message structure body and object process ID are set generate and message is set sends to target process according to described OAM object; According to arranging of described target process, reply definite setting of message and reply code; The Branch value of described OAM object, Leaf value and the described reply code that arranges are filled up to the definite relevant position of described reply message internal memory pointer.The described function that arranges can also comprise transmission described reply message (being generally OAM message).When the described message id that arranges is when invalid, reply the OAM message with invalid return code; When the described message id that arranges is when effective, correctly reply OAM message.
In one embodiment, the relevant code of described OAM protocol stack in described code generation module 13 comprises: the value function code of protocol stack object; The parameter of described value function input comprises replys message internal memory pointer, value message valid data field pointer and object instance number.Described object instance number is for determining described OAM object; The global property of described OAM object also comprises: value message id, value message structure body, manual value mark and object process ID.When the manual value of described OAM object is designated default manual value sign, illustrate that the value function of this OAM object needs artificial treatment, now, the value function of the described OAM object of generation is do-nothing function.When the manual value sign of described OAM object does not identify for default manual value, the described value function code generating comprises: judge that whether described value message id is effective, if effectively, generate value message according to the value message id of described OAM object, value message structure body and object process ID, send to target process; According to the value of described target process, reply the respective attributes value that message is obtained described OAM object, and the respective attributes value of described OAM object B ranch value, Leaf value and the described OAM object that obtains is filled into the definite relevant position of described reply message internal memory pointer.Described value function can also comprise transmission described reply message (being generally OAM message).When described value message is replied the OAM message with invalid return code; When described value message id is effective, correct OAM message of replying with content of parameter.
In sum, the present invention's a kind of OAM protocol stack coding method and system, there is following beneficial effect: can automatically realize the automatic generation of part OAM protocol stack correlative code, the efficiency of writing of code is not only provided greatly, shortened the project development cycle, and accuracy, the clarity of the code automatically generating also obtained enhancing, for secondary development and the maintenance in later stage provides a great convenience.So the present invention has effectively overcome various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all can, under spirit of the present invention and category, modify or change above-described embodiment.Therefore, such as in affiliated technical field, have and conventionally know that the knowledgeable, not departing from all equivalence modifications that complete under disclosed spirit and technological thought or changing, must be contained by claim of the present invention.

Claims (12)

1. the coding method of OAM protocol stack, is characterized in that, the coding method of described OAM protocol stack comprises:
Object definition module is set;
According to described object definition template, OAM object is defined to OAM object correlation attribute value;
According to the described OAM object correlation attribute value of definition, generate the relevant code of OAM protocol stack.
2. OAM protocol stack according to claim 1 coding method, is characterized in that: described object definition template comprises: the definition to the parameter of the global property of object and object; The global property of described object comprises: the title of object, object B ranch value and object Leaf value; The parameter attribute of described object comprises: the length that the title of parameter, the data type of parameter and parameter take in internal memory.
3. OAM protocol stack according to claim 2 coding method, is characterized in that: the relevant code of described OAM protocol stack comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure of protocol stack object; The generation of described structure code is to generate a structure example according to OAM object definition described in each.
4. OAM protocol stack according to claim 2 coding method, is characterized in that: the relevant code of described OAM protocol stack comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure array statement of protocol stack object and gets number of objects function; The generation of described structure array statement code is to generate a structure example according to OAM object definition described in each, and all described structure examples form the statement of structure array; The described number of objects function of getting returns to the object number in described structure array.
5. according to the OAM protocol stack coding method described in claim 3 or 4, it is characterized in that: the described specific implementation according to a structure of OAM object definition generation described in each comprises: according to the title of described object, described object B ranch value, object Leaf value, generate a structure example; Described structure example comprise corresponding object Branch, Leaf, function and value function are set.
6. OAM protocol stack according to claim 5 coding method, is characterized in that: the relevant code of described OAM protocol stack comprises: protocol stack object function code is set; The described parameter that function input is set comprises reply message internal memory pointer, message valid data field pointer and object instance number is set; Described object instance number is for determining described OAM object; The global property of described OAM object also comprises: message id is set, message structure body is set, mark and object process ID are manually set; When described OAM object, sign is manually set for default when sign is manually set, the described function code that arranges generating comprises: according to described, the respective attributes value that message valid data field pointer obtains described OAM object is set, and the respective attributes value of described OAM object is filled up to arranging in message structure body of described OAM object; Message id being set, message structure body and object process ID are set generate and message is set sends to target process according to described OAM object; According to arranging of described target process, reply definite setting of message and reply code; The Branch value of described OAM object, Leaf value and the described reply code that arranges are filled up to the definite relevant position of described reply message internal memory pointer; When the object of described OAM object manually arranges, be designated defaultly when sign is manually set, the described function that arranges generating is do-nothing function, and now the described function that arranges needs artificial treatment.
7. OAM protocol stack according to claim 5 coding method, is characterized in that: the relevant code of described OAM protocol stack comprises: the value function code of protocol stack object; The parameter of described value function input comprises replys message internal memory pointer, value message valid data field pointer and object instance number; Described object instance number is for determining described OAM object; The global property of described OAM object also comprises: value message id, value message structure body, manual value mark and object process ID; When the manual value of described OAM object is designated default manual value sign, the described value function code of generation comprises: according to the value message id of described OAM object, value message structure body and object process ID, generate value message and send to target process; According to the value of described target process, reply the respective attributes value that message is obtained described OAM object, and the respective attributes value of described OAM object B ranch value, Leaf value and the described OAM object that obtains is filled into the definite relevant position of described reply message internal memory pointer; Work as described OAM object the manual value of object while being designated default manual value sign, the described value function generating is do-nothing function, now the described function that arranges needs artificial treatment.
8. an OAM protocol stack coded system, is characterized in that: described OAM protocol stack coded system comprises:
Template definition module, for arranging object definition module;
Object definition module, is connected with described template definition module, for OAM object being defined to OAM object correlation attribute value according to described object definition template;
Code generation module, is connected with described object definition module, for the described OAM object correlation attribute value according to definition, generates the relevant code of OAM protocol stack.
9. OAM protocol stack coded system according to claim 8, is characterized in that: the described object definition template in described template definition module comprises: the definition to the parameter of the global property of object and object; The global property of described object comprises: the title of object, object B ranch value and object Leaf value; The parameter attribute of described object comprises: the length that the title of parameter, the data type of parameter and parameter take in internal memory.
10. OAM protocol stack coded system according to claim 9, is characterized in that: the relevant code of described OAM protocol stack comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure of protocol stack object; The generation of described structure code is to generate a structure example according to OAM object definition described in each.
11. OAM protocol stack coded systems according to claim 9, is characterized in that: the relevant code of described OAM protocol stack in described code generation module comprises: the public function source code of protocol stack; The public function source code of described protocol stack comprises the structure array statement of protocol stack object and gets object function; The generation of described structure array statement code is to generate a structure example according to OAM object definition described in each, and all described structure examples form the statement of structure array; The described object function of getting returns to the object number in described structure array.
12. according to the OAM protocol stack coded system described in claim 10 or 11, it is characterized in that: described structure example comprise corresponding object Branch, Leaf, function and value function are set; The relevant code of described OAM protocol stack in described code generation module comprises: protocol stack object function code is set; The described parameter that function input is set comprises reply message internal memory pointer, message valid data field pointer and object instance number is set; Described object instance number is for determining described OAM object; The global property of described OAM object also comprises: message id is set, message structure body is set, mark and object process ID are manually set; When described OAM object, sign is manually set for default when sign is manually set, the described function code that arranges generating comprises: according to described, the respective attributes value that message valid data field pointer obtains described OAM object is set, and the respective attributes value of described OAM object is filled up to arranging in message structure body of described OAM object; Message id being set, message structure body and object process ID are set generate and message is set sends to target process according to described OAM object; According to arranging of described target process, reply definite setting of message and reply code; The Branch value of described OAM object, Leaf value and the described reply code that arranges are filled up to the definite relevant position of described reply message internal memory pointer; The relevant code of described OAM protocol stack in described code generation module also comprises: the value function code of protocol stack object; The parameter of described value function input comprises replys message internal memory pointer, value message valid data field pointer and object instance number; Described object instance number is for determining described OAM object; The global property of described OAM object also comprises: value message id, value message structure body, manual value mark and object process ID; When the manual value of described OAM object is designated default manual value sign, the described value function code of generation comprises: according to the value message id of described OAM object, value message structure body and object process ID, generate value message and send to target process; According to the value of described target process, reply the respective attributes value that message is obtained described OAM object, and the respective attributes value of described OAM object B ranch value, Leaf value and the described OAM object that obtains is filled into the definite relevant position of described reply message internal memory pointer.
CN201410427666.5A 2014-08-27 2014-08-27 The coding method of OAM protocol stacks and system Active CN104158903B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410427666.5A CN104158903B (en) 2014-08-27 2014-08-27 The coding method of OAM protocol stacks and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410427666.5A CN104158903B (en) 2014-08-27 2014-08-27 The coding method of OAM protocol stacks and system

Publications (2)

Publication Number Publication Date
CN104158903A true CN104158903A (en) 2014-11-19
CN104158903B CN104158903B (en) 2018-05-01

Family

ID=51884308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410427666.5A Active CN104158903B (en) 2014-08-27 2014-08-27 The coding method of OAM protocol stacks and system

Country Status (1)

Country Link
CN (1) CN104158903B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107147630A (en) * 2017-04-27 2017-09-08 上海斐讯数据通信技术有限公司 It is a kind of to realize the method and device that OMCI protocol stack codes are automatically generated
CN109462584A (en) * 2018-10-31 2019-03-12 哈尔滨电工仪表研究所有限公司 The analytic method of recordable data in 698.45 agreement of DL/T

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030103080A1 (en) * 2001-12-05 2003-06-05 Bahman Radjabi System and method for developing a code generator for object-oriented communication protocol
CN101122854A (en) * 2007-09-13 2008-02-13 上海交通大学 Structured code automatic configuration method and device
US20100218165A1 (en) * 2009-02-26 2010-08-26 International Business Machines Corporation Optimizing code generation system with input data integration
CN101841515A (en) * 2009-03-19 2010-09-22 北京理工大学 Target variable protocol data unit codec code automatic generation implementation method
CN103135976A (en) * 2011-11-30 2013-06-05 阿里巴巴集团控股有限公司 Code automatic generation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030103080A1 (en) * 2001-12-05 2003-06-05 Bahman Radjabi System and method for developing a code generator for object-oriented communication protocol
CN101122854A (en) * 2007-09-13 2008-02-13 上海交通大学 Structured code automatic configuration method and device
US20100218165A1 (en) * 2009-02-26 2010-08-26 International Business Machines Corporation Optimizing code generation system with input data integration
CN101841515A (en) * 2009-03-19 2010-09-22 北京理工大学 Target variable protocol data unit codec code automatic generation implementation method
CN103135976A (en) * 2011-11-30 2013-06-05 阿里巴巴集团控股有限公司 Code automatic generation method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
卢国伟: "EPON网管系统设计及OAM协议的研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 *
汪亮: "EPON系统OAM模块的软件实现", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107147630A (en) * 2017-04-27 2017-09-08 上海斐讯数据通信技术有限公司 It is a kind of to realize the method and device that OMCI protocol stack codes are automatically generated
CN109462584A (en) * 2018-10-31 2019-03-12 哈尔滨电工仪表研究所有限公司 The analytic method of recordable data in 698.45 agreement of DL/T

Also Published As

Publication number Publication date
CN104158903B (en) 2018-05-01

Similar Documents

Publication Publication Date Title
TWI668655B (en) Risk information output, risk information construction method and device
CN104053164B (en) Things-internet gateway test system and method
CN109739915B (en) Cross-domain shared data model construction method
CN101593111A (en) A kind of Service Component reaches the applied software development method and system based on Service Component
CN102281152B (en) Distributed communication system, implementation method, marshalling and unmarshalling method of remote API (Application Program Interface)
CN106095376A (en) A kind of implementation method of quick configuration monitoring picture
CN103634161A (en) Train communication protocol consistency detection device and train communication protocol consistency detection method
CN111683066A (en) Heterogeneous system integration method and device, computer equipment and storage medium
CN103746746A (en) Business system of network device
CN111026460A (en) Method and device for quickly matching points by using area template in configuration tool
CN104698962B (en) PLC man-machine communication's method and system
CN108255602A (en) Task combined method and terminal device
CN105005543A (en) Interface generation apparatus and method
CN114510452A (en) SOC (System on chip) integration method and device and electronic equipment
CN104750468B (en) A kind of server-side topological data conversion method and conversion equipment
CN105574130A (en) Data transmission method and service system
CN104158903A (en) Method and system of encoding OAM (Operation Administration and Maintenance) protocol stack
CN101794240B (en) Method and system for aggregating data content
CN105930354A (en) Storage model conversion method and device
CN103729523B (en) Automatic verification method orienting to parameterization system
CN112860954A (en) Real-time computing method and real-time computing system
CN109788034B (en) Configuration method for gateway access equipment, electronic equipment and storage medium
CN112019389A (en) Topological system configuration method, device, equipment and medium
CN103793227A (en) Method for achieving WCF service
CN109120731B (en) Universal communication method, system and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201209

Address after: 313021 industrial functional zone, Donglin Town, Huzhou City, Zhejiang Province

Patentee after: ZHEJIANG YUANTE NEW MATERIAL Co.,Ltd.

Address before: 201616 No. 3666 Sixian Road, Songjiang District, Shanghai

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210519

Address after: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

Address before: 313021 industrial functional zone, Donglin Town, Huzhou City, Zhejiang Province

Patentee before: ZHEJIANG YUANTE NEW MATERIAL Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221230

Address after: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Address before: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

TR01 Transfer of patent right