CN115858107A - Multithreading batch operation monitoring method and device, computer equipment and storage medium - Google Patents

Multithreading batch operation monitoring method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115858107A
CN115858107A CN202210908232.1A CN202210908232A CN115858107A CN 115858107 A CN115858107 A CN 115858107A CN 202210908232 A CN202210908232 A CN 202210908232A CN 115858107 A CN115858107 A CN 115858107A
Authority
CN
China
Prior art keywords
service
current
equal
current service
records
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
CN202210908232.1A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210908232.1A priority Critical patent/CN115858107A/en
Publication of CN115858107A publication Critical patent/CN115858107A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application relates to the technical field of data processing, and particularly discloses a multithreading batch operation monitoring method, a multithreading batch operation monitoring device, multithreading batch operation monitoring equipment and a storage medium. The method comprises the following steps: acquiring the total number of current service records, the number of current service processing and the number of last service processing of each service thread in a service reading module; judging whether the current service record number is equal to the current service processing number; when the total number of the current service records is not equal to the current service processing number, judging whether the current service records are equal to the last service processing number or not; when the number of the current business records is equal to the number of the last business processing, triggering a monitoring alarm. By the mode, the total number of the previous service records, the current service processing number and the last service processing number are obtained and compared, when the current service record number is equal to the last service processing number, the alarm is triggered through the service monitoring module, and the technical problem that the efficiency is low when multithreading batch operation is carried out at present is solved.

Description

Multithreading batch operation monitoring method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for monitoring multithread batch operations, a computer device, and a storage medium.
Background
In daily large-batch business processing, multi-thread batch processing is a common business processing mode, and increasingly high-speed business needs higher control capability on batch business processing, so that a solution for batch processing capable of sensing in real time is needed.
The common scheme of the traditional business scheme is that the database is recorded in real time during batch processing in the processing, the database interaction is increased through the processing, the retention significance of the processed data is not large, and resources are wasted. When multiple threads process services simultaneously, the progress of each thread cannot be monitored, so that an alarm cannot be given when a certain thread is abnormal, and the efficiency of multi-thread batch operation is low. Therefore, how to solve the low efficiency of the prior multithread batch operation becomes a technical problem to be solved urgently at present.
Disclosure of Invention
The application provides a multithreading batch operation monitoring method and device, computer equipment and a storage medium, and aims to solve the technical problem of low efficiency in multithreading batch operation.
In a first aspect, the present application provides a method for monitoring multi-thread batch operations, where the method includes:
acquiring the total number of current service records, the current service processing number and the last service processing number of each service thread in a service reading module; judging whether the total number of the current service records is equal to the current service processing number or not through a service monitoring module; when the total number of the current service records is not equal to the current service processing number, judging whether the current service records are equal to the last service processing number or not; and triggering a monitoring alarm when the number of the current service records is equal to the number of the last service processing.
Further, when the current service record number is not equal to the current service processing number, before determining whether the current service record number is equal to the last service processing number, the method further includes:
when the total number of the current business records is equal to the current business processing number, updating the current business processing number to a database, and synchronizing the current business processing number to the business reading module;
further, acquiring the total number of the current service records of each service thread in the service reading module includes:
acquiring the current service record number of each service thread through the service reading module;
summing the current business record number of all the business threads to obtain the total number of the current business records;
further, before the current service record number of each service thread is obtained through the service reading module, the method further includes:
naming each service thread in the form of a serial number through the service acquisition module, wherein the serial number is an integer which is sequentially arranged from 0;
further, when the number of the current service records is equal to the number of the last service processes, before triggering the monitoring alarm, the method further includes:
when the current service record number is not equal to the last service processing number, updating the current service processing number to a database, and synchronizing the current service processing number to the service reading module;
further, before determining whether the current service record number is equal to the last service processing number, the method further includes:
judging whether the service thread is interrupted or not through the service monitoring module;
if the interruption of the service thread is detected, alarming is carried out through the service monitoring module;
if the interruption of the service thread is not detected, starting: judging whether the current service record number is equal to the last service processing number;
further, the method for monitoring the multi-thread batch operation further comprises the following steps:
when the current service of each service thread is processed, marking the current service as completed through the service monitoring module, and synchronizing to the service reading module.
In a second aspect, the present application further provides a multithreading batch job monitoring apparatus, including: the data acquisition module is used for acquiring the total number of current service records, the current service processing number and the last service processing number of each service thread in the service reading module; the first judging module is used for judging whether the total number of the current service records is equal to the current service processing number or not through the service monitoring module; a second judging module, configured to judge whether the current service record number is equal to the last service processing number when the total number of the current service records is not equal to the current service processing number; and the abnormal alarm module is used for triggering monitoring alarm when the current business record number is equal to the last business processing number.
In a third aspect, the present application further provides a computer device comprising a memory and a processor; the memory is used for storing a computer program; the processor is configured to execute the computer program and to implement the multi-threaded batch job monitoring method as described above when executing the computer program.
In a fourth aspect, the present application also provides a computer-readable storage medium storing a computer program, which when executed by a processor causes the processor to implement the method for multi-threaded batch job monitoring as described above.
The application discloses a method for monitoring multi-thread batch operation, which comprises the steps of obtaining the total number of current service records, the current service processing number and the last service processing number of each service thread in a service reading module; judging whether the total number of the current service records is equal to the current service processing number or not through a service monitoring module; when the total number of the current service records is not equal to the current service processing number, judging whether the current service records are equal to the last service processing number or not; and triggering a monitoring alarm when the number of the current service records is equal to the number of the last service processing. By the above mode, the total number of the previous service records, the current service processing number and the last service processing number are obtained and compared, when the current service records are equal to the last service processing number, the alarm is triggered by the service monitoring module, the efficiency of the multi-thread batch operation is improved, and the technical problem of low efficiency of the multi-thread batch operation at present is solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram illustrating a first embodiment of a method for monitoring multi-threaded batch jobs according to an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a second embodiment of a method for monitoring multithreaded batch jobs according to an embodiment of the present application;
FIG. 3 is a schematic flow chart diagram illustrating a third embodiment of a method for monitoring multi-threaded batch jobs according to an embodiment of the present application;
FIG. 4 is a schematic block diagram of an apparatus for multi-threaded batch job monitoring provided by an embodiment of the present application;
FIG. 5 is a block diagram schematic illustration of an architecture of a multithreaded batch job monitoring computer device as provided by an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution order may be changed according to the actual situation.
It is to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
The embodiment of the application provides a multithreading batch operation monitoring method and device, computer equipment and a storage medium. The multithreading batch operation monitoring method can be applied to a server, the total number of the previous service records, the current service processing number and the last service processing number are obtained and compared, when the current service record number is equal to the last service processing number, the service processing is not carried out currently, and therefore an alarm is triggered through a service monitoring module. The server may be an independent server or a server cluster.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for monitoring a multithreaded batch operation according to a first embodiment of the present application. The multithreading batch operation monitoring method can be applied to a server and is used for comparing the total number of the obtained business records, the current business processing number and the last business processing number and triggering alarm through a business monitoring module when the current business record number is equal to the last business processing number.
As shown in fig. 1, the method for monitoring multi-thread batch jobs specifically includes steps S101 to S104.
S101, acquiring the total number of current service records, the number of current service processing and the number of last service processing of each service thread in a service reading module.
S102, judging whether the total number of the current business records is equal to the current business processing number through a business monitoring module.
S103, when the total number of the current service records is not equal to the current service processing number, judging whether the current service records are equal to the last service processing number.
And S104, when the current business record number is equal to the last business processing number, triggering a monitoring alarm.
In this example, the role of the volite keyword is:
1. memory visibility
Based on the cache coherency protocol, when a variable modified with a volate key changes, the CPU (central processing unit) will notify other threads that the cache has been modified and needs to be updated. So that each thread can obtain the latest variable value.
2. Preventing instruction reordering based on memory barrier
Variables modified with voliate may prevent cpu instructions from reordering. The implementation of the bottom layer is based on 4 kinds of memory barriers: read, write, read barriers.
When a computer executes a multi-thread program, each instruction is executed in each computer, and data reading and writing are involved in the process of executing the instructions by each CPU. However, temporary data during the program running process is stored in the physical memory, which causes a phenomenon: the execution speed of the CPU is fast, and the physical memory reading and writing speeds are much slower compared to the execution speed of the CPU. On the premise that all data operations are performed through interaction with the physical memory at any time, the instruction execution speed is greatly reduced.
In a multi-core CPU, there may be a case: initially, two threads respectively read the value of i and store the value in the cache of the CPU where the two threads are located, then thread 1 adds 1, and then writes the latest value 1 of i into the memory. At this time, the value of i in the cache of the thread 2 is still 0, and after the operation of adding 1, the value of i is 1, and then the thread 2 writes the value of i into the memory. The value of the final result i is 1 instead of 2.
In computer programming, a basic concept is to control multiple tasks simultaneously. Many programming problems require that the program be able to stop working at hand, instead handle other problems, and return to the main process. This can be achieved in a number of ways. Initially, programmers in machine low-level languages written "interrupt service routines" and the main process was suspended by hardware-level interrupts. While this is a useful approach, the programmed program is difficult to migrate, thereby posing another type of costly problem. Interrupts are necessary for tasks that are very real-time. However, for many other problems, it is only necessary to divide the problem into independently running program segments so that the entire program can respond to the user's request more quickly.
Initially, threads were just one tool for allocating the processing time of a single processor. However, if the operating system itself supports multiple processors, each thread may be assigned to a different processor, actually entering the "parallel operation" state. One of the most valuable features of multi-threading from a programming language perspective is that the programmer does not have to be concerned about how many processors are used. A program is logically divided into a plurality of threads; if the machine itself has multiple processors installed, the process can run faster without any special adjustments. From the foregoing discussion, one may feel thread processing is very simple. But one problem must be noted: the resources are shared. A problem is encountered if there are multiple threads running simultaneously and they attempt to access the same resource. For example, two threads cannot send information to a printer at the same time. To address this problem, for those resources that are shareable (such as printers), they must enter a locked state during use. One thread can lock a resource and after completing its task, release the lock so that other threads can then use the same resource.
Multithreading is to complete multiple tasks simultaneously, not to improve the efficiency of operation, but to improve the efficiency of resource usage to improve the efficiency of the system. Threads are implemented when multiple tasks need to be completed at the same time.
The embodiment provides a method for monitoring multi-thread batch jobs, which acquires the total number of current service records, the number of current service processes and the number of last service processes of each service thread in a service reading module; judging whether the total number of the current service records is equal to the current service processing number or not through a service monitoring module; when the total number of the current service records is not equal to the current service processing number, judging whether the current service record number is equal to the last service processing number; and triggering a monitoring alarm when the number of the current service records is equal to the number of the last service processing. By the above mode, the total number of the previous service records, the current service processing number and the last service processing number are obtained and compared, when the current service records are equal to the last service processing number, the alarm is triggered by the service monitoring module, the efficiency of the multi-thread batch operation is improved, and the technical problem of low efficiency of the multi-thread batch operation at present is solved.
As shown in fig. 1, before step S103, the method further includes:
and when the total number of the current business records is equal to the current business processing number, updating the current business processing number to a database, and synchronizing the current business processing number to the business reading module.
In this embodiment, the process of the volate reading and writing variables is as follows:
and (3) writing: when a thread modifies the value of a volate variable, the JMM flushes the shared variable value in the local memory corresponding to the thread to the main memory.
And (3) reading: when a thread reads the value of a volate variable, the JMM will set the local memory corresponding to the thread as invalid, and the thread will then read the shared variable from the main memory.
The embodiment provides a method for monitoring multi-thread batch jobs, which acquires the total number of current service records, the number of current service processes and the number of last service processes of each service thread in a service reading module; judging whether the total number of the current service records is equal to the current service processing number or not through a service monitoring module; when the total number of the current service records is not equal to the current service processing number, judging whether the current service records are equal to the last service processing number or not; and triggering a monitoring alarm when the number of the current service records is equal to the number of the last service processing. By the above mode, the total number of the previous service records, the current service processing number and the last service processing number are obtained and compared, when the current service records are equal to the last service processing number, the alarm is triggered by the service monitoring module, the efficiency of the multi-thread batch operation is improved, and the technical problem of low efficiency of the multi-thread batch operation at present is solved.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a method for monitoring a multi-threaded batch operation according to a second embodiment of the present disclosure. The multithreading batch operation monitoring method can be applied to a server and is used for comparing the total number of the obtained previous service records, the current service processing number and the last service processing number, and when the current service record number is equal to the last service processing number, the service monitoring module triggers an alarm.
Based on the embodiment shown in fig. 1, step S101 specifically includes:
step S1011, obtaining the current business record number of each business thread through the business reading module;
step S1012, summing up the current service record numbers of all the service threads to obtain the total number of the current service record.
In this embodiment, a set of number of service processing records of the volate type is set:
voltate List < Integer > currNumberList = arrays. Aslist (0,0,0,0,n); the number of N is the number of multiple threads of the service processing module;
setting totalNumber = N total number of records processed in batch;
y number =0 the number of records of the last batch processing.
In particular embodiments, implementing multithreading employs a concurrent execution mechanism.
The concurrent execution mechanism principle: in short, a processor is divided into a plurality of short time slices, each time slice is used for processing each application program in turn, and as compared with an application program, the time slice is short as if the processor is serving the application program independently, so that the effect that a plurality of application programs are carried out simultaneously is achieved.
Multithreading is to apply the concurrent execution mechanism principle in an operating system to a program, and divide the program into a plurality of subtasks, where each task is a thread, and the plurality of subtasks are executed concurrently.
The embodiment provides a method for monitoring multi-thread batch jobs, which acquires the total number of current service records, the number of current service processes and the number of last service processes of each service thread in a service reading module; judging whether the total number of the current service records is equal to the current service processing number or not through a service monitoring module; when the total number of the current service records is not equal to the current service processing number, judging whether the current service record number is equal to the last service processing number; and when the current business record number is equal to the last business processing number, triggering a monitoring alarm. By the above mode, the total number of the previous service records, the current service processing number and the last service processing number are obtained and compared, when the current service records are equal to the last service processing number, the alarm is triggered by the service monitoring module, the efficiency of the multi-thread batch operation is improved, and the technical problem of low efficiency of the multi-thread batch operation at present is solved.
Referring to fig. 1, before the step S101, the present embodiment further includes:
naming each service thread in the form of a serial number through the service acquisition module, wherein the serial number is an integer sequentially arranged from 0.
In this embodiment, in the multi-thread processing service processing module, the thread names of multiple threads are set as sequence numbers, for example, the first is 0, the second is 1, and so on, during service processing, the sequence number of the current thread is obtained, and the codes are as follows: integer.parsein (thread.currentthread (). GetName ()).
In the same thread, according to the code sequence, the operation written in the front occurs in the operation written in the back in advance; a write operation to a variable occurs first and then a read operation to the variable occurs later.
Visibility of a thread is the modification of a shared variable by one thread, and it is seen by another thread whether all operations in the thread are restricted from occurring in the detection of a thread's suspension.
The embodiment provides a method for monitoring multi-thread batch jobs, which acquires the total number of current service records, the number of current service processes and the number of last service processes of each service thread in a service reading module; judging whether the total number of the current service records is equal to the current service processing number or not through a service monitoring module; when the total number of the current service records is not equal to the current service processing number, judging whether the current service records are equal to the last service processing number or not; and triggering a monitoring alarm when the number of the current service records is equal to the number of the last service processing. By the method, the total number of the previous service records, the current service processing number and the last service processing number are obtained and compared, and when the current service record number is equal to the last service processing number, the alarm is triggered through the service monitoring module, so that the efficiency of multi-thread batch operation is improved, and the technical problem of low efficiency of the conventional multi-thread batch operation is solved.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating a method for monitoring multithreaded batch operations according to a third embodiment of the present application. The multithreading batch operation monitoring method can be applied to a server and is used for comparing the total number of the obtained business records, the current business processing number and the last business processing number and triggering alarm through a business monitoring module when the current business record number is equal to the last business processing number.
Based on the embodiment shown in fig. 1, before step S103, the method further includes:
step S1021, judging whether the service thread is interrupted or not through the service monitoring module;
step S1022, if it is detected that the service thread is interrupted, an alarm is given through the service monitoring module;
step S1023, if it is not detected that the service thread is interrupted, then: and judging whether the current service record number is equal to the last service processing number.
In the present embodiment, multithreading (multithreading) refers to a technique for implementing concurrent execution of multiple threads from software or hardware. The computer with multithreading capability can execute more than one thread at the same time due to the hardware support, thereby improving the overall processing performance. Systems with this capability include symmetric multiprocessors, multi-core processors, and chip-level multiprocessing or simultaneous multi-threaded processors. In a program, these independently running program fragments are called "threads" (threads), and the notion of programming with them is called "multithreading".
Because the multi-thread processor comprises a plurality of CPUs, and each CPU runs independently, the processing progress of all threads is difficult to monitor simultaneously, and when the threads are abnormal, abnormal alarm information cannot be obtained from the system in time.
The embodiment provides a method for monitoring multi-thread batch jobs, which acquires the total number of current service records, the number of current service processes and the number of last service processes of each service thread in a service reading module; judging whether the total number of the current service records is equal to the current service processing number or not through a service monitoring module; when the total number of the current service records is not equal to the current service processing number, judging whether the current service records are equal to the last service processing number or not; and triggering a monitoring alarm when the number of the current service records is equal to the number of the last service processing. By the above mode, the total number of the previous service records, the current service processing number and the last service processing number are obtained and compared, when the current service records are equal to the last service processing number, the alarm is triggered by the service monitoring module, the efficiency of the multi-thread batch operation is improved, and the technical problem of low efficiency of the multi-thread batch operation at present is solved.
Based on all the above embodiments, in this embodiment, the method specifically further includes:
when the current service of each service thread is processed, marking the current service as completed through the service monitoring module, and synchronizing to the service reading module.
In this embodiment, based on the memory visibility of Voliate, when the service in one or more of the threads is changed, the service is fed back to other threads in time, and the other threads are notified to receive and cache the modified instruction, so that each thread can acquire the latest variable value in the entire system. Volilate-modified variables may also prevent reordering of CPU instructions in the system.
Referring to fig. 1, before the step S104, the present embodiment further includes updating the current service processing number to a database and synchronizing the current service processing number to the service reading module when the current service record number is not equal to the last service processing number.
The embodiment provides a method for monitoring multi-thread batch jobs, which acquires the total number of current service records, the number of current service processes and the number of last service processes of each service thread in a service reading module; judging whether the total number of the current service records is equal to the current service processing number or not through a service monitoring module; when the total number of the current service records is not equal to the current service processing number, judging whether the current service record number is equal to the last service processing number; and triggering a monitoring alarm when the number of the current service records is equal to the number of the last service processing. By the above mode, the total number of the previous service records, the current service processing number and the last service processing number are obtained and compared, when the current service records are equal to the last service processing number, the alarm is triggered by the service monitoring module, the efficiency of the multi-thread batch operation is improved, and the technical problem of low efficiency of the multi-thread batch operation at present is solved.
Referring to FIG. 4, FIG. 4 is a block diagram of a multi-thread batch job monitoring apparatus for performing the above-mentioned multi-thread batch job monitoring method according to an embodiment of the present application. The multithreading batch operation monitoring device can be configured on a server.
As shown in FIG. 4, the multi-threaded batch job monitoring apparatus 400 includes:
the data acquisition module 10 is configured to acquire a total number of current service records, a current service processing number, and a last service processing number of each service thread in the service reading module;
a first judging module 20, configured to judge, by a service monitoring module, whether the total number of the current service records is equal to the current service processing number;
a second judging module 30, configured to judge whether the current service record number is equal to the last service processing number when the total number of the current service records is not equal to the current service processing number;
and the abnormal alarm module 40 is configured to trigger a monitoring alarm when the current service record number is equal to the last service processing number.
Further, the data obtaining module 10 specifically includes:
a current service record number obtaining unit, configured to obtain, through the service reading module, a current service record number of each service thread;
and the current business record total acquiring unit is used for summing the current business records of all the business threads to obtain the current business record total.
Further, the first determining module 20 specifically includes:
and the thread naming unit is used for naming each service thread in a serial number form through the service acquisition module, wherein the serial number is an integer which is sequentially arranged from 0.
Further, the second determining module 30 specifically includes:
a thread interruption judging unit, configured to judge, by the service monitoring module, whether the service thread is interrupted; if the interruption of the business thread is not detected, starting: and judging whether the current service record number is equal to the last service processing number.
Further, the abnormal alarm module 40 specifically includes:
a data synchronization unit, configured to update the current service processing number to a database and synchronize the current service processing number to the service reading module when the current service record number is not equal to the last service processing number;
and the service marking unit is used for marking the current service as finished through the service monitoring module and synchronizing the current service to the service reading module when the current service of each service thread is processed and finished.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the apparatus and the modules described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The apparatus described above may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 5.
Referring to fig. 5, fig. 5 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device may be a server.
Referring to fig. 5, the computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a nonvolatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause a processor to perform any one of the methods of multi-threaded batch job monitoring.
The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.
The internal memory provides an environment for execution of a computer program on a non-volatile storage medium, which when executed by the processor, causes the processor to perform any one of the methods of multithreaded batch job monitoring.
The network interface is used for network communication, such as sending assigned tasks. It will be appreciated by those skilled in the art that the configuration shown in fig. 5 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein, in one embodiment, the processor is configured to execute a computer program stored in the memory to implement the steps of:
acquiring the total number of current service records, the number of current service processing and the number of last service processing of each service thread in a service reading module;
judging whether the total number of the current service records is equal to the current service processing number or not through a service monitoring module;
when the total number of the current service records is not equal to the current service processing number, judging whether the current service records are equal to the last service processing number or not;
and triggering a monitoring alarm when the number of the current service records is equal to the number of the last service processing.
In an embodiment, when the current service record number is not equal to the current service processing number, before determining whether the current service record number is equal to the last service processing number, the method is configured to:
when the total number of the current business records is equal to the current business processing number, updating the current business processing number to a database, and synchronizing the current business processing number to the business reading module;
in an embodiment, the obtaining of the total number of the current service records of each service thread in the service reading module is used to implement:
acquiring the current service record number of each service thread through the service reading module;
summing the current business record number of all the business threads to obtain the total number of the current business records;
in an embodiment, before the current service record number of each service thread is obtained by the service reading module, the service reading module is configured to:
naming each service thread in the form of a serial number through the service acquisition module, wherein the serial number is an integer which is sequentially arranged from 0;
in an embodiment, before triggering a monitoring alarm when the current service record number is equal to the last service processing number, the following is implemented:
when the current service record number is not equal to the last service processing number, updating the current service processing number to a database, and synchronizing the current service processing number to the service reading module;
in an embodiment, before the determining whether the current service record number is equal to the last service processing number, the method is implemented to:
judging whether the service thread is interrupted or not through the service monitoring module;
if the interruption of the service thread is detected, alarming is carried out through the service monitoring module;
if the interruption of the business thread is not detected, starting: judging whether the current service record number is equal to the last service processing number;
in one embodiment, the method is further for implementing:
when the current service of each service thread is processed, marking the current service as completed through the service monitoring module, and synchronizing to the service reading module.
The embodiment of the application further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, the computer program comprises program instructions, and the processor executes the program instructions to implement any one of the multithreading batch job monitoring methods provided by the embodiments of the application.
The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A multithreading batch operation monitoring method, comprising:
acquiring the total number of current service records, the number of current service processing and the number of last service processing of each service thread in a service reading module;
judging whether the total number of the current service records is equal to the current service processing number or not through a service monitoring module;
when the total number of the current service records is not equal to the current service processing number, judging whether the current service records are equal to the last service processing number or not;
and triggering a monitoring alarm when the number of the current service records is equal to the number of the last service processing.
2. The method of claim 1, wherein when the current transaction record number is not equal to the current transaction processing number, before determining whether the current transaction record number is equal to the last transaction processing number, the method further comprises:
and when the total number of the current service records is equal to the current service processing number, updating the current service processing number to a database, and synchronizing the current service processing number to the service reading module.
3. The method of claim 1, wherein the obtaining the total number of current service records of each service thread in the service reading module comprises:
acquiring the current service record number of each service thread through the service reading module;
and summing the current business record number of all the business threads to obtain the total number of the current business records.
4. The method of claim 3, wherein before the obtaining of the current number of service records of each service thread by the service reading module, the method further comprises:
naming each service thread in the form of a serial number through the service acquisition module, wherein the serial number is an integer sequentially arranged from 0.
5. The method for monitoring multithreaded batch jobs according to claim 1, wherein before triggering a monitoring alarm when the current transaction count is equal to the last transaction count, the method further comprises:
and when the current service record number is not equal to the last service processing number, updating the current service processing number to a database, and synchronizing the current service processing number to the service reading module.
6. The method of claim 1, wherein before determining whether the current transaction record number is equal to the last transaction processing number, the method further comprises:
judging whether the service thread is interrupted or not through the service monitoring module;
if the interruption of the service thread is detected, alarming is carried out through the service monitoring module;
if the interruption of the service thread is not detected, starting: and judging whether the current service record number is equal to the last service processing number.
7. The method of any of claims 1-6, further comprising:
when the current service of each service thread is processed, marking the current service as completed through the service monitoring module, and synchronizing to the service reading module.
8. A multithreaded batch job monitoring apparatus, the monitoring apparatus comprising:
the data acquisition module is used for acquiring the total number of current service records, the current service processing number and the last service processing number of each service thread in the service reading module;
the first judging module is used for judging whether the total number of the current service records is equal to the current service processing number or not through the service monitoring module;
a second judging module, configured to judge whether the current service record number is equal to the last service processing number when the total number of the current service records is not equal to the current service processing number;
and the abnormal alarm module is used for triggering monitoring alarm when the current business record number is equal to the last business processing number.
9. A computer device, wherein the computer device comprises a memory and a processor;
the memory is used for storing a computer program;
the processor for executing the computer program and implementing the method of multi-threaded batch job monitoring of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to implement the method of multi-threaded batch job monitoring of any one of claims 1 to 7.
CN202210908232.1A 2022-07-29 2022-07-29 Multithreading batch operation monitoring method and device, computer equipment and storage medium Pending CN115858107A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210908232.1A CN115858107A (en) 2022-07-29 2022-07-29 Multithreading batch operation monitoring method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210908232.1A CN115858107A (en) 2022-07-29 2022-07-29 Multithreading batch operation monitoring method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115858107A true CN115858107A (en) 2023-03-28

Family

ID=85660449

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210908232.1A Pending CN115858107A (en) 2022-07-29 2022-07-29 Multithreading batch operation monitoring method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115858107A (en)

Similar Documents

Publication Publication Date Title
US6886081B2 (en) Method and tool for determining ownership of a multiple owner lock in multithreading environments
US8949671B2 (en) Fault detection, diagnosis, and prevention for complex computing systems
US7472228B2 (en) Read-copy update method
US8341635B2 (en) Hardware wake-and-go mechanism with look-ahead polling
EP0264568B1 (en) Serialisation of system events in a multiprocessing system
US20130160028A1 (en) Method and apparatus for low latency communication and synchronization for multi-thread applications
US9378069B2 (en) Lock spin wait operation for multi-threaded applications in a multi-core computing environment
EP2626786B1 (en) Multicore processor system, method of monitoring control, and monitoring control program
US11132294B2 (en) Real-time replicating garbage collection
US7818743B2 (en) Logging lock data
CN110018914B (en) Shared memory based message acquisition method and device
EP1857927A2 (en) Method and system for enhanced thread synchronization and coordination
JP5326374B2 (en) Processor, performance profiling apparatus, performance profiling program, and performance profiling method
US8181185B2 (en) Filtering of performance monitoring information
US11620215B2 (en) Multi-threaded pause-less replicating garbage collection
US8990551B2 (en) Analysis and visualization of cluster resource utilization
WO2020232875A1 (en) Actor model-based task scheduling method and apparatus, and storage medium
US7581222B2 (en) Software barrier synchronization
US8769546B2 (en) Busy-wait time for threads
KR20200014378A (en) Job management
US9910717B2 (en) Synchronization method
JP3546694B2 (en) Multi-thread computer system and multi-thread execution control method
Armejach et al. HARP: Adaptive abort recurrence prediction for hardware transactional memory
JP4253796B2 (en) Computer and control method
CN115858107A (en) Multithreading batch operation monitoring method and device, computer equipment and storage medium

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