Embodiment
Embodiments herein is described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end
Same or similar label represents same or similar module or the module with same or like function.Below with reference to attached
The embodiment of figure description is exemplary, is only used for explaining the application, and it is not intended that limitation to the application.On the contrary, this
All changes in the range of spirit and intension that the embodiment of application includes falling into attached claims, modification and equivalent
Thing.
Fig. 1 is the schematic flow sheet of the method for the inquiry source code that the application one embodiment is proposed.
The present embodiment is by taking the execution of software model side as an example.
The Core Generator of software model has a variety of, and the present embodiment (is abbreviated as with visualization paradigm (Visual Paradigm)
VP exemplified by).VP be it is a it is powerful, cross-platform, using most convenient, intuitively UML (Unified
Modeling Language, UML) modeling tool.
Software model be in a kind of abstract model, the present embodiment by taking uml diagram as an example.
Accordingly, the functional unit in software model for example including:Connecting line in uml diagram.
Specifically, the executive agent of the present embodiment can be provided in the plug-in unit in the Core Generator of software model.This reality
Apply in example, so that the plug-in unit is referred to as VP plug-in units as an example.
In the present embodiment, the content identification of the identification information and source code of the functional unit being pre-established with software model
Between corresponding relation.
Referring to Fig. 1, the method for the present embodiment includes:
S11:Obtain the identification information of the functional unit in software model.
Wherein, when the Core Generator of software model is VP, above-mentioned identification information is specifically VP links.
Can be as shown in Figure 2 using a kind of VP software models generated.As shown in Fig. 2 the software model generated using VP
It is made up of a series of UML (Unified Modeling Language, UML) figure, uml diagram is by element (such as Fig. 2
In A, B these points) and connecting line (line between such as A and B) composition.
Therefore, in the present embodiment, so that the functional unit in software model is connecting line as an example.
In VP, after developer clicks a connecting line by right key, a menu for including multiple options can be shown, should
One in menu is " context ", after developer moves the cursor to " context " this option, can be shown " up and down
The next stage menu of this option of text ", the next stage menu includes " coherent element/displaying link (Related
Elements/Show Link ...) " this option, when developer click on " Related Elements/Show Link ... " this
After one option, the VP links of the connecting line can be jumped out.
For example, when developer click on A and B between " queries asset information " this connecting line after, can jump out such as Fig. 3
Shown VP links 31.
When needing to check the corresponding source code of the connecting line of some in software model, then developer can use above-mentioned side
Formula causes the VP of the connecting line is linked to show.
After VP link displays, VP can be linked and is input to VP by developer by the way of replicating or inputting character by character
In plug-in unit so that VP plug-in units get the VP links of software model.
S12:According to the corresponding relation, it is determined that the content of source code corresponding to the identification information of acquired functional unit
Mark.
The above-mentioned corresponding relation due to being pre-established with, therefore, it can be determined and above-mentioned mark according to the corresponding relation
The content identification of the corresponding source code of information.
Further, VP plug-in units can obtain the content identification of above-mentioned source code from server.
Wherein, VP plug-in units are got after VP links, VP links can be sent into server.
Server is a kind of equipment that can be all communicated with VP plug-in units and source code plug-in unit, and the equipment can be corresponded to
Store the content identification of the identification information and source code of software model.Server can be located locally or distal end.
Preserved in server similar<VP links 1, the content identification 1 of source code>This corresponding relation, therefore, works as processor
Receive after VP links, can determine that VP links the content identification of corresponding source code according to above-mentioned corresponding relation.Source code
Content identification for example including:Class name and method name etc..
It is understood that it is above-mentioned using be man-to-man corresponding relation between VP links and the content identification of source code as
Example, it is to be understood that can also be the content identification of the multiple source codes of VP link correspondences, or, multiple VP links pair
Answer the content identification of same source code.
Server is got after the content identification of source code, and the content identification can be sent to VP plug-in units.
Further, after VP plug-in units determine the content identification of source code, user can be displayed it to.
Afterwards, user can be according to the content identification of display, according to the content identification in the Core Generator of source code
Open source code.
For example, VP plug-in units are received after the content identification of the source code of server transmission, exploit person can be displayed it to
Member.
Developer can use the Core Generator of source code after display information is got, according to the source code of display
Content identification, open corresponding specific source code.For example, source is opened in good grounds content identification in the Core Generator of source code
The option of code, source code can be opened by the option.
In the present embodiment, pass through the identification information of functional unit and the content of source code being pre-established with software model
Corresponding relation between mark, can inquire source generation corresponding with the functional unit in software model according to the corresponding relation
Code, therefore, it can easily determine source code corresponding with software model.
Fig. 4 be the application one embodiment propose query software model in functional unit method flow signal
Figure.
The present embodiment is by taking the execution of source code side as an example.
The Core Generator of source code has a variety of, for example, Eclipse, Intellij Idea etc..
Wherein, Eclipse is an open source code, the expansible development platform based on Java.In itself,
It is a framework and one group of service, for making up environment by plug in component.
Intellij Idea are the integration environments of java language developments, are in the industry cycle acknowledged as best java exploitation works
One of tool, especially the function in terms of smart code assistant, code are pointed out, reconstructed automatically can be described as extraordinary.
Intellij Idea are the products of JetBrains companies.
Specifically, the executive agent of the present embodiment can be provided in the plug-in unit in the Core Generator of source code.This implementation
In example, so that the plug-in unit is referred to as Eclipse plug-in units as an example.
Referring to Fig. 4, the method for the present embodiment includes:
S41:In the note of source code, the identification information of the functional unit in software model is obtained, wherein, the source generation
The identification information for the functional unit being added in advance in the note of code in software model corresponding with the source code.
Wherein, developer can be obtained in software model when generating software model and source code using the above method
Functional unit VP links, and note (such as Java of the corresponding source code of functional unit in software model
Annotation VP links are added in).
For example, with reference to Fig. 5, developer can know the corresponding relation of the functional unit and source code in software model,
After showing that the VP of the functional unit in software model is linked in VP, VP links can be added to the software model by developer
In the note 51 of corresponding source code.
It is understood that when the source code multiple functional units of correspondence, then can be in the note 51 of the source code
Add multiple VP links.
After source code to be detected is determined, developer can input source code to be detected in Eclipse plug-in units
Content identification, such as class name or method name, Eclipse plug-in units can find corresponding source code according to the content identification, and
VP links are got from the note of the source code.
S42:Show the identification information.
Further, Eclipse plug-in units are got after VP links, can display it to developer.
Developer can use the Core Generator of software model after display information is got, according to the software of display
The identification information of model, opens the functional unit in corresponding specific software model.For example, in the Core Generator of software model
With good grounds identification information opens the option of the functional unit in software model, and the work(in software model can be opened by the option
Can unit.
In the present embodiment, by adding the identification information of the functional unit in software model in the note of source code, from
And the identification information of the functional unit in software model can be obtained from note, it therefore, it can easily determine and source code
Functional unit in corresponding software model.
Fig. 6 is the schematic flow sheet for the information query method that the application one embodiment is proposed.
In the present embodiment, the Core Generator with software model is VP, exemplified by the Core Generator of source code is Eclipse.
Referring to Fig. 6, the method for the present embodiment includes:
S601:VP generates software model, and shows the VP links of the functional unit in software model.
For example, as it appears from the above, can be clicked by right key by developer, so as to show the VP links shown in Fig. 3.
S602:In the note that VP is linked to the corresponding source code of functional unit being added in software model.
For example, as it appears from the above, can be filled in by the artificial of developer, as shown in figure 5, VP links are added into note
In.
S603:Source code is after being stored, and Eclipse plug-in units are by the VP chain sending and receiving in the content identification and note of source code
Give processor.
For example, by after source code storage to data warehouse, Eclipse plug-in units are corresponding with VP links by above-mentioned content identification
It is sent to processor.
S604:The content identification of processor correspondence storage source code is linked with VP.
By S601-S604, the functional unit in source code and software model can be passed through relational processor.
Afterwards can be mutual between the functional unit and source code in progress software model according to above-mentioned incidence relation
Inquiry.
For example, when needing in software model side, during the corresponding source code of inquiry, S605-S610 can be performed, or, when
When needing to inquire about the functional unit in corresponding software model in source code side, S611-S612 can be performed.
S605:VP plug-in units obtain VP links to be detected.
S606:VP links are sent to server by VP plug-in units.
S607:Server links the corresponding relation with the content identification of source code according to VP, determines corresponding content identification.
S608:The content identification that VP plug-in units the reception server is sent.
S609:VP plug-in units display content is identified.
S610:The content identification that Eclipse is inputted according to developer, opens corresponding source code.
By S605-S610, corresponding source code can be inquired by the functional unit in software model.
S611:Eclipse plug-in units obtain VP links from the note of source code to be detected, and are shown.
S612:The VP that VP is inputted according to developer is linked, and opens the functional unit in corresponding software model.
By S611-S612, the functional unit in corresponding software model can be tracked by source code.
It is understood that the correlation that the content of non-specified otherwise may refer in above-described embodiment in the present embodiment is retouched
State, no longer describe in detail herein.
In the present embodiment, the VP for showing the functional unit in software model by VP is linked, and VP links are added into source
In the note of code, the inquiry between the functional unit in software model and source code can be easily realized.
Fig. 7 is the structural representation of the device for the inquiry source code that the application one embodiment is proposed.
The device of the present embodiment can be specifically the plug-in unit in the Core Generator of software model.
In the present embodiment, the content identification of the identification information and source code of the functional unit being pre-established with software model
Between corresponding relation,
Referring to Fig. 7, the device 70 of the present embodiment includes:Acquisition module 71 and determining module 72.
Acquisition module 71, the identification information for obtaining the functional unit in software model;
Determining module 72, for according to the corresponding relation, it is determined that the identification information of acquired functional unit is corresponding
The content identification of source code.
In some embodiments, referring to Fig. 8, the determining module 72 includes:
Transmitting element 721, the correspondence pass is preserved for the identification information to be sent in server, the server
System, so that the server obtains the content identification of the source code corresponding with the identification information according to the corresponding relation;
Receiving unit 722, the content identification for receiving the source code that the server is sent.
In some embodiments, referring to Fig. 8, the device 70 also includes:
Display module 73, the content identification for showing the source code.
In some embodiments, when the Core Generator of the software model is VP, the identification information is VP links.
In some embodiments, the corresponding relation preserved in the server is the Core Generator by being arranged on source code
In plug-in unit upload, the plug-in unit obtains the identification information from the note of the source code, wherein, when software model
Core Generator shows after the identification information that the identification information is added in the note.
It is understood that the device of the present embodiment is corresponding with the embodiment of the method for above-mentioned software model side, it is specific interior
Hold the associated description that may refer in above-described embodiment, no longer describe in detail herein.
In the present embodiment, pass through the identification information of functional unit and the content of source code being pre-established with software model
Corresponding relation between mark, can inquire source generation corresponding with the functional unit in software model according to the corresponding relation
Code, therefore, it can easily determine source code corresponding with the functional unit in software model.
Fig. 9 be the application one embodiment propose query software model in functional unit device structural representation
Figure.
The device of the present embodiment can be specifically the plug-in unit in the Core Generator of source code.
Referring to Fig. 9, the device 90 of the present embodiment includes:Acquisition module 91 and display module 92.
Acquisition module 91, in the note of source code, obtaining the identification information of the functional unit in software model, its
In, the mark for the functional unit being added in advance in the note of the source code in software model corresponding with the source code
Information;
Display module 92, for showing the identification information.
In some embodiments, referring to Figure 10, the device 90 also includes:
Sending module 93, for after the source code is stored, by the content identification and note of the source code
The identification information of the functional unit of software model is sent to server, so that the server correspondence storage source code is interior
Hold mark and the identification information of the functional unit of the software model.
It is understood that the device of the present embodiment is corresponding with the embodiment of the method for above-mentioned source code side, particular content
The associated description in above-described embodiment is may refer to, is no longer described in detail herein.
In the present embodiment, by adding the identification information of the functional unit in software model in the note of source code, from
And the identification information of the functional unit in software model can be obtained from note, it therefore, it can easily determine and source code
Functional unit in corresponding software model.
It should be noted that in the description of the present application, term " first ", " second " etc. are only used for describing purpose, without
It is understood that to indicate or imply relative importance.In addition, in the description of the present application, unless otherwise indicated, the implication of " multiple "
Refer at least two.
Any process described otherwise above or method description are construed as in flow chart or herein, represent to include
Module, fragment or the portion of the code of one or more executable instructions for the step of realizing specific logical function or process
Point, and the scope of the preferred embodiment of the application includes other realization, wherein can not be by shown or discussion suitable
Sequence, including according to involved function by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should be by the application
Embodiment person of ordinary skill in the field understood.
It should be appreciated that each several part of the application can be realized with hardware, software, firmware or combinations thereof.Above-mentioned
In embodiment, the software that multiple steps or method can in memory and by suitable instruction execution system be performed with storage
Or firmware is realized.If, and in another embodiment, can be with well known in the art for example, realized with hardware
Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal
Discrete logic, the application specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene
Programmable gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method is carried
Rapid to can be by program to instruct the hardware of correlation to complete, described program can be stored in a kind of computer-readable storage medium
In matter, the program upon execution, including one or a combination set of the step of embodiment of the method.
In addition, each functional unit in the application each embodiment can be integrated in a processing module, can also
That unit is individually physically present, can also two or more units be integrated in a module.Above-mentioned integrated mould
Block can both be realized in the form of hardware, it would however also be possible to employ the form of software function module is realized.The integrated module is such as
Fruit is realized using in the form of software function module and as independent production marketing or in use, can also be stored in a computer
In read/write memory medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means to combine specific features, structure, material or the spy that the embodiment or example are described
Point is contained at least one embodiment of the application or example.In this manual, to the schematic representation of above-mentioned term not
Necessarily refer to identical embodiment or example.Moreover, specific features, structure, material or the feature of description can be any
One or more embodiments or example in combine in an appropriate manner.
Although embodiments herein has been shown and described above, it is to be understood that above-described embodiment is example
Property, it is impossible to the limitation to the application is interpreted as, one of ordinary skill in the art within the scope of application can be to above-mentioned
Embodiment is changed, changed, replacing and modification.