A method, device, equipment and medium for running a job of a distributed application program

By building the interface between program jobs and resource managers and configuring resource scheduling logic, the efficiency of distributed applications in resource allocation is solved, and more efficient program job operation is achieved.

CN114564255BActive Publication Date: 2025-03-14宋二飞
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210052251.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-18
Publication Date
2025-03-14
Estimated Expiration
2042-01-18

AI Technical Summary

Technical Problem

When distributed applications allocate operation resources for program jobs through resource managers, they need to access the platform in advance, resulting in a lot of time consumption and affecting the operation efficiency of the job.

Method used

By building a job calling interface between program jobs in distributed applications and preset resource managers, configuring resource scheduling logic, using resource scheduling components to request scheduling resources, and running program jobs through task run components, monitoring the job ending in real time and obtaining results.

Benefits of technology

It simplifies the operation complexity of program jobs in distributed applications, reduces the attention of resource managers and applications, and improves the operation efficiency of program jobs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114564255B_ABST
    Figure CN114564255B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of software development, and discloses a method, device, equipment and medium for running a job of a distributed application program, wherein the method comprises: obtaining a program job in a distributed application program, constructing a job calling interface between the program job and a preset resource manager; configuring a resource scheduling logic of the program job in the preset resource manager according to the job calling interface; using a resource scheduling component in the preset resource manager to request a resource allocation component in the preset resource manager for scheduling resources of the program job according to the resource scheduling logic; using a task running component in the preset resource manager to run the program job according to the scheduling resources, monitoring in real time whether the program job has been completed, and obtaining the running result of the program job when the program job has been completed. The present invention can improve the running efficiency of the job of a distributed application program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software development, and in particular to a method, device, electronic device and computer-readable storage medium for running a distributed application program. Background Art

[0002] Distributed applications refer to applications that are distributed on different computers and work together to complete a task through a network. They are usually in a server / client mode. Through the distributed applications, program jobs of applications on different computers can be processed synchronously, achieving efficient execution of program jobs.

[0003] At present, the job running of distributed applications usually allocates the running resources of program jobs in distributed applications according to the resource manager. However, when allocating the running resources of program jobs through the resource manager, the distributed application needs to be connected to the platform with the resource manager, which will consume a lot of time in the early platform access work, thus affecting the job running efficiency of the distributed application. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a method, device, electronic device and computer-readable storage medium for running a job of a distributed application, which can improve the job running efficiency of the distributed application.

[0005] In a first aspect, the present invention provides a method for running a job of a distributed application, comprising:

[0006] Obtaining a program job in a distributed application program, and constructing a job calling interface between the program job and a preset resource manager;

[0007] According to the job calling interface, configuring the resource scheduling logic of the program job in the preset resource manager;

[0008] According to the resource scheduling logic, using the resource scheduling component in the preset resource manager to request the scheduling resources of the program job from the resource allocation component in the preset resource manager;

[0009] According to the scheduling resources, the program job is run using the task running component in the preset resource manager, and whether the program job is completed is monitored in real time. When the program job is completed, the running result of the program job is obtained.

[0010] In a possible implementation of the first aspect, the step of constructing a job calling interface between the program job and a preset resource manager includes:

[0011] Querying program interface parameters of a distributed application corresponding to the program job;

[0012] According to the program interface parameters, the calling interface of the program job is configured in the preset resource manager to obtain the job calling interface.

[0013] In a possible implementation of the first aspect, configuring the resource scheduling logic of the program job in the preset resource manager according to the job calling interface includes:

[0014] According to the job calling interface, the program job is transmitted to the resource manager, so as to set the resource scheduling node and resource scheduling mode of the program job through the resource manager;

[0015] The resource scheduling logic of the program job is generated according to the resource scheduling node and the resource scheduling mode.

[0016] In a possible implementation manner of the first aspect, the requesting, according to the resource scheduling logic, from a resource allocation component in the preset resource manager for scheduling resources for the program job includes:

[0017] According to the resource scheduling logic, using the global scheduling component in the resource scheduling component to start the program scheduling component of the program job in the resource scheduling component;

[0018] The program job is transmitted to the resource allocation component through the program scheduling component, so that the scheduling resources of the program job are calculated by the resource allocation component.

[0019] In a possible implementation manner of the first aspect, calculating the scheduling resources of the program job by the resource allocation component includes:

[0020] Utilizing the resource monitoring component in the resource allocation component to query the locally available resources of the program job;

[0021] The resource calculation component in the resource allocation component is used to calculate the scheduling resources of the program job according to the locally available resources.

[0022] In a possible implementation of the first aspect, the step of running the program job using a task running component in the preset resource manager according to the scheduled resources includes:

[0023] The to-be-executed tasks in the program job are obtained, and a running thread of the to-be-executed tasks is constructed according to the task running component and the scheduling resource, so as to run the to-be-executed tasks through the running thread.

[0024] In a possible implementation of the first aspect, the real-time monitoring of whether the program operation is completed includes:

[0025] A program monitoring script is constructed in the task running component corresponding to the program job, and the program monitoring script is used to monitor in real time whether the program job has been completed.

[0026] In a second aspect, the present invention provides a distributed application program job running device, the device comprising:

[0027] A calling interface building module is used to obtain a program job in a distributed application program and build a job calling interface between the program job and a preset resource manager;

[0028] A scheduling logic configuration module, configured to configure the resource scheduling logic of the program job in the preset resource manager according to the job calling interface;

[0029] A scheduling resource request module, configured to request the scheduling resources of the program job from the resource allocation component in the preset resource manager using the resource scheduling component in the preset resource manager according to the resource scheduling logic;

[0030] The operation result generation module is used to run the program job according to the scheduled resources using the task running component in the preset resource manager, monitor in real time whether the program job has been completed, and obtain the operation result of the program job when the program job is completed.

[0031] In a third aspect, the present invention provides an electronic device, comprising:

[0032] at least one processor; and a memory communicatively coupled to the at least one processor;

[0033] The memory stores a computer program executable by the at least one processor, so that the at least one processor can execute the job running method of the distributed application as described in any one of the first aspects above.

[0034] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the method for running a job of a distributed application as described in any one of the first aspects above is implemented.

[0035] Compared with the prior art, the technical principle and beneficial effects of this solution are:

[0036] The embodiment of the present invention constructs a job call interface between a program job in a distributed application and a preset resource manager, so that the preset resource manager can focus on processing the program job in the distributed application, reduce the attention of the preset resource manager and the distributed application, thereby simplifying the running complexity of the program job in the distributed application and improving the running efficiency of the program job; secondly, the embodiment of the present invention configures the resource scheduling logic of the program job in the preset resource manager according to the job call interface, so as to use the resource scheduling component in the preset resource manager to request the scheduling resources of the program job from the resource allocation component in the preset resource manager, and determine the resource allocation rules of the program job when it is running, realize the resource scheduling of the program job, and ensure the running premise of the program job; further, the embodiment of the present invention runs the program job according to the scheduling resources using the task running component in the preset resource manager, monitors in real time whether the program job has been completed, and obtains the running result of the program job when the program job is completed, so as to realize the parallel processing of the tasks to be executed in the program job and further improve the running efficiency of the program job. Therefore, the distributed application program job running method, device, electronic device, and storage medium proposed in the embodiments of the present invention can improve the distributed application program job running efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0039] Figure 1 A schematic diagram of a process flow of a method for running a distributed application program provided by an embodiment of the present invention;

[0040] Figure 2 In one embodiment of the present invention Figure 1 A flowchart of one step of a method for running a job of a distributed application is provided;

[0041] Figure 3 In one embodiment of the present invention Figure 1 A flowchart diagram of another step of a method for running a job of a distributed application is provided;

[0042] Figure 4 A schematic diagram of a module of a distributed application program operation running device provided by an embodiment of the present invention;

[0043] Figure 5 A schematic diagram of the internal structure of an electronic device for implementing a method for running a distributed application program provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0045] The embodiment of the present invention provides a method for running a job of a distributed application, and the execution subject of the method for running a job of the distributed application includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present invention. In other words, the method for running a job of the distributed application can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0046] See also Figure 1 FIG. 1 is a flow chart of a method for running a distributed application program according to an embodiment of the present invention. Figure 1 The job running methods for distributed applications described in include:

[0047] S1. Obtain a program job in a distributed application program, and construct a job calling interface between the program job and a preset resource manager.

[0048] In the embodiment of the present invention, the distributed application refers to a client program deployed in a distributed architecture. The distributed architecture is an application and tool of distributed computing technology, which is used to allocate client programs to separate servers for independent computing to achieve high concurrent processing of large amounts of data. The program job refers to an application service that needs to be processed in the distributed application, such as an order service query job, an order service statistics job, and an order service processing job. Further, in the embodiment of the present invention, the preset resource manager includes an Apache Hadoop YARN (YetAnother Resource Negotiator) manager. The YARN is a Hadoop resource manager, which is a general resource management system that can provide unified resource management and scheduling for upper-level applications, and brings great benefits to the cluster in terms of utilization, unified resource management, and data sharing. Therefore, the embodiment of the present invention constructs a job call interface between the program job and the preset resource manager, so that the preset resource manager can focus on the processing of the program job in the distributed application, reduce the attention of the preset resource manager and the distributed application, thereby simplifying the running complexity of the program job in the distributed application and improving the running efficiency of the program job.

[0049] As an embodiment of the present invention, see Figure 2 As shown, the construction of the job calling interface of the program job and the preset resource manager includes:

[0050] S201, querying the program interface parameters of the distributed application corresponding to the program operation;

[0051] S202: According to the program interface parameters, configure the calling interface of the program job in the preset resource manager to obtain the job calling interface.

[0052] Among them, the program interface parameters refer to the interface interaction data of the distributed application when it is called, such as parameters such as IP, domain name and port number, and the calling interface refers to the data interaction channel between the program job and the preset resource manager, such as the Java Runnable interface.

[0053] Furthermore, in an optional embodiment of the present invention, the program interface parameters are obtained by querying a configuration file of a distributed application corresponding to the program job, and the calling interface is obtained by a program compilation language, such as Java language.

[0054] Furthermore, another embodiment of the present invention also includes setting the application state of the job call interface in a preset registration center to ensure that when the application client running the program job crashes, a new application client can normally connect to the preset resource manager, so that the distributed application corresponding to the program job maintains a persistent state. Optionally, the preset registration center is a ZooKeeper center.

[0055] S2. According to the job calling interface, configure the resource scheduling logic of the program job in the preset resource manager.

[0056] The embodiment of the present invention configures the resource scheduling logic of the program job in the preset resource manager according to the job calling interface to determine the resource allocation rules of the program job when it is running, implements the resource scheduling of the program job, and ensures the running premise of the program job.

[0057] As an embodiment of the present invention, configuring the resource scheduling logic of the program job in the preset resource manager according to the job calling interface includes: transmitting the program job to the resource manager according to the job calling interface, so as to set the resource scheduling node and resource scheduling method of the program job through the resource manager, and generating the resource scheduling logic of the program job according to the resource scheduling node and the resource scheduling method.

[0058] The resource scheduling node refers to a scheduling component when the program job performs resource scheduling in the resource manager, and the resource scheduling mode refers to a scheduling mode when the program job performs resource scheduling in the resource manager, such as a first-in-first-out scheduling mode.

[0059] S3. According to the resource scheduling logic, the resource scheduling component in the preset resource manager is used to request the resource allocation component in the preset resource manager for scheduling resources for the program job.

[0060] In an embodiment of the present invention, the resource scheduling component includes a global scheduling component (ResourceManager, RM) and a program scheduling component (ApplicationMaster, AM). The RM refers to the resource manager of the program job cluster in the distributed application, which is responsible for the unified management and scheduling allocation of the entire resources of the cluster. The AM refers to the resource manager of a single program job in the distributed application, which is responsible for the unified management and scheduling allocation of resources of a single program job. The resource allocation component includes a resource monitoring component (Node Manager) and a resource computing component (Container). The resource monitoring component is responsible for monitoring the local available resources, fault reports and jobs on the management node of the preset resource manager. The resource computing component is used to calculate the computing resources of the program job in the preset resource manager. Furthermore, in an embodiment of the present invention, the scheduling resources refer to the system resources required by the program job at runtime, such as CPU, memory, threads, etc.

[0061] As an embodiment of the present invention, see Figure 3 As shown, according to the resource scheduling logic, using the resource scheduling component in the preset resource manager to request the scheduling resources of the program job from the resource allocation component in the preset resource manager includes:

[0062] S301, according to the resource scheduling logic, using the global scheduling component in the resource scheduling component to start the program scheduling component of the program job in the resource scheduling component;

[0063] S302: The program job is transmitted to the resource allocation component through the program scheduling component, so that the scheduling resources of the program job are calculated through the resource allocation component.

[0064] In an optional embodiment, according to the resource scheduling logic, the program scheduling component of the program job in the resource scheduling component is started by using the global scheduling component in the resource scheduling component, including: according to the resource scheduling logic, triggering a resource scheduling event of the program job in the resource scheduling component, and according to the resource scheduling event, starting the program scheduling component of the program job in the resource scheduling component by using the global scheduling component in the resource scheduling component.

[0065] In an optional embodiment, the calculation of the scheduling resources of the program job by the resource allocation component includes: using the resource monitoring component in the resource allocation component to query the local available resources of the program job, and calculating the scheduling resources of the program job based on the local available resources using the resource calculation component in the resource allocation component.

[0066] The locally available resources refer to the system resources that can be allocated locally during the running of the program job.

[0067] Based on the request for scheduling resources, the callable system resources of the program job in the preset resource manager can be determined to ensure the running prerequisites of subsequent program jobs.

[0068] S4. According to the scheduling resources, the task running component in the preset resource manager is used to run the program job, and real-time monitoring is performed to determine whether the program job has been completed. When the program job is completed, the running result of the program job is obtained.

[0069] In an embodiment of the present invention, the task running component includes a main process component (APPMaster), which is used to implement the task running of the program job. Therefore, the embodiment of the present invention runs the program job according to the scheduling resources using the task running component in the preset resource manager to obtain the task running results of each task in the program job.

[0070] As an embodiment of the present invention, the program job is run according to the scheduling resources using the task running component in the preset resource manager, including: obtaining the task to be executed in the program job, and constructing the running thread of the task to be executed according to the task running component and the scheduling resources, so as to run the task to be executed through the running thread.

[0071] Among them, the tasks to be executed refer to the job tasks existing in the program job, and the running threads refer to the program tools that load the tasks to be executed, which are used to realize parallel processing of the tasks to be executed and improve the running efficiency of the tasks to be executed.

[0072] Furthermore, the embodiment of the present invention manages the life cycle of the application corresponding to the program job by monitoring in real time whether the program job has been completed, thereby facilitating the closing or restarting of the application corresponding to the program job.

[0073] As an embodiment of the present invention, the real-time monitoring of whether the program job has been completed includes: constructing a program monitoring script in the task running component corresponding to the program job, and using the program monitoring script to monitor in real time whether the program job has been completed. Optionally, the program monitoring script is compiled using a scripting language, such as JavaScript scripting language.

[0074] Furthermore, in the embodiment of the present invention, when the program job is finished running, the real-time message of the message queue of the distributed application is queried to obtain the running result of the program job. The message queue includes Apache Kafka, which is used to asynchronously collect the real-time logs generated by the program job in the distributed application when it is running. Optionally, the real-time message is queried through a log appender pre-injected into the message queue.

[0075] It can be seen that the embodiment of the present invention, by constructing a job call interface between the program job in the distributed application and the preset resource manager, can enable the preset resource manager to focus on the processing of the program job in the distributed application, reduce the attention of the preset resource manager and the distributed application, thereby simplifying the operation complexity of the program job in the distributed application and improving the operation efficiency of the program job; secondly, the embodiment of the present invention configures the resource scheduling logic of the program job in the preset resource manager according to the job call interface, so as to use the resource scheduling component in the preset resource manager to request the scheduling resources of the program job from the resource allocation component in the preset resource manager, and can determine the resource allocation rules of the program job when it is running, realize the resource scheduling of the program job, and ensure the operation premise of the program job; further, the embodiment of the present invention runs the program job according to the scheduling resources, uses the task running component in the preset resource manager to monitor whether the program job is running in real time, and obtains the running result of the program job when the program job is running, so as to realize the parallel processing of the tasks to be executed in the program job, and further improve the operation efficiency of the program job. Therefore, the job running method of a distributed application proposed in the embodiment of the present invention can improve the job running efficiency of the distributed application.

[0076] like Figure 4 The figure shows a functional module diagram of the job running device of the distributed application program of the present invention.

[0077] The distributed application job running device 400 of the present invention can be installed in an electronic device. According to the functions to be implemented, the distributed application job running device can include a call interface construction module 401, a scheduling logic configuration module 402, a scheduling resource request module 403, and an operation result generation module 404. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0078] In the embodiment of the present invention, the functions of each module / unit are as follows:

[0079] The calling interface building module 401 is used to obtain the program job in the distributed application program and build a job calling interface between the program job and the preset resource manager;

[0080] The scheduling logic configuration module 402 is used to configure the resource scheduling logic of the program job in the preset resource manager according to the job calling interface;

[0081] The scheduling resource request module 403 is used to request the scheduling resources of the program job from the resource allocation component in the preset resource manager using the resource scheduling component in the preset resource manager according to the resource scheduling logic;

[0082] The operation result generating module 404 is used to run the program job according to the scheduled resources using the task running component in the preset resource manager, monitor in real time whether the program job has been completed, and obtain the operation result of the program job when the program job is completed.

[0083] In detail, each module in the distributed application job running device 400 in the embodiment of the present invention is used in the same manner as described above. Figures 1 to 3 The same technical means are used as the job running method of the distributed application described in , and can produce the same technical effects, which will not be repeated here.

[0084] like Figure 5 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a method for running a distributed application program according to the present invention.

[0085] The electronic device may include a processor 50, a memory 51, a communication bus 52, and a communication interface 53, and may also include a computer program stored in the memory 51 and executable on the processor 50, such as a job execution program of a distributed application.

[0086] In some embodiments, the processor 50 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 50 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 51 (for example, a job running program for executing distributed applications, etc.), and calls data stored in the memory 51 to execute various functions of the electronic device and process data.

[0087] The memory 51 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 51 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 51 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 51 may also include both an internal storage unit of the electronic device and an external storage device. The memory 51 may not only be used to store application software and various types of data installed in the electronic device, such as the code of the job running program of a distributed application, but may also be used to temporarily store data that has been output or is to be output.

[0088] The communication bus 52 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 51 and at least one processor 50, etc.

[0089] The communication interface 53 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0090] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0091] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 50 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0092] It should be understood that the embodiment is for illustrative purposes only and the scope of the patent invention is not limited to this structure.

[0093] The distributed application program stored in the memory 51 in the electronic device is a combination of multiple computer programs. When running in the processor 50, the following can be achieved:

[0094] Obtaining a program job in a distributed application program, and constructing a job calling interface between the program job and a preset resource manager;

[0095] According to the job calling interface, configuring the resource scheduling logic of the program job in the preset resource manager;

[0096] According to the resource scheduling logic, using the resource scheduling component in the preset resource manager to request the scheduling resources of the program job from the resource allocation component in the preset resource manager;

[0097] According to the scheduling resources, the program job is run using the task running component in the preset resource manager, and whether the program job is completed is monitored in real time. When the program job is completed, the running result of the program job is obtained.

[0098] Specifically, the specific implementation method of the processor 50 for the above computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0099] Furthermore, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0100] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0101] Obtaining a program job in a distributed application program, and constructing a job calling interface between the program job and a preset resource manager;

[0102] According to the job calling interface, configuring the resource scheduling logic of the program job in the preset resource manager;

[0103] According to the resource scheduling logic, using the resource scheduling component in the preset resource manager to request the scheduling resources of the program job from the resource allocation component in the preset resource manager;

[0104] According to the scheduling resources, the program job is run using the task running component in the preset resource manager, and whether the program job is completed is monitored in real time. When the program job is completed, the running result of the program job is obtained.

[0105] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0106] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0107] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0108] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0109] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0110] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0111] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

Claims

1. A method for running a distributed application program, characterized in that: The method comprises: Obtaining a program job in a distributed application and constructing a job calling interface between the program job and a preset resource manager, the specific process comprising: querying program interface parameters of the distributed application corresponding to the program job; configuring a calling interface of the program job in the preset resource manager according to the program interface parameters to obtain the job calling interface; The calling interface refers to a data interaction channel between the program job and the preset resource manager; the program interface parameters are obtained by querying the configuration file of the distributed application corresponding to the program job; According to the job calling interface, the resource scheduling logic of the program job is configured in the preset resource manager, and the specific process includes: according to the job calling interface, transmitting the program job to the resource manager, so as to set the resource scheduling node and resource scheduling mode of the program job through the resource manager; according to the resource scheduling node and the resource scheduling mode, generating the resource scheduling logic of the program job; According to the resource scheduling logic, the resource scheduling component in the preset resource manager is used to request the scheduling resources of the program job from the resource allocation component in the preset resource manager. The specific process includes: according to the resource scheduling logic, the global scheduling component in the resource scheduling component is used to start the program scheduling component of the program job in the resource scheduling component; the program job is transmitted to the resource allocation component through the program scheduling component, so as to calculate the scheduling resources of the program job through the resource allocation component; The specific process of starting the program scheduling component of the program job in the resource scheduling component includes: triggering a resource scheduling event of the program job in the resource scheduling component according to the resource scheduling logic, and starting the program scheduling component of the program job in the resource scheduling component according to the resource scheduling event by using the global scheduling component in the resource scheduling component; According to the scheduling resources, the program job is run by using the task running component in the preset resource manager, and whether the program job is completed is monitored in real time. When the program job is completed, the running result of the program job is obtained.

2. The method according to claim 1, characterized in that The calculating the scheduling resources of the program job by the resource allocation component includes: Utilizing the resource monitoring component in the resource allocation component to query the locally available resources of the program job; The resource calculation component in the resource allocation component is used to calculate the scheduling resources of the program job according to the locally available resources.

3. The method according to any one of claims 1 to 2, characterized in that The step of running the program job using the task running component in the preset resource manager according to the scheduling resources includes: The to-be-executed tasks in the program job are obtained, and a running thread of the to-be-executed tasks is constructed according to the task running component and the scheduling resource, so as to run the to-be-executed tasks through the running thread.

4. The method according to claim 1, characterized in that The real-time monitoring of whether the program operation is completed includes: A program monitoring script is constructed in the task running component corresponding to the program job, and the program monitoring script is used to monitor in real time whether the program job has been completed.

5. A distributed application program operation running device, characterized in that: The device comprises: The calling interface building module is used to obtain the program job in the distributed application and build the job calling interface between the program job and the preset resource manager. The specific process includes: querying the program interface parameters of the distributed application corresponding to the program job; configuring the calling interface of the program job in the preset resource manager according to the program interface parameters to obtain the job calling interface; The calling interface refers to a data interaction channel between the program job and the preset resource manager; the program interface parameters are obtained by querying the configuration file of the distributed application corresponding to the program job; A scheduling logic configuration module is used to configure the resource scheduling logic of the program job in the preset resource manager according to the job calling interface, and the specific process includes: according to the job calling interface, transmitting the program job to the resource manager to set the resource scheduling node and resource scheduling mode of the program job through the resource manager; generating the resource scheduling logic of the program job according to the resource scheduling node and the resource scheduling mode; The scheduling resource request module is used to request the scheduling resources of the program job from the resource allocation component in the preset resource manager using the resource scheduling component in the preset resource manager according to the resource scheduling logic, and the specific process includes: according to the resource scheduling logic, using the global scheduling component in the resource scheduling component to start the program scheduling component of the program job in the resource scheduling component; transmitting the program job to the resource allocation component through the program scheduling component, so as to calculate the scheduling resources of the program job through the resource allocation component; The specific process of starting the program scheduling component of the program job in the resource scheduling component includes: triggering a resource scheduling event of the program job in the resource scheduling component according to the resource scheduling logic, and starting the program scheduling component of the program job in the resource scheduling component according to the resource scheduling event by using the global scheduling component in the resource scheduling component; The operation result generation module is used to run the program job according to the scheduled resources using the task running component in the preset resource manager, monitor in real time whether the program job has been completed, and obtain the operation result of the program job when the program job is completed.

6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the job running method of the distributed application as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for running a job of a distributed application program as claimed in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Task processing method and device

    CN113312165A