WO2020143324A1 - 服务程序发布方法、装置、计算机设备及存储介质 - Google Patents
服务程序发布方法、装置、计算机设备及存储介质 Download PDFInfo
- Publication number
- WO2020143324A1 WO2020143324A1 PCT/CN2019/118539 CN2019118539W WO2020143324A1 WO 2020143324 A1 WO2020143324 A1 WO 2020143324A1 CN 2019118539 W CN2019118539 W CN 2019118539W WO 2020143324 A1 WO2020143324 A1 WO 2020143324A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- container
- target container
- content
- target
- identification information
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Definitions
- This application relates to the field of computer application technologies, and in particular, to a service program publishing method, device, computer equipment, and storage medium.
- Most of the code version release rules rely on personal experience and do not form rules according to product and project requirements; even if the release rules have clearly stipulated, manual processing of the code version will still bring operational errors, and different people will have some details on the processing rules and operation steps The difference cannot guarantee the consistency of the results with high quality.
- the current code release uploads the project source code to the server, and restarts the server to achieve the release. When the number of services or projects is large, the server needs to be restarted for each release, which will consume a lot of time.
- the embodiments of the present application can provide a service program distribution method, device, computer equipment, and storage medium that reduce labor costs and reduce service program distribution time.
- the present application discloses a service program publishing apparatus, including: an acquiring module for acquiring published content, wherein the published content includes a service program; and a processing module for distributing the published content to a target container, Wherein, the target container is one or more containers in the server that have a mapping relationship with the service program; an execution module is used to restart the target container, write the published content into the target container, and overwrite The original content in the target container.
- the present application discloses a computer device, including: one or more processors; a memory; one or more computer programs, wherein the one or more computer programs are stored in the memory and configured as It is executed by the one or more processors, and the one or more computer programs are configured to execute one of the above-mentioned service program distribution methods.
- the present application discloses a computer-readable storage medium.
- the computer When instructions in the storage medium are executed by a processor of a computer, the computer is enabled to execute a service program distribution method.
- FIG. 1 is a schematic flowchart of a service program publishing method according to an embodiment of this application
- FIG. 3 is a schematic flowchart of searching for a target container through identification information according to an embodiment of the present application
- FIG. 4 is a schematic diagram of a process for determining a target container through priority information according to an embodiment of the present application
- FIG. 6 is a schematic diagram of a process of updating container content according to an embodiment of the present application.
- FIG. 1 is a schematic diagram of the basic process of the service program publishing method of this embodiment.
- a service program publishing method includes the following steps:
- S1200 Distribute the published content to a target container, where the target container is one or more containers in the server that have a mapping relationship with the service program;
- the published content also includes the identification information and version information of the corresponding service program.
- the identification information is used to match and find the container that is running or supports the service program in the server, and the version information is used to confirm that the version of the service program in the corresponding container is old and new. To determine whether to update.
- the released version may be for one or more specified versions, after finding the container with the corresponding program identification code, obtain the version number of the existing program in the container to determine whether the version number is the current published content For the version targeted, if it is, the corresponding container is defined as the target container to achieve targeted content publishing.
- the target container After the target container receives the published content, it starts the update process, restarts the container, writes the published content into the container and overwrites the original content, so as to realize the content update in the container.
- the update After the update is completed, it is determined whether the container starts normally, and when the container fails to start normally, an abnormal report is generated and fed back to the management server to guide maintenance personnel to maintain the server.
- a specified feedback code may be sent to the management server to feed back the update result to the management server, the feedback code obtained by the management server is abnormal, or within a certain period of time If no feedback code is received, it is determined that the container starts abnormally after being updated.
- the published content contains the identification information of the corresponding service program. After obtaining the published content, extract the identification information. The identification information is used to distinguish between different service programs to determine the delivery target and update target of the published content.
- the published content also includes corresponding version information, such as a version number, which is used to determine whether the version of the service program is found before finding the target of the corresponding service program before determining whether to update it.
- the container that matches the identification information is searched for in the server as the target container.
- the determination of the server may be that the developer or the operator specifies the server as the server when the content is published, the server information has been written in the published content, and after the content is published, the corresponding container is directly searched in the server.
- Each container in the server has corresponding container information.
- the container information of the container with a service program contains the program identification code of the corresponding service program. After obtaining the identification information of the published content, look in the server for the information corresponding to the identification information.
- the container of the program identification code, the above corresponding relationship may be a certain mapping relationship, upper and lower relationship or the same check character segment, the searched container may be one or more, the searched one or more Containers as target containers.
- Each server container has a corresponding update instruction, and the update instruction is used to update the contents of the container.
- the method for triggering the update instruction may be to obtain a corresponding trigger code.
- the trigger code of each container in the same server may be the same or different.
- the corresponding trigger code can be determined after obtaining the published content; when the trigger code of each container in the server is different, the trigger code of the target container needs to be further obtained after the target container is determined.
- an update request carrying the trigger code is sent to the target container.
- the target container triggers an update instruction due to the trigger code contained therein, and starts the update process of the container content.
- the identification information in the distribution information is used to determine the target container, which avoids the need for manual deployment to determine the storage location and update location of content in the traditional content distribution process, which effectively improves the efficiency of content distribution and reduces labor and time costs .
- step S1200 specifically includes the following steps:
- S1121 Obtain container information of all containers, where the container information includes program identification codes of existing service programs in the container;
- Each content in the server has corresponding container information.
- the container information of the container with the service program contains the program identification code of the corresponding service program. After obtaining the target content, the container information of all the containers in the server is obtained and integrated The program identification codes form a list.
- the identification information of the published content as a search condition, find the program identification code that has a mapping relationship with the identification information in the generated program identification code list.
- the mapping relationship may be that the program identification code is the same as the corresponding information in the identification information, or the program identification code It has a certain subordinate relationship or algorithm relationship with the identification information.
- After finding the program identification code in the list use the container corresponding to the program identification code as the corresponding container.
- the identification information further includes version information. After finding the program identification code, the version number of the service program in the corresponding container is obtained, and the version of the service program in the container is determined according to the version information and the version number. If the version is lower than the published content, the corresponding container is used as the corresponding container.
- the corresponding container When a corresponding container with a mapping relationship is found, the corresponding container is used as the target container.
- the corresponding container found may be one or more. Therefore, the target container may also be one or more, such as multiple Run the same service program in each container to achieve offload processing.
- the program identification code that has a mapping relationship with the identification information cannot be found in the list, it means that there is no container with a service program corresponding to the published content in the current server, that is, the content published this time is a newly added service program instead of the original Some programs are updated. At this time, the corresponding target container cannot be determined based on the identification information.
- the server is set with the priority of the container. When a new service program is released, the container can be selected as the carrier of the service program according to the priority. The priority can be determined according to certain rules. For example, an empty container is the highest priority, and the container is discarded. It is a secondary priority, etc., but not limited to this. An empty container is a container that does not store content.
- the container After the server is officially used, the container has not been used to store content.
- the abandoned container is the content that has been previously stored but has been cleared or stored
- the service program has been disabled.
- the above priority information is dynamically updated. Whenever an empty container is used, the service program is deactivated, or the content of the container is cleared, the priority information is updated. When the target container cannot be determined based on the identification information, the priority information stored in the server is obtained.
- step S1120 the following steps are also included:
- step S1300 specifically includes the following steps:
- the content update begins, and the obtained published content is written into the container, while overwriting the original content in the target container.
- the original content in the target container may be deleted before writing the published content directly.
- update it The update process can be adjusted according to the actual use scenario, including deployment, analysis, and installation, but it is not limited to this.
- the update process can be written in the published content. After the published content is written, it is automatically updated. After the update is completed, restart the target container again to enter the normal operation process of the container.
- step S1330 the following steps are also included:
- the server determines that the target container starts normally after updating, it sends an instruction to delete the backup to the target container to delete the backup content in the designated storage area, and the content publishing process ends.
- the designated storage area is a designated container in the server, after the server determines that the target container is normally started, it sends an instruction to delete the backup to the server or the designated container in the backup to delete the backup content.
- the server determines that the target container cannot start normally, it starts the content recovery process of the container, forcibly stops the operation of the target container, and at the same time obtains the backup content in the designated storage area, writes the backup content into the target container and overwrites the target container.
- Some content to achieve version reduction, at the same time, generate alarm information and trigger alarm instructions to feedback to the maintenance staff of the management platform the failure of this update, and guide maintenance personnel to troubleshoot or repair.
- the version is lowered, it is judged again whether the container can start normally.
- the corresponding completion information is generated, for example, "the container has finished version downgrading"; when the container cannot start normally, the corresponding Failure information, such as "The container still cannot start normally after the version is downgraded and has stopped functioning".
- the container update fails and cannot start or operate normally, the version of the service program can be reduced through the backup content.
- the container update fails, the normal operation of the container is effectively ensured, and the alarm information is used to remind the maintenance personnel Carry out maintenance to reduce the impact of update failure on service program operation.
- the service program publishing apparatus further includes: a second acquisition submodule, a first search submodule, and a second execution submodule.
- the second obtaining sub-module is used to obtain container information of all containers, wherein the container information includes the program identification code of the existing service program in the container; the first searching sub-module is used to search the program identification code and the The identification information has a corresponding container with a mapping relationship; the second execution submodule is used to define the corresponding container with a mapping relationship as the target container.
- the present application also provides a storage medium storing computer-readable instructions, which when executed by one or more processors, cause the one or more processors to execute the service program release according to any of the foregoing embodiments Method steps.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
一种服务程序发布方法、装置、计算机设备及存储介质,包括下述步骤:获取发布内容,其中,所述发布内容包括服务程序(S1100);将所述发布内容分配至目标容器,其中,所述目标容器为服务器中与所述服务程序具有映射关系的一个或多个容器(S1200);重启所述目标容器,将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容(S1300)。与传统的更新内容时需要重启整个服务器的发布模式相比,这种服务程序发布方法在服务器中将多个容器分隔开,进行更新时只需要将发布的内容发送到对应的服务器容器中,对目标的一个或多个容器进行重启和内容更新,有效节省了发布内容时的时间成本。
Description
本申请要求于2019年1月8日提交中国专利局、申请号为201910014248.6,发明名称为“服务程序发布方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及计算机应用技术领域,特别是涉及一种服务程序发布方法、装置、计算机设备及存储介质。
在计算机技术领域,基于Web的应用研发已经占据项目中的主流,越来越多的信息化系统以及其他应用系统通过这种“瘦”客户端的形式提供服务。在项目的实施阶段,实施工程师需要在机器上部署项目所需要的所有环境和软件,这个过程需要浪费很多时间,同时在安装的过程中会出现各种各样的问题。由于用户的业务需求变化快,因而经常需要对网站的页面功能进行修改和扩充,结果催生网站新的版本的不断诞生。
发明人意识到,当前大多数代码版本发布过程中,需要依据待发布的工作流程任务,人工分析、处理待发布的代码版本,并手工获取代码文件。代码版本发布规则大多依赖个人经验,并未按照产品、项目需求形成规则;即使发布规则已明确规定,人工处理代码版本依然会带来操作失误,不同人员会在处理规则细节、操作步骤上有所差异,无法高质量的保证结果的一致性。同时,当前的代码发布将项目源代码上传至服务器中,并重启服务器实现发布,当服务或项目数量较多时,每次发布都需要重启服务器,将消耗大量的时间。
发明内容
本申请实施例能够提供一种降低人力成本、减少服务程序发布时间的服务程序发布方法、装置、计算机设备及存储介质。
第一方面,本申请公开一种服务程序发布方法,包括以下步骤:获取发布内容,其中,所述发布内容包括服务程序;将所述发布内容分配至目标容器,其中,所述目标容器为服务器中与所述服务程序具有映射关系的一个或多个容器;重启所述目标容器,将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容。
第二方面,本申请公开一种服务程序发布装置,包括:获取模块,用于获取发布内容,其中,所述发布内容包括服务程序;处理模块,用于将所述发布内容分配至目标容器,其中,所述目标容器为服务器中与所述服务程序具有映射关系的一个或多个容器;执行模块,用于重启所述目标容器,将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容。
第三方面,本申请公开一种计算机设备,包括:一个或多个处理器;存储器;一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个计算机程序配置用于执行上述一种服务程序发布方法。
第四方面,本申请公开一种计算机可读存储介质,当所述存储介质中的指令由计算机的处理器执行时,使得计算机能够执行一种服务程序发布方法。
本申请附加的方面和优点将在下面的描述中部分给出,这些将从下面的描述中变得明显,或通过本申请的实践了解到。
图1为本申请实施例服务程序发布方法的基本流程示意图;
图2为本申请实施例内容更新准备的流程示意图;
图3为本申请实施例通过识别信息查找目标容器的流程示意图;
图4为本申请实施例通过优先级信息确定目标容器的流程示意图;
图5为本申请实施例发送更新请求的流程示意图;
图6为本申请实施例容器内容更新的流程示意图;
图7为本申请实施例保证容器正常运作的流程示意图;
图8为本申请实施例服务程序发布装置的基本结构框图;
图9为本申请实施例计算机设备基本结构框图。
具体地请参阅图1,图1为本实施例服务程序发布方法的基本流程示意图。
如图1所示,一种服务程序发布方法,包括以下步骤:
S1100、获取发布内容,其中,所述发布内容包括服务程序;
发布内容的获取途径可以是开发或运营人员将待发布的内容上传到管理服务器中,管理服务器在识别到存在待发布的内容时,获取该内容作为发布内容。在一些实施方式中,发布内容可以是Web端服务程序的更新版本或者是未发布过的全新服务程序,但不限于此,发布内容的形式可以根据实际应用场景的不同进行调整,例如服务程序的源代码或文件包的方式。
S1200、将所述发布内容分配至目标容器,其中,所述目标容器为服务器中与所述服务程序具有映射关系的一个或多个容器;
发布内容中还包括对应服务程序的识别信息和版本信息,识别信息用于在服务器中匹配查找正在运行或支持该服务程序的容器,版本信息用于确认查找得到对应的容器中服务程序的版本新旧,以确定是否进行更新。
在确定发布内容之后,获取发布内容中的识别信息,以识别信息为依据在服务器中查找与该识别信息具有映射关系的容器,服务器中每一个容器都具有一个程序识别码,用于确定该容器中所运行或支持 的服务程序,上述映射关系即通过识别信息查找对应的程序识别码,例如使用一段校验码作为识别信息,在服务器中查找具有与识别信息对应的程序识别码的容器。
在查找到具有对应程序识别码的容器后,通过版本信息与容器中的程序版本进行对比,确定发布版本是否比容器中的已有版本高,如果发布版本高于容器中的已有版本,即确定对应容器需要进行内容更新,将对应容器定义为目标容器。在一些实施方式中,发布的版本可以针对指定的一个或多个版本,在查找到有对应程序识别码的容器后,获取容器中已有程序的版本号,确定该版本号是否是当前发布内容所针对的版本,若是,则将对应的容器定义为目标容器,实现具有针对性的内容发布。
确定目标容器之后,与目标容器建立连接,将获取到的发布内容发送到目标容器。
S1300、重启所述目标容器,将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容;
当目标容器接收到发布内容之后,启动更新流程,重启容器,将发布内容写入到容器中并覆盖原有内容,以实现容器中的内容更新。在更新完成后,判断容器是否正常启动,当容器无法正常启动时,生成异常报告反馈至管理服务器,以引导维护人员对该服务器进行维护。在一些实施方式中,容器更新完成并正常启动之后,可以向管理服务器发送一个指定的反馈码,用于向管理服务器反馈更新结果,管理服务器获取到的反馈码异常,或者在一定的时间段内没有接收到反馈码,即确定容器更新后启动异常。
如图2所示,步骤S1200之前还包括以下步骤:
S1110、获取所述发布内容的识别信息,其中,所述识别信息为用于区分并识别不同服务程序的程序识别代码;
发布内容中包含有对应服务程序的识别信息,在获取到发布内容之后,提取其中的识别信息。识别信息用于区分各个不同的服务程序,以确定发布内容发送目标和更新目标。在一些实施方式中,发布内容还包 括对应的版本信息,例如版本号,用于确定查找到对应服务程序的目标后确定其版本是否处于当前待发布的版本之前,以确定是否更新。
S1120、根据所述识别信息在服务器中查找与所述识别信息具有映射关系的容器作为所述目标容器;
在获取到识别信息之后,在服务器中查找与识别信息相匹配的容器作为目标容器。具体地,服务器的确定可以是内容发布时由开发人员或者运营人员指定服务器作为服务器,在发布内容之中已经写入了服务器的信息,内容发布之后,直接在服务器中查找对应的容器。服务器中每个容器都具有对应的容器信息,具有服务程序的容器的容器信息中包含有对应服务程序的程序识别码,在得到发布内容的识别信息后,在服务器中查找具有与识别信息相对应的程序识别码的容器,上述的对应关系可以是具有一定的映射关系、上下位关系或者是完全相同的校验字符段,查找得到的容器可以是一个或多个,将查找得到的一个或多个容器作为目标容器。
S1130、触发所述目标容器的更新指令,启动所述目标容器的更新流程;
每一个服务器容器都具有对应的更新指令,更新指令用于对容器的内容进行更新。在一些实施方式中,触发更新指令的方法可以是获取到对应的触发码,同一个服务器中各个容器的触发码可以相同,也可以各不相同,当服务器中各个容器的触发码是相同的时候,在获取到发布内容之后即可确定对应的触发码;当服务器中各个容器的触发码各不相同的时候,确定目标容器后需要进一步获取目标容器的触发码。确定触发码之后向目标容器发送携带触发码的更新请求,目标容器在接收到更新请求后因其中包含的触发码而触发更新指令,开始容器内容的更新流程。
利用发布信息中的识别信息确定目标容器,避免了传统的内容发布过程中需要通过人工部署的方式去确定内容的存储位置和更新位置,有效地提高了内容发布的效率,减少了人工和时间成本。
如图3所示,步骤S1200具体包括以下步骤:
S1121、获取所有容器的容器信息,其中,所述容器信息包括容器中已有服务程序的程序识别码;
服务器中每个内容都具有对应的容器信息,具有服务程序的容器的容器信息中包含有对应服务程序的程序识别码,在获取到目标内容之后,获取服务器中所有容器的容器信息,并整合其中的程序识别码形成列表。
S1122、查找所述程序识别码与所述识别信息具有映射关系的对应容器;
以发布内容的识别信息作为查找条件,在生成的程序识别码列表中查找与识别信息具有映射关系的程序识别码,上述映射关系可以是程序识别码与识别信息中对应信息相同,或者程序识别码与识别信息具有一定的上下位关系或者算法关系。在列表中查找到程序识别码之后,将程序识别码所对应的容器作为对应容器。在一些实施方式中,识别信息中还包括版本信息,在查找到程序识别码之后,获取其对应的容器中服务程序的版本号,根据版本信息和版本号确定容器中已有的服务程序版本是否低于发布内容的版本,若是,则将对应的容器作为对应容器。
S1123、定义所述具有映射关系的对应容器为所述目标容器;
当查找到具有映射关系的对应容器后,将对应容器作为目标容器,在一些实施方式中,查找到的对应容器可以为一个或多个,因此,目标容器也可以为一个或多个,例如多个容器中运行同一个服务程序以实现分流处理。
通过在服务器中查找对应容器的方法,当服务器中存在大量容器时,可以快速准确地获取到发布内容所对应需要的更新容器,相比于传统的人工部署方式,可以节省大量的人力资源和时间成本,并且有效地保证了目标容器选择的准确性。
如图4所示,步骤S1122之后还包括以下步骤:
S1124、当查找不到所述对应容器时,获取优先级信息,其中,所述优先级信息包括服务器中各容器的使用优先级;
当列表之中查找不到与识别信息具有映射关系的程序识别码时,说明当前服务器中不存在具备发布内容对应的服务程序的容器,即此次发布的内容为新增的服务程序而不是在原有的程序上进行更新,此时无法根据识别信息确定对应的目标容器。服务器中设置有容器的使用优先级,当新的服务程序发布时,可以根据优先级选用容器作为服务程序的载体,优先级的确定可以按照一定的规则,例如空容器为最高优先级,废弃容器为次级优先级等等,但不限于此,空容器即没有存储内容的容器,在服务器正式使用之后没有使用过该容器存储过内容,废弃容器为之前存储过内容但已被清除或者存储的服务程序已经停用。上述优先级信息动态更新,每当有空容器被使用、服务程序停用或者容器内容清除时,更新优先级信息。当无法根据识别信息确定目标容器时,获取到服务器中存储的优先级信息。
S1125、根据所述容器优先级信息确定其中使用优先级最高的容器为所述目标容器;
在获取到优先级信息后,定义服务器中当前优先级最高的容器作为目标容器。在一些实施方式中,同一个优先级中可以有一个或多个容器,当最高优先级中存在多个容器,而此次的内容发布并不需要其中全部容器时,可以根据选取规则选择其中的容器作为目标容器,选取规则可以是随机选择,也可以是根据容器编号按顺序使用。
当发布内容为新的服务程序时,在服务器中无法查找到对应的容器,从而通过优先级信息确定目标容器,保证了发布内容不属于现有服务程序的更新时可以及时的获取到目标容器从而保证新内容的上线时间。
如图5所示,步骤S1120之后还包括下述步骤:
S1126、获取所述目标容器的端口信息,其中,所述端口信息为用于确定容器端口地址的地址码;
服务器中每个容器中都存储有对应的端口信息,即容器端口的地址码,用于确定该容器的地址和端口校验码。在确定目标容器之后,获取目标容器的端口信息。
S1127、根据所述端口信息向所述目标容器发送更新请求;
根据获取到的端口信息与目标容器建立连接,进行数据交换。具体地,通过端口信息确定目标容器的物理地址和接口信息,根据物理地址与目标容器建立连接,通过接口信息的校验获取目标容器的权限,该权限可以用于向目标容器发送内容、删除或修改目标容器的内容等等,获取到目标容器的权限之后,向目标容器发布更新请求,更新请求中携带有触发目标容器更新指令的对应触发码,目标容器在获取到更新请求后启动更新流程。
如图6所示,步骤S1300具体包括下述步骤:
S1310、将所述目标容器中的原内容写入指定的存储区域内作为备份内容;
目标容器在获取到发布内容之后,停止当前服务程序的动作,进入更新状态,将容器内当前运作的服务程序写入指定的存储区域内进行保存备份。指定的存储区域可以根据实际使用场景进行设定,例如容器内预设的用于备份保存的存储区域,或者服务器中被指定用作备份的一个或多个容器,但不限于此。服务程序的备份方法可以是将当前的代码整合为一份备份数据,或者将当前的程序本身完整地复制,当更新失败时可以通过备份的内容对该容器实现内容版本的回降。
S1320、重启所述目标容器;
将当前内容备份之后,进入容器重启流程,对目标容器进行重启,以确保当前运作的完全停止,防止内容更新过程中出现错误或者内容写入不到位。
S1330、将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容。
将目标容器重启后,开始进行内容更新,将获取到的发布内容写入到容器中,同时覆盖目标容器中原有的内容。在一些实施方式中,可以先删除目标容器中的原有内容,再直接将发布内容写入。内容写入完成后,进行更新,更新的流程根据实际使用场景的不同可以进行调整,例如包括部署、解析和安装等,但不限于此。更新的流程可以写入在 发布内容中,在发布内容写入之后,自动进行更新。更新完成之后,再次重启目标容器,进入容器正常运作流程。
如图7所示,步骤S1330之后还包括下述步骤:
S1331、判断所述目标容器是否正常启动;
目标容器更新后首次重启时向服务器发送一个启动校验码,用于反馈目标容器的更新结果,当服务器收到校验码并判断该校验码正确时,确定目标容器正常启动;当服务器收到校验码不符合预设的规则或者超过预设的时间段没有收到校验码时,说明目标容器更新后并不能够反馈正确的校验码,确定目标容器启动异常。
S1332、当所述目标容器正常启动时,删除所述存储区域内的备份内容;
当服务器确定目标容器更新后正常启动时,向目标容器发送删除备份的指令,删除指定存储区域内的备份内容,内容发布流程结束。在一些实施方式中,当指定存储区域是服务器中的指定容器时,服务器确定目标容器正常启动后,将删除备份的指令发送至服务器或者其中的备份指定容器,删除备份内容。
S1333、当所述目标容器无法正常启动时,根据所述指定存储区域内的备份内容恢复所述目标容器的内容。
当服务器确定目标容器无法正常启动时,启动容器的内容恢复流程,强制停止目标容器的运作,同时在指定存储区域内获取到备份内容,将备份内容写入到目标容器中并覆盖目标容器中现有的内容,实现版本回降,同时,生成警报信息并触发警报指令,以向管理平台的维护人员反馈此次更新的失败,引导维护人员进行故障排查或修复。在一些实施方式中,版本回降之后再次判断容器是否能正常启动,当容器可以正常启动时,生成对应的完成信息,例如“容器已完成版本回降”;当容器无法正常启动时,生成对应的失败信息,例如“容器在版本回降后仍无法正常启动,已停止运作”。
在将原内容备份后,当容器更新失败而无法正常启动或者运作时,可以通过备份内容实现服务程序的版本回降,当容器更新失败时有效 保证容器的正常运作,同时利用警报信息提醒维护人员进行维护,降低更新失败对于服务程序运行的影响。
为解决上述技术问题,本申请实施例还提供一种服务程序发布装置。具体请参阅图8,图8为本实施服务程序发布装置的基本结构框图。
如图8所示,服务程序发布装置,包括:获取模块2100、处理模块2200和执行模块2300。其中,获取模块用于获取发布内容,其中,所述发布内容包括服务程序;处理模块用于将所述发布内容分配至目标容器,其中,所述目标容器为服务器中与所述服务程序具有映射关系的一个或多个容器;执行模块用于重启所述目标容器,将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容。
通过在服务器中设置多个相互独立的容器,在需要进行内容发布时,直接查找对应的目标容器并将发布的内容发送到目标容器,相比于传统的通过人为地进行版本代码发布部署,这种发布方法可以有效的减少内容发布时开发和运营等人员之间的沟通和协调,节省人力成本,降低出错概率,进一步地,在内容进行更新时,只需要更新对应的一个或多个目标容器的内容,对目标容器进行重启,可以有效地提高发布内容的效率,避免了传统的发布方式需要将内容上传到服务器中对整个服务器进行重启的弊端。
在一些实施方式中,服务程序发布装置还包括:第一获取子模块、第一处理子模块、第一执行子模块。其中第一获取子模块用于获取所述发布内容的识别信息,其中,所述识别信息为用于区分并识别不同服务程序的程序识别代码;第一处理子模块用于根据所述识别信息在服务器中查找与所述识别信息具有映射关系的容器作为所述目标容器;第一执行子模块用于触发所述目标容器的更新指令,启动所述目标容器的更新流程。
在一些实施方式中,服务程序发布装置还包括:第二获取子模块、第一查找子模块、第二执行子模块。其中,第二获取子模块用于获取所有容器的容器信息,其中,所述容器信息包括容器中已有服务程序 的程序识别码;第一查找子模块用于查找所述程序识别码与所述识别信息具有映射关系的对应容器;第二执行子模块用于定义所述具有映射关系的对应容器为所述目标容器。
在一些实施方式中,服务程序发布装置还包括:第三执行子模块、第二处理子模块。其中,第三执行子模块用于当查找不到所述对应容器时,获取优先级信息,其中,所述优先级信息包括服务器中各容器的使用优先级;第二处理子模块用于根据所述容器优先级信息确定其中使用优先级最高的容器为所述目标容器。
在一些实施方式中,服务程序发布装置还包括:第三获取子模块、第一发送子模块。其中,第三获取子模块用于获取所述目标容器的端口信息,其中,所述端口信息为用于确定容器端口地址的地址码;第一发送子模块用于根据所述端口信息向所述目标容器发送更新请求。
在一些实施方式中,服务程序发布装置还包括:第一写入子模块、第一重启子模块、第二写入子模块。其中,第一写入子模块用于将所述目标容器中的原内容写入指定的存储区域内作为备份内容;第一重启子模块用于重启所述目标容器;第二写入子模块用于将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容。
在一些实施方式中,服务程序发布装置还包括:第一判断子模块、第四执行子模块、第五执行子模块。其中,第一判断子模块用于判断所述目标容器是否正常启动;第四执行子模块用于当所述目标容器正常启动时,删除所述存储区域内的备份内容;第五执行子模块用于当所述目标容器无法正常启动时,根据所述指定存储区域内的备份内容恢复所述目标容器的内容。
为解决上述技术问题,本申请实施例还提供一种计算机设备。具体请参阅图9,图9为本实施例计算机设备基本结构框图。
如图9所示,计算机设备的内部结构示意图。如图9所示,该计算机设备包括通过系统总线连接的处理器、非易失性存储介质、存储器和网络接口。其中,该计算机设备的非易失性存储介质存储有操作系统、数据库和计算机可读指令,数据库中可存储有控件信息序列, 该计算机可读指令被处理器执行时,可使得处理器实现一种服务程序发布方法。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该计算机设备的存储器中可存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行一种服务程序发布方法。该计算机设备的网络接口用于与终端连接通信。本领域技术人员可以理解,图中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
本实施方式中处理器用于执行图8中获取模块2100、处理模块2200和执行模块2300的具体功能,存储器存储有执行上述模块所需的程序代码和各类数据。网络接口用于向用户终端或服务器之间的数据传输。本实施方式中的存储器存储有服务程序发布装置中执行所有子模块所需的程序代码及数据,服务器能够调用服务器的程序代码及数据执行所有子模块的功能。
本申请还提供一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述任一实施例所述服务程序发布方法的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。本实施方式中的存储介质是易失性存储介质,也可以是非易失性的存储介质。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-OnlyMemory,ROM)等非易失性存储介质,或随机存储记忆体(RandomAccessMemory,RAM)等。
Claims (20)
- 一种服务程序发布方法,包括以下步骤:获取发布内容,其中,所述发布内容包括服务程序;将所述发布内容分配至目标容器,其中,所述目标容器为服务器中与所述服务程序具有映射关系的一个或多个容器;重启所述目标容器,将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容。
- 如权利要求1所述的服务程序发布方法,所述将所述发布内容分配至目标容器的步骤之前,包括以下步骤:获取所述发布内容的识别信息,其中,所述识别信息为用于区分并识别不同服务程序的程序识别代码;根据所述识别信息在服务器中查找与所述识别信息具有映射关系的容器作为所述目标容器;触发所述目标容器的更新指令,启动所述目标容器的更新流程。
- 如权利要求2所述的服务程序发布方法,所述服务器中包含多个容器,所述根据所述识别信息在服务器中查找与所述识别信息具有映射关系的容器作为所述目标容器的步骤,包括以下步骤:获取所有容器的容器信息,其中,所述容器信息包括容器中已有服务程序的程序识别码;查找所述程序识别码与所述识别信息具有映射关系的对应容器;定义所述具有映射关系的对应容器为所述目标容器。
- 如权利要求3所述的服务程序发布方法,所述查找所述程序识别码与所述识别信息具有映射关系的对应容器的步骤之后,包括以下步骤:当查找不到所述对应容器时,获取优先级信息,其中,所述优先级信息包括服务器中各容器的使用优先级;根据所述容器优先级信息确定其中使用优先级最高的容器为所述目标容器。
- 如权利要求2所述的服务程序发布方法,所述根据所述识别信 息在服务器中查找与所述识别信息具有映射关系的容器作为所述目标容器的步骤之后,包括下述步骤:获取所述目标容器的端口信息,其中,所述端口信息为用于确定容器端口地址的地址码;根据所述端口信息向所述目标容器发送更新请求。
- 如权利要求1-5任一项所述的服务程序发布方法,所述重启所述目标容器,将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容的步骤,包括下述步骤:将所述目标容器中的原内容写入指定的存储区域内作为备份内容;重启所述目标容器;将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容。
- 如权利要求6所述的服务程序发布方法,所述将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容的步骤之后,包括下述步骤:判断所述目标容器是否正常启动;当所述目标容器正常启动时,删除所述存储区域内的备份内容;当所述目标容器无法正常启动时,根据所述指定的存储区域内的备份内容恢复所述目标容器的内容。
- 一种服务程序发布装置,包括:获取模块,用于获取发布内容,其中,所述发布内容包括服务程序;处理模块,用于将所述发布内容分配至目标容器,其中,所述目标容器为服务器中与所述服务程序具有映射关系的一个或多个容器;执行模块,用于重启所述目标容器,将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容。
- 一种计算机设备,包括:一个或多个处理器;存储器;一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个计算机程序配置用于执行一种服务程序发布方法,所述服务程序发布方法包括以下步骤:获取发布内容,其中,所述发布内容包括服务程序;将所述发布内容分配至目标容器,其中,所述目标容器为服务器中与所述服务程序具有映射关系的一个或多个容器;重启所述目标容器,将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容。
- 根据权利要求9所述的计算机设备,所述将所述发布内容分配至目标容器的步骤之前,包括以下步骤:获取所述发布内容的识别信息,其中,所述识别信息为用于区分并识别不同服务程序的程序识别代码;根据所述识别信息在服务器中查找与所述识别信息具有映射关系的容器作为所述目标容器;触发所述目标容器的更新指令,启动所述目标容器的更新流程。
- 根据权利要求10所述的计算机设备,所述服务器中包含多个容器,所述根据所述识别信息在服务器中查找与所述识别信息具有映射关系的容器作为所述目标容器的步骤,包括以下步骤:获取所有容器的容器信息,其中,所述容器信息包括容器中已有服务程序的程序识别码;查找所述程序识别码与所述识别信息具有映射关系的对应容器;定义所述具有映射关系的对应容器为所述目标容器。
- 根据权利要求11所述的计算机设备,所述查找所述程序识别码与所述识别信息具有映射关系的对应容器的步骤之后,包括以下步骤:当查找不到所述对应容器时,获取优先级信息,其中,所述优先级信息包括服务器中各容器的使用优先级;根据所述容器优先级信息确定其中使用优先级最高的容器为所述目标容器。
- 根据权利要求10所述的计算机设备,所述根据所述识别信息在服务器中查找与所述识别信息具有映射关系的容器作为所述目标容器的步骤之后,包括下述步骤:获取所述目标容器的端口信息,其中,所述端口信息为用于确定容器端口地址的地址码;根据所述端口信息向所述目标容器发送更新请求。
- 根据权利要求9-13任一项所述的计算机设备,所述重启所述目标容器,将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容的步骤,包括下述步骤:将所述目标容器中的原内容写入指定的存储区域内作为备份内容;重启所述目标容器;将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容。
- 根据权利要求14所述的计算机设备,所述将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容的步骤之后,包括下述步骤:判断所述目标容器是否正常启动;当所述目标容器正常启动时,删除所述指定的存储区域内的备份内容;当所述目标容器无法正常启动时,根据所述指定的存储区域内的备份内容恢复所述目标容器的内容。
- 一种计算机可读存储介质,当所述存储介质中的指令由计算机的处理器执行时,使得计算机能够执行一种服务程序发布方法,所述服务程序发布方法包括以下步骤:获取发布内容,其中,所述发布内容包括服务程序;将所述发布内容分配至目标容器,其中,所述目标容器为服务器 中与所述服务程序具有映射关系的一个或多个容器;重启所述目标容器,将所述发布内容写入到所述目标容器中,覆盖所述目标容器中的原内容。
- 根据权利要求16所述的计算机可读存储介质,所述将所述发布内容分配至目标容器的步骤之前,包括以下步骤:获取所述发布内容的识别信息,其中,所述识别信息为用于区分并识别不同服务程序的程序识别代码;根据所述识别信息在服务器中查找与所述识别信息具有映射关系的容器作为所述目标容器;触发所述目标容器的更新指令,启动所述目标容器的更新流程。
- 根据权利要求17所述的计算机可读存储介质,所述服务器中包含多个容器,所述根据所述识别信息在服务器中查找与所述识别信息具有映射关系的容器作为所述目标容器的步骤,包括以下步骤:获取所有容器的容器信息,其中,所述容器信息包括容器中已有服务程序的程序识别码;查找所述程序识别码与所述识别信息具有映射关系的对应容器;定义所述具有映射关系的对应容器为所述目标容器。
- 根据权利要求18所述的计算机可读存储介质,所述查找所述程序识别码与所述识别信息具有映射关系的对应容器的步骤之后,包括以下步骤:当查找不到所述对应容器时,获取优先级信息,其中,所述优先级信息包括服务器中各容器的使用优先级;根据所述容器优先级信息确定其中使用优先级最高的容器为所述目标容器。
- 根据权利要求17所述的计算机可读存储介质,所述根据所述识别信息在服务器中查找与所述识别信息具有映射关系的容器作为所述目标容器的步骤之后,包括下述步骤:获取所述目标容器的端口信息,其中,所述端口信息为用于确定容器端口地址的地址码;根据所述端口信息向所述目标容器发送更新请求。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910014248.6 | 2019-01-08 | ||
| CN201910014248.6A CN109918099A (zh) | 2019-01-08 | 2019-01-08 | 服务程序发布方法、装置、计算机设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020143324A1 true WO2020143324A1 (zh) | 2020-07-16 |
Family
ID=66960211
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/118539 Ceased WO2020143324A1 (zh) | 2019-01-08 | 2019-11-14 | 服务程序发布方法、装置、计算机设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109918099A (zh) |
| WO (1) | WO2020143324A1 (zh) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109918099A (zh) * | 2019-01-08 | 2019-06-21 | 平安科技(深圳)有限公司 | 服务程序发布方法、装置、计算机设备及存储介质 |
| CN113535203B (zh) * | 2021-07-06 | 2024-06-07 | 海南视联通信技术有限公司 | 服务器升级方法、装置、设备及存储介质 |
| CN114363168B (zh) * | 2021-12-21 | 2024-06-14 | 上海众源网络有限公司 | 容器内服务配置修改方法及装置、电子设备及存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106020930A (zh) * | 2016-05-13 | 2016-10-12 | 深圳市中润四方信息技术有限公司 | 一种基于应用容器的应用管理方法及系统 |
| US20170085653A1 (en) * | 2015-09-22 | 2017-03-23 | Le Holdings (Beijing) Co., Ltd. | Method, device and system for message distribution |
| CN108549542A (zh) * | 2018-04-11 | 2018-09-18 | 泰康保险集团股份有限公司 | 一种文件部署方法、装置及设备 |
| CN108959046A (zh) * | 2018-06-08 | 2018-12-07 | 联想(北京)有限公司 | 一种信息处理方法、设备及装置 |
| CN109918099A (zh) * | 2019-01-08 | 2019-06-21 | 平安科技(深圳)有限公司 | 服务程序发布方法、装置、计算机设备及存储介质 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109313544A (zh) * | 2016-05-23 | 2019-02-05 | W·特纳 | 具有虚拟机的基于容器的部署的超融合系统架构 |
| CN108282513B (zh) * | 2017-12-08 | 2021-01-29 | 广州视源电子科技股份有限公司 | 服务器部署方法、系统、存储介质及计算机设备 |
-
2019
- 2019-01-08 CN CN201910014248.6A patent/CN109918099A/zh active Pending
- 2019-11-14 WO PCT/CN2019/118539 patent/WO2020143324A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170085653A1 (en) * | 2015-09-22 | 2017-03-23 | Le Holdings (Beijing) Co., Ltd. | Method, device and system for message distribution |
| CN106020930A (zh) * | 2016-05-13 | 2016-10-12 | 深圳市中润四方信息技术有限公司 | 一种基于应用容器的应用管理方法及系统 |
| CN108549542A (zh) * | 2018-04-11 | 2018-09-18 | 泰康保险集团股份有限公司 | 一种文件部署方法、装置及设备 |
| CN108959046A (zh) * | 2018-06-08 | 2018-12-07 | 联想(北京)有限公司 | 一种信息处理方法、设备及装置 |
| CN109918099A (zh) * | 2019-01-08 | 2019-06-21 | 平安科技(深圳)有限公司 | 服务程序发布方法、装置、计算机设备及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109918099A (zh) | 2019-06-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10915412B2 (en) | System and method for live migration of a virtual machine | |
| CN106843957B (zh) | 系统固件升级方法及装置 | |
| US10635473B2 (en) | Setting support program, setting support method, and setting support device | |
| US20160077919A1 (en) | Methods and apparatus to perform site recovery of a virtual data center | |
| US9146839B2 (en) | Method for pre-testing software compatibility and system thereof | |
| CN106020865B (zh) | 一种系统升级方法和装置 | |
| CN107451040B (zh) | 故障原因的定位方法、装置及计算机可读存储介质 | |
| US20170090904A1 (en) | Application management device, application management method, and computer-readable recording medium | |
| WO2020143324A1 (zh) | 服务程序发布方法、装置、计算机设备及存储介质 | |
| CN106603289B (zh) | 一种lmt配置文件平滑升级方法 | |
| US20230239212A1 (en) | Stable References for Network Function Life Cycle Management Automation | |
| CN109324959B (zh) | 一种自动转移数据的方法、服务器及计算机可读存储介质 | |
| CN113703823A (zh) | 一种bmc固件升级方法、装置、电子设备及存储介质 | |
| CN119225925A (zh) | 服务管理方法、装置、电子设备及存储介质 | |
| CN113326052B (zh) | 业务组件的升级方法、装置、计算机设备和存储介质 | |
| CN111158729A (zh) | 系统升级方法、装置、设备及存储介质 | |
| US12235728B2 (en) | Automatic identification and attachment of replicated volumes to application | |
| CN114238255A (zh) | 同步文件的方法、装置、电子设备及计算机可读存储介质 | |
| CN107463390A (zh) | 一种软件升级方法及升级服务器 | |
| CN114675902A (zh) | 基于嵌入式设备的软件版本的管理方法与管理装置 | |
| US20160162365A1 (en) | Storing difference information in a backup system | |
| WO2018010603A1 (zh) | 基于视频云存储系统的存储模式升级方法、装置和系统 | |
| CN119127254A (zh) | 一种硬盘固件升级方法、装置、电子设备及存储介质 | |
| WO2016131294A1 (zh) | 版本升级处理方法及装置 | |
| CN114153387B (zh) | 一种ai平台的多用户存储对接方法和ai平台 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19909125 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19909125 Country of ref document: EP Kind code of ref document: A1 |