A method, device and equipment for running and accessing an application

By building a target container that integrates data management and proxy service plug-ins, the problem of resource waste in the Docker cluster is solved, and multiple applications are deployed and accessed simultaneously, increasing the utilization rate of server resources.

CN113760442BActive Publication Date: 2024-12-03BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011121592.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-19
Publication Date
2024-12-03
Estimated Expiration
2040-10-19

AI Technical Summary

Technical Problem

Each container in the Docker cluster can only deploy one application to be tested, resulting in high idle rate of server resources and waste of resources.

Method used

Build a target container that integrates data management plug-in and proxy service plug-in, run multiple applications through data management plug-in, and access these applications through proxy service plug-in, so as to achieve simultaneous deployment and access of multiple applications.

Benefits of technology

Effective utilization of server resources improves the utilization rate of server resources and avoids idle resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760442B_ABST
    Figure CN113760442B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method for running and accessing an application, the method comprising: constructing a target container integrated with a data management plug-in and a proxy service plug-in; wherein the data management plug-in is used to manage applications; the proxy service plug-in is used to access applications; the target container is used to deploy multiple applications; the multiple applications are run through the data management plug-in; and the multiple applications are accessed through the proxy service plug-in. The embodiment of the present application also discloses an application running and accessing device, equipment, and computer-readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and computer-readable storage medium for running and accessing an application. Background Art

[0002] Before each application is launched on the platform, its related functions need to be tested and verified. In relative technology, most of them use Docker clusters to deploy the application to be tested to complete related testing work. This leads to a high server resource idle rate because each Docker in the Docker cluster can only deploy one application to be tested, which in turn leads to serious waste of server resources. Summary of the invention

[0003] To solve the above technical problems, the embodiments of the present application hope to provide a method, device, equipment and computer-readable storage medium for running and accessing an application, so as to reasonably utilize server resources and thereby improve the utilization rate of server resources.

[0004] To achieve the above purpose, the technical solution of this application is implemented as follows:

[0005] A method for running and accessing an application, the method comprising:

[0006] Constructing a target container integrated with a data management plug-in and a proxy service plug-in; wherein the data management plug-in is used to manage applications; the proxy service plug-in is used to access applications; and the target container is used to deploy multiple applications;

[0007] Running the plurality of applications through the data management plug-in;

[0008] The plurality of applications are accessed through the proxy service plug-in.

[0009] In some embodiments, constructing a target container integrated with a data management plug-in and a proxy service plug-in includes:

[0010] Build a base image;

[0011] Create a configuration file corresponding to the data management plug-in;

[0012] The configuration file is imported into the base image, and the base image is processed to generate the target container.

[0013] In some implementations, building a base image includes:

[0014] Creating a basic file corresponding to the target container, and running the basic file to generate a target image;

[0015] Acquire a basic toolkit, a first resource corresponding to the data management plug-in, and a second resource corresponding to the proxy service plug-in; wherein the basic toolkit includes basic resources required to build the target container;

[0016] The basic toolkit, the first resource, and the second resource are imported into the target image to generate the basic image.

[0017] In some implementations, running the plurality of applications through the data management plug-in includes:

[0018] Obtaining source files of each application through the data management plug-in;

[0019] The source file of each application is compiled by the data management plug-in to generate the target code of each application, and each application is run based on the target code of each application.

[0020] In some implementations, obtaining the source file of each application through the data management plug-in includes:

[0021] Obtaining a target address for each application;

[0022] Based on the target address, the source file of each application is obtained through the data management plug-in.

[0023] In some implementations, accessing the plurality of applications through the proxy service plug-in includes:

[0024] Obtaining, through the proxy service plug-in, a first configuration file for each application;

[0025] Based on the first configuration file of each application, each application is accessed.

[0026] In some implementations, obtaining the first configuration file of each application through the proxy service plug-in includes:

[0027] Acquire a target area of ​​the target container; wherein the target area is used to store configuration files required to access each application in the target container;

[0028] The first configuration file of each application is obtained from the target area through the proxy service plug-in.

[0029] In some embodiments, the method further comprises:

[0030] Obtain a second configuration file of the application to be processed;

[0031] Based on the second configuration file, the first configuration file stored in the target area is updated to a third configuration file; wherein the third configuration file includes the first configuration file of each application and the second configuration file of the application to be processed.

[0032] An application running and accessing device, comprising: a building module, a running module and an accessing module;

[0033] The construction module is used to construct a target container integrated with a data management plug-in and a proxy service plug-in; wherein the data management plug-in is used to manage applications; the proxy service plug-in is used to access applications; and the target container is used to deploy multiple applications;

[0034] The running module is used to run the multiple applications through the data management plug-in;

[0035] The access module is used to access the multiple applications through the proxy service plug-in.

[0036] An application running and accessing device, comprising: a processor, a memory and a communication bus;

[0037] The communication bus is used to realize the communication connection between the processor and the memory;

[0038] The processor is used to execute the program in the memory to implement any of the above-mentioned application operation and access methods.

[0039] A computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the above-mentioned application running and access method.

[0040] The application running and accessing method, apparatus, device and computer-readable storage medium provided in the embodiments of the present application construct a target container integrated with a data management plug-in and a proxy service plug-in; wherein the data management plug-in is used to manage the application; the proxy service plug-in is used to access the application; the target container is used to deploy multiple applications; multiple applications are run through the data management plug-in; and multiple applications are accessed through the proxy service plug-in. In this way, multiple applications can be run and accessed at the same time by constructing a target container integrated with a data management plug-in and a proxy service plug-in, instead of only being able to deploy one application to be tested in each Docker as in the relative technology, thereby improving the utilization rate of server resources by rationally utilizing server resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A flowchart of a method for running and accessing an application provided in an embodiment of the present application;

[0042] Figure 2 A flowchart of another method for running and accessing an application provided in an embodiment of the present application;

[0043] Figure 3 A flowchart of another method for running and accessing an application provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of putting domain name proxies of the same group of projects provided in an embodiment of the present application into the same Nginx configuration file;

[0045] Figure 5 A flowchart of a specific implementation flowchart for running and accessing multiple applications in a target Docker provided in an embodiment of the present application;

[0046] Figure 6 A schematic diagram of the structure of an application operation and access device provided in an embodiment of the present application;

[0047] Figure 7 A schematic diagram of the structure of an application operation and access device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0049] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0050] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the present application.

[0051] The embodiment of the present application provides an application operation and access method, which is applied to an application operation and access device, referring to Figure 1 , the method comprises the following steps:

[0052] Step 101: Build a target container that integrates a data management plug-in and a proxy service plug-in.

[0053] Among them, the data management plug-in is used to manage applications; the proxy service plug-in is used to access applications; and the target container is used to deploy multiple applications.

[0054] In an embodiment of the present application, a data management plug-in may be a tool for processing data or building source code. Furthermore, a data management plug-in may be used to compile source code for different types of applications. At the same time, a data management plug-in may also be a continuous integration tool, that is, a data management plug-in is used to monitor continuously repetitive work. In the following embodiments of the present application, Jenkins is used as an example for explanation.

[0055] In the embodiments of the present application, the proxy service plug-in can be a high-performance HyperText Transfer Protocol (HTTP) and reverse proxy Web server; in the following embodiments of the present application, Nginx is used as an example for explanation; wherein, Nginx can be compiled and run on most operating systems: Unix, Linux and OS, and has a Windows ported version.

[0056] Among them, Nginx is an HTTP server that can display static files on the server: Hypertext Markup Language (HTML) and pictures on the client through the HTTP protocol.

[0057] It should be noted that the target container can be an open source application container engine; in the embodiments of the present application, the target Docker is used as an example of a container for explanation; wherein, the target Docker can enable users to package developed applications and dependency packages into a lightweight, portable container, and then publish them to any popular Linux machine. At the same time, the target Docker can also realize virtualization.

[0058] It should be noted that Docker can provide a complete environment required for the application to run. In addition to the application itself, all dependencies, class libraries, other binary files, and configuration files required to run the application can be unified into a package called an image. Among them, Docker's implementation technology is based on open standards and can run on any operating system. The operating system can be but not limited to Windows operating system, Linux operating system or Android operating system, etc. The specific Windows operating system can be but not limited to Windows 8 operating system, Windows 10 operating system, etc.

[0059] It should be noted that the target Docker is a container integrated with Jenkins and Nginx; the specific integration implementation scheme is not limited in this application.

[0060] Step 102: Run multiple applications through the data management plug-in.

[0061] In an embodiment of the present application, the application running and access device compiles the codes of multiple applications inside the target Docker through Jenkins; wherein the multiple applications can be applications of the same type or different types.

[0062] It should be noted that Jenkins can provide an open source, scalable web-based interface platform for continuous integration, delivery, and deployment.

[0063] Among them, Jenkins is used to achieve continuous integration and delivery of multiple different applications. In a feasible implementation method, after the basic functional components of the application are completed, the developed Jenkins is used to adapt the basic functions of the application and build and package it, so that the application developer can test the build output package or release the version.

[0064] Step 103: Access multiple applications through the proxy service plug-in.

[0065] In an embodiment of the present application, the application running and access device can access multiple applications running inside the target Docker through Nginx; wherein, Nginx is based on the Representational State Transfer (REST) ​​architectural style, uses the Uniform Resource Locator (URL) or Uniform Resource Identifier (URI) as the communication basis, and provides various network services through the HTTP protocol; wherein, URI is a string used to identify the name of an Internet resource.

[0066] It should be noted that on the server network, each information resource has a unified and unique address on the Internet, which is the URL, which is the uniform resource locator of the server network, that is, the network address; among them, the URL can be composed of three parts: resource type, host domain name where the resource is stored, and resource file name, or composed of four parts: protocol, host, port, and path.

[0067] The application running and accessing method provided in the embodiment of the present application constructs a target container integrated with a data management plug-in and a proxy service plug-in; runs multiple applications through the data management plug-in; accesses multiple applications through the proxy service plug-in; in this way, by constructing a target container integrated with a data management plug-in and a proxy service plug-in, multiple applications can be run and accessed at the same time, server resources can be used reasonably, thereby improving the utilization rate of server resources.

[0068] Based on the above embodiments, the embodiments of the present application provide a method for running and accessing an application. Figure 2 As shown, the method comprises the following steps:

[0069] Step 201: The application runs and accesses the device to build a basic image.

[0070] In an embodiment of the present application, the running and access devices of the application build a basic image based on the Dockerfile file; wherein, the Dockerfile file is a text file used to build an image, and the content of the Dockerfile file contains multiple instructions and descriptions required for building the image; at the same time, the Dockerfile file is generally divided into four parts: basic image information, maintainer information, image operation instructions, and instructions executed when the container is started.

[0071] Step 202: The application runs and the access device creates a configuration file corresponding to the data management plug-in.

[0072] In an embodiment of the present application, the application's running and access devices create Jenkins by debugging the Jenkins configuration file; wherein, Jenkins can be developed in the target Docker by creating the required log path in the Jenkins application repository; wherein, the log mainly includes the requested resource path, server response status, request source, resource size, and user browser ID, etc.

[0073] It should be noted that the log is the Nginx request log, which is used to store the user's access to Jenkins inside the target Docker, as well as the Nginx access log compiled by Jenkins to provide users with access to applications running in the target Docker; among them, the application's operation and the access record of the access device to any application running on the target Docker will be recorded in the Nginx request log; among them, the Nginx request log is mainly used to analyze the source of the request and monitor whether there are malicious requests.

[0074] In a feasible implementation, Nginx request logs may contain the following information:

[0075] "@timestamp":"2020-09-10T11:16:42+08:00","@fields":{"request":"GET / static-shop-common / page / home.bundle.js HTTP / 1.1","status":"200","http_referrer":"http: / / jshopx.jd.com / ","remote_addr":"172.22.141.3","remote_user":"-","bytes_sent":"15897","body_byt es_sent":"15614","request_time":"0.000","upstream_response_time":"-","http_x_forwarded_for":"-","http_user_agent":"Mozilla / 5.0(Macintosh; Intel Mac OS X 10_14_6)AppleWebKit / 537.36(KHTML,like Gecko)Chrome / 85.0.4183.83Safari / 537.36"}

[0076] At the same time, to create Jenkins, you need to write the start.sh file and the stop.sh file in Jenkins; among them, the start.sh file is mainly responsible for starting Nginx and Jenkins integrated in the target Docker.

[0077] In one possible implementation, creating an Nginx request log, starting Nginx, and starting the Jenkins service can be achieved through the following code:

[0078] #Create Nginx request log

[0079] touch / export / Logs / nginx / nginx_access.log

[0080] touch / export / Logs / nginx / nginx_error.log

[0081] #Start Nginx

[0082] nginx-c / opt / nginx / conf / nginx.conf

[0083] #Start the Jenkins service

[0084] java-jar / jenkins.war--httpPort=8080

[0085] Among them, the code corresponding to creating the Nginx request log is represented by creating the nginx_access.log log on the target Docker to show the normal response of the server to the user, and the nginx_error.log log on the fault information of Nginx operation; the code corresponding to starting Nginx is represented by starting Nginx, after which the user can access all applications deployed on the target Docker; the code corresponding to starting the Jenkins service is represented by starting Jenkins, after which the user can access Jenkins deployed on the target Docker.

[0086] At the same time, when creating Jenkins, you also need to write the stop.sh file in Jenkins. The stop.sh file is the core file for implementing static resource access. The configuration file in the Nginx directory is copied to the configuration directory of the target Docker, and Nginx is started again to reload the configuration file.

[0087] In one possible implementation, stopping Nginx, copying the Nginx configuration, and starting Nginx can be accomplished with the following code:

[0088] #Stop Nginx

[0089] nginx -s stop

[0090] #Copy Nginx configuration

[0091] cp / root / .jenkins / workspace / nginx-domains / domains / * / opt / nginx / conf / domains /

[0092] cp / root / .jenkins / workspace / nginx-domains / mime.types / opt / nginx / conf /

[0093] cp / root / .jenkins / workspace / nginx-domains / nginx.conf / opt / nginx / conf /

[0094] #Start Nginx

[0095] nginx-c / opt / nginx / conf / nginx.conf

[0096] Among them, the code corresponding to stop Nginx means stopping the Nginx service and ending all running Nginx processes; the code corresponding to copy Nginx configuration means copying Nginx configuration, which will copy all configuration files in the relevant Nginx configuration application to the Nginx installation directory on the target Docker; the main function here is to enable Nginx to proxy to different applications compiled by Jenkins, so that users can access them; the code corresponding to start nginx means starting the nginx service, at which time all copied configuration files are effective; all applications compiled by Jenkins can also be accessed.

[0097] Step 203: The application running and accessing device imports the configuration file into the base image, and processes the base image to generate a target container.

[0098] In an embodiment of the present application, the application running and access device can process the application repository and basic image corresponding to Jenkins, form a target container and publish it online.

[0099] Step 204: The application running and access device obtains the source file of each application through the data management plug-in.

[0100] In an embodiment of the present application, the application running and access device is based on installing a git parameter plug-in to configure Jenkins integrated in the target Docker, and based on the Jenkins, source files corresponding to multiple applications are pulled from the warehouse addresses corresponding to the multiple applications.

[0101] It should be noted that the source file is a source file written by the application developer using the voice supported by the development tool; wherein the source file is an ordered arrangement of numbers or letters.

[0102] Among them, Jenkins can use the HTTP protocol to obtain source files, and can also use the Secure Shell (SSH) protocol to obtain source files, and this application does not impose any restrictions on this.

[0103] Step 205: Application operation and access The device compiles the source file of each application through the data management plug-in to generate the target code of each application, and runs each application based on the target code of each application.

[0104] In an embodiment of the present application, the application running and access device compiles the source file of each application through Jenkins to generate the corresponding target code of each application, and processes the target code of each application to run each application.

[0105] Step 206: The application running and accessing device obtains the first configuration file of each application through the proxy service plug-in.

[0106] The application operation and access device is implemented by creating Nginx and configuring tasks corresponding to the successfully created Nginx to access or test each application running in the target Docker.

[0107] Step 207: Application execution and access The device accesses each application based on the first configuration file of each application.

[0108] In an embodiment of the present application, the application running and access device pulls the corresponding configuration file based on Nginx to access each application deployed in the target Docker; wherein, whether the application in the target Docker runs normally can be determined based on whether it can be accessed normally. If it cannot be accessed normally, the reason can be checked based on the Nginx request log.

[0109] It should be noted that the policy used to access the application running in the target Docker is based on the matching policy of Nginx.

[0110] In a feasible implementation, the configuration file in Nginx: static1.xx.com / a can be written as the following code:

[0111] location^~ / a{

[0112] alias / export / jenkins / workspace / a / dist;

[0113] }

[0114] Among them, this code indicates that Nginx matches the files under the static1.xx.com / a path, and returns the files under the / export / jenkins / workspace / a / dist path.

[0115] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0116] The application running and accessing method provided in the embodiment of the present application constructs a target container integrated with a data management plug-in and a proxy service plug-in to run and access multiple applications at the same time, thereby rationally utilizing server resources and improving the utilization rate of server resources.

[0117] Based on the above embodiments, the embodiments of the present application also provide a method for running and accessing an application, such as Figure 3As shown, the method comprises the following steps:

[0118] Step 301: The application runs and the access device creates a basic file corresponding to the target container, and runs the basic file to generate a target image.

[0119] In an embodiment of the present application, the application running and access device can create basic files based on shell commands, that is, write a Dockerfile file, and build a target image based on the Dockerfile file; wherein the Dockerfile file is a text document containing commands for assembling images.

[0120] It should be noted that the target Docker can automatically generate an image by reading the instructions in the Dockerfile file.

[0121] Step 302: The application running and accessing device obtains a basic toolkit, a first resource corresponding to the data management plug-in, and a second resource corresponding to the proxy service plug-in.

[0122] The basic toolkit includes the basic resources required to build the target container.

[0123] In an embodiment of the present application, the application's running and access device obtains a basic toolkit, an installation package corresponding to Jenkins, and an installation package corresponding to Nginx to build a target Docker integrated with Jenkins and Nginx; wherein the first resource is the installation package corresponding to Jenkins, and the second resource is the installation package corresponding to Nginx.

[0124] Among them, the basic toolkit includes at least: Node.js installation package (global variables have been set), image source management tool (npm registry manager, nrm) dependency package (set the dependency package download source accordingly), Node service process management tool PM2 and webpack packaging tool; among them, Node.js is a compiled language running on the server; webpack packaging tool is a code compilation tool with corresponding entry, exit, loader and plug-in.

[0125] Step 303: The application running and accessing device imports the basic toolkit, the first resource and the second resource into the target image to generate a basic image.

[0126] In an embodiment of the present application, the application running and access device downloads the operating environment, dependency packages, and private service sources required for the service into the target image, that is, the application running and access device imports the above-mentioned basic toolkit, the installation package corresponding to Jenkins, and the installation package corresponding to Nginx into the target image and generates a basic image.

[0127] Step 304: The application runs and the access device creates a configuration file corresponding to the data management plug-in.

[0128] Step 305: The application running and accessing device imports the configuration file into the base image, and processes the base image to generate a target container.

[0129] Step 306: The application execution and access device obtains the target address of each application.

[0130] In an embodiment of the present application, an application running and accessing device obtains repository address information of source codes corresponding to multiple applications developed by multiple developers.

[0131] Step 307: The application running and access device obtains the source file of each application through the data management plug-in based on the target address of each application.

[0132] In an embodiment of the present application, the application running and access device pulls the source code, i.e., the source file, corresponding to each application from the warehouse address corresponding to each application based on Jenkins. The source file can be obtained using the HTTP protocol or the SSH protocol. The present application does not impose any limitation on this.

[0133] Step 308: The application operation and access device compiles the source file of each application through the data management plug-in to generate the target code of each application, and runs each application based on the target code of each application.

[0134] Step 309: The application runs and the access device obtains the target area of ​​the target container.

[0135] The target area is used to store the configuration files required to access each application in the target Docker. The target area is a configuration directory in the target Docker that stores the configuration files required for each application to be run, that is, accessed or tested.

[0136] Step 310: The application running and access device obtains the first configuration file of each application from the target area through the proxy service plug-in.

[0137] In an embodiment of the present application, the application running and access device uses Nginx to pull the configuration files required for each application to be accessed or tested.

[0138] It should be noted that in order to achieve a goal, Docker deploys an unlimited number of static resource projects; in real scenarios, the same static resource domain name generally corresponds to a group of static resource projects. Therefore, the application running and access devices put the domain name proxy of the same group of projects into an Nginx configuration file, which ensures subsequent scalability. Figure 4As shown in the figure, a schematic diagram of putting the domain name proxies of the same group of projects into the same Nginx configuration file is given; among them, static1.xx.com / a and static1.xx.com / b corresponding to the static resource domain name static1.xx.com are put into the same Nginx configuration file static1, and static2.xx.com / a and static2.xx.com / b corresponding to the static resource domain name static2.xx.com are put into an Nginx configuration file static2.

[0139] In a feasible implementation, when a user accesses a static1.xx.com / a / xx.js file, Nginx matches the url rule static1.xx.com / a and returns the file under the path / export / jenkins / workspace / a / dist, as shown in the following code:

[0140]

[0141] It should be noted that in the Nginx configuration file, different access paths need to be proxied to the file directory after Jenkins compilation. Different configuration files correspond to different domain name directory paths, thus achieving unlimited application access.

[0142] Step 311: Application operation and access The device accesses each application based on the first configuration file.

[0143] In a feasible implementation, when the application running and access device accesses static1.xx.com / a / xx.js, Nginx matches this URL rule and returns the file under the path / export / jenkins / workspace / a / dist; when the application running and access device accesses static1.xx.com / b / xx.js, Nginx matches this URL rule and returns the file under the path / export / jenkins / workspace / b / dist; among them, the applications with the same domain name but different directories are stored in one file.

[0144] In another feasible implementation, the application running and access device accesses static2.xx.com / a / xx.js. After Nginx matches this URL rule, it returns the file under the path / export / jenkins / workspace / c / dist.

[0145] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0146] The application running and accessing method provided in the embodiment of the present application constructs a target container integrated with a data management plug-in and a proxy service plug-in to run and access multiple applications at the same time, thereby rationally utilizing server resources and improving the utilization rate of server resources.

[0147] Based on the foregoing embodiment, in other embodiments of the present application, after executing step 103, step 207, and step 311, the application running and accessing device may further execute the following steps A1 to A2:

[0148] Step A1: Application execution and access: The device obtains a second configuration file of the application to be processed.

[0149] In an embodiment of the present application, multiple applications can be deployed or run in the target docker according to preset rules, and each time an application is added to the target docker, a new first configuration file needs to be reloaded.

[0150] Step A2: The application runs and the access device updates the first configuration file stored in the target area to a third configuration file based on the second configuration file.

[0151] The third configuration file includes a first configuration file of each application and a second configuration file of the application to be processed.

[0152] In the embodiment of the present application, each time the target Docker expands an application, it is necessary to reload the new configuration file in order to access the latest compiled static resource files.

[0153] In a feasible implementation, the application's running and access device first stops the Nginx service of the current Jenkins application; then copies the latest Nginx configuration file to the server's Nginx configuration directory; also copies nginx.conf to the server's global Nginx directory, and finally restarts Nginx to make the new configuration file take effect.

[0154] It should be noted that after adding the Nginx configuration file, the Nginx application code pulled by Jenkins is located under / root / .jenkins / workspace / nginx-domains / domains / , while the Nginx startup configuration file on the target Docker is in the / opt / nginx / conf / domains / directory. Therefore, the copy operation is performed. At the same time, if the copy is not performed, restarting Nginx will not have the latest configuration file, and the newly added applications will not be accessible.

[0155] As Figure 5 shown, a specific implementation flowchart of running and accessing multiple applications in a target Docker provided by an embodiment of the present application is given; it is applied to the device for running and accessing applications. The device for running and accessing applications creates a target Docker integrated with Jenkins and Nginx. That is, after starting, steps 501 and 502 are executed. Step 501 is to create a Dockerfile base image application based on writing a Dockerfile file, and step 502 is to incorporate the required Jenkins, nginx, jdk, and tomcat into the base image to build the base image. While steps 501 and 502 are being executed, step 503 is executed to debug the Jenkins project to create a Jenkins project application. Then step 504 is executed to package the base image and the Jenkins application repository into an application image. That is, after building the application image, step 505 is executed to publish the target Docker online. Then the source codes of multiple applications to be run inside the target Docker are obtained. That is, step 506 is executed to configure Jenkins and install the git parameter plugin to execute step 509. Based on the obtained source codes and configured compilation commands, an application compilation task is created. After step 509 is executed, step 510 is executed to execute the compilation task and generate the compiled file, which is step 511. At the same time, the device for running and accessing applications executes step 507 to create an Nginx configuration application, and then step 508 to create a task for pulling the Nginx configuration. When the device for running and accessing applications needs to expand applications inside the target Docker, step 512 is executed to execute the task by pulling a static Nginx configuration file. And step 513 is executed to execute a shell command to copy the Nginx configuration file to the Nginx configuration directory, stop the current Nginx service, and restart it, that is, restart the Nginx service to Reload the new configuration file. After the device for running and accessing applications finishes executing steps 513 and 511, users can access multiple applications running inside the target Docker based on HTTP.

[0156] Based on the above embodiments, the embodiments of the present application further provide an application operation and access device 6, which can be applied to Figures 1 to 3 In a method for running and accessing an application provided in a corresponding embodiment, refer to Figure 6 As shown, the application running and accessing device 6 includes: a construction module 61, a running module 62 and an accessing module 63, wherein:

[0157] A construction module 61 is used to construct a target container integrated with a data management plug-in and a proxy service plug-in; wherein the data management plug-in is used to manage applications; the proxy service plug-in is used to access applications; and the target container is used to deploy multiple applications;

[0158] A running module 62, used to run multiple applications through the data management plug-in;

[0159] The access module 63 is used to access multiple applications through the proxy service plug-in.

[0160] In other embodiments of the present application, the construction module 61 is also used to construct a basic image;

[0161] Create the configuration file corresponding to the data management plug-in;

[0162] Import the configuration file into the base image and process the base image to generate the target container.

[0163] In other embodiments of the present application, the construction module 61 is further used to create a basic file corresponding to the target container, and run the basic file to generate a target image;

[0164] Obtain a basic toolkit, a first resource corresponding to a data management plug-in, and a second resource corresponding to a proxy service plug-in; wherein the basic toolkit includes basic resources required to build a target container;

[0165] Import the basic toolkit, the first resource, and the second resource into the target image to generate a basic image.

[0166] In other embodiments of the present application, the running module 62 is further used to obtain the source file of each application through the data management plug-in;

[0167] The source files of each application are compiled by the data management plug-in to generate the target code of each application, and each application is run based on the target code of each application.

[0168] In other embodiments of the present application, the running module 62 is further used to obtain the target address of each application;

[0169] Based on the target address, the source files of each application are obtained through the data management plug-in.

[0170] In other embodiments of the present application, the access module 63 is further used to obtain the first configuration file of each application through the proxy service plug-in;

[0171] Each application is accessed based on a first configuration file for each application.

[0172] In other embodiments of the present application, the access module 63 is further used to obtain a target area of ​​the target container; wherein the target area is used to store configuration files required to access each application in the target container;

[0173] The first configuration file of each application is obtained from the target area through the proxy service plug-in.

[0174] In other embodiments of the present application, the access module 63 is further used to obtain a second configuration file of the application to be processed;

[0175] Based on the second configuration file, the first configuration file stored in the target area is updated to a third configuration file; wherein the third configuration file includes the first configuration file of each application and the second configuration file of the application to be processed.

[0176] It should be noted that the specific implementation process of the steps executed by each module in this embodiment can be referred to Figures 1 to 3 The implementation process of the application running and access method provided in the corresponding embodiment will not be repeated here.

[0177] The application running and accessing device provided in the embodiment of the present application constructs a target container integrated with a data management plug-in and a proxy service plug-in to run and access multiple applications at the same time, thereby rationally utilizing server resources and improving the utilization rate of server resources.

[0178] Based on the above embodiments, the embodiments of the present application further provide an application operation and access device 7, which can be applied to Figures 1 to 3 In a method for running and accessing an application provided in a corresponding embodiment, refer to Figure 7 As shown, the application running and access device 7 may include: a processor 71, a memory 72 and a communication bus 73, wherein:

[0179] The communication bus 73 is used to implement the communication connection between the processor 71 and the memory 72 .

[0180] The processor 71 is used to execute the program of the application running and access method stored in the memory 72 to implement the following steps:

[0181] Construct a target container integrated with a data management plug-in and a proxy service plug-in; wherein the data management plug-in is used to manage applications; the proxy service plug-in is used to access applications; and the target container is used to deploy multiple applications;

[0182] Run multiple applications through data management plugins;

[0183] Access multiple applications through proxy service plug-ins.

[0184] In other embodiments of the present application, the processor 71 is used to execute the target container integrated with the data management plug-in and the proxy service plug-in stored in the memory 72 to implement the following steps:

[0185] Build a base image;

[0186] Create the configuration file corresponding to the data management plug-in;

[0187] Import the configuration file into the base image and process the base image to generate the target container.

[0188] In other embodiments of the present application, the processor 71 is used to execute the building base image stored in the memory 72 to implement the following steps:

[0189] Create a basic file corresponding to the target container and run the basic file to generate the target image;

[0190] Obtain a basic toolkit, a first resource corresponding to a data management plug-in, and a second resource corresponding to a proxy service plug-in; wherein the basic toolkit includes basic resources required to build a target container;

[0191] Import the basic toolkit, the first resource, and the second resource into the target image to generate a basic image.

[0192] In other embodiments of the present application, the processor 71 is used to execute the operation of running multiple applications through the data management plug-in stored in the memory 72 to implement the following steps:

[0193] Get the source files of each application through the data management plug-in;

[0194] The source files of each application are compiled by the data management plug-in to generate the target code of each application, and each application is run based on the target code of each application.

[0195] In other embodiments of the present application, the processor 71 is used to execute the source file of each application obtained through the data management plug-in stored in the memory 72 to implement the following steps:

[0196] Get the target address of each application;

[0197] Based on the target address, the source files of each application are obtained through the data management plug-in.

[0198] In other embodiments of the present application, the processor 71 is used to execute the access to multiple applications through the proxy service plug-in stored in the memory 72 to implement the following steps:

[0199] Obtain the first configuration file of each application through the proxy service plug-in;

[0200] Each application is accessed based on a first configuration file for each application.

[0201] In other embodiments of the present application, the processor 71 is used to execute the proxy service plug-in stored in the memory 72 to obtain the first configuration file of each application to implement the following steps:

[0202] Obtaining a target area of ​​a target container; wherein the target area is used to store configuration files required to access each application in the target container;

[0203] The first configuration file of each application is obtained from the target area through the proxy service plug-in.

[0204] In other embodiments of the present application, when the processor 71 is used to execute the program stored in the memory 72, the following steps may also be performed:

[0205] Obtain a second configuration file of the application to be processed;

[0206] Based on the second configuration file, the first configuration file stored in the target area is updated to a third configuration file; wherein the third configuration file includes the first configuration file of each application and the second configuration file of the application to be processed.

[0207] It should be noted that the specific implementation process of the steps executed by the processor in this embodiment can refer to Figures 1 to 3 The implementation process of the application running and access method provided in the corresponding embodiment will not be repeated here.

[0208] The application running and access device provided in the embodiment of the present application constructs a target container integrated with a data management plug-in and a proxy service plug-in to run and access multiple applications at the same time, thereby rationally utilizing server resources and improving the utilization rate of server resources.

[0209] Based on the foregoing embodiments, the embodiments of the present application provide a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following. Figures 1 to 3 The corresponding embodiments provide steps for the method of running and accessing the application.

[0210] It should be noted that the above-mentioned computer-readable storage medium can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and other memories; it can also be an operating and access device for various applications including one or any combination of the above-mentioned memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.

[0211] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0212] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0213] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0214] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0215] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0216] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0217] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for running and accessing an application, characterized in that: The method comprises: Constructing a target container integrated with a data management plug-in and a proxy service plug-in; wherein the data management plug-in is used to manage applications; the proxy service plug-in is used to access applications; and the target container is used to deploy multiple applications; Running the plurality of applications through the data management plug-in; Accessing the plurality of applications through the proxy service plug-in; The step of constructing a target container integrated with a data management plug-in and a proxy service plug-in includes: Build a base image; Creating a configuration file corresponding to the data management plug-in; wherein the configuration file includes a request log of the proxy service plug-in; The configuration file is imported into the base image, and the base image is processed to generate the target container.

2. The method according to claim 1, characterized in that The building of the base image includes: Creating a basic file corresponding to the target container, and running the basic file to generate a target image; Acquire a basic toolkit, a first resource corresponding to the data management plug-in, and a second resource corresponding to the proxy service plug-in; wherein the basic toolkit includes basic resources required to build the target container; The basic toolkit, the first resource, and the second resource are imported into the target image to generate the basic image.

3. The method according to claim 1, characterized in that The running of the multiple applications through the data management plug-in includes: Obtaining source files of each application through the data management plug-in; The source file of each application is compiled by the data management plug-in to generate the target code of each application, and each application is run based on the target code of each application.

4. The method according to claim 3, characterized in that The obtaining the source file of each application through the data management plug-in includes: Obtaining a target address for each application; Based on the target address, the source file of each application is obtained through the data management plug-in.

5. The method according to claim 1, characterized in that The accessing the multiple applications through the proxy service plug-in comprises: Obtaining, through the proxy service plug-in, a first configuration file for each application; Based on the first configuration file of each application, each application is accessed.

6. The method according to claim 5, characterized in that The obtaining, through the proxy service plug-in, the first configuration file of each application includes: Acquire a target area of ​​the target container; wherein the target area is used to store configuration files required to access each application in the target container; The first configuration file of each application is obtained from the target area through the proxy service plug-in.

7. The method according to claim 6, characterized in that The method further comprises: Obtain a second configuration file of the application to be processed; Based on the second configuration file, the first configuration file stored in the target area is updated to a third configuration file; wherein the third configuration file includes the first configuration file of each application and the second configuration file of the application to be processed.

8. An application operation and access device, characterized in that: The device comprises: a construction module, an operation module and an access module; The construction module is used to build a basic image; create a configuration file corresponding to the data management plug-in; import the configuration file into the basic image, and process the basic image to generate a target container; wherein the data management plug-in is used to manage applications; the proxy service plug-in is used to access applications; the target container is used to deploy multiple applications; the configuration file includes a request log of the proxy service plug-in; The running module is used to run the multiple applications through the data management plug-in; The access module is used to access the multiple applications through the proxy service plug-in.

9. An application operation and access device, characterized in that: The application running and accessing device includes: a processor, a memory and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute the program in the memory to implement the application operation and access method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the application running and accessing method according to any one of claims 1 to 7.