CN109828830A - Method and apparatus for managing container - Google Patents

Method and apparatus for managing container Download PDF

Info

Publication number
CN109828830A
CN109828830A CN201910108400.7A CN201910108400A CN109828830A CN 109828830 A CN109828830 A CN 109828830A CN 201910108400 A CN201910108400 A CN 201910108400A CN 109828830 A CN109828830 A CN 109828830A
Authority
CN
China
Prior art keywords
application
container
offline
site
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910108400.7A
Other languages
Chinese (zh)
Other versions
CN109828830B (en
Inventor
宋泽辉
方栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910108400.7A priority Critical patent/CN109828830B/en
Publication of CN109828830A publication Critical patent/CN109828830A/en
Application granted granted Critical
Publication of CN109828830B publication Critical patent/CN109828830B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Telephonic Communication Services (AREA)
  • Stored Programmes (AREA)

Abstract

Embodiment of the disclosure discloses the method and apparatus for managing container.One specific embodiment of this method includes: to obtain the service requesting information of first terminal equipment input, wherein service requesting information includes the application type information of application to be run;According to application type information, the life cycle run on target container is applied in determination;In response to determining that the operating status of target container is container operating status, target container will be run on using according to identified life cycle.This embodiment improves the flexibilities of the management to the application in container and container.

Description

Method and apparatus for managing container
Technical field
Embodiment of the disclosure is related to field of computer technology, and in particular to the method and apparatus for managing container.
Background technique
Container (container) typically refers to the operation frame of the code using (Application).Container is usually run In on destination server.Usually operation has application in container.In recent years, with the continuous development of computer technology, container is wide It is general to be applied to the fields such as cloud computing, safety, intelligent operating system.In the related technology, exist to the application in container and container into The demand of row management.
Summary of the invention
Embodiment of the disclosure proposes the method and apparatus for managing container.
In a first aspect, embodiment of the disclosure provides a kind of method for managing container, this method comprises: obtaining the The service requesting information of one terminal device input, wherein service requesting information includes the application type information of application to be run; According to application type information, the life cycle run on target container is applied in determination;In response to determining the operation of target container State is container operating status, will run on target container using according to identified life cycle.
In some embodiments, the application type that application type information is characterized includes following one: application on site, offline Using.
In some embodiments, according to application type information, the life cycle run on target container is applied in determination, is wrapped It includes: being application on site in response to application type, the life cycle of application is determined as to include: in application on site original state Process, the process in application on site deployable state, the process in application on site starting state run shape in application on site The process of state, the process in application on site error condition delete the process of state in application on site.
In some embodiments, according to application type information, the life cycle run on target container is applied in determination, is wrapped It includes: being offline application in response to application type, the life cycle of application is determined as to include: in offline using original state Process, in the offline process for applying starting state, runs shape in offline application in the offline process for applying deployable state The process of state, in the offline process for applying completion status, the process in offline application error state is deleted in offline application Except the process of state.
In some embodiments, this method further include: in response to receiving answering for inquiring for second terminal equipment input The information inquiring request of operational process data exports the operational process data of application from the file system of target container.
Second aspect, embodiment of the disclosure provide a kind of for managing the device of container, which includes: that information obtains Unit is taken, is configured to obtain the service requesting information of first terminal equipment input, wherein service requesting information includes wait run Application application type information;Period determination unit is configured to according to application type information, and determination is applied in target container The life cycle of upper operation;Using running unit, it is configured in response to determine the operating status of target container as container operation State will run on target container using according to identified life cycle.
In some embodiments, the application type that application type information is characterized includes following one: application on site, offline Using.
In some embodiments, period determination unit is further configured to: it is application on site in response to application type, The life cycle of application is determined as to include: the process in application on site original state, in application on site deployable state Process, the process in application on site starting state, the process in application on site operating status are in application on site mistake shape The process of state deletes the process of state in application on site.
In some embodiments, period determination unit is further configured to: it is offline application in response to application type, The life cycle of application is determined as to include: in the offline process for applying original state, in offline using deployable state Process, in the offline process for applying operating status, completes shape in offline application in the offline process for applying starting state The process of state, the process in offline application error state, in the offline process for applying deletion state.
In some embodiments, device further include: data query unit is configured in response to receive second terminal The information inquiring request of the operational process data for inquiring application of equipment input, exports from the file system of target container The operational process data of application.
The third aspect, embodiment of the disclosure provide a kind of electronic equipment, comprising: one or more processors;Storage Device is stored thereon with one or more programs, when one or more programs are executed by one or more processors, so that one Or multiple processors realize the method such as any embodiment in the method for managing container.
Fourth aspect, embodiment of the disclosure provide a kind of computer-readable medium, are stored thereon with computer program, The method such as any embodiment in the method for managing container is realized when the program is executed by processor.
The method and apparatus for managing container that embodiment of the disclosure provides, available first terminal equipment input Service requesting information.Wherein, service requesting information includes the application type information of application to be run.Then, according to application The life cycle run on target container is applied in type information, determination.Finally, the operating status in response to determining target container For container operating status, target container will be run on using according to identified life cycle.The method and apparatus of the present embodiment, Connected applications type information determines the life cycle of application to be run, and when target container is in container operating status, The pipe to the application in container and container will may be implemented using running in target container according to identified life cycle Reason, improves the flexibility of the management to the application in container and container.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the disclosure is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the disclosure can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for managing container of the disclosure;
Fig. 3 is according to an embodiment of the present disclosure for managing the schematic diagram of an application scenarios of the method for container;
Fig. 4 is the flow chart according to another embodiment of the method for managing container of the disclosure;
Fig. 5 is the structural schematic diagram according to one embodiment of the device for managing container of the disclosure;
Fig. 6 is adapted for the structural schematic diagram for realizing the electronic equipment of disclosed embodiment.
Specific embodiment
The disclosure is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the disclosure can phase Mutually combination.The disclosure is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can the method for managing container using embodiment of the disclosure or the dress for managing container The exemplary system architecture 100 set.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104,105, control service Device 106 and destination server 107.Network 104,105 is in terminal device 101,102,103, control server 106 and target The medium of communication link is provided between server 107.Network 104,105 may include various connection types, such as wired, wireless Communication link or fiber optic cables etc..
Terminal device 101,102,103 can be interacted by network 104 with control server 106, be disappeared with receiving or sending Breath etc..Various applications, such as the application of debugging class, the application of task requests class etc. can be installed on terminal device 101,102,103. Terminal device 101,102,103 can be hardware, be also possible to software.It, can be with when terminal device 101,102,103 is hardware It is the various electronic equipments that there is display screen and service requesting information is supported to input, including but not limited to smart phone, plate Computer, pocket computer on knee and desktop computer etc..When terminal device 101,102,103 is software, can install In above-mentioned cited electronic equipment.Multiple softwares or software module may be implemented into (such as providing distributed clothes in it Business), single software or software module also may be implemented into.It is not specifically limited herein.
Control server 106 can pass through network 104,105 and terminal device 101,102,103 and destination server 107 It interacts, to receive or send message etc..Control server 106 can be hardware, be also possible to software.Work as control server 106 be hardware when, may be implemented into and the distributed server cluster of various information processing services be provided, also may be implemented into single Server.For example, connected applications type information determines the life cycle of application to be run, and container is in target container It, will be using the server run on according to identified life cycle in target container when operating status.Control server can be with Obtain the service requesting information of first terminal equipment input.Wherein, service requesting information includes the application class of application to be run Type information.Then, according to application type information, the life cycle run on target container is applied in determination.Finally, in response to true The operating status of container of setting the goal is container operating status, will be using according to identified life cycle running on target container. When control server 106 is software, may be mounted in above-mentioned cited server.Its may be implemented into multiple softwares or Software module (such as providing Distributed Services), also may be implemented into single software or software module.It does not do herein specific It limits.
Destination server 107 can be interacted by network 105 with control server 106, to receive information or send information Deng.Destination server 107 can be the various servers that operation has container.
It should be noted that for managing the method for container generally by control server provided by embodiment of the disclosure 106 execute, and correspondingly, the device for managing container is generally positioned in control server 106.
It should be understood that the number of the terminal device in Fig. 1, network, control server and destination server is only to illustrate Property.According to needs are realized, any number of terminal device, network, control server and destination server can have.
With continued reference to Fig. 2, the process of one embodiment of the method for managing container according to the disclosure is shown 200.The method for being used to manage container, comprising the following steps:
Step 201, the service requesting information of first terminal equipment input is obtained.
In the present embodiment, for managing the executing subject (such as control server 106 shown in FIG. 1) of the method for container Service request letter can be obtained from the first terminal equipment of communication connection by wired connection mode or radio connection Breath.Wherein, first terminal equipment can be the terminal device that user uses, and be also possible to the terminal device that operation maintenance personnel uses. Service requesting information includes the application type information of application to be run.Wherein, above-mentioned application type information can be for retouching State the various information of the type of application.As an example, above-mentioned application type information can be digital " 1 ", for describing application Type is application on site.As another example, above-mentioned application type information can be digital " 1 ", for describing the type of application To apply offline.
Optionally, the application type that above-mentioned application type information is characterized may include following one: application on site, offline Using.
Step 202, according to application type information, the life cycle run on target container is applied in determination.
Wherein, target container can be operate in and the container on the destination server of control server communication connection.It answers Life cycle is usually to apply in the environment of host from creation, operation, to a kind of process description of extinction.Application It usually may include multiple processes in life cycle.In the present embodiment, executing subject can use above-mentioned application type information, From pre-stored application type-life cycle identity mapping table, finds and believe corresponding to above-mentioned application type The life cycle identity of breath, to obtain the life cycle corresponding to life cycle identity.Wherein, above-mentioned to apply class Type-life cycle identity mapping table, can be it is that executing subject pre-establishes, be stored with multiple application types and life Order the mapping table of the corresponding relationship of periodic identity mark.
In some optional implementations of the present embodiment, according to application type information, determination is applied in target container The life cycle of upper operation, comprising: in response to application type be application on site, by the life cycle of application be determined as include: place In the process of application on site original state, the process in application on site deployable state, the mistake in application on site starting state Journey, the process in application on site operating status, the process in application on site error condition delete state in application on site Process.
In this implementation, when application type is application on site, the life cycle of application may include 6 processes, It is respectively as follows: the process in application on site original state, the process in application on site deployable state starts in application on site The process of state, the process in application on site operating status, the process in application on site error condition are in application on site The process of deletion state.
In this implementation, when the application type of the application wait run is application on site, in the life cycle of application Handoff relation between each process and each process can be such that
When using the process for being in application on site original state, executing subject not yet gives allocated resources.
Using be in application on site deployable state process when, executing subject can using it is pre-stored, for Configuration information in the application on site configuration file of line allocated resources gives allocated resources.Wherein, application on site configures It is preset that configuration information in file can be technical staff.May include in configuration information at least one configuration parameter and Parameter value corresponding to configuration parameter.It should be pointed out that in this process, if executing subject gives allocated resources success, Then by application switching to the process for being in application on site starting state.If executing subject fails to allocated resources, will answer With switching to the process in application on site error condition.
When using the process for being in application on site starting state, executing subject can call the starting shell script in application To start application.After the completion of starting shell script in the application calls, executing subject carries out health examination, health inspection to application Success is looked into, then by application switching to the process for being in application on site operating status.It is wherein, above-mentioned that health examination is carried out to application, Whether the parameter value for typically referring to the parameter that detection corresponds to application belongs in preset numberical range.Wherein, if parameter Value belongs in preset numberical range, then it is assumed that is health examination success.If parameter value is not belonging to preset numerical value In range, then it is assumed that be that health examination is unsuccessful.It is when health examination is unsuccessful, then application switching is wrong to application on site is in The accidentally process of state.The above-mentioned parameter for corresponding to application can be the preset parameter of technical staff.It should be pointed out that During being somebody's turn to do, if executing subject detects deletion identification information, by application switching to the mistake for being in application on site deletion state Journey.Wherein, above-mentioned deletion identification information can be this using the information caused by operational process, for characterizing deletion application.
When using the process for being in application on site operating status, using running in a reservoir.In this process, if executing master Physical examination measures deletion identification information, then application switching to application on site is deleted to the process of state.If executing subject detects portion When affixing one's name to identification information, by application switching to the process for being in application on site deployable state.Wherein, deployment identification information can be this Using the information caused by operational process, for characterizing application deployment.It should be pointed out that in the process of running, executing master Body carries out health examination to application according to the setting period.If health examination success, will be run using application on site is kept The process of state.If health examination is unsuccessful, by application switching to the process for being in application on site error condition.
When using the process for being in application on site error condition, executing subject can carry out health examination to application.If strong Health inspection success, then by application switching to the process for being in application on site operating status.If health examination is unsuccessful, will apply Keep the process of application on site error condition.In this process, it if executing subject detects deletion identification information, will answer With the process for switching to application on site deletion state.If executing subject detects deployment identification information, by application switching to place In the process of application on site deployable state.If executing subject detects starting identification information, by application switching to being in online Using the process of starting state.Starting identification information can be this and apply caused by operational process, apply for characterizing starting Information.
When using the process for deleting state in application on site, executing subject executes will be using deletion.It deletes successfully, then will Application switching is to the process for being in application on site original state.Delete it is unsuccessful, then by application switching to be in application on site mistake The accidentally process of state.
In some optional implementations of the present embodiment, according to application type information, determination is applied in target container The life cycle of upper operation, comprising: applied in response to application type to be offline, the life cycle of application is determined as to include: place In the process for applying original state offline, in the offline process for applying deployable state, in the offline mistake for applying starting state Journey is in offline application error state in the offline process for applying completion status in the offline process for applying operating status Process, in the offline process for applying deletion state.
It in application type is offline in application, the life cycle of application may include 7 processes in this implementation, It is respectively as follows: in the offline process for applying original state, in the offline process for applying deployable state, in offline application starting The process of state, in the offline process for applying operating status, in the offline process for applying completion status, in offline application The process of error condition, in the offline process for applying deletion state.
In this implementation, the application type of application to be run is offline in application, in the life cycle of application Handoff relation between each process and each process can be such that
When using in the offline process for applying original state, executing subject not yet gives allocated resources.
When using in the offline process for applying deployable state, executing subject can using it is pre-stored, for from Configuration information in the offline application configuration file of line allocated resources gives allocated resources.Wherein, offline application configuration It is preset that configuration information in file can be technical staff.May include in configuration information at least one configuration parameter and Parameter value corresponding to configuration parameter.It should be pointed out that in this process, if executing subject gives allocated resources success, Then by application switching to being in the offline process for applying starting state.If executing subject fails to allocated resources, will answer With switching to the process in offline application error state.If executing subject detects deletion identification information, by application switching To in the offline process for applying deletion state.Wherein, above-mentioned deletion identification information can be this using produced by operational process , for characterize delete application information.
When using in the offline process for applying starting state, executing subject can call the starting shell script in application To start application.In this process, if application start successfully, by application switching to be in offline using operating status mistake Journey.If application starting is unsuccessful, by application switching to the process for being in offline application error state.If executing subject detects Identification information is deleted, then by application switching to being in the offline process for applying deletion state.
When using in the offline process for applying operating status, which runs in a reservoir.In this process, if operation Success, then by application switching to being in the offline process for applying completion status.If operation is unsuccessful, by application switching to being in The process of offline application error state.If executing subject detects deletion identification information, application switching to offline application is deleted Except the process of state.
When using in the offline process for applying completion status, if executing subject detects deletion identification information, it will answer With switching to the offline process for applying deletion state.
When using the process for being in offline application error state, if executing subject detects deletion identification information, it will answer With switching to the offline process for applying deletion state.
When using in the offline process for applying deletion state, executing subject will be using deletion.If deleting successfully, will answer The offline process for applying original state is in switching to.It is if deletion is unsuccessful, application switching is wrong to offline application is in The accidentally process of state.
View of the above, it will be seen that running on the life cycle applied in target container not to the life of container Period impacts.That is, in the present embodiment, executing subject is with the management to the application in container to the management of container It is uncoupled.Since the life cycle of existing container is associated with and (is coupled in other words) life cycle of the application in container, Container also will be terminated or be terminated therewith when application in container is moved to end perhaps abnormal end.Therefore, compared to existing The way to manage of application in container and container, the way to manage in the present embodiment are more flexible.
It step 203, will be using according to identified in response to determining that the operating status of target container is container operating status Life cycle runs on target container.
In the present embodiment, above-mentioned executing subject can be when the operating status of target container be container operating status, i.e., When target container is in the process of container operating status, by application according to each process and each process in identified life cycle Handoff relation run on target container.
Optionally, when application type is application on site, executing subject can will correspond to using according to identified Handoff relation between each process and each process of line application is run.It is offline in application, executing subject in application type Application can be run according to the identified handoff relation corresponding between each process and each process applied offline.It needs It is noted that the handoff relation between each process and each process of application on site, reference can be made to application on site in step 202 The description of each process and interprocedual handoff relation, is not described herein in life cycle.Each process and each process applied offline Between handoff relation, reference can be made to each process in the life cycle applied offline and interprocedual handoff relation in step 202 Description, is not described herein.
It may include: at the beginning of the container in addition, it is necessary to explanation, the in the present embodiment life cycle of target container The process of beginning state, the process in container starting state, the process in container operating status, in receptacle error state Process deletes the process of state in container.Wherein, the life cycle of container typically refers to container in the environment of host from wound It builds, runs, to a kind of process description of extinction.It usually may include multiple processes in the life cycle of container.Target container The handoff relation between each process and each process in life cycle can be such that
When container is in the process of container original state, executing subject not yet gives container allocation resource.
When container is in the process of container starting state, executing subject executes container creation.Container creates successfully, then will hold Device switches to the process in container operating status.If container creation failure, container is switched in receptacle error state Process.Here, the technology that the method for creating container is known to the skilled person, is not described herein.
When container is in the process of container operating status, executing subject carries out health to container according to the preset period It checks.Container, then is kept the process of container operating status by health examination success.Health examination is unsuccessful, then by container Process in receptacle error state.Wherein, above-mentioned that health examination is carried out to container, typically refer to the ginseng that detection corresponds to container Whether several parameter values belongs in preset numberical range.Wherein, if parameter value belongs in preset numberical range, Then it is considered health examination success.If parameter value is not belonging in preset numberical range, then it is assumed that be health examination not at Function.It should be pointed out that in this process, if executing subject detects that container deletes identification information, container is switched to place The process of state is deleted in container.Wherein, said vesse deletes identification information and can be caused by the container operational process, uses The information of container is deleted in characterization.
When container is in the process of receptacle error state, executing subject can carry out health examination to container.If health inspection Success is looked into, then container is switched into the process in container operating status.If health examination is unsuccessful, container is switched into place The process of state is deleted in container.
When container is in the process of container deletion state, container is deleted in executing subject execution.
With continued reference to the signal that Fig. 3, Fig. 3 are according to the application scenarios of the method for managing container of the present embodiment Figure.In the application scenarios of Fig. 3, user 301 passes through terminal device 302 for service requesting information A input control server 303. Wherein, service requesting information A includes the application type information a1 to be run using X.Control server 303, first acquisition industry Be engaged in solicited message A.Then, determining that X is applied to run on container according to the application type information a1 in service requesting information A Life cycle.Finally, be container operating status in response to the operating status for determining container, it will be using X according to identified life Periodic duty is in container.
The method provided by the above embodiment for managing container of the disclosure, available first terminal equipment input Service requesting information.Wherein, service requesting information includes the application type information of application to be run.Then, according to using class The life cycle run on target container is applied in type information, determination.Finally, being in response to the operating status of determining target container Container operating status will run on target container using according to identified life cycle.The method of the present embodiment, connected applications Type information determines the life cycle of application to be run, and when target container is in container operating status, will apply and press It is run in target container according to identified life cycle, may be implemented to improve the management of the application in container and container Flexibility to the management of the application in container and container.
With further reference to Fig. 4, it illustrates the processes 400 of another embodiment of the method for managing container.The use In the process 400 of the method for management container, comprising the following steps:
Step 401, the service requesting information of first terminal equipment input is obtained.
Step 402, according to application type information, the life cycle run on target container is applied in determination.
It step 403, will be using according to identified in response to determining that the operating status of target container is container operating status Life cycle runs on target container.
In the present embodiment, the behaviour of the concrete operations of step 401-403 and step 201-203 in embodiment shown in Fig. 2 Make essentially identical, details are not described herein.
Step 404, the letter for being used to inquire the operational process data applied inputted in response to receiving second terminal equipment Inquiry request is ceased, the operational process data of application are exported from the file system of target container.
In the present embodiment, executing subject can be by wired connection mode or radio connection, from communication connection Second terminal equipment obtain for inquire apply operational process data information inquiring request.Wherein, second terminal equipment It can be the terminal device that user uses, be also possible to the terminal device that operation maintenance personnel uses.Information inquiring request can be use In the various requests of the operational process data of request inquiry application.Above-mentioned operational process data typically refer to apply according to life Generated data during periodic duty.In addition, executing subject can be in the information inquiry for receiving second terminal equipment When request, the operational process data of application are exported from the file system of target container.It should be pointed out that due to each container With a file system, for store correspond in the container and container using generated data.If container exists, File in the file system of container will also save.Therefore, in container application be moved to end or abnormal end after, user or fortune Dimension personnel can send information inquiring request by terminal device, to obtain the operational process data of application, thus according to operation Process data analysis goes out application and is moved to end or the reason of abnormal end.Therefore, in the present embodiment, the application in container is tied Beam or abnormal end, container still operate normally, and may be implemented to carry out malfunction elimination to the application in container.
Figure 4, it is seen that the method for managing container compared with the corresponding embodiment of Fig. 2, in the present embodiment Process 400 highlight receive for inquire application operational process data information inquiring request when, from target container File system in the step of exporting the operational process data of application.The scheme of the present embodiment description can contribute to answer as a result, Be moved to end or abnormal end after malfunction elimination.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, present disclose provides one kind to hold for managing One embodiment of the device of device, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which can specifically answer For in various electronic equipments.
As shown in figure 5, the present embodiment includes: information acquisition unit 501 for managing the device 500 of container, it is configured At the service requesting information for obtaining the input of first terminal equipment, wherein service requesting information includes the application of application to be run Type information;Period determination unit 502, be configured to according to application type information, determines to apply and runs on target container Life cycle;Using running unit 503, it is configured in response to determine that the operating status of target container is container operating status, Target container will be run on using according to identified life cycle.
In some optional implementations of the present embodiment, the application type that application type information is characterized includes following One of: application on site, it is offline to apply.
In some optional implementations of the present embodiment, period determination unit can be further configured to: response It is application on site in application type, the life cycle of application is determined as to include: the process in application on site original state, locates In the process of application on site deployable state, the process in application on site starting state, the mistake in application on site operating status Journey, the process in application on site error condition delete the process of state in application on site.
In some optional implementations of the present embodiment, period determination unit can be further configured to: response It is offline application in application type, the life cycle of application is determined as to include: in the offline process for applying original state, place In the process for applying deployable state offline, in the offline process for applying starting state, in the offline mistake for applying operating status Journey, in the offline process for applying completion status, the process in offline application error state, in offline using deletion state Process.
In some optional implementations of the present embodiment, which can also be including data query unit (in figure not It shows).Data query unit may be configured to the fortune for being used to inquire application in response to receiving the input of second terminal equipment The information inquiring request of row process data exports the operational process data of application from the file system of target container.
The device provided by the above embodiment of the disclosure, information acquisition unit 501 obtain the industry of first terminal equipment input Business solicited message.Wherein, service requesting information includes the application type information of application to be run.Then, period determination unit 502 apply the life cycle run on target container according to application type information, determination.Finally, using 503 sound of running unit Target should will be run on using according to identified life cycle in determining that the operating status of target container is container operating status Container.The device of the present embodiment, connected applications type information determine the life cycle of application to be run, and in target container When in container operating status, it will may be implemented using being run in target container according to identified life cycle to container And the management of the application in container, improve the flexibility of the management to the application in container and container.
Below with reference to Fig. 6, it illustrates the electronic equipment that is suitable for being used to realize embodiment of the disclosure, (example is as shown in figure 1 Control server) 600 structural schematic diagram.Electronic equipment shown in Fig. 6 is only an example, should not be to the implementation of the disclosure The function and use scope of example bring any restrictions.
As shown in fig. 6, electronic equipment 600 may include processing unit (such as central processing unit (CPU), graphics process Device etc.) 601, can according to the program being stored in read-only memory (ROM) 602 or from storage device 608 be loaded into Machine accesses the program in memory (RAM) 603 and executes various movements appropriate and processing.In RAM 603, it is also stored with electricity Sub- equipment 600 operates required various programs and data.Processing unit 601, ROM 602 and RAM 603 by bus 604 that This is connected.Input/output (I/O) interface 605 is also connected to bus 604.
In general, following device can connect to I/O interface 605: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 606 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 607 of dynamic device etc.;Storage device 608 including such as tape, hard disk etc.;And communication device 609.Communication device 609, which can permit electronic equipment 600, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 6 shows tool There is the electronic equipment 600 of various devices, it should be understood that being not required for implementing or having all devices shown.It can be with Alternatively implement or have more or fewer devices.Each box shown in Fig. 6 can represent a device, can also root According to needing to represent multiple devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 609, or from storage device 608 It is mounted, or is mounted from ROM 602.When the computer program is executed by processing unit 601, the implementation of the disclosure is executed The above-mentioned function of being limited in the method for example.It should be noted that the computer-readable medium of embodiment of the disclosure can be meter Calculation machine readable signal medium or computer readable storage medium either the two any combination.Computer-readable storage Medium for example may be-but not limited to-system, device or the device of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, Or any above combination.The more specific example of computer readable storage medium can include but is not limited to: have one Or the electrical connections of multiple conducting wires, portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), Erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light Memory device, magnetic memory device or above-mentioned any appropriate combination.In embodiment of the disclosure, computer-readable to deposit Storage media can be any tangible medium for including or store program, which can be commanded execution system, device or device Part use or in connection.And in embodiment of the disclosure, computer-readable signal media may include in base band In or as carrier wave a part propagate data-signal, wherein carrying computer-readable program code.This propagation Data-signal can take various forms, including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Meter Calculation machine readable signal medium can also be any computer-readable medium other than computer readable storage medium, which can Read signal medium can be sent, propagated or be transmitted for being used by instruction execution system, device or device or being tied with it Close the program used.The program code for including on computer-readable medium can transmit with any suitable medium, including but not It is limited to: electric wire, optical cable, RF (radio frequency) etc. or above-mentioned any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.Above-mentioned computer-readable medium carries one or more program, when said one or more When a program is executed by the electronic equipment, so that the electronic equipment: the service requesting information of first terminal equipment input is obtained, In, service requesting information includes the application type information of application to be run;According to application type information, determination is applied in target The life cycle run on container;It, will be using according to institute in response to determining that the operating status of target container is container operating status Determining life cycle runs on target container.
The behaviour for executing embodiment of the disclosure can be write with one or more programming languages or combinations thereof The computer program code of work, programming language include object oriented program language-such as Java, Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar program design language Speech.Program code can be executed fully on the user computer, partly be executed on the user computer, as an independence Software package execute, part on the user computer part execute on the remote computer or completely in remote computer or It is executed on server.In situations involving remote computers, remote computer can pass through the network of any kind --- packet It includes local area network (LAN) or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as benefit It is connected with ISP by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in embodiment of the disclosure can be realized by way of software, can also be passed through The mode of hardware is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor Including information acquisition unit, period determination unit and apply running unit.Wherein, the title of these units is under certain conditions simultaneously The restriction to the unit itself is not constituted, for example, information acquisition unit is also described as " obtaining the input of first terminal equipment Service requesting information unit ".
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the disclosure, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed in the disclosure Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (12)

1. a kind of method for managing container, comprising:
Obtain the service requesting information of first terminal equipment input, wherein the service requesting information includes application to be run Application type information;
According to the application type information, the life cycle applied and run on target container is determined;
Operating status in response to the determination target container is container operating status, by the application according to identified life Periodic duty is in the target container.
2. according to the method described in claim 1, wherein, the application type that the application type information is characterized include it is following it One: application on site, it is offline to apply.
3. it is described according to the application type information according to the method described in claim 2, wherein, determine described apply in mesh The life cycle run on mark container, comprising:
It is application on site in response to the application type, the life cycle of the application is determined as to include: in online Using the process of original state, the process in application on site deployable state, the process in application on site starting state is in The process of application on site operating status, the process in application on site error condition delete the process of state in application on site.
4. it is described according to the application type information according to the method described in claim 2, wherein, determine described apply in mesh The life cycle run on mark container, comprising:
It is offline application in response to the application type, the life cycle of the application is determined as to include: in offline Using the process of original state, it is in the offline process for applying deployable state in the offline process for applying starting state The offline process for applying operating status, in the offline process for applying completion status, the process in offline application error state, In the offline process for applying deletion state.
5. method described in one of -4 according to claim 1, wherein the method also includes:
Information inquiry in response to receiving the operational process data for inquiring the application of second terminal equipment input is asked It asks, the operational process data of the application is exported from the file system of the target container.
6. a kind of for managing the device of container, comprising:
Information acquisition unit is configured to obtain the service requesting information of first terminal equipment input, wherein the service request Information includes the application type information of the application of row to be shipped;
Period determination unit, be configured to according to the application type information, determines that described apply runs on target container Life cycle;
Using running unit, it is configured in response to determine that the operating status of the target container is container operating status, by institute It states and runs on the target container using according to identified life cycle.
7. device according to claim 6, wherein the application type that the application type information is characterized include it is following it One: application on site, it is offline to apply.
8. device according to claim 7, wherein the period determination unit is further configured to:
It is application on site in response to the application type, the life cycle of the application is determined as to include: in online Using the process of original state, the process in application on site deployable state, the process in application on site starting state is in The process of application on site operating status, the process in application on site error condition delete the process of state in application on site.
9. device according to claim 7, wherein the period determination unit is further configured to:
It is offline application in response to the application type, the life cycle of the application is determined as to include: in offline Using the process of original state, it is in the offline process for applying deployable state in the offline process for applying starting state The offline process for applying operating status, in the offline process for applying completion status, the process in offline application error state, In the offline process for applying deletion state.
10. the device according to one of claim 6-9, wherein described device further include:
Data query unit is configured in response to receive the operation for being used to inquire the application of second terminal equipment input The information inquiring request of process data exports the operational process data of the application from the file system of the target container.
11. a kind of electronic equipment, comprising:
One or more processors;
Storage device is stored thereon with one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 5.
12. a kind of computer-readable medium, is stored thereon with computer program, wherein the realization when program is executed by processor Such as method as claimed in any one of claims 1 to 5.
CN201910108400.7A 2019-01-18 2019-01-18 Method and apparatus for managing containers Active CN109828830B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910108400.7A CN109828830B (en) 2019-01-18 2019-01-18 Method and apparatus for managing containers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910108400.7A CN109828830B (en) 2019-01-18 2019-01-18 Method and apparatus for managing containers

Publications (2)

Publication Number Publication Date
CN109828830A true CN109828830A (en) 2019-05-31
CN109828830B CN109828830B (en) 2021-07-16

Family

ID=66863451

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910108400.7A Active CN109828830B (en) 2019-01-18 2019-01-18 Method and apparatus for managing containers

Country Status (1)

Country Link
CN (1) CN109828830B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111200595A (en) * 2019-12-20 2020-05-26 北京淇瑀信息科技有限公司 Authority management method and device for accessing container and electronic equipment
CN112148420A (en) * 2019-06-28 2020-12-29 杭州海康威视数字技术股份有限公司 Abnormal task processing method based on container technology, server and cloud platform
CN113238956A (en) * 2021-05-31 2021-08-10 康键信息技术(深圳)有限公司 Fault analysis method, device and equipment for abnormal application and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577779A (en) * 2015-12-21 2016-05-11 用友网络科技股份有限公司 Method and system for containerized deployment of large enterprise private cloud
CN105847045A (en) * 2016-01-04 2016-08-10 中国电子科技网络信息安全有限公司 Application packaging system and management method based on Docker container
CN106126299A (en) * 2016-06-30 2016-11-16 百度在线网络技术(北京)有限公司 The processing method and processing device of business plug-in unit
CN106375101A (en) * 2015-07-20 2017-02-01 华为技术有限公司 Life cycle management method and apparatus
CN107077388A (en) * 2014-09-25 2017-08-18 甲骨文国际公司 System and method for providing end-to-end life cycle in multi-tenant application server environment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077388A (en) * 2014-09-25 2017-08-18 甲骨文国际公司 System and method for providing end-to-end life cycle in multi-tenant application server environment
CN106375101A (en) * 2015-07-20 2017-02-01 华为技术有限公司 Life cycle management method and apparatus
CN105577779A (en) * 2015-12-21 2016-05-11 用友网络科技股份有限公司 Method and system for containerized deployment of large enterprise private cloud
CN105847045A (en) * 2016-01-04 2016-08-10 中国电子科技网络信息安全有限公司 Application packaging system and management method based on Docker container
CN106126299A (en) * 2016-06-30 2016-11-16 百度在线网络技术(北京)有限公司 The processing method and processing device of business plug-in unit

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148420A (en) * 2019-06-28 2020-12-29 杭州海康威视数字技术股份有限公司 Abnormal task processing method based on container technology, server and cloud platform
CN112148420B (en) * 2019-06-28 2024-04-02 杭州海康威视数字技术股份有限公司 Abnormal task processing method based on container technology, server and cloud platform
CN111200595A (en) * 2019-12-20 2020-05-26 北京淇瑀信息科技有限公司 Authority management method and device for accessing container and electronic equipment
CN111200595B (en) * 2019-12-20 2022-04-29 北京淇瑀信息科技有限公司 Authority management method and device for accessing container and electronic equipment
CN113238956A (en) * 2021-05-31 2021-08-10 康键信息技术(深圳)有限公司 Fault analysis method, device and equipment for abnormal application and storage medium
CN113238956B (en) * 2021-05-31 2024-04-05 康键信息技术(深圳)有限公司 Fault analysis method, device, equipment and storage medium for abnormal application

Also Published As

Publication number Publication date
CN109828830B (en) 2021-07-16

Similar Documents

Publication Publication Date Title
CN106489251B (en) The methods, devices and systems of applied topology relationship discovery
CN109697075A (en) File updating method, system and device
CN109523187A (en) Method for scheduling task, device and equipment
CN105630684B (en) Software Development Kit recognition methods and device
CN108733476A (en) A kind of method and apparatus executing multitask
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
CN108768730A (en) Method and apparatus for operating intelligent network adapter
CN109828830A (en) Method and apparatus for managing container
CN108958992A (en) test method and device
CN110391938A (en) Method and apparatus for deployment services
CN108681777A (en) A kind of method and apparatus of the machine learning program operation based on distributed system
CN108846753A (en) Method and apparatus for handling data
CN110263565A (en) Method and apparatus for calling service
CN109684188A (en) Test method and device
CN110399253A (en) Delay machine treating method and apparatus
CN110019263A (en) Information storage means and device
CN109766148A (en) Method and apparatus for Processing Interface method call
CN110493341A (en) Method and device for controlling devices
CN109218041A (en) Request processing method and device for server system
CN109819042A (en) For providing the method and apparatus of Software Development Kit
CN109299124A (en) Method and apparatus for more new model
CN109818994A (en) Information processing method and device for agent side
CN112887355B (en) Service processing method and device for abnormal server
CN110247978B (en) Job execution method and device adapting to different resource scheduling systems
CN110113176A (en) Information synchronization method and device for configuration server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20190531

Assignee: Beijing Intellectual Property Management Co.,Ltd.

Assignor: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY Co.,Ltd.

Contract record no.: X2023110000093

Denomination of invention: Method and device for managing containers

Granted publication date: 20210716

License type: Common License

Record date: 20230818