CN114827278B - Task scheduling method, system, device and equipment based on message queue - Google Patents

Task scheduling method, system, device and equipment based on message queue Download PDF

Info

Publication number
CN114827278B
CN114827278B CN202210721974.3A CN202210721974A CN114827278B CN 114827278 B CN114827278 B CN 114827278B CN 202210721974 A CN202210721974 A CN 202210721974A CN 114827278 B CN114827278 B CN 114827278B
Authority
CN
China
Prior art keywords
message
task
semi
middleware server
information
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.)
Active
Application number
CN202210721974.3A
Other languages
Chinese (zh)
Other versions
CN114827278A (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.)
Xiaomi Automobile Technology Co Ltd
Original Assignee
Xiaomi Automobile 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 Xiaomi Automobile Technology Co Ltd filed Critical Xiaomi Automobile Technology Co Ltd
Priority to CN202210721974.3A priority Critical patent/CN114827278B/en
Publication of CN114827278A publication Critical patent/CN114827278A/en
Application granted granted Critical
Publication of CN114827278B publication Critical patent/CN114827278B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The disclosure relates to a task scheduling method, system, device and equipment based on a message queue, wherein the method is applied to a client and comprises the following steps: sending a semi-transaction message to a message middleware server; the message middleware server adds the semi-transaction message into a semi-message queue and returns the message identification information of the semi-transaction message; receiving message identification information sent by a message middleware server; storing task information corresponding to the semi-transaction message and message identification information of the semi-transaction message to a database; reading stored task information from a database, and screening the read task information according to the message identification information to obtain a task to be scheduled; and adding the task to be scheduled into a message queue in the message middleware server based on the message backcheck of the message middleware server so as to enable a message subscriber to consume the task to be scheduled. Through the technical scheme disclosed by the invention, the burden of the server can be reduced, and the task submission speed is accelerated.

Description

Task scheduling method, system, device and equipment based on message queue
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method, a system, an apparatus, and a device for task scheduling based on a message queue.
Background
In the related technology, a client reads data and submits tasks to a Kubernets cluster, which is one of basic solutions based on Kubernets products, but when the client and a server are both based on a database and used as task middleware, the task submitting speed is not ideal, the task scheduling mode of the server is not flexible enough, and the task scheduling queue added at the server further reduces the task submitting speed.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a task scheduling method, system, device and apparatus based on a message queue.
According to a first aspect of the embodiments of the present disclosure, there is provided a task scheduling method based on a message queue, where the method is applied to a client, and the method includes: sending a semi-transaction message to a message middleware server; the message middleware server adds the semi-transaction message into a semi-message queue and returns the message identification information of the semi-transaction message; receiving the message identification information sent by the message middleware server; storing task information corresponding to the semi-transaction message and message identification information of the semi-transaction message to a database; reading the stored task information from the database, and screening the read task information according to the message identification information to obtain a task to be scheduled; and adding the task to be scheduled into a message queue in the message middleware server based on the message reexamination of the message middleware server so as to be consumed by a message subscriber.
In an implementation manner, the performing screening processing on the read task information according to the message identification information to obtain the task to be scheduled includes: according to the current service scene and the message identification information, task information meeting requirements is screened from the read task information; and determining the task information meeting the requirements as the task to be scheduled.
In an optional implementation manner, the screening out task information meeting requirements from the read task information according to the current service scenario and the message identification information includes: determining a corresponding task scheduling mode according to the current service scene; and screening out the task information meeting the task scheduling mode from the read task information.
Optionally, the task information includes priority levels of tasks, and the task scheduling manner includes a manner of scheduling tasks according to the priority levels; the step of screening out the task information meeting the task scheduling mode from the read task information comprises the following steps: and queuing the read task information according to the priority level of the task, and determining the queued task information as the task information meeting the task scheduling mode.
Optionally, the task information includes priority levels of tasks, and the task scheduling mode includes a mode of scheduling the tasks with the priority levels ranked in the top N; the step of screening out the task information meeting the task scheduling mode from the read task information comprises the following steps: according to the priority levels of the tasks, finding out the task information with the priority level ranked at the top N from the read task information; wherein N is a positive integer; and determining the task information with the priority level ranked at the top N as the task information meeting the task scheduling mode.
In one implementation, the adding the task to be scheduled to a message queue in the message middleware server based on the message review of the message middleware server includes: adding a task to be scheduled with a target state into a message queue in the message middleware server based on the message reexamination of the message middleware server; wherein the target state is a state that is visible to the message subscriber.
According to a second aspect of the embodiments of the present disclosure, there is provided a task scheduling method based on a message queue, the method being applied to a client, the method including: sending a semi-transaction message to a message middleware server; the message middleware server adds the semi-transaction message into a semi-message queue and returns the message identification information of the semi-transaction message; receiving the message identification information sent by the message middleware server; storing task information corresponding to the semi-transaction message and message identification information of the semi-transaction message into a database so that a message processor reads the stored task information and message identification information from the database, screening the read task information according to the message identification information to obtain a task to be scheduled, and adding the task to be scheduled into a message queue in a message middleware server based on message review of the message middleware server so that a message subscriber can consume the task to be scheduled.
According to a third aspect of the embodiments of the present disclosure, a task scheduling method based on a message queue is provided, where the method is applied to a message middleware server, and the method includes: receiving a semi-transaction message sent by a client; adding the semi-transaction message into a semi-message queue, and returning the message identification information of the semi-transaction message; the message identification information is used for indicating the client to store task information corresponding to the semi-transaction message and message identification information of the semi-transaction message into a database, so that a message processor reads the stored task information from the database, performs screening processing on the read task information according to the message identification information to obtain a task to be scheduled, and adds the task to be scheduled into a message queue in the message middleware server based on message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a task scheduling method based on a message queue, the method being applied to a message processor, the method including: reading the stored task information and the message identification information from the database; the task information stored in the database corresponds to a semi-transaction message sent to a message middleware server by a client, and the semi-transaction message corresponding to the task information stored in the database is added into a semi-message queue through the message middleware server and returns message identification information of the semi-transaction message; the task information and the message identification information stored in the database are stored by the client; screening the read task information according to the message identification information to obtain a task to be scheduled; and adding the task to be scheduled into a message queue in the message middleware server based on the message reexamination of the message middleware server so as to be consumed by a message subscriber.
According to a fifth aspect of the embodiments of the present disclosure, a task scheduling system based on a message queue is provided, including a client, a message middleware server, a message processor, and a message subscriber, where the client is configured to send a semi-transaction message to the message middleware server; the message middleware server is used for adding the semi-transaction message into a semi-message queue and returning the message identification information of the semi-transaction message; the client is also used for receiving the message identification information sent by the message middleware server and storing the task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message in a database; the message processor is used for reading the stored task information from the database, screening the read task information according to the message identification information to obtain a task to be scheduled, and adding the task to be scheduled into a message queue in the message middleware server based on the message back-check of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
According to a sixth aspect of the embodiments of the present disclosure, there is provided a message queue-based task scheduling apparatus, the apparatus being applied to a client, the apparatus including: the sending module is used for sending the semi-transaction message to the message middleware server; the message middleware server adds the semi-transaction message into a semi-message queue and returns the message identification information of the semi-transaction message; the receiving module is used for receiving the message identification information sent by the message middleware server; the storage module is used for storing the task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message into a database; the first processing module is used for reading the stored task information from the database and screening the read task information according to the message identification information to obtain a task to be scheduled; and the second processing module is used for adding the task to be scheduled into a message queue in the message middleware server based on the message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
In one implementation manner, the first processing module is specifically configured to: according to the current service scene and the message identification information, task information meeting requirements is screened from the read task information; and determining the task information meeting the requirements as the task to be scheduled.
In an optional implementation manner, the first processing module is specifically configured to: determining a corresponding task scheduling mode according to a current service scene; and screening out the task information meeting the task scheduling mode from the read task information.
Optionally, the task information includes priority levels of tasks, and the task scheduling manner includes a manner of scheduling tasks according to the priority levels; the first processing module is specifically configured to: and queuing the read task information according to the priority level of the task, and determining the queued task information as the task information meeting the task scheduling mode.
Optionally, the task information includes priority levels of tasks, and the task scheduling mode includes a mode of scheduling the tasks with the priority levels ranked in the top N; the first processing module is specifically configured to: according to the priority levels of the tasks, finding out the task information with the priority level ranked at the top N from the read task information; wherein N is a positive integer; and determining the task information with the priority level ranked at the top N as the task information meeting the task scheduling mode.
In one implementation, the second processing module is specifically configured to: adding a task to be scheduled with a target state into a message queue in the message middleware server based on the message reexamination of the message middleware server; wherein the target state is a state visible to the message subscriber.
According to a seventh aspect of the embodiments of the present disclosure, there is provided a message queue-based task scheduling apparatus, which is applied to a client, the apparatus including: the sending module is used for sending the semi-transaction message to the message middleware server; the message middleware server adds the semi-transaction message into a semi-message queue and returns the message identification information of the semi-transaction message; the receiving module is used for receiving the message identification information sent by the message middleware server; and the processing module is used for storing the task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message into a database so that a message processor reads the stored task information and the message identification information from the database, performs screening processing on the read task information according to the message identification information to obtain a task to be scheduled, and adds the task to be scheduled into a message queue in the message middleware server based on message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
According to an eighth aspect of the embodiments of the present disclosure, there is provided a task scheduling apparatus based on a message queue, where the apparatus is applied to a message middleware server, and the apparatus includes: the receiving module is used for receiving the semi-transaction message sent by the client; the processing module is used for adding the semi-transaction message into a semi-message queue and returning the message identification information of the semi-transaction message; the message identification information is used for indicating the client to store task information corresponding to the semi-transaction message and message identification information of the semi-transaction message into a database, so that a message processor reads the stored task information from the database, performs screening processing on the read task information according to the message identification information to obtain a task to be scheduled, and adds the task to be scheduled into a message queue in the message middleware server based on message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
According to a ninth aspect of the embodiments of the present disclosure, there is provided a task scheduling apparatus based on a message queue, the apparatus being applied to a message processor, the apparatus including: the reading module is used for reading the stored task information and the message identification information from the database; the method comprises the steps that task information stored in a database corresponds to semi-transaction information sent to a message middleware server by a client, and the semi-transaction information corresponding to the task information stored in the database is added into a semi-message queue through the message middleware server and returns message identification information of the semi-transaction information; the task information and the message identification information stored in the database are stored by the client; the first processing module is used for screening the read task information according to the message identification information to obtain a task to be scheduled; and the second processing module is used for adding the task to be scheduled into a message queue in the message middleware server based on the message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
According to a tenth aspect of an embodiment of the present disclosure, there is provided an electronic apparatus including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect, or to perform the method of the second aspect, or to perform the method of the third aspect, or to perform the method of the fourth aspect.
According to an eleventh aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium storing instructions that, when executed, cause a method according to the first aspect to be implemented, or cause a method according to the second aspect to be implemented, or cause a method according to the third aspect to be implemented, or cause a method according to the fourth aspect to be implemented.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: based on the message identification information returned by the message middleware server, the client is subjected to screening processing to obtain the task to be scheduled for consumption by the message subscriber, so that the burden of the server is reduced, and the task submission speed is increased.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flow diagram illustrating a method for message queue based task scheduling in accordance with an exemplary embodiment.
FIG. 2 is a flow diagram illustrating another message queue-based task scheduling method in accordance with an example embodiment.
FIG. 3 is a flow chart illustrating yet another message queue-based task scheduling method in accordance with an exemplary embodiment.
FIG. 4 is a flowchart illustrating yet another message queue-based task scheduling method in accordance with an exemplary embodiment.
FIG. 5 is a flowchart illustrating yet another message queue-based task scheduling method in accordance with an exemplary embodiment.
FIG. 6 is a flowchart illustrating yet another message queue-based task scheduling method in accordance with an exemplary embodiment.
FIG. 7 is a diagram illustrating a message queue based task scheduling system in accordance with an exemplary embodiment.
FIG. 8 is a diagram illustrating a message queue based task scheduling procedure in accordance with an exemplary embodiment.
FIG. 9 is a block diagram illustrating a message queue based task scheduler in accordance with an example embodiment.
FIG. 10 is a block diagram illustrating another message queue-based task scheduler in accordance with an example embodiment.
FIG. 11 is a block diagram illustrating yet another message queue-based task scheduler in accordance with an exemplary embodiment.
FIG. 12 is a block diagram illustrating yet another message queue-based task scheduler in accordance with an exemplary embodiment.
FIG. 13 is a schematic diagram of an electronic device shown in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
In the process that the client sends data to the server or the server sends a message to the client, a processor is needed to process the message, and the message processor in the embodiment of the disclosure can be deployed on a non-kubernets cluster server. For example, it may be deployed on a third party device alone, or it may be deployed on a client.
Fig. 1 is a flowchart illustrating a task scheduling method based on a message queue, which is applied to a client on which a message processor is deployed, according to an exemplary embodiment. As shown in fig. 1, the method may include, but is not limited to, the following steps:
step S101, sending the semi-transaction message to the message middleware server.
The message middleware server adds the half-transaction message into a half-message (half-MSG) queue and returns the message identification information of the half-transaction message.
For example, the client sends a semi-transaction message to the message middleware server. And the message middleware server adds the semi-transaction message into a semi-message queue and returns message identification information corresponding to the semi-transaction message.
In the embodiment of the present disclosure, the server may be a Borker server side of a rocktmq (Rocket Message Queue), the Message middleware may be Message middleware based on the rocktmq, and the Message identification information may be an MSG id (Message Identifier).
Step S102, receiving message identification information sent by a message middleware server.
For example, the client receives message identification information sent by the message middleware server, wherein the message identification information corresponds to a semi-transaction message sent by the client.
Step S103, storing the task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message in a database.
For example, the client stores task information corresponding to the semi-transaction message and message identification information corresponding to the semi-transaction message returned by the message middleware server to a database connected with the client.
And step S104, reading the stored task information from the database, and screening the read task information according to the message identification information to obtain a task to be scheduled.
For example, the message processor reads task information stored in the database, and screens the read task information according to the message identification information to screen out tasks meeting preset requirements, and the tasks are used as tasks to be scheduled.
In the embodiment of the present disclosure, the preset requirement is a requirement that a task should meet when the task is taken as a task to be scheduled.
And step S105, adding the task to be scheduled into a message queue in the message middleware server based on the message reexamination of the message middleware server so that the message subscriber consumes the task to be scheduled.
For example, when the message processor performs message review at the message middleware server, the callback function is called to change the task state of the task to be scheduled to a preset state (for example, a commit state), so as to add the task to be scheduled to the message queue of the message middleware server, so that the task to be scheduled is visible to the server, and the message subscriber consumes the task to be scheduled.
It can be understood that in the embodiment of the present disclosure, the message middleware alleviates the dependency of the client and the server on the database, reduces the code complexity of the server, and thus increases the task submission speed.
By implementing the embodiment of the disclosure, the client can perform screening processing on the basis of the message identification information returned by the message middleware server to obtain the task to be scheduled for consumption by the message subscriber, so that the burden of the server is reduced, and the task submission speed is increased.
In an implementation manner of the embodiment of the present disclosure, task information meeting requirements can be screened from the read task information according to the current service scene and the message identification information. Referring to fig. 2 as an example, fig. 2 is a flowchart illustrating another message queue-based task scheduling method according to an exemplary embodiment, where the method is applied to a client on which a message processor is deployed. As shown in fig. 2, the method may include, but is not limited to, the following steps:
step S201, sending the semi-transaction message to the message middleware server.
The message middleware server adds the half-transaction message into a half-message (half-MSG) queue and returns the message identification information of the half-transaction message.
In the embodiment of the present disclosure, step S201 may be implemented by adopting any one of the embodiments of the present disclosure, and this is not limited in the embodiment of the present disclosure and is not described again.
Step S202, receiving message identification information sent by the message middleware server side.
In the embodiment of the present disclosure, step S202 may be implemented by using any one of the embodiments of the present disclosure, and this is not limited in the embodiment of the present disclosure and is not described again.
Step S203, storing the task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message in a database.
In the embodiment of the present disclosure, step S203 may be implemented by adopting any one of the embodiments of the present disclosure, which is not limited by the embodiment of the present disclosure and is not described again.
Step S204, reading the stored task information from the database.
And S205, screening out task information meeting the requirements from the read task information according to the current service scene and the message identification information.
For example, the message server screens out the task information meeting the current service scene from all the read task information according to the current service scene and the message identification information.
In an optional implementation manner, the screening of the task information meeting the requirement from the read task information according to the current service scenario and the message identification information may include the following steps: determining a corresponding task scheduling mode according to the current service scene; and screening out the task information meeting the task scheduling mode from the read task information.
For example, the message server determines a corresponding task scheduling mode according to the current service scene, and screens out task information meeting the task scheduling mode from the read task information.
Optionally, the task information includes priority levels of tasks, and the task scheduling mode includes a mode of performing task scheduling according to the priority levels; the step of screening the task information meeting the task scheduling mode from the read task information may include the following steps: and queuing the read task information according to the priority level of the task, and determining the queued task information as the task information meeting a task scheduling mode.
For example, the priority level of each task is obtained from the task information, all the read task information is queued according to the priority level of each task (for example, queuing is performed sequentially from a high priority level to a low priority level, or queuing is performed sequentially from a low priority level to a high priority level), and the queued task information is determined as the task information meeting the task scheduling mode.
Optionally, the task information includes priority levels of the tasks, and the task scheduling mode includes a mode of scheduling the tasks with the priority levels ranked in the top N; screening out task information meeting the task scheduling mode from the read task information, wherein the task information comprises the following steps: according to the priority levels of the tasks, finding out the task information with the priority level ranked at the top N from the read task information; wherein N is a positive integer; and determining the task information with the priority level ranked at the top N as the task information meeting the task scheduling mode.
For example, the priority level of each task is obtained from the task information, the task information with the priority level ranked at the top N is found from all the read task information according to the priority level, and the task information with the priority level ranked at the top N is determined as the task information meeting the task scheduling mode.
And step S206, determining the task information meeting the requirements as the task to be scheduled.
For example, the task information which is screened out in the last step and meets the requirements is determined as the task to be scheduled.
Step S207, adding the task to be scheduled into the message queue in the message middleware server based on the message back check of the message middleware server, so that the message subscriber consumes the task to be scheduled.
In the embodiment of the present disclosure, step S207 may be implemented by adopting any one of the embodiments of the present disclosure, and this is not limited in the embodiment of the present disclosure and is not described again.
By implementing the embodiment of the disclosure, task information meeting requirements can be screened from the read task information based on the message identification information returned by the message middleware server and the current service scene so as to obtain the task to be scheduled for consumption by the message subscriber, so that secondary development and configuration of different task scheduling modes can be performed according to different service scenes, and task submission supporting multi-task scheduling is realized by combining with a queue mechanism of the message middleware. The method solves the expansibility bottleneck of the traditional scheme, reduces the burden of the server and accelerates the task submission.
In an implementation manner of the embodiment of the present disclosure, a task to be scheduled in a target state may be added to a message queue in a message middleware server based on message backtracking of the message middleware server. Referring to fig. 3 as an example, fig. 3 is a flowchart illustrating a further message queue-based task scheduling method according to an exemplary embodiment, where the method is applied to a client on which a message processor is deployed. As shown in fig. 3, the method may include, but is not limited to, the following steps:
step S301, sending the semi-transaction message to the message middleware server.
The message middleware server adds the semi-transaction message into the semi-message queue and returns the message identification information of the semi-transaction message.
In the embodiment of the present disclosure, step S301 may be implemented by adopting any one of the embodiments of the present disclosure, and this is not limited in the embodiment of the present disclosure and is not described again.
Step S302, receiving message identification information sent by the message middleware server.
In the embodiment of the present disclosure, step S302 may be implemented by any one of the embodiments of the present disclosure, and this is not limited in the embodiment of the present disclosure and is not described again.
Step S303, storing the task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message in a database.
In the embodiment of the present disclosure, step S303 may be implemented by respectively adopting any one of the embodiments of the present disclosure, and this is not limited in the embodiment of the present disclosure and is not described again.
And step S304, reading the stored task information from the database, and screening the read task information according to the message identification information to obtain a task to be scheduled.
In the embodiment of the present disclosure, step S304 may be implemented by using any one of the embodiments of the present disclosure, and this is not limited in the embodiment of the present disclosure and is not described again.
Step S305, based on the message back check of the message middleware server, adding the task to be scheduled with the target state into the message queue of the message middleware server, so that the message subscriber consumes the task to be scheduled.
Wherein the target state is a state visible to the message subscriber.
For example, when the message middleware server performs message review, the task to be scheduled in the target state (for example, commit state) is added to the message queue in the message middleware server, so that the message subscriber consumes the task to be scheduled.
By implementing the embodiment of the disclosure, the client can be screened and processed based on the message identification information returned by the message middleware server to obtain the task to be scheduled for the message subscriber to consume, thereby reducing the burden of the server and accelerating the task submission speed.
In some embodiments of the present disclosure, the message processor may be deployed solely on the non-client, such as solely on a third-party device. Referring to fig. 4 as an example, fig. 4 is a flowchart illustrating a further message queue-based task scheduling method applied to a client according to an exemplary embodiment, where the message handler is deployed on a third-party device. As shown in fig. 4, the method may include, but is not limited to, the following steps:
step S401, sending the semi-transaction message to the message middleware server.
The message middleware server adds the semi-transaction message into a semi-message queue and returns the message identification information of the semi-transaction message.
In the embodiment of the present disclosure, step S401 may be implemented by any one of the embodiments of the present disclosure, which is not limited in this disclosure and is not described again.
Step S402, receiving message identification information sent by the message middleware server.
In the embodiment of the present disclosure, step S402 may be implemented by any one of the embodiments of the present disclosure, which is not limited in this embodiment of the present disclosure and is not described again.
Step S403, storing the task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message into a database, so that the message processor reads the stored task information and the message identification information from the database, performing screening processing on the read task information according to the message identification information to obtain a task to be scheduled, and adding the task to be scheduled into a message queue in a message middleware server based on message review of the message middleware server, so that a message subscriber consumes the task to be scheduled.
In the embodiment of the present disclosure, each specific step in step S402 may be implemented by using any one of the embodiments of the present disclosure, and this is not limited in the embodiment of the present disclosure and is not described again.
By implementing the embodiment of the disclosure, the client can be screened and processed based on the message identification information returned by the message middleware server to obtain the task to be scheduled for the message subscriber to consume, thereby reducing the burden of the server and accelerating the task submission speed.
Referring to fig. 5, fig. 5 is a flowchart illustrating a further message queue-based task scheduling method applied to a message middleware server according to an exemplary embodiment, and as shown in fig. 5, the method includes the following steps:
step S501, receiving a semi-transaction message sent by a client.
Step S502, adding the semi-transaction message into the semi-message queue, and returning the message identification information of the semi-transaction message.
The message identification information is used for indicating the client to store task information corresponding to the semi-transaction message and message identification information of the semi-transaction message into the database, so that the message processor reads the stored task information from the database, performs screening processing on the read task information according to the message identification information to obtain a task to be scheduled, and adds the task to be scheduled into a message queue in the message middleware server based on message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
For example, the message middleware server adds the received semi-transaction message sent by the client into the semi-message queue, and returns the message identification information corresponding to the semi-transaction message.
By implementing the embodiment of the disclosure, the message middleware server side can return the message identification information of the semi-transaction message to the client side based on the received semi-transaction message, so that the client side can perform screening processing on the task information read from the database based on the message identification information to obtain the task to be scheduled for consumption by the message subscriber side, thereby reducing the burden of the server side and accelerating the task submission speed.
Referring to fig. 6, fig. 6 is a flowchart illustrating a further task scheduling method based on a message queue according to an exemplary embodiment, the method is applied to a message processor, and as shown in fig. 6, the method includes the following steps:
step S601, reading the stored task information and message identification information from the database.
The method comprises the steps that task information stored in a database corresponds to a semi-transaction message sent to a message middleware server by a client, the semi-transaction message corresponding to the task information stored in the database is added into a semi-message queue through the message middleware server, and message identification information of the semi-transaction message is returned; the task information and message identification information stored in the database are stored by the client.
For example, the message processor reads task information corresponding to a semi-transaction message sent from the client to the message middleware server from the database, reads the semi-transaction message corresponding to the task information, joins the semi-transaction message into a semi-message queue through the message middleware server, and returns message identification information of the semi-transaction message.
Step S602, the read task information is screened according to the message identification information to obtain the task to be scheduled.
For example, the message processor performs screening processing on all task information models read from the database according to the message identification information read from the database, and selects task information meeting preset requirements as a task to be scheduled.
In one implementation mode, the task information meeting the requirement can be screened from the read task information according to the current service scene and the message identification information, and the task information meeting the requirement is determined as the task to be scheduled.
In an optional implementation manner, the screening of the task information meeting the requirement from the read task information according to the current service scenario and the message identification information may include the following steps: determining a corresponding task scheduling mode according to the current service scene; and screening out the task information meeting the task scheduling mode from the read task information.
Optionally, the task information may include priority levels of the tasks, and the task scheduling manner includes a manner of scheduling the tasks according to the priority levels; the step of screening the task information meeting the task scheduling mode from the read task information may include the following steps: and queuing the read task information according to the priority level of the task, and determining the queued task information as the task information meeting the task scheduling mode.
Optionally, the task information includes priority levels of the tasks, and the task scheduling manner includes a manner of scheduling the tasks with the priority levels ranked at the top N; the step of screening the task information meeting the task scheduling mode from the read task information may include the following steps: according to the priority levels of the tasks, finding out the task information with the priority level ranked at the top N from the read task information; wherein N is a positive integer; and determining the task information with the priority level ranked at the top N as the task information meeting the task scheduling mode.
In the embodiments of the present disclosure, the above steps may be implemented by any one of the embodiments of the present disclosure, and the embodiments of the present disclosure are not limited to this and are not described in detail again.
Step S603, adding the task to be scheduled into a message queue in the message middleware server based on the message reexamination of the message middleware server so that the message subscriber consumes the task to be scheduled.
In the embodiment of the present disclosure, step S603 may be implemented by using any one of the embodiments of the present disclosure, and this is not limited in the embodiment of the present disclosure and is not described again.
By implementing the embodiment of the disclosure, the message processor can perform screening processing on the task information read from the database based on the message identifier to obtain the task to be scheduled for consumption by the message subscriber, thereby reducing the burden of the server and accelerating the task submission speed.
Referring to fig. 7, fig. 7 is a schematic diagram illustrating a task scheduling system based on a message queue according to an exemplary embodiment, and as shown in fig. 7, the system includes a client 701, a message middleware server 702, a message processor 703 and a message subscriber 704.
The client 701 is configured to send a semi-transaction message to the message middleware server 702. The message middleware server 702 is configured to add the half-transaction message into the half-message queue, and return the message identification information of the half-transaction message. The client 701 is further configured to receive message identification information sent by the message middleware server 702, and store task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message in a database. The message processor 703 is configured to read stored task information from the database, perform screening processing on the read task information according to the message identification information to obtain a task to be scheduled, and add the task to be scheduled to a message queue in the message middleware server 702 based on message review of the message middleware server 702, so that the message subscriber 704 consumes the task to be scheduled.
Through the system of the embodiment of the disclosure, the message processor can perform screening processing on the task information read from the database based on the message identifier to obtain the task to be scheduled for consumption by the message subscriber, thereby reducing the burden of the server and accelerating the task submission speed.
With respect to the system in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated herein.
Referring to fig. 8, fig. 8 is a schematic diagram illustrating a task scheduling procedure based on a message queue according to an exemplary embodiment, and as shown in fig. 8, a client submits a task message based on things to a half-MSG queue, and then a server returns an MSG id of the task message, and the client stores task information and the MSG id corresponding to the task message to a database. The message processor periodically and circularly takes out the stored task information from the database, screens out tasks meeting the requirements and stores the tasks in the scheduling queue. When the task state is checked back, the task meeting the requirement calls the callback function to change the task state to Commit, and at the moment, the message enters a message queue of the message middleware and is visible to the server. The server side normally consumes the messages in the message queue, reviews the database and submits the messages to Kubernetes.
Fig. 9 is a block diagram illustrating a message queue based task scheduler 900 according to an example embodiment. The device is applied to a client, which can be a third-party device, and a message processor is deployed on the client. Referring to fig. 9, the apparatus includes a transmitting module 901, a receiving module 902, a storing module 903, a first processing module 904, and a second processing module 905.
The sending module 901 is configured to send a semi-transaction message to a message middleware server; and the message middleware server adds the semi-transaction message into the semi-message queue and returns the message identification information of the semi-transaction message. The storage module 903 is used for storing task information corresponding to the semi-transaction message and message identification information of the semi-transaction message to a database; the first processing module 904 is configured to read stored task information from a database, and perform screening processing on the read task information according to the message identification information to obtain a task to be scheduled; the second processing module 905 is configured to add the task to be scheduled to a message queue in the message middleware server based on message review of the message middleware server, so that the message subscriber consumes the task to be scheduled.
In one implementation, the first processing module 904 is specifically configured to: according to the current service scene and the message identification information, task information meeting requirements is screened from the read task information; and determining the task information meeting the requirements as the task to be scheduled.
In an optional implementation manner, the first processing module 904 is specifically configured to: determining a corresponding task scheduling mode according to the current service scene; and screening out the task information meeting the task scheduling mode from the read task information.
Optionally, the task information includes a priority level of the task, and the task scheduling mode includes a mode of scheduling the task according to the priority level; the first processing module 904 is specifically configured to: and queuing the read task information according to the priority level of the task, and determining the queued task information as the task information meeting a task scheduling mode.
Optionally, the task information includes priority levels of the tasks, and the task scheduling mode includes a mode of scheduling the tasks with the priority levels ranked in the top N; the first processing module 904 is specifically configured to: according to the priority levels of the tasks, task information with the priority level ranked at the top N is found out from the read task information; wherein N is a positive integer; and determining the task information with the priority level ranked at the top N as the task information meeting the task scheduling mode.
In an implementation manner, the second processing module 905 is specifically configured to: adding a task to be scheduled with a target state into a message queue in the message middleware server based on the message reexamination of the message middleware server; wherein the target state is a state visible to the message subscriber.
By the device of the embodiment, the task information meeting the requirement can be screened from the read task information based on the message identification information returned by the message middleware server and the current service scene so as to obtain the task to be scheduled for consumption by the message subscriber, so that secondary development and configuration of different task scheduling modes can be performed according to different service scenes, the expansibility bottleneck of the traditional submission scheme is solved, the burden of the server is reduced, and the task submission speed is increased.
Fig. 10 is a block diagram of another message queue-based task scheduling apparatus 1000 according to an exemplary embodiment, which is applied to a client, which may be a third-party device, and on which a message processor is deployed. Referring to fig. 10, the apparatus includes a transmitting module 1001, a receiving module 1002, and a processing module 1003.
The sending module 1001 is configured to send a semi-transaction message to a message middleware server; the message middleware server adds the semi-transaction message into a semi-message queue and returns the message identification information of the semi-transaction message; a receiving module 1002, configured to receive message identifier information sent by a message middleware server; the processing module 1003 is configured to store the task information corresponding to the semi-transaction message and the message identifier information of the semi-transaction message in the database, so that the message processor reads the stored task information and message identifier information from the database, performs screening processing on the read task information according to the message identifier information to obtain a task to be scheduled, and adds the task to be scheduled to a message queue in the message middleware server based on message review of the message middleware server, so that the message subscriber consumes the task to be scheduled.
By the device of the embodiment of the disclosure, based on the message identification information returned by the message middleware server, the client can be screened to obtain the task to be scheduled for consumption by the message subscriber, so that the burden of the server is reduced, and the task submission speed is increased.
Fig. 11 is a block diagram illustrating yet another message queue-based task scheduler 1100 in accordance with an example embodiment. The device is applied to a message middleware server side. Referring to fig. 11, the apparatus includes a receiving module 1101 and a processing module 1102.
A receiving module 1101, configured to receive a semi-transaction message sent by a client; a processing module 1102, configured to add the semi-transaction message to the semi-message queue, and return message identification information of the semi-transaction message; the message identification information is used for indicating the client to store the task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message into the database, so that the message processor reads the stored task information from the database, performs screening processing on the read task information according to the message identification information to obtain a task to be scheduled, and adds the task to be scheduled into a message queue in the message middleware server based on message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
Fig. 12 is a block diagram illustrating yet another message queue-based task scheduler 1200 according to an example embodiment. The device is applied to a message processor. Referring to fig. 12, the apparatus includes a reading module 1201, a first processing module 1202, and a second processing module 1203.
A reading module 1201, configured to read stored task information and message identification information from a database; the method comprises the steps that task information stored in a database corresponds to a semi-transaction message sent to a message middleware server by a client, the semi-transaction message corresponding to the task information stored in the database is added into a semi-message queue through the message middleware server, and message identification information of the semi-transaction message is returned; the task information and the message identification information stored in the database are stored by the client; the first processing module 1202 is configured to perform screening processing on the read task information according to the message identifier information to obtain a task to be scheduled; the second processing module 1203 is configured to add the task to be scheduled to a message queue in the message middleware server based on a message review of the message middleware server, so that the message subscriber consumes the task to be scheduled.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Referring to fig. 13, fig. 13 is a diagram illustrating an electronic device 1300 according to an exemplary embodiment. The electronic device 1300 may be an electronic device, or may be a chip, a chip system, a processor, or the like that supports the electronic device to implement the method. The electronic device may be configured to implement the method described in the method embodiment, and specific reference may be made to the description in the method embodiment.
The electronic device 1300 may include one or more processors 1301. The processor 1301 may be a general purpose processor, a special purpose processor, or the like. For example, a baseband processor or a central processor. The baseband processor may be configured to process communication protocols and communication data, and the central processor may be configured to control a communication device (e.g., a base station, a baseband chip, an electronic device chip, a DU or CU, etc.), execute a computer program, and process data of the computer program.
Optionally, the electronic device 1300 may further include one or more memories 1302, on which a computer program 1304 may be stored, and the processor 1301 executes the computer program 1304, so that the electronic device 1300 performs the methods described in the above method embodiments. Optionally, the memory 1302 may further store data. The electronic device 1300 and the memory 1302 may be separate or integrated.
Optionally, the electronic device 1300 may further include a transceiver 1305, an antenna 1306. The transceiver 1305 may be referred to as a transceiving unit, a transceiver, a transceiving circuit, or the like, and is configured to perform a transceiving function. The transceiver 1305 may include a receiver, which may be referred to as a receiver or a receiving circuit, etc., for implementing a receiving function; the transmitter may be referred to as a transmitter or a transmission circuit, etc. for implementing the transmission function.
Optionally, one or more interface circuits 1307 may also be included in the electronic device 1300. The interface circuit 1307 is used to receive code instructions and transmit them to the processor 1301. The processor 1301 executes the code instructions to cause the electronic device 1300 to perform the methods described in the method embodiments above.
In one implementation, a transceiver may be included in processor 1301 for performing receive and transmit functions. The transceiver may be, for example, a transceiver circuit, or an interface circuit. The transceiver circuitry, interface or interface circuitry for implementing the receive and transmit functions may be separate or integrated. The transceiver circuit, the interface circuit or the interface circuit may be used for reading and writing code/data, or the transceiver circuit, the interface circuit or the interface circuit may be used for transmitting or transferring signals.
In one implementation, the processor 1301 may store a computer program 1303, and the computer program 1303 may be executed on the processor 1301, so that the electronic device 1301 may perform the method described in the above method embodiment. The computer program 1303 may be solidified in the processor 1301, in which case the processor 1301 may be implemented by hardware.
In one implementation, electronic device 1301 may include circuitry that may implement the functionality of transmitting or receiving or communicating in the aforementioned method embodiments. The processors and transceivers described in this disclosure may be implemented on Integrated Circuits (ICs), analog ICs, Radio Frequency Integrated Circuits (RFICs), mixed signal ICs, Application Specific Integrated Circuits (ASICs), Printed Circuit Boards (PCBs), electronic devices, and the like. The processor and transceiver may also be fabricated using various IC process technologies, such as Complementary Metal Oxide Semiconductor (CMOS), N-type metal oxide semiconductor (NMOS), P-type metal oxide semiconductor (PMOS), Bipolar Junction Transistor (BJT), bipolar CMOS (bicmos), silicon germanium (SiGe), gallium arsenide (GaAs), and the like.
The electronic device in the description of the above embodiment may be a network device or an electronic device, but the scope of the electronic device described in the present disclosure is not limited thereto, and the structure of the electronic device may not be limited by fig. 13. The electronic device may be a stand-alone device or may be part of a larger device. For example, the electronic device may be:
(1) a stand-alone integrated circuit IC, or chip, or system-on-chip or subsystem;
(2) a set of one or more ICs, which optionally may also include storage means for storing data, computer programs;
(3) an ASIC, such as a Modem (Modem);
(4) a module that may be embedded within other devices;
(5) receivers, electronic devices, intelligent electronic devices, cellular phones, wireless devices, handsets, mobile units, in-vehicle devices, network devices, cloud devices, artificial intelligence devices, and the like;
(6) others, and so forth.
Those of skill in the art will also appreciate that the various illustrative logical blocks and steps (step) set forth in the embodiments of the disclosure may be implemented in electronic hardware, computer software, or combinations of both. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Those skilled in the art may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments.
The present disclosure also provides a readable storage medium having stored thereon instructions which, when executed by a computer, implement the functionality of any of the above-described method embodiments.
The present disclosure also provides a computer program product which, when executed by a computer, implements the functionality of any of the above-described method embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs. The procedures or functions according to the embodiments of the present disclosure are wholly or partially generated when the computer program is loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer program can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer program can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a Digital Video Disc (DVD)), or a semiconductor medium (e.g., a Solid State Disk (SSD)), among others.
Those of ordinary skill in the art will understand that: the various numbers of the first, second, etc. involved in this disclosure are merely for convenience of description and distinction, and are not intended to limit the scope of the embodiments of the disclosure, but also to indicate the order of precedence.
At least one of the present disclosure may also be described as one or more, and a plurality may be two, three, four or more, without limitation of the present disclosure. In the embodiment of the present disclosure, for a technical feature, the technical features in the technical feature are distinguished by "first", "second", "third", "a", "B", "C", and "D", etc., and the technical features described in "first", "second", "third", "a", "B", "C", and "D" are not in a sequential order or a magnitude order.
The correspondence shown in the tables in the present disclosure may be configured or predefined. The values of the information in each table are only examples, and may be configured as other values, and the disclosure is not limited thereto. When the correspondence between the information and each parameter is configured, it is not always necessary to configure all the correspondences indicated in each table. For example, in the table in the present disclosure, the correspondence relationship shown by some rows may not be configured. For another example, appropriate modification adjustments, such as splitting, merging, etc., can be made based on the above tables. The names of the parameters in the tables may be other names understandable by the communication device, and the values or the expression of the parameters may be other values or expressions understandable by the communication device. When the above tables are implemented, other data structures may be used, for example, arrays, queues, containers, stacks, linear tables, pointers, linked lists, trees, graphs, structures, classes, heaps, hash tables, or hash tables may be used.
Predefinition in this disclosure may be understood as defining, predefining, storing, pre-negotiating, pre-configuring, curing, or pre-firing.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present disclosure, and all the changes or substitutions should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (21)

1. A task scheduling method based on a message queue is applied to a client, and the method comprises the following steps:
sending a semi-transaction message to a message middleware server; the message middleware server adds the semi-transaction message into a semi-message queue and returns the message identification information of the semi-transaction message;
receiving the message identification information sent by the message middleware server;
storing task information corresponding to the semi-transaction message and message identification information of the semi-transaction message to a database;
reading stored task information from the database, and screening the read task information according to the message identification information to obtain a task to be scheduled;
and adding the task to be scheduled into a message queue in the message middleware server based on the message reexamination of the message middleware server so as to be consumed by a message subscriber.
2. The method as claimed in claim 1, wherein the filtering the read task information according to the message identification information to obtain the task to be scheduled includes:
according to the current service scene and the message identification information, task information meeting requirements is screened from the read task information;
and determining the task information meeting the requirements as the task to be scheduled.
3. The method as claimed in claim 2, wherein the step of screening out task information meeting the requirement from the read task information according to the current service scenario and the message identification information comprises:
determining a corresponding task scheduling mode according to a current service scene;
and screening out the task information meeting the task scheduling mode from the read task information.
4. The method of claim 3, wherein the task information includes a priority level of the task, and the task scheduling manner includes a manner of scheduling the task according to the priority level; the step of screening out the task information meeting the task scheduling mode from the read task information comprises the following steps:
and queuing the read task information according to the priority level of the task, and determining the queued task information as the task information meeting the task scheduling mode.
5. The method of claim 3, wherein the task information includes priority levels of tasks, and the task scheduling manner includes a manner of scheduling tasks with priority levels top N; the step of screening out the task information meeting the task scheduling mode from the read task information comprises the following steps:
according to the priority levels of the tasks, finding out the task information with the priority level ranked at the top N from the read task information; wherein N is a positive integer;
and determining the task information with the priority level ranked at the top N as the task information meeting the task scheduling mode.
6. The method of claim 1, wherein the adding the task to be scheduled to a message queue in the message middleware server based on a message lookback of the message middleware server comprises:
adding a task to be scheduled with a target state into a message queue in the message middleware server based on the message reexamination of the message middleware server; wherein the target state is a state that is visible to the message subscriber.
7. A task scheduling method based on a message queue is applied to a client side and comprises the following steps:
sending a semi-transaction message to a message middleware server; the message middleware server adds the semi-transaction message into a semi-message queue and returns the message identification information of the semi-transaction message;
receiving the message identification information sent by the message middleware server;
storing task information corresponding to the semi-transaction message and message identification information of the semi-transaction message into a database so that a message processor reads the stored task information and message identification information from the database, screening the read task information according to the message identification information to obtain a task to be scheduled, and adding the task to be scheduled into a message queue in a message middleware server based on message review of the message middleware server so that a message subscriber can consume the task to be scheduled.
8. A task scheduling method based on a message queue is characterized in that the method is applied to a message middleware server side, and the method comprises the following steps:
receiving a semi-transaction message sent by a client;
adding the semi-transaction message into a semi-message queue, and returning the message identification information of the semi-transaction message;
the message identification information is used for indicating the client to store task information corresponding to the semi-transaction message and message identification information of the semi-transaction message into a database, so that a message processor reads the stored task information from the database, performs screening processing on the read task information according to the message identification information to obtain a task to be scheduled, and adds the task to be scheduled into a message queue in the message middleware server based on message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
9. A task scheduling method based on a message queue is applied to a message processor and comprises the following steps:
reading the stored task information and the message identification information from the database; the task information stored in the database corresponds to a semi-transaction message sent to a message middleware server by a client, and the semi-transaction message corresponding to the task information stored in the database is added into a semi-message queue through the message middleware server and returns message identification information of the semi-transaction message; the task information and the message identification information stored in the database are stored by the client;
screening the read task information according to the message identification information to obtain a task to be scheduled;
and adding the task to be scheduled into a message queue in the message middleware server based on the message reexamination of the message middleware server so as to be consumed by a message subscriber.
10. A task scheduling system based on a message queue is characterized by comprising a client, a message middleware server, a message processor and a message subscriber, wherein,
the client is used for sending a semi-transaction message to the message middleware server;
the message middleware server is used for adding the semi-transaction message into a semi-message queue and returning the message identification information of the semi-transaction message;
the client is also used for receiving the message identification information sent by the message middleware server and storing the task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message into a database;
the message processor is used for reading the stored task information from the database, screening the read task information according to the message identification information to obtain a task to be scheduled, and adding the task to be scheduled into a message queue in the message middleware server based on the message back-check of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
11. A task scheduling device based on a message queue, wherein the device is applied to a client, and the device comprises:
the sending module is used for sending the semi-transaction message to the message middleware server; the message middleware server adds the semi-transaction message into a semi-message queue and returns the message identification information of the semi-transaction message;
the receiving module is used for receiving the message identification information sent by the message middleware server;
the storage module is used for storing the task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message into a database;
the first processing module is used for reading the stored task information from the database and screening the read task information according to the message identification information to obtain a task to be scheduled;
and the second processing module is used for adding the task to be scheduled into a message queue in the message middleware server based on the message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
12. The apparatus of claim 11, wherein the first processing module is specifically configured to:
according to the current service scene and the message identification information, screening out task information meeting requirements from the read task information;
and determining the task information meeting the requirements as the task to be scheduled.
13. The apparatus of claim 12, wherein the first processing module is specifically configured to:
determining a corresponding task scheduling mode according to the current service scene;
and screening out the task information meeting the task scheduling mode from the read task information.
14. The apparatus of claim 13, wherein the task information includes a priority level of a task, and the task scheduling manner includes a manner of task scheduling according to the priority level; the first processing module is specifically configured to:
and queuing the read task information according to the priority level of the task, and determining the queued task information as the task information meeting the task scheduling mode.
15. The apparatus of claim 13, wherein the task information includes priority levels of tasks, and the task scheduling manner includes a manner of scheduling tasks with priority levels top N; the first processing module is specifically configured to:
according to the priority levels of the tasks, finding out the task information with the priority level ranked at the top N from the read task information; wherein N is a positive integer;
and determining the task information with the priority level ranked at the top N as the task information meeting the task scheduling mode.
16. The apparatus of claim 11, wherein the second processing module is specifically configured to:
adding a task to be scheduled with a target state into a message queue in the message middleware server based on the message reexamination of the message middleware server; wherein the target state is a state visible to the message subscriber.
17. A task scheduling device based on a message queue, the device being applied to a client, the device comprising:
the sending module is used for sending the semi-transaction message to the message middleware server; the message middleware server adds the semi-transaction message into a semi-message queue and returns the message identification information of the semi-transaction message;
the receiving module is used for receiving the message identification information sent by the message middleware server;
and the processing module is used for storing the task information corresponding to the semi-transaction message and the message identification information of the semi-transaction message into a database so that a message processor reads the stored task information and the message identification information from the database, performs screening processing on the read task information according to the message identification information to obtain a task to be scheduled, and adds the task to be scheduled into a message queue in the message middleware server based on message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
18. A task scheduling device based on a message queue, which is applied to a message middleware server side, and comprises:
the receiving module is used for receiving the semi-transaction message sent by the client;
the processing module is used for adding the semi-transaction message into a semi-message queue and returning the message identification information of the semi-transaction message;
the message identification information is used for indicating the client to store task information corresponding to the semi-transaction message and message identification information of the semi-transaction message into a database, so that a message processor reads the stored task information from the database, performs screening processing on the read task information according to the message identification information to obtain a task to be scheduled, and adds the task to be scheduled into a message queue in the message middleware server based on message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
19. A task scheduling device based on a message queue, which is applied to a message processor, and comprises:
the reading module is used for reading the stored task information and the message identification information from the database; the task information stored in the database corresponds to a semi-transaction message sent to a message middleware server by a client, and the semi-transaction message corresponding to the task information stored in the database is added into a semi-message queue through the message middleware server and returns message identification information of the semi-transaction message; the task information and the message identification information stored in the database are stored by the client;
the first processing module is used for screening the read task information according to the message identification information to obtain a task to be scheduled;
and the second processing module is used for adding the task to be scheduled into a message queue in the message middleware server based on the message review of the message middleware server so as to enable a message subscriber to consume the task to be scheduled.
20. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 6, or to perform the method of claim 7, or to perform the method of claim 8, or to perform the method of claim 9.
21. A computer-readable storage medium storing instructions that, when executed, cause a method of any one of claims 1-6 to be implemented, or cause a method of claim 7 to be implemented, or cause a method of claim 8 to be implemented, or cause a method of claim 9 to be implemented.
CN202210721974.3A 2022-06-24 2022-06-24 Task scheduling method, system, device and equipment based on message queue Active CN114827278B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210721974.3A CN114827278B (en) 2022-06-24 2022-06-24 Task scheduling method, system, device and equipment based on message queue

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210721974.3A CN114827278B (en) 2022-06-24 2022-06-24 Task scheduling method, system, device and equipment based on message queue

Publications (2)

Publication Number Publication Date
CN114827278A CN114827278A (en) 2022-07-29
CN114827278B true CN114827278B (en) 2022-09-02

Family

ID=82521298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210721974.3A Active CN114827278B (en) 2022-06-24 2022-06-24 Task scheduling method, system, device and equipment based on message queue

Country Status (1)

Country Link
CN (1) CN114827278B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115334155B (en) * 2022-08-12 2024-04-19 中国建设银行股份有限公司 Message queue proxy method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527528A (en) * 2020-12-18 2021-03-19 平安科技(深圳)有限公司 Data transmission method, device and storage medium based on message queue
CN113849320A (en) * 2021-08-20 2021-12-28 阿里巴巴新加坡控股有限公司 Development method, control method and computing device
CN114356599A (en) * 2021-12-30 2022-04-15 中国农业银行股份有限公司 Service message processing system and method
CN114598593A (en) * 2022-02-16 2022-06-07 阿里巴巴(中国)有限公司 Message processing method, system, computing device and computer storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111708619B (en) * 2020-08-20 2020-11-06 上海冰鉴信息科技有限公司 Distributed transaction processing method and system based on message queue and database

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527528A (en) * 2020-12-18 2021-03-19 平安科技(深圳)有限公司 Data transmission method, device and storage medium based on message queue
CN113849320A (en) * 2021-08-20 2021-12-28 阿里巴巴新加坡控股有限公司 Development method, control method and computing device
CN114356599A (en) * 2021-12-30 2022-04-15 中国农业银行股份有限公司 Service message processing system and method
CN114598593A (en) * 2022-02-16 2022-06-07 阿里巴巴(中国)有限公司 Message processing method, system, computing device and computer storage medium

Also Published As

Publication number Publication date
CN114827278A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
CN114467314A (en) Method and device for determining shared channel occupation time
WO2023184457A1 (en) Effective time determination method and apparatus
CN114827278B (en) Task scheduling method, system, device and equipment based on message queue
CN115088275A (en) Method and device for triggering position information reporting
CN115843444A (en) Path adding method and device
WO2023028924A1 (en) Validity indication method and apparatus for reference signal
CN114342483A (en) Access control method and device
CN114208354A (en) Physical Downlink Shared Channel (PDSCH) configuration method and device
WO2024000531A1 (en) Method for sending cyclic prefix extended (cpe), and apparatus therefor
CN116157706A (en) Global Navigation Satellite System (GNSS) positioning measurement method and device
CN115136660A (en) Relay connection method and device
CN115280875A (en) GNSS positioning measurement method and device of global navigation satellite system
CN114208239A (en) Method and device for switching new air interface and new air interface sidelink
CN115956381A (en) Radio resource management measurement method and device thereof
WO2023245499A1 (en) Transmission and reception point (trp) configuration method, and apparatus, device and storage medium
WO2023201755A1 (en) Configuration method for mobility management, and apparatus
WO2024026888A1 (en) Application function using method and apparatus
WO2022236625A1 (en) Positioning method and apparatus thereof
WO2023245587A1 (en) Validation time acquisition method and apparatus
CN114902721A (en) Processing method and device for measurement configuration
CN115956371A (en) Method and device for channel state feedback
CN115486003A (en) Data receiving processing method and device
CN114080780A (en) Method and device for determining period of tracking reference signal
CN116830479A (en) Satellite coverage information determining method and device
CN114097260A (en) Terminal capability reporting method, terminal capability determining method and 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
GR01 Patent grant
GR01 Patent grant