CN111309304B - Method, device, medium and electronic equipment for generating IDL file - Google Patents

Method, device, medium and electronic equipment for generating IDL file Download PDF

Info

Publication number
CN111309304B
CN111309304B CN202010086841.4A CN202010086841A CN111309304B CN 111309304 B CN111309304 B CN 111309304B CN 202010086841 A CN202010086841 A CN 202010086841A CN 111309304 B CN111309304 B CN 111309304B
Authority
CN
China
Prior art keywords
function
type
interface
cloud
cloud function
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.)
Active
Application number
CN202010086841.4A
Other languages
Chinese (zh)
Other versions
CN111309304A (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 ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010086841.4A priority Critical patent/CN111309304B/en
Publication of CN111309304A publication Critical patent/CN111309304A/en
Application granted granted Critical
Publication of CN111309304B publication Critical patent/CN111309304B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure provides a method, a device, a medium and electronic equipment for generating IDL files. The method comprises the following steps: acquiring request information of each cloud function through a function, namely a first interface of a service platform; respectively acquiring the language type and cloud function code of each cloud function through the function, namely a second interface of the service platform; analyzing cloud function codes of each cloud function based on the language types to obtain corresponding parameter types; and generating a first service type of the interface in the interface description language file based on the request information of each cloud function and the corresponding parameter type. The IDL file is automatically generated according to the request information of the cloud function, the cloud function code and the corresponding parameter type. The IDL file is convenient to review and may also generate a code for the HTTP interface. The efficiency of the HTTP interface developed on the FaaS platform is effectively improved.

Description

Method, device, medium and electronic equipment for generating IDL file
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a medium, and an electronic device for generating an IDL file.
Background
Function as a service (english full name Function as a service, faaS for short) is a type of cloud computing service, which provides a platform. On this platform, a user can develop, run, and manage application functions, but does not need to build and maintain infrastructure typically associated with developing and launching applications. The FaaS enables a developer to be liberated from tedious operation and deployment work, is focused on application program development, and can effectively improve the development efficiency of the application program.
Unlike backend services (English full name Backend as a Service, baaS for short), faaS requires the developer to complete backend logic development by himself. First, a developer develops a function, commonly referred to as a cloud function, on the FaaS's platform that implements the desired functionality. Then, the online function of the FaaS platform is triggered. The FaaS platform automatically completes the construction and deployment work of the cloud function. Finally, the cloud function is accessed using the hypertext transfer protocol (english full name HyperText Transfer Protocol, abbreviated HTTP). In the FaaS platform, one cloud function corresponds to one HTTP interface.
When accessing an HTTP interface on a FaaS platform, it is necessary to know the details of the interface, such as URL of the interface request, method, request data type, and response data type. In order to obtain the interface information, the cloud function codes on the FaaS platform need to be consulted. After obtaining the detailed information of the interface, the developer also needs to write the code for initiating the HTTP request. This process is cumbersome and inefficient.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The present disclosure aims to provide a method, an apparatus, a medium and an electronic device for generating an IDL file, which can solve at least one technical problem mentioned above. The specific scheme is as follows:
according to a specific embodiment of the present disclosure, in a first aspect, the present disclosure provides a method for generating an IDL file, including:
acquiring request information of each cloud function through a function, namely a first interface of a service platform;
respectively acquiring the language type and cloud function code of each cloud function through the function, namely a second interface of the service platform; wherein the cloud function code comprises a business logic code of a hypertext transfer protocol service;
analyzing cloud function codes of each cloud function based on the language types to obtain corresponding parameter types;
and generating a first service type of the interface in the interface description language file based on the request information of each cloud function and the corresponding parameter type.
According to a second aspect of a specific embodiment of the present disclosure, the present disclosure provides an apparatus for generating an IDL file, including:
the request information acquisition unit is used for respectively acquiring the request information of each cloud function through a function, namely a first interface of the service platform;
the cloud function code obtaining unit is used for obtaining the language type and the cloud function code of each cloud function through the function, namely the second interface of the service platform; wherein the cloud function code comprises a business logic code of a hypertext transfer protocol service;
the analysis unit is used for analyzing cloud function codes of each cloud function based on the language types and acquiring corresponding parameter types;
and generating a first service type unit, which is used for generating a first service type of an interface in the interface description language file based on the request information of each cloud function and the corresponding parameter type.
According to a third aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of generating IDL files according to any of the first aspects.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: one or more processors; storage means for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the method of generating IDL files according to any of the first aspects.
Compared with the prior art, the scheme of the embodiment of the disclosure has at least the following beneficial effects:
the disclosure provides a method, a device, a medium and electronic equipment for generating IDL files. The IDL file is automatically generated according to the request information of the cloud function, the cloud function code and the corresponding parameter type. The IDL file is convenient to review and may also generate a code for the HTTP interface. The efficiency of the HTTP interface developed on the FaaS platform is effectively improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale. In the drawings:
FIG. 1 illustrates a flow chart of a method of generating IDL files according to an embodiment of the present disclosure;
fig. 2 shows a block diagram of a unit of an apparatus for generating IDL files according to an embodiment of the present disclosure;
fig. 3 illustrates a schematic diagram of an electronic device connection structure according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Alternative embodiments of the present disclosure are described in detail below with reference to the drawings.
The first embodiment provided in the present disclosure, that is, an embodiment of a method of generating an IDL file.
Embodiments of the present disclosure are described in detail below with reference to fig. 1, where fig. 1 is a flowchart of a method for generating an IDL file according to an embodiment of the present disclosure.
Step S101, request information of each cloud function is obtained through a function, namely a first interface of a service platform.
The method for obtaining the request information of each cloud function through the function, namely the first interface of the service platform, comprises the following steps:
step S101-1, respectively obtaining configuration information of each cloud function through the function, namely a first interface of a service platform.
When the cloud function is newly built, configuration information associated with the cloud function needs to be input and stored in advance. The configuration information includes: function name, function description, request resource address, and request method information.
The first interface is provided by the FaaS platform and is used for acquiring pre-stored configuration information.
Optionally, the obtaining, through the function, that is, the first interface of the service platform, the configuration information of each cloud function includes the following steps:
step S101-1-1, respectively obtaining configuration information of each cloud function from a configuration data set of the function, namely the service platform, through a first interface of the function, namely the service platform.
The configuration information is stored in a configuration data set provided by the FaaS platform. The first interface obtains configuration information from a configuration data set.
Step S101-2, acquiring the request information based on the configuration information.
The request information includes: function name, request resource address, and request method information.
Because the configuration information includes the request information, the step obtains the corresponding request information from the configuration information of each cloud function.
Step S102, the language type and the cloud function code of each cloud function are respectively obtained through the function, namely the second interface of the service platform.
Wherein the cloud function code comprises business logic code of hypertext transfer protocol service. The second interface is an interface provided by the FaaS platform and is used for acquiring the language type of the cloud function and the cloud function code.
The FaaS platform provides an online code editor that supports multiple programming languages. Therefore, the language type of the programming language needs to be set in advance before the cloud function code is written. The cloud function can successfully pass the compilation only if the language type and the cloud function code are matched.
Optionally, the obtaining, through the function, that is, the second interface of the service platform, the language type and the cloud function code of each cloud function includes the following steps:
step S102-1, the language type and the code text of each cloud function are respectively obtained from the code data set of the function, namely the service platform, through the second interface of the function, namely the service platform.
The written cloud function code may be saved in the code text.
The language type and code text of the pre-set programming language may be stored in a code data set provided by the FaaS platform. The language type and the code text of the cloud function can be obtained from the code data set through the second interface.
And step S102-2, acquiring corresponding cloud function codes based on the code text of each cloud function.
And acquiring cloud function codes corresponding to the cloud functions from the code text.
The FaaS platform not only shields construction, deployment and operation and maintenance work, but also encapsulates the functions of the HTTP service framework, thereby realizing seamless connection of cloud functions and the HTTP service framework.
Step S103, analyzing cloud function codes of each cloud function based on the language types, and acquiring corresponding parameter types.
The HTTP service framework encapsulated by the FaaS platform automatically completes the work of operating HTTP. For example, request data and response data for setting an HTTP request are acquired from the HTTP request.
The cloud function code includes business logic code of the HTTP service. The input parameters of the cloud function are HTTP request data, and the output parameters are HTTP response data. That is, the parameter type of the cloud function represents the data type of the HTTP interface.
Wherein the parameter types include an in-parameter type and an out-parameter type.
Specifically, the analyzing the cloud function code of each cloud function based on the language type, and obtaining the corresponding parameter type, includes the following steps:
step S103-1, analyzing cloud function codes of each cloud function based on the language types, and acquiring a corresponding first abstract syntax tree.
An abstract syntax tree (english full name abstract syntax tree, abbreviated as AST) is a tree representation of the abstract syntax structure of source code. Each node on the tree represents a structure in the source code. The grammar is said to be "abstract" in that the grammar herein does not represent every detail that appears in the real grammar.
And analyzing the cloud function codes of each cloud function to obtain a corresponding first abstract syntax tree, namely analyzing the cloud function codes through a parser to obtain the corresponding first abstract syntax tree.
And step S103-2, respectively analyzing each first abstract syntax tree to obtain the parameter type corresponding to the cloud function.
The process of analyzing each first abstract syntax tree to obtain the parameter types corresponding to the cloud function is not described in detail in this embodiment, and may be implemented with reference to various implementation manners in the prior art.
Step S104, generating a first service type of the interface in the interface description language file based on the request information of each cloud function and the corresponding parameter type.
The interface description language (english full name Interface Description Language, IDL for short) is a computer language used to describe an application program interface. IDLs describe interfaces in a neutral manner so that objects running on different platforms and programs written in different languages can communicate with each other.
In the interface description language file, a first service type includes at least one or more function types. A first service type describes a backend service. One of the first service types in the interface description language file describes one of the cloud functions in the FaaS platform.
Specifically, the generating the first service type of the interface in the interface description language file based on the request information of each cloud function and the corresponding parameter type includes the following steps:
step S104-1, generating a function type of the first service type and auxiliary function labeling information associated with the function type in the interface description language file based on the request information of each function, namely the cloud function in the service platform.
Because the first service type in the interface description language file cannot completely describe the HTTP interface, auxiliary function labeling information associated with the function type is generated according to the request information of the cloud function. So as to further fully describe the HTTP interface in the interface description language file.
Step S104-2, generating the parameter type of the function in the first service type in the interface description language file based on each function, namely the parameter type corresponding to the cloud function in the service platform.
IDLs are programming language independent, defining the mapping of IDL data types to data types corresponding to a particular language type. According to the mapping relation, the inter-conversion of IDL data types and data types corresponding to specific language types can be realized.
And step S104-3, generating the first service type according to the function type, the auxiliary function labeling information and the parameter type.
The first service type includes a service name and a plurality of function types. The service name takes a default value.
According to the embodiment of the disclosure, the IDL file is automatically generated according to the request information of the cloud function, the cloud function code and the corresponding parameter type. The IDL file is convenient to review and may also generate a code for the HTTP interface. The efficiency of the HTTP interface developed on the FaaS platform is effectively improved.
Corresponding to the first embodiment provided by the present disclosure, the present disclosure also provides a second embodiment, namely an apparatus for generating an IDL file. Since the second embodiment is substantially similar to the first embodiment, the description is relatively simple, and the relevant portions will be referred to the corresponding descriptions of the first embodiment. The device embodiments described below are merely illustrative.
Fig. 2 illustrates an embodiment of an apparatus for generating IDL files provided by the present disclosure. Fig. 2 is a block diagram of a unit of an apparatus for generating an IDL file according to an embodiment of the present disclosure.
Referring to fig. 2, the present disclosure provides an apparatus for generating an IDL file, including: the acquisition request information unit 201, the acquisition cloud function code unit 202, the analysis unit 203, and the generation of the first service type unit 204.
An acquiring request information unit 201, configured to acquire request information of each cloud function through a function, that is, a first interface of a service platform, respectively;
the cloud function code obtaining unit 202 is configured to obtain a language type and a cloud function code of each cloud function through the function, that is, the second interface of the service platform; wherein the cloud function code comprises a business logic code of a hypertext transfer protocol service;
the analysis unit 203 is configured to analyze cloud function codes of each cloud function based on the language type, and obtain a corresponding parameter type;
a first service type unit 204 is generated, which is configured to generate a first service type of an interface in the interface description language file based on the request information of each cloud function and the corresponding parameter type.
Optionally, in the acquisition request information unit 201, it includes:
the configuration information acquisition subunit is used for respectively acquiring the configuration information of each cloud function through the function, namely the first interface of the service platform;
and the first acquisition request information subunit is used for acquiring the request information based on the configuration information.
Optionally, the acquiring configuration information subunit includes:
the second configuration information acquisition subunit is configured to acquire configuration information of each cloud function from the configuration data set of the function, i.e. the service platform, through the first interface of the function, i.e. the service platform.
Optionally, in the acquiring cloud function code unit 202, it includes:
the code text obtaining subunit is used for obtaining the language type and the code text of each cloud function from the code data set of the function serving platform through the second interface of the function serving platform;
and acquiring Yun Hanshu code subunits, which are used for acquiring the corresponding cloud function codes based on the code text of each cloud function.
Optionally, in the analysis unit 203, it includes:
the first abstract syntax tree obtaining subunit is used for analyzing cloud function codes of each cloud function based on the language type and obtaining a corresponding first abstract syntax tree;
and the first abstract syntax tree analysis subunit is used for respectively analyzing each first abstract syntax tree and acquiring the parameter type corresponding to the cloud function.
Optionally, in the generating the first service type unit 204, it includes:
a function type generating subunit, configured to generate a function type of the first service type in the interface description language file and auxiliary function labeling information associated with the function type based on request information of each function, that is, the cloud function in the service platform;
the generation parameter type subunit is used for respectively generating the parameter types of the functions in the first service type in the interface description language file based on each function, namely the parameter type corresponding to the cloud function in the service platform;
and the generation first service type subunit is used for generating the first service type according to the function type, the auxiliary function labeling information and the parameter type.
Optionally, the request information includes: function name, request resource address, and request method information.
According to the embodiment of the disclosure, the IDL file is automatically generated according to the request information of the cloud function, the cloud function code and the corresponding parameter type. The IDL file is convenient to review and may also generate a code for the HTTP interface. The efficiency of the HTTP interface developed on the FaaS platform is effectively improved.
An embodiment of the present disclosure provides a third embodiment, that is, an electronic device, where the method for generating an IDL file includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the one processor to enable the at least one processor to perform the method of generating IDL files as described in the first embodiment.
The present disclosure provides a fourth embodiment, namely, a computer storage medium storing computer-executable instructions that can perform the method of generating an IDL file as described in the first embodiment.
Referring now to fig. 3, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 3 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 3, the electronic device may include a processing means (e.g., a central processor, a graphics processor, etc.) 301 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
In general, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 308 including, for example, magnetic tape, hard disk, etc.; and communication means 309. The communication means 309 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 shows an electronic device having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device 309, or installed from a storage device 308, or installed from a ROM 302. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing means 301.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (9)

1. A method of generating an IDL file, comprising:
acquiring request information of each cloud function through a function, namely a first interface of a service platform;
respectively acquiring the language type and cloud function code of each cloud function through the function, namely a second interface of the service platform; wherein the cloud function code comprises a business logic code of a hypertext transfer protocol service;
analyzing cloud function codes of each cloud function based on the language types to obtain corresponding parameter types;
generating a first service type of an interface in an interface description language file based on the request information of each cloud function and the corresponding parameter type, wherein the first service type is used for describing a back-end service in the interface description language file;
the generating the first service type of the interface in the interface description language file based on the request information of each cloud function and the corresponding parameter type includes:
generating a function type of the first service type in the interface description language file and auxiliary function labeling information associated with the function type based on the request information of each function, namely the cloud function in the service platform;
generating parameter types of functions in the first service type in the interface description language file respectively based on each function, namely the parameter type corresponding to the cloud function in the service platform;
and generating the first service type according to the function type, the auxiliary function labeling information and the parameter type.
2. The method according to claim 1, wherein the obtaining, through the first interface of the function-as-a-service platform, the request information of each cloud function includes:
respectively acquiring configuration information of each cloud function through the function, namely a first interface of a service platform;
and acquiring the request information based on the configuration information.
3. The method according to claim 2, wherein the obtaining, through the first interface of the function-as-a-service platform, configuration information of each cloud function includes:
and respectively acquiring the configuration information of each cloud function from the configuration data set of the function, namely the service platform through the first interface of the function, namely the service platform.
4. The method according to claim 1, wherein the obtaining, through the second interface of the function-as-a-service platform, the language type and the cloud function code of each cloud function, respectively, includes:
the language type and the code text of each cloud function are respectively obtained from the code data set of the function, namely the service platform, through the second interface of the function, namely the service platform;
and acquiring corresponding cloud function codes based on the code text of each cloud function.
5. The method of claim 1, wherein analyzing the cloud function code of each cloud function based on the language type, and obtaining the corresponding parameter type, comprises:
analyzing cloud function codes of each cloud function based on the language types, and acquiring a corresponding first abstract syntax tree;
and respectively analyzing each first abstract syntax tree to obtain the parameter type corresponding to the cloud function.
6. The method of claim 1, wherein the requesting information comprises: function name, request resource address, and request method information.
7. An apparatus for generating an IDL file, comprising:
the request information acquisition unit is used for respectively acquiring the request information of each cloud function through a function, namely a first interface of the service platform;
the cloud function code obtaining unit is used for obtaining the language type and the cloud function code of each cloud function through the function, namely the second interface of the service platform; wherein the cloud function code comprises a business logic code of a hypertext transfer protocol service;
the analysis unit is used for analyzing cloud function codes of each cloud function based on the language types and acquiring corresponding parameter types;
generating a first service type unit, which is used for generating a first service type of an interface in an interface description language file based on the request information of each cloud function and the corresponding parameter type, wherein the first service type is used for describing a back-end service in the interface description language file;
the generating the first service type of the interface in the interface description language file based on the request information of each cloud function and the corresponding parameter type includes:
generating a function type of the first service type in the interface description language file and auxiliary function labeling information associated with the function type based on the request information of each function, namely the cloud function in the service platform;
generating parameter types of functions in the first service type in the interface description language file respectively based on each function, namely the parameter type corresponding to the cloud function in the service platform;
and generating the first service type according to the function type, the auxiliary function labeling information and the parameter type.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any one of claims 1 to 6.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the method of any of claims 1 to 6.
CN202010086841.4A 2020-02-11 2020-02-11 Method, device, medium and electronic equipment for generating IDL file Active CN111309304B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010086841.4A CN111309304B (en) 2020-02-11 2020-02-11 Method, device, medium and electronic equipment for generating IDL file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010086841.4A CN111309304B (en) 2020-02-11 2020-02-11 Method, device, medium and electronic equipment for generating IDL file

Publications (2)

Publication Number Publication Date
CN111309304A CN111309304A (en) 2020-06-19
CN111309304B true CN111309304B (en) 2023-07-11

Family

ID=71154505

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010086841.4A Active CN111309304B (en) 2020-02-11 2020-02-11 Method, device, medium and electronic equipment for generating IDL file

Country Status (1)

Country Link
CN (1) CN111309304B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949253B (en) * 2020-08-07 2023-12-01 抖音视界有限公司 Method, apparatus, computer device and storage medium for combining IDL files
CN112256326B (en) * 2020-10-27 2023-07-07 北京字跳网络技术有限公司 Information processing method, device, equipment and storage medium
CN112667224A (en) * 2021-01-12 2021-04-16 北京字节跳动网络技术有限公司 File processing method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902283A (en) * 2014-03-03 2014-07-02 华东师范大学 Method for achieving real-time asynchronous communication through model transformation in CORBA
CN109683856A (en) * 2018-10-26 2019-04-26 平安科技(深圳)有限公司 Electronic device, Faas stage function creation method and storage medium
WO2019217889A1 (en) * 2018-05-11 2019-11-14 Jpmorgan Chase Bank, N.A. Function as a service gateway
CN110489323A (en) * 2019-07-09 2019-11-22 北京字节跳动网络技术有限公司 Visual RPC API adjustment method, device, medium and equipment
CN110489101A (en) * 2019-07-15 2019-11-22 北京字节跳动网络技术有限公司 Interface analogy method, system, medium and electronic equipment

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030237073A1 (en) * 2001-05-17 2003-12-25 Karel Gardas Software synchronization of interface and class implementation
JP5292670B2 (en) * 2006-02-22 2013-09-18 富士通株式会社 Development support program, development support method, and development support apparatus
US8881101B2 (en) * 2011-05-24 2014-11-04 Microsoft Corporation Binding between a layout engine and a scripting engine
US9699249B2 (en) * 2014-12-05 2017-07-04 Vmware, Inc. Runtime generation of application programming interfaces for remote procedure call services
CN109032663A (en) * 2018-07-09 2018-12-18 深圳市小牛在线互联网信息咨询有限公司 Generation method, device, computer equipment and the storage medium of interface document
CN109375922A (en) * 2018-09-26 2019-02-22 深圳壹账通智能科技有限公司 A kind of automatic generation method and terminal device of interface document
US20190042395A1 (en) * 2018-09-28 2019-02-07 Intel Corporation Source code profiling through enhanced mapping
CN110457144B (en) * 2019-08-05 2021-12-07 北京字节跳动网络技术有限公司 Method, device, medium and equipment for realizing front-end application

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902283A (en) * 2014-03-03 2014-07-02 华东师范大学 Method for achieving real-time asynchronous communication through model transformation in CORBA
WO2019217889A1 (en) * 2018-05-11 2019-11-14 Jpmorgan Chase Bank, N.A. Function as a service gateway
CN109683856A (en) * 2018-10-26 2019-04-26 平安科技(深圳)有限公司 Electronic device, Faas stage function creation method and storage medium
CN110489323A (en) * 2019-07-09 2019-11-22 北京字节跳动网络技术有限公司 Visual RPC API adjustment method, device, medium and equipment
CN110489101A (en) * 2019-07-15 2019-11-22 北京字节跳动网络技术有限公司 Interface analogy method, system, medium and electronic equipment

Also Published As

Publication number Publication date
CN111309304A (en) 2020-06-19

Similar Documents

Publication Publication Date Title
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN111221572B (en) Method, device, medium and equipment for automatically adapting to running environment
CN112395253B (en) Index file generation method, terminal device, electronic device and medium
CN111324342B (en) Method, device, medium and electronic equipment for generating interface layer code
CN111930534A (en) Data calling method and device and electronic equipment
CN111367516B (en) Application interface generation method and device and electronic equipment
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
CN111338944B (en) Remote Procedure Call (RPC) interface testing method, device, medium and equipment
CN112596720A (en) Service operation method and device, electronic equipment and computer storage medium
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
CN111324376B (en) Function configuration method, device, electronic equipment and computer readable medium
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN111240801A (en) Method, device, medium and electronic equipment for generating heap memory snapshot file
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN111309323B (en) Parameter initialization method and device and electronic equipment
CN111414161B (en) Method, device, medium and electronic equipment for generating IDL file
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN109669720B (en) Chain type asynchronous request processing method and device based on Promise and electronic equipment
CN113761588A (en) Data verification method and device, terminal equipment and storage medium
CN111797009A (en) Method and device for detecting code compatibility and electronic equipment
CN112688863B (en) Gateway data processing method and device and electronic equipment
CN111399902B (en) Client source file processing method and device, readable medium and electronic equipment
CN112445517B (en) Inlet file generation method, device, electronic equipment and computer readable medium
CN111240738B (en) File processing method, device, equipment and medium

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