CN113419841A - Message scheduling method and device, electronic equipment and computer readable medium - Google Patents

Message scheduling method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN113419841A
CN113419841A CN202110971921.2A CN202110971921A CN113419841A CN 113419841 A CN113419841 A CN 113419841A CN 202110971921 A CN202110971921 A CN 202110971921A CN 113419841 A CN113419841 A CN 113419841A
Authority
CN
China
Prior art keywords
message
executed
thread
execution
queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110971921.2A
Other languages
Chinese (zh)
Other versions
CN113419841B (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.)
Hubei Central China Technology Development Of Electric Power Co ltd
Original Assignee
Beijing Missfresh Ecommerce 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 Missfresh Ecommerce Co Ltd filed Critical Beijing Missfresh Ecommerce Co Ltd
Priority to CN202110971921.2A priority Critical patent/CN113419841B/en
Publication of CN113419841A publication Critical patent/CN113419841A/en
Application granted granted Critical
Publication of CN113419841B publication Critical patent/CN113419841B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the disclosure discloses a message scheduling method, a message scheduling device, electronic equipment and a computer readable medium. One embodiment of the method comprises: responding to a received message reading instruction, and acquiring a message queue corresponding to the message reading instruction, wherein the message in the message queue comprises a message identifier and a development environment identifier corresponding to the message identifier; selecting a message corresponding to the current development environment from the message queue as a message to be executed according to each development environment identifier included in the message queue to obtain a message queue to be executed; and executing message scheduling operation based on the message queue to be executed. The embodiment reduces the waiting time of message isolation and improves the efficiency of message isolation.

Description

Message scheduling method and device, electronic equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a message scheduling method, an apparatus, an electronic device, and a computer-readable medium.
Background
At present, in order to solve the problem of message consumption confusion in a test environment, the following methods are generally adopted: a gateway system is developed, and the gateway determines the message forwarding and consuming logic.
However, the following technical problems generally exist in the above manner:
firstly, a set of gateway system is developed, so that the development cost is high and the development period is long; and determining the message going direction through the gateway, resulting in longer waiting time for message isolation;
second, the occupation resource and the submission time of the message are not considered, so that the messages arranged after the message with more occupation resource cannot be run in time.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose message scheduling methods, apparatuses, electronic devices and computer readable media to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a message scheduling method, including: responding to a received message reading instruction, and acquiring a message queue corresponding to the message reading instruction, wherein the message in the message queue comprises a message identifier and a development environment identifier corresponding to the message identifier; selecting a message corresponding to the current development environment from the message queue as a message to be executed according to each development environment identifier included in the message queue to obtain a message queue to be executed; and executing message scheduling operation based on the message queue to be executed.
In a second aspect, some embodiments of the present disclosure provide an apparatus for scheduling a message, the apparatus comprising: the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to respond to a received message reading instruction and acquire a message queue corresponding to the message reading instruction, and messages in the message queue comprise message identifications and development environment identifications corresponding to the message identifications; the selection unit is configured to select a message corresponding to a current development environment from the message queue as a message to be executed according to each development environment identifier included in the message queue, so as to obtain a message queue to be executed; and the scheduling unit is configured to execute message scheduling operation based on the message queue to be executed.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following advantages: by the message scheduling method of some embodiments of the present disclosure, the waiting time for message isolation is reduced, and the efficiency of message isolation is improved. In particular, the reason why the latency time leading to message isolation is long is that: a set of gateway system is developed, so that the development cost is high and the development period is long; and deciding on the message to go through the gateway, resulting in a longer latency for message isolation. Based on this, the message scheduling method of some embodiments of the present disclosure first obtains, in response to receiving a message reading instruction, a message queue corresponding to the message reading instruction. The messages in the message queue comprise message identifications and development environment identifications corresponding to the message identifications. Therefore, data support is provided for subsequent message isolation. And then, according to each development environment identifier included in the message queue, selecting a message corresponding to the current environment from the message queue as a message to be executed, and obtaining a message queue to be executed. Therefore, the message corresponding to the current development environment can be selected for scheduling, so that the effect of message isolated consumption is achieved. And finally, executing message scheduling operation based on the message queue to be executed. Thus, the scheduling operation for the message is completed. Therefore, development of a gateway system is avoided, waiting time of message isolation is reduced, and message isolation efficiency 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 elements are not necessarily drawn to scale.
Fig. 1 is a schematic diagram of one application scenario of a message scheduling method according to some embodiments of the present disclosure;
fig. 2 is a flow diagram of some embodiments of a message scheduling method according to the present disclosure;
FIG. 3 is a flow diagram of further embodiments of a message scheduling method according to the present disclosure;
fig. 4 is a schematic structural diagram of some embodiments of a message scheduling apparatus according to the present disclosure;
FIG. 5 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments 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 disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments 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.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
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.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize 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.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of an application scenario of a message scheduling method according to some embodiments of the present disclosure.
In the application scenario of fig. 1, first, the computing device 101 may obtain, in response to receiving a message reading instruction, a message queue 102 corresponding to the message reading instruction. The message in the message queue 102 includes a message identifier 1021 and a development environment identifier 1022 corresponding to the message identifier 1021. Then, the computing device 101 may select, according to each development environment identifier 1022 included in the message queue 102, a message corresponding to the current development environment from the message queue 102 as a to-be-executed message, so as to obtain the to-be-executed message queue 103. Finally, the computing device 101 may perform message scheduling operations based on the pending message queue 103 described above.
The computing device 101 may be hardware or software. When the computing device is hardware, it may be implemented as a distributed cluster composed of multiple servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices enumerated above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in FIG. 1 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to fig. 2, a flow 200 of some embodiments of a message scheduling method according to the present disclosure is shown. The message scheduling method comprises the following steps:
step 201, in response to receiving a message reading instruction, obtaining a message queue corresponding to the message reading instruction.
In some embodiments, in response to receiving the message reading instruction, an execution subject of the message scheduling method (e.g., the computing device 101 shown in fig. 1) may obtain a message queue corresponding to the message reading instruction from the terminal device through a wired connection or a wireless connection. Here, the message reading instruction may be a reading instruction input by a tester. The messages in the message queue comprise message identifications and development environment identifications corresponding to the message identifications. Here, the development environment identification may refer to an identification of a development environment configured for a message in a message queue in advance. For example, the identification of the exact development environment may be R1. Here, the messages in the message queue may further include a commit time.
As an example, the message queue may be: { [ message identification: AAB, development environment identification: r1, commit time: 2021-8-10-12: 00 ]; [ message identification: ABC, development environment identification: r1, commit time: 2021-8-10-12: 01 ]; [ message identification: ABB, development environment identification: r2, commit time: 2021-8-10-12: 05 ]; [ message identification: ADD, development environment identification: r3, commit time: 2021-8-10-12: 04]}.
Step 202, according to each development environment identifier included in the message queue, selecting a message corresponding to the current development environment from the message queue as a message to be executed, and obtaining a message queue to be executed.
In some embodiments, the execution subject may select, from the message queue, a message that includes a development environment identifier that is the same as an identifier of a current development environment, as a message to be executed, resulting in a message queue to be executed. For example, the identification of the current development environment may be "R1". Thus, a message including the same development environment identifier as the identifier "R1" of the current development environment may be selected from the message queue exemplified in step 201 as a to-be-executed message, resulting in a to-be-executed message queue "{ [ message identifier: AAB, development environment identification: r1, commit time: 2021-8-10-12: 00 ]; [ message identification: ABC, development environment identification: r1, commit time: 2021-8-10-12: 01]}".
Step 203, executing message scheduling operation based on the message queue to be executed.
In some embodiments, the execution main body may sequentially schedule the messages to be executed in the message queue to be executed according to a sequence of commit times included in the messages to be executed in the message queue to be executed. Here, the scheduling operation may be to add the to-be-executed message in the to-be-executed message queue to the thread pool to perform scheduling of the message.
The above embodiments of the present disclosure have the following advantages: by the message scheduling method of some embodiments of the present disclosure, the waiting time for message isolation is reduced, and the efficiency of message isolation is improved. In particular, the reason why the latency time leading to message isolation is long is that: a set of gateway system is developed, so that the development cost is high and the development period is long; and deciding on the message to go through the gateway, resulting in a longer latency for message isolation. Based on this, the message scheduling method of some embodiments of the present disclosure first obtains, in response to receiving a message reading instruction, a message queue corresponding to the message reading instruction. The messages in the message queue comprise message identifications and development environment identifications corresponding to the message identifications. Therefore, data support is provided for subsequent message isolation. And then, according to each development environment identifier included in the message queue, selecting a message corresponding to the current environment from the message queue as a message to be executed, and obtaining a message queue to be executed. Therefore, the message corresponding to the current development environment can be selected for scheduling, so that the effect of message isolated consumption is achieved. And finally, executing message scheduling operation based on the message queue to be executed. Thus, the scheduling operation for the message is completed. Therefore, development of a gateway system is avoided, waiting time of message isolation is reduced, and message isolation efficiency is improved.
With further reference to fig. 3, a flow 300 of further embodiments of a message scheduling method according to the present disclosure is shown. The method may be performed by the computing device 101 of fig. 1. The message scheduling method comprises the following steps:
step 301, in response to receiving a message reading instruction, obtaining a message queue corresponding to the message reading instruction.
Step 302, according to each development environment identifier included in the message queue, selecting a message corresponding to the current development environment from the message queue as a message to be executed, and obtaining a message queue to be executed.
In some embodiments, the specific implementation manner and technical effects of the steps 301 and 302 can refer to the steps 201 and 202 in the embodiments corresponding to fig. 2, which are not described herein again.
Step 303, obtaining thread information of each message thread in the message thread pool to obtain a thread information group.
In some embodiments, an executing agent of the message scheduling method (e.g., computing device 101 shown in fig. 1) may obtain thread information for each message thread in a local message thread pool, resulting in a thread information group. The thread information includes thread identification and execution resource information. Here, the message thread pool may refer to a thread pool used by the local server to process a message. Here, the thread identification may represent a message thread in a message thread pool. Here, the execution resource information may characterize a maximum memory occupied by the message executed by the message thread. Here, the thread information may also include a running state. Here, the run state may characterize whether a thread is running.
As an example, the thread information group may be: { [ thread identification: thread A, executing resource information: 1G, operation state: operating state ]; [ thread identification: thread B, executing resource information: 2G, operation state: idle state ]; [ thread identification: thread C, executing resource information: 3G, operation state: idle state ]; [ thread identification: a thread D, executing resource information: 4G, operation state: operating state ]; [ thread identification: e-thread, executing resource information: 5G, operation state: idle state ] }.
And step 304, determining the message thread with the idle running state in the message thread pool as an alternative message thread, and obtaining an alternative message thread group.
In some embodiments, the execution subject may determine a message thread in the message thread pool, the running state of which is an idle state, as an alternative message thread, to obtain an alternative message thread group. In practice, first, the thread information with the idle running state may be selected from the thread information group as the candidate thread information, so as to obtain the candidate thread information group. Then, the execution subject may determine the message thread corresponding to each candidate thread information in the candidate thread information group as a candidate message thread, so as to obtain a candidate message thread group. As an example, according to the above description of the embodiment, an alternative message thread group "{ [ thread identification: thread A ]; [ thread identification: c thread ]; [ thread identification: e thread ] } ".
And 305, sorting the alternative message thread groups in a descending order based on each execution resource information in the thread information group corresponding to the alternative message thread group to obtain an alternative message thread sequence.
In some embodiments, the execution main body may perform descending order sorting on the alternative message thread groups based on each execution resource information in the thread information group corresponding to the alternative message thread group, so as to obtain an alternative message thread sequence. In practice, the execution main body may perform descending order sorting on the alternative message thread groups according to the largest memory represented by each execution resource information corresponding to each alternative message thread in the alternative message thread groups from large to small in numerical value, so as to obtain an alternative message thread sequence.
As an example, according to the description of the embodiment in step 305, an alternative message thread sequence "{ [ thread identification: e thread ]; [ thread identification: c thread ]; [ thread identification: thread a }.
And step 306, executing message scheduling operation on the to-be-executed message queue based on the alternative message thread sequence.
In some embodiments, the to-be-executed messages in the to-be-executed message queue include: message occupancy resource information, commit time, and priority. Here, the message occupation resource information may represent the memory occupied by the thread when running the message. Here, the submission time may be a time when the developer submits the message. Here, the priority may refer to a priority of processing messages divided in advance.
In practice, based on the alternative message thread sequence, the execution main body may perform a message scheduling operation on the to-be-executed message queue through the following steps:
the method comprises the steps of firstly, selecting a message to be executed which comprises message occupied resource information less than or equal to execution resource information of a first alternative message thread in the alternative message thread sequence from the message queue to be executed as a first message to be executed, and obtaining a first message queue to be executed. In practice, the execution main body may select, from the message queue to be executed, a message to be executed of a running memory, which is characterized by the execution resource information of the first candidate message thread in the candidate message thread sequence and whose memory resource occupied by the message is less than or equal to the memory resource information characterized by the execution resource information of the first candidate message thread, as a first message to be executed, so as to obtain a first message queue to be executed.
And secondly, performing descending processing on the first to-be-executed message queue according to the resource information occupied by each message corresponding to the first to-be-executed message queue to obtain a first to-be-executed message sequence. In practice, the execution main body may perform descending processing on the first to-be-executed message queue from large to small according to the numerical value of the resource information occupied by each message corresponding to the first to-be-executed message queue, so as to obtain a first to-be-executed message sequence.
And thirdly, determining an alternative message thread corresponding to each first message to be executed in the first message sequence to be an execution message thread based on the alternative message thread sequence, and obtaining an execution message thread group.
In practice, the above-mentioned third step comprises the following sub-steps:
and a first substep of selecting an alternative message thread, of which the corresponding execution resource information is greater than or equal to the resource information occupied by the message corresponding to the first to-be-executed message, from the alternative message thread sequence as a first alternative message thread to obtain a first alternative message thread group. In practice, the execution main body may select, from the candidate message thread sequence, a candidate message thread whose running memory resource represented by the execution resource information is greater than or equal to a memory resource represented by the message occupation resource information corresponding to the first to-be-executed message as a first candidate message thread, so as to obtain a first candidate message thread group.
And a second substep, determining a difference value between the execution resource information corresponding to each first candidate message thread in the first candidate message thread group and the message occupation resource information corresponding to the first to-be-executed message as a resource difference value, so as to obtain a resource difference value group. In practice, a difference between the operating memory resource represented by the execution resource information corresponding to each first candidate message thread in the first candidate message thread group and the memory resource represented by the message occupied resource information corresponding to the first to-be-executed message may be determined as a resource difference, so as to obtain a resource difference set.
And a third substep of determining the first candidate message thread corresponding to the resource difference value with the smallest value in the resource difference value group as the execution message thread corresponding to the first to-be-executed message.
And fourthly, performing duplicate removal processing on the execution message thread group based on each thread identifier corresponding to the execution message thread group to obtain a duplicate removal execution message thread group. In practice, the execution main body may perform deduplication processing on each execution message thread having the same thread identifier in the execution message thread group, so as to obtain a deduplication execution message thread group.
And fifthly, executing message scheduling operation on the first to-be-executed message sequence based on the de-duplicated execution message thread group.
In practice, for each of the above-mentioned sets of deduplication execution message threads, the following processing steps are performed:
the first substep, determine every first to-be-executed message that the above-mentioned de-duplication execution message thread corresponds to as the target and carry out the message group.
And a second substep of sequencing the target execution message group based on the sequence of the submission times corresponding to the target execution message group to obtain a target execution message sequence. In practice, the execution main body may sort the target execution message groups according to the order of the submission times corresponding to the target execution message groups, so as to obtain a target execution message sequence.
And a third substep of generating a message execution score based on the sequence number corresponding to each target execution message in the target execution message sequence, the message occupied resource information and the priority, and obtaining a message execution score group. In practice, the execution main body may determine, as the message execution score, a sequence number corresponding to each target execution message, and a product value of the memory resource and the priority represented by the message occupied resource information, to obtain the message execution score group.
And a fourth substep of performing packet evaluation based on the message, and sorting the target execution message group to obtain a target execution message queue. In practice, the execution body may sort the target execution message group from large to small according to the value of the message execution score in the message execution score group, so as to obtain the target execution message queue.
And a fifth substep of executing scheduling operations on the target execution messages in the target execution message queue in sequence based on the de-replay execution message thread. In practice, the execution agent may add each target execution message in the target execution message queue to the deduplication execution message thread in turn to execute the target execution message.
Optionally, a to-be-executed message including message occupied resource information larger than execution resource information of a first candidate message thread in the candidate message thread sequence is selected from the to-be-executed message queue as a second to-be-executed message, so as to obtain a second to-be-executed message queue.
In some embodiments, the execution subject may select, from the message queue to be executed, a message to be executed that includes memory resources represented by message occupied resource information and is greater than running memory resources represented by execution resource information of a first candidate message thread in the candidate message thread sequence, as a second message to be executed, so as to obtain a second message queue to be executed.
Optionally, a second to-be-executed message sequence is generated based on the respective submission times and priorities corresponding to the second to-be-executed message queue.
In some embodiments, the to-be-executed messages in the to-be-executed message queue include: commit time and priority. Here, the message occupation resource information may represent the memory occupied by the thread when running the message. Here, the submission time may be a time when the developer submits the message. Here, the priority may refer to a priority in which the message is divided in advance. In practice, based on the respective submission times and priorities corresponding to the second to-be-executed message queue, the execution main body may generate a second to-be-executed message sequence by:
and step one, sequencing the second to-be-executed message queue according to each priority corresponding to the second to-be-executed message queue to obtain a first alternative to-be-executed message sequence. In practice, the execution main body may sequence the second to-be-executed message queue from large to small according to the numerical values of the priorities corresponding to the second to-be-executed message queue, so as to obtain a first candidate to-be-executed message sequence.
And secondly, for each first alternative to-be-executed message with the same priority in the first alternative to-be-executed message sequence, sequencing each first alternative to-be-executed message according to the sequence of the submission time corresponding to each first alternative to-be-executed message, and obtaining a second to-be-executed message sequence. In practice, the execution main body may sequence, for each first alternative to-be-executed message with the same priority in the first alternative to-be-executed message sequence, each first alternative to-be-executed message with the same priority according to the order of submission times corresponding to each first alternative to-be-executed message, so as to obtain a second to-be-executed message sequence.
Optionally, based on the auxiliary message thread in the message thread pool, scheduling operations are sequentially performed on the second to-be-executed message in the second to-be-executed message sequence.
In some embodiments, the execution agent may add each second to-be-executed message in the second to-be-executed message sequence to the assist message thread in sequence to execute the target execution message. Here, the auxiliary message thread may refer to an auxiliary thread in the thread pool.
The related content in step 303 plus 306 is used as an invention point of the present disclosure, and solves the technical problem mentioned in the background art that "the message cannot be run in time after the message with more occupied message resources because the occupied message resources and the submission time are not considered". The factors that cause the messages arranged behind the message occupying more resources to fail to run in time are often as follows: the occupation resource and the submission time of the message are not considered, so that the messages arranged behind the message with more occupation resource cannot be timely operated. If the above factors are solved, the effect of improving the scheduling efficiency of the message can be achieved. To achieve this effect, the present disclosure first obtains thread information of each message thread in the message thread pool, and obtains a thread information group. The thread information includes thread identification and execution resource information. Therefore, the messages of different memory resources can be added to the corresponding message threads conveniently, and the message threads can be fully utilized. And secondly, selecting a message to be executed, which comprises message occupied resource information less than or equal to the execution resource information of the first alternative message thread in the alternative message thread sequence, from the message queue to be executed as a first message to be executed, and obtaining a first message queue to be executed. Therefore, the message meeting the requirement of the message thread on running the memory is selected to run, so that the phenomenon that the message thread runs in a stuck state due to the fact that the memory resource of the message is too large is prevented. And then, generating a message execution score based on the sequence number, the message occupied resource information and the priority corresponding to each target execution message in the target execution message sequence, and obtaining a message execution score group. And performing grouping evaluation based on the messages, and sequencing the target execution message group to obtain a target execution message queue. And executing scheduling operation on the target execution messages in the target execution message queue in sequence based on the de-replay execution message thread. Therefore, messages which are arranged behind messages which occupy more resources are convenient to run in time, and the messages which occupy less resources are arranged behind the messages which occupy more resources. Then, selecting a message to be executed, which comprises message occupied resource information larger than the execution resource information of the first alternative message thread in the alternative message thread sequence, from the message queue to be executed as a second message to be executed, and obtaining a second message queue to be executed; and generating a second message sequence to be executed based on the submission time and the priority corresponding to the second message sequence to be executed. Therefore, the message with more resource occupied by the message can be selected. And finally, based on the auxiliary message thread in the message thread pool, sequentially executing scheduling operation on the second to-be-executed message in the second to-be-executed message sequence. Therefore, the scheduling of the message occupying more resources is completed. Therefore, the messages arranged behind the messages with more resources occupied by some messages can be operated in time, and the message scheduling efficiency is improved.
As can be seen from fig. 3, compared with the description of some embodiments corresponding to fig. 2, the process 300 of the message scheduling method in some embodiments corresponding to fig. 3 facilitates to run messages arranged after some messages occupying more resources in time, and improves the efficiency of message scheduling.
With further reference to fig. 4, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides some embodiments of a message scheduling apparatus, which correspond to those of the method embodiments described above in fig. 2, and which may be applied in various electronic devices.
As shown in fig. 4, the message scheduling apparatus 400 of some embodiments includes: an acquisition unit 401, a selection unit 402 and a scheduling unit 403. The obtaining unit 401 is configured to, in response to receiving a message reading instruction, obtain a message queue corresponding to the message reading instruction, where messages in the message queue include a message identifier and a development environment identifier corresponding to the message identifier; the selecting unit 402 is configured to select, according to each development environment identifier included in the message queue, a message corresponding to a current development environment from the message queue as a message to be executed, and obtain a message queue to be executed; the scheduling unit 403 is configured to perform a message scheduling operation based on the message queue to be executed.
It will be understood that the elements described in the apparatus 400 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 400 and the units included therein, and will not be described herein again.
Referring now to FIG. 5, a block diagram of an electronic device (e.g., computing device 101 of FIG. 1) 500 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 5 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. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 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. Each block shown in fig. 5 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program, when executed by the processing device 501, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may 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 some embodiments of the 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 some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: 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 apparatus; 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: responding to a received message reading instruction, and acquiring a message queue corresponding to the message reading instruction, wherein the message in the message queue comprises a message identifier and a development environment identifier corresponding to the message identifier; selecting a message corresponding to the current development environment from the message queue as a message to be executed according to each development environment identifier included in the message queue to obtain a message queue to be executed; and executing message scheduling operation based on the message queue to be executed.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including 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 some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a selection unit, and a scheduling unit. For example, the selection unit may be further described as "a unit that selects, according to the identifiers of the development environments included in the message queue, a message corresponding to the current development environment from the message queue as a message to be executed, and obtains a message queue to be executed" according to the identifiers of the development environments included in the message queue.
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.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A method of message scheduling, comprising:
responding to a received message reading instruction, and acquiring a message queue corresponding to the message reading instruction, wherein messages in the message queue comprise message identifications and development environment identifications corresponding to the message identifications;
selecting a message corresponding to the current development environment from the message queue as a message to be executed according to each development environment identifier included in the message queue to obtain a message queue to be executed;
and executing message scheduling operation based on the message queue to be executed.
2. The method of claim 1, wherein the pending messages in the pending message queue comprise: resource information occupied by the message; and
the executing of the message scheduling operation based on the to-be-executed message queue includes:
acquiring thread information of each message thread in a message thread pool to obtain a thread information group, wherein the thread information comprises thread identification and execution resource information;
determining the message thread with the idle running state in the message thread pool as an alternative message thread to obtain an alternative message thread group;
based on each execution resource information in the thread information group corresponding to the alternative message thread group, performing descending order on the alternative message thread group to obtain an alternative message thread sequence;
and executing message scheduling operation on the message queue to be executed based on the alternative message thread sequence.
3. The method of claim 2, wherein the performing a message scheduling operation on the queue of messages to be executed based on the sequence of alternative message threads comprises:
selecting a message to be executed, which includes message occupied resource information less than or equal to execution resource information of a first alternative message thread in the alternative message thread sequence, from the message queue to be executed as a first message to be executed, and obtaining a first message queue to be executed;
according to the resource information occupied by each message corresponding to the first to-be-executed message queue, performing descending processing on the first to-be-executed message queue to obtain a first to-be-executed message sequence;
determining an alternative message thread corresponding to each first message to be executed in the first message sequence to be an execution message thread based on the alternative message thread sequence, so as to obtain an execution message thread group;
based on each thread identifier corresponding to the execution message thread group, carrying out duplicate removal processing on the execution message thread group to obtain a duplicate removal execution message thread group;
and executing message scheduling operation on the first to-be-executed message sequence based on the de-replay message thread group.
4. The method of claim 3, wherein the determining, based on the sequence of alternative message threads, an alternative message thread corresponding to each first to-be-executed message in the sequence of first to-be-executed messages as a message thread of execution comprises:
selecting an alternative message thread of which the corresponding execution resource information is greater than or equal to the resource information occupied by the message corresponding to the first message to be executed from the alternative message thread sequence as a first alternative message thread to obtain a first alternative message thread group;
determining a difference value between execution resource information corresponding to each first alternative message thread in the first alternative message thread group and message occupied resource information corresponding to the first message to be executed as a resource difference value to obtain a resource difference value group;
and determining the first alternative message thread corresponding to the resource difference value with the minimum value in the resource difference value group as the execution message thread corresponding to the first to-be-executed message.
5. The method of claim 3, wherein the pending messages in the pending message queue comprise: commit time and priority; and
the executing the message scheduling operation on the first to-be-executed message sequence based on the de-replay message thread group includes:
for each deduplication execution message thread in the deduplication execution message thread group, performing the following processing steps:
determining each first to-be-executed message corresponding to the duplicate removal execution message thread as a target execution message group;
sequencing the target execution message group based on the sequence of the submission times corresponding to the target execution message group to obtain a target execution message sequence;
generating a message execution score based on the sequence number corresponding to each target execution message in the target execution message sequence, the message occupied resource information and the priority, and obtaining a message execution score group;
ranking the target execution message group based on the message execution grouping to obtain a target execution message queue;
and sequentially executing scheduling operation on the target execution messages in the target execution message queue based on the de-replay execution message thread.
6. The method of claim 2, wherein the pending messages in the pending message queue comprise: commit time and priority; and
the method further comprises the following steps:
selecting a message to be executed, which comprises message occupied resource information larger than the execution resource information of the first alternative message thread in the alternative message thread sequence, from the message queue to be executed as a second message to be executed, so as to obtain a second message queue to be executed;
generating a second message sequence to be executed based on the submission time and the priority corresponding to the second message sequence to be executed;
and sequentially executing scheduling operation on the second to-be-executed message in the second to-be-executed message sequence based on the auxiliary message thread in the message thread pool.
7. The method of claim 6, wherein generating a second sequence of messages to be executed based on respective commit times and priorities corresponding to the second queue of messages to be executed comprises:
sequencing the second to-be-executed message queue according to each priority corresponding to the second to-be-executed message queue to obtain a first alternative to-be-executed message sequence;
and for each first alternative message to be executed with the same priority in the first alternative message sequence to be executed, sequencing each first alternative message to be executed according to the sequence of the submission time corresponding to each first alternative message to be executed to obtain a second message sequence to be executed.
8. A message scheduling apparatus, comprising:
the information processing device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to respond to a received information reading instruction and acquire an information queue corresponding to the information reading instruction, and the information in the information queue comprises an information identifier and a development environment identifier corresponding to the information identifier;
the selection unit is configured to select a message corresponding to the current development environment from the message queue as a message to be executed according to each development environment identifier included in the message queue, so as to obtain a message queue to be executed;
and the scheduling unit is configured to execute message scheduling operation based on the message queue to be executed.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
CN202110971921.2A 2021-08-24 2021-08-24 Message scheduling method and device, electronic equipment and computer readable medium Active CN113419841B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110971921.2A CN113419841B (en) 2021-08-24 2021-08-24 Message scheduling method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110971921.2A CN113419841B (en) 2021-08-24 2021-08-24 Message scheduling method and device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN113419841A true CN113419841A (en) 2021-09-21
CN113419841B CN113419841B (en) 2021-11-23

Family

ID=77719523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110971921.2A Active CN113419841B (en) 2021-08-24 2021-08-24 Message scheduling method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113419841B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114281572A (en) * 2021-12-28 2022-04-05 重庆允成互联网科技有限公司 Cross-service business life cycle management method and system
WO2023151498A1 (en) * 2022-02-11 2023-08-17 深圳Tcl新技术有限公司 Message execution processing method and apparatus, electronic device, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101324851A (en) * 2007-06-12 2008-12-17 华为技术有限公司 Method and apparatus of thread scheduling
CN108052400A (en) * 2017-12-21 2018-05-18 深圳Tcl新技术有限公司 Message immediate processing method, intelligent terminal and computer readable storage medium
CN110347520A (en) * 2019-06-28 2019-10-18 北京大米科技有限公司 Method, apparatus, electronic equipment and the medium of message distribution
CN110837410A (en) * 2019-10-30 2020-02-25 北京奇艺世纪科技有限公司 Task scheduling method and device, electronic equipment and computer readable storage medium
US20200257577A1 (en) * 2018-04-18 2020-08-13 Open Text GXS ULC Producer-Side Prioritization of Message Processing
CN113238861A (en) * 2021-05-08 2021-08-10 北京天空卫士网络安全技术有限公司 Task execution method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101324851A (en) * 2007-06-12 2008-12-17 华为技术有限公司 Method and apparatus of thread scheduling
CN108052400A (en) * 2017-12-21 2018-05-18 深圳Tcl新技术有限公司 Message immediate processing method, intelligent terminal and computer readable storage medium
US20200257577A1 (en) * 2018-04-18 2020-08-13 Open Text GXS ULC Producer-Side Prioritization of Message Processing
CN110347520A (en) * 2019-06-28 2019-10-18 北京大米科技有限公司 Method, apparatus, electronic equipment and the medium of message distribution
CN110837410A (en) * 2019-10-30 2020-02-25 北京奇艺世纪科技有限公司 Task scheduling method and device, electronic equipment and computer readable storage medium
CN113238861A (en) * 2021-05-08 2021-08-10 北京天空卫士网络安全技术有限公司 Task execution method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114281572A (en) * 2021-12-28 2022-04-05 重庆允成互联网科技有限公司 Cross-service business life cycle management method and system
WO2023151498A1 (en) * 2022-02-11 2023-08-17 深圳Tcl新技术有限公司 Message execution processing method and apparatus, electronic device, and storage medium

Also Published As

Publication number Publication date
CN113419841B (en) 2021-11-23

Similar Documents

Publication Publication Date Title
CN111950988B (en) Distributed workflow scheduling method and device, storage medium and electronic equipment
CN113419841B (en) Message scheduling method and device, electronic equipment and computer readable medium
CN112311656B (en) Message aggregation and display method and device, electronic equipment and computer readable medium
CN113722056A (en) Task scheduling method and device, electronic equipment and computer readable medium
CN110795446A (en) List updating method and device, readable medium and electronic equipment
CN113760991A (en) Data operation method and device, electronic equipment and computer readable medium
CN113760488A (en) Method, device, equipment and computer readable medium for scheduling task
CN113722055A (en) Data processing method and device, electronic equipment and computer readable medium
CN115357350A (en) Task configuration method and device, electronic equipment and computer readable medium
CN111857720A (en) Method and device for generating user interface state information, electronic equipment and medium
CN111898061B (en) Method, apparatus, electronic device and computer readable medium for searching network
CN113392018A (en) Traffic distribution method, traffic distribution device, storage medium, and electronic device
CN110489219B (en) Method, device, medium and electronic equipment for scheduling functional objects
CN112732979B (en) Information writing method, information writing device, electronic equipment and computer readable medium
CN111209042B (en) Method, device, medium and electronic equipment for establishing function stack
CN112346891A (en) Message storage method, device, equipment and computer readable medium
CN113778850A (en) Data processing method and device, electronic equipment and computer readable medium
CN113176937A (en) Task processing method and device and electronic equipment
CN112965827B (en) Information scheduling method and device, electronic equipment and computer medium
CN115994120B (en) Data file merging method, device, electronic equipment and computer readable medium
CN111404824B (en) Method, apparatus, electronic device, and computer-readable medium for forwarding request
CN112203113B (en) Video stream structuring method and device, electronic equipment and computer readable medium
CN115374320B (en) Text matching method and device, electronic equipment and computer medium
CN113420170B (en) Multithreading storage method, device, equipment and medium for big data image
CN115562892B (en) Redis-based simulation system time management method, system, device and equipment

Legal Events

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

Effective date of registration: 20231109

Address after: 518000 807, No. 121, Minsheng Avenue, Shangcun Community, Gongming Street, Guangming District, Shenzhen, Guangdong

Patentee after: Shenzhen Zhuanxin Intellectual Property Service Co.,Ltd.

Address before: 100102 room 076, no.1-302, 3 / F, commercial building, No.9 Wangjing street, Chaoyang District, Beijing

Patentee before: BEIJING MISSFRESH E-COMMERCE Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231214

Address after: No. 546, Luoyu Road, Hongshan District, Wuhan, Hubei Province, 430000

Patentee after: HUBEI CENTRAL CHINA TECHNOLOGY DEVELOPMENT OF ELECTRIC POWER Co.,Ltd.

Address before: 518000 807, No. 121, Minsheng Avenue, Shangcun Community, Gongming Street, Guangming District, Shenzhen, Guangdong

Patentee before: Shenzhen Zhuanxin Intellectual Property Service Co.,Ltd.

TR01 Transfer of patent right