CN115878290A - Job processing method and device, electronic equipment and computer readable medium - Google Patents

Job processing method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN115878290A
CN115878290A CN202211600859.7A CN202211600859A CN115878290A CN 115878290 A CN115878290 A CN 115878290A CN 202211600859 A CN202211600859 A CN 202211600859A CN 115878290 A CN115878290 A CN 115878290A
Authority
CN
China
Prior art keywords
job
identification
blocking
executing
strategy
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.)
Pending
Application number
CN202211600859.7A
Other languages
Chinese (zh)
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 Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech 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 Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202211600859.7A priority Critical patent/CN115878290A/en
Publication of CN115878290A publication Critical patent/CN115878290A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a job processing method, a job processing device, electronic equipment and a computer readable medium, which relate to the technical field of big data analysis and mining, and one specific implementation mode comprises the steps of responding to a job processing request, obtaining a corresponding job identifier, and further determining a corresponding job execution thread based on the job identifier; responding to the fact that the operation execution thread is not empty, and obtaining a blocking strategy corresponding to the operation identification; and executing the job corresponding to the job identifier based on the blocking strategy, and sending the job completion notification information to the preset callback interface in response to receiving the job completion notification information. The problem of blocking when the operation is executed in busy waiting is solved, the operation callback is packaged, and the real-time monitoring of the operation is guaranteed.

Description

Job processing method and device, electronic equipment and computer readable medium
Technical Field
The present application relates to the field of big data analysis and mining technologies, and in particular, to a job processing method and apparatus, an electronic device, and a computer-readable medium.
Background
At present, with the advance of computer technology, the better people execute job scheduling by various original application programs have certain fatigue, a large number of timing jobs exist in work, and the job execution efficiency is influenced when the timing jobs are busy.
Disclosure of Invention
In view of the above, embodiments of the present application provide a job processing method and apparatus, an electronic device, and a computer readable medium, which can solve the problem that when a timed job enters busy waiting, the job execution efficiency is affected.
To achieve the above object, according to an aspect of an embodiment of the present application, there is provided a job processing method including:
responding to the job processing request, acquiring a corresponding job identifier, and further determining a corresponding job execution thread based on the job identifier;
responding to the fact that the operation execution thread is not empty, and obtaining a blocking strategy corresponding to the operation identification;
and executing the job corresponding to the job identifier based on the blocking strategy, and sending the job completion notification information to the preset callback interface in response to receiving the job completion notification information.
Optionally, after determining the corresponding job execution thread based on the job identification, the method further comprises:
and in response to the fact that the job execution thread is empty and the job corresponding to the job identification is not executed by the job execution thread within the preset time, executing a job destroying program to end the current life cycle of the job corresponding to the job identification.
Optionally, after ending the current life cycle of the job corresponding to the job identification, the method further comprises:
and executing the job waiting program, and responding to the detection of the new job processing request, and executing initialization on the job corresponding to the new job processing request.
Optionally, after acquiring the corresponding job identifier, the method further includes:
and responding to the job processing type corresponding to the job identification as the job addition, and calling the rich text editor to execute the addition of the corresponding job according to the job identification.
Optionally, executing the job corresponding to the job identification based on the blocking policy includes:
and in response to the fact that the blocking strategy corresponds to the discarding subsequent scheduling strategy, performing discarding processing on the job corresponding to the job identification and marking as failure.
Optionally, executing the job corresponding to the job identification based on the blocking policy includes:
and in response to the blocking strategy corresponding to the single machine serial strategy, adding the job corresponding to the job identification into a first-in first-out queue to wait for execution in a serial mode.
Optionally, executing the job corresponding to the job identification based on the blocking policy includes:
and in response to the fact that the blocking strategy corresponds to the pre-coverage scheduling strategy, terminating the currently running job and emptying the job queue, and further executing the job corresponding to the job identifier.
In addition, the present application also provides a job processing apparatus including:
a first obtaining unit configured to obtain a corresponding job identification in response to the job processing request, and further determine a corresponding job execution thread based on the job identification;
a second obtaining unit, configured to obtain a blocking policy corresponding to the job identifier in response to the job execution thread being non-empty;
and the job execution unit is configured to execute the job corresponding to the job identification based on the blocking strategy, and in response to receiving the job completion notification information, send the job completion notification information to the preset callback interface.
Optionally, the first obtaining unit is further configured to:
and in response to the fact that the job execution thread is empty and the job corresponding to the job identification is not executed by the job execution thread within the preset time, executing a job destroying program to end the current life cycle of the job corresponding to the job identification.
Optionally, the first obtaining unit is further configured to:
and executing the job waiting program, and responding to the detection of the new job processing request, and executing initialization on the job corresponding to the new job processing request.
Optionally, the first obtaining unit is further configured to:
and responding to the job processing type corresponding to the job identification as the job addition, and calling the rich text editor to execute the addition of the corresponding job according to the job identification.
Optionally, the job execution unit is further configured to:
and in response to the blocking strategy corresponding to the discarding subsequent scheduling strategy, performing discarding processing on the job corresponding to the job identification and marking as failure.
Optionally, the job execution unit is further configured to:
and in response to the blocking strategy corresponding to the single machine serial strategy, adding the job corresponding to the job identification into a first-in first-out queue to wait for execution in a serial mode.
Optionally, the job execution unit is further configured to:
and in response to the fact that the blocking strategy corresponds to the pre-coverage scheduling strategy, terminating the currently running job and emptying the job queue, and further executing the job corresponding to the job identifier.
In addition, the present application also provides a job processing electronic device including: one or more processors; a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement a job processing method as described above.
In addition, the present application also provides a computer readable medium, on which a computer program is stored, which when executed by a processor implements the job processing method as described above.
To achieve the above object, according to still another aspect of embodiments of the present application, there is provided a computer program product.
A computer program product according to an embodiment of the present application includes a computer program, and when the computer program is executed by a processor, the computer program implements a job processing method according to an embodiment of the present application.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of responding to a job processing request, obtaining a corresponding job identifier, and determining a corresponding job execution thread based on the job identifier; responding to the fact that the operation execution thread is not empty, and obtaining a blocking strategy corresponding to the operation identification; and executing the job corresponding to the job identifier based on the blocking strategy, and sending the job completion notification information to a preset callback interface in response to receiving the job completion notification information. The problem of blocking when the operation is executed in busy waiting is solved, the operation callback is packaged, and the real-time monitoring of the operation is guaranteed.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a further understanding of the application and are not to be construed as limiting the application. Wherein:
FIG. 1 is a schematic diagram of a main flow of a job processing method according to one embodiment of the present application;
FIG. 2 is a schematic illustration of a main flow of a job processing method according to one embodiment of the present application;
FIG. 3 is a schematic flow chart diagram illustrating a method for job processing according to one embodiment of the present application;
FIG. 4 is a schematic flow chart diagram illustrating a method for job processing according to one embodiment of the present application;
fig. 5 is a schematic diagram of main units of a job processing apparatus according to an embodiment of the present application;
FIG. 6 is an exemplary system architecture diagram to which embodiments of the present application may be applied;
fig. 7 is a schematic structural diagram of a computer system suitable for implementing the terminal device or the server according to the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application to assist in understanding, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness. It should be noted that, in the technical solution of the present application, the aspects of collecting, analyzing, using, transmitting, storing, etc. of the related user personal information all conform to the regulations of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside the aspects of legal use, etc., and are under the supervision and management of the supervision department. Necessary measures should be taken for the personal information of the user to prevent illegal access to such personal information data, ensure that personnel who have access to the personal information data comply with the regulations of relevant laws and regulations, and ensure the security of the personal information of the user. Once these user personal information data are no longer needed, the risk should be minimized by limiting or even prohibiting data collection and/or deleting data.
User privacy is protected by de-identifying data when used, including in certain related applications, such as by removing specific identifiers, controlling the amount or specificity of stored data, controlling how data is stored, and/or other methods of de-identifying when used.
Fig. 1 is a schematic diagram of a main flow of a job processing method according to an embodiment of the present application, and as shown in fig. 1, the job processing method includes:
step S101, in response to the job processing request, acquires a corresponding job identifier, and determines a corresponding job execution thread based on the job identifier.
In this embodiment, an execution subject (for example, a server) of the job processing method may check whether a job processing request is received by wired connection or wireless connection. After receiving the job processing request, a corresponding job identification may be obtained, where the job identification may be, for example, a job number or the like. And determining the job type according to the job identifier and acquiring corresponding job configuration information. And determining a corresponding job execution thread according to the job configuration information. Specifically, the job configuration information may include a thread identifier, and a corresponding job execution thread is determined according to the thread identifier.
Specifically, after acquiring the corresponding job identifier, the job processing method further includes:
and responding to the job processing type corresponding to the job identification as the job addition, and calling the rich text editor to execute the addition of the corresponding job according to the job identification.
According to the embodiment of the application, the registration center and the execution center are decoupled, and the non-intrusive type embedded execution center is embedded into the production application depending on the spring-ioc characteristic. The method comprises the steps that jobs are registered in a registration center in an articulate mode through spring-aop characteristics, unified scheduling management is conducted through the registration center, the management comprises common cron expression triggering and delay triggering, and weak association is established for each job through supporting subtask triggering. And a rich text editor is embedded in the registry to support the issuing of shell script operation in the registry, so that the online work of related operation of server operation is reduced and the management work of related operation is enhanced. The rich text editor may be invoked to perform the addition of the corresponding job when the job identifies the corresponding job processing type as job addition.
And step S102, responding to the non-empty operation execution thread, and acquiring a blocking strategy corresponding to the operation identification.
And when the storage program of the job execution thread is not empty, acquiring the content of the blocking strategy corresponding to the job identifier, and executing a subsequent processing process according to the content of the blocking strategy.
And step S103, executing the job corresponding to the job identifier based on the blocking strategy, and sending the job completion notification information to the preset callback interface in response to receiving the job completion notification information.
For example, the execution center loads the job execution method, the job execution queue, and the job execution thread from the cache according to the issued job name JOBNAME. And if the current operation execution thread is not empty, processing according to the issued blocking strategy. And the task callback JobCallback spin extracts a callback task from the log queue, and sends the callback task to a callback interface when the log is completed so as to complete the notification of job completion.
Specifically, executing the job corresponding to the job identification based on the blocking policy includes: and in response to the blocking strategy corresponding to the discarding subsequent scheduling strategy, performing discarding processing on the job corresponding to the job identification and marking as failure.
Specifically, executing the job corresponding to the job identification based on the blocking policy includes: and responding to the single machine serial strategy corresponding to the blocking strategy, and adding the job corresponding to the job identification into a first-in first-out queue to wait for execution in a serial mode.
Specifically, executing the job corresponding to the job identification based on the blocking policy includes: and in response to the fact that the blocking strategy corresponds to the pre-coverage scheduling strategy, terminating the currently running job and emptying the job queue, and further executing the job corresponding to the job identifier.
The blocking policy may include three types, which may include, for example, a drop-after-schedule policy, a stand-alone serialization policy, and an override-before-schedule policy. After a single machine serial strategy, namely a new scheduling task enters the executor, the scheduling task enters the FIFO queue and is executed in a serial mode. After a subsequent scheduling policy is discarded, that is, a new scheduling task enters the executor, if the same running scheduling task exists, the scheduling request is discarded and marked as failure. And covering the previous scheduling strategy, namely after a new scheduling task enters the executor, if the same scheduling task which is running exists, terminating the current scheduling task which is running, emptying the queue, and then running the new scheduling task.
In the embodiment, the corresponding job identifier is acquired by responding to the job processing request, and then the corresponding job execution thread is determined based on the job identifier; responding to the fact that the operation execution thread is not empty, and obtaining a blocking strategy corresponding to the operation identification; and executing the job corresponding to the job identifier based on the blocking strategy, and sending the job completion notification information to the preset callback interface in response to receiving the job completion notification information. The problem of blocking when the operation is executed in busy waiting is solved, the operation callback is packaged, and the real-time monitoring of the operation is guaranteed.
Fig. 2 is a main flow diagram of a job processing method according to an embodiment of the present application, and as shown in fig. 2, the job processing method includes:
in step S201, in response to the job processing request, the corresponding job identifier is acquired, and then the corresponding job execution thread is determined based on the job identifier.
The job processing request may be, for example, a processing request of a batch job. The number of the acquired job identifiers may be one or multiple, and the number of the jobs corresponding to the job processing request and the number of the acquired job identifiers are not specifically limited in the embodiment of the present application. Different job identifiers may correspond to the same job execution thread, or each job identifier may uniquely correspond to one job execution thread.
In step S202, in response to that the job execution thread is empty and the job corresponding to the job identifier is not executed by the job execution thread within the preset time, executing the job destruction program to end the current life cycle of the job corresponding to the job identifier.
When the storage program of the job execution thread is empty and the job corresponding to the job identification corresponding to the job processing request is not executed by the job execution thread within several minutes or tens of minutes, the job destroying program is called and executed to end the current life cycle of the job corresponding to the job identification, so that the job corresponding to the job identification is destroyed.
Step S203, in response to the job execution thread being non-empty, a blocking policy corresponding to the job identifier is obtained.
When the stored program of the job execution thread is non-empty, which indicates that the stored program exists in the job execution thread, the corresponding job configuration information may be obtained according to the job processing request, and the blocking policy corresponding to the job identifier may be obtained from the job configuration information.
And step S204, executing the operation corresponding to the operation identification based on the blocking strategy, responding to the received operation completion notification information, and sending the operation completion notification information to a preset callback interface.
According to the embodiment of the application, the problem of blocking when the execution operation is busy can be solved, the operation callback is packaged, and the real-time monitoring of the operation is guaranteed.
Fig. 3 is a schematic main flow diagram of a job processing method according to an embodiment of the present application, and as shown in fig. 3, the job processing method includes:
in step S301, in response to the job processing request, the corresponding job identifier is acquired, and the corresponding job execution thread is determined based on the job identifier.
After receiving the job processing request, the execution main body may obtain a corresponding job identifier, where the job identifier may be, for example, a job number. And determining the job type according to the job identifier and acquiring corresponding job configuration information. And determining a corresponding job execution thread according to the job configuration information. Specifically, the job configuration information may include a thread identifier, and a corresponding job execution thread is determined according to the thread identifier.
Step S302, in response to that the job execution thread is empty and the job corresponding to the job identifier is not executed by the job execution thread within the preset time, executing the job destruction program to end the current life cycle of the job corresponding to the job identifier.
In step S303, the job waiting program is executed, and in response to detecting a new job processing request, initialization is performed on a job corresponding to the new job processing request.
After the destruction is performed on the previous job, a job waiting program is executed to wait for the arrival of a new job. When the execution body detects a new job processing request, the latest job can be acquired and initialization can be performed for subsequent execution.
Illustratively, a job execution thread (JobThread) self-spinning extracts and processes jobs from a JobTriggerQueue (job trigger queue), an idle-time destruction strategy is designed for ensuring performance, and when no job is executed within 60s, a store is executed to end the current life cycle until a new job is issued and then is initialized again.
And step S304, responding to the non-empty operation thread, and acquiring a blocking strategy corresponding to the operation identification.
When the stored program of the job execution thread is non-empty, which indicates that the stored program exists in the job execution thread, the corresponding job configuration information may be obtained according to the job processing request, and the blocking policy corresponding to the job identifier may be obtained from the job configuration information.
Step S305, executing the job corresponding to the job identifier based on the blocking policy, and sending the job completion notification information to the preset callback interface in response to receiving the job completion notification information.
When the blocking strategy is a single machine serial strategy, a new scheduling task enters the executor and then enters the FIFO queue to be executed in a serial mode. When the blocking policy is to discard the subsequent scheduling policy, after a new scheduling task enters the executor, if the same scheduling task is running, the scheduling request of this time will be discarded and marked as failure. When the blocking strategy is a scheduling strategy before coverage, after a new scheduling task enters the actuator, if the same scheduling task which is running exists, the current running scheduling task is terminated, the queue is emptied, and then the new scheduling task is run. The execution center loads the job execution method, the job execution queue and the job execution thread from the cache according to the issued job name JOBNAME. And if the current operation execution thread is not empty, processing according to the issued blocking strategy. And the task callback JobCallback spin extracts a callback task from the log queue, and sends the callback task to a callback interface when the log is completed so as to complete the notification of job completion.
Fig. 4 is a schematic main flow diagram of a job processing method according to an embodiment of the present application. In the embodiment of the application, the registration center and the execution center solve the problem of busy waiting through asynchronous queues, and realize dynamic declarative registration of jobs through spring-ioc and SOCKET9999 job execution ports. In the embodiment of the present application, appName: the central authority name is registered. JobHandler: and a central operation execution device. JobThread: and executing the central job execution thread. Executorroot: the registry performs the issuing of the host interface. Execuoror router: the registration center executes the down-sending routing strategy to realize the interface. Execlutorcglib: the registry executes the issue of the specific agent class. Quartz: existing timed task execution frameworks. Spring: the existing JAVA framework. Web clustering: a network access layer cluster. Ap Cluster: the application deploys the cluster. Rabbitmq: and the message middleware encapsulates the blocking queue to realize de-centering asynchronous call. Socket: a network communication socket.
The functions of the registry include managing registry services and asynchronous consumption queues. The registry service can realize job registration management, job execution policy management, job load policy management, job failure retry policy management, registration machine ip management, scheduling and callback log management. The asynchronous consumption queue can realize service registration and consumer discovery and log consumer management. And the marking message queue and the executor interact through asynchronous execution queue calling. The logging message queue may include an execution queue, a scheduling queue, a job registration queue, a log queue, a heartbeat callback queue, and a job callback queue. The executor is used for issuing and executing tasks, managing ccbExecute general consumers and managing a job method. The scheduling queue in the queuing message queue can interact with the executor through the SOCKET9999 job execution port. The queuing message queue may be interoperable with a job service. The operation service comprises log monitoring, operation registration, operation callback and heartbeat monitoring.
For example, (1) when a project is started, a corresponding configuration file is read, and the corresponding configuration file is bound to a local machine (mainly ip and a registered socket service execution port) and an executor in the DB, for example, each ap and a mobile banking marketing service executor are bound by an application scene. The registry service and the registered consumer regularly read the corresponding registry update executor registration queue (ip: port queue) of the DB by 30S to ensure the load and call of the subsequent service.
(2) The job registration provides two job modes, namely, the execution center registers the declarative method, the declarative method is written in the execution center, @ ccbsandler (value = 'registered job name') is added, after the application is started, job registration consumers register in the registry at regular time, and the job list management is added.
(3) After the operation is registered, the registry delivers the operation according to the configuration execution strategy, and broadcasts in the register queue of the executor or selects the corresponding address- > to appoint the ip through the routing strategy according to the load strategy: and port- > issuing an execution command- > recording a relevant log.
(4) The execution center loads a job execution method, a job execution queue and a job execution thread from the cache according to the issued JOBNAME (registered job name). And if the current job execution thread is not empty, processing (processing strategies such as discarding, blocking, single machine serial and the like) according to the issued blocking strategy. JobCallback spin extracts a callback task from LogQueue, and sends the callback task to a callback interface when logs are completed so as to complete the notification of job completion.
(5) The JobThread (job execution thread) spinning extracts and processes the job from the JobTriggerQueue, an idle destruction strategy is designed for ensuring the performance, and when the job is not executed within 60s, the store is executed to end the current life cycle until a new job is issued and then the new job is initialized again.
The embodiment of the application mainly aims at high availability and high performance, the user group is wide, and an invention outer layer framework is arranged below, wherein containerization ensures that each application has the characteristics of mobility, light weight, expandability, agility and the like, and better deployment ecology is provided for the application. The embodiment of the application separates the registration from the execution, and improves the stability and the expansibility. And realizing declarative registration for the operation by means of spring-aop characteristic. The registration manages the scattered operation in a unified way, realizes a series of humanized operations, processes strategies of phenomena such as a registration center encapsulation load strategy, encapsulation failure, expiration, service restart and the like, and realizes the distribution of different strategies of different operations. The executor encapsulation blocking queue supports the parallel scheduling of the registry for the operation, solves the problem of operation blocking, encapsulates the operation callback, and ensures the real-time monitoring of the operation.
Fig. 5 is a schematic diagram of main units of a job processing apparatus according to an embodiment of the present application. As shown in fig. 5, the job processing apparatus 500 includes a first acquisition unit 501, a second acquisition unit 502, and a job execution unit 503.
A first obtaining unit 501, configured to obtain a corresponding job identifier in response to a job processing request, and further determine a corresponding job execution thread based on the job identifier.
A second obtaining unit 502 configured to obtain a blocking policy corresponding to the job identifier in response to the job execution thread being non-empty.
And a job execution unit 503 configured to execute the job corresponding to the job identifier based on the blocking policy, and in response to receiving the job completion notification information, send the job completion notification information to the preset callback interface.
In some embodiments, the first obtaining unit 501 is further configured to: and in response to the fact that the job execution thread is empty and the job corresponding to the job identification is not executed by the job execution thread within the preset time, executing a job destroying program to end the current life cycle of the job corresponding to the job identification.
In some embodiments, the first obtaining unit 501 is further configured to: and executing the job waiting program, and responding to the detection of the new job processing request, and executing initialization on the job corresponding to the new job processing request.
In some embodiments, the first obtaining unit 501 is further configured to: and responding to the job processing type corresponding to the job identification as the job addition, and calling the rich text editor to execute the addition of the corresponding job according to the job identification.
In some embodiments, the job execution unit 503 is further configured to: and in response to the blocking strategy corresponding to the discarding subsequent scheduling strategy, performing discarding processing on the job corresponding to the job identification and marking as failure.
In some embodiments, the job execution unit 503 is further configured to: and in response to the blocking strategy corresponding to the single machine serial strategy, adding the job corresponding to the job identification into a first-in first-out queue to wait for execution in a serial mode.
In some embodiments, the job execution unit 503 is further configured to: and in response to the fact that the blocking strategy corresponds to the scheduling strategy before covering, terminating the currently running job and emptying the job queue, and further executing the job corresponding to the job identifier.
The job processing method and the job processing apparatus according to the present application have a corresponding relationship in the details of implementation, and therefore, the description of the details thereof will not be repeated.
Fig. 6 illustrates an exemplary system architecture 600 to which the job processing method or job processing apparatus of the embodiments of the present application can be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a job processing screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server that provides various services, such as a background management server (for example only) that provides support for job processing requests submitted by users using the terminal devices 601, 602, 603. The background management server can respond to the job processing request, acquire a corresponding job identifier and further determine a corresponding job execution thread based on the job identifier; responding to the fact that the operation execution thread is not empty, and obtaining a blocking strategy corresponding to the operation identification; and executing the job corresponding to the job identifier based on the blocking strategy, and sending the job completion notification information to the preset callback interface in response to receiving the job completion notification information. The problem of blocking when the operation is executed in busy waiting is solved, the operation callback is packaged, and the real-time monitoring of the operation is guaranteed.
It should be noted that the job processing method provided in the embodiment of the present application is generally executed by the server 605, and accordingly, the job processing apparatus is generally provided in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use in implementing a terminal device of an embodiment of the present application. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the computer system 700 are also stored. The CPU701, the ROM702, and the RAM703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a liquid crystal credit authorization query processor (LCD), and the like, and a speaker and the like; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments disclosed herein, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments disclosed herein include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present application when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, which may be described as: a processor includes a first acquisition unit, a second acquisition unit, and a job execution unit. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to obtain a corresponding job identifier in response to a job processing request, and further determine a corresponding job execution thread based on the job identifier; responding to the fact that the operation execution thread is not empty, and obtaining a blocking strategy corresponding to the operation identification; and executing the job corresponding to the job identifier based on the blocking strategy, and sending the job completion notification information to the preset callback interface in response to receiving the job completion notification information.
The computer program product of the present application includes a computer program that implements the job processing method in the embodiments of the present application when executed by a processor.
According to the technical scheme of the embodiment of the application, the problem of blocking when the execution operation is busy is solved, the operation callback is packaged, and the real-time monitoring of the operation is guaranteed.
The above-described embodiments should not be construed as limiting the scope of the present application. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (16)

1. A method of processing a job, comprising:
responding to a job processing request, acquiring a corresponding job identifier, and further determining a corresponding job execution thread based on the job identifier;
responding to the non-empty operation execution thread, and acquiring a blocking strategy corresponding to the operation identification;
and executing the job corresponding to the job identification based on the blocking strategy, and sending the job completion notification information to a preset callback interface in response to receiving the job completion notification information.
2. The method of claim 1, wherein after said determining a corresponding job execution thread based on said job identification, the method further comprises:
and in response to the fact that the job execution thread is empty and the job corresponding to the job identification is not executed by the job execution thread within the preset time, executing a job destroying program to end the current life cycle of the job corresponding to the job identification.
3. The method of claim 2, wherein after said ending the current lifecycle of the job for which the job identification corresponds, the method further comprises:
and executing a job waiting program, responding to the detection of the new job processing request, and executing initialization on the job corresponding to the new job processing request.
4. The method of claim 1, wherein after said obtaining the corresponding job identification, the method further comprises:
and responding to the job processing type corresponding to the job identification as job addition, and calling a rich text editor to execute addition of the corresponding job according to the job identification.
5. The method of claim 1, wherein said executing the job identification corresponding job based on the blocking policy comprises:
and in response to the blocking strategy corresponding to the discarding subsequent scheduling strategy, performing discarding processing on the job corresponding to the job identification and marking as failure.
6. The method of claim 1, wherein the executing the job based on the blocking policy identifies the corresponding job, comprising:
and responding to the single machine serial strategy corresponding to the blocking strategy, and adding the operation corresponding to the operation identification into a first-in first-out queue to wait for execution in a serial mode.
7. The method of claim 1, wherein the executing the job based on the blocking policy identifies the corresponding job, comprising:
and in response to the fact that the blocking strategy corresponds to the pre-coverage scheduling strategy, terminating the currently running job and emptying a job queue, and further executing the job corresponding to the job identifier.
8. A job processing apparatus, comprising:
a first obtaining unit configured to obtain a corresponding job identification in response to a job processing request, and further determine a corresponding job execution thread based on the job identification;
a second obtaining unit configured to obtain a blocking policy corresponding to the job identifier in response to the job execution thread being non-empty;
and the job execution unit is configured to execute the job corresponding to the job identification based on the blocking strategy, and in response to receiving the job completion notification information, send the job completion notification information to a preset callback interface.
9. The apparatus of claim 8, wherein the first obtaining unit is further configured to:
and in response to the fact that the job execution thread is empty and the job corresponding to the job identification is not executed by the job execution thread within the preset time, executing a job destroying program to end the current life cycle of the job corresponding to the job identification.
10. The apparatus of claim 9, wherein the first obtaining unit is further configured to:
and executing the job waiting program, responding to the detection of the new job processing request, and executing initialization on the job corresponding to the new job processing request.
11. The apparatus of claim 8, wherein the first obtaining unit is further configured to:
and responding to the job processing type corresponding to the job identification as job addition, and calling a rich text editor to execute addition of the corresponding job according to the job identification.
12. The apparatus of claim 8, wherein the job execution unit is further configured to:
and in response to the fact that the blocking strategy corresponds to a discarding subsequent scheduling strategy, performing discarding processing on the job corresponding to the job identification and marking the job as failed.
13. The apparatus of claim 8, wherein the job execution unit is further configured to:
and responding to the single machine serial strategy corresponding to the blocking strategy, adding the job corresponding to the job identification into a first-in first-out queue to wait for execution in a serial mode.
14. A job processing electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-7.
15. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
16. A computer program product comprising a computer program, characterized in that the computer program realizes the method according to any of claims 1-7 when executed by a processor.
CN202211600859.7A 2022-12-13 2022-12-13 Job processing method and device, electronic equipment and computer readable medium Pending CN115878290A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211600859.7A CN115878290A (en) 2022-12-13 2022-12-13 Job processing method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211600859.7A CN115878290A (en) 2022-12-13 2022-12-13 Job processing method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN115878290A true CN115878290A (en) 2023-03-31

Family

ID=85767343

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211600859.7A Pending CN115878290A (en) 2022-12-13 2022-12-13 Job processing method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN115878290A (en)

Similar Documents

Publication Publication Date Title
AU2017434691B2 (en) Method and device for handling timeout of system service
CN106127036B (en) The worker process of duration and elasticity
US11630692B2 (en) Efficient worker utilization
CN109743411B (en) Method, device and storage medium for dynamically scheduling IP proxy pool in distributed environment
US9323591B2 (en) Listening for externally initiated requests
US11115348B2 (en) Virtual resource allocation for processing an event queue
CN111221638B (en) Concurrent task scheduling processing method, device, equipment and medium
US11294740B2 (en) Event to serverless function workflow instance mapping mechanism
US11656902B2 (en) Distributed container image construction scheduling system and method
US8635682B2 (en) Propagating security identity information to components of a composite application
CN110457132B (en) Method and device for creating functional object and terminal equipment
US20210226929A1 (en) Techniques for transferring data across air gaps
CN111290842A (en) Task execution method and device
CN110704131B (en) Method and device for calling native application by HTML5 application
CN116701020A (en) Message delay processing method, device, equipment, medium and program product
CN116095005A (en) Traffic management method, apparatus, device, medium, and program product
CN115878290A (en) Job processing method and device, electronic equipment and computer readable medium
CN115525411A (en) Method, device, electronic equipment and computer readable medium for processing service request
CN113765871B (en) Method and device for managing fort machine
CN116089924A (en) Method, device, computer equipment and storage medium for accessing permission data
CN114374657A (en) Data processing method and device
CN113296829A (en) Method, device, equipment and computer readable medium for processing service
CN106484536B (en) IO scheduling method, device and equipment
CN111324888B (en) Verification method and device for application program starting, electronic equipment and storage medium
CN115422530A (en) Method and device for isolating tenant and electronic equipment

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