[go: up one dir, main page]

CN108563515A - A kind of business process management method and system - Google Patents

A kind of business process management method and system Download PDF

Info

Publication number
CN108563515A
CN108563515A CN201810226939.8A CN201810226939A CN108563515A CN 108563515 A CN108563515 A CN 108563515A CN 201810226939 A CN201810226939 A CN 201810226939A CN 108563515 A CN108563515 A CN 108563515A
Authority
CN
China
Prior art keywords
business process
business
guardian
group
guard
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
CN201810226939.8A
Other languages
Chinese (zh)
Other versions
CN108563515B (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.)
China Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN201810226939.8A priority Critical patent/CN108563515B/en
Publication of CN108563515A publication Critical patent/CN108563515A/en
Application granted granted Critical
Publication of CN108563515B publication Critical patent/CN108563515B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present embodiments relate to management of process field more particularly to a kind of business process management methods and system, to solve the problems, such as in the prior art to business process managerial flexibility difference.In the embodiment of the present invention, suitable for including the system of configuration center and at least one host composition;Configuration center is for configuring the corresponding configuration information of multiple business process;Demon agent obtains configuration information from configuration center;Configuration information include be used to indicate the business process group in multiple business process belonging to each business process instruction information and the corresponding multigroup business process group of multiple business process in every group of business process group is corresponding guards information;Demon agent determines the corresponding multigroup business process group of multiple business process according to instruction information;Every group of business process group includes at least one of multiple business process business process in multigroup business process group;Demon agent guards information according to business process group is corresponding, it is determined whether business process group is guarded in unlatching.

Description

一种业务进程管理方法和系统Method and system for business process management

技术领域technical field

本发明实施例涉及进程管理领域,尤其涉及一种业务进程管理方法和系统。The embodiments of the present invention relate to the field of process management, and in particular to a business process management method and system.

背景技术Background technique

分布式环境或者系统的应用已经很普遍了,对于分布式系统中的服务器往往会启动多类业务进程,各类业务进程必须提供正常的服务以保证互联网业务的正常运行。因此,需要对业务进程进行监控。通常用守护进程监控服务器上的各业务进程是否存活,一旦有业务进程退出,守护进程可以及时探测到并重信拉起业务进程,进而保证各业务进程的正常运行。Distributed environments or system applications are already very common. Servers in distributed systems often start multiple types of business processes, which must provide normal services to ensure the normal operation of Internet services. Therefore, the business process needs to be monitored. Usually, a daemon process is used to monitor whether each business process on the server is alive. Once a business process exits, the daemon process can detect it in time and trust it to start the business process, thereby ensuring the normal operation of each business process.

在现有技术中,需要在不同的服务器上部署不同的守护进程,且守护进程对该服务器上的所有业务进程进行统一守护,当有某个或某几个业务进程升级或变更时,需要停止守护进程的守护;造成对业务进程管理灵活性差的问题。In the prior art, different daemon processes need to be deployed on different servers, and the daemon processes uniformly guard all business processes on the server. When one or several business processes are upgraded or changed, they need to be stopped The guardian of the daemon process; resulting in poor flexibility in business process management.

发明内容Contents of the invention

本发明实施例提供一种业务进程管理方法和系统,用以解决现有技术中对业务进程管理灵活性差问题。Embodiments of the present invention provide a business process management method and system to solve the problem of poor flexibility in business process management in the prior art.

本发明实施例提供一种业务进程管理方法,所述方法适用于包括配置中心和至少一个主机构成的系统;所述主机上部署有守护代理和多个业务进程;所述配置中心用于配置所述多个业务进程对应的配置信息;该方法包括:所述守护代理从所述配置中心获取所述配置信息;其中,所述配置信息包括用于指示所述多个业务进程中每个业务进程所属的业务进程组的指示信息,以及所述多个业务进程对应的多组业务进程组中每组业务进程组对应的守护信息;所述守护代理根据所述指示信息确定所述多个业务进程对应的多组业务进程组;所述多组业务进程组中每组业务进程组包括所述多个业务进程中的至少一个业务进程;所述守护代理根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护。An embodiment of the present invention provides a business process management method, and the method is applicable to a system composed of a configuration center and at least one host; a guard agent and multiple business processes are deployed on the host; the configuration center is used to configure all The configuration information corresponding to the plurality of business processes; the method includes: the guardian agent obtains the configuration information from the configuration center; wherein the configuration information includes information for indicating each business process in the plurality of business processes The indication information of the business process group to which the multiple business processes belong, and the guardian information corresponding to each set of business process groups in the multiple business process groups corresponding to the multiple business processes; the guardian agent determines the multiple business processes according to the indication information Corresponding multiple sets of business process groups; each set of business process groups in the multiple sets of business process groups includes at least one business process in the multiple sets of business processes; the guardian agent according to the guard information corresponding to the business process group, Determine whether to enable the guarding of the business process group.

由于本发明实施例中,守护代理可根据配置信息中的指示信息确定出多个业务进程对应的多组业务进程组,根据业务进程组的对应的守护信息来确定是否开启对所述业务进程组的守护;通过本发明实施例,实现了对业务进程的有效划分,进而可以从不同的粒度对业务进程进行管理,提高了业务进程管理的灵活性。Because in the embodiment of the present invention, the guardian agent can determine multiple sets of business process groups corresponding to multiple business processes according to the indication information in the configuration information, and determine whether to enable the service process group according to the corresponding guard information of the business process groups The guardianship of the service process; through the embodiment of the present invention, the effective division of the service process is realized, and the service process can be managed from different granularities, which improves the flexibility of the service process management.

进一步,配置信息是在配置中心集中进行配置的,不需要在每个主机上对业务进程进行配置,如此,可以在配置中心集中管理配置信息,进而提高了运维人员的工作效率。Furthermore, the configuration information is centrally configured in the configuration center, and there is no need to configure the business process on each host. In this way, the configuration information can be managed centrally in the configuration center, thereby improving the work efficiency of the operation and maintenance personnel.

可选地,所述守护代理根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护之后,还包括:针对所述每组业务进程组包括一个业务进程,执行:当所述守护代理确定开启对所述业务进程的守护时,确定所述业务进程在当前进程记录数组中对应的标识是否为初始值;所述当前进程记录数组用于标识对应的业务进程的当前运行状态;若所述守护代理确定所述业务进程在所述当前进记录数组中对应的标识为初始值时,则重新启动所述业务进程。Optionally, after the guard agent determines whether to enable guarding of the business process group according to the guard information corresponding to the business process group, it also includes: for each set of business process groups including a business process, execute: When the guardian agent determines to enable the guarding of the business process, determine whether the corresponding identifier of the business process in the current process record array is an initial value; the current process record array is used to identify the current process of the corresponding business process Running state: if the guardian agent determines that the corresponding identifier of the business process in the array of current progress records is the initial value, restart the business process.

本发明实施例中,通过确定所述业务进程在当前进程记录数组中对应的标识是否为初始值来确定该业务进程是否丢失,不需要像现有技术中与业务进程通过心跳报文的方式来确定业务进程是否丢失,进而避免了对业务进程的侵入,降低了业务进程与守护代理之间的耦合性,有助于提高系统的稳定性。In the embodiment of the present invention, whether the business process is lost is determined by determining whether the corresponding identifier of the business process in the current process record array is an initial value, and it is not necessary to communicate with the business process through a heartbeat message as in the prior art. It is determined whether the business process is lost, thereby avoiding the intrusion of the business process, reducing the coupling between the business process and the guard agent, and helping to improve the stability of the system.

可选地,所述主机上还部署有命令行客户端程序,所述命令行客户端程序用于输入操作指令;所述守护代理从所述配置中心获取所述配置信息之后,还包括:所述守护代理接收所述命令行客户端程序发送的操作指令;所述守护代理根据所述操作指令查询或修改所述守护信息。Optionally, a command-line client program is also deployed on the host, and the command-line client program is used to input operation instructions; after the daemon agent acquires the configuration information from the configuration center, it further includes: The guardian agent receives the operation instruction sent by the command line client program; the guardian agent queries or modifies the guardian information according to the operation instruction.

通过本发明实施例中命令行客户端程序,一方面可以实现通过命令行客户端程序提供对业务进程操作指令的支持,另一方面有助于降低对业务进程高危命令的告警。Through the command line client program in the embodiment of the present invention, on the one hand, the command line client program can provide support for business process operation instructions, and on the other hand, it can help reduce alarms for high-risk business process commands.

可选地,所述守护代理根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护,包括:所述守护代理根据所述多组所述业务进程组中每组业务进程组对应的守护信息,确定所述业务进程组的业务进程组开关数组;所述守护代理对所述业务进程组开关数组中的开关值为开的业务进程组开启守护。Optionally, the guard agent determines whether to enable guarding of the business process group according to the guard information corresponding to the business process group, including: the guard agent determines whether to enable guarding of the business process group according to The guard information corresponding to the business process group determines the business process group switch array of the business process group; the guard agent starts guarding for the business process group whose switch value is ON in the business process group switch array.

可选地,所述当所述守护代理确定开启对所述业务进程的守护时,确定所述业务进程在当前进程记录数组中对应的标识是否为初始值之前,还包括:所述守护代理根据所述配置信息初始化进程记录数组;所述守护代理根据所述多个业务进程中每个业务进程对应的守护信息获取所述业务进程的标识;所述守护代理根据前一次进程记录数组中所述业务进程对应的标识的位置,确定出获取到的所述业务进程在初始化进程记录数组中的目标位置;所述守护代理将获取到的所述业务进程对应的标识记录在所述目标位置,确定出当前进程记录数组。Optionally, when the guardian agent determines to enable the guardian of the business process, before determining whether the corresponding identifier of the business process in the current process record array is an initial value, it further includes: the guardian agent according to The configuration information initializes a process record array; the guard agent acquires the identifier of the business process according to the guard information corresponding to each business process in the plurality of business processes; The position of the identification corresponding to the business process determines the acquired target position of the business process in the initialization process record array; the guardian agent records the acquired identification corresponding to the business process in the target position, and determines Get the current process record array.

本发明实施例提供一种业务进程管理系统,所述系统包括配置中心和至少一个主机;所述主机上部署有守护代理和多个业务进程;所述配置中心用于配置所述多个业务进程对应的配置信息;其中,所述主机上部署的守护代理包括:获取单元,用于从所述配置中心获取所述配置信息;其中,所述配置信息包括用于指示所述多个业务进程中每个业务进程所属的业务进程组的指示信息,以及所述多个业务进程对应的多组业务进程组中每组业务进程组对应的守护信息;处理单元,用于根据所述指示信息确定所述多个业务进程对应的多组业务进程组;所述多组业务进程组中每组业务进程组包括所述多个业务进程中的至少一个业务进程;根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护。An embodiment of the present invention provides a business process management system, the system includes a configuration center and at least one host; a guard agent and multiple business processes are deployed on the host; the configuration center is used to configure the multiple business processes Corresponding configuration information; wherein, the guardian agent deployed on the host includes: an obtaining unit, configured to obtain the configuration information from the configuration center; wherein, the configuration information includes information for indicating that in the plurality of business processes The indication information of the business process group to which each business process belongs, and the guardian information corresponding to each set of business process groups in the plurality of business process groups corresponding to the plurality of business processes; the processing unit is configured to determine the indicated information according to the indication information Multiple business process groups corresponding to the multiple business processes; each business process group in the multiple business process groups includes at least one business process in the multiple business processes; according to the guardian information corresponding to the business process group , to determine whether to enable the guarding of the business process group.

可选地,所述处理单元,还用于:针对所述每组业务进程组包括一个业务进程,执行:当确定开启对所述业务进程的守护时,确定所述业务进程在当前进程记录数组中对应的标识是否为初始值;所述当前进程记录数组用于标识对应的业务进程的当前运行状态;若确定所述业务进程在所述当前进记录数组中对应的标识为初始值时,则重新启动所述业务进程。Optionally, the processing unit is further configured to: for each set of business process groups includes a business process, perform: when determining to enable the guard of the business process, determine that the business process records the array in the current process Whether the corresponding identifier in the array is an initial value; the current process record array is used to identify the current running state of the corresponding business process; if it is determined that the corresponding identifier of the business process in the current progress record array is an initial value, then Restart the business process.

可选地,所述主机上还部署有命令行客户端程序,所述命令行客户端程序用于输入操作指令;所述获取单元,还用于:接收所述命令行客户端程序发送的操作指令;所述处理单元,还用于:根据所述操作指令查询或修改所述守护信息。Optionally, a command-line client program is also deployed on the host, and the command-line client program is used to input operation instructions; the acquisition unit is also used to: receive the operation sent by the command-line client program Instruction; the processing unit is further configured to: query or modify the guardian information according to the operation instruction.

可选地,所述处理单元,用于:根据所述多组所述业务进程组中每组业务进程组对应的守护信息,确定所述业务进程组的业务进程组开关数组;对所述业务进程组开关数组中的开关值为开的业务进程组开启守护。Optionally, the processing unit is configured to: determine the business process group switch array of the business process group according to the guardian information corresponding to each of the multiple business process groups; The switch value in the process group switch array is on, and the business process group starts the daemon.

可选地,所述处理单元,还用于:根据所述配置信息初始化进程记录数组;根据所述多个业务进程中每个业务进程对应的守护信息获取所述业务进程的标识;根据前一次进程记录数组中所述业务进程对应的标识的位置,确定出获取到的所述业务进程在初始化进程记录数组中的目标位置;将获取到的所述业务进程对应的标识记录在所述目标位置,确定出当前进程记录数组。Optionally, the processing unit is further configured to: initialize a process record array according to the configuration information; obtain the identifier of the business process according to the guardian information corresponding to each of the multiple business processes; The position of the identifier corresponding to the business process in the process record array determines the acquired target position of the business process in the initialization process record array; records the acquired identifier corresponding to the business process in the target position , determine the current process record array.

本发明实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使所述计算机执行上述所述的方法。An embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to cause the computer to execute the above-mentioned method.

本发明实施例提供一种计算机设备,包括:存储器,用于存储程序指令;An embodiment of the present invention provides a computer device, including: a memory for storing program instructions;

处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述所述的方法。The processor is configured to call the program instructions stored in the memory, and execute the above-mentioned method according to the obtained program.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without any creative effort.

图1为本发明实施例提供的一种通信系统的架构示意图;FIG. 1 is a schematic structural diagram of a communication system provided by an embodiment of the present invention;

图2为本发明实施例提供的一种守护代理的框架示意图;FIG. 2 is a schematic diagram of a framework of a guardian agent provided by an embodiment of the present invention;

图3为本发明实施例提供的一种守护信息示意图;FIG. 3 is a schematic diagram of guard information provided by an embodiment of the present invention;

图4为本发明实施例提供的一种业务进程管理方法流程示意图;FIG. 4 is a schematic flowchart of a business process management method provided by an embodiment of the present invention;

图5为本发明实施例提供的一种业务进程管理系统中守护代理的结构示意图。Fig. 5 is a schematic structural diagram of a guard agent in a business process management system provided by an embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

图1示出了应用本发明实施例的一种通信系统的架构示意图。如图1所示,该系统架构可以包括配置中心10和主机集群20;主机集群20包括多个主机,图1以主机20a和主机20b为例说明。配置中心10和主机集群20中的每个主机通过有线或者无线的方式进行连接。Fig. 1 shows a schematic diagram of a communication system applying an embodiment of the present invention. As shown in FIG. 1 , the system architecture may include a configuration center 10 and a host cluster 20; the host cluster 20 includes multiple hosts, and FIG. 1 takes host 20a and host 20b as examples for illustration. The configuration center 10 and each host in the host cluster 20 are connected in a wired or wireless manner.

配置中心10可以是数据库;用于配置多个业务进程对应的配置信息;其中,配置信息包括用于指示所述多个业务进程中每个业务进程所属的业务进程组的指示信息,以及所述多个业务进程对应的多组业务进程组中每组业务进程组对应的守护信息;所述多组业务进程组中每组业务进程组包括所述多个业务进程中的至少一个业务进程。可选地,配置中心可以按主机名-业务进程名索引配置信息。The configuration center 10 may be a database; it is used to configure configuration information corresponding to multiple business processes; wherein, the configuration information includes indication information for indicating the business process group to which each business process in the multiple business processes belongs, and the Guardian information corresponding to each of the plurality of service process groups corresponding to the plurality of service processes; each of the plurality of service process groups includes at least one service process in the plurality of service process groups. Optionally, the configuration center can index configuration information by hostname-business process name.

主机集群20中的主机20a上部署业务进程组201、业务进程组202、守护代理203和命令行客户端程序21,主机20b上部署有业务进程组204、业务进程组205、守护代理206和命令行客户端程序22;业务进程组201包括业务进程201a、201b和201c;业务进程组202包括业务进程202a、202b和202c;业务进程组204包括业务进程204a、204b和204c;业务进程组205包括业务进程205a、205b和205c。守护代理203和206用于对各业务进程组进程守护,以及对接收到的操作指令进行处理和发送应答。可选地,为了确保守护代理在主机启动时立即提供服务,可以将守护代理的启动脚本加入到主机启动脚本中,比如Linux的/etc/rc.local。命令行客户端程序21和22用于输入操作指令,并对操作指令合法性及安全性的检查,将操作指令序列化后向守护代理发送操作指令、以及对守护代理发送的应答进行展示。当命令行客户端程序完成处理后,关闭连接,触发守护代理回收资源。可选地,将命令行客户端程序部署路径加入到主机系统的搜索路径中,比如Linux的PATH路径,以保证在业务主机任意目录下运行命令行客户端程序。Business process group 201, business process group 202, guard agent 203 and command line client program 21 are deployed on host 20a in host cluster 20, and business process group 204, business process group 205, guard agent 206 and command Line client program 22; business process group 201 includes business process 201a, 201b and 201c; business process group 202 includes business process 202a, 202b and 202c; business process group 204 includes business process 204a, 204b and 204c; business process group 205 includes Business processes 205a, 205b and 205c. The guarding agents 203 and 206 are used to guard the processes of each business process group, process the received operation instructions and send responses. Optionally, in order to ensure that the daemon agent provides services immediately when the host starts, the startup script of the daemon agent can be added to the host startup script, such as /etc/rc.local of Linux. The command-line client programs 21 and 22 are used to input operation instructions, check the legality and safety of the operation instructions, serialize the operation instructions, send the operation instructions to the guardian agent, and display the response sent by the guardian agent. When the command-line client program finishes processing, it closes the connection and triggers the daemon agent to reclaim resources. Optionally, the deployment path of the command-line client program is added to the search path of the host system, such as the PATH path of Linux, so as to ensure that the command-line client program can be run in any directory of the business host.

图1的通信系统中还可以包括集中命令管理中心,集中命令管理中心与主机集群中的每个主机以有线或者无线的方式连接。命令行客户端程序21和22也可以部署在集中命令管理中心。当命令行客户端程序部署在集中命令管理中心时,为了确定出操作指令和主机之间的映射关系,在集中命令管理中心还需要预先存储主机名列表;主机名可以是主机的网络协议(Internet Protocol,简称IP)地址。命令行客户端程序可以根据主机名向相应的主机发送操作指令;通过集中命令管理中心可以实现批量的操作命令的批量管理。The communication system in FIG. 1 may further include a centralized command management center, which is connected to each host in the host cluster in a wired or wireless manner. Command line client programs 21 and 22 can also be deployed in the centralized command management center. When the command line client program is deployed in the centralized command management center, in order to determine the mapping relationship between the operation instruction and the host, the centralized command management center also needs to store the list of host names in advance; the host name can be the network protocol (Internet protocol) of the host. Protocol, referred to as IP) address. The command line client program can send operation instructions to the corresponding host according to the host name; batch management of batch operation commands can be realized through the centralized command management center.

图2示出了应用本发明实施例的一种守护代理的框架示意图。如图2所示,守护代理包括主线程301、守护线程302、守护信息303、生产者线程304、EPOLL异步事件触发器305(EPOLL是Linux内核为处理大批量文件描述符而作了改进的poll)、异步队列306和消费线程池307。Fig. 2 shows a schematic diagram of the framework of a guard agent applying the embodiment of the present invention. As shown in Figure 2, the guardian agent includes a main thread 301, a guardian thread 302, a guardian information 303, a producer thread 304, and an EPOLL asynchronous event trigger 305 (EPOLL is a poll improved by the Linux kernel for processing a large number of file descriptors). ), asynchronous queue 306 and consumer thread pool 307.

主线程301用于拉起守护线程302、生产者线程304和消费线程池307中的所有线程;初始化EPOLL异步事件触发器305、异步队列306;以及确定守护信息303。The main thread 301 is used to pull up all the threads in the daemon thread 302 , the producer thread 304 and the consumer thread pool 307 ; initialize the EPOLL asynchronous event trigger 305 and the asynchronous queue 306 ; and determine the daemon information 303 .

守护线程302用于根据业务进程组对应的守护信息,守护需要守护的所述业务进程组;当确定守护的业务进程组中的业务进程对应的标识消失时,重新拉起该标识对应的业务进程。The daemon thread 302 is used to guard the business process group that needs to be guarded according to the guard information corresponding to the business process group; when it is determined that the logo corresponding to the business process in the guarded business process group disappears, pull up the business process corresponding to the logo again .

守护信息303如图3所示,包括读写锁、全局开关业务进程组开关数组、进程开关数组、业务进程组哈希表、业务进程哈希表、主机用户名、用户目录路径、PS命令行、守护间隔。其中,业务进程开关组是易失变量,用于控制是否开启对应的业务进程组的守护;业务进程开关数组是变量,用于控制是否开启对应的业务进程的守护;业务进程组哈希表中包括三层哈希表,第一层哈希表是根据业务进程组名与一级哈希表关联组成,第二层哈希表是否三个特殊键组成,包括业务进程组开关数组中的下标、业务进程组启动路径以及业务进程组内的业务进程哈希表,第三层哈希表由业务进程组内的业务进程与其在进程开关数组中下标关联组成;业务进程哈希表包括进程开关数组下标;主机用户名标识启动业务进程的用户,用于组成每轮守护业务进程时,业务进程对应的标识获取的命令的正则表达式;PS命令行用于获取业务进程对应的标识的正则表达式;用户目录路径用于标识统一的用户根目录,通常用于拼接业务进程组的路径,可以减少业务进程组中具备同一路径前缀时的配置信息;守护间隔用于确定每轮守护的时间间隔。Guardian information 303 is shown in Figure 3, including read-write lock, global switch business process group switch array, process switch array, business process group hash table, business process hash table, host user name, user directory path, PS command line , Guardian interval. Among them, the business process switch group is a volatile variable, which is used to control whether to enable the guard of the corresponding business process group; the business process switch array is a variable, used to control whether to enable the guard of the corresponding business process; the business process group hash table It includes three layers of hash tables. The first layer of hash table is composed of the business process group name and the first-level hash table. The second layer of hash table is composed of three special keys, including the lower key in the business process group switch array. The starting path of the business process group and the business process hash table in the business process group. The third-level hash table is composed of the business process in the business process group and its subscript in the process switch array; the business process hash table includes The subscript of the process switch array; the host user name identifies the user who starts the business process, which is used to form the regular expression of the command corresponding to the identification of the business process when forming each round of guarding the business process; the PS command line is used to obtain the corresponding identification of the business process regular expression; the user directory path is used to identify a unified user root directory, and is usually used to splice the path of the business process group, which can reduce the configuration information when the business process group has the same path prefix; the guard interval is used to determine each round of guard time interval.

生产者线程304依赖于EPOLL事件触发线程;在EPOLL事件触发线程上等待事件的到来;如果超过预设时间无事件到来,进入下一轮守护;如果在预设时间内接收到命令行客户端程序发来操作指令时,确定是否为监控套接字上事件;若是,则确定为连接请求,生产者线程接收命令行客户端程序的连接,完成对连接请求的注册;若否,则从所述操作指令中读取通信上下文信息,并对异步队列临界区上锁,将上下文信息存入队列,解锁并激发消费线程池中线程。Producer thread 304 depends on the EPOLL event trigger thread; on the EPOLL event trigger thread, wait for the arrival of the event; if no event arrives beyond the preset time, enter the next round of guard; if receive the command line client program in the preset time When an operation instruction is sent, determine whether it is an event on the monitoring socket; if so, determine that it is a connection request, and the producer thread receives the connection of the command line client program, and completes the registration of the connection request; if not, then from the The operation instruction reads the communication context information, locks the critical section of the asynchronous queue, stores the context information in the queue, unlocks and activates the thread in the consumer thread pool.

EPOLL异步事件触发器305是基于EPOLL实现的多路复用IO,可以高效的分发操作指令;EPOLL asynchronous event trigger 305 is a multiplexed IO based on EPOLL, which can efficiently distribute operation instructions;

异步队列306是基于环形数组和线程信号技术实现的异步通知队列。The asynchronous queue 306 is an asynchronous notification queue implemented based on ring array and thread signal technology.

消费线程池306在异步队列的线程信号上,用于在被唤醒后,获取异步队列上的互斥锁并加锁;从异步队列中获取通信上下文信息,根据所述通信上下文信息,读取并解析通信线路上的操作指令;确定是查询指令还是修改指令;根据对应的指令获取读写锁;之后操作指令查询或修改全局开关、业务进程组开关、业务进程组开关,来实现查询或修改业务进程组的状态、业务进程的状态;释放读写锁;组装应答报文,并将应答报文写入通信线路;将套接字加回时间循环。The consumption thread pool 306 is used to obtain the mutex on the asynchronous queue and lock it after being awakened on the thread signal of the asynchronous queue; obtain the communication context information from the asynchronous queue, and read and Analyze the operation instructions on the communication line; determine whether to query or modify the instruction; obtain the read-write lock according to the corresponding instruction; then operate the instruction to query or modify the global switch, business process group switch, and business process group switch to realize query or modify business The status of the process group and the status of the business process; release the read-write lock; assemble the response message, and write the response message to the communication line; add the socket back to the time loop.

基于图1、图2和图3所示,图4示例性示出了本发明实施例提供的一种业务进程管理方法流程示意图,如图4所示,该业务进程管理方法包括以下步骤:Based on FIG. 1 , FIG. 2 and FIG. 3 , FIG. 4 exemplarily shows a schematic flowchart of a business process management method provided by an embodiment of the present invention. As shown in FIG. 4 , the business process management method includes the following steps:

步骤401,所述守护代理从所述配置中心获取所述配置信息。Step 401, the daemon agent obtains the configuration information from the configuration center.

所述配置信息包括用于指示所述多个业务进程中每个业务进程所属的业务进程组的指示信息,以及所述多个业务进程对应的多组业务进程组中每组业务进程组对应的守护信息;The configuration information includes indication information for indicating the business process group to which each business process of the multiple business processes belongs, and each of the business process groups corresponding to the multiple business processes corresponds to protect information;

步骤402,所述守护代理根据所述指示信息确定所述多个业务进程对应的多组业务进程组。Step 402, the daemon agent determines multiple sets of service process groups corresponding to the multiple service processes according to the indication information.

所述多组业务进程组中每组业务进程组包括所述多个业务进程中的至少一个业务进程。Each of the plurality of service process groups includes at least one service process in the plurality of service processes.

步骤403,所述守护代理根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护。Step 403, the guard agent determines whether to enable guarding of the business process group according to the guard information corresponding to the business process group.

由于本发明实施例中,守护代理可根据配置信息中的指示信息确定出多个业务进程对应的多组业务进程组,根据业务进程组的对应的守护信息来确定是否开启对所述业务进程组的守护;通过本发明实施例,实现了对业务进程的有效划分,进而可以从不同的粒度对业务进程进行管理,提高了业务进程管理的灵活性。Because in the embodiment of the present invention, the guardian agent can determine multiple sets of business process groups corresponding to multiple business processes according to the indication information in the configuration information, and determine whether to enable the service process group according to the corresponding guard information of the business process groups The guardianship of the service process; through the embodiment of the present invention, the effective division of the service process is realized, and the service process can be managed from different granularities, which improves the flexibility of the service process management.

进一步,配置信息是在配置中心集中进行配置的,不需要在每个主机上对业务进程进行配置,如此,可以在配置中心集中管理配置信息,进而提高了运维人员的工作效率。Furthermore, the configuration information is centrally configured in the configuration center, and there is no need to configure the business process on each host. In this way, the configuration information can be managed centrally in the configuration center, thereby improving the work efficiency of the operation and maintenance personnel.

为了便于方案的理解,表1示例性示出了本发明实施例提供的一种配置信息的形式;In order to facilitate the understanding of the solution, Table 1 exemplarily shows a form of configuration information provided by the embodiment of the present invention;

表1配置信息的形式Table 1 Format of configuration information

本发明实施例中,所述守护代理根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护之后,还包括:针对所述每组业务进程组包括一个业务进程,执行:当所述守护代理确定开启对所述业务进程的守护时,确定所述业务进程在当前进程记录数组中对应的标识是否为初始值;所述当前进程记录数组用于标识对应的业务进程的当前运行状态;若所述守护代理确定所述业务进程在所述当前进记录数组中对应的标识为初始值时,则重新启动所述业务进程。In the embodiment of the present invention, after the guard agent determines whether to enable the guarding of the business process group according to the guard information corresponding to the business process group, it further includes: including one business process for each set of business process groups, Execution: When the guardian agent determines to enable the guarding of the business process, determine whether the corresponding identifier of the business process in the current process record array is an initial value; the current process record array is used to identify the corresponding business process If the guardian agent determines that the corresponding identifier of the business process in the array of current progress records is the initial value, restart the business process.

本发明实施例中,通过确定所述业务进程在当前进程记录数组中对应的标识是否为初始值来确定该业务进程是否丢失,不需要像现有技术中与业务进程通过心跳报文的方式来确定业务进程是否丢失,进而避免了对业务进程的侵入,降低了业务进程与守护代理之间的耦合性,有助于提高系统的稳定性。In the embodiment of the present invention, whether the business process is lost is determined by determining whether the corresponding identifier of the business process in the current process record array is an initial value, and it is not necessary to communicate with the business process through a heartbeat message as in the prior art. It is determined whether the business process is lost, thereby avoiding the intrusion of the business process, reducing the coupling between the business process and the guard agent, and helping to improve the stability of the system.

本发明实施例中,所述当所述守护代理确定开启对所述业务进程的守护时,确定所述业务进程在当前进程记录数组中对应的标识是否为初始值之前,还包括:所述守护代理根据所述配置信息初始化进程记录数组;所述守护代理根据所述多个业务进程中每个业务进程对应的守护信息获取所述业务进程的标识;所述守护代理根据前一次进程记录数组中所述业务进程对应的标识的位置,确定出获取到的所述业务进程在初始化进程记录数组中的目标位置;所述守护代理将获取到的所述业务进程对应的标识记录在所述目标位置,确定出当前进程记录数组。In the embodiment of the present invention, when the guarding agent determines to enable the guarding of the business process, before determining whether the corresponding identifier of the business process in the current process record array is an initial value, it also includes: the guarding The agent initializes the process record array according to the configuration information; the guard agent obtains the identifier of the business process according to the guard information corresponding to each business process in the plurality of business processes; The position of the identification corresponding to the business process determines the acquired target position of the business process in the initialization process record array; the guardian agent records the acquired identification corresponding to the business process in the target position , determine the current process record array.

具体地,守护代理在对业务进程组进程管理时,首先要判断主机上的全局开关是否打开;若全局开关未打开,则不进行守护。需经过守护间隔后再次确定全局开关是否打开。若全局开关打开,守护代理初始化本轮业务进程对应的进程记录数组,可以将进程记录数据中的元素均初始化为0;之后通过业务进程捞取命令,读取该轮守护中所有业务进程的启动方式和业务进程对应的标识。进程捞取命令的形式可为:ps–opid,cmd–u配置的主机用户名|grep–E‘配置的进程启动正则表达式’”,其中,主机用户名及业务进程正则表达式根据表1中配置信息确定出;业务进程捞取命令可以通过管道系统调用方法。根据业务进程的启动方式查找守护信息中进程哈希表,确定出业务进程对应的标识在前一次业务进程开关数组中的索引位置,前一次进程开关数组中索引位置和当前进程记录数组中的索引位置相同,可以确定出获取到的所述业务进程对应的标识在当前进程记录数组中的目标位置;所述守护代理将获取到的所述标识记录在所述目标位置。Specifically, when the guardian agent manages the process of the business process group, it first needs to determine whether the global switch on the host is turned on; if the global switch is not turned on, then it will not guard. It is necessary to check whether the global switch is turned on again after the guard interval has elapsed. If the global switch is turned on, the guardian agent initializes the process record array corresponding to the current round of business processes, and can initialize the elements in the process record data to 0; then use the business process to retrieve the command to read the startup mode of all business processes in the round of guarding The identifier corresponding to the business process. The form of the process fishing command can be: ps–opid,cmd–u configured host user name|grep–E'configured process startup regular expression'", where the host user name and business process regular expression are based on Table 1 The configuration information is determined; the business process fishing command can call the method through the pipeline system. Search the process hash table in the guard information according to the startup mode of the business process, and determine the index position of the corresponding logo of the business process in the previous business process switch array, The index position in the previous process switch array is the same as the index position in the current process record array, and the target position of the obtained identifier corresponding to the business process in the current process record array can be determined; The identification is recorded at the target location.

本发明实施例中,所述守护代理根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护,包括:所述守护代理根据所述多组所述业务进程组中每组业务进程组对应的守护信息,确定所述业务进程组的业务进程组开关数组;所述守护代理对所述业务进程组开关数组中的开关值为开的业务进程组开启守护。In the embodiment of the present invention, the guardian agent determines whether to enable the guardian of the business process group according to the guardian information corresponding to the business process group, including: the guardian agent determines whether to enable the guard of the business process group according to the The guardian information corresponding to each business process group determines the business process group switch array of the business process group; the guard agent starts guarding for the business process group whose switch value in the business process group switch array is ON.

可选地,根据业务进程组哈希表确定出业务进程组在业务进程组开关数组中的索引位置、根据配置信息确定出业务进程组的启动路径以及业务进程组内的业务进程列表;根据确定出的索引位置确定出业务进程组开关数组中当前业务进程组数组中业务进程组的开关值,当确定所述业务进程组的开关值对应为开时,确定开启对该业务进程组的守护。Optionally, determine the index position of the business process group in the business process group switch array according to the business process group hash table, determine the startup path of the business process group and the list of business processes in the business process group according to the configuration information; The obtained index position determines the switch value of the business process group in the current business process group array in the business process group switch array, and when it is determined that the switch value of the business process group is on, it is determined to enable the guard of the business process group.

之后确定出业务进程组中的业务进程列表,取出哈希表中的键及键值,根据键值确定出业务进程对应的标识在当前进程开关数组中对应的值为开时,守护该业务进程。Then determine the business process list in the business process group, take out the key and key value in the hash table, and determine the corresponding identifier of the business process according to the key value. When the corresponding value in the current process switch array is on, guard the business process .

本发明实施例提供了一种确定业务进程是否消失或者发生变化的实施例。具体地,确定该业务进程对应的标识在当前进程记录数组的相应位置上的值,如果该值为初始值,则说明该业务进程丢失了,需要重启该业务进程。如果该值不是初始值,再比较该值在当前进程记录数组与前一次进程记录数组是否相同;如果相同,则说明业务进程正常,如果不相同,则说明业务进程发生过变化,并将当前进程记录数组中该业务进程对应的值记录到前一次进程记录数组中。如此,实现了对业务进程的守护时无侵的优势;且可以追踪到业务进程的日志信息。The embodiment of the present invention provides an embodiment of determining whether a service process disappears or changes. Specifically, determine the value of the identifier corresponding to the business process at the corresponding position of the current process record array. If the value is the initial value, it means that the business process is lost, and the business process needs to be restarted. If the value is not the initial value, then compare whether the value is the same in the current process record array and the previous process record array; if they are the same, it means that the business process is normal; The value corresponding to the business process in the record array is recorded in the previous process record array. In this way, the advantage of non-invasive protection of the business process is realized; and the log information of the business process can be traced.

当确定业务进程消失时,需要重新启动该业务进程。本发明实施例中提供了一种重新启动业务进程的实现方式,具体为:根据配置信息中的业务进程的启动路径、业务进程的启动方式拼接启动命令;之后业务进程可以调用fork函数创建一个新子进程;关闭子进程中除了0、1、2之外的其余文件句柄;调用excel,到指定启动路径下载业务进程,拉起该业务进程,并将拉起的业务进程的标识记录到前一次业务进程记录数组中相应业务进程对应的标识的位置。When it is determined that the business process disappears, the business process needs to be restarted. The embodiment of the present invention provides a kind of implementation mode of restarting the business process, specifically: according to the start-up path of the business process in the configuration information, the start-up mode of the business process splicing start command; After that, the business process can call the fork function to create a new Child process; close the other file handles in the child process except 0, 1, and 2; call excel, download the business process to the specified startup path, pull up the business process, and record the identity of the pulled up business process to the previous time The position of the identifier corresponding to the corresponding business process in the business process record array.

本发明实施例中,所述主机上还部署有命令行客户端程序,所述命令行客户端程序用于输入操作指令;所述守护代理从所述配置中心获取所述配置信息之后,还包括:所述守护代理接收所述命令行客户端程序发送的操作指令;所述守护代理根据所述操作指令查询或者修改所述配置信息。In the embodiment of the present invention, a command-line client program is also deployed on the host, and the command-line client program is used to input operation instructions; after the daemon agent obtains the configuration information from the configuration center, it also includes : The guardian agent receives the operation instruction sent by the command line client program; the guardian agent queries or modifies the configuration information according to the operation instruction.

通过本发明实施例中命令行客户端程序,一方面可以实现通过命令行客户端程序提供对业务进程操作指令的支持,另一方面有助于降低对业务进程高危命令的告警。Through the command line client program in the embodiment of the present invention, on the one hand, the command line client program can provide support for business process operation instructions, and on the other hand, it can help reduce alarms for high-risk business process commands.

可选地,命令行客户端程序主要采用命令行界面(Command-Line Interface,简称CLI)的方式,以方便运维人员命令行操作。在命令行客户端程序中可输入的操作指令如表2所示。Optionally, the command-line client program mainly adopts a command-line interface (Command-Line Interface, CLI for short), so as to facilitate operation and maintenance personnel to perform command-line operations. The operation instructions that can be input in the command line client program are shown in Table 2.

表2客户端程序可输入的操作指令Table 2 The operating instructions that can be input by the client program

通过在命令行客户端输入的操作命令,实现了从不同粒度对业务进程组的管理,进而降低了开发运维人员变更配置文件的复杂度,提高了系统稳定性。Through the operation commands entered on the command line client, the management of business process groups at different granularities is realized, thereby reducing the complexity of changing configuration files for development and maintenance personnel, and improving system stability.

从上述内容可以看出:本发明实施例中,守护代理可根据配置信息中的指示信息确定出多个业务进程对应的多组业务进程组,根据业务进程组的对应的守护信息来确定是否开启对所述业务进程组的守护;通过本发明实施例,实现了对业务进程的有效划分,进而可以从不同的粒度对业务进程进行管理,提高了业务进程管理的灵活性。It can be seen from the above that in the embodiment of the present invention, the guardian agent can determine multiple service process groups corresponding to multiple service processes according to the indication information in the configuration information, and determine whether to enable Guarding of the business process group; through the embodiment of the present invention, the effective division of the business process is realized, and the business process can be managed from different granularities, which improves the flexibility of business process management.

进一步,配置信息是在配置中心集中进行配置的,不需要在每个主机上对业务进程进行配置,如此,可以在配置中心集中管理配置信息,进而提高了运维人员的工作效率。Furthermore, the configuration information is centrally configured in the configuration center, and there is no need to configure the business process on each host. In this way, the configuration information can be managed centrally in the configuration center, thereby improving the work efficiency of the operation and maintenance personnel.

基于相同的技术构思,本发明实施例还提供一种业务进程管理系统中守护代理,可执行上述方法实施例。图5为本发明实施例提供了一种业务进程管理系统中守护代理的结构示意图,如图5所示,该守护代理500包括获取501和处理模块502。其中:Based on the same technical concept, the embodiment of the present invention also provides a guard agent in the business process management system, which can execute the above method embodiment. FIG. 5 is a schematic structural diagram of a guard agent in a business process management system provided by an embodiment of the present invention. As shown in FIG. 5 , the guard agent 500 includes an acquisition 501 and a processing module 502 . in:

获取单元,用于从所述配置中心获取所述配置信息;其中,所述配置信息包括用于指示所述多个业务进程中每个业务进程所属的业务进程组的指示信息,以及所述多个业务进程对应的多组业务进程组中每组业务进程组对应的守护信息;处理单元,用于根据所述指示信息确定所述多个业务进程对应的多组业务进程组;所述多组业务进程组中每组业务进程组包括所述多个业务进程中的至少一个业务进程;根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护。An obtaining unit, configured to obtain the configuration information from the configuration center; wherein, the configuration information includes indication information for indicating the business process group to which each of the multiple business processes belongs, and the multiple Guardian information corresponding to each set of business process groups in multiple sets of business process groups corresponding to a business process; a processing unit configured to determine multiple sets of business process groups corresponding to the multiple business processes according to the indication information; the multiple sets of service process groups Each business process group in the business process group includes at least one business process in the plurality of business processes; according to the guard information corresponding to the business process group, determine whether to enable the guard of the business process group.

可选地,所述处理单元,还用于:针对所述每组业务进程组包括一个业务进程,执行:当确定开启对所述业务进程的守护时,确定所述业务进程在当前进程记录数组中对应的标识是否为初始值;所述当前进程记录数组用于标识对应的业务进程的当前运行状态;若确定所述业务进程在所述当前进记录数组中对应的标识为初始值时,则重新启动所述业务进程。Optionally, the processing unit is further configured to: for each set of business process groups includes a business process, perform: when determining to enable the guard of the business process, determine that the business process records the array in the current process Whether the corresponding identifier in the array is an initial value; the current process record array is used to identify the current running state of the corresponding business process; if it is determined that the corresponding identifier of the business process in the current progress record array is an initial value, then Restart the business process.

可选地,所述主机上还部署有命令行客户端程序,所述命令行客户端程序用于输入操作指令;所述获取单元,还用于:接收所述命令行客户端程序发送的操作指令;所述处理单元,还用于:根据所述操作指令查询或修改所述守护信息。Optionally, a command-line client program is also deployed on the host, and the command-line client program is used to input operation instructions; the acquisition unit is also used to: receive the operation sent by the command-line client program Instruction; the processing unit is further configured to: query or modify the guardian information according to the operation instruction.

可选地,所述处理单元,用于:根据所述多组所述业务进程组中每组业务进程组对应的守护信息,确定所述业务进程组的业务进程组开关数组;对所述业务进程组开关数组中的开关值为开的业务进程组开启守护。Optionally, the processing unit is configured to: determine the business process group switch array of the business process group according to the guardian information corresponding to each of the multiple business process groups; The switch value in the process group switch array is on, and the business process group starts the daemon.

可选地,所述处理单元,还用于:根据所述配置信息初始化进程记录数组;根据所述多个业务进程中每个业务进程对应的守护信息获取所述业务进程的标识;根据前一次进程记录数组中所述业务进程对应的标识的位置,确定出获取到的所述业务进程在初始化进程记录数组中的目标位置;将获取到的所述业务进程对应的标识记录在所述目标位置,确定出当前进程记录数组。Optionally, the processing unit is further configured to: initialize a process record array according to the configuration information; obtain the identifier of the business process according to the guardian information corresponding to each of the multiple business processes; The position of the identifier corresponding to the business process in the process record array determines the acquired target position of the business process in the initialization process record array; records the acquired identifier corresponding to the business process in the target position , determine the current process record array.

从上述内容可以看出:本发明实施例中,守护代理可根据配置信息中的指示信息确定出多个业务进程对应的多组业务进程组,根据业务进程组的对应的守护信息来确定是否开启对所述业务进程组的守护;通过本发明实施例,实现了对业务进程的有效划分,进而可以从不同的粒度对业务进程进行管理,提高了业务进程管理的灵活性。It can be seen from the above that in the embodiment of the present invention, the guardian agent can determine multiple service process groups corresponding to multiple service processes according to the indication information in the configuration information, and determine whether to enable Guarding of the business process group; through the embodiment of the present invention, the effective division of the business process is realized, and the business process can be managed from different granularities, which improves the flexibility of business process management.

进一步,配置信息是在配置中心集中进行配置的,不需要在每个主机上对业务进程进行配置,如此,可以在配置中心集中管理配置信息,进而提高了运维人员的工作效率。Furthermore, the configuration information is centrally configured in the configuration center, and there is no need to configure the business process on each host. In this way, the configuration information can be managed centrally in the configuration center, thereby improving the work efficiency of the operation and maintenance personnel.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现、当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述指令可以存储在计算机存储介质中,或者从一个计算机存储介质向另一个计算机存储介质传输,例如,所述指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带、磁光盘(MO)等)、光介质(例如,CD、DVD、BD、HVD等)、或者半导体介质(例如ROM、EPROM、EEPROM、非易失性存储器(NAND FLASH)、固态硬盘(Solid State Disk,SSD))等。本领域内的技术人员应明白,本申请实施例可提供为方法、系统、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。In the above-mentioned embodiments, all or part may be implemented by software, hardware, firmware or any combination thereof, and when implemented by using a software program, all or part may be implemented in the form of a computer program product. The computer program product includes one or more instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The instructions may be stored in or transmitted from one computer storage medium to another, e.g., from a website, computer, server, or data center via a wired (e.g., coaxial cable, Optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website site, computer, server or data center. The computer storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available media may be magnetic media, (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), optical media (e.g., CD, DVD, BD, HVD, etc.), or semiconductor media (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state disk (Solid State Disk, SSD)), etc. Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the embodiment of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。这些指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by instructions. These instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine such that execution of the instructions by the processor of the computer or other programmable data processing device produces a Means for specifying functions in one or more steps of a flowchart and/or one or more blocks of a block diagram. These instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means implementing A function specified in a process flow or processes and/or a block or blocks in a block diagram.

这些指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。The instructions may also be loaded into a computer or other programmable data processing device such that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide Steps for realizing the functions specified in the flow chart or flow charts and/or block diagram block or blocks.

显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Apparently, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. In this way, if the modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and equivalent technologies, the present application also intends to include these modifications and variations.

Claims (12)

1.一种业务进程管理方法,其特征在于,所述方法适用于包括配置中心和至少一个主机构成的系统;所述主机上部署有守护代理和多个业务进程;所述配置中心用于配置所述多个业务进程对应的配置信息;1. A business process management method, characterized in that, the method is applicable to a system comprising a configuration center and at least one host; a guard agent and a plurality of business processes are deployed on the host; the configuration center is used to configure Configuration information corresponding to the plurality of business processes; 所述守护代理从所述配置中心获取所述配置信息;其中,所述配置信息包括用于指示所述多个业务进程中每个业务进程所属的业务进程组的指示信息,以及所述多个业务进程对应的多组业务进程组中每组业务进程组对应的守护信息;The guardian agent obtains the configuration information from the configuration center; wherein, the configuration information includes indication information for indicating the business process group to which each business process in the multiple business processes belongs, and the multiple Guardian information corresponding to each set of business process groups in multiple sets of business process groups corresponding to the business process; 所述守护代理根据所述指示信息确定所述多个业务进程对应的多组业务进程组;所述多组业务进程组中每组业务进程组包括所述多个业务进程中的至少一个业务进程;The guardian agent determines multiple service process groups corresponding to the multiple service processes according to the indication information; each service process group in the multiple service process groups includes at least one service process in the multiple service processes ; 所述守护代理根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护。The guard agent determines whether to enable guarding of the service process group according to the guard information corresponding to the service process group. 2.如权利要求1所述的方法,其特征在于,所述守护代理根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护之后,还包括:2. The method according to claim 1, wherein after the guardian agent determines whether to enable the guard of the business process group according to the guard information corresponding to the business process group, it further includes: 针对所述每组业务进程组包括一个业务进程,执行:For each set of business process groups including a business process, execute: 当所述守护代理确定开启对所述业务进程的守护时,确定所述业务进程在当前进程记录数组中对应的标识是否为初始值;所述当前进程记录数组用于标识对应的业务进程的当前运行状态;When the guardian agent determines to enable the guarding of the business process, determine whether the corresponding identifier of the business process in the current process record array is an initial value; the current process record array is used to identify the current process of the corresponding business process Operating status; 若所述守护代理确定所述业务进程在所述当前进记录数组中对应的标识为初始值时,则重新启动所述业务进程。If the guardian agent determines that the identifier corresponding to the current progress record array of the service process is an initial value, restart the service process. 3.如权利要求1所述的方法,其特征在于,所述主机上还部署有命令行客户端程序,所述命令行客户端程序用于输入操作指令;3. The method according to claim 1, wherein a command line client program is also deployed on the host, and the command line client program is used to input operation instructions; 所述守护代理从所述配置中心获取所述配置信息之后,还包括:After the guardian agent obtains the configuration information from the configuration center, it also includes: 所述守护代理接收所述命令行客户端程序发送的操作指令;The guardian agent receives the operation instruction sent by the command line client program; 所述守护代理根据所述操作指令查询或修改所述守护信息。The guard agent queries or modifies the guard information according to the operation instruction. 4.如权利要求1所述的方法,其特征在于,所述守护代理根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护,包括:4. The method according to claim 1, wherein the guardian agent determines whether to enable the guardianship of the business process group according to the guardian information corresponding to the business process group, comprising: 所述守护代理根据所述多组所述业务进程组中每组业务进程组对应的守护信息,确定所述业务进程组的业务进程组开关数组;The guardian agent determines the business process group switch array of the business process group according to the guardian information corresponding to each of the multiple business process groups; 所述守护代理对所述业务进程组开关数组中的开关值为开的业务进程组开启守护。The guarding agent starts guarding for the business process group whose switch value is ON in the switch array of the business process group. 5.如权利要求2所述的方法,其特征在于,所述当所述守护代理确定开启对所述业务进程的守护时,确定所述业务进程在当前进程记录数组中对应的标识是否为初始值之前,还包括:5. The method according to claim 2, wherein when the guardian agent determines to enable the guarding of the business process, it is determined whether the corresponding identifier of the business process in the current process record array is an initial Before the value, also include: 所述守护代理根据所述配置信息初始化进程记录数组;The guardian agent initializes a process record array according to the configuration information; 所述守护代理根据所述多个业务进程中每个业务进程对应的守护信息获取所述业务进程的标识;The guard agent obtains the identifier of the business process according to the guard information corresponding to each business process in the plurality of business processes; 所述守护代理根据前一次进程记录数组中所述业务进程对应的标识的位置,确定出获取到的所述业务进程在初始化进程记录数组中的目标位置;The guardian agent determines the acquired target position of the business process in the initialization process record array according to the position of the identifier corresponding to the business process in the previous process record array; 所述守护代理将获取到的所述业务进程对应的标识记录在所述目标位置,确定出当前进程记录数组。The guardian agent records the acquired identifier corresponding to the business process in the target location, and determines a current process record array. 6.一种业务进程管理系统,其特征在于,所述系统包括配置中心和至少一个主机;所述主机上部署有守护代理和多个业务进程;所述配置中心用于配置所述多个业务进程对应的配置信息;其中,所述主机上部署的守护代理包括:6. A business process management system, characterized in that the system includes a configuration center and at least one host; a guard agent and a plurality of business processes are deployed on the host; the configuration center is used to configure the plurality of business processes Configuration information corresponding to the process; wherein, the guard agent deployed on the host includes: 获取单元,用于从所述配置中心获取所述配置信息;其中,所述配置信息包括用于指示所述多个业务进程中每个业务进程所属的业务进程组的指示信息,以及所述多个业务进程对应的多组业务进程组中每组业务进程组对应的守护信息;An obtaining unit, configured to obtain the configuration information from the configuration center; wherein, the configuration information includes indication information for indicating the business process group to which each of the multiple business processes belongs, and the multiple Guardian information corresponding to each set of business process groups in multiple sets of business process groups corresponding to a business process; 处理单元,用于根据所述指示信息确定所述多个业务进程对应的多组业务进程组;所述多组业务进程组中每组业务进程组包括所述多个业务进程中的至少一个业务进程;根据所述业务进程组对应的守护信息,确定是否开启对所述业务进程组的守护。A processing unit, configured to determine multiple sets of business process groups corresponding to the multiple business processes according to the indication information; each set of business process groups in the multiple sets of business process groups includes at least one business process in the multiple business processes process; according to the guard information corresponding to the business process group, determine whether to enable the guard for the business process group. 7.如权利要求6所述的系统,其特征在于,所述处理单元,还用于:7. The system according to claim 6, wherein the processing unit is further configured to: 针对所述每组业务进程组包括一个业务进程,执行:For each set of business process groups including a business process, execute: 当确定开启对所述业务进程的守护时,确定所述业务进程在当前进程记录数组中对应的标识是否为初始值;所述当前进程记录数组用于标识对应的业务进程的当前运行状态;若确定所述业务进程在所述当前进记录数组中对应的标识为初始值时,则重新启动所述业务进程。When determining to open the guard of the business process, determine whether the corresponding identifier of the business process in the current process record array is an initial value; the current process record array is used to identify the current running state of the corresponding business process; if When it is determined that the corresponding identifier in the current progress record array of the business process is an initial value, restart the business process. 8.如权利要求6所述的方法,其特征在于,所述主机上还部署有命令行客户端程序,所述命令行客户端程序用于输入操作指令;8. The method according to claim 6, wherein a command line client program is also deployed on the host, and the command line client program is used to input operation instructions; 所述获取单元,还用于:The acquisition unit is also used for: 接收所述命令行客户端程序发送的操作指令;receiving an operation instruction sent by the command line client program; 所述处理单元,还用于:The processing unit is also used for: 根据所述操作指令查询或修改所述守护信息。Query or modify the guardian information according to the operation instruction. 9.如权利要求6所述的系统,其特征在于,所述处理单元,用于:9. The system according to claim 6, wherein the processing unit is configured to: 根据所述多组所述业务进程组中每组业务进程组对应的守护信息,确定所述业务进程组的业务进程组开关数组;对所述业务进程组开关数组中的开关值为开的业务进程组开启守护。Determine the business process group switch array of the business process group according to the guardian information corresponding to each business process group in the plurality of business process groups; The process group is daemonized. 10.如权利要求7所述的系统,其特征在于,所述处理单元,还用于:10. The system according to claim 7, wherein the processing unit is further configured to: 根据所述配置信息初始化进程记录数组;根据所述多个业务进程中每个业务进程对应的守护信息获取所述业务进程的标识;根据前一次进程记录数组中所述业务进程对应的标识的位置,确定出获取到的所述业务进程在初始化进程记录数组中的目标位置;将获取到的所述业务进程对应的标识记录在所述目标位置,确定出当前进程记录数组。Initialize the process record array according to the configuration information; obtain the identification of the business process according to the guardian information corresponding to each business process in the plurality of business processes; record the position of the identification corresponding to the business process in the previous process record array. , determining the acquired target position of the business process in the initialization process record array; recording the acquired identifier corresponding to the business process in the target position, and determining the current process record array. 11.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使所述计算机执行权利要求1至5任一权利要求所述的方法。11. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make the computer execute any one of claims 1 to 5. the method described. 12.一种计算机设备,其特征在于,包括:12. A computer device, characterized in that it comprises: 存储器,用于存储程序指令;memory for storing program instructions; 处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行如权利要求1至5任一权利要求所述的方法。The processor is configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 5 according to the obtained program.
CN201810226939.8A 2018-03-14 2018-03-14 Business process management method and system Active CN108563515B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810226939.8A CN108563515B (en) 2018-03-14 2018-03-14 Business process management method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810226939.8A CN108563515B (en) 2018-03-14 2018-03-14 Business process management method and system

Publications (2)

Publication Number Publication Date
CN108563515A true CN108563515A (en) 2018-09-21
CN108563515B CN108563515B (en) 2021-08-27

Family

ID=63532112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810226939.8A Active CN108563515B (en) 2018-03-14 2018-03-14 Business process management method and system

Country Status (1)

Country Link
CN (1) CN108563515B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385296A (en) * 2020-03-04 2020-07-07 深信服科技股份有限公司 Business process restarting method, device, storage medium and system
CN112346906A (en) * 2019-08-08 2021-02-09 丰鸟航空科技有限公司 Unmanned aerial vehicle daemon processing method, device, equipment and storage medium
CN112463828A (en) * 2020-11-02 2021-03-09 马上消费金融股份有限公司 Data processing method, device, equipment, system and readable storage medium
CN113076131A (en) * 2021-04-07 2021-07-06 山东爱拓软件开发有限公司 Embedded software system construction method and system based on multi-process architecture idea

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1750566A (en) * 2004-09-16 2006-03-22 中兴通讯股份有限公司 Monitoring method for double machine application system based on surrogate process
US7954062B2 (en) * 2005-01-03 2011-05-31 International Business Machines Corporation Application status board mitigation system and method
CN102104628A (en) * 2010-12-29 2011-06-22 北京新媒传信科技有限公司 Server cluster system and management method thereof
CN103138985A (en) * 2011-12-01 2013-06-05 中国移动通信集团浙江有限公司 Method and system of process of service host computer of supporting network
CN103283209A (en) * 2011-04-18 2013-09-04 北京新媒传信科技有限公司 Application service platform system and implementation method thereof
US20140280398A1 (en) * 2013-03-15 2014-09-18 Miosoft Corporation Distributed database management
US9063783B2 (en) * 2008-11-24 2015-06-23 Red Hat, Inc. Coordinating parallel execution of processes using agents
CN104750544A (en) * 2013-12-30 2015-07-01 中国银联股份有限公司 Process management system and process management method applied in distributed system
US20160132318A1 (en) * 2014-11-07 2016-05-12 Oracle International Corporation Notifications framework for distributed software upgrades
CN105610648A (en) * 2016-01-11 2016-05-25 飞天诚信科技股份有限公司 Operation and maintenance monitoring data collection method and server
CN106325975A (en) * 2016-09-09 2017-01-11 浪潮软件股份有限公司 Method for automatically deploying and managing big data clusters by using Docker container
CN106776212A (en) * 2016-12-09 2017-05-31 中电科华云信息技术有限公司 The supervisory systems and method of container clustered deploy(ment) multi-process application

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1750566A (en) * 2004-09-16 2006-03-22 中兴通讯股份有限公司 Monitoring method for double machine application system based on surrogate process
US7954062B2 (en) * 2005-01-03 2011-05-31 International Business Machines Corporation Application status board mitigation system and method
US9063783B2 (en) * 2008-11-24 2015-06-23 Red Hat, Inc. Coordinating parallel execution of processes using agents
CN102104628A (en) * 2010-12-29 2011-06-22 北京新媒传信科技有限公司 Server cluster system and management method thereof
CN103283209A (en) * 2011-04-18 2013-09-04 北京新媒传信科技有限公司 Application service platform system and implementation method thereof
CN103138985A (en) * 2011-12-01 2013-06-05 中国移动通信集团浙江有限公司 Method and system of process of service host computer of supporting network
US20140280398A1 (en) * 2013-03-15 2014-09-18 Miosoft Corporation Distributed database management
CN104750544A (en) * 2013-12-30 2015-07-01 中国银联股份有限公司 Process management system and process management method applied in distributed system
US20160132318A1 (en) * 2014-11-07 2016-05-12 Oracle International Corporation Notifications framework for distributed software upgrades
CN105610648A (en) * 2016-01-11 2016-05-25 飞天诚信科技股份有限公司 Operation and maintenance monitoring data collection method and server
CN106325975A (en) * 2016-09-09 2017-01-11 浪潮软件股份有限公司 Method for automatically deploying and managing big data clusters by using Docker container
CN106776212A (en) * 2016-12-09 2017-05-31 中电科华云信息技术有限公司 The supervisory systems and method of container clustered deploy(ment) multi-process application

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346906A (en) * 2019-08-08 2021-02-09 丰鸟航空科技有限公司 Unmanned aerial vehicle daemon processing method, device, equipment and storage medium
CN111385296A (en) * 2020-03-04 2020-07-07 深信服科技股份有限公司 Business process restarting method, device, storage medium and system
CN111385296B (en) * 2020-03-04 2022-06-21 深信服科技股份有限公司 Business process restarting method, device, storage medium and system
CN112463828A (en) * 2020-11-02 2021-03-09 马上消费金融股份有限公司 Data processing method, device, equipment, system and readable storage medium
CN113076131A (en) * 2021-04-07 2021-07-06 山东爱拓软件开发有限公司 Embedded software system construction method and system based on multi-process architecture idea

Also Published As

Publication number Publication date
CN108563515B (en) 2021-08-27

Similar Documents

Publication Publication Date Title
US10949245B2 (en) Maintaining high availability during network partitions for virtual machines stored on distributed object-based storage
US11307890B2 (en) Methods and apparatus to manage virtual machines
JP6461167B2 (en) System and method for supporting multi-tenancy in an application server, cloud or other environment
US10778539B1 (en) Resolving configuration drift for computing resource stacks
KR102047216B1 (en) Replaying jobs at a secondary location of a service
CN108563515A (en) A kind of business process management method and system
US9495259B2 (en) Orchestrating high availability failover for virtual machines stored on distributed object-based storage
JP2003099410A (en) Method and system for managing multiple devices
US9367414B2 (en) Persisting high availability protection state for virtual machines stored on distributed object-based storage
WO2018233630A1 (en) Fault discovery
WO2011083673A1 (en) Configuration information management system, configuration information management method, and configuration information management-use program
US11424984B2 (en) Autodiscovery with dynamic configuration launching
JP6994477B2 (en) Automated problem detection and resolution framework for enterprise resource planning
WO2020015116A1 (en) Database monitoring method and terminal device
US20140297834A1 (en) Management of a plurality of system control networks
US20170286097A1 (en) Method to prevent operating system digital product key activation failures
US11799743B2 (en) Node addition in cloud networks
US10348555B2 (en) Version tracking and recording of configuration data within a distributed system
US10922305B2 (en) Maintaining storage profile consistency in a cluster having local and shared storage
US11327824B2 (en) Using a web server to obtain service data for a failed software application
US10897413B1 (en) Determining operational status of internet of things devices
US12050609B1 (en) Discretization of continuous stream of data items using data dividers
US12047442B1 (en) Configuring a replacement node using a configuration backup of a failed node being replaced
US20250244995A1 (en) Systems and methods for upgrading unconfigured nodes, including examples of health monitoring and parallel upgrades
US20250165353A1 (en) Relational software-as-a-service data protection

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