Program scheduling method and device, computer readable storage medium and electronic equipment

By adjusting the priority coefficient of programs in the on-board system and sorting it, the problem of low program scheduling efficiency in vehicle scenarios is solved, and more efficient program scheduling and resource allocation are achieved.

CN119938239APending Publication Date: 2025-05-06HAOMO TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311459218.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-03
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In vehicle scenarios, the program scheduling efficiency of multiple on-board systems is low, especially programs with low priority and low resource occupancy requirements, which leads to excessive queueing time due to the high priority programs temporarily inserted.

Method used

By obtaining multiple programs to be scheduled and their scheduling parameters, including queueing time, priority and resource usage, adjusting the initial priority coefficient of priority, obtaining the target priority coefficient, and sorting the program based on these parameters, determining the scheduling sequence, and ultimately achieving efficient scheduling of the program.

Benefits of technology

It improves the scheduling efficiency of programs, avoids scheduling delays caused by long queueing time for programs with low priority, and takes into account the program's resource requirements and ensures reasonable allocation of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938239A_ABST
    Figure CN119938239A_ABST
Patent Text Reader

Abstract

The invention discloses a program scheduling method and device, a computer readable storage medium and electronic equipment. The method comprises the steps that in response to a received program scheduling instruction, a plurality of programs to be scheduled and associated scheduling parameters are obtained, and the scheduling parameters at least comprise the queuing duration, the priority and the resource occupation amount; adjusting the initial priority coefficient of the priority based on the queuing duration and the resource occupation amount to obtain a target priority coefficient; sorting the plurality of programs based on the queuing duration, the resource occupation amount, the priority and the target priority coefficient to obtain a first sorting result, the first sorting result being used for representing a scheduling sequence of the plurality of programs; and scheduling the plurality of programs based on the first sorting result. According to the method and the device, the technical problem of relatively low program scheduling efficiency in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of program scheduling, and in particular to a program scheduling method, device, computer-readable storage medium and electronic device. Background Art

[0002] Currently, in vehicle scenarios, if it is necessary to schedule programs in multiple vehicle systems, multiple programs are generally scheduled according to pre-set priorities. However, for some programs with lower priorities and lower resource requirements, if higher-priority programs are temporarily inserted, these programs may be queued for too long, resulting in low program scheduling efficiency.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present invention provide a program scheduling method, device, computer-readable storage medium and electronic device to at least solve the technical problem of low program scheduling efficiency in the related art.

[0005] According to one aspect of an embodiment of the present invention, a program scheduling method is provided, comprising: in response to receiving a program scheduling instruction, obtaining multiple programs to be scheduled and associated scheduling parameters, wherein the scheduling parameters include at least: queue time, priority and resource occupancy; adjusting the initial priority coefficient of the priority based on the queue time and resource occupancy to obtain a target priority coefficient; sorting the multiple programs based on the queue time, resource occupancy, priority and target priority coefficient to obtain a first sorting result, wherein the first sorting result is used to represent the scheduling order of the multiple programs; and scheduling the multiple programs based on the first sorting result.

[0006] Optionally, the initial priority coefficient of the priority level is adjusted based on the queue time and the resource occupancy amount to obtain a target priority coefficient, including: obtaining the queue time coefficient and the resource occupancy coefficient; adjusting the initial priority coefficient based on the queue time coefficient, the queue time, the initial priority coefficient, the priority level, the resource occupancy coefficient and the resource occupancy amount to obtain the target priority coefficient.

[0007] Optionally, the initial priority coefficient is adjusted based on the queuing time coefficient, the queuing time, the initial priority coefficient, the priority, the resource occupancy coefficient and the resource occupancy to obtain the target priority coefficient, including: constructing a target equation based on the queuing time coefficient, the queuing time, the initial priority coefficient, the priority, the resource occupancy coefficient and the resource occupancy; adjusting the initial priority coefficient in the target equation based on the target preset value to obtain the target priority coefficient.

[0008] Optionally, the target equation includes: a first equation and a second equation, and the target equation is constructed based on the queuing time coefficient, the queuing time, the initial priority coefficient, the priority, the resource occupancy coefficient and the resource occupancy, including: constructing the first equation based on the queuing time coefficient, the queuing time, the initial priority coefficient and the priority; constructing the second equation based on the resource occupancy coefficient, the resource occupancy, the initial priority coefficient and the priority.

[0009] Optionally, the target preset value includes: a first preset value and a second preset value. The initial priority coefficient in the target equation is adjusted based on the target preset value to obtain the target priority coefficient, including: adjusting the initial priority coefficient in the first equation based on the first preset value to obtain the first priority coefficient; adjusting the initial priority coefficient in the second equation based on the second preset value to obtain the second priority coefficient; determining the target priority coefficient based on the first priority coefficient and / or the second priority coefficient.

[0010] Optionally, a first equation is constructed based on the queuing time coefficient, the queuing time, the initial priority coefficient and the priority, including: determining the initial priority score based on the product of the initial priority coefficient and the priority; determining the queuing time score based on the product of the queuing time coefficient and the queuing time; and constructing the first equation based on the ratio of the initial priority score to the queuing time score.

[0011] Optionally, a second equation is constructed based on the resource occupancy coefficient, the resource occupancy, the initial priority coefficient and the priority, including: determining the resource occupancy score based on the product of the resource occupancy coefficient and the resource occupancy; and constructing the second equation based on the ratio of the resource occupancy score to the initial priority score.

[0012] Optionally, multiple programs are sorted based on queue time, resource usage, priority and target priority coefficient to obtain a first sorting result, including: determining execution scores of multiple programs based on queue time coefficient, target priority coefficient, resource usage coefficient, queue time, target priority and resource usage; sorting multiple programs based on the execution scores to obtain the first sorting result.

[0013] Optionally, based on the queuing time coefficient, target priority coefficient, resource occupancy coefficient, queuing time, target priority and resource occupancy, the execution scores of multiple programs are determined, including: determining the target priority score based on the product of the target priority coefficient and the priority; and obtaining the execution score based on the sum of the resource occupancy score, the queuing time score and the target priority score.

[0014] Optionally, the method further includes: in response to receiving a resource release instruction, determining a target number of programs to be executed based on a resource release amount; and generating a program scheduling instruction based on the target number.

[0015] Optionally, scheduling the multiple programs based on the first sorting result includes: allocating the multiple programs to different queues; and scheduling the multiple programs in different queues based on the first sorting result.

[0016] Optionally, the method also includes: adjusting the priority based on the queue length and resource occupancy to obtain a target priority; sorting multiple programs based on the queue length, resource occupancy, target priority and initial priority coefficient to obtain a second sorting result; scheduling multiple programs based on the second sorting result.

[0017] According to another aspect of an embodiment of the present invention, a method for scheduling a vehicle program is provided, comprising: in response to receiving a vehicle program scheduling instruction, obtaining multiple vehicle programs to be scheduled and associated scheduling parameters, wherein the scheduling parameters include at least: queue time, priority and resource occupancy; adjusting the initial priority coefficient of the priority based on the queue time and resource occupancy to obtain a target priority coefficient; sorting the multiple vehicle programs based on the queue time, resource occupancy, priority and target priority coefficient to obtain a first sorting result, wherein the first sorting result is used to represent the scheduling order of the multiple vehicle programs; and scheduling the multiple vehicle programs based on the first sorting result.

[0018] According to another aspect of an embodiment of the present invention, a program scheduling device is provided, including: an acquisition module, used to obtain multiple programs to be scheduled and scheduling parameters of the multiple programs in response to receiving a program scheduling instruction, wherein the scheduling parameters include at least queue time, priority and resource occupancy; an adjustment module, used to adjust the initial priority coefficient of the priority based on the queue time and resource occupancy to obtain a target priority coefficient; a sorting module, used to sort the multiple programs based on the queue time, resource occupancy, priority and target priority coefficient to obtain a first sorting result, wherein the first sorting result is used to represent the scheduling order of the multiple programs; a scheduling module, used to schedule the multiple programs based on the first sorting result.

[0019] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein when the program is running, a processor of a device is controlled to execute the program scheduling method of any one of the above embodiments.

[0020] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs; and a program scheduling method in which, when the one or more programs are executed by the one or more processors, the one or more processors execute any one of the above-mentioned embodiments.

[0021] In an embodiment of the present invention, in response to receiving a program scheduling instruction, multiple programs to be scheduled and associated scheduling parameters are obtained, wherein the scheduling parameters include at least: queuing time, priority and resource occupancy; the initial priority coefficient of the priority is adjusted based on the queuing time and resource occupancy to obtain a target priority coefficient; the multiple programs are sorted based on the queuing time, resource occupancy, priority and target priority coefficient to obtain a first sorting result, wherein the first sorting result is used to represent the scheduling order of the multiple programs; the multiple programs are scheduled based on the first sorting result, thereby achieving the purpose of improving the scheduling efficiency of the programs; it is easy to notice that the initial priority can be adjusted according to the queuing time and resource occupancy, and the present application can take into account the business requirements for the priority of program execution, and consider that programs that have been queued for a long time no longer continue to wait for a long time, and can also take into account the situation that the program itself does not require high resources for execution, and does not need to queue for too long, thereby improving the scheduling efficiency of the program, and further solving the technical problem of low scheduling efficiency of the program in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0023] Figure 1 is a schematic diagram of a hardware environment of an on-vehicle device according to a program scheduling method according to an embodiment of the present application;

[0024] Figure 2 is a flow chart of a program scheduling method according to an embodiment of the present invention;

[0025] Figure 3 is a flow chart of a vehicle program scheduling method according to an embodiment of the present invention;

[0026] Figure 4 is a schematic diagram of a program scheduling device according to an embodiment of the present application;

[0027] Figure 5 It is a schematic diagram of an in-vehicle program scheduling device according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:

[0031] Program: It is written in some programming language and runs on some target architecture;

[0032] Program execution priority: refers to the order in which programs are executed;

[0033] Priority: short for program execution priority;

[0034] Program resource evaluation and scoring: Through multiple tests, the resources required for program execution are scored according to the test results, making it easier to compare the resource usage of various programs;

[0035] Program Rating: Short for Program Resource Assessment Rating;

[0036] Queueing time: The time difference between program generation and scheduling is the queueing time;

[0037] Preemptive scheduling: A scheduler that, based on a certain principle, pauses a process in execution and reallocates the processor that has been assigned to the process to another process.

[0038] Non-preemptive scheduling: Once a processor is assigned to a process, it will be allowed to run continuously. The processor of the currently running process will never be preempted due to clock interruption or any other reasons. The processor will be assigned to other processes only when the process is completed or blocked by some event.

[0039] Resources: refers to the computer that can run the program, which can be a cloud server or a private server;

[0040] Ready program set: all programs that have completed the previous preparation, meet business requirements, and are waiting to be executed;

[0041] High priority: high priority;

[0042] Second best: The priority is not as high as the highest priority.

[0043] Example 1

[0044] According to an embodiment of the present invention, an embodiment of a program scheduling method 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.

[0045] Figure 1 Schematic diagram of the hardware environment of a vehicle-mounted device according to a program scheduling method of an embodiment of the present application. Figure 1 As shown, the vehicle-mounted device 102 and the server 104 are connected via a network. The vehicle-mounted device 102 is not limited to: a vehicle-mounted display screen, a vehicle-mounted audio system. The server 104 can be a server corresponding to a program operator. The network includes but is not limited to: a wide area network, a metropolitan area network or a local area network.

[0046] Optionally, the vehicle-mounted device 102 of this embodiment includes: a memory, a processor, and a transmission device. The memory is used to store an application, which can be used to execute: in response to receiving a program scheduling instruction, obtaining multiple programs to be scheduled and associated scheduling parameters, wherein the scheduling parameters at least include: queue time, priority, and resource occupancy; adjusting the initial priority coefficient of the priority based on the queue time and the resource occupancy to obtain a target priority coefficient; sorting the multiple programs based on the queue time, the resource occupancy, the priority, and the target priority coefficient to obtain a first sorting result, wherein the first sorting result is used to represent the scheduling order of the multiple programs; scheduling the multiple programs based on the first sorting result.

[0047] Figure 2 is a flow chart of a program scheduling method according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0048] Step S202: in response to receiving a program scheduling instruction, obtaining a plurality of programs to be scheduled and associated scheduling parameters.

[0049] The scheduling parameters include at least: queuing time, priority and resource occupancy.

[0050] The above-mentioned multiple programs can be programs in any system, for example, a vehicle-mounted system, a monitoring system, and a client, and no limitation is imposed on the application scenarios of the programs.

[0051] The above program scheduling instruction can be a program scheduling instruction generated by the vehicle when the user needs a program. Multiple programs and associated scheduling parameters can be obtained according to this program scheduling instruction. Here, the program scheduling instruction is not specifically limited and can be set according to actual needs. Optionally, program scheduling refers to the process of allocating multiple programs to a processor for execution in a certain order according to certain strategies and algorithms. The scheduling parameters refer to some parameters that need to be considered during the program scheduling process. After obtaining the program scheduling instruction, multiple programs and associated scheduling parameters can be obtained according to certain strategies and algorithms.

[0052] The above program scheduling instruction can carry the type, quantity, etc. of the programs to be scheduled.

[0053] In an optional embodiment, in response to receiving a program scheduling instruction, multiple programs to be scheduled and scheduling parameters associated with the multiple programs can be obtained according to the program scheduling instruction, so as to schedule the multiple programs according to the scheduling parameters.

[0054] The queuing duration in the above scheduling parameters can be the waiting duration for a program to wait for scheduling in the resource pool. The above priority can be the priority of the program set in advance. The above resource occupancy can be the amount of resources occupied by the program, that is, the size of the program or the amount of resources required to execute the program.

[0055] Exemplarily, if there are n programs to be scheduled, then there are m types of programs (m < n) among the n programs. The m types of programs are used to represent that there are m types of the n programs. The resource occupancy situations of different types of programs are different when they are executed. According to the requirements of the service, x programs (x < n) need to be executed with high priority or sub - optimal priority. The x programs are used to represent that x programs need to be executed preferentially or...

[0056] The resource occupancy of the above multiple programs can be determined in advance according to experiments. Different types of programs can be experimented, the resource occupancy situations of the programs can be evaluated, and scores can be given. Programs with less resource occupancy have higher scores. On the contrary, programs with large resource occupancy during execution have lower scores. The priority can be defined by numbers. The numbers of high - priority are larger than those of low - priority, and are even larger than those of lower - priority.

[0057] Step S204, adjust the initial priority coefficient of the priority based on the queuing duration and the resource occupancy to obtain the target priority coefficient.

[0058] The above-mentioned initial priority coefficients can be pre-set priority coefficients of different priorities. By setting priority coefficients of different priorities, it is convenient to adjust the weight ratio of the priority. Optionally, different initial priority coefficients can be set according to different priorities, and the same initial priority coefficient can also be set according to different priorities. The method for determining the initial priority coefficient is not specifically limited here.

[0059] In an optional embodiment, the initial priority system of the priority level can be dynamically adjusted according to the queuing time and the resource occupancy to obtain a target priority coefficient. The target priority coefficient can be used to balance the waiting time of multiple programs. The specific balancing method is: if the waiting time is longer, the priority of the program can be increased by dynamically adjusting the initial priority coefficient, so that programs with longer waiting time can be scheduled as soon as possible, avoiding the situation where some programs have a long waiting time and are difficult to be called.

[0060] Step S206, sorting the plurality of programs based on the queuing time, resource usage, priority and target priority coefficient to obtain a first sorting result.

[0061] The first sorting result is used to represent the scheduling order of multiple programs.

[0062] In an optional embodiment, an equation can be constructed based on the queue duration, resource usage, priority, and target priority coefficient. By solving the equation, the score values ​​of multiple programs can be obtained. The multiple programs can be sorted according to the size of the score values ​​to obtain the above-mentioned first sorting result. If the score value is higher, the program can be sorted higher so that it can be called first. If the score value is lower, the program can be sorted lower. It can also be set that if the score value is lower, the program can be sorted higher so that it can be called first. If the score value is higher, the program can be sorted lower. There is no specific limitation on the specific method of sorting here, and the sorting strategy can be flexibly set according to actual needs.

[0063] In another optional embodiment, multiple programs can be sorted according to a preset model based on queue time, resource usage, and priority to obtain a first sorting result, wherein the preset model can be a pre-trained neural network model, which is not specifically limited here and is only used as an example.

[0064] Step S208: scheduling multiple programs based on the first sorting result.

[0065] In an optional embodiment, multiple programs may be scheduled according to the scheduling order in the first sorting result.

[0066] In another optional embodiment, after receiving the program scheduling instruction, the program can be added to the scheduling service, first entering the ready program set, and the scheduler detects that resources have been released, and p programs can be executed at present. At this time, the data of the ready program set is calculated once, and the execution scores are arranged from large to small, and p ready programs are taken in sequence for execution, and other programs continue to wait in the ready program set. The detection program of the scheduler can detect continuously, and if the scheduler receives an instruction that does not need to be detected, the detection can be stopped.

[0067] This application can take into account the requirements for the priority of program execution in terms of tasks, and can also consider that programs that have been queued for a long time will no longer have to wait for a long time, and can also take into account the situation where the program itself does not require high resources to be executed, so there is no need to queue for too long.

[0068] Through the above steps, in response to receiving a program scheduling instruction, multiple programs to be scheduled and associated scheduling parameters are obtained, wherein the scheduling parameters include at least: queuing time, priority and resource occupancy; the initial priority coefficient of the priority is adjusted based on the queuing time and resource occupancy to obtain a target priority coefficient; the multiple programs are sorted based on the queuing time, resource occupancy, priority and target priority coefficient to obtain a first sorting result, wherein the first sorting result is used to represent the scheduling order of the multiple programs; the multiple programs are scheduled based on the first sorting result, thereby achieving the purpose of improving the scheduling efficiency of the programs; it is easy to notice that the initial priority can be adjusted according to the queuing time and resource occupancy, and the present application can take into account the business requirements for the priority of program execution, and can also consider that the program that has been waiting in line for a long time will no longer continue to wait for a long time, and can also take into account the situation that the program itself does not require high resources for execution, and does not need to wait in line for too long, thereby improving the scheduling efficiency of the program, and further solving the technical problem of low scheduling efficiency of the program in the related technology.

[0069] Optionally, the initial priority coefficient of the priority level is adjusted based on the queue time and the resource occupancy amount to obtain a target priority coefficient, including: obtaining the queue time coefficient and the resource occupancy coefficient; adjusting the initial priority coefficient based on the queue time coefficient, the queue time, the initial priority coefficient, the priority level, the resource occupancy coefficient and the resource occupancy amount to obtain the target priority coefficient.

[0070] The above-mentioned queuing time coefficient and resource occupancy coefficient can be pre-set coefficients, which are not specifically limited here. By setting the queuing time coefficient, it is convenient to adjust the weight ratio of the queuing time; by setting the resource occupancy coefficient, it is convenient to adjust the weight ratio of the resource occupancy.

[0071] In an optional embodiment, at least one dynamic balance formula can be set based on the queuing time coefficient, queuing time, initial priority coefficient, priority, resource occupancy coefficient and resource occupancy and initial priority coefficient. Among these parameters, except for the initial priority coefficient, other parameters can be kept fixed, and the balance of the formula can be maintained by adjusting the initial priority coefficient.

[0072] In another optional embodiment, the initial priority coefficient can be adjusted based on the queuing time, priority and resource occupancy through a preset model, so that when the queuing time of multiple programs is long and the priority is low, the execution score of the program can be improved by adjusting the initial priority coefficient, so that the program can be scheduled faster.

[0073] Optionally, the initial priority coefficient is adjusted based on the queuing time coefficient, the queuing time, the initial priority coefficient, the priority, the resource occupancy coefficient and the resource occupancy to obtain the target priority coefficient, including: constructing a target equation based on the queuing time coefficient, the queuing time, the initial priority coefficient, the priority, the resource occupancy coefficient and the resource occupancy; adjusting the initial priority coefficient in the target equation based on the target preset value to obtain the target priority coefficient.

[0074] The number of the above-mentioned target equations can be one or more. If there are multiple target equations, the parameters contained in different equations are different. For example, the parameters constituting the first equation are queue time coefficient, queue time, initial priority coefficient, and priority. The parameters constituting the second equation are initial priority coefficient, priority, resource occupancy coefficient, and resource occupancy.

[0075] The above-mentioned target preset value can be a pre-set value, which is not limited here. Optionally, the target preset value can be determined according to the multiple of the expected difference in the target equation. For example, if the difference between the numerator and denominator in the target equation is expected to be a times, the target preset value can be set to a.

[0076] Optionally, the target equation includes: a first equation and a second equation, and the target equation is constructed based on the queue time coefficient, the queue time, the initial priority coefficient, the priority, the resource occupancy coefficient and the resource occupancy, including: constructing the first equation based on the queue time coefficient, the queue time, the initial priority coefficient and the priority; constructing the second equation based on the resource occupancy coefficient, the resource occupancy, the initial priority coefficient and the priority. The first equation is used to adjust the initial priority coefficient according to the queue time and the queue time coefficient, and the second equation is used to adjust the initial priority coefficient according to the resource occupancy and the resource occupancy coefficient.

[0077] In an optional embodiment, a first equation can be constructed according to the queuing time coefficient, the queuing time, the initial priority coefficient and the priority, and the first equation can be balanced by adjusting the initial priority coefficient. A second equation can be constructed according to the resource occupancy coefficient, the resource occupancy, the initial priority coefficient and the priority, and the second equation can be balanced by adjusting the initial priority coefficient.

[0078] In another optional embodiment, the target priority coefficient can be determined by combining the initial priority coefficient obtained by adjusting the first equation and the initial priority coefficient obtained by adjusting the second equation. For example, the initial priority coefficient obtained by adjusting the first equation and the initial priority coefficient obtained by adjusting the second equation can be averaged to obtain the target priority coefficient. Alternatively, the equation with a larger proportion between the first equation and the second equation can be determined by means of weight values, and the initial priority coefficient obtained by adjusting the equation with a larger proportion can be used as the target priority coefficient. If the first equation has a larger proportion, the initial priority coefficient obtained by adjusting the first equation can be used as the target priority coefficient. If the second equation has a larger proportion, the initial priority coefficient obtained by adjusting the second equation can be used as the target priority coefficient.

[0079] Optionally, the target preset value includes: a first preset value and a second preset value, and the initial priority coefficient in the target equation is adjusted based on the target preset value to obtain the target priority coefficient, including: adjusting the initial priority coefficient in the first equation based on the first preset value to obtain the first priority coefficient; adjusting the initial priority coefficient in the second equation based on the second preset value to obtain the second priority coefficient; determining the target priority coefficient based on the first priority coefficient and the second priority coefficient.

[0080] Taking priority as a measurement and comparison standard, the following equation can be obtained, wherein the first preset value can be x and the second preset value can be y.

[0081] The first equation above can be:

[0082] (initial priority coefficient × priority) / (queue duration coefficient × queue duration) = x. It is expected that after queuing for x time, the priority will be increased by one level.

[0083] The second equation above can be:

[0084] (Resource occupancy coefficient × resource occupancy) / (priority coefficient × priority) = y. When the expected resource occupancy differs by y times, the priority is increased by one.

[0085] Optionally, a first equation is constructed based on the queuing time coefficient, the queuing time, the initial priority coefficient and the priority, including: determining the initial priority score based on the product of the initial priority coefficient and the priority; determining the queuing time score based on the product of the queuing time coefficient and the queuing time; and constructing the first equation based on the ratio of the initial priority score to the queuing time score.

[0086] In an optional embodiment, the initial priority score can be obtained based on the product of the initial priority coefficient and the priority, and the queuing time score can be determined based on the product of the queuing time coefficient and the queuing time. Based on the ratio of the initial priority score and the queuing time score, a first equation is constructed, and the first equation can be modified by flexibly adjusting the initial priority coefficient in the initial priority score.

[0087] Optionally, a second equation is constructed based on the resource occupancy coefficient, the resource occupancy, the initial priority coefficient and the priority, including: determining the resource occupancy score based on the product of the resource occupancy coefficient and the resource occupancy; and constructing the second equation based on the ratio of the resource occupancy score to the initial priority score.

[0088] In an optional embodiment, the resource occupancy score can be determined based on the product of the resource occupancy coefficient and the resource occupancy, and the second equation can be constructed based on the ratio of the resource occupancy score and the initial priority score. The second equation can be modified by flexibly adjusting the initial priority coefficient in the initial priority score.

[0089] Optionally, multiple programs are sorted based on queue time, resource usage, priority and target priority coefficient to obtain a first sorting result, including: determining execution scores of multiple programs based on queue time coefficient, target priority coefficient, resource usage coefficient, queue time, target priority and resource usage; sorting multiple programs based on the execution scores to obtain the first sorting result.

[0090] In an optional embodiment, the queuing time coefficient, target priority coefficient, resource occupancy coefficient, queuing time, target priority and resource occupancy can be flexibly set according to actual conditions to obtain execution scores of multiple programs, and the scheduling order of multiple programs can be sorted according to the execution scores to obtain a first sorting result.

[0091] In another optional embodiment, the execution order of the programs can be determined by the execution score. If the execution score of the program is high, the scheduling order of the program can be ranked first, and if the execution score of the program is low, the scheduling order of the program can be ranked last. Alternatively, if the execution score of the program is low, the scheduling order of the program can be ranked first, and if the execution score of the program is high, the scheduling order of the program can be ranked last; the specific method of sorting multiple programs according to the execution score can be flexibly set according to the actual situation, and is only used as an example here.

[0092] Optionally, based on the queuing time coefficient, target priority coefficient, resource occupancy coefficient, queuing time, target priority and resource occupancy, the execution scores of multiple programs are determined, including: determining the target priority score based on the product of the target priority coefficient and the priority; and obtaining the execution score based on the sum of the resource occupancy score, the queuing time score and the target priority score.

[0093] Execution score = queue time * queue time coefficient + priority * target priority coefficient + resource usage * resource usage coefficient.

[0094] Exemplarily, the queuing time coefficient may be 1, the target priority coefficient may be 100, and the resource occupancy coefficient may be 1000.

[0095] Execution score = queuing time * 1 + priority * 100 + resource usage * 1000

[0096] After the queue time is 100 minutes, it is equivalent to a higher priority. If the program score is 0.1, it is equivalent to a lower priority than the program with a score of 0.2.

[0097] Optionally, the method further includes: in response to receiving a resource release instruction, determining a target number of programs to be executed based on a resource release amount; and generating a program scheduling instruction based on the target number.

[0098] The resource release instruction may be the amount of resources released after the previous batch of programs have used up the resources.

[0099] In an optional embodiment, the amount of resources to be released may be determined according to the resource release instruction, and the number of executable programs may be determined according to the released amount of resources, and the program scheduling instruction may be generated according to the target number of programs to be executed.

[0100] Optionally, scheduling the multiple programs based on the first sorting result includes: allocating the multiple programs to different queues; and scheduling the multiple programs in different queues based on the first sorting result.

[0101] In an optional embodiment, multiple waiting queues can be set, and the scheduler can obtain the programs to be executed from the multiple queues to complete the scheduling. Optionally, the programs to be executed can be obtained from the multiple queues by polling, or by periodicity. It should be noted that the functions of the above-mentioned different queues can be the same or different, and the above-mentioned different queues can be set by the user.

[0102] In another optional embodiment, programs to be executed are obtained from multiple queues by polling. One program may be scheduled in the first queue first and then in the second queue. Alternatively, two programs may be scheduled in the first queue and then in the second queue. There is no limitation on the method of scheduling programs in multiple queues, which is only used as an example.

[0103] In another optional embodiment, obtaining the program to be executed from multiple queues in a periodic manner may be scheduling the program from the first queue in a first time period, scheduling the program from the second queue in a second time period, and scheduling the program from the third queue in a third time period, and there is no limitation here.

[0104] In another optional embodiment, multiple programs may be allocated to different queues, so that when multiple programs are scheduled, multiple programs in different queues may be polled and scheduled, thereby improving the balance of scheduling multiple programs.

[0105] Optionally, the method also includes: adjusting the priority based on the queue length and resource occupancy to obtain a target priority; sorting multiple programs based on the queue length, resource occupancy, target priority and initial priority coefficient to obtain a second sorting result; scheduling multiple programs based on the second sorting result.

[0106] In an optional embodiment, after the queuing time reaches a certain time, the priority of the program can be directly modified to further improve the priority of the program, so that the program can be scheduled faster.

[0107] It should be noted that the above-mentioned method of adjusting the priority is basically the same as the method of adjusting the initial priority coefficient, which will not be repeated here.

[0108] In this application, formulas can be cleverly used to adjust the coefficient according to the actual scenario to meet business demands, and to dynamically calculate the score ratio of each program. There is no need to maintain various queues, which reduces the complexity of the system, and the score only needs to be calculated once each time. By using the queue time * queue time coefficient, the program will not be in a waiting state due to priority or the service itself, and no zombie program will be generated. By using priority, the issuer of the program can increase the situation of human control over the execution of the program according to the actual situation, and use the service scoring mechanism to allow programs that do not have high resource requirements but have low priority to avoid waiting for a long time, giving users a better user experience.

[0109] Example 2

[0110] According to an embodiment of the present invention, an embodiment of a vehicle program scheduling method 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.

[0111] Figure 3 is a flow chart of a vehicle program scheduling method according to an embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:

[0112] Step S302 , in response to receiving the vehicle program scheduling instruction sent by the vehicle, obtaining multiple vehicle programs to be scheduled and associated scheduling parameters from the server.

[0113] The scheduling parameters include at least: queuing time, priority and resource occupancy.

[0114] The above-mentioned vehicle-mounted program scheduling instruction can be used to schedule the vehicle-mounted program in the vehicle.

[0115] Step S304, adjusting the initial priority coefficient of the priority based on the queuing time and the resource occupancy to obtain a target priority coefficient.

[0116] Step S306 , sorting the multiple in-vehicle programs based on the queuing time, resource occupancy, priority and target priority coefficient to obtain a first sorting result.

[0117] The first sorting result is used to represent the scheduling order of multiple vehicle-mounted programs.

[0118] Step S308: scheduling the multiple in-vehicle programs based on the first sorting result.

[0119] Through the above steps, in response to receiving the vehicle-mounted program scheduling instruction sent by the vehicle, multiple vehicle-mounted programs to be scheduled and associated scheduling parameters are obtained from the server, wherein the scheduling parameters at least include: queuing time, priority and resource occupancy; the initial priority coefficient of the priority is adjusted based on the queuing time and resource occupancy to obtain the target priority coefficient; the multiple vehicle-mounted programs are sorted based on the queuing time, resource occupancy, priority and target priority coefficient to obtain a first sorting result, wherein the first sorting result is used to represent the scheduling order of the multiple vehicle-mounted programs; the multiple vehicle-mounted programs are scheduled based on the first sorting result, thereby achieving the purpose of improving the scheduling efficiency of the program; it is easy to notice that the initial priority can be adjusted according to the queuing time and resource occupancy, and the present application can take into account the business requirements for the priority of program execution, and can also consider that the program that has been waiting in line for a long time will no longer continue to wait for a long time, and can also take into account the situation that the program itself does not require high resources for execution, and does not need to wait in line for too long, thereby improving the scheduling efficiency of the program, thereby solving the technical problem of low scheduling efficiency of the program in the related technology.

[0120] Example 3

[0121] According to another aspect of an embodiment of the present invention, a program scheduling device is also provided, which can execute the program scheduling method of the above embodiment. The specific implementation method and preferred application scenario are the same as those of the above embodiment and will not be described in detail here.

[0122] Figure 3 is a schematic diagram of a program scheduling device according to an embodiment of the present application, such as Figure 4 As shown, the device includes: an acquisition module 402 , an adjustment module 404 , a sorting module 406 , and a scheduling module 408 .

[0123] Among them, the acquisition module is used to obtain multiple programs to be scheduled and associated scheduling parameters in response to receiving a program scheduling instruction, wherein the scheduling parameters include at least: queue time, priority and resource occupancy; the adjustment module is used to adjust the initial priority coefficient of the priority based on the queue time and resource occupancy to obtain a target priority coefficient; the sorting module is used to sort the multiple programs based on the queue time, resource occupancy, priority and target priority coefficient to obtain a first sorting result, wherein the first sorting result is used to represent the scheduling order of multiple programs; the scheduling module is used to schedule multiple programs based on the first sorting result.

[0124] Optionally, the adjustment module is also used to obtain the queuing time coefficient and the resource occupancy coefficient, and adjust the initial priority coefficient based on the queuing time coefficient, the queuing time, the initial priority coefficient, the priority, the resource occupancy coefficient and the resource occupancy to obtain the target priority coefficient.

[0125] Optionally, the adjustment module is also used to construct a target equation based on the queuing time coefficient, queuing time, initial priority coefficient and priority, resource occupancy coefficient and resource occupancy; and adjust the initial priority coefficient in the target equation based on the target preset value to obtain the target priority coefficient.

[0126] Optionally, the target equation includes: a first equation and a second equation, and the adjustment module is further used to construct the first equation based on the queuing time coefficient, the queuing time, the initial priority coefficient and the priority; and to construct the second equation based on the resource occupancy coefficient, the resource occupancy, the initial priority coefficient and the priority.

[0127] Optionally, the target preset value includes: a first preset value and a second preset value. The adjustment module is also used to adjust the initial priority coefficient in the first equation based on the first preset value to obtain a first priority coefficient; adjust the initial priority coefficient in the second equation based on the second preset value to obtain a second priority coefficient; and determine the target priority coefficient based on the first priority coefficient and / or the second priority coefficient.

[0128] Optionally, the adjustment module is also used to determine an initial priority score based on the product of an initial priority coefficient and a priority; determine a queuing time score based on the product of a queuing time coefficient and a queuing time; and construct a first equation based on a ratio of the initial priority score to the queuing time score.

[0129] Optionally, the adjustment module is further used to determine a resource occupancy score based on the product of the resource occupancy coefficient and the resource occupancy; and construct a second equation based on a ratio of the resource occupancy score to the initial priority score.

[0130] Optionally, the sorting module is also used to determine execution scores of multiple programs based on the queuing time coefficient, target priority coefficient, resource occupancy coefficient, queuing time, target priority and resource occupancy; and sort the multiple programs based on the execution scores to obtain a first sorting result.

[0131] Optionally, the sorting module is further used to determine the target priority score based on the product of the target priority coefficient and the priority; and obtain the execution score based on the sum of the resource occupancy score, the queue time score and the target priority score.

[0132] Optionally, the device also includes: a determination module and a generation module.

[0133] The determination module is used to determine the target number of programs to be executed based on the resource release amount in response to receiving the resource release instruction; the generation module is used to generate the program scheduling instruction based on the target number.

[0134] Optionally, the scheduling module is further used to allocate multiple programs to different queues; and schedule the multiple programs in different queues based on the first sorting result.

[0135] Optionally, the sorting module is also used to adjust the priority based on the queue time and resource occupancy to obtain the target priority; the scheduling module is also used to sort multiple programs based on the queue time, resource occupancy, target priority and initial priority coefficient to obtain a second sorting result; and schedule multiple programs based on the second sorting result.

[0136] Example 4

[0137] According to another aspect of an embodiment of the present invention, a vehicle-mounted program scheduling device is also provided, which can execute the vehicle-mounted program scheduling method of the above embodiment. The specific implementation method and preferred application scenario are the same as the above embodiment and will not be repeated here.

[0138] Figure 5 is a schematic diagram of a vehicle program scheduling device according to an embodiment of the present application, such as Figure 5 As shown, the device includes: an acquisition module 502 , an adjustment module 504 , a sorting module 506 , and a scheduling module 508 .

[0139] Among them, the acquisition module is used to respond to the receipt of the vehicle-mounted program scheduling instruction sent by the vehicle, and obtain multiple vehicle-mounted programs to be scheduled and associated scheduling parameters from the server, wherein the scheduling parameters include at least: queuing time, priority and resource occupancy; the scheduling module is used to adjust the initial priority coefficient of the priority based on the queuing time and resource occupancy to obtain the target priority coefficient; the sorting module is used to sort the multiple vehicle-mounted programs based on the queuing time, resource occupancy, priority and target priority coefficient to obtain a first sorting result, wherein the first sorting result is used to represent the scheduling order of multiple vehicle-mounted programs; the scheduling module is used to schedule multiple vehicle-mounted programs based on the first sorting result.

[0140] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0141] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0142] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0143] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0144] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0145] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store computer programs.

[0146] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A program scheduling method, characterized in that: include: In response to receiving the program scheduling instruction, a plurality of programs to be scheduled and associated scheduling parameters are obtained, wherein the scheduling parameters include at least: queuing time, priority and resource occupancy; Adjusting the initial priority coefficient of the priority based on the queuing time and the resource occupancy to obtain a target priority coefficient; Sorting the plurality of programs based on the queuing time, the resource occupancy, the priority and the target priority coefficient to obtain a first sorting result, wherein the first sorting result is used to represent the scheduling order of the plurality of programs; The plurality of programs are scheduled based on the first sorting result.

2. The program scheduling method according to claim 1, characterized in that: The initial priority coefficient of the priority is adjusted based on the queuing time and the resource occupancy to obtain a target priority coefficient, including: Obtain the queuing time coefficient and resource occupancy coefficient; The initial priority coefficient is adjusted based on the queuing time coefficient, the queuing time, the initial priority coefficient, the priority, the resource occupancy coefficient and the resource occupancy to obtain the target priority coefficient.

3. The program scheduling method according to claim 2, characterized in that: The initial priority coefficient is adjusted based on the queuing time coefficient, the queuing time, the initial priority coefficient, the priority, the resource occupancy coefficient and the resource occupancy to obtain the target priority coefficient, including: constructing a target equation based on the queuing duration coefficient, the queuing duration, the initial priority coefficient, the priority, the resource occupancy coefficient and the resource occupancy; The initial priority coefficient in the target equation is adjusted based on a target preset value to obtain the target priority coefficient.

4. The program scheduling method according to claim 3, characterized in that: The target equation includes: a first equation and a second equation, and the target equation is constructed based on the queuing time coefficient, the queuing time, the initial priority coefficient, the priority, the resource occupancy coefficient and the resource occupancy, including: Constructing a first equation based on the queue duration coefficient, the queue duration, the initial priority coefficient and the priority; A second equation is constructed based on the resource occupancy coefficient, the resource occupancy, the initial priority coefficient and the priority.

5. The program scheduling method according to claim 4, characterized in that: The target preset value includes: a first preset value and a second preset value. The initial priority coefficient in the target equation is adjusted based on the target preset value to obtain the target priority coefficient, including: Adjusting the initial priority coefficient in the first equation based on a first preset value to obtain a first priority coefficient; Adjusting the initial priority coefficient in the second equation based on a second preset value to obtain a second priority coefficient; The target priority coefficient is determined based on the first priority coefficient and the second priority coefficient.

6. The program scheduling method according to claim 4, characterized in that: Based on the queuing time coefficient, the queuing time, the initial priority coefficient and the priority, a first equation is constructed, including: determining an initial priority score based on a product of the initial priority coefficient and the priority; Determine a queue time score based on the product of the queue time coefficient and the queue time; The first equation is constructed based on the ratio of the initial priority score and the queuing time score.

7. The program scheduling method according to claim 6, characterized in that: Based on the resource occupancy coefficient, the resource occupancy, the initial priority coefficient and the priority, a second equation is constructed, including: Determine a resource occupancy score based on a product of the resource occupancy coefficient and the resource occupancy; The second equation is constructed based on a ratio of the resource occupancy score and the initial priority score.

8. The program scheduling method according to claim 7, characterized in that: The plurality of programs are sorted based on the queuing time, the resource occupancy, the priority, and the target priority coefficient to obtain a first sorting result, including: Determining execution scores of the plurality of programs based on a queuing time coefficient, the target priority coefficient, a resource occupancy coefficient, the queuing time, the target priority, and the resource occupancy; The plurality of programs are sorted based on the execution scores to obtain the first sorting result.

9. A program scheduling device, characterized in that: include: An acquisition module, configured to acquire, in response to receiving a program scheduling instruction, a plurality of programs to be scheduled and scheduling parameters of the plurality of programs, wherein the scheduling parameters at least include a queuing time, a priority, and a resource occupancy amount; An adjustment module, configured to adjust the initial priority coefficient of the priority based on the queuing time and the resource occupancy to obtain a target priority coefficient; A sorting module, used to sort the multiple programs based on the queuing time, the resource occupancy, the priority and the target priority coefficient to obtain a first sorting result, wherein the first sorting result is used to represent the scheduling order of the multiple programs; A scheduling module is used to schedule the multiple programs based on the first sorting result.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is running, the program scheduling method according to any one of claims 1 to 8 is executed in a processor of a device where the program is controlled.

11. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors execute the program scheduling method described in any one of claims 1 to 8.

Citation Information

Cited By

  • Execution priority scheduling method and device, electronic equipment, medium and product

    CN120935119A