CN114020310A - Task processing method, device, equipment and medium - Google Patents

Task processing method, device, equipment and medium Download PDF

Info

Publication number
CN114020310A
CN114020310A CN202111327369.XA CN202111327369A CN114020310A CN 114020310 A CN114020310 A CN 114020310A CN 202111327369 A CN202111327369 A CN 202111327369A CN 114020310 A CN114020310 A CN 114020310A
Authority
CN
China
Prior art keywords
task
cluster
message
trigger
service
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
CN202111327369.XA
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.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network 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 Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202111327369.XA priority Critical patent/CN114020310A/en
Publication of CN114020310A publication Critical patent/CN114020310A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the disclosure relates to a task processing method, a device, equipment and a medium, wherein the method comprises the following steps: in response to receiving the upgrade message, analyzing the upgrade message to obtain service parameter information; creating a first cluster under corresponding target service according to service parameter information, wherein the first cluster is a cluster with the latest version in all clusters under the target service; and sending a trigger message to the first cluster according to the trigger time of the task, so that the first cluster executes the task according to the trigger message. By adopting the technical scheme, the problem of failure of the task being executed during upgrading is solved, the task execution failure caused by upgrading is avoided, and the reliability of task execution is improved.

Description

Task processing method, device, equipment and medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method, an apparatus, a device, and a medium for task processing.
Background
In a business scenario, there is a need to periodically perform a specified operation, and therefore, a timing task is generally set for an operation that needs to be periodically performed, and the operation is periodically performed in accordance with the timing task. As the timing tasks are widely used, upgrading the timing tasks is of great importance.
In the related art, the scheduling of the timing task is realized through a platform, the timing task is scheduled to an execution side for execution, and when the timing task which is being executed exists on the execution side, if the timing task is upgraded, the timing task which is being executed fails.
Disclosure of Invention
To solve the technical problems described above or at least partially solve the technical problems, the present disclosure provides a task processing method, apparatus, device, and medium.
The embodiment of the disclosure provides a task processing method, which comprises the following steps:
in response to receiving an upgrade message, analyzing the upgrade message to obtain service parameter information;
creating a first cluster under a corresponding target service according to the service parameter information, wherein the first cluster is a cluster with the latest version in all clusters under the target service;
and sending a trigger message to the first cluster according to the trigger time of the task, so that the first cluster executes the task according to the trigger message.
The embodiment of the disclosure provides another task processing method, which includes:
creating a first cluster, wherein the first cluster is a cluster with the latest version in all clusters;
receiving a trigger message, wherein the trigger message is sent by the robot service according to the trigger time of the task;
executing the task in the first cluster according to the trigger message.
An embodiment of the present disclosure further provides a task processing device, where the task processing device includes:
the analysis module is used for responding to the received upgrading message and analyzing the upgrading message to acquire service parameter information;
the upgrading module is used for creating a first cluster under the corresponding target service according to the service parameter information, wherein the first cluster is a cluster with the latest version in all clusters under the target service;
and the triggering module is used for sending a triggering message to the first cluster according to the triggering time of the task so that the first cluster executes the task according to the triggering message.
An embodiment of the present disclosure further provides another task processing device, where the device includes:
the system comprises a creating module, a judging module and a judging module, wherein the creating module is used for creating a first cluster, and the first cluster is a cluster with the latest version in all clusters;
the receiving module is used for receiving a trigger message, wherein the trigger message is sent by the robot service according to the trigger time of the task;
and the execution module is used for executing the task in the first cluster according to the trigger message.
An embodiment of the present disclosure further provides an electronic device, which includes: a processor; a memory for storing the processor-executable instructions; the processor is used for reading the executable instructions from the memory and executing the instructions to realize the task processing method provided by the embodiment of the disclosure.
The embodiment of the disclosure also provides a computer readable storage medium, which stores a computer program for executing the task processing method provided by the embodiment of the disclosure.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages: according to the task processing scheme provided by the embodiment of the disclosure, the robot service analyzes the upgrade message to obtain the service parameter information, and creates a first cluster under the corresponding target service according to the service parameter information, wherein the first cluster is a cluster with the latest version in all clusters under the target service, and the robot service sends the trigger message to the first cluster according to the trigger time of the task, so that the first cluster executes the task according to the trigger message. By adopting the technical scheme, the cluster is newly built during the task upgrading, the task which is being executed in the existing cluster can not be terminated during the upgrading, the problem that the task which is being executed fails during the upgrading is solved, the task execution failure caused by the upgrading is avoided, and the reliability of the task execution is improved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1 is a schematic flowchart of a task processing method according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of task scheduling provided by an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another task processing method provided in the embodiment of the present disclosure;
FIG. 4 is a schematic diagram of task monitoring provided by an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of task triggering provided by an embodiment of the present disclosure;
fig. 6 is a schematic flowchart of another task processing method provided in the embodiment of the present disclosure;
FIG. 7 is a schematic diagram of task execution provided by an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a task processing device according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of another task processing device provided in the embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
The embodiment of the present disclosure provides a task processing method, which is described below with reference to specific embodiments.
Fig. 1 is a flowchart illustrating a task processing method according to an embodiment of the present disclosure, where the method may be performed by a task processing apparatus, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in an electronic device. As shown in fig. 1, the method includes:
step 101, in response to receiving the upgrade message, parsing the upgrade message to obtain service parameter information.
The method of the embodiment of the present disclosure may be applied to a robot service, where the robot service may be preset to perform operations related to scheduling, triggering, upgrading, monitoring, and the like of tasks, and the operations include, but are not limited to, receiving an upgrade message, parsing the upgrade message, triggering the task, and the like.
In the embodiment of the present disclosure, the robot service receives an upgrade message, for example, the application platform sends the upgrade message to the robot service, where the upgrade message may be an HTTP (Hyper Text Transfer Protocol) event. And the robot service analyzes the upgrading message to acquire service parameter information, wherein the service parameter information is used for upgrading the task.
And 102, creating a first cluster under the corresponding target service according to the service parameter information.
In the embodiment of the disclosure, the robot service executes the upgrade of the task according to the service parameter information, optionally, determines a target service corresponding to the service parameter information, and creates a first cluster under the target service, where the first cluster is a cluster with the latest version in all clusters under the target service.
In an actual business scenario, a plurality of services may be formed according to the business basic component, and optionally, in a task processing scenario, a corresponding task execution service may be set for each service in the plurality of services. The target service may be any one of a plurality of task execution services, and the target service may include at least one cluster, and each cluster may include at least one instance.
In this embodiment, whether each cluster is the cluster with the latest version may be determined according to the version information of each cluster under the target service. As an example, the number of clusters in the target service is obtained, in a case that only one cluster is included in the target service, the cluster is the cluster with the latest version in all the clusters in the target service, and in a case that a plurality of clusters are included in the target service, a binary file running by each cluster may be obtained, and the binary file may be used to determine whether the cluster is the latest version.
The upgrade process is exemplified below.
As an example, the robot service calls an application programming interface of the code release management module, performs a compiling and packaging operation according to the service parameter information to obtain an object file, where the object file may be generated by compiling and packaging a code warehouse, and calls an application programming interface of the cloud engine module, and creates a first cluster under the object service according to the object file, so that the first cluster runs the object file. In this example, referring to fig. 2, after the robot service parses and acquires the service parameter information, the robot service performs operations such as compiling, packaging, and creating a cluster on a code repository of the target service, and in the process of compiling and packaging, periodically sends a request to the code release management module to train until the compiling and packaging are successful, and in the process of creating a cluster, periodically sends a request to the cloud engine module to train until the cluster is successfully created, where the request sent by the robot service is, for example, an HTTP request. Therefore, the robot service executes operations such as compiling, packaging, cluster building and the like, compared with manual deployment, the method reduces labor burden and saves deployment time of new tasks.
And 103, sending a trigger message to the first cluster according to the trigger time of the task, so that the first cluster executes the task according to the trigger message.
The task in this embodiment may be a timing task, for example, a periodically triggered task, or a task triggered at a specified time. Timing tasks are common in actual development, and functions such as periodic message reminding, automatic cancellation of unpaid orders after 30 minutes of an e-commerce platform, early data aggregation and backup and the like can be achieved through the timing tasks. The robot service sends a trigger message to the first cluster, and the first cluster executes a task according to the trigger message.
The triggering and execution of tasks is exemplified below.
As an example, referring to fig. 2, the robot service acquires parameter information of a task by reading a dynamic configuration center, and creates a scheduler according to the parameter information, wherein the parameter information of the task includes, but is not limited to, a task identifier, address information, and personalized configuration parameters such as a tenant identifier, a user identifier, a full execution or a partial execution. The address information includes, for example, a service identifier, which may be used to determine a corresponding execution service, for example, when the execution service is a target service, the scheduler obtains, through the cluster state management module, a first cluster in which a latest version code is run under the target service, where the first cluster includes at least one instance, the scheduler obtains, through the service discovery module, a designated address of the instance under the first cluster, and periodically sends a trigger message to the designated address according to a trigger time, and after receiving the trigger message, the instance executes a task corresponding to the trigger message.
For example, taking 2 clusters as an example, the target service includes a first cluster, and the robot service sends a trigger message to the first cluster, so that the first cluster executes a task according to the trigger message. And then, the robot service responds to the received upgrading message, a second cluster is created under the target service, and at the moment, the robot service sends a triggering message to the second cluster so that the second cluster executes a task according to the triggering message. And the new cluster II is created, and the new task is scheduled to the new cluster II, so that seamless switching is realized.
According to the task processing scheme provided by the embodiment of the disclosure, the robot service analyzes the upgrade message to obtain the service parameter information, and creates a first cluster under the corresponding target service according to the service parameter information, wherein the first cluster is a cluster with the latest version in all clusters under the target service, and the robot service sends the trigger message to the first cluster according to the trigger time of the task, so that the first cluster executes the task according to the trigger message. By adopting the technical scheme, the cluster is newly built during task upgrading, the task which is being executed in the existing cluster can not be terminated during upgrading, the problem that the task which is being executed fails during upgrading is solved, the task execution failure caused by upgrading is avoided, in addition, the seamless switching can be realized by sending the trigger message to the first cluster, and the reliability of task execution is improved.
Based on the embodiment, the first cluster with the latest version in all the clusters under the target service is created during each upgrading, and then when the task is triggered, the first cluster executes the task according to the trigger message by sending the trigger message to the first cluster, so that the problem of failure of the task being executed during the upgrading of the task is solved, and the reliability of task execution is improved. However, after multiple upgrades, a plurality of clusters of non-latest versions exist in the target service, and since the trigger message is sent to the first cluster when the task is triggered, the clusters of non-latest versions are idle, and therefore, in the embodiment of the present disclosure, the idle clusters of non-latest versions may be deleted to release resources and achieve resource recovery. This is explained below with reference to fig. 3.
Fig. 3 is a schematic flowchart of another task processing method provided in the embodiment of the present disclosure, and as shown in fig. 3, the method includes:
step 301, acquiring task processing state and version information of each cluster in all clusters under the target service.
In this embodiment, the robot service analyzes all clusters under the target service, and obtains task processing state and version information of each cluster.
The task processing state may include a working state and an idle state, and when the tasks in all instances in a certain cluster are completely executed, the task processing state of the cluster is determined to be the idle state, and when any instance in the cluster has a task that is not completely executed, the task processing state of the cluster is determined to be the working state.
The version information of the cluster can be determined according to the binary file operated by the cluster.
Step 302, determine a second cluster from all clusters under the target service.
And the task processing state of the second cluster is an idle state, and the version information of the second cluster is a non-latest version. As an example, the target service includes a first cluster and a second cluster, where the first cluster and the second cluster are both in an idle state, the second cluster is a first cluster of a latest version, and the version information of the first cluster is a non-latest version, and then the first cluster under the target service is determined to be the second cluster.
In some embodiments, the robot service periodically sends a state acquisition request to each cluster in the target service, and each cluster determines state information of a task in execution according to the state acquisition request and returns the state information of the task in the row to the robot service. And the robot service updates the state of the task in execution according to the returned state information, wherein the state information comprises the execution progress of the task, the resource occupation condition of the task and the like. Therefore, the task monitoring is realized, the state of the task can be updated in time, and the timeliness of the state of the task which is being executed in the instance under each cluster is ensured.
Step 303, a delete operation is performed on the second cluster.
In this embodiment, referring to fig. 4, a deletion operation may be performed on a second cluster that is not the latest version and is in an idle state under the target service, so that resources can be released, and resource recovery is achieved.
Based on the above embodiments, a task triggering scheme is explained below.
In one embodiment of the present disclosure, sending a trigger message to a first cluster according to a trigger time of a task includes: acquiring parameter information of a task; locally creating a scheduler corresponding to the task according to the parameter information of the task; based on the scheduler, a hypertext protocol request is sent to the first cluster at a trigger time of the task.
As an example, a local task library may be developed to automatically parse the task's expressions, which may be in the form of strings. And then, according to the analysis result of the expression, a scheduler corresponding to the task is established in the operating system, and the scheduler sends an HTTP request according to the trigger time to realize the triggering of the task.
In one embodiment of the present disclosure, sending a trigger message to a first cluster according to a trigger time of a task includes: generating a trigger message by taking a clock or a hypertext protocol as a trigger source of a task; the trigger message is sent to a message queue such that the message queue sends the trigger message to the first cluster.
In this embodiment, with the trigger platform, a clock or HTTP is used as a trigger source to serialize the parameters into a trigger message, and further, referring to fig. 5, by adding the trigger message to a message queue, the message queue sends the trigger message to a corresponding target service (for example, service one or service two in the figure), and the target service side converts the trigger message into one or more executable subtasks. By designing a light-weight trigger platform, the scheduling precision can be improved, and the requirement of a task trigger scene on the precision is met.
Optionally, in the above embodiment, when the trigger source is HTTP, the trigger source may be directly scheduled to the first cluster for processing.
The task processing scheme provided by the embodiment of the disclosure can improve the scheduling precision of the task, reduce the scheduling delay and start the task in time.
The following describes a task processing method according to an embodiment of the present disclosure with respect to a target service side.
Fig. 6 is a schematic flowchart of another task processing method provided in the embodiment of the present disclosure, and as shown in fig. 6, the method includes:
step 601, a first cluster is created.
The embodiment of the disclosure can be applied to a target service, wherein the first cluster is a cluster with the latest version in all clusters under the target service. Optionally, the target service may include at least one cluster, each cluster may include at least one instance, whether each cluster is a cluster with the latest version may be determined according to the version information of each cluster under the target service, and the version information of each cluster may be determined according to a binary file in which the cluster runs.
Step 602, a trigger message is received.
The robot service sends a triggering message according to the triggering time of the task;
in this embodiment, the robot service sends a trigger message to the first cluster according to the trigger time of the task. For example, the target service includes a first cluster and a second cluster, where the second cluster is created by the robot service under the target service after the robot service responds to the received upgrade message, the second cluster is a first cluster with the latest version in all clusters under the target service, and at this time, the robot service sends a trigger message to the second cluster, so that the second cluster executes a task according to the trigger message.
Step 603, executing the task in the first cluster according to the trigger message.
As an example, the first cluster includes at least one example, when the robot service sends a trigger message of a task, the robot service determines an example of a designated address corresponding to the trigger message and sends the trigger message to the designated address, and the example of the designated address in the first cluster executes the task according to the trigger message. Optionally, the same cluster executes tasks using the same consumption group, avoiding tasks being executed repeatedly.
The task processing method explained in the foregoing embodiment is also applicable to this embodiment, and is not described herein again.
According to the task processing scheme provided by the embodiment of the disclosure, a first cluster is established under a target service, a trigger message is received, and a task is executed in the first cluster according to the trigger message. By adopting the technical scheme, the first cluster is newly established when the task is upgraded, the task which is being executed in the existing cluster can not be terminated when the task is upgraded, the problem that the task which is being executed fails when the task is upgraded is solved, the task execution failure caused by the upgrade is avoided, in addition, the task is executed according to the trigger message through the first cluster, the seamless switching can be realized, and the reliability of the task execution is improved.
Based on the above embodiments, the execution scheme of the task is explained below.
In one embodiment of the present disclosure, performing the task according to the trigger message includes: and acquiring a task concurrency value, wherein the task concurrency value is determined according to the number of the tasks which are executed concurrently currently. And under the condition that the task concurrency value is smaller than the preset threshold value, controlling the task concurrency value to be increased by one, and executing the task concurrently.
In this embodiment, based on the signal synchronization mechanism, multiple tasks may be executed concurrently. As an example, referring to fig. 7, a first cluster acquires a current task concurrency value, where the current task concurrency value is equal to the number of tasks to be executed concurrently, and if the current task concurrency value is smaller than a preset threshold, acquires a trigger message from a message queue, and checks whether a service identifier carried by the trigger message is consistent with a pre-stored identifier. If not, sending ACK (Acknowledgement) information of the service identification inconsistent with the pre-stored identification; if the two tasks are consistent, judging whether a handler corresponding to the task name exists or not, if not, generating a log and giving an alarm, if so, controlling a task concurrency value to increase by one, starting a coroutine, executing the task and sending a corresponding ACK message.
In one embodiment of the present disclosure, referring to fig. 7, performing the task may include: under the condition that the number of tenants corresponding to the task is multiple, converting the task into multiple subtasks according to the number of the tenants; and concurrently executing a plurality of subtasks, and controlling the concurrent value of the tasks to be reduced by one when the completion of the execution of the plurality of subtasks is detected.
In this embodiment, based on a signal synchronization mechanism, a task is divided into a plurality of subtasks according to tenants, and the plurality of subtasks may be executed concurrently, where a tenant may correspond to an enterprise. As an example, referring to fig. 7, determining the number of tenants corresponding to a task, where in the case that the number of the corresponding tenants is one, a single collaborative process executes the task; and under the condition that the number of the corresponding tenants is multiple, converting the task into multiple subtasks, wherein each tenant corresponds to one subtask and executes the multiple subtasks simultaneously. And when the execution of the task single routine is finished or the execution of a plurality of subtasks is finished, controlling the concurrency value of the task to be reduced by one. Optionally, before determining the number of tenants corresponding to the task, it may be determined whether there are executed tasks of the same type, and if so, the task is skipped and the task concurrency value is controlled to be decreased by one.
The task processing scheme provided by the embodiment of the disclosure can concurrently execute a plurality of tasks in the same cluster, so that all tasks can share one service authority, corresponding authority application for each task is not required, operation is simplified, all tasks share one virtualization container, the same binary package file as that used by online service is used, one virtualization container is not required to be maintained for each task, and maintenance cost is saved. In addition, each task can be further divided into a plurality of subtasks according to the tenants to be executed concurrently, and the processing efficiency is further improved.
Fig. 8 is a schematic structural diagram of a task processing device provided in an embodiment of the present disclosure, where the task processing device may be implemented by software and/or hardware, and may be generally integrated in an electronic device for task processing. As shown in fig. 8, the task processing device includes: parsing module 81, upgrading module 82, triggering module 83.
The parsing module 81 is configured to, in response to receiving the upgrade message, parse the upgrade message to obtain the service parameter information.
And the upgrading module 82 is configured to create a first cluster under the corresponding target service according to the service parameter information, where the first cluster is a cluster with the latest version in all clusters under the target service.
And the triggering module 83 is configured to send a triggering message to the first cluster according to the triggering time of the task, so that the first cluster executes the task according to the triggering message.
The task processing device provided by the embodiment of the disclosure can execute the task processing method provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 9 is a schematic structural diagram of another task processing device provided in an embodiment of the present disclosure, where the device may be implemented by software and/or hardware, and may be generally integrated in an electronic device for task processing. As shown in fig. 9, the task processing device includes: a creating module 91, a receiving module 92 and an executing module 93.
A creating module 91, configured to create a first cluster, where the first cluster is a cluster with the latest version among all clusters.
A receiving module 92, configured to receive a trigger message, where the trigger message is sent by the robot service according to a trigger time of the task.
An executing module 93, configured to execute the task in the first cluster according to the trigger message.
The task processing device provided by the embodiment of the disclosure can execute the task processing method provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
In order to implement the above embodiments, the present disclosure also proposes a computer program product comprising a computer program/instructions which, when executed by a processor, implement the task processing method in the above embodiments.
Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Referring now specifically to fig. 10, a schematic diagram of an electronic device 1000 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device 1000 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), and the like, and fixed terminals such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 10, the electronic device 1000 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 1001 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)1002 or a program loaded from a storage means 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the electronic apparatus 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
Generally, the following devices may be connected to the I/O interface 1005: input devices 1006 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 1007 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 1008 including, for example, magnetic tape, hard disk, and the like; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. While fig. 10 illustrates an electronic device 1000 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 1009, or installed from the storage means 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-described functions defined in the task processing method of the embodiment of the present disclosure are performed.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: in response to receiving an upgrade message, analyzing the upgrade message to obtain service parameter information; creating a first cluster under a corresponding target service according to the service parameter information, wherein the first cluster is a cluster with the latest version in all clusters under the target service; and sending a trigger message to the first cluster according to the trigger time of the task, so that the first cluster executes the task according to the trigger message.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
According to one or more embodiments of the present disclosure, there is provided a task processing method including:
in response to receiving an upgrade message, analyzing the upgrade message to obtain service parameter information;
creating a first cluster under a corresponding target service according to the service parameter information, wherein the first cluster is a cluster with the latest version in all clusters under the target service;
and sending a trigger message to the first cluster according to the trigger time of the task, so that the first cluster executes the task according to the trigger message.
According to one or more embodiments of the present disclosure, in a task processing method provided by the present disclosure, the creating a first cluster under a corresponding target service according to the service parameter information includes: calling an application programming interface of a code release management module, and executing compiling and packaging operation according to the service parameter information to acquire a target file; and calling an application programming interface of a cloud engine module, and creating a first cluster under the target service based on the target file.
According to one or more embodiments of the present disclosure, in the task processing method provided by the present disclosure, the method further includes: acquiring task processing state and version information of each cluster in all clusters under the target service; determining a second cluster from all the clusters, wherein the task processing state of the second cluster is an idle state, and the version information of the second cluster is a non-latest version; and executing deletion operation on the second cluster.
According to one or more embodiments of the present disclosure, in the task processing method provided by the present disclosure, the method further includes: periodically sending a state acquisition request to a cluster in the target service so that the cluster returns state information of the task in execution according to the state acquisition request; and updating the state of the task in execution according to the returned state information.
According to one or more embodiments of the present disclosure, in the task processing method provided by the present disclosure, the sending a trigger message to the first cluster according to the trigger time of the task includes: acquiring parameter information of the task; locally creating a scheduler corresponding to the task according to the parameter information of the task; based on the scheduler, sending a hypertext protocol request to the first cluster at the trigger time of the task.
According to one or more embodiments of the present disclosure, in the task processing method provided by the present disclosure, the sending a trigger message to the first cluster according to the trigger time of the task includes: generating the trigger message by taking a clock or a hypertext protocol as a trigger source of the task; sending the trigger message to a message queue, so that the message queue sends the trigger message to the first cluster.
According to one or more embodiments of the present disclosure, there is provided a task processing method including:
creating a first cluster, wherein the first cluster is a cluster with the latest version in all clusters;
receiving a trigger message, wherein the trigger message is sent by the robot service according to the trigger time of the task;
executing the task in the first cluster according to the trigger message.
According to one or more embodiments of the present disclosure, in a task processing method provided by the present disclosure, the executing the task according to the trigger message includes: acquiring a task concurrency value, wherein the task concurrency value is determined according to the number of tasks which are executed concurrently; and controlling the task concurrency value to be increased by one and executing the task concurrently under the condition that the task concurrency value is smaller than a preset threshold value.
According to one or more embodiments of the present disclosure, in a task processing method provided by the present disclosure, the executing the task includes: under the condition that the number of tenants corresponding to the task is multiple, converting the task into multiple subtasks according to the number of the tenants; concurrently executing the plurality of subtasks; and when the plurality of subtasks are detected to be completely executed, controlling the concurrency value of the tasks to be reduced by one.
According to one or more embodiments of the present disclosure, there is provided a task processing apparatus including:
the analysis module is used for responding to the received upgrading message and analyzing the upgrading message to acquire service parameter information;
the upgrading module is used for creating a first cluster under the corresponding target service according to the service parameter information, wherein the first cluster is a cluster with the latest version in all clusters under the target service;
and the triggering module is used for sending a triggering message to the first cluster according to the triggering time of the task so that the first cluster executes the task according to the triggering message.
According to one or more embodiments of the present disclosure, in a task processing device provided by the present disclosure, an upgrade module is specifically configured to: calling an application programming interface of the code release management module, and executing compiling and packaging operation according to the service parameter information to acquire a target file; and calling an application programming interface of the cloud engine module, and creating a first cluster under the target service according to the target file.
According to one or more embodiments of the present disclosure, in a task processing device provided by the present disclosure, the task processing device further includes: the resource recovery module is used for acquiring the task processing state and version information of each cluster in all the clusters under the target service; determining a second cluster from all the clusters, wherein the task processing state of the second cluster is an idle state, and the version information of the second cluster is a non-latest version; and executing deletion operation on the second cluster.
According to one or more embodiments of the present disclosure, in a task processing device provided by the present disclosure, the task processing device further includes: the state updating module is used for periodically sending a state acquisition request to the cluster in the target service so as to enable the cluster to return state information of the task in execution according to the state acquisition request; and updating the state of the task in execution according to the returned state information.
According to one or more embodiments of the present disclosure, in a task processing device provided by the present disclosure, a trigger module is specifically configured to: acquiring parameter information of the task; locally creating a scheduler corresponding to the task according to the parameter information of the task; based on the scheduler, sending a hypertext protocol request to the first cluster at the trigger time of the task.
According to one or more embodiments of the present disclosure, in a task processing device provided by the present disclosure, a trigger module is specifically configured to: generating the trigger message by taking a clock or a hypertext protocol as a trigger source of the task; sending the trigger message to a message queue, so that the message queue sends the trigger message to the first cluster.
According to one or more embodiments of the present disclosure, there is provided a task processing apparatus including:
the system comprises a creating module, a judging module and a judging module, wherein the creating module is used for creating a first cluster, and the first cluster is a cluster with the latest version in all clusters;
the receiving module is used for receiving a trigger message, wherein the trigger message is sent by the robot service according to the trigger time of the task;
and the execution module is used for executing the task in the first cluster according to the trigger message.
According to one or more embodiments of the present disclosure, in a task processing device provided by the present disclosure, an execution module is specifically configured to: acquiring a task concurrency value, wherein the task concurrency value is determined according to the number of tasks which are executed concurrently; and controlling the task concurrency value to be increased by one and executing the task concurrently under the condition that the task concurrency value is smaller than a preset threshold value.
According to one or more embodiments of the present disclosure, in a task processing device provided by the present disclosure, an execution module is specifically configured to: under the condition that the number of tenants corresponding to the task is multiple, converting the task into multiple subtasks according to the number of the tenants; concurrently executing the plurality of subtasks; and when the execution of the plurality of subtasks is detected to be completed, controlling the task concurrency value to be reduced by one.
In accordance with one or more embodiments of the present disclosure, there is provided an electronic device including: a processor; a memory for storing the processor-executable instructions; the processor is used for reading the executable instructions from the memory and executing the instructions to realize any task processing method provided by the disclosure.
According to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing any of the task processing methods provided by the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units. The modifications referred to in this disclosure as "a", "an", and "the" are illustrative and not restrictive, and it will be understood by those skilled in the art that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.

Claims (14)

1. A task processing method, comprising the steps of:
in response to receiving an upgrade message, analyzing the upgrade message to obtain service parameter information;
creating a first cluster under a corresponding target service according to the service parameter information, wherein the first cluster is a cluster with the latest version in all clusters under the target service;
and sending a trigger message to the first cluster according to the trigger time of the task, so that the first cluster executes the task according to the trigger message.
2. The method of claim 1, wherein the creating a first cluster under a corresponding target service according to the service parameter information comprises:
calling an application programming interface of a code release management module, executing compiling and packaging operation according to the service parameter information, and acquiring a target file;
and calling an application programming interface of a cloud engine module, and creating a first cluster under the target service according to the target file.
3. The method of claim 1, further comprising:
acquiring task processing state and version information of each cluster in all clusters under the target service;
determining a second cluster from all the clusters, wherein the task processing state of the second cluster is an idle state, and the version information of the second cluster is a non-latest version;
and executing deletion operation on the second cluster.
4. The method of claim 1, further comprising:
periodically sending a state acquisition request to a cluster in the target service so that the cluster returns state information of the task in execution according to the state acquisition request;
and updating the state of the task in execution according to the returned state information.
5. The method of claim 1, wherein the sending a trigger message to the first cluster according to a trigger time of a task comprises:
acquiring parameter information of the task;
locally creating a scheduler corresponding to the task according to the parameter information of the task;
based on the scheduler, sending a hypertext protocol request to the first cluster at the trigger time of the task.
6. The method of claim 1, wherein the sending a trigger message to the first cluster according to a trigger time of a task comprises:
generating the trigger message by taking a clock or a hypertext protocol as a trigger source of the task;
sending the trigger message to a message queue, so that the message queue sends the trigger message to the first cluster.
7. A task processing method, comprising:
creating a first cluster, wherein the first cluster is a cluster with the latest version in all clusters;
receiving a trigger message, wherein the trigger message is sent by the robot service according to the trigger time of the task;
executing the task in the first cluster according to the trigger message.
8. The method of claim 7, wherein the performing the task according to the trigger message comprises:
acquiring a task concurrency value, wherein the task concurrency value is determined according to the number of tasks which are executed concurrently;
and controlling the task concurrency value to be increased by one and executing the task concurrently under the condition that the task concurrency value is smaller than a preset threshold value.
9. The method of claim 8, wherein the performing the task comprises:
under the condition that the number of tenants corresponding to the task is multiple, converting the task into multiple subtasks according to the number of the tenants;
concurrently executing the plurality of subtasks;
and when the execution of the plurality of subtasks is detected to be completed, controlling the task concurrency value to be reduced by one.
10. A task processing apparatus, comprising:
the analysis module is used for responding to the received upgrading message and analyzing the upgrading message to acquire service parameter information;
the upgrading module is used for creating a first cluster under the corresponding target service according to the service parameter information, wherein the first cluster is a cluster with the latest version in all clusters under the target service;
and the triggering module is used for sending a triggering message to the first cluster according to the triggering time of the task so that the first cluster executes the task according to the triggering message.
11. A task processing apparatus, comprising:
the system comprises a creating module, a judging module and a judging module, wherein the creating module is used for creating a first cluster, and the first cluster is a cluster with the latest version in all clusters;
the receiving module is used for receiving a trigger message, wherein the trigger message is sent by the robot service according to the trigger time of the task;
and the execution module is used for executing the task in the first cluster according to the trigger message.
12. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the task processing method according to any one of claims 1 to 6 or implement the task processing method according to any one of claims 7 to 9.
13. A computer-readable storage medium, characterized in that the storage medium stores a computer program for executing the task processing method of any of the above claims 1-6 or implementing the task processing method of any of the above claims 7-9.
14. A computer program product, characterized in that the computer program product comprises a computer program/instructions which, when executed by a processor, implements a task processing method according to any one of claims 1-6 or implements a task processing method according to any one of the preceding claims 7-9.
CN202111327369.XA 2021-11-10 2021-11-10 Task processing method, device, equipment and medium Pending CN114020310A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111327369.XA CN114020310A (en) 2021-11-10 2021-11-10 Task processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111327369.XA CN114020310A (en) 2021-11-10 2021-11-10 Task processing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114020310A true CN114020310A (en) 2022-02-08

Family

ID=80063138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111327369.XA Pending CN114020310A (en) 2021-11-10 2021-11-10 Task processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114020310A (en)

Similar Documents

Publication Publication Date Title
CN109523187B (en) Task scheduling method, device and equipment
CN109582310B (en) Data processing method and device, electronic equipment and computer readable storage medium
CN111309747A (en) Data synchronization method, system and device
CN112015816A (en) Data synchronization method, device, medium and electronic equipment
CN113553178A (en) Task processing method and device and electronic equipment
CN112596720A (en) Service operation method and device, electronic equipment and computer storage medium
CN110781373A (en) List updating method and device, readable medium and electronic equipment
CN110795446A (en) List updating method and device, readable medium and electronic equipment
CN111338944A (en) Remote Procedure Call (RPC) interface test method, device, medium and equipment
CN114595065A (en) Data acquisition method and device, storage medium and electronic equipment
CN111338666A (en) Method, device, medium and electronic equipment for realizing application program upgrading
CN110928715A (en) Method, device, medium and electronic equipment for prompting error description information
CN109683992B (en) Method and apparatus for managing objects
CN109218338B (en) Information processing system, method and device
CN112083945A (en) NPM installation package update prompting method and device, electronic equipment and storage medium
CN116821187A (en) Database-based data processing method and device, medium and electronic equipment
CN115167874B (en) Automatic driving software mirror image deployment method and device, electronic equipment and readable medium
CN116302271A (en) Page display method and device and electronic equipment
CN112422648B (en) Data synchronization method and system
CN115134254A (en) Network simulation method, device, equipment and storage medium
CN114020310A (en) Task processing method, device, equipment and medium
CN113961330A (en) Distributed timing task execution method, device, equipment and computer readable medium
CN111324386A (en) Method and device for starting personal application program, electronic equipment and storage medium
CN111309367A (en) Method, device, medium and electronic equipment for managing service discovery
US20240152504A1 (en) Data interaction method, apparatus, and electronic device

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