CN107832045A - Across the method and apparatus of programming language interface conversion - Google Patents

Across the method and apparatus of programming language interface conversion Download PDF

Info

Publication number
CN107832045A
CN107832045A CN201710959210.7A CN201710959210A CN107832045A CN 107832045 A CN107832045 A CN 107832045A CN 201710959210 A CN201710959210 A CN 201710959210A CN 107832045 A CN107832045 A CN 107832045A
Authority
CN
China
Prior art keywords
class
idl file
interface
language interface
idl
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
CN201710959210.7A
Other languages
Chinese (zh)
Other versions
CN107832045B (en
Inventor
郑伟强
王德俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710959210.7A priority Critical patent/CN107832045B/en
Publication of CN107832045A publication Critical patent/CN107832045A/en
Application granted granted Critical
Publication of CN107832045B publication Critical patent/CN107832045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors

Landscapes

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

Abstract

The invention discloses the method and apparatus across programming language interface conversion, it is related to field of computer technology.One embodiment of this method includes:Class generation idl file is described according to original language interface;Edlin is entered to the idl file;Class is described based on the idl file generation object language interface after editor.The embodiment can avoid generating the code of excessive redundancy in across programming language interface conversion by the editor to idl file;Reduce the repetitive operation during modification;Add the controllability and flexibility ratio of across programming language interface conversion process;Effectively solve polymorphic problem of the different programming languages in transcode process.

Description

Across the method and apparatus of programming language interface conversion
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method and apparatus across programming language interface conversion.
Background technology
With the development of computer technology, the life of people becomes increasingly dependent on computer technology, various to meet Demand, the system program of Various Functions arise at the historic moment.Often occur inter-department cooperation collaboration in system program development process to open The situation of hair, due to inter-sectional using different programming languages, therefore during co-development, have much across programming language Interface interchange scene.
At present, the interface protocol conversion of different programming languages can describe class according to the interface of service side and called side Structural similarity is automatically generated using instrument.The interface standard that service side externally provides can define class by interface to represent, Code transformation tool loading interface defines class, obtains interface and defines the interface included in class and defines statement with related object, so File of the reconvert into target programmed language afterwards.
In process of the present invention is realized, inventor has found that at least there are the following problems in the prior art:
1. because called side only needs service side to provide part of interface and object, due to Core Generator None- identified called side Which interface and object are needed, causes the code that excessive redundancy is had after code building;
2. called side is directly repaiied because business needs to carry out self-defined adjustment to partial code to the code automatically generated Change and a large amount of repetitive operations be present;
3. the object instance that interface returns there may be polymorphic situation, i.e., the object statement returned in interface describes class is One parent, but actually return be probably the parent subclass, and the object instance that may be returned has multiple subclasses, causes The interface of object language, which describes class, can not obtain the actual types of return so that returning result can not be serialized after interface interchange.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus across programming language interface conversion, can avoid The code of excessive redundancy is generated in across programming language interface conversion;Reduce the repetitive operation during modification;Add across The controllability and flexibility ratio of programming language interface conversion process;It is more in transcode process effectively to solve different programming languages State problem.
To achieve the above object, one side according to embodiments of the present invention, there is provided a kind of across programming language interface turns The method changed.
A kind of method across programming language interface conversion of the embodiment of the present invention includes:Class life is described according to original language interface Into idl file;Edlin is entered to the idl file;Based on the idl file generation object language interface description after editor Class.
Alternatively, describing class generation idl file according to original language interface includes:Obtain the original language interface and describe class Class defines information or interface function defines information;According to the class defines information or the interface function defines information generation Idl file.
Alternatively, the idl file is carried out editing at least one included in the following:Increase the idl file Content;Delete the content of the idl file;Change the content of the idl file;Add and explain in the idl file.
Alternatively, the note includes annotation, extended field or version number.
Alternatively, describing class based on the idl file generation object language interface after editor includes:After obtaining editor The class in the idl file defines information, the interface function defines information or the note;Based on static masterplate technology Generation object language interface describes class.
To achieve the above object, according to another aspect of the present invention, there is provided a kind of dress across programming language interface conversion Put.
A kind of device across programming language interface conversion of present example includes:First generation module, for according to source Language interface describes class generation idl file;Editor module, for entering edlin to the idl file;Second generation module, use Idl file generation object language interface after based on editor describes class.
Alternatively, first generation module is additionally operable to:Obtain the class that the original language interface describes class define information or Interface function defines information;Information is defined according to the class or the interface function defines information and generates the idl file.
Alternatively, the editor module is additionally operable at least one in the following:Increase the content of the idl file; Delete the content of the idl file;Change the content of the idl file;Add and explain in the idl file.
Alternatively, the note includes annotation, extended field or version number.
Alternatively, second generation module is additionally operable to:Obtain the class definition letter in the idl file after editor Breath, the interface function define information or the note;Class is described based on static masterplate technology generation object language interface.
To achieve the above object, in accordance with a further aspect of the present invention, there is provided a kind of electricity across programming language interface conversion Sub- equipment.
A kind of electronic equipment across programming language interface conversion of the embodiment of the present invention includes:One or more processors; Storage device, for storing one or more programs, when one or more of programs are held by one or more of processors OK so that one or more of processors realize a kind of method across programming language interface conversion of the embodiment of the present invention.
To achieve the above object, in accordance with a further aspect of the present invention, there is provided a kind of computer-readable recording medium.
A kind of computer-readable recording medium of the embodiment of the present invention, it is stored thereon with computer program, described program quilt A kind of method across programming language interface conversion of the embodiment of the present invention is realized during computing device.
One embodiment in foregoing invention has the following advantages that or beneficial effect:Because using idl file mechanism technology Means, class generation IDL idl file is described according to original language interface;Edlin is entered to idl file;After editor Idl file generation object language interface class is described.By overcoming code redundancy to the editor of idl file, can not be self-defined Change, lack Version Control and polymorphic technical problem, it is excessive superfluous so as to avoid generating in across programming language interface conversion Remaining code;Reduce the repetitive operation during modification;Only maintain IDL intermediate files i.e. can be achieved service side's interface document with Called side interface document synchronous vacations, add the controllability and flexibility ratio of across programming language interface conversion process;Effectively solve Polymorphic problem of the different programming languages in transcode process.
Further effect adds hereinafter in conjunction with embodiment possessed by above-mentioned non-usual optional mode With explanation.
Brief description of the drawings
Accompanying drawing is used to more fully understand the present invention, does not form inappropriate limitation of the present invention.Wherein:
Fig. 1 is the schematic diagram of the key step of the method according to embodiments of the present invention across programming language interface conversion;
Fig. 2 is the first signal of the interface conversion of the method according to embodiments of the present invention across programming language interface conversion Figure;
Fig. 3 is the second signal of the interface conversion of the method according to embodiments of the present invention across programming language interface conversion Figure;
Fig. 4 is the schematic diagram of the main modular of the device according to embodiments of the present invention across programming language interface conversion;
Fig. 5 is that the embodiment of the present invention can apply to exemplary system architecture figure therein;
Fig. 6 is adapted for the structural representation for realizing the terminal device of the embodiment of the present invention or the computer system of server Figure.
Embodiment
The one exemplary embodiment of the present invention is explained below in conjunction with accompanying drawing, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize Arrive, various changes and modifications can be made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, the description to known function and structure is eliminated in following description.
Fig. 1 is the schematic diagram of the key step of the method according to embodiments of the present invention across programming language interface conversion.
As shown in figure 1, a kind of method across programming language interface conversion of the embodiment of the present invention mainly includes the following steps that:
Step S101:Class generation idl file is described according to original language interface.
In order to increase the controllability and flexibility ratio of across programming language interface conversion process, the embodiment of the present invention introduces interface Definitional language (IDL) file mechanism, during across programming language interface conversion, class generation is described according to the interface of original language Idl file.
There is structural similarity because the same interface of different programming languages describes class, therefore, pass through intermediate file IDL texts Part can realize the interface conversion of different programming languages.In embodiments of the present invention, this step can be connect by obtaining original language The class of mouth description class defines information or interface function defines information;Information is defined according to class or interface function defines information generation Idl file is realized.
It should be noted that the modes such as reflection characteristic or text resolution can be utilized, which to obtain class, defines information or interface function Information is defined, wherein, class defines the title that information can be interface class, object, attribute, method, the type of field, the name of field The information such as title;It can be interface function name, function parameter type, function parameter name, function return class that interface function, which defines information, The information such as type, when generating idl file, describe acquisition class in class from the interface of original language and define information or interface function definition letter Breath, and information is defined based on the class got or interface function defines information generation idl file.
Step S102:Edlin is entered to idl file.
In order to avoid generating the code of excessive redundancy in across programming language interface conversion, and reduce the weight during modification Renaturation works.It can also enter edlin to the idl file generated in step S101 in the embodiment of the present invention, that is, safeguard idl file. Pass through the editor to idl file, it is possible to achieve the modification that service side's interface is described to class is synchronized to the interface of called side and describes class In, i.e., if service side have modified code, it is only necessary to change the corresponding contents in idl file and can be achieved to repair the whole of code Change.
In embodiments of the present invention, idl file is carried out editing at least one included in the following:Increase IDL texts The content of part;Delete the content of idl file;Change the content of idl file;Add and explain in idl file.
When to entering edlin to idl file, it can select to change the description of the interfaces such as class name, field name according to the actual requirements The class of class defines information, and the class that can also delete redundancy defines information and interface function defines information.By increasing, deleting or repair Repeated modification during interface conversion to bulk redundancy code can be reduced by changing the code in idl file, such as be deleted Except the object repeated in idl file.Meanwhile enter edlin to idl file and can also be described by addition note to add interface The extension information of class, the note is used for identifying extended attribute, such as "@Member " can be used for the extra letter for identifying class to note Breath, "@Field " can be used for extraneous information of identification field etc. to note.
It should be noted that the certain field in the object of interface communication, describes only to describe in class in the interface of original language The information of parent, but practical communication is probably subclass, and be probably unfixed subclass, therefore, note can be passed through Form manually add the polymorphism information of the field for field, the field a variety of subclass information that may be present are identified, for example, logical Note " MutiType " is crossed to be identified subclass.
In embodiments of the present invention, explaining includes annotation, extended field or version number.Wherein, annotation can be used for identifying The implication of field, such as the annotation information of the annotation information of attribute and method;When version number can be used for identifying the modification of object Between, i.e., it is controlled by idl file docking port version;Although extended field is not involved in the communication of service side and called side, but It is that can flexibly be used for called side, such as the definition of mark class, field definition or version information etc..
Step S103:Class is described based on the idl file generation object language interface after editor.
Idl file after step S102 is edited can generate the interface description of corresponding object language as needed Class, so as to complete across programming language interface conversion.
In embodiments of the present invention, this step can define information, interface by obtaining the class in the idl file after editing Function defines information, annotation, version number or extended field;Class reality is described based on static masterplate technology generation object language interface It is existing.This step can equally utilize the modes such as reflection characteristic or text resolution, and interface description is obtained from the idl file after editor The information that the class of class defines information, interface function defines information or is added in idl file, information, interface are defined using class Interface of the information based on the corresponding object language of static masterplate technology generation that function defines information or added in idl file Class is described.
It should be noted that static masterplate technology (FreeMarker) is a kind of based on template and the data next life to be changed Into the general utility tool of output text (HTML html web page, Email, configuration file, source code etc.).In addition, The interface of resulting object language describes the extended field that can retain annotation information in class and be added according to version number, so as to Called side flexibly uses, such as the definition of mark class, field definition or version information etc..
Method across programming language interface conversion according to embodiments of the present invention can be seen that because using idl file machine Technological means processed, class generation IDL idl file is described according to original language interface;Edlin is entered to idl file;It is based on Idl file generation object language interface after editor describes class.By overcoming code redundancy to the editor of idl file, can not Self-defined modification, lack Version Control and polymorphic technical problem, so as to avoid generating in across programming language interface conversion The code of excessive redundancy;Reduce the repetitive operation during modification;Only maintain IDL intermediate files and service side's interface can be achieved File and called side interface document synchronous vacations, add the controllability and flexibility ratio of across programming language interface conversion process;Have Effect solves polymorphic problem of the different programming languages in transcode process.
Fig. 2 is the first signal of the interface conversion of the method according to embodiments of the present invention across programming language interface conversion Figure.
As shown in Fig. 2 in embodiments of the present invention, it is right by taking the interface of the interface conversion of JAVA language to C Plus Plus as an example Illustrated across the method for programming language interface conversion, wherein, service side uses JAVA language, there is provided the interface of JAVA language is retouched State class;Called side uses C Plus Plus, and the interface for finally needing to obtain C Plus Plus describes class.
Assuming that the interface of JAVA language describes to provide two base attributes of commodity and method in class, in generation IDL texts The interface is obtained before part describe the class of class and define information, that is, get the title of interface class, object, attribute, method, field The information such as type, the title of field, for JAVA language reflection characteristic can be utilized to obtain class and define information, based on above- mentioned information Generate idl file.
Edlin is entered to the idl file of generation, interface and object, modification object of redundancy etc. is deleted or increase is explained, note The content of solution includes the annotation for identification field implication, the version number for identifying the object modification time, determined for identifying class Justice or the extended field of field definition or version information etc..
Specifically, in the embodiment of the present invention addition explain "@Member " and "@Field ", wherein, explain "@Member's " Field " desc " represents that class annotation information, field " cplusNamespace " represent C++ NameSpaces, field " rawJsonFormat " indicates whether to generate object tag (json) method;Explain "@Field " field " desc " expression word Section annotation information, field " defaultValue " represent that default value, field " jsonField " represent generation json methods, field " extfieldc " represents that text box, field " version " represent version number.
Interface based on the idl file generation C Plus Plus after above-mentioned editor describes class.Specifically, based on JAVA language Interface describes the idl file of class generation, can equally utilize reflection characteristic acquisition class to define increased in information and idl file The information such as annotation, version number and extended field, the interface that called side generates C Plus Plus using these information describe class, and then will Interface describes the object serialization in class, and serializing refers to being converted to the status information of object into the form that can be stored or transmit Process.
Fig. 3 is the second signal of the interface conversion of the method according to embodiments of the present invention across programming language interface conversion Figure.
As shown in figure 3, equally to across programming language interface by taking the interface of the interface conversion of JAVA language to C Plus Plus as an example The method of conversion illustrates, wherein, service side uses JAVA language, there is provided the interface of JAVA language describes class;Called side makes With C Plus Plus, the interface for finally needing to obtain C Plus Plus describes class.
The interface function in class, which is described, obtaining the interface of JAVA language using reflection characteristic or text resolution defines information, It can be the information such as interface function name, function parameter type, function parameter name, function return type that interface function, which defines information, Information generation idl file is defined according to interface function.
Edlin is entered to the idl file of generation, interface and object, modification object of redundancy etc. is deleted or increase is explained, note The content of solution includes the annotation for identification field implication, the version number for identifying the object modification time, determined for identifying class Justice or the extended field of field definition or version information etc..
Specifically, in the embodiment of the present invention addition explain "@Member " and "@Field ", wherein, explain "@Member's " Field " desc " represents that class annotation information, field " cplusNamespace " represent C++ NameSpaces, field " rawJsonFormat " indicates whether to generate json methods;Explain "@Field " field " desc " expression field annotation information, Field " defaultValue " represents that default value, field " jsonField " represent generation json methods, field " version " table Show that version number, field " MutiType " represent subclass information existing for the field practical object.
In addition, there is polymorphic situation, i.e. pair in the interface of original language describes class in the object instance that interface is described in class As example is a parent, but actual capabilities are the subclasses of the parent, when the interface of C Plus Plus is needed the parent of JAVA interface When being extended to multiple subclasses, i.e., by the parent " BaseProduct " of JAVA interface be extended to " YushouProduct " and " GlobalProduct " two subclasses, it is only necessary to increase a comment field in idl file, such as pass through field " MutiType " is identified to subclass.
Idl file obtains interface after above-mentioned editor using the text resolution instrument of reflection characteristic or programming language Function defines the information such as increased annotation, version number and extended field in information and idl file, using these information by IDL The interface of file generated C Plus Plus describes class, and when generating the interface of C Plus Plus, connecing for JAVA language is distinguished according to comment field The subclass type of mouth, such as when the object in idl file is subclass " com.test.YushouProduct ", called side uses Subclass " YushouProduct " carries out object serialization.
Fig. 4 is the schematic diagram of the main modular of the device according to embodiments of the present invention across programming language interface conversion.
As shown in figure 4, a kind of device 400 across programming language interface conversion of present example includes:First generation mould Block 401, the generation module 403 of editor module 402 and second.
Wherein,
First generation module 401, for describing class generation idl file according to original language interface;
Editor module 402, for entering edlin to the idl file;
Second generation module 403, for describing class based on the idl file generation object language interface after editor.
In embodiments of the present invention, first generation module 401 is additionally operable to:Obtain the original language interface and describe class Class defines information or interface function defines information;According to the class defines information or the interface function defines information generation Idl file.
In embodiments of the present invention, the editor module 402 is additionally operable at least one in the following:Described in increase The content of idl file;Delete the content of the idl file;Change the content of the idl file;Added in the idl file Explain.
In addition, the note includes annotation, extended field or version number.
In embodiments of the present invention, second generation module 403 is additionally operable to:Obtain in the idl file after editor The class define information, the interface function defines information or the note;Object language is generated based on static masterplate technology Interface describes class.
Device across programming language interface conversion according to embodiments of the present invention can be seen that because using idl file machine Technological means processed, class generation IDL idl file is described according to original language interface;Edlin is entered to idl file;It is based on Idl file generation object language interface after editor describes class.By overcoming code redundancy to the editor of idl file, can not Self-defined modification, lack Version Control and polymorphic technical problem, so as to avoid generating in across programming language interface conversion The code of excessive redundancy;Reduce the repetitive operation during modification;Only maintain IDL intermediate files and service side's interface can be achieved File and called side interface document file synchronization are changed, and add the controllability and flexibly of across programming language interface conversion process Degree;Effectively solve polymorphic problem of the different programming languages in transcode process.
Fig. 5, which is shown, can apply being connect across the method for programming language interface conversion or across programming language for the embodiment of the present invention The exemplary system architecture 500 of the device of mouth conversion.
As shown in figure 5, system architecture 500 can include terminal device 501,502,503, network 504 and server 505. Network 504 between terminal device 501,502,503 and server 505 provide communication link medium.Network 504 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be interacted with using terminal equipment 501,502,503 by network 504 with server 505, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 501,502,503 The application of page browsing device, searching class application, JICQ, mailbox client, social platform software etc..
Terminal device 501,502,503 can have a display screen and a various electronic equipments that supported web page browses, bag Include but be not limited to smart mobile phone, tablet personal computer, pocket computer on knee and desktop computer etc..
Server 505 can be to provide the server of various services, such as utilize terminal device 501,502,503 to user The shopping class website browsed provides the back-stage management server supported.Back-stage management server can be believed the product received The breath data such as inquiry request analyze etc. processing, and by result (such as target push information, product information -- only show Example) feed back to terminal device.
It should be noted that the method across programming language interface conversion that the embodiment of the present invention is provided is typically by server 505 perform, and correspondingly, are generally positioned at across the device of programming language interface conversion in server 505.
It should be understood that the number of the terminal device, network and server in Fig. 5 is only schematical.According to realizing need Will, can have any number of terminal device, network and server.
Below with reference to Fig. 6, it illustrates suitable for for realizing the computer system 600 of the terminal device of the embodiment of the present invention Structural representation.Terminal device shown in Fig. 6 is only an example, to the function of the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in fig. 6, computer system 600 includes CPU (CPU) 601, it can be read-only according to being stored in Program in memory (ROM) 602 or be loaded into program in random access storage device (RAM) 603 from storage part 608 and Perform various appropriate actions and processing.In RAM 603, also it is stored with system 600 and operates required various programs and data. CPU 601, ROM 602 and RAM 603 are connected with each other by bus 604.Input/output (I/O) interface 605 is also connected to always Line 604.
I/O interfaces 605 are connected to lower component:Importation 606 including keyboard, mouse etc.;Penetrated including such as negative electrode The output par, c 607 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage part 608 including hard disk etc.; And the communications portion 609 of the NIC including LAN card, modem etc..Communications portion 609 via such as because The network of spy's net performs communication process.Driver 610 is also according to needing to be connected to I/O interfaces 605.Detachable media 611, such as Disk, CD, magneto-optic disk, semiconductor memory etc., it is arranged on as needed on driver 610, in order to read from it Computer program be mounted into as needed storage part 608.
Especially, according to embodiment disclosed by the invention, may be implemented as counting above with reference to the process of flow chart description Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product, it includes being carried on computer Computer program on computer-readable recording medium, the computer program include the program code for being used for the method shown in execution flow chart. In such embodiment, the computer program can be downloaded and installed by communications portion 609 from network, and/or from can Medium 611 is dismantled to be mounted.When the computer program is performed by CPU (CPU) 601, system of the invention is performed The above-mentioned function of middle restriction.
It should be noted that the computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer-readable recording medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, system, device or the device of infrared ray or semiconductor, or it is any more than combination.Meter The more specifically example of calculation machine readable storage medium storing program for executing can include but is not limited to:Electrical connection with one or more wires, just Take formula computer disk, hard disk, random access storage device (RAM), read-only storage (ROM), erasable type and may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only storage (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer-readable recording medium can any include or store journey The tangible medium of sequence, the program can be commanded the either device use or in connection of execution system, device.And at this In invention, computer-readable signal media can include in a base band or as carrier wave a part propagation data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium beyond storage medium is read, the computer-readable medium, which can send, propagates or transmit, to be used for By instruction execution system, device either device use or program in connection.Included on computer-readable medium Program code can be transmitted with any appropriate medium, be included but is not limited to:Wirelessly, electric wire, optical cable, RF etc., or it is above-mentioned Any appropriate combination.
Flow chart and block diagram in accompanying drawing, it is illustrated that according to the system of various embodiments of the invention, method and computer journey Architectural framework in the cards, function and the operation of sequence product.At this point, each square frame in flow chart or block diagram can generation The part of one module of table, program segment or code, a part for above-mentioned module, program segment or code include one or more For realizing the executable instruction of defined logic function.It should also be noted that some as replace realization in, institute in square frame The function of mark can also be with different from the order marked in accompanying drawing generation.For example, two square frames succeedingly represented are actual On can perform substantially in parallel, they can also be performed in the opposite order sometimes, and this is depending on involved function.Also It is noted that the combination of each square frame and block diagram in block diagram or flow chart or the square frame in flow chart, can use and perform rule Fixed function or the special hardware based system of operation are realized, or can use the group of specialized hardware and computer instruction Close to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module can also be set within a processor, for example, can be described as:A kind of processor bag Include the first generation module, editor module and the second generation module.Wherein, the title of these modules not structure under certain conditions The paired restriction of the module in itself, for example, editor module is also described as " entering the idl file mould of edlin Block ".
As on the other hand, present invention also offers a kind of computer-readable medium, the computer-readable medium can be Included in equipment described in above-described embodiment;Can also be individualism, and without be incorporated the equipment in.Above-mentioned calculating Machine computer-readable recording medium carries one or more program, when said one or multiple programs are performed by the equipment, makes Obtaining the equipment includes:Step S101:Class generation idl file is described according to original language interface;Step S102:Idl file is carried out Editor;Step S103:Class is described based on the idl file generation object language interface after editor.
Technical scheme according to embodiments of the present invention, because using idl file mechanism technological means, according to original language interface Class generation IDL idl file is described;Edlin is entered to idl file;Target language is generated based on the idl file after editor Speech interface describes class.By the editor of idl file is overcome code redundancy, self-defined can not change, lack Version Control with And polymorphic technical problem, so as to avoid that the code of excessive redundancy is generated in across programming language interface conversion;Reduction was changed Repetitive operation in journey;Only maintain IDL intermediate files and service side's interface document and more parts of object codes of called side can be achieved File synchronization is changed, and adds the controllability and flexibility ratio of across programming language interface conversion process;Effectively solves distinct program language Say the polymorphic problem in transcode process.
Above-mentioned embodiment, does not form limiting the scope of the invention.Those skilled in the art should be bright It is white, depending on design requirement and other factors, various modifications, combination, sub-portfolio and replacement can occur.It is any Modifications, equivalent substitutions and improvements made within the spirit and principles in the present invention etc., should be included in the scope of the present invention Within.

Claims (11)

  1. A kind of 1. method across programming language interface conversion, it is characterised in that including:
    Class generation idl file is described according to original language interface;
    Edlin is entered to the idl file;
    Class is described based on the idl file generation object language interface after editor.
  2. 2. according to the method for claim 1, it is characterised in that describing class generation idl file according to original language interface includes:
    Obtain that the class that the original language interface describes class defines information or interface function defines information;
    Information is defined according to the class or the interface function defines information and generates the idl file.
  3. 3. according to the method for claim 2, it is characterised in that editor is carried out to the idl file to be included in the following At least one of:
    Increase the content of the idl file;
    Delete the content of the idl file;
    Change the content of the idl file;
    Add and explain in the idl file.
  4. 4. according to the method for claim 3, it is characterised in that
    The note includes annotation, extended field or version number.
  5. 5. according to the method for claim 4, it is characterised in that object language is generated based on the idl file after editor Interface, which describes class, to be included:
    The class in the idl file after acquisition editor defines information, the interface function defines information or the note;
    Class is described based on static masterplate technology generation object language interface.
  6. A kind of 6. device across programming language interface conversion, it is characterised in that including:
    First generation module, for describing class generation idl file according to original language interface;
    Editor module, for entering edlin to the idl file;
    Second generation module, for describing class based on the idl file generation object language interface after editor.
  7. 7. device according to claim 6, it is characterised in that first generation module is additionally operable to:
    Obtain that the class that the original language interface describes class defines information or interface function defines information;
    Information is defined according to the class or the interface function defines information and generates the idl file.
  8. 8. device according to claim 7, it is characterised in that the editor module is additionally operable at least one in the following :
    Increase the content of the idl file;
    Delete the content of the idl file;
    Change the content of the idl file;
    Add and explain in the idl file.
  9. 9. device according to claim 8, it is characterised in that second generation module is additionally operable to:
    The class in the idl file after acquisition editor defines information, the interface function defines information or the note Solution;
    Class is described based on static masterplate technology generation object language interface.
  10. A kind of 10. electronic equipment across programming language interface conversion, it is characterised in that including:
    One or more processors;
    Storage device, for storing one or more programs,
    When one or more of programs are by one or more of computing devices so that one or more of processors are real The now method as described in any in claim 1-5.
  11. 11. a kind of computer-readable medium, is stored thereon with computer program, it is characterised in that described program is held by processor The method as described in any in claim 1-5 is realized during row.
CN201710959210.7A 2017-10-16 2017-10-16 Method and apparatus for cross programming language interface conversion Active CN107832045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710959210.7A CN107832045B (en) 2017-10-16 2017-10-16 Method and apparatus for cross programming language interface conversion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710959210.7A CN107832045B (en) 2017-10-16 2017-10-16 Method and apparatus for cross programming language interface conversion

Publications (2)

Publication Number Publication Date
CN107832045A true CN107832045A (en) 2018-03-23
CN107832045B CN107832045B (en) 2021-03-30

Family

ID=61648115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710959210.7A Active CN107832045B (en) 2017-10-16 2017-10-16 Method and apparatus for cross programming language interface conversion

Country Status (1)

Country Link
CN (1) CN107832045B (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002287A (en) * 2018-08-08 2018-12-14 郑州云海信息技术有限公司 The management method and device of software in cloud data system
CN109343836A (en) * 2018-08-31 2019-02-15 阿里巴巴集团控股有限公司 Data Serialization, data antitone sequence method, device and equipment
CN110058864A (en) * 2019-04-18 2019-07-26 成都四方伟业软件股份有限公司 The dispositions method and device of micro services
CN110377273A (en) * 2019-07-01 2019-10-25 北京字节跳动网络技术有限公司 A kind of method, apparatus of data processing, medium and electronic equipment
CN110430222A (en) * 2019-09-12 2019-11-08 北京许继电气有限公司 A kind of service interface implementation method based on protocol mode
CN110704200A (en) * 2018-07-09 2020-01-17 北京京东尚科信息技术有限公司 Method and device for converting call interface
CN110716798A (en) * 2019-09-29 2020-01-21 微梦创科网络科技(中国)有限公司 PHP (hypertext preprocessor) timing task management method and system
CN110795147A (en) * 2018-08-01 2020-02-14 北京京东尚科信息技术有限公司 Interface protocol file management method and device
CN111399902A (en) * 2020-03-25 2020-07-10 北京字节跳动网络技术有限公司 Client source file processing method and device, readable medium and electronic equipment
CN111930363A (en) * 2020-08-07 2020-11-13 北京字节跳动网络技术有限公司 Block interface code generation method and device
CN111950239A (en) * 2020-08-07 2020-11-17 北京字节跳动网络技术有限公司 Schema document generation method and device, computer equipment and medium
CN111949253A (en) * 2020-08-07 2020-11-17 北京字节跳动网络技术有限公司 Method, apparatus, computer device and storage medium for combining IDL files
CN112130837A (en) * 2020-09-25 2020-12-25 腾讯科技(深圳)有限公司 Code processing method and device and storage medium
CN112162755A (en) * 2020-09-28 2021-01-01 北京字节跳动网络技术有限公司 Data processing method, device, medium and electronic equipment
CN112783748A (en) * 2019-11-06 2021-05-11 腾讯科技(深圳)有限公司 Program debugging method, device, equipment and computer readable storage medium
CN113805882A (en) * 2021-09-18 2021-12-17 上海波顿诺华智能科技有限公司 Method and device for developing application program, electronic equipment and storage medium
CN114253520A (en) * 2020-09-21 2022-03-29 北京字节跳动网络技术有限公司 Interface code generation method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043624A (en) * 2010-12-17 2011-05-04 青岛海信网络科技股份有限公司 Method for automatically programming intermediate communication interface and device
CN102891837A (en) * 2011-07-22 2013-01-23 华为软件技术有限公司 Information conversion processing method, bridging device and communication system
CN103530097A (en) * 2012-07-04 2014-01-22 深圳中兴网信科技有限公司 Implement method and device of module crossing middleware platform
CN103902283A (en) * 2014-03-03 2014-07-02 华东师范大学 Method for achieving real-time asynchronous communication through model transformation in CORBA
CN105279195A (en) * 2014-07-23 2016-01-27 腾讯科技(深圳)有限公司 Method and apparatus for webpage application to call browser function
CN105337968A (en) * 2015-10-19 2016-02-17 江苏中威科技软件系统有限公司 Cross platform communication protocol code conversion method and system
US20170286077A1 (en) * 2016-03-31 2017-10-05 Ca, Inc. Interface definition language compiler with version reconciliation

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043624A (en) * 2010-12-17 2011-05-04 青岛海信网络科技股份有限公司 Method for automatically programming intermediate communication interface and device
CN102891837A (en) * 2011-07-22 2013-01-23 华为软件技术有限公司 Information conversion processing method, bridging device and communication system
CN103530097A (en) * 2012-07-04 2014-01-22 深圳中兴网信科技有限公司 Implement method and device of module crossing middleware platform
CN103902283A (en) * 2014-03-03 2014-07-02 华东师范大学 Method for achieving real-time asynchronous communication through model transformation in CORBA
CN105279195A (en) * 2014-07-23 2016-01-27 腾讯科技(深圳)有限公司 Method and apparatus for webpage application to call browser function
CN105337968A (en) * 2015-10-19 2016-02-17 江苏中威科技软件系统有限公司 Cross platform communication protocol code conversion method and system
US20170286077A1 (en) * 2016-03-31 2017-10-05 Ca, Inc. Interface definition language compiler with version reconciliation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WEI HONGXING等: ""Research of Open CNC System Based on CORBA"", 《2008 FIFTH IEEE INTERNATIONAL SYMPOSIUM ON EMBEDDED COMPUTING》 *
朱振祥: ""CORBA/Java技术在WEB环境中的应用"", 《价值工程》 *

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704200A (en) * 2018-07-09 2020-01-17 北京京东尚科信息技术有限公司 Method and device for converting call interface
CN110795147A (en) * 2018-08-01 2020-02-14 北京京东尚科信息技术有限公司 Interface protocol file management method and device
CN109002287A (en) * 2018-08-08 2018-12-14 郑州云海信息技术有限公司 The management method and device of software in cloud data system
CN109002287B (en) * 2018-08-08 2021-11-26 郑州云海信息技术有限公司 Management method and device for software in cloud data system
CN109343836A (en) * 2018-08-31 2019-02-15 阿里巴巴集团控股有限公司 Data Serialization, data antitone sequence method, device and equipment
CN109343836B (en) * 2018-08-31 2021-09-10 创新先进技术有限公司 Data serialization and data deserialization method, device and equipment
CN110058864A (en) * 2019-04-18 2019-07-26 成都四方伟业软件股份有限公司 The dispositions method and device of micro services
CN110058864B (en) * 2019-04-18 2023-08-22 成都四方伟业软件股份有限公司 Micro-service deployment method and device
CN110377273A (en) * 2019-07-01 2019-10-25 北京字节跳动网络技术有限公司 A kind of method, apparatus of data processing, medium and electronic equipment
CN110377273B (en) * 2019-07-01 2023-07-28 北京字节跳动网络技术有限公司 Data processing method, device, medium and electronic equipment
CN110430222A (en) * 2019-09-12 2019-11-08 北京许继电气有限公司 A kind of service interface implementation method based on protocol mode
CN110716798A (en) * 2019-09-29 2020-01-21 微梦创科网络科技(中国)有限公司 PHP (hypertext preprocessor) timing task management method and system
CN110716798B (en) * 2019-09-29 2021-11-19 微梦创科网络科技(中国)有限公司 PHP (hypertext preprocessor) timing task management method and system
CN112783748A (en) * 2019-11-06 2021-05-11 腾讯科技(深圳)有限公司 Program debugging method, device, equipment and computer readable storage medium
CN112783748B (en) * 2019-11-06 2024-02-20 腾讯科技(深圳)有限公司 Program debugging method, device, equipment and computer readable storage medium
CN111399902A (en) * 2020-03-25 2020-07-10 北京字节跳动网络技术有限公司 Client source file processing method and device, readable medium and electronic equipment
CN111399902B (en) * 2020-03-25 2023-08-08 北京字节跳动网络技术有限公司 Client source file processing method and device, readable medium and electronic equipment
CN111949253A (en) * 2020-08-07 2020-11-17 北京字节跳动网络技术有限公司 Method, apparatus, computer device and storage medium for combining IDL files
CN111950239A (en) * 2020-08-07 2020-11-17 北京字节跳动网络技术有限公司 Schema document generation method and device, computer equipment and medium
CN111930363A (en) * 2020-08-07 2020-11-13 北京字节跳动网络技术有限公司 Block interface code generation method and device
CN111949253B (en) * 2020-08-07 2023-12-01 抖音视界有限公司 Method, apparatus, computer device and storage medium for combining IDL files
CN111930363B (en) * 2020-08-07 2023-11-24 抖音视界有限公司 Block interface code generation method and device
CN114253520B (en) * 2020-09-21 2024-03-12 抖音视界有限公司 Interface code generation method and device
CN114253520A (en) * 2020-09-21 2022-03-29 北京字节跳动网络技术有限公司 Interface code generation method and device
CN112130837A (en) * 2020-09-25 2020-12-25 腾讯科技(深圳)有限公司 Code processing method and device and storage medium
CN112162755A (en) * 2020-09-28 2021-01-01 北京字节跳动网络技术有限公司 Data processing method, device, medium and electronic equipment
CN113805882A (en) * 2021-09-18 2021-12-17 上海波顿诺华智能科技有限公司 Method and device for developing application program, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN107832045B (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN107832045A (en) Across the method and apparatus of programming language interface conversion
CN109933752A (en) A kind of method and apparatus exporting electronic document
CN108804327A (en) A kind of method and apparatus of automatic Data Generation Test
CN107729106A (en) It is a kind of that the method and apparatus quickly redirected are realized between application component
CN110472207A (en) List generation method and device
CN112100550A (en) Page construction method and device
CN108108342A (en) Generation method, search method and the device of structured text
CN107844371A (en) Task processing method, system and electronic equipment
CN108628830A (en) A kind of method and apparatus of semantics recognition
CN110134427A (en) A kind of method and apparatus generating code file
CN113435846A (en) Business process arranging method and device, computer equipment and storage medium
CN109815107A (en) The method and apparatus of automatic test
CN102770842A (en) Pattern-based user interfaces
CN107632833A (en) Generation method, equipment and the electronic equipment gently applied
CN110020329A (en) For generating the methods, devices and systems of webpage
CN106919711A (en) The method and apparatus of the markup information based on artificial intelligence
CN113031946A (en) Method and device for rendering page component
CN109857388A (en) Code generating method, device, server and computer-readable medium
CN113626223A (en) Interface calling method and device
CN110020376A (en) Data linkage method and system
CN109582317A (en) Method and apparatus for debugging boarding application
CN109002282A (en) A kind of method and apparatus for realizing animation effect in web page exploitation
CN109829723A (en) The method and apparatus for generating business voucher
CN110399187A (en) A kind for the treatment of method and apparatus of language resource
CN109472740A (en) The method and apparatus for generating figure based on web front end

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
GR01 Patent grant
GR01 Patent grant