CN102937910A - System and method for cross-platform conversion of control algorithms - Google Patents

System and method for cross-platform conversion of control algorithms Download PDF

Info

Publication number
CN102937910A
CN102937910A CN 201110234800 CN201110234800A CN102937910A CN 102937910 A CN102937910 A CN 102937910A CN 201110234800 CN201110234800 CN 201110234800 CN 201110234800 A CN201110234800 A CN 201110234800A CN 102937910 A CN102937910 A CN 102937910A
Authority
CN
China
Prior art keywords
attribute
name
format
tabulation
syntax
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
CN 201110234800
Other languages
Chinese (zh)
Other versions
CN102937910B (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.)
CGN (BEIJING) SIMULATION TECHNOLOGY CO LTD
China General Nuclear Power Corp
Original Assignee
CGN (BEIJING) SIMULATION TECHNOLOGY CO LTD
China General Nuclear Power Corp
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 CGN (BEIJING) SIMULATION TECHNOLOGY CO LTD, China General Nuclear Power Corp filed Critical CGN (BEIJING) SIMULATION TECHNOLOGY CO LTD
Priority to CN201110234800.6A priority Critical patent/CN102937910B/en
Publication of CN102937910A publication Critical patent/CN102937910A/en
Application granted granted Critical
Publication of CN102937910B publication Critical patent/CN102937910B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a system for cross-platform conversion of control algorithms. The system is used for converting the control algorithms of a source platform to algorithms which are executed in a target platform. The system comprises a resolver and a converter, wherein the resolver is used for converting source control algorithms to an expanded parsing tree, the expanded parsing tree is a tree type data structure which consists of expanded syntax nodes, every expanded syntax node corresponds to a syntax rule of source control algorithms and comprises an attribute list, a format rule list and an action sequence, the format rule list comprises format rules of a target file, and the converter is used for converting the expanded parsing tree to the target file in accordance with format rules of the format rule list. The invention also provides a method for the cross-platform conversion of control algorithms. The attribute lists, the format rule lists and the action sequences are added in the expanded parsing tree, and the cross-platform conversion of control algorithms, which supports multi-target file generation automatically, is achieved.

Description

The cross-platform converting system of control algolithm and method
Technical field
The present invention relates to control algolithm emulation field, more particularly, relate to the cross-platform converting system of a kind of control algolithm and method.
Background technology
Nuclear power station all needs to control by control system when operation.Include various steering logics in the above-mentioned control system, these steering logics all are to adopt the algorithm description language stipulated in the IEC61131-3 international standard or the descriptive language of manufacturer's self-defining to be described usually.Hereinafter only describe as an example of the IEC61131-3 standard language example.
The IEC61131-3 international standard provides the standardization programming language for the Software for Design of industrial automation control system.This standard has been improved the development efficiency of industrial control system programming software, makes the transplanting between the program of automation control system of each producer become possibility, has reduced user's use difficulty and engineering cost.The IEC61131-3 control algolithm all is encapsulated among the corresponding POU (Program Organization Unit program organization unit).The POU algorithm comprises function, functional block and program three types.As shown in Figure 1, each POU comprises a variable declarations part and a logical code main body, and wherein logical code adopts any one algorithm description language of IEC programming language to write.
In simulation process, POU steering logic (source platform) from its platform need to be transformed on oneself the platform (target platform).By Fig. 1 as seen, the POU steering logic is with different algorithm description language encapsulation, and these algorithm description language grammers differ greatly; Its next POU steering logic may need to translate into one or more file on the target platform, and the form of these files is different.At last, target platform may be different.These factors are given automatically, and conversion has brought a huge difficult problem.
In addition, because many emulation platforms are not directly supported the emulation of IEC61131-3 algorithm, thereby so that people need these language of human interpretation when carrying out power station simulation, and convert the algorithm of these language descriptions on the emulation platform algorithm.The migration process of general algorithm all is to adopt artificial mode now.There is the problem of two aspects in this method: generally speaking, need to generate multiple file, the form of various files is different, thereby so that whole migration process is very complicated and make mistakes easily; In addition, because DCS continues upgrading, its control algolithm is also processed in the continuous renewal.Meeting is so that former transfer algorithm can't be reused like this, and whole conversion work needs again to re-start, and has wasted a large amount of manpowers and time.
Summary of the invention
The technical problem to be solved in the present invention is, transplants for existing control algolithm and relies on artificial defective, and the cross-platform converting system of a kind of control algolithm and method are provided.
The technical solution adopted for the present invention to solve the technical problems is: provide a kind of control algolithm cross-platform converting system, be used for the control algolithm of source platform is converted to the algorithm of carrying out at target platform, comprising:
Resolver, be used for the source control algolithm is converted to the extension syntax parsing tree, described extension syntax parsing tree comprises the extension syntax node, a syntax rule in each the corresponding source of described extension syntax node control algolithm, each described extension syntax node comprises attribute list, format convention tabulation, action sequence, and described format convention tabulation comprises the format convention of file destination;
Converter is used for according to the format convention of format convention tabulation described extension syntax parsing tree being converted to file destination.
In the cross-platform converting system of control algolithm of the present invention, described resolver comprises:
Lexical analyzer is used for the control algolithm text resolution of input is become mark stream, and each lexical analyzer is corresponding with a kind of algorithm description language;
Syntax analyzer, be used for resolving the mark stream of lexical analyzer output and creating the extension syntax parsing tree, the extension syntax node that is simultaneously the extension syntax parsing tree generates attribute list, format convention tabulation, action sequence, and each syntax analyzer is corresponding with a kind of algorithm description language.
In the cross-platform converting system of control algolithm of the present invention, described attribute list comprises one group of attribute, and each attribute comprises attribute-name and property value, and wherein property value is character string, object or tabulation; Format convention in the described format convention tabulation comprises form name and format value, and wherein the form name is associated with the syntax rule name, and format value is a character string that includes placeholder, and placeholder uses the mode of escape to quote attribute-name or attribute list.
The present invention also provides a kind of control algolithm cross-platform conversion method, is used for the control algolithm of source platform is converted to the algorithm of carrying out at target platform, may further comprise the steps:
(a) the source control algolithm is converted to the extension syntax parsing tree, described extension syntax parsing tree comprises the extension syntax node, a syntax rule in each the corresponding source of described extension syntax node control algolithm, each described extension syntax node comprises attribute list, format convention tabulation, action sequence, and described format convention tabulation comprises the format convention of file destination;
(b) according to the format convention in the format convention tabulation described extension syntax parsing tree is converted to file destination.
5, the cross-platform conversion method of control algolithm according to claim 4 is characterized in that, described step (a) comprising:
(a1) by lexical analyzer the control algolithm text resolution of inputting is become mark stream, each lexical analyzer is corresponding with a kind of algorithm description language;
(a2) resolve the mark stream of lexical analyzer output and create the extension syntax parsing tree by syntax analyzer, the extension syntax node that is simultaneously the extension syntax parsing tree generates attribute list, format convention tabulation, action sequence, and each syntax analyzer is corresponding with a kind of algorithm description language.
In the cross-platform conversion method of control algolithm of the present invention, when creating the format convention tabulation, comprise in the described step (a2): all and the corresponding format convention of this syntax rule in according to syntax rule name find formatting text, and with in its adding format convention tabulation, described format text file is corresponding with the target platform algorithm.
In the cross-platform conversion method of control algolithm of the present invention, described attribute list comprises one group of attribute, and each attribute comprises attribute-name and property value, and wherein property value is character string, object or tabulation.
In the cross-platform conversion method of control algolithm of the present invention, format convention in the described format convention tabulation comprises form name and format value, wherein the form name is associated with the syntax rule name, format value is a character string that includes placeholder, and placeholder uses the mode of escape to quote attribute-name or attribute list.
In the cross-platform conversion method of control algolithm of the present invention, described placeholder comprises following four kinds of form of Definitions:
Escape character-attribute-name X: the property value of getting attribute attribute-name X by name;
Escape character-attribute-name X[i]: the property value of getting i the attribute of attribute attribute-name X by name;
Escape character-attribute-name X[i]. field name: the field value of getting specific fields in the property value of i attribute of attribute attribute-name X by name;
Escape character-attribute-name X[i]-the form name: the format value of when property value is the extension syntax node, getting specific format rule in the property value of i attribute of attribute attribute-name X by name, and specify sub-syntax rule object and corresponding form name, return in this object therewith conversion value corresponding to form.
In the cross-platform conversion method of control algolithm of the present invention, described step (b) comprising:
(b1) content in the assay format rule and it is stored among the tabulation L arranges as a result character string R for empty;
(b2) if tabulation L be sky, then enter (b5), otherwise first element I among the L that reads to tabulate.
(b3) process by the content that reads: if element I is format text, then directly add content of text to the as a result end of character string R; If element I is condition cycle control label, then according to conditional content getattr value and add the as a result end of character string R to.Or according to cycling condition circulation getattr value and add the as a result end of character string R to; If element I is placeholder, and the form of placeholder is escape character-attribute-name X, then the direct property value in the reading attributes tabulation and add it to as a result end of character string R; If element I is placeholder, and the form of placeholder is escape character-attribute-name X[i], the property value X during then directly reading attributes is tabulated, and with i end that property value adds R among the X; If element I is placeholder, and the form of placeholder is escape character-attribute-name X[i]. field name, the direct property value X in the reading attributes tabulation then, and add the field value of i property value among the X to the as a result end of character string R; If element I is placeholder, and the form of placeholder is escape character-attribute-name X[i]-form name M, property value X during then directly reading attributes is tabulated, and read i property value K among the X, K is extension syntax node node, this step of recursive call, and with the input root node be arranged to K, and format convention is arranged to M, adds the result of recursive call to the as a result end of character string R;
(b4) first element of deletion I from tabulation returns (b2);
(b5) return results character string R.
The cross-platform converting system of control algolithm of the present invention and method by increasing attribute list and list of rules in the extension syntax parsing tree, have realized the automatic cross-platform conversion of control algolithm.The present invention can generate the target platform associated documents automatically, avoids the trouble of artificial conversion.And the present invention can generate different file layouts by the different format convention of input, automatically generates multiple file layout, automatically finishes the upgrading of algoritic module.
Description of drawings
Fig. 1 is the structural representation of existing POU document.
Fig. 2 is the synoptic diagram of the cross-platform converting system embodiment of control algolithm of the present invention.
Fig. 3 is the synoptic diagram of extension syntax node in the extension syntax parsing tree.
Fig. 4 is lexical analysis process synoptic diagram.
Fig. 5 is the synoptic diagram that mark stream is processed the extension syntax node of gained among Fig. 4.
Fig. 6 is the target program synoptic diagram of conversion gained.
Embodiment
Understand for technical characterictic of the present invention, purpose and effect being had more clearly, now contrast accompanying drawing and describe the specific embodiment of the present invention in detail.
The cross-platform converting system of control algolithm of the present invention and method, actual is the process of an algorithm description language identification and conversion.This transfer process has taken into full account the needs that multiple document format is changed simultaneously, has creationaryly proposed the method that multiple document format is changed simultaneously.
As shown in Figure 2, be the synoptic diagram of the cross-platform converting system embodiment of control algolithm of the present invention.This system is used for the control algolithm of source platform is converted to the algorithm of carrying out at target platform, specifically comprises resolver 21 and converter 22.
Resolver 21 is used for the source control algolithm is converted to the extension syntax parsing tree, and wherein the extension syntax parsing tree is to form a K fork tree by the child node tabulation.In above-mentioned extension syntax parsing tree, comprise the extension syntax node, a syntax rule in the control algolithm of the corresponding source of each extension syntax node, each extension syntax node comprises attribute list, format convention tabulation, action sequence.As shown in Figure 3, be the synoptic diagram of extension syntax node in the extension syntax parsing tree.
Attribute list includes one group of attribute, and every attribute kit contains two aspects: attribute-name and property value.Property value can be common string value, common object, also can be extension syntax object (node) or a list object that comprises string value or extension syntax object.Attribute record the information of algorithm description language, such as the type of statement object in the declarative statement, name etc.Article one, all properties in the syntax rule all is kept in the attribute list.
Include one group of formal definition in the format convention tabulation.Defined the rule of form in the form, such as, how the information that has defined in the object assertion format in the extension syntax object changes into the content that object is stated.Form equally also includes form name and format value.Format value is a character string that includes placeholder, and placeholder uses the mode of escape to quote attribute-name or attribute list.Placeholder has four kinds of form of Definitions:
Escape character-attribute-name X: the property value of getting attribute attribute-name X by name.When this mode generally is character string constant or other non-EAST objects for property value.
Escape character-attribute-name X[i]: the property value of getting i the attribute of attribute attribute-name X by name.When this mode generally is constant tabulation or other non-EAST list objects for property value.
Escape character-attribute-name X[i]. field name: with top similar, still can directly get the field value in the object.
Escape character-attribute-name X[i]-the form name: when property value is the EST object, just use this kind form.Specify simultaneously sub-syntax rule object and corresponding form name, return in this object therewith conversion value corresponding to form.
In addition, also include the labels such as condition and circulation in the formal definition so that format conversion is controlled.
Action sequence is serial of methods, has wherein comprised method, the method that sets property of resolving the format convention tabulation, the method for obtaining transformation result.Action is one section code, is used for setting property or generating relevant information.Action need to be read corresponding configuration information, with the content that determines to set property.
Converter 22 is used for according to the format convention of format convention tabulation described extension syntax parsing tree being converted to file destination.Converter 22 obtains the transformation result that needs by an extension syntax node object and a wiht strip-lattice type rule.Generally speaking, the extension syntax node of input all is the root node of syntax tree.And the format convention of input is the format convention relevant with this node.Fairly simple main attribute, circulation label and the condition label etc. that need in the identification transformation rule of the process of conversion, and with the placeholder in the value replacement transformation rule of reality.In converter, input different rule names, then can change out on request the content of different file layouts.And in transfer process, only need to revise the content of formatted file, just can reach the purpose of the form of modify target file.
In said system, resolver 21 comprises lexical analyzer and syntax analyzer, and wherein lexical analyzer is used for the control algolithm text resolution of input is become mark stream, and each lexical analyzer is corresponding with a kind of algorithm description language; Syntax analyzer is used for resolving the mark stream of lexical analyzer output and creating the extension syntax parsing tree, the extension syntax node that is simultaneously the extension syntax parsing tree generates attribute list, format convention tabulation, action sequence, and each syntax analyzer is corresponding with a kind of algorithm description language.
The present invention also provides a kind of control algolithm cross-platform conversion method, and the method mainly comprises two large step front-end processing and back-end processing.Wherein front-end processing is used for the source control algolithm is converted to the extension syntax parsing tree, this extension syntax parsing tree comprises the extension syntax node, a syntax rule in the control algolithm of the corresponding source of each extension syntax node, each described extension syntax node comprises attribute list, format convention tabulation, action sequence, and described format convention tabulation comprises the format convention of file destination; Back-end processing is used for according to the format convention of format convention tabulation the extension syntax parsing tree being converted to file destination.
Particularly, front-end processing is used for the conversion that realization source control algolithm is converted to the extension syntax parsing tree.This front-end processing includes two important steps: lexical analysis and grammatical analysis.
Lexical analysis is used for source program is resolved into one by one mark sequence, as shown in Figure 4.The lexical analysis process realizes that by lexical analyzer this lexical analyzer makes up by the morphological rule in the algorithm description language of analysis source.Lexical analyzer is relevant with algorithm description language, generally speaking the corresponding lexical analyzer of a kind of algorithm description language.The lexical analyzer of each algorithm description language only need make up once.
Grammatical analysis is used for making up the extension syntax parsing tree, and it is realized by syntax analyzer.Syntax analyzer is relevant with algorithm description language, generally speaking the corresponding syntax analyzer of a kind of algorithm description language.The syntax analyzer of each algorithm description language only need to make up once.Syntax analyzer all can make up corresponding extension syntax node and corresponding list of attribute values, format convention tabulation and action lists are set in the process of resolving each bar syntax rule.The interrelated formation tree of these nodes.Can comprise one or more sub-rule in every syntax rule, sub-rule can circulate.Rule name is unique not reproducible.
Each bar syntax rule in the source language has unique grammer title, and corresponding one by one with a kind of extension syntax node.Attribute list in the extension syntax node needs define separately for each extension syntax node, and the form that comprises which attribute, various property values such as the needs definition (is common object, or string value, or the extension syntax object; Single object or list object etc.).In addition, the format convention of file destination also needs separately definition, and is stored in the format text file.The format convention name must be associated with the syntax rule name in the file destination, belongs to which bar syntax rule to distinguish this format convention.Quote property value by placeholder in the format convention.
The process that makes up the extension syntax parsing tree in the resolving and set property is as follows: newly-built extension syntax node according to all and the corresponding format convention of this rule in the syntax rule name find formatting text, and adds it in format convention tabulation; Carry out syntax rule identification child node is set simultaneously; Set property (being arranged on before the syntax rule identification of property value, among or afterwards can, property value can be the tabulation of constant or object (comprising the extension syntax object) or constant object); Then utilize lexical analyzer and syntax analyzer to make up extension syntax parsing tree tree: at first to utilize lexical analyzer that the control algolithm text of input is carried out lexical analysis, the text segmentation of input is become one by one mark, the recycling syntax analyzer mates these marks, after the coupling, generated one whole extension syntax parsing tree tree.
For example, suppose to exist a kind of E Language, morphology and the syntactic information of E language following (for the sake of simplicity, the definition of E language and imperfect):
The definition of E language morphology:
Symbol :+,-, * ,/; :=
Key word: CALL, INT, IF, THEN, ENDIF
ID=[a-z][a-z]*
NUM=[1-9][0-9]*
The definition of E language syntax:
PROGRAM:statment,statment*
statment:if_stat?|ass_stat
if_stat:IF?expression?THEN?statement?ENDIF;
expression:Factor?exp_op?Factor
exp_op:>|<|=
ass_stat:ID:=Factor;
Factor:NUM|ID
Secondly, the lexical analyzer of E language is with the text resolution one-tenth mark one by one of input, as shown in Figure 4.Syntax analyzer is set up the extension syntax parsing tree by resolving the mark stream of input, and as shown in Figure 5, this tree is made of different extension syntax nodes.With regard to the E language, include PROGRAM, statement, expression, if_stat, ass_stat, Factor, exp_op node.When making up the extension syntax parsing tree, syntax analyzer need to set property.And the tabulation of following format convention is set:
PROGRAM:{stat[..]}
Statement:{Statment?Value}
If_stat:if({exp})\{{StatementValue}\}
Ass_stat:{factor?Value[0]}={factorValue[1]};
exp_op:{expValue}
Factor:{factorValue}
Exp:{factorValue[0]}{exp_opValue}{factorValue[1]}
Back-end processing is converted to file destination with extension syntax parsing tree root node and a wiht strip-lattice type rule name of input.Back-end processing is changed by this root node, includes equally format convention in the root node, the different file layout of the corresponding generation of different format conventions.In the back-end processing process, input different rule names, then can change out on request the content of different file layouts.And, in transfer process, only need to revise the content of formatted file, just can reach the purpose of the form of modify target file.This process is automatically performed by machine fully, and machine is by reading the conversion of the automatic completion code of content in parse tree and the form rule.
Back-end processing specifically may further comprise the steps:
Content in step 1, the assay format rule is distinguished wherein format text, placeholder condition circulation label, and it is stored among the tabulation L, and arranging as a result, character string R is sky.
If step 2 L is empty, then enter step 5.Otherwise read first element I among the L.
Step 3, process by the content that reads:
If I is format text, the end of then directly adding content of text to R.
If I is condition cycle control label, then according to conditional content getattr value and the end of adding R to.Or according to cycling condition circulation getattr value and the end of adding R to.
If I is placeholder, and the form of placeholder is escape character-attribute-name X.The direct property value in the reading attributes tabulation and add it end of R to then.
If I is placeholder, and the form of placeholder is escape character-attribute-name X[i].Property value X during then directly reading attributes is tabulated, and with i end that property value adds R among the X.
If I is placeholder, and the form of placeholder is escape character-attribute-name X[i]. field name.The direct property value X in the reading attributes tabulation then, and the end of adding the field value of i property value among the X to R.
If I is placeholder, and the form of placeholder is escape character-attribute-name X[i]-form name M.Property value X during then directly reading attributes is tabulated, and read i property value K among the X, K is the extension syntax node.This step of recursive call, and the root node of input is arranged to K, and format convention is arranged to M.The result of recursive call is added to the end of R.
Step 4, from the tabulation the deletion first element, return step 2.
Step 5, return string R.Return string R is file destination.
As shown in Figure 6, be the target program that obtains according to above-mentioned flow process conversion.
The above is described embodiments of the invention by reference to the accompanying drawings; but the present invention is not limited to above-mentioned embodiment; above-mentioned embodiment only is schematic; rather than restrictive; those of ordinary skill in the art is under enlightenment of the present invention; not breaking away from the scope situation that aim of the present invention and claim protect, also can make a lot of forms, these all belong within the protection of the present invention.

Claims (10)

1. the cross-platform converting system of control algolithm is used for the control algolithm of source platform is converted to the algorithm of carrying out at target platform, it is characterized in that, comprising:
Resolver, be used for the source control algolithm is converted to the extension syntax parsing tree, described extension syntax parsing tree comprises the extension syntax node, a syntax rule in each the corresponding source of described extension syntax node control algolithm, each described extension syntax node comprises attribute list, format convention tabulation, action sequence, and described format convention tabulation comprises the format convention of file destination;
Converter is used for according to the format convention of format convention tabulation described extension syntax parsing tree being converted to file destination.
2. the cross-platform converting system of control algolithm according to claim 1 is characterized in that, described resolver comprises:
Lexical analyzer is used for the control algolithm text resolution of input is become mark stream, and each lexical analyzer is corresponding with a kind of algorithm description language;
Syntax analyzer, be used for resolving the mark stream of lexical analyzer output and creating the extension syntax parsing tree, the extension syntax node that is simultaneously the extension syntax parsing tree generates attribute list, format convention tabulation, action sequence, and each syntax analyzer is corresponding with a kind of algorithm description language.
3. the cross-platform converting system of control algolithm according to claim 1 and 2 is characterized in that, described attribute list comprises one group of attribute, and each attribute comprises attribute-name and property value, and wherein property value is character string, object or tabulation; Format convention in the described format convention tabulation comprises form name and format value, and wherein the form name is associated with the syntax rule name, and format value is a character string that includes placeholder, and placeholder uses the mode of escape to quote attribute-name or attribute list.
4. the cross-platform conversion method of control algolithm is used for the control algolithm of source platform is converted to the algorithm of carrying out at target platform, it is characterized in that, may further comprise the steps:
(a) the source control algolithm is converted to the extension syntax parsing tree, described extension syntax parsing tree comprises the extension syntax node, a syntax rule in each the corresponding source of described extension syntax node control algolithm, each described extension syntax node comprises attribute list, format convention tabulation, action sequence, and described format convention tabulation comprises the format convention of file destination;
(b) according to the format convention in the format convention tabulation described extension syntax parsing tree is converted to file destination.
5. the cross-platform conversion method of control algolithm according to claim 4 is characterized in that, described step (a) comprising:
(a1) by lexical analyzer the control algolithm text resolution of inputting is become mark stream, each lexical analyzer is corresponding with a kind of algorithm description language;
(a2) resolve the mark stream of lexical analyzer output and create the extension syntax parsing tree by syntax analyzer, the extension syntax node that is simultaneously the extension syntax parsing tree generates attribute list, format convention tabulation, action sequence, and each syntax analyzer is corresponding with a kind of algorithm description language.
6. the cross-platform conversion method of control algolithm according to claim 5, it is characterized in that, when creating the format convention tabulation, comprise in the described step (a2): all and the corresponding format convention of this syntax rule in according to syntax rule name find formatting text, and with in its adding format convention tabulation, described format text file is corresponding with the target platform algorithm.
7. the cross-platform conversion method of control algolithm according to claim 4 is characterized in that, described attribute list comprises one group of attribute, and each attribute comprises attribute-name and property value, and wherein property value is character string, object or tabulation.
8. the cross-platform conversion method of control algolithm according to claim 7, it is characterized in that, format convention in the described format convention tabulation comprises form name and format value, wherein the form name is associated with the syntax rule name, format value is a character string that includes placeholder, and placeholder uses the mode of escape to quote attribute-name or attribute list.
9. the cross-platform conversion method of control algolithm according to claim 8 is characterized in that, described placeholder comprises following four kinds of form of Definitions:
Escape character-attribute-name X: the property value of getting attribute attribute-name X by name;
Escape character-attribute-name X[i]: the property value of getting i the attribute of attribute attribute-name X by name;
Escape character-attribute-name X[i]. field name: the field value of getting specific fields in the property value of i attribute of attribute attribute-name X by name;
Escape character-attribute-name X[i]-the form name: the format value of when property value is the extension syntax node, getting specific format rule in the property value of i attribute of attribute attribute-name X by name, and specify sub-syntax rule object and corresponding form name, return in this object therewith conversion value corresponding to form.
10. the cross-platform conversion method of control algolithm according to claim 9 is characterized in that, described step (b) comprising:
(b1) content in the assay format rule and it is stored among the tabulation L arranges as a result character string R for empty;
(b2) if tabulation L be sky, then enter (b5), otherwise first element I among the L that reads to tabulate;
(b3) process by the content that reads: if element I is format text, then directly add content of text to the as a result end of character string R; If element I is condition cycle control label, then according to conditional content getattr value and add the as a result end of character string R to, or according to cycling condition circulation getattr value and add the as a result end of character string R to; If element I is placeholder, and the form of placeholder is escape character-attribute-name X, then the direct property value in the reading attributes tabulation and add it to as a result end of character string R; If element I is placeholder, and the form of placeholder is escape character-attribute-name X[i], the property value X during then directly reading attributes is tabulated, and with i end that property value adds R among the X; If element I is placeholder, and the form of placeholder is escape character-attribute-name X[i]. field name, the direct property value X in the reading attributes tabulation then, and add the field value of i property value among the X to the as a result end of character string R; If element I is placeholder, and the form of placeholder is escape character-attribute-name X[i]-form name M, property value X during then directly reading attributes is tabulated, and read i property value K among the X, K is extension syntax node node, this step of recursive call, and with the input root node be arranged to K, and format convention is arranged to M, adds the result of recursive call to the as a result end of character string R;
(b4) first element of deletion I from tabulation returns (b2);
(b5) return results character string R.
CN201110234800.6A 2011-08-16 2011-08-16 System and method for cross-platform conversion of control algorithms Active CN102937910B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110234800.6A CN102937910B (en) 2011-08-16 2011-08-16 System and method for cross-platform conversion of control algorithms

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110234800.6A CN102937910B (en) 2011-08-16 2011-08-16 System and method for cross-platform conversion of control algorithms

Publications (2)

Publication Number Publication Date
CN102937910A true CN102937910A (en) 2013-02-20
CN102937910B CN102937910B (en) 2015-06-10

Family

ID=47696809

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110234800.6A Active CN102937910B (en) 2011-08-16 2011-08-16 System and method for cross-platform conversion of control algorithms

Country Status (1)

Country Link
CN (1) CN102937910B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631632A (en) * 2013-11-29 2014-03-12 华为技术有限公司 Transplantation method and source to source compiler
CN106843878A (en) * 2017-01-20 2017-06-13 武汉斗鱼网络科技有限公司 A kind of model generating method and system
CN109710260A (en) * 2018-11-16 2019-05-03 青岛特锐德电气股份有限公司 It is a kind of based on multi-platform applet code converting system and conversion method
CN110442330A (en) * 2019-07-05 2019-11-12 五八有限公司 List element conversion method, device, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5768564A (en) * 1994-10-07 1998-06-16 Tandem Computers Incorporated Method and apparatus for translating source code from one high-level computer language to another
CN101369234A (en) * 2008-06-24 2009-02-18 杭州电子科技大学 Method for compiling ladder diagram language into instruction list language according to IEC61131-3 standard
CN101499015A (en) * 2009-03-18 2009-08-05 北京和利时系统工程有限公司 Method and converter for converting high level language to other high level languages
CN101587445A (en) * 2009-06-19 2009-11-25 国网电力科学研究院 PLC compiling implement method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631632A (en) * 2013-11-29 2014-03-12 华为技术有限公司 Transplantation method and source to source compiler
CN103631632B (en) * 2013-11-29 2017-08-04 华为技术有限公司 Implantation method and source-to-source compiler
CN106843878A (en) * 2017-01-20 2017-06-13 武汉斗鱼网络科技有限公司 A kind of model generating method and system
CN106843878B (en) * 2017-01-20 2019-10-25 武汉斗鱼网络科技有限公司 A kind of model generating method and system
CN109710260A (en) * 2018-11-16 2019-05-03 青岛特锐德电气股份有限公司 It is a kind of based on multi-platform applet code converting system and conversion method
CN109710260B (en) * 2018-11-16 2022-03-08 青岛特来电新能源科技有限公司 Multi-platform-based applet code conversion method
CN110442330A (en) * 2019-07-05 2019-11-12 五八有限公司 List element conversion method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN102937910B (en) 2015-06-10

Similar Documents

Publication Publication Date Title
CN110196719B (en) Business rule generation method and system based on natural language processing
WO2017016179A1 (en) International multi-language implementation method of configuration software
US20080244541A1 (en) Code translator and method of automatically translating modeling language code to hardware language code
CN102508654B (en) Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller)
CN104598635A (en) Automatic complex document generating method based on XML (Extensive Markup Language) description
CN106598581A (en) ASTERIX message parsing code generation method based on XML
CN113778449B (en) Avionic interface data adaptation conversion system
CN102937910B (en) System and method for cross-platform conversion of control algorithms
CN106951305A (en) It is a kind of based on method of the model conversion by QVT R language generation midCore scripts
CN107291522A (en) A kind of compiling optimization method and system towards custom rule file
US20020026632A1 (en) Universal computer code generator
CN106681727B (en) Modelica external function graphical editing system and implementation method thereof
CN113655996B (en) Enterprise-level system generation method based on demand model
CN103793458B (en) Method for nondestructively converting AADL (architecture analysis and design language) into XML (extensible markup language)
CN116126304B (en) XML-based extended Lustre code generation method
CN112506488A (en) Method for generating programming language class based on sql creating statement
CN103970776A (en) Method and system for creating CAN hierarchy tree
CN101201750A (en) Method of providing data for encoding/decoding using syntax lexical analysis tool
Younis et al. UML-based approach for the re-engineering of PLC programs
CN104598636A (en) Complex document separating and organizing method and complex document automatic generating method
CN110554860B (en) Construction method and code generation method of software project natural language programming interface (NLI)
Runde et al. EDDL and semantic web—From field device integration (FDI) to Future Device Management (FDM)
CN112905450A (en) Automatic development system of chip register based on template variable replacement
CN112199626A (en) Dynamic form generation method based on DSL layout engine
WO2008075087A1 (en) Code translator and method of automatically translating modelling language code to hardware language code

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