CN117112074B - Method, system and medium for automatically converting HTTP application into serverless function - Google Patents

Method, system and medium for automatically converting HTTP application into serverless function Download PDF

Info

Publication number
CN117112074B
CN117112074B CN202310721869.4A CN202310721869A CN117112074B CN 117112074 B CN117112074 B CN 117112074B CN 202310721869 A CN202310721869 A CN 202310721869A CN 117112074 B CN117112074 B CN 117112074B
Authority
CN
China
Prior art keywords
http
request processing
http request
function
name
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
CN202310721869.4A
Other languages
Chinese (zh)
Other versions
CN117112074A (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.)
Lingyue Digital Information Technology Co ltd
Original Assignee
Lingyue Digital 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 Lingyue Digital Information Technology Co ltd filed Critical Lingyue Digital Information Technology Co ltd
Priority to CN202310721869.4A priority Critical patent/CN117112074B/en
Publication of CN117112074A publication Critical patent/CN117112074A/en
Application granted granted Critical
Publication of CN117112074B publication Critical patent/CN117112074B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Abstract

Methods, systems, and media for automatically converting HTTP applications to serverless functions are disclosed. The method comprises the following steps: scanning code files in a code package of a user to determine one or more HTTP request processing methods included in the code files, for each HTTP request processing method: obtaining HTTP method type, access path, class name, method name and parameter list; based on the obtained HTTP method type and access path, automatically generating a deployment code of the cloud native API; based on the obtained class names and method names, automatically generating a deployment code of the cloud native function; based on the one-to-one correspondence between the request interface and the request method, a deployment code of the configuration relation between the cloud native API and the cloud native function is automatically generated; creating a processing class which accords with the function computing platform specification as an entry function; in the entry function, determining a corresponding first HTTP request processing method based on the received first request; and executing the first HTTP request processing method through the reflection call.

Description

Method, system and medium for automatically converting HTTP application into serverless function
Technical Field
The present disclosure relates to the field of transcoding, and in particular, to methods, systems, computer readable media, and computer program products for automatically converting HTTP applications into serverless functions.
Background
HTTP (Hyper Text Transfer Protocol ), a request-response protocol, may be used for communication between a client and a server. For example, a client or browser submits an HTTP request to a server, which then returns a response to the client, where the response may include status information related to the request or may include the requested content. For example, when a user wants to access a browser, the user can see the displayed browser page because an HTTP request is sent and a response is obtained; and when the user uploads the document, the document resource is successfully uploaded to the server by sending an HTTP request. This includes different HTTP request methods. The HTTP request method includes at least GET, POST, PUT, DELETE and the like.
Serverless (Serverless) is an application architecture or product that allows developers to focus on product code without taking too much into account the server, with typical products including cloud functions. Depending on the Serverless product provided by the cloud platform, a developer can focus on building application logic and running programs, and can build and deploy Serverless applications without managing or operating servers or infrastructure. The server decouples the application from the server, so that the server does not need to be purchased, and the operation and maintenance requirements of the server are reduced; the Serverless application is executed on demand and charged according to the actual usage amount, and is loaded and executed only when a request needs to be processed or an event is triggered, so that the computing resource and the cost are saved; the Serverless function can handle single events, so that high concurrency of services can be realized, and peak pressure can be elastically stretched.
Disclosure of Invention
According to a first aspect of the present disclosure, there is provided a method for automatically converting an HTTP application into a serverless function, comprising: loading a code package of a user; scanning code files in the code package to determine whether one or more HTTP request processing methods are included in the scanned code files; in response to determining that the one or more HTTP request processing methods are included in the code file, for each HTTP request processing method: obtaining an HTTP method type, an access path, a class name, a method name and a parameter list of each HTTP request processing method; based on the obtained HTTP method type and access path, automatically generating a deployment code of the cloud native API; based on the obtained class names and method names, automatically generating a deployment code of the cloud native function; based on the one-to-one correspondence between the HTTP method type, the request interface identified by the access path, the class name and the request method identified by the method name, a deployment code of the configuration relation between the Yun Yuansheng API and the cloud native function is automatically generated; creating a processing class which accords with the function computing platform specification as an entry function; determining a first HTTP request processing method corresponding to a first request interface based on the first request interface contained in the first request received via the cloud native API in the entry function conforming to the function computing platform specification; and executing the first HTTP request processing method through the reflection call.
According to another aspect of the present disclosure, there is provided a system for automatically converting an HTTP application into a serverless function, comprising: one or more processors, and a memory coupled to the one or more processors, the memory storing computer-readable program instructions that, when executed by the one or more processors, cause the one or more processors to perform the method as described above.
According to yet another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium for automatically converting an HTTP application into a serverless function, the non-transitory computer-readable medium having computer-readable program instructions stored thereon that, when executed by one or more processors, cause the one or more processors to perform the method as described above.
According to yet another aspect of the present disclosure, there is provided a computer program product for automatically converting an HTTP application into a serverless function, comprising computer readable program instructions which, when executed by one or more processors, cause the one or more processors to perform any of the methods as described herein.
Other features and advantages of the present disclosure will become apparent from the following description with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain, without limitation, the principles of the disclosure. Like reference numerals are used to denote like items throughout the various figures.
Fig. 1 is a flowchart illustrating a method for automatically converting HTTP applications to serverless functions, according to an embodiment of the present disclosure.
Fig. 2 is a schematic diagram illustrating a general hardware environment in which a system according to an embodiment of the present disclosure may be implemented.
Detailed Description
In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the described exemplary embodiments. It will be apparent, however, to one skilled in the art that the described embodiments may be practiced without some or all of these specific details. In the described exemplary embodiments, well known structures or processing steps have not been described in detail in order to avoid unnecessarily obscuring the concepts of the present disclosure.
The blocks within each block diagram shown below may be implemented by hardware, software, firmware, or any combination thereof to implement the principles of the present disclosure. It will be appreciated by those skilled in the art that the blocks described in each block diagram may be combined or divided into sub-blocks to implement the principles of the present disclosure.
The steps of the methods presented in this disclosure are intended to be illustrative. In some embodiments, the method may be accomplished with one or more additional steps not described and/or without one or more of the steps discussed. Furthermore, the order in which the steps of a method are illustrated and described is not intended to be limiting.
HTTP applications and serverless functions are different frameworks. Traditionally, developers have needed to develop and deploy applications separately for these two frameworks. When a developer has developed an HTTP application, the developer may need to manually re-develop or deploy code for the framework of the serverless cloud platform if it is desired to apply it to the serverless cloud function computing platform. This would take time and effort.
Thus, the present disclosure proposes automatically converting HTTP applications into serverless functions. However, there is currently no automated method that allows applications to flexibly migrate to cloud function computing platforms. Accordingly, there is a need for a method and system for automatically converting HTTP applications to serverless functions, and for enabling automatic deployment and configuration to enable developers to conveniently and quickly convert existing HTTP applications to serverless applications.
Embodiments of the present disclosure relate to methods, systems, computer readable media, and computer program products for automatically converting HTTP applications to server-less functions. The method comprises the following steps: loading a code package of a user; scanning code files in the code package to determine whether one or more HTTP request processing methods are included in the scanned code files; in response to determining that the one or more HTTP request processing methods are included in the code file, for each HTTP request processing method: obtaining an HTTP method type, an access path, a class name, a method name and a parameter list of each HTTP request processing method; based on the obtained HTTP method type and access path, automatically generating a deployment code of the cloud native API; based on the obtained class names and method names, automatically generating a deployment code of the cloud native function; based on the one-to-one correspondence between the HTTP method type, the request interface identified by the access path, the class name and the request method identified by the method name, a deployment code of the configuration relation between the Yun Yuansheng API and the cloud native function is automatically generated; creating a processing class which accords with the function computing platform specification as an entry function; determining a first HTTP request processing method corresponding to a first request interface based on the first request interface contained in the first request received via the cloud native API in the entry function conforming to the function computing platform specification; and executing the first HTTP request processing method through the reflection call.
By using the method and the system disclosed by the invention, the HTTP service application program can be automatically and automatically converted into the server application based on cloud function calculation, so that the time and effort for manual deployment and configuration are saved. The method is universal, can span development languages and various http frameworks, and enables a large number of developers to conveniently convert the existing application into a server application. In addition, the method greatly reduces the difficulty and complexity of deployment by automatically generating the cloud API, the cloud function and the deployment code of the relation between the API and the function. The method also utilizes the advantages of the cloud function computing platform, so that the application can quickly respond to the request and simultaneously save computing resources and cost. In addition, the method can automatically generate the configuration relation between the cloud API and the cloud function, so that the application can be easily and transversely expanded, and high concurrency situations can be dealt with.
An example flow of a method for automatically converting an HTTP application into a serverless function according to an embodiment of the present disclosure will be described below with reference to fig. 1.
Fig. 1 is a flowchart illustrating a method 100 for automatically converting HTTP applications to serverless functions, according to an embodiment of the present disclosure.
The method 100 may include loading a code package of a user in operation 101. Next, in operation 102, the code files in the code package may be scanned to determine whether one or more HTTP request processing methods are included in the scanned code files. If yes, continue operation 103; if not, the process of method 100 ends.
For example, determining the HTTP request processing method may be performed by: for the scanned code file, a method conforming to specifications of various HTTP frameworks for HTTP request processing methods is determined as an HTTP request processing method.
Here, the specification of the HTTP framework for the HTTP request processing method may include: the HTTP frame has annotations specified for the HTTP request processing method. Then, determining the HTTP request processing method may include: in response to one or more methods having the above-specified annotations, the one or more methods are determined to be HTTP request processing methods. For example, for the HTTP framework of the Java language, annotations pertaining to HTTP request processing methods may include: @ GetMapping, @ PostMapping, @ PutMapping, @ DeleteMapping, or @ PatchMapping, etc. For example, @ GetMapping shown here may be tied to the GET method. Note that the note of the HTTP request processing method is merely an example, and is not limited thereto. Likewise, different HTTP frameworks have different specifications for HTTP request processing methods, and the form of the specifications in this disclosure is not limited to the manner in which annotations are employed.
Continuing with method 100, in response to determining that the one or more HTTP request processing methods are included in the code file, i.e., the determination of operation 102 is "Yes," operations 103-106 are performed for each HTTP request processing method. Since multiple HTTP request processing methods may be identified by the scan, operations 103-106 may be performed for each HTTP request processing method. In some embodiments, these operations may be performed in a loop to complete the deployment of all identified HTTP processing request methods.
In operation 103, an HTTP method type, an access path, a class name, a method name, and a parameter list of each HTTP request processing method are obtained. Here, for each HTTP request processing method, the obtained HTTP method type, access path, class name, method name, and parameter list may be stored as a data structure, for example, as JSON body. An example representation of the acquired information or stored data structure is shown below.
In the above example representation, both httpMethod and urlPath can be obtained from the HTTP interface, where the httpMethod item represents the HTTP method type and the urlPath item represents the access path, which can uniquely identify the HTTP request processing method. The ClassName item represents the class name, i.e. the class name of the class to which the method belongs; the methodargsList item represents a list of parameters, i.e. a list of parameters related to the method; the methodName term represents the name of the method; the combination of class name, method name and parameter list (the parameter list may be empty) can define the HTTP request processing method, and is unique.
As described above, the parameter list may be empty. In other embodiments, where the parameter list is not empty, the parameter list may include a parameter name (shown in the argsName field) and a parameter type (shown in the argsType field) for each parameter.
Continuing with the method 100, further comprising in operation 104, a deployment code for the cloud native API may be automatically generated based on the obtained HTTP method type and access path. For example, code portions corresponding to httpMethod and urlPath may be deployed to a cloud function platform, which may be abstracted into cloud resources.
In operation 105, a deployment code for the cloud native function may be automatically generated based on the obtained class name and method name. For example, code portions corresponding to className and methodName may be deployed to a cloud function platform, which may be abstracted into cloud resources.
Next, in operation 106, a deployment code of the configuration relationship between the Yun Yuansheng API and the cloud native function is automatically generated based on the one-to-one correspondence between the HTTP method type, the request interface identified by the access path, and the class name, the request method identified by the method name. Since in the cloud function platform, the interfaces and the function parts may be deployed separately, it is also necessary to configure the connection relationship between them. For each HTTP request processing method, the HTTP interface and the user method are in a one-to-one correspondence, so, for example, a connection relationship between the cloud native API and the corresponding cloud native function can be established, and the connection relationship is connected through a key (key). When the Function Key is used for connection, the corresponding cloud native API and the cloud native Function can be bound through the output value of the Function Key.
The above operations 103-106 may be performed for respective HTTP request processing methods identified by scanning.
Continuing with the method 100, further comprising creating a processing class conforming to the function computing platform specification as an entry function in operation 107. The specification requirements, entry requirements, of a cloud function computing platform may differ from the traditional HTTP framework, and thus, it is necessary to create entry functions that conform to their specifications. And for each language frame, the processing class that meets its respective specification needs to be created as an entry function according to the requirements of each language frame (e.g., the requirements of java and python may be different). The entry function may be used to receive a user request for a cloud function.
In operation 108, in the entry function conforming to the function computing platform specification, a first HTTP request processing method corresponding to the first request interface may be determined based on the first request interface included in the first request received via the cloud native API.
For example, based on a one-to-one correspondence between a request interface and a request method, a method name or a class name corresponding to the first request interface is determined, and an HTTP request processing method corresponding to the method name or the class name is determined as the first HTTP request processing method. The user request can contain information such as httpMethod and url path, and the corresponding user method function can be matched through the two items and according to the connection corresponding relation between the interface and the function, so that the matched method is determined to execute the processing of the request.
Then in operation 109, a first HTTP request processing method may be executed by the reflection call. For example, the first HTTP request processing method is executed based on the determined method name of the first HTTP request processing method by reflecting the call, and using the instance of the class and the method parameter corresponding to the class name. In operation 108, a first HTTP request processing method to invoke execution has been determined, i.e., its method name, class name, and list of required parameters are determined. Then in operation 109 the request processing method may be performed by reflecting the class name to the class and generating an instance of the class and utilizing the corresponding method parameters. Wherein the method parameters may be obtained from a user request and may be converted by a conversion operation into parameters suitable for use by the method.
Thus, the HTTP request of the user can be executed by the cloud function platform.
By using the method and the system disclosed by the invention, the HTTP service application program can be automatically and automatically converted into the server application based on cloud function calculation, so that the time and effort for manual deployment and configuration are saved. The method is universal, can span development languages and various http frameworks, and enables a large number of developers to conveniently convert the existing application into a server application. In addition, the method greatly reduces the difficulty and complexity of deployment by automatically generating the cloud API, the cloud function and the deployment code of the relation between the API and the function. The method also utilizes the advantages of the cloud function computing platform, so that the application can quickly respond to the request and simultaneously save computing resources and cost. In addition, the method can automatically generate the configuration relation between the cloud API and the cloud function, so that the application can be easily and transversely expanded, and high concurrency situations can be dealt with.
Fig. 2 is a schematic diagram 200 illustrating a general hardware environment in which a system according to an embodiment of the present disclosure may be implemented.
Referring now to FIG. 2, a schematic diagram of an example of a computing node 200 is shown. Computing node 200 is only one example of a suitable computing node and is not intended to suggest any limitation as to the scope of use or functionality of the embodiments described herein. Regardless, the computing node 200 is capable of implementing and/or performing any of the functions set forth above.
In computing node 200, there is a computer system/server 2012 that can operate in conjunction with a number of other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with computer system/server 2012 include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers systems, mainframe computer systems, distributed cloud computing environments that include any of the above systems or devices, and the like.
The computer system/server 2012 may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server 2012 may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
As shown in fig. 2, computer systems/servers 2012 in computing node 200 are shown in the form of general purpose computing devices. Components of computer system/server 2012 may include, but are not limited to: one or more processors or processing units 2016, a system memory 2028, a bus 2018 that couples various system components including the system memory 2028 to the processing unit 2016.
Bus 2018 represents any one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include, but are not limited to, industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, peripheral Component Interconnect (PCI) bus, peripheral component interconnect express (PCIe), and Advanced Microcontroller Bus Architecture (AMBA).
The computer system/server 2012 typically includes a variety of computer system readable media. Such media can be any available media that is accessed by computer system/server 2012 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 2028 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 2030 and/or cache memory 2032. The computer system/server 2012 may also include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, a storage system 2034 may be provided for reading from and writing to non-removable, non-volatile magnetic media (not shown, and commonly referred to as a "hard disk drive"). Although not shown, a magnetic disk drive may be provided for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive may be provided for reading from and writing to a removable, nonvolatile optical disk such as a CD-ROM, DVD-ROM, or other optical media. In such cases, each may be connected to bus 2018 by one or more data medium interfaces. As will be further depicted and described below, memory 2028 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the present disclosure.
By way of example, and not limitation, program/utility 2040 having a set (at least one) of program modules 2042 and an operating system, one or more application programs, other program modules, and program data can be stored in memory 2028. An operating system, one or more application programs, other program modules, and program data, or some combination thereof, may each include an implementation of a network environment. Program modules 2042 generally perform the functions and/or methodologies in the embodiments as described herein.
The computer system/server 2012 can also communicate with one or more external devices 2014 (such as a keyboard, pointing device, display 2024, etc.), one or more devices that enable a user to interact with the computer system/server 2012, and/or any devices (e.g., network cards, modems, etc.) that enable the computer system/server 2012 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 2022. Also, the computer system/server 2012 may communicate with one or more networks such as a Local Area Network (LAN), a general Wide Area Network (WAN), and/or a public network (e.g., the internet) via a network adapter 2020. As depicted, network adapter 2020 communicates with other components of computer system/server 2012 via bus 2018. It should be appreciated that although not shown, other hardware and/or software components may be utilized in conjunction with the computer system/server 2012. Examples include, but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archive storage systems, among others.
The present disclosure may be embodied as systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium(s) having computer-readable program instructions thereon for causing a processor to perform aspects of the present disclosure.
A computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices such as punch cards or in-groove bump structures having instructions stored thereon, and any suitable combination of the foregoing. A computer-readable storage medium, as used herein, is not to be construed as a transitory signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a pulse of light through a fiber optic cable), or an electrical signal transmitted through an electrical wire.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to individual computing/processing devices or over a network (e.g., the internet, a local area network, a wide area network, and/or a wireless network) to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards these computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer readable program instructions for performing the operations of the present disclosure may be assembly instructions, instruction Set Architecture (ISA) instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional over-programmed programming languages such as the "C" programming language or similar programming languages. The computer readable program instructions 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 (e.g., through the internet using an internet service provider). In some embodiments, the custom electronic circuit, including, for example, a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), may be personalized by utilizing state information of computer readable program instructions that may be executed in order to perform aspects of the disclosure.
Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
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 instructions, which comprises one or more executable instructions for implementing the specified logical function(s). 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.
Those skilled in the art will also appreciate that the various operations illustrated in the order of execution in the embodiments of the disclosure are not necessarily performed in the order illustrated. The order of operations may be adjusted as desired by those skilled in the art. Those skilled in the art may add more operations or omit some of them as desired.
The description of the various embodiments of the present disclosure has been presented for purposes of illustration, but is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the embodiments, the practical application, or the technical improvement of the technology found in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims (12)

1. A method for automatically converting an HTTP application to a serverless function, comprising:
loading a code package of a user;
scanning code files in the code package to determine whether one or more HTTP request processing methods are included in the scanned code files;
in response to determining that the one or more HTTP request processing methods are included in the code file, for each HTTP request processing method:
obtaining an HTTP method type, an access path, a class name, a method name and a parameter list of each HTTP request processing method;
based on the obtained HTTP method type and access path, automatically generating a deployment code of the cloud native API;
based on the obtained class names and method names, automatically generating a deployment code of the cloud native function; and is also provided with
Based on the one-to-one correspondence between the HTTP method type and the request interface identified by the access path and the request method identified by the class name and the method name, a deployment code of the configuration relation between the Yun Yuansheng API and the cloud native function is automatically generated;
creating a processing class which accords with the function computing platform specification as an entry function;
determining a first HTTP request processing method corresponding to a first request interface based on the first request interface contained in the first request received via the cloud native API in the entry function conforming to the function computing platform specification; and
the first HTTP request processing method is executed by the reflection call.
2. The method of claim 1, wherein determining whether the one or more HTTP request processing methods are included in the scanned code file comprises:
for the scanned code file, a method conforming to a specification of an HTTP request processing method based on the specification of the HTTP framework is determined as an HTTP request processing method.
3. The method of claim 2, wherein the specification of the HTTP framework for the HTTP request processing method comprises: having annotations specified by the HTTP framework for an HTTP request processing method, the method further comprising:
in response to one or more methods having the annotation, the one or more methods are determined to be HTTP request processing methods.
4. A method according to claim 3, wherein the annotation comprises at least one of:
@ GetMapping, @ PostMapping, @ PutMapping, @ DeleteMapping, or @ PatchMapping.
5. The method of claim 1, further comprising, for each HTTP request processing method, storing the obtained HTTP method type, access path, class name, method name, and parameter list as a data structure.
6. The method of claim 1, wherein the parameter list includes a parameter name and a parameter type for each parameter in the event that the parameter list is not empty.
7. The method of claim 1, wherein automatically generating deployment code for the configuration relationship between the Yun Yuansheng API and the cloud native function comprises: and establishing a connection relation between the Yun Yuansheng API and the corresponding cloud native function, wherein the connection relation is connected through keys.
8. The method of claim 1, wherein the first request interface includes an HTTP method type, an access path, of the first request, and determining a first HTTP request processing method corresponding to the first request interface includes:
based on the one-to-one correspondence between the request interfaces and the request methods, determining a method name or a class name corresponding to the first request interface, and determining an HTTP request processing method corresponding to the method name or the class name as a first HTTP request processing method.
9. The method of claim 1, wherein executing the first HTTP request processing method via a reflection call comprises:
the first HTTP request processing method is executed by reflecting the call based on the determined method name of the first HTTP request processing method and using the instance of the class and the method parameters corresponding to the class name.
10. A system for automatically converting HTTP applications to serverless functions, comprising:
one or more processors, and
a memory coupled to the one or more processors, the memory storing computer-readable program instructions that, when executed by the one or more processors, perform the method of any of claims 1-9.
11. A non-transitory computer readable medium having computer readable program instructions stored thereon, which when executed by one or more processors, cause the one or more processors to perform a method comprising any of claims 1-9.
12. A computer program product comprising computer readable program instructions which, when executed by one or more processors, cause the one or more processors to perform the method of any of claims 1-9.
CN202310721869.4A 2023-06-19 2023-06-19 Method, system and medium for automatically converting HTTP application into serverless function Active CN117112074B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310721869.4A CN117112074B (en) 2023-06-19 2023-06-19 Method, system and medium for automatically converting HTTP application into serverless function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310721869.4A CN117112074B (en) 2023-06-19 2023-06-19 Method, system and medium for automatically converting HTTP application into serverless function

Publications (2)

Publication Number Publication Date
CN117112074A CN117112074A (en) 2023-11-24
CN117112074B true CN117112074B (en) 2024-03-12

Family

ID=88799063

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310721869.4A Active CN117112074B (en) 2023-06-19 2023-06-19 Method, system and medium for automatically converting HTTP application into serverless function

Country Status (1)

Country Link
CN (1) CN117112074B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753302A (en) * 2018-12-19 2019-05-14 深圳晶泰科技有限公司 The method of servicing without service function based on mixing cloud computing platform
US10416996B1 (en) * 2018-05-29 2019-09-17 Nutanix, Inc. System and method for translating affliction programming interfaces for cloud platforms
CN110716765A (en) * 2019-09-29 2020-01-21 浙江网新恒天软件有限公司 Method for applying Faas to monomer
CN111279321A (en) * 2017-09-30 2020-06-12 甲骨文国际公司 Binding backend service endpoints to API functions in an API registry
CN113986222A (en) * 2021-10-29 2022-01-28 四川旅游学院 API (application programming interface) translation system for cloud computing

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8631067B2 (en) * 2010-07-01 2014-01-14 Red Hat, Inc. Architecture, system and method for providing a neutral application programming interface for accessing different cloud computing systems
JP6940751B2 (en) * 2017-05-10 2021-09-29 富士通株式会社 Information processing equipment, information processing methods and information processing programs
US10983767B2 (en) * 2019-01-04 2021-04-20 T-Mobile Usa, Inc. Microservice-based software development
US11582285B2 (en) * 2019-06-26 2023-02-14 Tencent America LLC Asynchronous workflow and task api for cloud based processing
US20200137163A1 (en) * 2019-12-20 2020-04-30 Intel Corporation Unified programming model for function as a service computing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111279321A (en) * 2017-09-30 2020-06-12 甲骨文国际公司 Binding backend service endpoints to API functions in an API registry
US10416996B1 (en) * 2018-05-29 2019-09-17 Nutanix, Inc. System and method for translating affliction programming interfaces for cloud platforms
CN109753302A (en) * 2018-12-19 2019-05-14 深圳晶泰科技有限公司 The method of servicing without service function based on mixing cloud computing platform
CN110716765A (en) * 2019-09-29 2020-01-21 浙江网新恒天软件有限公司 Method for applying Faas to monomer
CN113986222A (en) * 2021-10-29 2022-01-28 四川旅游学院 API (application programming interface) translation system for cloud computing

Also Published As

Publication number Publication date
CN117112074A (en) 2023-11-24

Similar Documents

Publication Publication Date Title
CN108196915B (en) Code processing method and device based on application container engine and storage medium
US10185558B2 (en) Language-independent program composition using containers
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN110647332A (en) Software deployment method and device based on container cloud
CN109815107B (en) Method and device for automatic testing
US10461772B1 (en) Code conversion
CN114816795A (en) Interface extension method, device, remote calling server and system
CN117112074B (en) Method, system and medium for automatically converting HTTP application into serverless function
US20180309645A1 (en) Adding voice commands to invoke web services
US10705824B2 (en) Intention-based command optimization
CN115982491A (en) Page updating method and device, electronic equipment and computer readable storage medium
US20070073902A1 (en) Information processor, information processing method and program
CN113779122B (en) Method and device for exporting data
CN117112075B (en) Method and system for automatically converting timed task applications into serverless functions
CN114238831A (en) HTML code fragment processing method, system, electronic equipment and storage medium
CN114489622A (en) Js application, electronic device, and storage medium
US11314555B2 (en) Synchronous re-execution of a data transformation operation to obtain further details regarding an exception
CN110548285B (en) Game communication control method and device, medium and electronic equipment
CN112394907A (en) Container-based delivery system construction method, application delivery method and delivery system
CN113821352A (en) Remote service calling method and device
US10795686B2 (en) Internationalization controller
US11243650B2 (en) Accessing window of remote desktop application
KR20210091327A (en) Batch processing method, apparatus, electronic device and readable storage medium of applet
CN113779018A (en) Data processing method and device
CN112882698A (en) Development environment generation method and device, computer storage medium and electronic device

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