CN110673942A - Asynchronous process ending method and device of cloud platform and cloud platform server - Google Patents

Asynchronous process ending method and device of cloud platform and cloud platform server Download PDF

Info

Publication number
CN110673942A
CN110673942A CN201910935658.4A CN201910935658A CN110673942A CN 110673942 A CN110673942 A CN 110673942A CN 201910935658 A CN201910935658 A CN 201910935658A CN 110673942 A CN110673942 A CN 110673942A
Authority
CN
China
Prior art keywords
task
asynchronous
heartbeat value
heartbeat
cloud platform
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910935658.4A
Other languages
Chinese (zh)
Other versions
CN110673942B (en
Inventor
周恒�
秦海中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Inspur Data Technology Co Ltd
Original Assignee
Beijing Inspur Data Technology 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 Beijing Inspur Data Technology Co Ltd filed Critical Beijing Inspur Data Technology Co Ltd
Priority to CN201910935658.4A priority Critical patent/CN110673942B/en
Publication of CN110673942A publication Critical patent/CN110673942A/en
Application granted granted Critical
Publication of CN110673942B publication Critical patent/CN110673942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention discloses an asynchronous process ending method and device of a cloud platform, a cloud platform server and a computer readable storage medium, wherein the method comprises the following steps: when the asynchronous process is started, acquiring a corresponding first heartbeat value; before receiving the current asynchronous task from the target task queue, judging whether a preset corresponding relation exists between a second heartbeat value and a first heartbeat value corresponding to the current asynchronous task; the target task queue is a task queue corresponding to the asynchronous process; if not, exiting the process; according to the invention, the asynchronous process can automatically quit and finish by utilizing the comparison of the heartbeat values through the setting of the heartbeat values corresponding to the asynchronous task and the asynchronous process, so that the asynchronous process can be finished simply and conveniently by adjusting the heartbeat values corresponding to the asynchronous task or the asynchronous process, the time occupied by the finishing process of the asynchronous process is reduced, the condition of task processing interruption is avoided, and the asynchronous process can be further smoothly upgraded.

Description

Asynchronous process ending method and device of cloud platform and cloud platform server
Technical Field
The invention relates to the technical field of cloud platforms, in particular to an asynchronous process ending method and device of a cloud platform, a cloud platform server and a computer readable storage medium.
Background
With the development of modern society science and technology, the application of the cloud platform is more and more extensive. The cloud platform often needs to process asynchronous tasks, and when the cloud platform is deployed, it is generally determined how many asynchronous processes (i.e., asynchronous daemon processes, asynchronous worker) are started to receive the tasks and execute the processing according to the deployed computing nodes.
In the prior art, when an asynchronous process needs to be ended if the asynchronous process is ended, for example, a code of the asynchronous process is updated, the following method is often adopted: 1. all existing asynchronous workers are kill (ended), but the asynchronous workers which are processing tasks possibly cause task processing interruption and bring about a series of other subsequent problems; 2. determining that an asynchronous worker is not processing a task by a certain means, and then giving out a kill to the asynchronous worker, but if the number of asynchronous tasks to be processed is large, the asynchronous worker can have a direct task and cannot be killed, the confirmation is a very troublesome event, and the condition of confirmation error often occurs, so that the task processing is interrupted, and a series of subsequent problems are brought; 3. the asynchronous worker determines when to quit by sending a signal to the asynchronous worker, but in this case, whether the asynchronous worker quits or not needs to be continuously confirmed, the process is troublesome, and the upgrading time is prolonged.
Therefore, how to simply and conveniently end the asynchronous process, reduce the time occupied by the ending process of the asynchronous process, and avoid the interruption of task processing is a problem which needs to be solved urgently nowadays.
Disclosure of Invention
The invention aims to provide an asynchronous process termination method and device of a cloud platform, a cloud platform server and a computer readable storage medium, wherein the asynchronous process can automatically quit termination through setting a heartbeat value, so that the asynchronous process can be terminated simply and conveniently, and the condition of task processing interruption is avoided.
In order to solve the technical problem, the invention provides an asynchronous process ending method of a cloud platform, which comprises the following steps:
when the asynchronous process is started, acquiring a corresponding first heartbeat value;
before receiving a current asynchronous task from a target task queue, judging whether a preset corresponding relation exists between a second heartbeat value corresponding to the current asynchronous task and the first heartbeat value; the target task queue is a task queue corresponding to the asynchronous process;
if yes, receiving and executing the current asynchronous task from the target task queue;
if not, the process is exited.
Optionally, the obtaining the corresponding first heartbeat value includes:
taking the received updated heartbeat value as the first heartbeat value;
and updating a second heartbeat value corresponding to the asynchronous task in the target task queue according to the updated heartbeat value.
Optionally, before the step of taking the received updated heartbeat value as the first heartbeat value, the step of further includes:
judging whether the updated heartbeat value is received or not;
if yes, executing the step of taking the received updated heartbeat value as the first heartbeat value;
and if not, taking a second heartbeat value corresponding to the asynchronous task in the target task queue as the first heartbeat value.
Optionally, before determining whether a preset corresponding relationship exists between the second heartbeat value corresponding to the current asynchronous task and the first heartbeat value, the method further includes:
acquiring a second heartbeat value corresponding to the current asynchronous task according to the task label of the current asynchronous task; the task tags are of task types, and the task tags of all asynchronous tasks in the target task queue are the same.
Optionally, the obtaining a second heartbeat value corresponding to the current asynchronous task according to the task label of the current asynchronous task includes:
acquiring a task label of the target task queue; wherein, the task label of the current asynchronous task is the task label of the target task queue;
and acquiring a heartbeat value corresponding to the task label of the target task queue stored in a database according to the task label of the target task queue, and taking the heartbeat value corresponding to the task label of the target task queue as the task label of the current asynchronous task.
Optionally, the determining whether a preset corresponding relationship exists between a second heartbeat value corresponding to the current asynchronous task and the first heartbeat value includes:
judging whether a second heartbeat value corresponding to the current asynchronous task is equal to the first heartbeat value or not;
if yes, executing the step of receiving and executing the current asynchronous task from the target task queue;
if not, executing the step of exiting the process.
Optionally, the method further includes:
and when the asynchronous process is upgraded by the upgrading process, inserting a preset number of empty tasks into the head of the target task queue, and updating a second heartbeat value corresponding to the asynchronous task in the target task queue, so that the second heartbeat value corresponding to the asynchronous task in the target task queue is not equal to the first heartbeat value.
The invention also provides an asynchronous process ending device of the cloud platform, which comprises the following steps:
the acquisition module is used for acquiring a corresponding first heartbeat value when the asynchronous process is started;
the judging module is used for judging whether a preset corresponding relation exists between a second heartbeat value corresponding to the current asynchronous task and the first heartbeat value before the current asynchronous task is received from the target task queue; the target task queue is a task queue corresponding to the asynchronous process;
the receiving module is used for receiving and executing the current asynchronous task from the target task queue if the preset corresponding relation exists;
and the automatic ending module is used for exiting the process if the preset corresponding relation does not exist.
The invention also provides a cloud platform server, comprising:
a memory for storing a computer program;
a processor configured to implement the steps of the asynchronous process termination method of the cloud platform according to any one of the above when executing the computer program.
The present invention also provides a computer readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the asynchronous process ending method of the cloud platform as set forth in any one of the above.
The invention provides an asynchronous process ending method of a cloud platform, which comprises the following steps: when the asynchronous process is started, acquiring a corresponding first heartbeat value; before receiving the current asynchronous task from the target task queue, judging whether a preset corresponding relation exists between a second heartbeat value and a first heartbeat value corresponding to the current asynchronous task; the target task queue is a task queue corresponding to the asynchronous process; if yes, receiving and executing the current asynchronous task from the target task queue; if not, exiting the process;
therefore, the invention can automatically quit and finish the asynchronous process by utilizing the comparison of the heartbeat values through the setting of the heartbeat values corresponding to the asynchronous task and the asynchronous process, thereby simply and conveniently finishing the asynchronous process by adjusting the heartbeat values corresponding to the asynchronous task or the asynchronous process, avoiding the uncertainty of the existing mode for finishing the asynchronous process, reducing the time occupied by the finishing process of the asynchronous process, avoiding the condition of task processing interruption and further enabling the asynchronous process to be smoothly upgraded. In addition, the invention also provides an asynchronous process ending device of the cloud platform, a cloud platform server and a computer readable storage medium, and the device and the server also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of an asynchronous process ending method of a cloud platform according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another method for ending an asynchronous process of a cloud platform according to an embodiment of the present invention;
fig. 3 is a block diagram of an asynchronous process termination apparatus of a cloud platform according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating an asynchronous process ending method of a cloud platform according to an embodiment of the present invention. The method can comprise the following steps:
step 101: and when the asynchronous process is started, acquiring a corresponding first heartbeat value.
The first heartbeat value in this step may be a heartbeat value of an asynchronous process.
It will be appreciated that the purpose of this step may be that the asynchronous process may obtain its corresponding heartbeat value (first heartbeat value) when the processor executes the code of the asynchronous process to cause the asynchronous process to start. That is, when each asynchronous process starts, a corresponding first heartbeat value may be obtained.
Specifically, the specific manner of acquiring the corresponding first heartbeat value when the asynchronous process is started in this step may be set by a designer according to a practical scenario and a user requirement, for example, the asynchronous process may directly receive heartbeat values transmitted by other processes when being started and serve as the first heartbeat value corresponding to the asynchronous process itself, that is, the asynchronous process may only have one starting manner, and each asynchronous process receives heartbeat values transmitted by other processes when being started and serves as the first heartbeat value corresponding to the asynchronous process. When the asynchronous process is started, a second heartbeat value corresponding to an asynchronous task of the same task type to be processed can be directly obtained and is used as a first heartbeat value corresponding to the asynchronous process, namely, the second heartbeat value corresponding to the asynchronous task in a task queue (target task queue) corresponding to the asynchronous process is used as the first heartbeat value corresponding to the asynchronous process; for example, when an asynchronous process includes a task tag corresponding to a task type of an asynchronous task to be processed, the asynchronous task may obtain a heartbeat value corresponding to the task tag from a database (e.g., a Redis database), that is, a second heartbeat value corresponding to the asynchronous task of the task tag; that is, the asynchronous processes may only have one starting manner, and each asynchronous process acquires the heartbeat value corresponding to its task tag when starting, and uses the heartbeat value as its corresponding first heartbeat value. When the asynchronous process is started, whether an incoming heartbeat value is received can be judged; if yes, the heartbeat value is used as a first heartbeat value corresponding to the heartbeat value; if not, acquiring a second heartbeat value corresponding to the asynchronous task of the same task type to be processed, and taking the second heartbeat value as a first heartbeat value corresponding to the second heartbeat value; i.e. an asynchronous process may have only two ways of starting. The present embodiment does not set any limit to this.
Correspondingly, in order to conveniently upgrade the asynchronous process, the old asynchronous process is ended, and after the asynchronous process receives the incoming heartbeat value when starting, not only can the heartbeat value be used as the heartbeat value corresponding to the heartbeat value, but also the second heartbeat value corresponding to the asynchronous task in the target task queue can be updated by using the heartbeat value, for example, the heartbeat value corresponding to the task label of the asynchronous task stored in the database is updated, so that when the processor executes the updating process to perform asynchronous process updating, the processor can update the updated heart rate by transmitting a new heart rate value (updating heart rate value) to the asynchronous process when the updated new asynchronous process is started, when the new heartbeat value does not have a preset correspondence with the first heartbeat value corresponding to the old asynchronous process, and updating the second heartbeat value corresponding to the asynchronous task in the target task queue by using the asynchronous process so that the old asynchronous processes can be respectively and automatically ended.
Furthermore, when the asynchronous process has two starting modes and is upgraded, the updating process can only transmit the updating heartbeat value without the preset corresponding relation with the first heartbeat value corresponding to the old asynchronous process when the upgraded first asynchronous process is started, so that the old asynchronous process is automatically ended and the asynchronous process is upgraded; when the subsequent asynchronous process is started, the updated heartbeat value is not transmitted any more, and the subsequent asynchronous process acquires a second heartbeat value corresponding to the asynchronous task of the same task type to be processed, for example, the task tag of the subsequent asynchronous process is used for automatically acquiring the first heartbeat value corresponding to the asynchronous task, so that the concurrent processing capacity of the cloud platform is increased.
It should be noted that, in this step, after the asynchronous process acquires the corresponding first heartbeat value, the first heartbeat value may be stored in the variable of the asynchronous process, and as long as the first heartbeat value can be subsequently used for comparison with the second heartbeat value corresponding to the current asynchronous task, no limitation is imposed on the storage location of the first heartbeat value in this embodiment.
Step 102: before receiving the current asynchronous task from the target task queue, judging whether a preset corresponding relation exists between a second heartbeat value and a first heartbeat value corresponding to the current asynchronous task; if yes, go to step 103; if not, go to step 104.
The target task queue is a task queue corresponding to the asynchronous process, namely a task queue where the asynchronous task needs to be processed by the asynchronous process is located. That is, since the asynchronous process can process a class of asynchronous tasks having the same or similar input/output and processing logic, the task types of all the asynchronous tasks in the target task queue in this step may be the same, i.e., the target task queues of a plurality of asynchronous processes processing the same task type are the same.
Specifically, the current asynchronous task in this step may be an asynchronous task that the asynchronous process in the target task queue currently needs to receive and execute under normal conditions. The second heartbeat value in this step may be a heartbeat value of an asynchronous task, and the specific settings of the first heartbeat value and the second heartbeat value in this step may be set by a designer, such as a numerical value, or a character string, as long as the first heartbeat value and the second heartbeat value can be compared with a preset corresponding relationship, which is not limited in this embodiment.
Correspondingly, the preset corresponding relation in the step can be set by a designer, and if the first heartbeat value and the second heartbeat value are numerical values, the preset corresponding relation can be equal, namely, the step can judge whether the second heartbeat value corresponding to the current asynchronous task is equal to the first heartbeat value; when the first heartbeat value is a numerical value and the second heartbeat value is a numerical range, the preset corresponding relationship can also be an inclusion relationship, that is, the step can judge whether the second heartbeat value corresponding to the current asynchronous task contains the first heartbeat value. The present embodiment does not set any limit to this.
It can be understood that, in this embodiment, before determining whether a preset correspondence exists between a second heartbeat value corresponding to the current asynchronous task and a first heartbeat value, the asynchronous process may further include a step of obtaining the second heartbeat value corresponding to the current asynchronous task, and for example, when each asynchronous task includes a heartbeat value (second heartbeat value) corresponding to each asynchronous task, the asynchronous process may directly extract the heartbeat value corresponding to the asynchronous task from the current asynchronous task; when each asynchronous task contains a task label corresponding to the asynchronous task, the asynchronous task can find the heartbeat value corresponding to the task label according to the task label corresponding to the current asynchronous task, namely the second heartbeat value corresponding to the current asynchronous task; when each task queue contains a corresponding task label, that is, the corresponding task label of the asynchronous task in the task queue is the task label corresponding to the task queue, the asynchronous process can obtain the task label of the target task queue and then search for the heartbeat value corresponding to the task label, that is, the second heartbeat value corresponding to the current asynchronous task. For example, when different heartbeat values corresponding to different task tags are stored in a database (e.g., a Redis database), the asynchronous task may obtain, according to the task tag of the target task queue, a heartbeat value corresponding to the task tag from the database, that is, a second heartbeat value corresponding to the current asynchronous task.
Correspondingly, when the task label of the current asynchronous task is the task label of the target task queue where the current asynchronous task is, the second heartbeat values corresponding to all the asynchronous tasks in the target task queue can be the same, if the asynchronous process does not execute the asynchronous task after being started, whether a preset corresponding relation exists between the first heartbeat value and the second heartbeat value corresponding to the current asynchronous task can be judged when the asynchronous task needs to be executed; after the asynchronous task (i.e., the previous asynchronous task) is executed and completed, the asynchronous process may determine whether a preset correspondence exists between the second heartbeat value and the first heartbeat value corresponding to the current asynchronous task. The task labels of the asynchronous processes in the target task queue are the same, after the last asynchronous task is executed, the result of obtaining the second heartbeat value corresponding to the current asynchronous task is the same as the result of obtaining the second heartbeat value corresponding to the last asynchronous task, namely, after the last asynchronous task is executed, the step of judging whether the preset corresponding relationship exists between the second heartbeat value corresponding to the current asynchronous task and the first heartbeat value can also be used for judging whether the preset corresponding relationship exists between the second heartbeat value corresponding to the last asynchronous task and the first heartbeat value after the last asynchronous task is executed.
The task tag may be a tag for identifying an asynchronous task of a task type, and asynchronous tasks of the same task type may have the same or similar input, output and processing logic. The specific setting of the task tag can be set by a designer according to the processing logic of the asynchronous task, for example, the task tag can be specifically a character string.
Step 103: the current asynchronous task is received from the target task queue and executed.
It can be understood that, in this step, the asynchronous process may receive the current asynchronous task from the target task queue and perform execution processing on the current asynchronous task when it is determined that a preset correspondence exists between the second heartbeat value and the first heartbeat value corresponding to the current asynchronous task, that is, the asynchronous process does not need to be finished, so that after the current asynchronous task is processed, the next asynchronous task to be performed in the target asynchronous queue is taken as the current asynchronous task, and the process returns to step 102.
Step 104: and exiting the process.
It can be understood that, in this step, the asynchronous process may exit the process when it is determined that there is no preset correspondence between the second heartbeat value and the first heartbeat value corresponding to the current asynchronous task, that is, the asynchronous process needs to be ended, so as to automatically end the asynchronous process.
It should be noted that, in this embodiment, if the processor needs to end the asynchronous process, it may only need to adjust a first heartbeat value corresponding to the asynchronous process that needs to be ended or a second heartbeat value corresponding to the asynchronous task that is processed by the asynchronous process that needs to be ended, so that there is no preset corresponding relationship between the adjusted first heartbeat value corresponding to the asynchronous process that needs to be ended and the adjusted second heartbeat value corresponding to the asynchronous task that is processed by the asynchronous process, and the asynchronous process that needs to be ended automatically exits from the end.
As shown in fig. 2, when the code of the asynchronous process needs to be upgraded, the update process may transmit an update heartbeat value different from a heartbeat value (a first heartbeat value) corresponding to the old asynchronous process to a new upgraded asynchronous process (worker) when the new upgraded asynchronous process (worker) is started, so that the new asynchronous process may update a heartbeat value corresponding to a task tag, that is, a heartbeat value (a second heartbeat value) corresponding to an asynchronous task in the target task queue, so that the old asynchronous process may automatically quit and end after the asynchronous task in the target task queue is executed and completed because the heartbeat value corresponding to the old asynchronous process is not equal to the heartbeat value corresponding to a next asynchronous task; therefore, the upgrading of the asynchronous process can be carried out at any time without considering the current load operation condition, the upgrading efficiency is greatly improved, the upgrading side effect is reduced, and the smooth and stable upgrading is realized. That is, as shown in fig. 2, the update process may update the second heartbeat value corresponding to the asynchronous task processed by the asynchronous process that needs to be ended by transmitting the update heartbeat value to the new asynchronous process after the first upgrade is started.
Correspondingly, the updating process can not transmit the updated heartbeat value when a second and later updated new asynchronous process (worker) is started, so that the new asynchronous process automatically takes the updated heartbeat value of the asynchronous task in the target task queue as the heartbeat value corresponding to the new asynchronous process.
Further, as shown in fig. 2, when the code of the asynchronous process needs to be updated, the update process may also insert a preset number of empty tasks at the head of the target task queue, so as to avoid the problem that the old asynchronous task is difficult to be quickly and automatically exited and ended when no asynchronous task exists in the target task queue, thereby quickly cleaning the old asynchronous process. The null task may be a special task that the asynchronous process does not need to execute, that is, the asynchronous task may directly compare the heartbeat value corresponding to the next asynchronous task after the null task with the heartbeat value corresponding to the asynchronous task when receiving the null task.
It should be noted that, in this embodiment, each asynchronous process may respectively correspond to one heartbeat value (a first heartbeat value), and each asynchronous task may correspond to one heartbeat value (a second heartbeat value) according to a respective task type, for example, the heartbeat value corresponding to the task tag of each asynchronous task. The heartbeat value of each asynchronous process can be stored in a variable of the process, and the heartbeat value of each type of asynchronous task can be stored in a database. The present embodiment is illustrated by taking an automatic exit termination of an asynchronous process executing a type of asynchronous task (an asynchronous task of a task type) as an example, and the automatic exit termination method for other asynchronous processes executing the type of asynchronous task and other asynchronous processes executing other types of asynchronous tasks may be implemented in a manner the same as or similar to that provided in the present embodiment, which is not limited in this embodiment.
In the embodiment of the invention, the asynchronous process can automatically quit and finish by utilizing the comparison of the heartbeat values through the setting of the heartbeat values corresponding to the asynchronous task and the asynchronous process, so that the asynchronous process can be finished simply and conveniently by adjusting the heartbeat values corresponding to the asynchronous task or the asynchronous process, the uncertainty of the conventional asynchronous process finishing mode is avoided, the time occupied by the asynchronous process finishing process is reduced, the task processing interruption condition is avoided, and the asynchronous process can be further smoothly upgraded.
Referring to fig. 3, fig. 3 is a block diagram illustrating an asynchronous process termination apparatus of a cloud platform according to an embodiment of the present invention. The apparatus may include:
the acquiring module 10 is configured to acquire a corresponding first heartbeat value when the asynchronous process is started;
the judging module 20 is configured to judge whether a preset corresponding relationship exists between a second heartbeat value and a first heartbeat value corresponding to the current asynchronous task before receiving the current asynchronous task from the target task queue; the target task queue is a task queue corresponding to the asynchronous process;
a receiving module 30, configured to receive and execute a current asynchronous task from a target task queue if a preset correspondence exists;
and an automatic ending module 40, configured to exit ending if there is no preset corresponding relationship.
In the embodiment of the invention, the asynchronous process can automatically quit and finish by utilizing the comparison of the heartbeat values through the setting of the heartbeat values corresponding to the asynchronous task and the asynchronous process, so that the asynchronous process can be finished simply and conveniently by adjusting the heartbeat values corresponding to the asynchronous task or the asynchronous process, the uncertainty of the conventional asynchronous process finishing mode is avoided, the time occupied by the asynchronous process finishing process is reduced, the task processing interruption condition is avoided, and the asynchronous process can be further smoothly upgraded.
An embodiment of the present invention further provides a cloud platform server, including:
a memory for storing a computer program;
a processor, configured to implement the steps of the asynchronous process ending method of the cloud platform provided in the foregoing embodiment when executing the computer program.
The memory in this embodiment includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory may be an internal storage unit of the cloud platform server (i.e., the server of the cloud platform system), such as a hard disk of the server, in some embodiments. The memory may also be an external storage device of the cloud platform server in other embodiments, such as a plug-in hard disk provided on the server, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory may also include both an internal storage unit and an external storage device of the cloud platform server. The memory can be used for storing application software installed in the cloud platform server and various data, such as: the code of the program that executes the asynchronous process termination method of the cloud platform, and the like, may also be used to temporarily store data that has been output or is to be output.
The processor in this embodiment may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip in some embodiments, and is configured to run program codes stored in a memory or process data, such as codes of a program for executing an asynchronous process termination method of a cloud platform.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the asynchronous process ending method for a cloud platform provided in the foregoing embodiment are implemented.
Wherein the computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device, the cloud platform server and the computer-readable storage medium disclosed by the embodiments correspond to the method disclosed by the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method part.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method and the device for ending the asynchronous process of the cloud platform, the cloud platform server and the computer readable storage medium provided by the invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. An asynchronous process ending method of a cloud platform is characterized by comprising the following steps:
when the asynchronous process is started, acquiring a corresponding first heartbeat value;
before receiving a current asynchronous task from a target task queue, judging whether a preset corresponding relation exists between a second heartbeat value corresponding to the current asynchronous task and the first heartbeat value; the target task queue is a task queue corresponding to the asynchronous process;
if yes, receiving and executing the current asynchronous task from the target task queue;
if not, the process is exited.
2. The method for ending the asynchronous process of the cloud platform according to claim 1, wherein the obtaining the corresponding first heartbeat value comprises:
taking the received updated heartbeat value as the first heartbeat value;
and updating a second heartbeat value corresponding to the asynchronous task in the target task queue according to the updated heartbeat value.
3. The asynchronous process termination method of the cloud platform according to claim 2, wherein before the step of using the received updated heartbeat value as the first heartbeat value, the method further comprises:
judging whether the updated heartbeat value is received or not;
if yes, executing the step of taking the received updated heartbeat value as the first heartbeat value;
and if not, taking a second heartbeat value corresponding to the asynchronous task in the target task queue as the first heartbeat value.
4. The method for ending the asynchronous process of the cloud platform according to claim 1, wherein before determining whether a preset correspondence exists between the second heartbeat value corresponding to the current asynchronous task and the first heartbeat value, the method further comprises:
acquiring a second heartbeat value corresponding to the current asynchronous task according to the task label of the current asynchronous task; the task tags are of task types, and the task tags of all asynchronous tasks in the target task queue are the same.
5. The method for ending the asynchronous process of the cloud platform according to claim 4, wherein the obtaining the second heartbeat value corresponding to the current asynchronous task according to the task tag of the current asynchronous task comprises:
acquiring a task label of the target task queue; wherein, the task label of the current asynchronous task is the task label of the target task queue;
and acquiring a heartbeat value corresponding to the task label of the target task queue stored in a database according to the task label of the target task queue, and taking the heartbeat value corresponding to the task label of the target task queue as the task label of the current asynchronous task.
6. The method for ending the asynchronous process of the cloud platform according to claim 1, wherein the step of judging whether a preset corresponding relationship exists between a second heartbeat value corresponding to the current asynchronous task and the first heartbeat value comprises:
judging whether a second heartbeat value corresponding to the current asynchronous task is equal to the first heartbeat value or not;
if yes, executing the step of receiving and executing the current asynchronous task from the target task queue;
if not, executing the step of exiting the process.
7. The method for ending the asynchronous process of the cloud platform according to claims 1 to 6, further comprising:
and when the asynchronous process is upgraded by the upgrading process, inserting a preset number of empty tasks into the head of the target task queue, and updating a second heartbeat value corresponding to the asynchronous task in the target task queue, so that the second heartbeat value corresponding to the asynchronous task in the target task queue is not equal to the first heartbeat value.
8. An asynchronous process termination apparatus of a cloud platform, comprising:
the acquisition module is used for acquiring a corresponding first heartbeat value when the asynchronous process is started;
the judging module is used for judging whether a preset corresponding relation exists between a second heartbeat value corresponding to the current asynchronous task and the first heartbeat value before the current asynchronous task is received from the target task queue; the target task queue is a task queue corresponding to the asynchronous process;
the receiving module is used for receiving and executing the current asynchronous task from the target task queue if the preset corresponding relation exists;
and the automatic ending module is used for exiting the process if the preset corresponding relation does not exist.
9. A cloud platform server, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the asynchronous process termination method of the cloud platform of any of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of the asynchronous process termination method of a cloud platform of any of claims 1 to 7.
CN201910935658.4A 2019-09-29 2019-09-29 Asynchronous process ending method and device of cloud platform and cloud platform server Active CN110673942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910935658.4A CN110673942B (en) 2019-09-29 2019-09-29 Asynchronous process ending method and device of cloud platform and cloud platform server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910935658.4A CN110673942B (en) 2019-09-29 2019-09-29 Asynchronous process ending method and device of cloud platform and cloud platform server

Publications (2)

Publication Number Publication Date
CN110673942A true CN110673942A (en) 2020-01-10
CN110673942B CN110673942B (en) 2022-06-17

Family

ID=69080460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910935658.4A Active CN110673942B (en) 2019-09-29 2019-09-29 Asynchronous process ending method and device of cloud platform and cloud platform server

Country Status (1)

Country Link
CN (1) CN110673942B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112583664A (en) * 2020-12-08 2021-03-30 广东荣文科技集团有限公司 Data processing method and related device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070250619A1 (en) * 2006-04-24 2007-10-25 Inventec Corporation Real-time heartbeat frequency regulation system and method utilizing user-requested frequency
CN102088470A (en) * 2009-12-07 2011-06-08 中兴通讯股份有限公司 Method and device for deadlock detection and self-recovery of file transfer protocol (FTP) in communication system
US20130182580A1 (en) * 2012-01-13 2013-07-18 Nomura Holdings, Inc. Methods and systems for monitoring multicast availability
CN106209482A (en) * 2016-09-13 2016-12-07 郑州云海信息技术有限公司 A kind of data center monitoring method and system
CN107181780A (en) * 2016-03-10 2017-09-19 阿里巴巴集团控股有限公司 Communication port processing method and system
CN109684058A (en) * 2018-12-18 2019-04-26 成都睿码科技有限责任公司 It is a kind of for multi-tenant can linear expansion efficient crawler platform and its application method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070250619A1 (en) * 2006-04-24 2007-10-25 Inventec Corporation Real-time heartbeat frequency regulation system and method utilizing user-requested frequency
CN102088470A (en) * 2009-12-07 2011-06-08 中兴通讯股份有限公司 Method and device for deadlock detection and self-recovery of file transfer protocol (FTP) in communication system
US20130182580A1 (en) * 2012-01-13 2013-07-18 Nomura Holdings, Inc. Methods and systems for monitoring multicast availability
CN107181780A (en) * 2016-03-10 2017-09-19 阿里巴巴集团控股有限公司 Communication port processing method and system
CN106209482A (en) * 2016-09-13 2016-12-07 郑州云海信息技术有限公司 A kind of data center monitoring method and system
CN109684058A (en) * 2018-12-18 2019-04-26 成都睿码科技有限责任公司 It is a kind of for multi-tenant can linear expansion efficient crawler platform and its application method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
吴天雄,陈兴蜀,罗永刚: "大数据平台下应用程序保护机制的研究与实现", 《信息网络安全》 *
李肖: "机群容错系统的设计与实现", 《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112583664A (en) * 2020-12-08 2021-03-30 广东荣文科技集团有限公司 Data processing method and related device

Also Published As

Publication number Publication date
CN110673942B (en) 2022-06-17

Similar Documents

Publication Publication Date Title
WO2019140656A1 (en) Firmware upgrade method and apparatus, electronic device and control device
CN110691120A (en) Timing task state detection method, server and detection system
WO2017193964A1 (en) Component upgrade method, apparatus and system
CN111858090B (en) Data processing method, system, electronic equipment and storage medium
CN110673942B (en) Asynchronous process ending method and device of cloud platform and cloud platform server
CN106020984B (en) Method and device for creating process in electronic equipment
CN110489242B (en) Distributed data computing method, device, terminal equipment and storage medium
CN115495142A (en) Cloud resource arranging method and device, computer equipment and storage medium
CN111625264B (en) Method, device, equipment and medium for upgrading multi-level management system
CN109445698B (en) Method and device for querying multi-chip flash state and computer readable storage medium
CN110888739B (en) Distributed processing method and device for delayed tasks
CN112698818A (en) Point exchange method and device based on activity page and point exchange system
CN110765125B (en) Method and device for storing data
CN111222972A (en) Account checking and clearing method and device
CN113342512B (en) IO task silencing and driving method and device and related equipment
CN112463348B (en) Timed task processing method and device
CN111459406B (en) Method and system for identifying NVME hard disk under storage unloading card
CN112084014A (en) Data processing method, device, equipment and medium
CN114153429A (en) Webpage page adjusting method and device
CN111196534A (en) Elevator stopping layer optimization method and system
CN112069258A (en) Management method and device of transaction progress and distributed database
CN109445829A (en) A kind of product software programme upgrade method, apparatus and system
CN113127479A (en) Method and device for loading Elasticissearch index, computer equipment and storage medium
CN114788294A (en) Content pushing method, device, server and storage medium
CN107967181B (en) Method and device for controlling critical section

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant