Priority setting method and device, computer equipment and storage medium

By sorting and setting priorities of the global task parameters of the task system, the difficulty of priority coordination and duplication between different task systems is solved, and the uniqueness of the global priority and the accuracy of the task execution sequence are achieved.

CN118796394APending Publication Date: 2024-10-18BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410865792.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In computer room management, priority coordination between different task systems is difficult, causing task priorities to lose practical meaning, and priorities may be duplicated or blurred, affecting the accuracy of task execution sequences.

Method used

By obtaining the setting request sent by the task system, the tasks to be processed are sorted according to the global task parameters, and a unique global priority is set for them to ensure priority coordination and uniqueness between different task systems.

Benefits of technology

It achieves priority coordination between task systems, ensures the uniqueness of global priorities, avoids duplication and ambiguity of priorities, and improves the accuracy of task execution order.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796394A_ABST
    Figure CN118796394A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of task management, and discloses a priority setting method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a setting request sent by at least one task system; the setting request comprises global task parameters of a to-be-processed task; sorting the plurality of to-be-processed tasks according to the global task parameters of the plurality of to-be-processed tasks; and setting a unique global priority for the plurality of to-be-processed tasks in sequence. According to the method, the globally unique global priority is configured for the tasks of the multiple task systems in a unified manner, priority coordination among the different task systems is realized, the global uniqueness of the global priority can be ensured, the priority of the tasks in the task systems can be globally unique, the tasks of the different task systems correspond to different global priorities, and the overall uniqueness of the tasks in the task systems can be ensured. Therefore, the problem of poor field execution sequence of the tasks caused by fuzzy or repeated task priorities and the like can be effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of task management, and in particular to a method, apparatus, computer equipment and storage medium for setting priorities. Background Art

[0002] In computer room management, offline administrators receive various tasks assigned by the online task system every day, such as receipt tasks, inventory tasks, and outbound tasks. Since the number of administrators is relatively fixed, when the number of tasks increases, the administrators will randomly select tasks to process, which makes it impossible to accurately estimate the expected start time of each task. Therefore, the online task system usually adds a priority information to the task to guide the offline administrator to complete the tasks in the expected order.

[0003] However, when there are many task systems, it is difficult to coordinate the priorities of different task systems, and it is easy for multiple tasks of the same priority to appear, causing the assigned priority to lose practical meaning. Summary of the invention

[0004] In view of this, the present disclosure provides a method, apparatus, computer device and storage medium for setting priorities to solve the problem that task priorities are easily repeated.

[0005] In a first aspect, the present disclosure provides a method for setting a priority, which is applied to a priority system, comprising:

[0006] Obtaining a setting request sent by at least one task system; the setting request includes global task parameters of the task to be processed;

[0007] Sorting the multiple tasks to be processed according to the global task parameters of the multiple tasks to be processed;

[0008] A unique global priority is sequentially set for the multiple tasks to be processed.

[0009] In a second aspect, the present disclosure provides a method for setting a priority, which is applied to a task system, comprising:

[0010] Identify pending tasks;

[0011] Setting global task parameters for the task to be processed;

[0012] Send a setting request to the priority system; the setting request includes the global task parameters of the pending task, and the setting request is used to instruct the priority system to sort multiple pending tasks according to the global task parameters of the pending tasks, and set a unique global priority for the pending tasks in sequence.

[0013] In a third aspect, the present disclosure provides a device for setting a priority, which is applied to a priority system, and the device includes:

[0014] An acquisition module, used to acquire a setting request sent by at least one task system; the setting request includes global task parameters of the task to be processed;

[0015] A sorting module, used for sorting the multiple tasks to be processed according to the global task parameters of the multiple tasks to be processed;

[0016] The priority setting module is used to sequentially set a unique global priority for the multiple tasks to be processed.

[0017] In a fourth aspect, the present disclosure provides a device for setting a priority, which is applied to a task system, and the device includes:

[0018] A task determination module, used to determine tasks to be processed;

[0019] A parameter setting module, used for setting global task parameters for the task to be processed;

[0020] A sending module is used to send a setting request to the priority system; the setting request includes the global task parameters of the pending tasks, and the setting request is used to instruct the priority system to sort multiple pending tasks according to the global task parameters of the pending tasks, and set a unique global priority for the pending tasks in sequence.

[0021] In a fifth aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the method for setting priority of the first aspect, the second aspect or any corresponding embodiment thereof by executing the computer instructions.

[0022] In a sixth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to cause a computer to execute the method for setting priority of the first aspect, the second aspect or any corresponding embodiment thereof.

[0023] The disclosed embodiments can uniformly configure a globally unique global priority for tasks of multiple task systems, thereby achieving priority coordination among different task systems; and, by generating a global priority based on the global task parameters generated by the task system, the global uniqueness of the global priority can be ensured. The priority of tasks in the task system can be globally unique, and tasks of different task systems correspond to different global priorities, thereby effectively avoiding problems such as poor on-site execution order of tasks due to ambiguity or duplication of task priorities. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0025] Figure 1 is a schematic diagram of dispatching tasks by a multi-task system according to an embodiment of the present disclosure;

[0026] Figure 2 is a flowchart of a method for setting priority according to an embodiment of the present disclosure;

[0027] Figure 3 is a schematic diagram of setting global priority according to the priority system of an embodiment of the present disclosure;

[0028] Figure 4 is a flowchart of another method for setting priority according to an embodiment of the present disclosure;

[0029] Figure 5 is a system interaction flow chart according to an embodiment of the present disclosure;

[0030] Figure 6 is a flowchart of setting priorities of a task system according to an embodiment of the present disclosure;

[0031] Figure 7 is a structural block diagram of a device for setting a priority level in a priority system according to an embodiment of the present disclosure;

[0032] Figure 8 is a structural block diagram of a device for setting priorities of a task system according to an embodiment of the present disclosure;

[0033] Fig. 9 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0035] In computer room management, various task systems will assign tasks to administrators. Figure 1A schematic diagram of multi-task system dispatching tasks is shown. Figure 1 As shown, the task system includes a delivery system, an asset system, an inventory system, etc. Each task system can add a priority field to the dispatched tasks, and its flag is, for example, P0, P1, P2, etc.

[0036] However, since each task system is independent of each other, each task system divides the task priority independently, which makes it difficult to coordinate the priorities between different task systems; and, since there are few priority levels, the meaning of the priority assigned by the task system is vague, which may lead to uncertainty in the order of task execution. In addition, there may be multiple tasks with the same priority, such as Figure 1 As shown, the priorities of the signing task 1 and the inventory task 1 are both P0. Especially when there are a large number of task systems, priority conflicts are more likely to occur, which makes the allocation of priorities lose practical significance.

[0037] According to the method for setting priorities provided by the embodiments of the present disclosure, each task system can set global task parameters for its own pending tasks, and then the priority system sets a unique global priority based on the global task parameters of these pending tasks, thereby uniformly setting priorities for the pending tasks of multiple task systems and ensuring the uniqueness of the priorities.

[0038] According to an embodiment of the present disclosure, a method embodiment for setting priority is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0039] In this embodiment, a method for setting priority is provided, which can be applied to a priority system. The priority system can be deployed in a device such as a dispatching center. Figure 2 is a flowchart of a method for setting priority according to an embodiment of the present disclosure, such as Figure 2 As shown, the process includes the following steps.

[0040] Step S201, obtaining a setting request sent by at least one task system; the setting request includes global task parameters of the task to be processed.

[0041] In this embodiment, the priority system sets a unique priority, i.e., a global priority, for tasks in one or more task systems. Specifically, when a task system determines that there are currently one or more pending tasks that need to be processed, the task system can send a setting request for setting a global priority to the priority system, so as to determine a unique global priority for the pending tasks.

[0042] Among them, the task system needs to determine the relevant task parameters of the task to be processed. The task parameters are used to determine the global priority, so the task parameters also need to be globally unique. For the convenience of description, the task parameters are called global task parameters.

[0043] For example, the global task parameter may be a globally unique numerical value or a globally unique character string, etc., which is not limited in this embodiment.

[0044] Step S202: sorting the multiple tasks to be processed according to their global task parameters.

[0045] The priority system can receive multiple setting requests, that is, the priority system can obtain global task parameters of multiple tasks to be processed; for example, the priority system can obtain multiple setting requests sent by a task system, or the priority system can obtain one or more setting requests sent by multiple task systems respectively.

[0046] When there are multiple tasks to be processed, the priority system can sort these tasks according to their global task parameters. For example, these tasks can be sorted in ascending order according to the size of the global task parameters.

[0047] It can be understood that if only a global priority needs to be set for one pending task, for example, the priority system only receives the global task parameters of a pending task sent by a task system, then the global priority can be set directly for the only pending task, such as the highest global priority, etc. This embodiment does not focus on this situation.

[0048] Step S203: setting a unique global priority for the multiple tasks to be processed in sequence.

[0049] In this embodiment, after sorting multiple pending tasks, a unique global priority can be set for each pending task according to the sorting order; the global priority is an absolute priority, and different pending tasks have different global priorities. For example, the higher the pending task is in the sorting order, the higher the global priority level is assigned to it, so that the administrator can give priority to the pending tasks with higher sorting order.

[0050] Figure 3 A schematic diagram showing a priority system setting global priority is shown. Figure 3 Take the example that the global task parameter is a Score. Figure 3As shown, task system A includes three pending tasks, namely, sign-off task 1, sign-off task 2, and sign-off task 3, and the global task parameters of the three pending tasks are score 1, score 5, and score 2 respectively; and task system B includes two pending tasks, namely, inventory task 1 and disassembly task 2, and the global task parameters of the two pending tasks are score 3 and score 4 respectively. The two task systems can send the scores of the corresponding pending tasks to the priority system by setting requests.

[0051] After the priority system obtains these five scores, it can sort them and set a global priority of 1 to 5. Figure 3 As shown in the figure, the global priorities of Signing Task 1, Signing Task 2, Signing Task 3, Inventory Task 1, and Disassembly Task 2 are 1, 5, 2, 3, and 4 respectively. Based on the global priorities, the administrator can be guided to complete the corresponding tasks in the order of "Signing Task 1 → Signing Task 3 → Inventory Task 1 → Disassembly Task 2 → Signing Task 2".

[0052] According to the method for setting priorities provided by the embodiments of the present disclosure, the priority system uniformly configures a globally unique global priority for tasks of multiple task systems, thereby realizing priority coordination among different task systems; and, based on the global task parameters generated by the task system, the global priority is generated, thereby ensuring the global uniqueness of the global priority. The priority of tasks in the task system can be globally unique, and tasks of different task systems correspond to different global priorities, thereby effectively avoiding problems such as poor on-site execution order of tasks due to ambiguity or duplication of task priorities.

[0053] In this embodiment, a method for setting priority is provided, which can be applied to a priority system. The priority system can be deployed in a device such as a dispatching center. Figure 4 is a flowchart of a method for setting priority according to an embodiment of the present disclosure, such as Figure 4 As shown, the process includes the following steps.

[0054] Step S401, obtaining a setting request sent by at least one task system; the setting request includes global task parameters of the task to be processed.

[0055] For details, please see Figure 2 Step S201 of the illustrated embodiment will not be described in detail here.

[0056] Optionally, the setting request is an asynchronous message. In other words, when the task system determines that there are pending tasks that need to determine the global priority, it can directly send the corresponding setting request to the priority system in the form of an asynchronous message without caring about whether it receives a response from the priority system. That is, the task system does not need to pay attention to the process of the priority system configuring the global priority, thus realizing the decoupling of the task system and the priority system.

[0057] Moreover, the task data of the task system and the priority data of the priority system can be separated. The task data only needs to save the generated global task parameters (such as Score) without caring about the specific priority. The storage, construction, acquisition, etc. of the priority (i.e., the global priority) are all handled by an independent priority system. Furthermore, the task system can also sort its pending tasks according to the global task parameters and display the tasks in order without knowing the global priority.

[0058] Step S402: Sort the multiple pending tasks according to the global task parameters of the multiple pending tasks.

[0059] For details, please refer to Figure 2 Step S202 of the illustrated embodiment, which will not be elaborated here.

[0060] It should be noted that since there may be cases of adding or clearing pending tasks, when the priority system has a setting task that needs to set the global priority (this task is a task executed by the priority system and is different from the pending tasks in the task system), all pending tasks can be sorted regardless of whether the pending task has been set with a global priority.

[0061] For example, taking the Figure 3 illustrated solution as an example, the priority system has currently set global priorities for 5 pending tasks. If a new setting request for a pending task is received from a certain task system at this time, and the global task parameter of the new pending task is Score 6, then there are 6 pending tasks at this time, and they need to be sorted according to the global task parameters of these 6 pending tasks. For example, if Score 3 < Score 6 < Score 4, then the new pending task is in the 4th position in the sorted queue, that is, the global priority of the new pending task is 4, and the global priority of disassembly task 1 is updated from 4 to 5, and the global priority of receipt task 2 is updated from 5 to 6.

[0062] Step S403: Set a unique global priority for the multiple pending tasks in order.

[0063] For details, please refer to Figure 2 Step S203 of the illustrated embodiment, which will not be elaborated here.

[0064] In some optional implementations, the above step S403 of "setting unique global priorities for multiple tasks to be processed in sequence" may include the following steps A1.

[0065] Step A1: setting unique and continuous global priorities for multiple tasks to be processed in sequence.

[0066] In this embodiment, when setting the global priority for the pending tasks, the set global priority is continuous and there is no missing. For example, if the global priority is set starting from 1, the global priorities of multiple pending tasks can be set to 1, 2, 3, 4, etc. in sequence, but not to 1, 2, 4 (missing 3).

[0067] The global priority in this embodiment mainly provides the priority of pending tasks to users (such as administrators) to guide users to execute pending tasks in sequence according to the global priority. Setting continuous global priorities is in line with user perception and can avoid the risk of tasks being missed to a certain extent.

[0068] Optionally, the method further includes steps B1 to B2.

[0069] Step B1, in response to a clearing request for clearing at least one pending task, clearing relevant data of at least one pending task.

[0070] Step B2: resetting a unique and continuous global priority for the remaining pending tasks that have not been cleared.

[0071] In this embodiment, in addition to obtaining the setting request sent by the task system, the priority system can also obtain a clear request for clearing one or more pending tasks; for example, the task system can send a corresponding clear request to the priority system, or, if the user has the authority to clear the task, the user can also initiate the clear request.

[0072] After the priority system obtains the clearing request, it can respond to the clearing request to clear the relevant data of the corresponding pending tasks, such as clearing the global priority of these pending tasks. If there are pending tasks that have not been cleared, the global priority of these pending tasks that have not been cleared can be reset; wherein, the pending tasks that have not been cleared can be reordered to reset the global priority. Alternatively, if the pending tasks that have not been cleared have been set with global priorities before, only the global priorities of other pending tasks that are located after the pending tasks that need to be cleared can be corrected. For example, if the global priorities are set in the order of 1, 2, and 3, the global priorities of other pending tasks that are located after the pending tasks that need to be cleared can be reduced by one to achieve the correction of the global priorities of the pending tasks that have not been cleared.

[0073] For example, the priority system can build a task list, which maintains pending tasks. When a clearing request is received, the corresponding pending tasks in the task list can be cleared. Correspondingly, the pending tasks retained in the task list are the pending tasks that have not been cleared. Subsequently, unique and continuous global priorities can be reset for these pending tasks.

[0074] The clear request may specifically be a cancel request for canceling a task, or a delete request for deleting a task.

[0075] Figure 5 The system interaction flow chart is shown in Figure 2. Figure 5 As shown, if the task system needs to add a new task to be processed, a new global task parameter can be generated for the new task to be processed. Figure 5 Take Score as an example; and each task is provided with task data, the task data includes a Score field for recording the Score. After the Score is generated, the Score can be entered into the Score field of the task data, and a corresponding setting request is initiated to the priority system.

[0076] If the task system needs to cancel a pending task, it can locate the pending task, delete the Score in the task data of the pending task (keep other data), and initiate a corresponding cancellation request to the priority system. If the task system needs to delete a pending task, it can locate the pending task, delete all the task data of the pending task, and initiate a corresponding deletion request to the priority system.

[0077] Among them, after the task system cancels a pending task, it does not need to set the global priority. The user executes the pending task, but the corresponding task record is still retained; after the task system deletes a pending task, all data of the pending task is deleted, which is equivalent to the non-existence of the pending task.

[0078] After receiving the corresponding setting request, cancellation request or deletion request, the priority system can update the corresponding task list. The scheduling center can obtain the updated task list and perform task scheduling based on the updated task list to set the global priority of each pending task.

[0079] In this embodiment, a continuous global priority is set for the tasks to be processed, which is in line with user perception and is conducive to correctly guiding users to process tasks in order of priority; and when adding or removing tasks, the global priority can be updated in real time to ensure that a continuous global priority can be provided to users.

[0080] Step S404, generating global priority data; the global priority data includes the global priorities of all currently set tasks to be processed.

[0081] In this embodiment, after the priority system determines the global priorities of the tasks to be processed, the global priorities are recorded to form corresponding global priority data, wherein the global priority data is initially empty.

[0082] For example, a global priority list for recording all global priorities may be set, and after the global priorities are generated, these global priorities are recorded in the global priority list, and the global priority list represents the global priority data.

[0083] In some optional implementations, the global priority data can assist the task system in generating corresponding global task parameters. Specifically, the global task parameters include at least two parameters, namely, a first parameter and a second parameter; and the process of the task system setting the global task parameters for the task to be processed can include the following steps C1 to C5.

[0084] Step C1, setting a target priority for the task to be processed.

[0085] When the task system generates global task parameters for a newly added task to be processed, you can set a preliminary priority for the task to be processed, that is, a target priority. The target priority can be determined based on an expert knowledge base, etc.

[0086] For example, a priority range can be pre-set, and the task system selects an appropriate priority from the priority range as the target priority according to the urgency of the task to be processed. The priority range can be fixed or based on the number of global priorities set by the current priority system, which is not limited in this embodiment.

[0087] Step C2, determining whether there is a global priority in the global priority data that is the same as the target priority.

[0088] As described above, the global priority data includes multiple global priorities, and the task system can determine whether there is a global priority in the global priority data that is the same as the target priority of the task to be processed. For example, the task system can send the target priority to the priority system, and the priority system returns to the task system whether the target priority is repeated; or the task system can also obtain the current global priority data to determine whether the target priority is repeated.

[0089] Step C3: when there is no global priority that is the same as the target priority in the global priority data, determine the first parameter of the global task parameter according to the target priority.

[0090] Step C4, when there is a global priority that is the same as the target priority in the global priority data, the first parameter corresponding to the global priority that is the same as the target priority is used as the first parameter of the global task parameter.

[0091] In the embodiment of the present disclosure, if there is no global priority in the global priority data that is the same as the target priority, that is, the target priority is not repeated, the target priority can be directly used to generate the corresponding first parameter. For example, the target priority is used as the first parameter of the task to be processed.

[0092] If there is a global priority that is the same as the target priority in the global priority data, it means that the target priority is repeated. At this time, if the target priority is used as the first parameter of the task to be processed, since the global priority has been determined to be different from the corresponding first parameter, this may lead to inaccurate subsequent determination of the global priority of the task to be processed, for example, the global priority of the task to be processed is too high or too low. In this embodiment, if the target priority is repeated, the first parameter corresponding to the global priority that is the same as the target priority is used as the first parameter of the global task parameter to try to ensure that the global priority set for the task to be processed later meets the setting requirements of the task system.

[0093] Step C5, generating a second parameter of the global task parameter according to the current timestamp.

[0094] In the disclosed embodiment, the second parameter can be set independently, that is, the first parameter and the second parameter can be set at the same time, or the first parameter can be set first and then the second parameter, or the second parameter can be set first and then the first parameter. Specifically, in order to ensure the uniqueness of the global task parameter, when setting the second parameter, the timestamp of the current time, that is, the current timestamp, is determined, and the timestamp can be, for example, a timestamp in the form of Unix. After determining the current timestamp, the second parameter of the global task parameter can be generated according to the current timestamp. For example, the current timestamp can be used as the second parameter of the global task parameter.

[0095] Alternatively, since the number of pending tasks is not fixed, in order to accurately set appropriate priorities for urgent tasks, the target priority and global priority are set such that the smaller the value corresponding to the priority, the higher the priority, and the more likely the user is to prioritize the corresponding task. In order to prioritize the latest pending task, the current timestamp and the second parameter may be negatively correlated, that is, the larger the current timestamp, the smaller the second parameter, so that a smaller global task parameter is set for the pending task.

[0096] Specifically, the second parameter of the global task parameter can be: the difference between the preset timestamp upper limit value and the current timestamp. The timestamp upper limit value is a preset value, and it is only necessary to ensure that the current timestamp does not exceed the timestamp upper limit value. For example, the timestamp upper limit value can be the maximum value of a 64-bit number, that is, 9223372036854775807.

[0097] For example, if Score represents the global task parameter, the rule for generating Score based on the current timestamp can be:

[0098] Score=mapping(${priority})_(9223372036854775807-${current_unix_time}).

[0099] Among them, Score is divided into two sections. The first section mapping(${priority}) represents the first parameter, and the second section (9223372036854775807-${current_unix_time}) represents the second parameter. The two parameters are connected by "_".

[0100] For the first parameter, priority represents the set target priority, and the mapping function is a mapping function between the target priority and the first parameter, which can convert the specific target priority to obtain the final first parameter. As shown in the above steps C2 to C4, if there is no data with global priority = priority in the current priority system, the result after mapping is priority itself. If there is already data with global priority = priority in the current priority system, the result after mapping is the first parameter of the Score of the data.

[0101] For the second parameter, current_unix_time represents the current timestamp, which is the Unix expression of the current time. Since the timestamp can be accurate to milliseconds (ms), the pending tasks of different task systems will basically not have the same timestamp, which can effectively ensure the global uniqueness of the generated Score.

[0102] For example, if the target priority set by the task system for a pending task is 12, and the current time is 0:00 on January 1, 2024, the current timestamp corresponding to the current time is 1704038400000, and the second parameter is 9223370332816375807.

[0103] Furthermore, if there is no Score with a global priority of 12 in the current priority system, the Score of the task to be processed is: Score=12_9223370332816375807.

[0104] On the contrary, if there is a Score with a global priority of 12 in the current priority system (hereinafter referred to as Score A to represent the Score with a global priority of 12), and the first parameter of Score A is X, then the Score of the task to be processed is: Score=X_9223370332816375807.

[0105] Among them, since the first parameters of different pending tasks may be the same, and there may be situations where pending tasks are added or deleted, the first parameter X of the Score with a global priority of 12 may be 12, or it may be other values, such as 11, 13, etc., depending on the actual situation. When the Score of the pending task is set in this way, even if there is already a global priority of 12, since the pending task has a newer timestamp than the task corresponding to the global priority of 12, that is, the second parameter of the pending task is smaller; even if the two tasks have the same prefix (that is, the first parameter), the pending task set later in time has a larger natural order corresponding to its Score, and the corresponding global priority is also more forward, that is, the global priority of the pending task will be set to 12, and the global priority of the task that originally had a global priority of 12 will be updated to 13, which is later.

[0106] The method for setting priorities provided by the embodiments of the present disclosure sets continuous global priorities for pending tasks, which is consistent with user perception. The priority system can record all global priorities based on global priority data to facilitate the display of global priorities; and by comparing the set target priority with the existing global priority, a more appropriate first parameter can be set; using the current timestamp to generate the global task parameters of the pending tasks can effectively ensure the uniqueness of the global task parameters and avoid duplication. The construction of global priorities is triggered by asynchronous messages between the task system and the priority system, which can achieve decoupling of the task system and the priority system.

[0107] Based on the same inventive concept, a method for setting priority is provided in this embodiment, which can be applied to the above-mentioned task system; wherein the task system and the priority system can be set on the same device or on different devices, depending on the actual situation. Furthermore, if there are multiple task systems, each task system can execute the method for setting priority. Figure 6 is a flowchart of a method for setting priority according to an embodiment of the present disclosure, such as Figure 6 As shown, the process includes the following steps.

[0108] Step S601, determining tasks to be processed.

[0109] In this embodiment, when the task system needs to dispatch tasks to be executed to users, the corresponding tasks to be processed can be determined.

[0110] Step S602, setting global task parameters for the task to be processed.

[0111] As described above, the task system sets unique global task parameters, such as Score, for its own pending tasks.

[0112] Optionally, the global task parameters include a first parameter and a second parameter; and the above-mentioned step S602 "setting global task parameters for the tasks to be processed" may specifically include: setting a target priority for the tasks to be processed; determining whether there is a global priority that is the same as the target priority in the global priority data set by the priority system; the global priority data includes the global priorities of all tasks to be processed currently set by the priority system; when there is no global priority that is the same as the target priority in the global priority data, determining the first parameter of the global task parameters according to the target priority; when there is a global priority that is the same as the target priority in the global priority data, using the first parameter corresponding to the global priority that is the same as the target priority as the first parameter of the global task parameters; generating the second parameter of the global task parameters according to the current timestamp.

[0113] Optionally, generating the second parameter of the global task parameter according to the current timestamp may include: taking the difference between a preset timestamp upper limit value and the current timestamp as the second parameter of the global task parameter.

[0114] The process of the task system generating global task parameters may be specifically referred to the relevant descriptions of the above steps C1 to C5, which will not be elaborated here.

[0115] Step S603, sending a setting request to the priority system; the setting request includes the global task parameters of the pending tasks, and the setting request is used to instruct the priority system to sort multiple pending tasks according to the global task parameters of the pending tasks, and set unique global priorities for the pending tasks in sequence.

[0116] After the task system determines the global task parameters of the task to be processed, it can send a corresponding setting request to the priority system so that the priority system can set a unique global priority for the task to be processed. For example, the priority system can set a unique global priority for the task to be processed based on the above steps S201 to S203.

[0117] Optionally, step S603 “sending a setting request to the priority system” may specifically include: after setting global task parameters for the task to be processed, directly sending a setting request to the priority system in the form of an asynchronous message.

[0118] In the method for setting priorities provided by the embodiments of the present disclosure, the task system sets a unique global task parameter for the pending task, so that the priority system can sort the pending tasks of multiple task systems based on the global task parameter, and then assign a unique global priority to each pending task to avoid duplication of task priorities. In addition, by comparing the set target priority with the existing global priority, a more appropriate first parameter can be set; using the current timestamp to generate the global task parameters of the pending task can effectively ensure the uniqueness of the global task parameters and avoid duplication. The construction of the global priority is triggered by asynchronous messages between the task system and the priority system, which can achieve decoupling of the task system and the priority system.

[0119] In the present embodiment, a device for setting priority is also provided, and the device is used to implement the above-mentioned embodiment and preferred implementation mode, and the description has been made no further. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0120] This embodiment provides a device for setting priority, which is applied to a priority system, such as Figure 7 As shown, including:

[0121] The acquisition module 701 is used to acquire a setting request sent by at least one task system; the setting request includes global task parameters of the task to be processed;

[0122] A sorting module 702, used for sorting the multiple tasks to be processed according to the global task parameters of the multiple tasks to be processed;

[0123] The priority setting module 703 is used to sequentially set a unique global priority for the multiple tasks to be processed.

[0124] In some optional implementations, after sequentially setting unique global priorities for the multiple tasks to be processed, the priority setting module 703 is further configured to:

[0125] Generate global priority data; the global priority data includes the global priorities of all currently set tasks to be processed.

[0126] In some optional implementations, the global task parameter includes a first parameter and a second parameter;

[0127] The process of the task system setting global task parameters for the task to be processed includes:

[0128] Setting a target priority for the pending task;

[0129] Determine whether there is a global priority that is the same as the target priority in the global priority data;

[0130] In the case that there is no global priority that is the same as the target priority in the global priority data, determining a first parameter of the global task parameter according to the target priority;

[0131] In the case where there is a global priority that is the same as the target priority in the global priority data, using a first parameter corresponding to the global priority that is the same as the target priority as the first parameter of the global task parameter;

[0132] A second parameter of the global task parameter is generated according to the current timestamp.

[0133] In some optional implementations, the second parameter of the global task parameter is: the difference between a preset timestamp upper limit value and a current timestamp.

[0134] In some optional implementations, the priority setting module 703 sets unique global priorities for the multiple tasks to be processed in sequence, including:

[0135] Unique and continuous global priorities are sequentially set for the multiple tasks to be processed.

[0136] In some optional implementations, the priority setting module 703 is further configured to:

[0137] In response to a clearing request for clearing at least one pending task, clearing data related to the at least one pending task;

[0138] Reset unique and continuous global priorities for the remaining pending tasks that have not been cleared.

[0139] In some optional implementations, the setting request is an asynchronous message.

[0140] This embodiment provides a device for setting priority, which is applied to a task system, such as Figure 8 As shown, the device comprises:

[0141] The task determination module 801 is used to determine the tasks to be processed;

[0142] The parameter setting module 802 is used to set global task parameters for the task to be processed;

[0143] Sending module 803 is used to send a setting request to the priority system; the setting request includes the global task parameters of the pending tasks, and the setting request is used to instruct the priority system to sort multiple pending tasks according to the global task parameters of the pending tasks, and set a unique global priority for the pending tasks in sequence.

[0144] In some optional implementations, the global task parameter includes a first parameter and a second parameter;

[0145] The parameter setting module 802 sets global task parameters for the task to be processed, including:

[0146] Setting a target priority for the pending task;

[0147] Determine whether there is a global priority that is the same as the target priority in the global priority data set by the priority system; the global priority data includes the global priorities of all pending tasks currently set by the priority system;

[0148] In the case that there is no global priority that is the same as the target priority in the global priority data, determining a first parameter of the global task parameter according to the target priority;

[0149] In the case where there is a global priority that is the same as the target priority in the global priority data, using a first parameter corresponding to the global priority that is the same as the target priority as the first parameter of the global task parameter;

[0150] A second parameter of the global task parameter is generated according to the current timestamp.

[0151] In some optional implementations, the parameter setting module 802 generates the second parameter of the global task parameter according to the current timestamp, including:

[0152] The difference between the preset timestamp upper limit value and the current timestamp is used as the second parameter of the global task parameter.

[0153] In some optional implementations, the sending module 803 sends a setting request to the priority system, including:

[0154] After setting the global task parameters for the task to be processed, a setting request is directly sent to the priority system in the form of an asynchronous message.

[0155] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0156] The device for setting priority in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, including a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0157] The present disclosure also provides a computer device having the above Figure 7 or Figure 8 The device for setting the priority is shown.

[0158] See also Fig. 9 , Fig. 9 is a schematic diagram of a computer device provided by an optional embodiment of the present disclosure, such as Fig. 9 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.

[0159] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0160] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0161] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0162] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0163] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0164] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0165] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0166] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for setting priorities, It is characterized in that Applied to a priority system, the method comprises: Obtaining a setting request sent by at least one task system; the setting request includes global task parameters of the task to be processed; Sorting the multiple tasks to be processed according to the global task parameters of the multiple tasks to be processed; A unique global priority is sequentially set for the multiple tasks to be processed.

2. The method according to claim 1, It is characterized in that After setting unique global priorities for the plurality of tasks to be processed in sequence, the method further includes: Generate global priority data; the global priority data includes the global priorities of all currently set tasks to be processed.

3. The method according to claim 2, It is characterized in that The global task parameters include a first parameter and a second parameter; The process of the task system setting global task parameters for the task to be processed includes: Setting a target priority for the pending task; Determine whether there is a global priority that is the same as the target priority in the global priority data; In the case that there is no global priority that is the same as the target priority in the global priority data, determining a first parameter of the global task parameter according to the target priority; In the case where there is a global priority that is the same as the target priority in the global priority data, using a first parameter corresponding to the global priority that is the same as the target priority as the first parameter of the global task parameter; A second parameter of the global task parameter is generated according to the current timestamp.

4. The method according to claim 3, It is characterized in that The second parameter of the global task parameter is: the difference between a preset timestamp upper limit value and a current timestamp.

5. The method according to claim 1, It is characterized in that The step of sequentially setting a unique global priority for the plurality of tasks to be processed comprises: Unique and continuous global priorities are sequentially set for the multiple tasks to be processed.

6. The method according to claim 5, It is characterized in that Also includes: In response to a clearing request for clearing at least one pending task, clearing data related to the at least one pending task; Reset unique and continuous global priorities for the remaining pending tasks that have not been cleared.

7. The method according to claim 1, It is characterized in that The setting request is an asynchronous message.

8. A method of setting priorities, It is characterized in that Applied to a task system, the method comprises: Identify pending tasks; Setting global task parameters for the task to be processed; Send a setting request to the priority system; the setting request includes the global task parameters of the pending tasks, and the setting request is used to instruct the priority system to sort multiple pending tasks according to the global task parameters of the pending tasks, and set unique global priorities for the pending tasks in sequence.

9. The method according to claim 8, It is characterized in that The global task parameters include a first parameter and a second parameter; The step of setting global task parameters for the task to be processed includes: Setting a target priority for the pending task; Determine whether there is a global priority that is the same as the target priority in the global priority data set by the priority system; the global priority data includes the global priorities of all pending tasks currently set by the priority system; In the case that there is no global priority that is the same as the target priority in the global priority data, determining a first parameter of the global task parameter according to the target priority; In the case where there is a global priority that is the same as the target priority in the global priority data, using a first parameter corresponding to the global priority that is the same as the target priority as the first parameter of the global task parameter; A second parameter of the global task parameter is generated according to the current timestamp.

10. The method according to claim 9, It is characterized in that The generating the second parameter of the global task parameter according to the current timestamp includes: The difference between the preset timestamp upper limit value and the current timestamp is used as the second parameter of the global task parameter.

11. The method according to claim 8, It is characterized in that The sending of a setting request to the priority system comprises: After setting the global task parameters for the task to be processed, a setting request is directly sent to the priority system in the form of an asynchronous message.

12. A device for setting priorities, It is characterized in that Applied to a priority system, the device comprises: An acquisition module, used to acquire a setting request sent by at least one task system; the setting request includes global task parameters of the task to be processed; A sorting module, used for sorting the multiple tasks to be processed according to the global task parameters of the multiple tasks to be processed; The priority setting module is used to sequentially set a unique global priority for the multiple tasks to be processed.

13. A device for setting priorities, It is characterized in that Applied to a mission system, the device comprises: A task determination module, used to determine tasks to be processed; A parameter setting module, used for setting global task parameters for the task to be processed; A sending module is used to send a setting request to the priority system; the setting request includes the global task parameters of the pending tasks, and the setting request is used to instruct the priority system to sort multiple pending tasks according to the global task parameters of the pending tasks, and set a unique global priority for the pending tasks in sequence.

14. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for setting priority according to any one of claims 1 to 11 by executing the computer instructions.

15. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for setting priority according to any one of claims 1 to 11.