CN106933566A - Graphic configuration language transfer method and device - Google Patents

Graphic configuration language transfer method and device Download PDF

Info

Publication number
CN106933566A
CN106933566A CN201710060383.5A CN201710060383A CN106933566A CN 106933566 A CN106933566 A CN 106933566A CN 201710060383 A CN201710060383 A CN 201710060383A CN 106933566 A CN106933566 A CN 106933566A
Authority
CN
China
Prior art keywords
graphic configuration
language
graphic
configuration
linguistic level
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.)
Pending
Application number
CN201710060383.5A
Other languages
Chinese (zh)
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.)
China General Nuclear Power Corp
China Techenergy Co Ltd
Original Assignee
China General Nuclear Power Corp
China Techenergy 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 China General Nuclear Power Corp, China Techenergy Co Ltd filed Critical China General Nuclear Power Corp
Priority to CN201710060383.5A priority Critical patent/CN106933566A/en
Publication of CN106933566A publication Critical patent/CN106933566A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The embodiment of the present invention provides a kind of graphic configuration language transfer method and device.Methods described includes:Obtain graphic configuration original language, graphic configuration original language includes the information of M graphic configuration object, and the relation between M graphic configuration object information;Information according to the relation between M graphic configuration object determines the hierarchical relationship between M graphic configuration object;According to hierarchical relationship, corresponding N number of graphic configuration linguistic level and the corresponding graphic configuration object of each graphic configuration linguistic level are determined successively;Self-corresponding graphic configuration object each to N number of graphic configuration linguistic level carries out language conversion successively, and carries out verification of correctness to transfer process and result;By graphic configuration source language translation it is the program code of object language according to transformation result if the transfer process and result of each graphic configuration linguistic level are by verification of correctness.In the present invention, it is ensured that the quality of Graphics Configuration System Used Code Generator correctness in itself and the code of generation.

Description

Graphic configuration language transfer method and device
Technical field
The present invention relates to technical field of data processing, more particularly to a kind of graphic configuration language transfer method and device.
Background technology
In the scattered control system (Distributed Control System, DCS) of Industry Control, graphic configuration is soft Part Code Generator is a kind of Software tool that user configuration is automatically generated code needed for the formula of being correspondingly embedded in.DCS is to figure The Performance And Reliability requirement of configuration software Code Generator is higher.Especially in nuclear power industry, to the quality requirement of software It is more strict.
In nuclear power I&C system, Graphics Configuration System Used Code Generator is that user configuration is automatically generated correspondence by one kind The Software tool of code needed for embedded.Nuclear power system to the basic demand high-performance of Graphics Configuration System Used Code Generator and High reliability, although various means of testing such as unit testing, integrated debugging are employed to Graphics Configuration System Used Code Generator But correctness is still difficult to effectively be verified Software tool in itself, and product quality deposits very big hidden danger.Particularly in nuclear power row Industry, the requirement to the quality of software is more strict, how to ensure that Graphics Configuration System Used Code Generator correctness just turns into pendulum Common problem in face of all nuclear power instrument control providers.
At present, generally ensure that Graphics Configuration System Used code is given birth to using various means of testing such as unit testing, integrated debugging Into instrument correctness in itself.
And the common embedded device Graphics Configuration System Used Code Generator of nuclear power field ensures software correctness at present Mode, simply by traditional test means ensure graphic configuration generate code quality.This just has one unavoidable to ask Topic is how to ensure SDK correctness and quality in itself, if the quality of Code Generator cannot be guaranteed It probably generates unsafe object code in conversion generation coding process.
For example, though the SCADE KCG of Ace Te Er companies of France are a codes for high safety system algorithm configuration Maker, be Industry Control DCS in common embedded device Graphics Configuration System Used Code Generator, but it ensures software The mode of correctness ensures that graphic configuration generates the quality of code simply by simulation means, and it is according to aviation DO- 178B standards and develop.
Even if however, by above-mentioned existing mode, Graphics Configuration System Used Code Generator correctness in itself and life Into the quality of code cannot be guaranteed, in China's nuclear safe level instrument control field, application needs to do substantial amounts of code verification work Make, the workload of engineering construction is very big.
The content of the invention
It is an object of the present invention to provide a kind of graphic configuration language transfer method and device, to realize by graphic configuration Original language is converted to the program code of object language, so as to ensure that Graphics Configuration System Used Code Generator correctness in itself And the quality of the code of generation.
According to an aspect of the present invention, there is provided a kind of graphic configuration language transfer method.Methods described includes:Obtain figure Configuration original language, the graphic configuration original language includes the M information of graphic configuration object, and the M graphic configuration pair The information of the relation as between;Information according to the relation between the M graphic configuration object determines the M graphic configuration Hierarchical relationship between object;According to the hierarchical relationship, corresponding N number of graphic configuration linguistic level and each figure are determined successively The corresponding graphic configuration object of shape Configuration Language layer;Successively to N number of each self-corresponding graphic configuration of graphic configuration linguistic level Object carries out language conversion, and carries out verification of correctness to transfer process and result;If each graphic configuration linguistic level Graphic configuration source language translation is then mesh according to the transformation result by the verification of correctness by transfer process and result The program code of poster speech;Wherein, M >=1, N >=1, M >=N, and M and N are integer.
Preferably, it is described according to the hierarchical relationship, corresponding N number of graphic configuration linguistic level and each figure are determined successively The corresponding graphic configuration object of shape Configuration Language layer includes:The graphic configuration pair of parent object is determined as according to the hierarchical relationship As, and as the graphic configuration object of subobjects at different levels;Set up respectively and the graphic configuration object phase as parent object The graphic configuration linguistic level answered, and N-1 graphic configuration corresponding with the graphic configuration object of the subobjects at different levels Linguistic level.
Preferably, it is described verification of correctness is carried out to transfer process and result to include:According to the M graphic configuration object Information, judge whether the corresponding graphic configuration object of each described graphic configuration linguistic level correct successively.
Preferably, it is described that language is carried out to N number of each self-corresponding graphic configuration object of graphic configuration linguistic level successively Conversion includes:Primary graphic element is carried out to N number of each self-corresponding graphic configuration object of graphic configuration linguistic level successively to tear open Point.
Preferably, described is the program code bag of object language by graphic configuration source language translation according to the transformation result Include:N number of each self-corresponding graphic configuration object of graphic configuration linguistic level is entered according to the primary graphic element that fractionation is obtained Line code is drawn, and obtains the program code of object language.
Preferably, methods described also includes:If the transfer process and result of any graphic configuration linguistic level do not pass through The verification of correctness, then prompting characterizes the first error information of transfer process and result mistake;Modification result is received, and in institute Modification result is stated by after the verification of correctness, carrying out the subsequent diagram Configuration Language of any graphic configuration linguistic level The language conversion treatment of layer.
Preferably, methods described also includes:Program code to the object language is verified;If the result is institute The program code for stating object language is correct, then export the program code of the object language.
Preferably, the object language is C language, and the program code to the object language carries out checking to be included: Judge whether the program code of C language calls the function for drawing primary graphic element;If the program code of the C language is adjusted With the function for drawing primary graphic element, then the result be the object language program code it is correct;If the C languages The program code never call of speech is used to draw the function of primary graphic element, then prompting characterizes the second of code drafting mistake and reports an error Information.
Preferably, the primary graphic element includes at least one of:Point, line segment, circle, rectangle, polygon and position Figure.
According to another aspect of the present invention, there is provided a kind of graphic configuration language converting device.Described device includes:Original language Acquisition module, for obtaining graphic configuration original language, the graphic configuration original language includes the M information of graphic configuration object, And the information of the relation between the M graphic configuration object;Relationship determination module, for according to the M graphic configuration The information of the relation between object determines the hierarchical relationship between the M graphic configuration object;Linguistic level determining module, is used for According to the hierarchical relationship, determine that corresponding N number of graphic configuration linguistic level and each graphic configuration linguistic level are corresponding successively Graphic configuration object;Language conversion and authentication module, for successively to N number of each self-corresponding figure of graphic configuration linguistic level Configuration object carries out language conversion, and carries out verification of correctness to transfer process and result;Code translation module, if for each The transfer process and result of the graphic configuration linguistic level by the verification of correctness, then will be schemed according to the transformation result The source language translation of shape configuration is the program code of object language;Wherein, M >=1, N >=1, M >=N, and M and N are integer.
Preferably, the linguistic level determining module includes:Object determining unit, for being determined to make according to the hierarchical relationship It is the graphic configuration object of parent object, and as the graphic configuration object of subobjects at different levels;Linguistic level sets up unit, for dividing Do not set up a graphic configuration linguistic level corresponding with the graphic configuration object as parent object, and with the sons at different levels The corresponding N-1 graphic configuration linguistic level of graphic configuration object of object.
Preferably, the language conversion and authentication module are used for the information according to the M graphic configuration object, sentence successively Whether the corresponding graphic configuration object of each described graphic configuration linguistic level that breaks is correct.
Preferably, the language conversion and authentication module are used to successively each correspond to N number of graphic configuration linguistic level Graphic configuration object carry out primary graphic element fractionation.
Preferably, the code translation module is used for according to splitting the primary graphic element that obtains to N number of graphical set Each self-corresponding graphic configuration object of state linguistic level enters line code drafting, obtains the program code of object language.
Preferably, described device also includes:Error information reminding module, if for any graphic configuration linguistic level Not by the verification of correctness, then prompting characterizes the first of transfer process and result mistake and reports an error letter for transfer process and result Breath;Modification result receiver module, for receiving modification result, and after the modification result is by the verification of correctness, Carry out the language conversion treatment of the subsequent diagram Configuration Language layer of any graphic configuration linguistic level.
Preferably, described device also includes:Code verification module, tests for the program code to the object language Card;Code output module, if correct for program code that the result is the object language, exports the object language Program code.
Preferably, the object language is C language, and the code verification module is used to judge that the program code of C language to be The no function called for drawing primary graphic element;If the program code call of the C language is used to draw fundamental figure unit Element function, then the result be the object language program code it is correct;If the program code never call of the C language is used In the function for drawing primary graphic element, then prompting characterizes the second error information that code draws mistake.
Preferably, the primary graphic element includes at least one of:Point, line segment, circle, rectangle, polygon and position Figure.
The graphic configuration language transfer method and device for providing according to embodiments of the present invention, by according to the figure for getting The information of the relation in configuration original language between M graphic configuration object, determines that the level between M graphic configuration object is closed System, corresponding N number of graphic configuration linguistic level and each corresponding figure of graphic configuration linguistic level are determined according to hierarchical relationship successively Shape configuration object, further self-corresponding graphic configuration object each to N number of graphic configuration linguistic level carries out language conversion successively, and Verification of correctness is carried out to transfer process and result, if the transfer process and result of each graphic configuration linguistic level are by correct Property checking, then according to transformation result by graphic configuration source language translation for object language program code, it is achieved thereby that by scheming Shape configuration original language is converted to the program code of object language.Compared with prior art, the present invention is in graphic configuration language conversion During, verification of correctness is carried out by the conversion pilot process to each graphic configuration linguistic level, and to transformation result Verification of correctness, only before the transfer process and result of each graphic configuration linguistic level is met by verification of correctness Put, it is the treatment of the program code of object language just to complete by graphic configuration source language translation.Thereby it is ensured that graphic configuration Software code Core Generator correctness in itself, and then cause that the quality of the code of generation is reliably ensured.
Advantage of the present invention:1st, code generator is in itself by Formal Verification, it is ensured that code generator sheet is in conversion Code generator correctness in itself is not interfered with coding process.2nd, the correctness of the object code obtained by conversion.Code is given birth to Grow up to be a useful person in addition to realizing basic translation function, it is ensured that code generator sheet will not be to code during transcode Original semantic is distorted.
Brief description of the drawings
Fig. 1 is the illustrative diagram of the mathematical principle for showing the embodiment of the present invention;
Fig. 2 is the illustrative diagram of the general principle for showing the embodiment of the present invention;
Fig. 3 is the flow chart of the graphic configuration language transfer method for showing according to embodiments of the present invention;
Fig. 4 is the flow chart of the graphic configuration language transfer method for showing according to embodiments of the present invention two;
Fig. 5 is the logic diagram of the graphic configuration language converting device for showing according to embodiments of the present invention three;
Fig. 6 is the logic diagram of the graphic configuration language converting device for showing according to embodiments of the present invention four.
Specific embodiment
Basic conception of the invention is to obtain graphic configuration original language, and the graphic configuration original language includes M graphic configuration The information of the relation between the information of object, and M graphic configuration object;According to the relation between M graphic configuration object The information hierarchical relationship that determines between M graphic configuration object;According to hierarchical relationship, corresponding N number of graphical set is determined successively State linguistic level and the corresponding graphic configuration object of each graphic configuration linguistic level, wherein, M >=1, N >=1, M >=N, and M and N are equal It is integer;Self-corresponding graphic configuration object each to N number of graphic configuration linguistic level carries out language conversion successively, and to transfer process And result carries out verification of correctness;If the transfer process and result of each graphic configuration linguistic level are by verification of correctness, According to transformation result by graphic configuration source language translation for object language program code, it is ensured that Graphics Configuration System Used code give birth to Into instrument correctness in itself and the quality of the code of generation.
As shown in figure 1,The program P of intermediate language is converted to the program of T intermediate languages It isIt is middle The semantic function of language,It isThe semantic function of language intermediate language.From intermediate languageTo intermediate languageSemantic holding Property refers to:
Here, sound (P) and soundMean normally to obtain(P) and
≈ is simulation equivalence relation.Mean:All environmental variances of P exist(P) There is matching object, and(P) change to environment can pass throughChange to the environment that matches carries out mould Intend.
For legal graphic configuration language GL programs, what result of evaluation was always to determine, it means that semantic computation is really Qualitative (in the situation that non-serial is semantic, what the result of different evaluation process was also to determine).Therefore, it was demonstrated that above-mentioned simulation is closed System just can be with.
Fig. 2 is the illustrative diagram of the general principle for showing the embodiment of the present invention.In order to more easily describe the present invention General principle, by five layer pattern Configuration Languages layer as a example by.In actual applications, graphic configuration linguistic level is according to graphic configuration pair Depending on hierarchical relationship between the quantity and graphic configuration object of elephant, 5 layers can be more or less than.
Reference picture 2, first, obtains graphic configuration original language;Secondly, according to multiple graphic configurations in graphic configuration original language The information of the relation between object, it is determined that the hierarchical relationship between multiple graphic configuration objects;Again, according to hierarchical relationship, according to It is secondary to determine corresponding five graphic configuration linguistic levels, that is, I layers of graphic configuration language, S layers of graphic configuration language, graphic configuration Language Q layers, R layers of graphic configuration language, T layers of graphic configuration language, and each corresponding graphic configuration of graphic configuration linguistic level Object;Language conversion is carried out to five each self-corresponding graphic configuration objects of graphic configuration linguistic level successively, after changing each time Verification of correctness is all carried out, if not by verification of correctness, error information is pointed out so that related personnel modifies, if passing through Verification of correctness, then continue next layer of conversion process, and such as graphic configuration linguistic level I layers, by verification of correctness, is just carried out The conversion process that S layers of graphic configuration language, until T layers of graphic configuration language will be schemed by verification of correctness according to transformation result Shape configuration original language is converted to lightweight C language, exports C source code.
(identical label represents identical element in some accompanying drawings) and embodiment below in conjunction with the accompanying drawings, to tool of the invention Body implementation method is described in further detail.Following examples are used to illustrate the present invention, but are not limited to the scope of the present invention.
It will be understood by those skilled in the art that the term such as " first ", " second " in the present invention to be only used for difference asynchronous Suddenly, equipment or module etc., neither represent any particular technology implication, also do not indicate that the inevitable logical order between them.
Embodiment one
Fig. 3 is the flow chart of the graphic configuration language transfer method for showing according to embodiments of the present invention.Can be in such as Fig. 5 institutes The graphic configuration language converting device for showing performs methods described.
Reference picture 3, in step S210, obtains graphic configuration original language, and graphic configuration original language includes M graphic configuration pair The information of the relation between the information of elephant, and M graphic configuration object.
It is respectively No. 1 factory building, No. 1 reactor, No. 2 reactions by taking nuclear power station as an example, it is assumed that have five graphic configuration objects Heap, and be No. 11 number word protection system and 2 number word protection systems of reactor configuration, then, graphic configuration original language In just include the information of above-mentioned five graphic configuration objects, and the relation between 5 graphic configuration objects information.
In step S220, the information according to the relation between M graphic configuration object is determined between M graphic configuration object Hierarchical relationship.
In step S230, according to hierarchical relationship, corresponding N number of graphic configuration linguistic level and each graphical set are determined successively The corresponding graphic configuration object of state linguistic level.
Wherein, M >=1, N >=1, M >=N, and M and N are integer.
Still by taking foregoing five graphic configuration objects as an example, foregoing hierarchical relationship can be that No. 1 factory building includes two reactors, It is No. 1 reactor configuration that i.e. No. 1 reactor and No. 2 reactors, 1 number word protection system and 2 number word protection systems are, because This, No. 1 reactor includes 1 number word protection system and 2 number word protection systems.
Thus, it is determined that the corresponding graphic configuration object of first graphic configuration linguistic level be No. 1 factory building, if figure There are two information of factory building in configuration original language, that is to say, that also in the presence of No. 2 factory buildings, first graphic configuration linguistic level now Corresponding graphic configuration object should be No. 1 factory building and No. 2 factory buildings.Similarly, the corresponding graphical set of second graphic configuration linguistic level The corresponding graphic configuration object of state object is exactly No. 1 reactor and No. 2 reactors, the 3rd corresponding figure of graphic configuration linguistic level The corresponding graphic configuration object of shape configuration object is exactly 1 number word protection system and 2 number word protection systems.If graphic configuration source Language includes the information of more graphic configuration objects, can refer to the mode of foregoing determination graphic configuration linguistic level, by that analogy, Will not be described here.
In step S240, self-corresponding graphic configuration object each to N number of graphic configuration linguistic level carries out language conversion successively, And verification of correctness is carried out to transfer process and result.
Specifically, fundamental figure unit can be carried out by self-corresponding graphic configuration object each to N number of graphic configuration linguistic level successively Element splits.Here, primary graphic element may include at least one of:Point, line segment, circle, rectangle, polygon and bitmap, but Not limited to this.Such as, edit box pel in graphic configuration language is converted into primary graphic element line segment or rectangle, and will be right Primary graphic element is answered to store in abstract syntax tree node, for another example, by the middle-and-high-ranking primitive types trend of graphic configuration language Curve transform is primary graphic element point or line segment, and correspondence primary graphic element is stored in abstract syntax tree node, For example, the middle-and-high-ranking pel window type of graphic configuration language is converted into primary graphic element line segment and rectangle, and will correspondence base This graphic element is stored in abstract syntax tree node.
Meanwhile, above-mentioned verification of correctness is exactly the checking to the pilot process changed, and the checking to transformation result, with This ensures graphic configuration Code Generator quality in itself.Specifically, according to the M information of graphic configuration object, sentence successively Whether the corresponding graphic configuration object of each graphic configuration linguistic level that breaks is correct.For example, if it is determined that first graphic configuration The corresponding graphic configuration object of linguistic level is in addition to No. 1 factory building, wherein have also appeared No. 2 reactors, then obviously determine First graphic configuration linguistic level is incorrect.
In step S250, if the transfer process and result of each graphic configuration linguistic level are by verification of correctness, root According to transformation result by graphic configuration source language translation for object language program code.
Specifically, according to splitting the primary graphic element that obtains to each self-corresponding graphical set of N number of graphic configuration linguistic level State object enters line code drafting, obtains the program code of object language.
In actual applications, by taking C language as an example, the purpose of this step wherein primary graphic element will exactly be partially converted to The function call mode of lightweight C language, will be related to the part of variable according to the category conversion of assignment operation:Structure and array Assignment be converted into gcg_memcpy function calls;Common assignment is converted into assign assignment statements.
Graphic configuration language transfer method provided in an embodiment of the present invention, by according to the graphic configuration original language for getting The information of the relation between middle M graphic configuration object, determines the hierarchical relationship between M graphic configuration object, according to level Relation determines corresponding N number of graphic configuration linguistic level and the corresponding graphic configuration object of each graphic configuration linguistic level successively, Further self-corresponding graphic configuration object each to N number of graphic configuration linguistic level carries out language conversion successively, and to transfer process And result carries out verification of correctness, if the transfer process and result of each graphic configuration linguistic level are by verification of correctness, According to transformation result by the program code that graphic configuration source language translation is object language, realize and turned by graphic configuration original language The program code of object language is changed to, so as to ensure that Graphics Configuration System Used Code Generator correctness in itself and generation Code quality.
Embodiment two
Fig. 4 is the flow chart of the graphic configuration language transfer method for showing according to embodiments of the present invention two, the embodiment Can be considered another concrete implementation scheme of Fig. 2.The side can be performed in graphic configuration language converting device as shown in Figure 5 Method.
Reference picture 4, in step S301, obtains graphic configuration original language, and graphic configuration original language includes M graphic configuration pair The information of the relation between the information of elephant, and M graphic configuration object.
Wherein, content is identical the step of step S210 with above-described embodiment one for the step of above-mentioned steps S301 contents, This is repeated no more.
In step S302, the information according to the relation between M graphic configuration object is determined between M graphic configuration object Hierarchical relationship.
Wherein, content is identical the step of step S220 with above-described embodiment one for the step of above-mentioned steps S302 contents, This is repeated no more.
In step S303, the graphic configuration object of parent object is determined as according to hierarchical relationship, and it is right as sons at different levels The graphic configuration object of elephant.
For example, No. 1 reactor and No. 2 reactors that example goes out in embodiment one belong to No. 1 next floor of factory building, by This, No. 1 factory building can be described as parent object, and correspondingly, No. 1 reactor and No. 2 reactors can be described as first order subobject.Similarly, No. 1 Numerical protection system and 2 number word protection systems belong to No. 1 next floor of reactor, thus, 1 number word protection system and No. 2 Numerical protection system can be described as second level subobject.For the foundation of graphic configuration linguistic level in subsequent step provides foundation.
In step S304, a graphic configuration language corresponding with the graphic configuration object as parent object is set up respectively Layer, and N-1 graphic configuration linguistic level corresponding with the graphic configuration object of subobjects at different levels.
Still by taking foregoing factory building, reactor and digital protection system as an example, by the treatment of step S303, can set up and No. 1 The corresponding graphic configuration linguistic level of factory building, sets up a graphic configuration language corresponding with No. 1 reactor and No. 2 reactors Layer, and a graphic configuration linguistic level corresponding with 1 number word protection system and 2 number word protection systems.It can be seen that, what has Object (parent object is designated as one-level) just sets up several layers of graphic configuration linguistic levels.
In step S305, self-corresponding graphic configuration object each to N number of graphic configuration linguistic level carries out fundamental figure successively Element splits, and according to the M information of graphic configuration object, each corresponding graphic configuration of graphic configuration linguistic level is judged successively Whether object is correct.
Here, primary graphic element may include at least one of:Point, line segment, circle, rectangle, polygon and bitmap, but Not limited to this.
In step S306, if the transfer process and result of any graphic configuration linguistic level are carried not by verification of correctness Show the first error information for characterizing transfer process and result mistake.
In step S307, modification result is received, and after modification result is by verification of correctness, carry out any graphical set The language conversion treatment of the subsequent diagram Configuration Language layer of state linguistic level.
In step S308, if the transfer process and result of each graphic configuration linguistic level are by verification of correctness, root The primary graphic element self-corresponding graphic configuration object each to N number of graphic configuration linguistic level obtained according to fractionation enters line code and paints System, obtains the program code of object language.
In step S309, the program code to object language is verified.
It should be noted that object language can be C language, but not limited to this.Correspondingly, according to exemplary reality of the invention Example is applied, step S309 can include:Judge whether the program code of C language calls the function for drawing primary graphic element; If the program code call of C language is used to draw the function of primary graphic element, the result is the program generation of object language Code is correct;If the program code never call of C language is used to draw the function of primary graphic element, point out to characterize code drafting mistake The second error information by mistake.
In actual applications, after the second error information of prompting, it is also possible to receive modification result, and pass through journey in modification result After the checking of sequence code, the program code of object language is exported.
In step S310, if the result is correct for the program code of object language, the program generation of object language is exported Code.
Graphic configuration language transfer method provided in an embodiment of the present invention, with following technique effect:
On the one hand, to be determined according to hierarchical relationship as parent object and the graphic configuration object of subobject at different levels It is foundation so that the graphic configuration linguistic level of foundation is more accurate;
On the other hand, by carrying out fundamental figure unit to each self-corresponding graphic configuration object of N number of graphic configuration linguistic level Element splits, and is entered according to the primary graphic element self-corresponding graphic configuration object each to N number of graphic configuration linguistic level that fractionation is obtained Line code is drawn, meanwhile, the program code to object language is verified, so as to ensure that the quality of program code;
Another further aspect, in the present embodiment, does not pass through correct in the transfer process and result of any graphic configuration linguistic level Property checking, point out error information so that related personnel modifies, only proceed subsequent diagram configuration after repairing correction really The language conversion treatment of linguistic level, further ensures Graphics Configuration System Used Code Generator correctness in itself and generation Code quality.
Embodiment three
Based on identical technology design, Fig. 5 be show according to embodiments of the present invention three graphic configuration language converting device Logic diagram.May be used to perform the graphic configuration language transfer method flow as described in embodiment one.
Reference picture 5, the graphic configuration language converting device include original language acquisition module 410, relationship determination module 420, Linguistic level determining module 430, language conversion and authentication module 440 and code translation module 450.
Original language acquisition module 410 is used to obtain graphic configuration original language, and graphic configuration original language includes M graphic configuration The information of the relation between the information of object, and M graphic configuration object.
Relationship determination module 420 is used to determine M graphic configuration according to the information of the relation between M graphic configuration object Hierarchical relationship between object.
Linguistic level determining module 430 be used for according to hierarchical relationship, determine successively corresponding N number of graphic configuration linguistic level and The corresponding graphic configuration object of each graphic configuration linguistic level.
Language conversion and authentication module 440 are used for successively to each self-corresponding graphic configuration pair of N number of graphic configuration linguistic level As carrying out language conversion, and verification of correctness is carried out to transfer process and result.
If transfer process and result that code translation module 450 is used for each graphic configuration linguistic level are tested by correctness Card, then according to transformation result by graphic configuration source language translation for object language program code.
Wherein, M >=1, N >=1, M >=N, and M and N are integer.
Graphic configuration language converting device provided in an embodiment of the present invention, by according to the graphic configuration original language for getting The information of the relation between middle M graphic configuration object, determines the hierarchical relationship between M graphic configuration object, according to level Relation determines corresponding N number of graphic configuration linguistic level and the corresponding graphic configuration object of each graphic configuration linguistic level successively, Further self-corresponding graphic configuration object each to N number of graphic configuration linguistic level carries out language conversion successively, and to transfer process And result carries out verification of correctness, if the transfer process and result of each graphic configuration linguistic level are by verification of correctness, According to transformation result by the program code that graphic configuration source language translation is object language, realize and turned by graphic configuration original language The program code of object language is changed to, so as to ensure that Graphics Configuration System Used Code Generator correctness in itself and generation Code quality.
Example IV
Based on identical technology design, Fig. 6 be show according to embodiments of the present invention four graphic configuration language converting device Logic diagram.May be used to perform the graphic configuration language transfer method flow as described in embodiment two.
Reference picture 6, linguistic level determining module 430 may particularly include:
Object determining unit 4301 is used to be determined as according to hierarchical relationship the graphic configuration object of parent object, and conduct The graphic configuration object of subobjects at different levels.
Linguistic level sets up unit 4302 for setting up a figure corresponding with the graphic configuration object as parent object respectively Shape Configuration Language layer, and N-1 graphic configuration linguistic level corresponding with the graphic configuration object of subobjects at different levels.
Preferably, language conversion and authentication module 440 can be used to, according to the M information of graphic configuration object, judge successively Whether the corresponding graphic configuration object of each graphic configuration linguistic level is correct.
Further, language conversion and authentication module 440 can be used for each self-corresponding to N number of graphic configuration linguistic level successively Graphic configuration object carries out primary graphic element fractionation.
Here, primary graphic element may include at least one of:Point, line segment, circle, rectangle, polygon and bitmap, but Not limited to this.
Preferably, code translation module 450 can be used for according to splitting the primary graphic element that obtains to N number of graphic configuration language Speech each self-corresponding graphic configuration object of layer enters line code drafting, obtains the program code of object language.
Further, the graphic configuration language converting device can also include:
If error information reminding module 460 is used for the transfer process and result of any graphic configuration linguistic level not by correct Property checking, then prompting characterizes the first error information of transfer process and result mistake.
Modification result receiver module 470 is used to receive modification result, and after modification result is by verification of correctness, enters The language conversion treatment of the subsequent diagram Configuration Language layer of any graphic configuration linguistic level of row.
Further, the graphic configuration language converting device can also include:
Code verification module 480 is used to verify the program code of object language;
If code output module 490 is used for the result for the program code of object language is correct, object language is exported Program code.
The object language concretely C language, correspondingly, code verification module 480 can be used to judge the program generation of C language Whether code calls the function for drawing primary graphic element;If the program code call of C language is used to draw fundamental figure unit Element function, then the result for object language program code it is correct;If the program code never call of C language is used to draw base The function of this graphic element, then prompting characterizes the second error information that code draws mistake.
Graphic configuration language converting device provided in an embodiment of the present invention, with following technique effect:
First, be using the graphic configuration object as parent object and subobject at different levels determined according to hierarchical relationship Foundation so that the graphic configuration linguistic level of foundation is more accurate;
Second, torn open by carrying out primary graphic element to each self-corresponding graphic configuration object of N number of graphic configuration linguistic level Point, in generation, is carried out according to the primary graphic element self-corresponding graphic configuration object each to N number of graphic configuration linguistic level that fractionation is obtained Code is drawn, meanwhile, the program code to object language is verified, so as to ensure that the quality of program code;
3rd, in the present embodiment, do not tested by correctness in the transfer process and result of any graphic configuration linguistic level Card, points out error information so that related personnel modifies, and only proceeds subsequent diagram Configuration Language after repairing correction really The language conversion treatment of layer, further ensures the generation of Graphics Configuration System Used Code Generator correctness in itself and generation The quality of code.
It may be noted that the need for according to implementation, each step/part described in this application can be split as into more multistep Suddenly/part, also can be combined into new step/part by the part operation of two or more step/parts or step/part, To realize the purpose of the present invention.
Above-mentioned the method according to the invention can be realized in hardware, firmware, or be implemented as being storable in recording medium Software or computer code in (such as CD ROM, RAM, floppy disk, hard disk or magneto-optic disk), or it is implemented through network download Original storage in long-range recording medium or nonvolatile machine readable media and by the meter in being stored in local recording medium Calculation machine code, so that method described here can be stored in uses all-purpose computer, application specific processor or programmable or special With the such software processing in the recording medium of hardware (such as ASIC or FPGA).It is appreciated that computer, processor, micro- Processor controller or programmable hardware include storing receive software or the storage assembly of computer code (for example, RAM, ROM, flash memory etc.), when the software or computer code are by computer, processor or hardware access and execution, realize herein The processing method of description.Additionally, when all-purpose computer accesses the code for the treatment for realizing being shown in which, the execution of code All-purpose computer is converted into the special-purpose computer for performing the treatment being shown in which.
The above, specific embodiment only of the invention, but protection scope of the present invention is not limited thereto, and it is any Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all contain Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (18)

1. a kind of graphic configuration language transfer method, it is characterised in that methods described includes:
Graphic configuration original language is obtained, the graphic configuration original language includes the M information of graphic configuration object, and the M The information of the relation between individual graphic configuration object;
Information according to the relation between the M graphic configuration object determines the level between the M graphic configuration object Relation;
According to the hierarchical relationship, corresponding N number of graphic configuration linguistic level and each graphic configuration linguistic level pair are determined successively The graphic configuration object answered;
Language conversion is carried out to N number of each self-corresponding graphic configuration object of graphic configuration linguistic level successively, and to converted Journey and result carry out verification of correctness;
If the transfer process and result of each graphic configuration linguistic level by the verification of correctness, turn according to described It is the program code of object language that result is changed by graphic configuration source language translation;
Wherein, M >=1, N >=1, M >=N, and M and N are integer.
2. method according to claim 1, it is characterised in that described according to the hierarchical relationship, determines corresponding N successively Individual graphic configuration linguistic level and the corresponding graphic configuration object of each graphic configuration linguistic level include:
The graphic configuration object of parent object is determined as according to the hierarchical relationship, and as the graphic configuration of subobjects at different levels Object;
Set up a graphic configuration linguistic level corresponding with the graphic configuration object as parent object respectively, and with it is described The corresponding N-1 graphic configuration linguistic level of graphic configuration object of subobjects at different levels.
3. method according to claim 1, it is characterised in that described that verification of correctness bag is carried out to transfer process and result Include:
According to the information of the M graphic configuration object, the corresponding graphical set of each described graphic configuration linguistic level is judged successively Whether state object is correct.
4. method according to claim 1, it is characterised in that it is described successively to N number of graphic configuration linguistic level each Corresponding graphic configuration object carries out language conversion to be included:
Primary graphic element fractionation is carried out to N number of each self-corresponding graphic configuration object of graphic configuration linguistic level successively.
5. method according to claim 4, it is characterised in that it is described according to the transformation result by graphic configuration original language The program code for being translated as object language includes:
N number of each self-corresponding graphic configuration object of graphic configuration linguistic level is entered according to the primary graphic element that fractionation is obtained Line code is drawn, and obtains the program code of object language.
6. method according to claim 1, it is characterised in that methods described also includes:
If the transfer process and result of any graphic configuration linguistic level be not by the verification of correctness, sign is pointed out to turn Change the first error information of process and result mistake;
Modification result is received, and after the modification result is by the verification of correctness, carries out any graphic configuration The language conversion treatment of the subsequent diagram Configuration Language layer of linguistic level.
7. method according to claim 5, it is characterised in that methods described also includes:
Program code to the object language is verified;
If the result is that the program code of the object language is correct, the program code of the object language is exported.
8. method according to claim 7, it is characterised in that the object language is C language, described to the target language The program code of speech carries out checking to be included:
Judge whether the program code of C language calls the function for drawing primary graphic element;
If the program code call of the C language is used to draw the function of primary graphic element, the result is the target The program code of language is correct;
If the program code never call of the C language is used to draw the function of primary graphic element, point out to characterize code drafting Second error information of mistake.
9. the method according to any one of claim 5,7-8, it is characterised in that the primary graphic element includes following At least one:Point, line segment, circle, rectangle, polygon and bitmap.
10. a kind of graphic configuration language converting device, it is characterised in that described device includes:
Original language acquisition module, for obtaining graphic configuration original language, the graphic configuration original language includes M graphic configuration pair The information of the relation between the information of elephant, and the M graphic configuration object;
Relationship determination module, for determining the M graphical set according to the information of the relation between the M graphic configuration object Hierarchical relationship between state object;
Linguistic level determining module, for according to the hierarchical relationship, determining corresponding N number of graphic configuration linguistic level and every successively The corresponding graphic configuration object of individual graphic configuration linguistic level;
Language conversion and authentication module, for successively to N number of each self-corresponding graphic configuration object of graphic configuration linguistic level Language conversion is carried out, and verification of correctness is carried out to transfer process and result;
Code translation module, if for graphic configuration linguistic level each described transfer process and result by the correctness Checking, then according to the transformation result by graphic configuration source language translation for object language program code;
Wherein, M >=1, N >=1, M >=N, and M and N are integer.
11. devices according to claim 10, it is characterised in that the linguistic level determining module includes:
Object determining unit, the graphic configuration object for being determined as parent object according to the hierarchical relationship, and as each The graphic configuration object of level subobject;
Linguistic level sets up unit, for setting up a graphical set corresponding with the graphic configuration object as parent object respectively State linguistic level, and N-1 graphic configuration linguistic level corresponding with the graphic configuration object of the subobjects at different levels.
12. devices according to claim 10, it is characterised in that the language conversion and authentication module are used for according to described Whether just the M information of graphic configuration object, judge the corresponding graphic configuration object of each described graphic configuration linguistic level successively Really.
13. devices according to claim 10, it is characterised in that the language conversion and authentication module are used for successively to institute Stating each self-corresponding graphic configuration object of N number of graphic configuration linguistic level carries out primary graphic element fractionation.
14. devices according to claim 13, it is characterised in that the code translation module is used for what is obtained according to fractionation Primary graphic element enters line code drafting to N number of each self-corresponding graphic configuration object of graphic configuration linguistic level, obtains mesh The program code of poster speech.
15. devices according to claim 10, it is characterised in that described device also includes:
Error information reminding module, if for any graphic configuration linguistic level transfer process and result by it is described just True property checking, then prompting characterizes the first error information of transfer process and result mistake;
Modification result receiver module, for receiving modification result, and after the modification result is by the verification of correctness, Carry out the language conversion treatment of the subsequent diagram Configuration Language layer of any graphic configuration linguistic level.
16. devices according to claim 14, it is characterised in that described device also includes:
Code verification module, verifies for the program code to the object language;
Code output module, if correct for program code that the result is the object language, exports the target language The program code of speech.
17. devices according to claim 16, it is characterised in that the object language is C language, the code verification mould Block is used to judge whether the program code of C language calls the function for drawing primary graphic element;If the program of the C language Code call is used to draw the function of primary graphic element, then the result be the object language program code it is correct;If The program code never call of the C language is used to draw the function of primary graphic element, then prompting characterizes code and draws mistake Second error information.
18. device according to any one of claim 14,16-17, it is characterised in that the primary graphic element includes At least one of:Point, line segment, circle, rectangle, polygon and bitmap.
CN201710060383.5A 2017-01-24 2017-01-24 Graphic configuration language transfer method and device Pending CN106933566A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710060383.5A CN106933566A (en) 2017-01-24 2017-01-24 Graphic configuration language transfer method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710060383.5A CN106933566A (en) 2017-01-24 2017-01-24 Graphic configuration language transfer method and device

Publications (1)

Publication Number Publication Date
CN106933566A true CN106933566A (en) 2017-07-07

Family

ID=59423491

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710060383.5A Pending CN106933566A (en) 2017-01-24 2017-01-24 Graphic configuration language transfer method and device

Country Status (1)

Country Link
CN (1) CN106933566A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018137146A1 (en) * 2017-01-24 2018-08-02 北京广利核***工程有限公司 Graph configuration language transformation method and apparatus
CN110471659A (en) * 2019-08-16 2019-11-19 珠海格力电器股份有限公司 Multilingual method and system, human-machine interface configuration software end and equipment end
CN112306470A (en) * 2020-10-19 2021-02-02 南京航空航天大学 Method for simplifying, converting and automatically verifying complex synchronous language program
CN112579065A (en) * 2019-09-27 2021-03-30 北京广利核***工程有限公司 Method and system for generating cross-platform code for graphic configuration picture

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101339502A (en) * 2008-07-08 2009-01-07 国电南瑞科技股份有限公司 Self-described configuration data packing method
CN101499015A (en) * 2009-03-18 2009-08-05 北京和利时***工程有限公司 Method and converter for converting high level language to other high level languages
CN101630865A (en) * 2009-08-19 2010-01-20 江苏省电力公司淮安供电公司 Integrated platform of configuration protection and engineering configuration of digital transformer substation
CN101196810B (en) * 2006-12-08 2012-01-11 中颖电子股份有限公司 Built-in equipment operation method
JP2012022425A (en) * 2010-07-13 2012-02-02 Fuji Electric Co Ltd Device and method for automatically generating program and program
JP2012043216A (en) * 2010-08-19 2012-03-01 Fuji Electric Co Ltd Program automatic generation device
CN103823666A (en) * 2013-11-05 2014-05-28 国电南瑞科技股份有限公司 Smart substation equipment visualized programming method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101196810B (en) * 2006-12-08 2012-01-11 中颖电子股份有限公司 Built-in equipment operation method
CN101339502A (en) * 2008-07-08 2009-01-07 国电南瑞科技股份有限公司 Self-described configuration data packing method
CN101499015A (en) * 2009-03-18 2009-08-05 北京和利时***工程有限公司 Method and converter for converting high level language to other high level languages
CN101630865A (en) * 2009-08-19 2010-01-20 江苏省电力公司淮安供电公司 Integrated platform of configuration protection and engineering configuration of digital transformer substation
JP2012022425A (en) * 2010-07-13 2012-02-02 Fuji Electric Co Ltd Device and method for automatically generating program and program
JP2012043216A (en) * 2010-08-19 2012-03-01 Fuji Electric Co Ltd Program automatic generation device
CN103823666A (en) * 2013-11-05 2014-05-28 国电南瑞科技股份有限公司 Smart substation equipment visualized programming method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018137146A1 (en) * 2017-01-24 2018-08-02 北京广利核***工程有限公司 Graph configuration language transformation method and apparatus
CN110471659A (en) * 2019-08-16 2019-11-19 珠海格力电器股份有限公司 Multilingual method and system, human-machine interface configuration software end and equipment end
CN112579065A (en) * 2019-09-27 2021-03-30 北京广利核***工程有限公司 Method and system for generating cross-platform code for graphic configuration picture
CN112306470A (en) * 2020-10-19 2021-02-02 南京航空航天大学 Method for simplifying, converting and automatically verifying complex synchronous language program

Similar Documents

Publication Publication Date Title
CN106933566A (en) Graphic configuration language transfer method and device
CN109086199B (en) Method, terminal and storage medium for automatically generating test script
US10866877B2 (en) Automated repair of bugs and security vulnerabilities in software
CN110244936B (en) Method and device for supporting VISIO flow chart to automatically import DCS algorithm configuration software
EP1890235A1 (en) Test case management
CN103226562A (en) Method and apparatus for generating questions
CN106294148A (en) C programmer software verification method based on escape character transition system and device
CN111243571A (en) Text processing method, device and equipment and computer readable storage medium
CN114218932A (en) Aviation fault text abstract generation method and device based on fault cause and effect map
KR20200071413A (en) Machine learning data generating apparatus, apparatus and method for analyzing errors in source code
US4510583A (en) Keyboard terminal
Gruner et al. Cross-domain evaluation of a deep learning-based type inference system
CN117130593A (en) Code processing method, system and electronic equipment
CN106775914B (en) A kind of code method for internationalizing and device for automatically generating key assignments
CN106354930B (en) A kind of self-adapting reconstruction method and system of spacecraft
EP3575956A1 (en) Graph configuration language transformation method and apparatus
Davel et al. Verifying pronunciation dictionaries using conflict analysis
EP2782005A1 (en) Verifying state reachability in a statechart model having computer program code embedded therein
Carlsson Development of an ISO 26262 ASIL D compliant verification system
Anureev et al. Two-level mixed verification method of C-light programs in terms of safety logic
CN115049899B (en) Model training method, reference expression generation method and related equipment
CN116991706B (en) Vehicle automatic test method, device, equipment and storage medium
CN111627275B (en) Processing method and device for language representation information test, storage medium and terminal
KR102610914B1 (en) Method for automatic test scenario generation from hysteresis curve
Draper Applying the B-method to avionics software: an initial report on the MIST project

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20170707