A cloud application engine deployment method, device, equipment and storage medium for shielding web framework from users

By loading public framework scripts and user scripts into shared storage when container starts and registering as global handlers, the problem that users need to master Web frameworks and container technologies in cloud application engine deployment is solved, and the effect of reducing complexity and cost is achieved.

CN114880073BActive Publication Date: 2025-09-02NANJING XIYIN ECOMMERCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210503287.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-09
Publication Date
2025-09-02
Estimated Expiration
2042-05-09

AI Technical Summary

Technical Problem

In the deployment of existing technology, users need to master the expertise of Web framework and container technology in the deployment of cloud application engines, resulting in a high threshold for use and poor environmental migration compatibility, which cannot meet the actual needs of different users.

Method used

Reduce user implementation complexity and cost by loading public framework scripts and user scripts into shared storage when container starts and registering as global handlers, blocking web frameworks and container knowledge.

Benefits of technology

It realizes the blocking of web frameworks and container knowledge for users, reduces deployment complexity and cost, solves environmental migration compatibility issues, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114880073B_ABST
    Figure CN114880073B_ABST
Patent Text Reader

Abstract

This application discloses a cloud application engine deployment method, apparatus, device, and storage medium that shields users from Web frameworks. The method includes: executing an initialization script at container startup to download runtime environment files to a designated location in the container; the initialization script downloads a public framework script and a user script from a designated location; the initialization script specifies that the public framework script be executed using the locally downloaded runtime environment; the public framework script loads the user script and is registered as a global handler; the caller calls a Web interface, finds the corresponding handler, executes the code in the user script, and returns the result. This method aims to shield program developers from Web framework and container knowledge, reducing implementation complexity and cost, and also solving compatibility issues with runtime environment file migration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud application engine deployment, and specifically to a cloud application engine deployment method, apparatus, device, and storage medium for shielding a Web framework from users. Background Art

[0002] Most applications deployed using cloud application engines need to provide services by providing an external web interface. Taking Python as an example, most use cases involve users introducing a web framework (such as Flask) to write code that can provide a web interface. However, this approach has the following disadvantages: (1) Users may not understand the HTTP protocol and web framework. For example, the user is an engineer who develops algorithms and can only write machine learning code. In order for this code to provide external services, he has to learn the web framework or seek support from engineers who develop services. (2) When using a web framework, various additional configurations are required to achieve tuning and customization of performance, compatibility, logging, and indicator reporting. For example, Python's Flask framework needs to introduce a multi-worker service framework such as gunicorn to enhance concurrency. This customization requires professional knowledge and is difficult for users who are not full-time backend developers to master. (3) The web protocol itself may change. For example, the original Http REST protocol may need to be modified to the gRPC protocol. In this case, a major modification of the user code is required, which not only requires professional skills, but is also time-consuming and labor-intensive, and requires a lot of testing.

[0003] With the development of container (Docker) technology, serverless technology has gradually matured. Its main principle is to shield users from the underlying technical details of images, containers, clusters, etc., allowing users to focus only on their business code, leaving deployment, monitoring, dynamic scaling, and other functions to cloud service providers. This achieves zero-maintenance, on-demand usage, and payment. At the bottom level, user-uploaded code is built into an image, which can then be deployed to a container machine in the cloud. When using this product, users only need to write standard code that can run locally, without having to understand container technology.

[0004] In order to solve the problem of shielding the web interface from users during the deployment of the cloud application engine, trying to use container technology is a feasible technical idea, but it will still cause new problems. The conventional idea of ​​container technology is to embed the operating environment into the image, and each operating environment is made into a mutually isolated Docker image. However, the operating environment based on the application language is complex and changeable. In actual production practice, the users of the platform have different work backgrounds and the operating environment will also vary greatly. There are existing images that cannot meet the actual needs, which is particularly prone to compatibility issues during environment migration. At this time, users can only make Docker images themselves, and making Docker images requires relevant professional knowledge such as container technology, which is equivalent to generating new problems, such as: (1) the professional knowledge of container technology cannot be shielded, which is the same as the professional knowledge of Web technology, which not only increases the threshold for using the platform but also reduces the platform user experience; (2) the quality of the Docker images created by unprofessional users cannot be guaranteed, which is the same as the case of unprofessional users writing Web services. Summary of the Invention

[0005] One purpose of this application is to provide a cloud application engine deployment method that shields the Web framework from users. The method aims to shield program developers from Web framework and container knowledge, reducing implementation complexity and cost.

[0006] A cloud application engine deployment method for shielding a web framework from users includes the following steps:

[0007] The container starts and executes the initialization script, downloading the runtime environment file to the specified location of the container;

[0008] Initialize the script to download public framework scripts and user scripts from the designated location;

[0009] The initialization script specifies to execute the public framework script using the locally downloaded runtime environment. The public framework script loads the user script and registers it as a global handler.

[0010] The caller calls the Web interface, finds the corresponding handler, executes the code in the user script, and returns the result.

[0011] Optionally, the runtime environment files are software and resources for Python language application instances; the runtime environment files for the programming language include a basic language library and an extension library. The Python language uses the Conda package management tool, and its runtime environment files are in a Conda subdirectory.

[0012] Optionally, the public framework script includes a Web framework and a script for loading user data, and the user script includes user code and data.

[0013] Optionally, before the container starts executing the initialization script, the debugged operating environment file, the common framework script and the user script are uploaded to the shared storage, and the upload address is configured on the container.

[0014] Optionally, before the container starts to execute the initialization script, the Docker image of the container is a standard Linux image and does not include a running environment for the programming language.

[0015] Optionally, it is characterized in that the shared storage is a distributed storage system.

[0016] The method of this application provides a new deployment method. During the operation of the cloud service engine, the public framework script (including the web framework and the script for loading user data) is first loaded when the container starts. The public framework script then loads the user script (including user code and data) and registers it in the global handler table. After that, external requests received can be passed to the corresponding global handler, thereby executing the user code and automatically registering it as an external web interface. This method shields users from the knowledge of the web framework, does not require program developers to master professional web framework programming knowledge, and reduces implementation complexity and cost.

[0017] In addition, this application is different from the conventional thinking of container technology. The conventional thinking of container technology is to make each operating environment into a Docker image. However, due to the complexity of the additional configuration of the Web framework and the variability of the Web protocol, the above method cannot meet actual needs and has poor compatibility. This application does not put the operating environment of the software Python (that is, the version of Python, which packages are installed) in the image, but puts the operating environment into shared storage. The image is just a bare Linux, and it may not even have Python. The operating environment file is downloaded to the specified location of the container when the container is started. The solution of this application is equivalent to shielding the user from container knowledge and also solves the compatibility problem of environment migration.

[0018] The present application also provides a cloud application engine deployment device that shields the Web framework from users, aiming to achieve the invention purpose of the above method. The device includes: a downloading runtime environment file module, which is used for the container to start executing the initialization script and download the runtime environment file to the specified location of the container; a downloading public framework script module, which is used to enable the initialization script to download the public framework script to the specified location; a downloading user script module, which is used to enable the initialization script to download the user script to the specified location; an execution module, in which the initialization script specifies to execute the public framework script with the downloaded local runtime environment, the public framework script loads the user script and is registered as a global handler; a calling module, which is used for the caller to call the Web interface, execute the code in the user script after finding the corresponding handler, and return the result.

[0019] The present application also provides an electronic device, comprising a processor and a memory storing a computer program, wherein when the processor executes the computer program, the steps of the cloud application engine deployment method for shielding the web framework from the user as described above are implemented.

[0020] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the cloud application engine deployment method for shielding the web framework from users as described above are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flow chart of a method according to an embodiment of the present application;

[0022] Figure 2 A schematic diagram of the data processing flow corresponding to the embodiment of the present application;

[0023] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described below are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0025] In response to the problems existing in the background technology of this application, an embodiment of this application proposes a cloud application engine deployment method that shields the Web framework from users.

[0026] Figure 1 is a flow chart of the deployment method of this embodiment, as shown in FIG. Figure 1 As described above, the process includes:

[0027] Step (101) uploads the debugged operating environment files, public framework scripts and user scripts to the shared storage, and configures the upload address on the container.

[0028] The programming language used in this application can be Python or other programming languages. This embodiment is explained in Python. The uploaded runtime environment file refers to the software and resources of the application instance of Python. The runtime environment file of the programming language includes the basic language library and the extension library. Python uses the Conda package management tool, and its runtime environment file is the Conda subdirectory. Copying this directory can realize the migration of the environment.

[0029] Programming language scripts can include public scripts and user scripts. Public scripts are generally service-layer scripts shared by multiple users, while user scripts are scripts for individual users. The public framework script in this embodiment includes a web framework and a script that loads user data. The announcement framework script then loads user scripts containing user code and data.

[0030] In this embodiment, the debugged operating environment files, public framework scripts and user scripts are uploaded to the shared storage. The shared storage here can be a distributed storage system, specifically a Ceph distributed storage system or other distributed storage systems. The Ceph distributed storage system is a distributed file system with excellent performance, high reliability and strong scalability, which can support cluster distributed reading.

[0031] Step (102) starts the container, executes the initialization script, and downloads the operating environment to the specified location in the container from the specified address.

[0032] In the embodiment of the present application, the Docker image of the container is just a standard Linux image and does not contain the runtime environment of the current programming language; the user copies the locally debugged environment directory as a whole to the shared storage; the startup operation of the container is to first download the environment directory uploaded by the user into the container, and then use this runtime environment to run the aforementioned program script.

[0033] The conventional idea of ​​container technology is to make each operating environment into a Docker image, but this approach cannot meet actual needs, has poor compatibility, and cannot solve the problems of the complexity of additional configuration of the Web framework and the variability of the Web protocol.

[0034] In particular, unlike Docker images, which already contain the application instance's runtime environment, this method doesn't place the Python runtime environment (that is, the Python version and installed packages) in the Docker image. Instead, it also places the runtime environment in shared storage. The image is just a bare Linux, and may even lack Python. The runtime environment files are downloaded to a designated location in the container when the container starts, and then the aforementioned program script is run using this runtime environment. This solution shields users from container knowledge and solves compatibility issues during environment migration.

[0035] Step (103) initialization script downloads public framework script and user script from designated location;

[0036] Step (104) The initialization script specifies to execute the public framework script using the locally downloaded runtime environment, and the public framework script loads the user script and is registered as a global handler;

[0037] Here, the public framework script of this embodiment includes a Web framework and a script for loading user data, and the announcement framework script then loads a user script including user code and data.

[0038] It can be understood that a specific embodiment of the public framework script can be a Tornado service, a Flask service or a Django service, which are all existing services that support network request calls.

[0039] A global handler is a function in a user script. Once registered as a global handler, it can be located by a unique name and called.

[0040] Step (105) The caller calls the Web interface, finds the corresponding handler, executes the code in the user script, and returns the result.

[0041] After that, the external requests received can be passed to the corresponding global handler, thereby executing the user code and automatically registering it as an external Web interface.

[0042] Figure 2 This is a flow chart of data processing corresponding to an embodiment of the present application, including containers and shared storage. The shared storage is where platform users upload Conda environment directories, framework scripts, and user scripts. The Conda environment directory contains Python language runtime environment files, and copying this directory can achieve environment migration. The framework script is a public framework script that contains a web framework and a script that loads user data. The user script includes user code and data.

[0043] After the container is started, the initialization script is executed first, and a request is sent to the shared storage to download the operating environment. The shared storage returns information, and the container downloads the operating environment to the specified location in the container at the specified address. The operating environment refers to the software and resources of the application instance of the Python language; the operating environment files of the program language include the basic language library and the extension library. The Python language uses the Conda package management tool, and its operating environment files are Conda subdirectories. Copying this directory can achieve environment migration. Then the initialization script issues a request to download the first data, and the shared storage returns information, and the public framework script is downloaded to the specified location of the container. The initialization script issues a request to download the second data, and the shared storage returns information, and the user script is downloaded to the specified location of the container. Next, the initialization script specifies to use the downloaded local operating environment to execute the public framework script, and the public framework script loads the user script and registers it as a global handler.

[0044] The caller requests to call the Web interface. After the container finds the corresponding handler, it executes the code in the user script and returns the result.

[0045] The above is a detailed description of an embodiment of a cloud application engine deployment method for shielding a Web framework from a user provided by the present application. The following is a detailed description of an embodiment of a cloud application engine deployment device for shielding a Web framework from a user provided by the present application. The cloud application engine deployment device for shielding a Web framework from a user described below and the cloud application engine deployment method for shielding a Web framework from a user described above can be referenced to each other.

[0046] The above deployment device includes:

[0047] The runtime environment file download module is used to start the container and execute the initialization script to download the runtime environment file to the specified location of the container;

[0048] Download the public framework script module, which is used to enable the initialization script to download the public framework script from the specified location;

[0049] Download user script module, used to enable the initialization script to download user scripts from the specified location;

[0050] Execution module, the initialization script specifies to use the downloaded local runtime environment to execute the public framework script, the public framework script loads the user script and registers it as a global handler;

[0051] The calling module is used by the caller to call the Web interface, find the corresponding handler, execute the code in the user script, and return the result.

[0052] Figure 3 The following is a schematic diagram of the physical structure of an electronic device. Figure 3As shown, the present invention further provides an electronic device, which may include: a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other via the communication bus 340. The processor 310 may call a computer program in the memory 330 to execute the steps of a cloud application engine deployment method for shielding a web framework from a user, for example, including:

[0053] The container starts and executes the initialization script, downloading the runtime environment file to the specified location of the container;

[0054] Initialize the script to download public framework scripts and user scripts from the designated location;

[0055] The initialization script specifies to execute the public framework script using the locally downloaded runtime environment. The public framework script loads the user script and registers it as a global handler.

[0056] The caller calls the Web interface, finds the corresponding handler, executes the code in the user script, and returns the result.

[0057] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0058] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, wherein the processor-readable storage medium stores a computer program, and the computer program is used to cause the processor to execute the steps of the methods provided in the above embodiments, for example, including:

[0059] The container starts and executes the initialization script, downloading the runtime environment file to the specified location of the container;

[0060] Initialize the script to download public framework scripts and user scripts from the designated location;

[0061] The initialization script specifies to execute the public framework script using the locally downloaded runtime environment. The public framework script loads the user script and registers it as a global handler.

[0062] The caller calls the Web interface, finds the corresponding handler, executes the code in the user script, and returns the result.

[0063] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO)), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROMs, EPROMs, EEPROMs, non-volatile memories (NANDFLASH), solid-state drives (SSDs)), etc.

[0064] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0065] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A cloud application engine deployment method that shields users from Web frameworks, characterized in that The steps include: The container starts executing the initialization script, downloading the runtime environment file from the shared storage to the specified location of the container. Before the container starts executing the initialization script, the Docker image of the container is a standard Linux image and does not contain the runtime environment of the programming language; Initialize the script to download public framework scripts and user scripts from the designated location; The initialization script specifies to execute the public framework script using the locally downloaded runtime environment. The public framework script loads the user script and registers it as a global handler. The caller calls the Web interface, finds the corresponding handler, executes the code in the user script, and returns the result. After that, the external request received can be passed to the corresponding global handler, thereby executing the user code and automatically registering it as an external Web interface; The operating environment file is the software and resources of the application instance of the programming language; the operating environment file of the programming language includes a basic language library and an extension library.

2. The cloud application engine deployment method for shielding a web framework from users according to claim 1, characterized in that: The operating environment file is the software and resources of the application instance of the Python language.

3. According to the cloud application engine deployment method for shielding the user from the Web framework according to claim 2, the Python language uses the Conda package management tool, and its operating environment file is the Conda subdirectory.

4. The cloud application engine deployment method for shielding a web framework from users according to claim 1, characterized in that: The public framework script includes a Web framework and a script for loading user data, and the user script includes user code and data.

5. The cloud application engine deployment method for shielding a web framework from users according to claim 1, characterized in that: Before the container starts executing the initialization script, the debugged operating environment files, public framework scripts and user scripts are uploaded to the shared storage, and the upload address is configured on the container.

6. The cloud application engine deployment method for shielding a web framework from users according to claim 5, characterized in that: The shared storage is a distributed storage system.

7. A cloud application engine deployment device that shields users from Web frameworks, characterized in that: include: The runtime environment file download module is used to start the container and execute the initialization script. It downloads the runtime environment file from the shared storage to the specified location of the container. Before the container starts and executes the initialization script, the Docker image of the container is a standard Linux image and does not contain the runtime environment of the programming language. Download the public framework script module, which is used to enable the initialization script to download the public framework script from the specified location; Download user script module, used to enable the initialization script to download user scripts from the specified location; Execution module, the initialization script specifies to use the downloaded local runtime environment to execute the public framework script, the public framework script loads the user script and registers it as a global handler; The calling module is used by the caller to call the Web interface, find the corresponding handler, execute the code in the user script, and return the result. After that, the external request received can be passed to the corresponding global handler to execute the user code and automatically register it as an external Web interface; The operating environment file is the software and resources of the application instance of the programming language; the operating environment file of the programming language includes a basic language library and an extension library.

8. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the steps of the cloud application engine deployment method for shielding a web framework from a user as described in any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the cloud application engine deployment method for shielding a web framework from a user as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Data processing method and device, electronic equipment and computer storage medium

    CN111177008A