Resource scheduling method, device and electronic device
By acquiring and sending transmission carriers, multiple resource user terminals can access the resource terminal at the same time, solving the problem that resources cannot be used simultaneously in the existing system, and achieving the improvement of resource sharing and utilization rate.
Patent Information
- Application Number
- CN202110118871.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-28
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2041-01-28
AI Technical Summary
Existing Android systems cannot implement multiple processes using a certain resource at the same time, such as camera resources.
By obtaining the transmission carriers of multiple resource usage ends, sending these transmission carriers to the resource end, enabling the resource end to write resource content, and allowing multiple resource usage ends to listen and obtain these contents.
It realizes that multiple resource usage ends obtain resource content from the resource end at the same time, solves the problem of resource sharing and improves the resource usage rate.
Smart Images

Figure CN114816688B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and in particular to a resource scheduling method, device and electronic equipment. Background Art
[0002] When multiple processes in the functions and services of an electronic device need to use a certain resource of the electronic device at the same time, such as a camera resource, the existing Android system only allows one process to use the camera resource, and it is impossible for multiple processes to use the camera resource at the same time. Summary of the invention
[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0004] The first embodiment of the present application provides a resource scheduling method, including:
[0005] Obtaining resource occupation requests sent by at least two first resource users, wherein the resource occupation requests include a transmission carrier;
[0006] respectively acquiring, from the resource occupation requests sent by the first resource users, transmission carriers of the first resource users;
[0007] A transmission carrier of each first resource user is sent to the resource end, wherein the transmission carrier is used by the resource end to write the resource content requested by the resource occupation request, and is used by the corresponding first resource user to monitor to obtain the written resource content.
[0008] The second aspect of the present application provides another resource scheduling method, including:
[0009] receiving transmission bearers of at least two first resource users sent by the scheduling end;
[0010] The resource content is written into the transmission carrier; wherein the transmission carrier is used for the corresponding first resource user to monitor to obtain the written resource content.
[0011] The third aspect of the present application provides a resource scheduling method, including:
[0012] Sending a resource occupation request to the scheduling end, wherein the resource occupation request includes a transmission carrier;
[0013] The transmission carrier is monitored to obtain the resource content written in the transmission carrier.
[0014] The fourth aspect of the present application provides a resource scheduling device, including:
[0015] A first acquisition module, configured to acquire resource occupation requests sent by at least two first resource users, wherein the resource occupation requests include a transmission carrier;
[0016] A second acquisition module, configured to respectively acquire a transmission carrier of each of the first resource users from the resource occupation request sent by each of the first resource users;
[0017] A sending module is used to send the transmission carrier of each first resource user end to the resource end, wherein the transmission carrier is used by the resource end to write the resource content requested by the resource occupation request, and is used for the corresponding first resource user end to monitor to obtain the written resource content.
[0018] The fifth aspect of the present application provides another resource scheduling device, including:
[0019] A receiving module, used to receive transmission carriers of at least two first resource users sent by the scheduling end;
[0020] A writing module is used to write resource content into the transmission carrier; wherein the transmission carrier is used for the corresponding first resource user to monitor to obtain the written resource content.
[0021] The sixth aspect of the present application provides another resource scheduling device, including:
[0022] A sending module, used to send a resource occupation request to the scheduling end, wherein the resource occupation request includes a transmission carrier;
[0023] The monitoring module is used to monitor the transmission carrier to obtain the resource content written in the transmission carrier.
[0024] The seventh aspect embodiment of the present application proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the resource scheduling method in the first aspect embodiment, and / or implements the resource scheduling method in the second aspect embodiment, and / or implements the resource scheduling method in the third aspect embodiment.
[0025] The eighth aspect embodiment of the present application proposes a non-temporary computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the resource scheduling method in the first aspect embodiment, and / or implements the resource scheduling method in the second aspect embodiment, and / or implements the resource scheduling method in the third aspect embodiment.
[0026] The technical solution provided in this embodiment has the following beneficial effects:
[0027] The scheduling end sends the transmission carrier of each resource user end to the resource end, so that the resource end writes the requested resource content to the transmission carrier of each resource user end, thereby enabling multiple resource users to obtain resource content from the resource end at the same time, that is, simultaneous access of multiple resource users.
[0028] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0030] Figure 1 A schematic diagram of a resource scheduling method provided in an embodiment of the present application;
[0031] Figure 2 A flowchart of another resource scheduling method provided in an embodiment of the present application;
[0032] Figure 3 A flowchart of a resource scheduling method provided in an embodiment of the present application;
[0033] Figure 4 A flowchart of another resource scheduling method provided in an embodiment of the present application;
[0034] Figure 5 A flowchart of another resource scheduling method provided in an embodiment of the present application;
[0035] Figure 6 A flowchart of another resource scheduling method provided in an embodiment of the present application;
[0036] Figure 7 A flowchart of another resource scheduling method provided in an embodiment of the present application;
[0037] Figure 8 A flowchart of another resource scheduling method provided in an embodiment of the present application;
[0038] Fig. 9 A flowchart of another resource scheduling method provided in an embodiment of the present application;
[0039] Fig.10 A flowchart of another resource scheduling method provided in an embodiment of the present application;
[0040] Fig.11 A flowchart of another resource scheduling method provided in an embodiment of the present application;
[0041] Fig.12 A flowchart of another resource scheduling method provided in an embodiment of the present application;
[0042] Fig.13 A flowchart of an interactive method for resource scheduling provided in an embodiment of the present application;
[0043] Fig.14 A flowchart of another interactive method for resource scheduling provided in an embodiment of the present application;
[0044] Fig.15 A flowchart of another interactive method for resource scheduling provided in an embodiment of the present application;
[0045] Fig.16 A schematic diagram of the structure of a resource scheduling device provided in an embodiment of the present application;
[0046] Fig.17 A schematic diagram of the structure of another resource scheduling device provided in an embodiment of the present application;
[0047] Fig.18 A schematic diagram of the structure of another resource scheduling device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0049] Before describing the present embodiment in detail, for ease of understanding, the key terms in the present application are first introduced and explained:
[0050] The scheduling end, as the manager and scheduler of resources, is responsible for the management and scheduling of resources.
[0051] The resource user, as the user of resources, can be an application, functional module, etc., which obtains the requested resource content by sending a resource occupation request to the scheduling end.
[0052] It should be noted that one or more resource users may send resource occupation requests to the scheduling end.
[0053] The resource end, as the provider of resources, enables the resource user to obtain resource content.
[0054] The scheduling end, resource usage end and resource end may be configured in the same electronic device, and the electronic device may be a self-moving device, such as an intelligent robot, etc. The scheduling end, resource usage end and resource end may also be configured in different electronic devices.
[0055] In the related art, multiple resource users need to seize resources according to the system preset rules. Multiple resource users cannot use the resources of one resource user at the same time, that is, resource sharing cannot be achieved. To this end, in the resource scheduling method of the embodiment of the present application, the scheduling end obtains resource occupation requests sent by at least two resource users, and the resource occupation request includes a transmission carrier. From the resource occupation request sent by each resource user, the scheduling end obtains the transmission carrier of each resource user, and sends the transmission carrier of each resource user to the resource end. Thus, the scheduling end sends the transmission carrier of each resource user to the resource end, so that the resource end writes the requested resource content to the transmission carrier of each resource user, so that multiple resource users can obtain resource content from the resource end at the same time, that is, multiple resource users can access at the same time, and resource sharing can be achieved.
[0056] The resource scheduling method, device, electronic device and storage medium of the embodiments of the present application are described below with reference to the accompanying drawings.
[0057] Figure 1 A flowchart of a resource scheduling method provided in an embodiment of the present application.
[0058] like Figure 1 As shown, the resource scheduling method, executed by the scheduling end, may include the following steps:
[0059] Step 101: Obtain resource occupation requests sent by at least two first resource users.
[0060] The scheduling end manages the resources requested to be occupied by each first resource user end, and the resource end is used to provide the resources requested to be called by each first resource user end, and there is a connection relationship between the scheduling end and the resource end. In the business scenario provided in this application, the scheduling end schedules one resource end, and the scheduled resource end can provide the resources requested by each first resource user end in the corresponding business scenario. Those skilled in the art can know that the resource end scheduled by the scheduling end is not limited to one, but can be multiple, and the scheduling end can apply the method provided in this application to each resource end.
[0061] In the embodiment of the present application, when requesting to occupy resources, the first resource user needs to send a resource occupation request to the scheduling end. At least two first resource users request to occupy resources of one resource end, and the scheduling end obtains the resource occupation requests sent by at least two first resource users.
[0062] The resource occupation request includes a transmission carrier, which can be used to store resource content and support the corresponding first resource user to monitor the stored resource content to obtain the resource content.
[0063] Step 102: acquiring the transmission bearer of each first resource user from the resource occupation request sent by each first resource user.
[0064] In the embodiment of the present application, after the scheduling end obtains the resource occupation requests sent by at least two first resource users, it can respectively obtain the transmission carrier of each first resource user from the resource occupation request sent by each first resource user.
[0065] Step 103: Send the transmission carrier of each first resource user end to the resource end.
[0066] In an embodiment of the present application, after the scheduling end obtains the transmission carrier of each first resource user, it sends the transmission carrier of each first resource user to the resource end, so that the resource end writes the resource content requested by the resource occupation request sent by each first resource user into the transmission carrier, and there is a corresponding relationship between each first resource user and the transmission carrier, and each first resource user monitors the corresponding transmission carrier to obtain the written resource content.
[0067] As an example, the resource requested to be occupied by the first resource user is a camera resource. In this case, the transmission carrier is a transmission carrier for storing camera data.
[0068] As another example, the resource requested to be occupied by the first resource user is a microphone resource. In this case, the transmission carrier is a transmission carrier for storing microphone data.
[0069] It should be noted that the above two examples are only described as examples, and the specific implementation of the transmission carrier is not limited in this application.
[0070] As a possible implementation method, the transmission carrier can be a surface object. For example, after the resource end writes the resource content requested by the first resource user end in the Surface object, the first resource user end can monitor the resource content written in the Surface object, and specifically can use the SurfaceHolder interface to monitor the resource content written in the Surface object. When the corresponding first resource user end monitors that the resource content is written in the Surface object, the resource content is obtained from the corresponding Surface object.
[0071] It should be noted that there is a corresponding relationship between the first resource user and the Surface object.
[0072] In the resource scheduling method of the embodiment of the present application, the scheduling end sends the transmission carrier of each resource-using end to the resource end, so that the resource end writes the requested resource content to the transmission carrier of each resource-using end, and each resource-using end monitors the corresponding transmission carrier, thereby realizing that multiple resource-using ends simultaneously obtain resource content from the resource end, that is, multiple resource-using ends access simultaneously, thereby improving resource utilization.
[0073] Based on the above embodiments, this embodiment provides an implementation method: Figure 2 The flowchart of another resource scheduling method provided by the embodiment of the present application illustrates that the number of resource users that can be supported by the resource end to access simultaneously cannot be greater than the threshold value, and at the same time, the resource occupation request also includes resource parameters for generating resource content. Figure 2 As shown, the method comprises the following steps:
[0074] Step 201: Obtain resource occupation requests sent by at least two first resource users.
[0075] Among them, the resource occupation request may include a transmission carrier and resource parameters. The resource parameters can be used by the resource end to generate resource content. They are relevant parameters for each first resource user to indicate the resources it needs, so that the resource end can provide matching resource content based on the relevant parameters.
[0076] For related contents, please refer to the explanations in the aforementioned embodiments. The principles are the same and will not be repeated here.
[0077] Step 202: determine whether the number of first resource users is less than or equal to a set threshold.
[0078] In this embodiment, it is assumed that before the first resource user, no resource user occupies the resources of the resource end. Since the central processing unit CPU and memory capacity of the electronic device are limited, in order to improve the reliability when multiple resource users simultaneously obtain resource content from the resource end, the number of resource users that can simultaneously obtain resource content from the resource end must be less than or equal to the set threshold, wherein the set threshold is related to the CPU and memory capacity, wherein the greater the CPU's data processing capacity and memory capacity, the greater the number of set thresholds. Among them, the set threshold can be flexibly set according to the CPU and memory capacity in the specific usage scenario, and is not limited in this embodiment.
[0079] Step 203: acquiring the transmission carrier and resource parameters of each first resource user from the resource occupation request sent by each first resource user.
[0080] Step 204: Send the transmission carrier and resource parameters of each first resource user end to the resource end.
[0081] In this embodiment, the resource requested to be occupied by the first resource user end is taken as a camera resource as an example for description.
[0082] For example, the resource occupation request sent by the first resource user A includes the resource parameter C1: video, resolution 1920*1080, frame rate 60FP / s; the resource occupation request sent by the second resource user B includes the resource parameter C2: video, resolution 1280*960, frame rate 30FPS.
[0083] After the scheduling end obtains the resource occupation request for occupying the camera resources sent by the first resource user A and the first resource user B, the scheduling end can send the resource parameters of the first resource user A and the first resource user B to the resource end according to each resource occupation request. Thus, for the first resource user A, the resource end generates the resource content of the video stream with a resolution of 1920*1080 and a frame rate of 60FP / s according to the resource parameter C1 obtained from the scheduling end, and writes the resource content into the transmission carrier corresponding to the first resource user A, so that the first resource user can obtain the resource content in the transmission carrier when it monitors that the transmission carrier carries the resource content. Similarly, for the first resource user B, the resource end generates the resource content of the video stream with a resolution of 1280*960 and a frame rate of 30FP / s according to the resource parameter C2 obtained from the scheduling end, and writes the resource content into the transmission carrier corresponding to the first resource user B, so that the first resource user B can obtain the resource content in the transmission carrier when it monitors that the transmission carrier carries the resource content.
[0084] It should be noted that the resource end generates corresponding resource content according to the resource parameters of each first resource user end obtained. In one scenario, the resource parameters of each first resource user end are obtained asynchronously, and the corresponding resource content can be generated in sequence based on the order in which the resource parameters are obtained, or the corresponding resource content can be generated in sequence based on the pre-set priority of each first resource user end; in another scenario, the resource parameters of each first resource user end are obtained synchronously, and can be generated synchronously according to the processing capacity of the resource end, or the corresponding resource content can be generated in sequence based on the pre-set priority of each first resource user end. This is not limited in this embodiment.
[0085] Among them, in the case where the resources requested to be occupied by each first resource user are other resources, the principle is the same and will not be repeated in the embodiments of the present application.
[0086] As an example, Figure 3As shown, the scheduling end and the resource end are first connected. After the connection is successful, the scheduling end obtains the resource occupation request sent by at least two first resource users, and then obtains the transmission carrier and resource parameters of each first resource user from the resource occupation request sent by each first resource user, and sends the transmission carrier and resource parameters of each first resource user to the resource end, so that the resource end writes the resource content generated according to each resource parameter into the transmission carrier of each first resource user.
[0087] It should be noted that the connection between the resource end and the first resource usage end may be a long connection, or may be connected when the first resource usage end monitors the resource content, which is not limited here.
[0088] In an embodiment of the present application, the resource end may periodically send a first heartbeat message to the scheduling end, so that the scheduling end can confirm whether the resource end is operating normally according to the first heartbeat message. Further, when the resource end stops operating or exits abnormally, the scheduling end sends a prompt message to each first resource user end to inform each first resource user end that the resource end is abnormal and cannot continue to provide resource content.
[0089] Similarly, each first resource user can periodically send a second heartbeat message to the scheduling end, so that the scheduling end can confirm whether the corresponding first resource user is running normally based on the second heartbeat message. Furthermore, when the first resource user stops running or exits abnormally, the scheduling end sends an indication message to the resource end to inform the resource end that the first resource user has exited, and the resource end can stop writing resource content to the corresponding transmission carrier to reduce the writing pressure of the resource end.
[0090] In the resource scheduling method of the embodiment of the present application, the scheduling end sends the transmission carrier and resource parameters of each resource user end to the resource end, so that the resource end generates the resource content of each resource user end according to the resource parameters of each resource user end, and writes the resource content of each resource user end into the transmission carrier of each resource user end. Each resource user end monitors the corresponding transmission carrier to obtain the written resource content.
[0091] In the above embodiment, the number of resource users that can simultaneously obtain the resource content of the same resource end needs to be less than or equal to a set threshold. In one scenario, the number of resource users that request resource occupancy from the same resource end exceeds the threshold. In order to achieve better scheduling and management of resource occupancy, the priority of each resource user can be set to achieve resource allocation based on priority after the number of resource users exceeds the set threshold, thereby improving the effect of resource scheduling and management.
[0092] In an implementation of the embodiment of the present application, the resource occupation request also includes the priority of the corresponding resource user. After the above steps 103 and 204, the method further includes the following steps:
[0093] Step 401: Obtain a resource occupation request sent by a second resource user.
[0094] For the sake of ease of distinction and explanation, in the embodiment of the present application, a resource usage end that meets a set threshold number is referred to as a first resource usage end, and a resource usage end that exceeds the set threshold number is referred to as a second resource usage end.
[0095] In the embodiment of the present application, the second resource user requests to occupy the resources of a resource end currently occupied by each first resource user, that is, when each first resource user is occupying the resources of a resource end, the scheduling end can also obtain the resource occupation request sent by the second resource user for requesting to occupy the resources of the resource end. The resource occupation request of each first resource user and the second resource user also includes the priority of the corresponding resource user.
[0096] It should be noted that the priority of each first resource user and second resource user can be pre-configured according to the needs of different business scenarios. For example, in one scenario, there are two first resource users, namely a video call application and a target focus following function module, both of which need to obtain camera resources. The priority of the video call application can be configured to be higher than the priority of the focus following function module.
[0097] Step 402, if the total number of first resource users and second resource users is greater than a set threshold, the priority of the second resource users is determined according to the resource occupation request of the second resource users, and the priority of each first resource user is determined according to the resource occupation request of each first resource user.
[0098] Step 403: Control resource occupancy according to the priority relationship between the second resource user and each first resource user.
[0099] In this embodiment, the resource occupation request also includes the priority of the corresponding resource user, so that after obtaining the resource occupation request sent by the second resource end, it is determined whether the total number of the first resource user and the second resource user is greater than the set threshold. If it is greater than the set threshold, the priority of each first resource user and the priority of each second resource user can be determined according to the priority of the resource user included in each resource occupation request. Furthermore, according to the priority relationship between the second resource user and each first resource user, it is determined whether the second resource user is allowed to occupy the resource, that is, effective management of controlling resource occupation is achieved.
[0100] The following describes three embodiments to illustrate the situation of controlling resource occupation according to the priority relationship between the first resource users and the second resource users.
[0101] As a first implementation:
[0102] Based on the above embodiments, this embodiment provides an implementation method: Figure 5 A flow chart of another resource scheduling method provided in an embodiment of the present application illustrates how to control resource occupancy when the priority of the second resource user end is higher than the first resource user end with the lowest priority among the first resource users. Figure 5 As shown, the above step 403 includes the following steps:
[0103] Step 501: Determine a first resource user with the lowest priority from at least two first resource users.
[0104] In this embodiment, different resource users have different corresponding priorities. Therefore, according to the priorities of the first resource users, a first resource user with the lowest priority can be determined from at least two first resource users.
[0105] Step 502 : Compare the priority relationship between the first resource user with the lowest priority and the second resource user.
[0106] Step 503, determine that the priority of the second resource user is higher than that of the first resource user with the lowest priority, obtain the transmission carrier of the second resource user from the resource occupation request sent by the second resource user, and send the transmission carrier of the second resource user and the identifier of the first resource user with the lowest priority to the resource end.
[0107] The transmission carrier of the second resource user end is used by the resource end to replace the transmission carrier of the first resource user end with the lowest priority.
[0108] In this embodiment, by comparison, it is determined that the priority of the second resource user is higher than that of the first resource user with the lowest priority, which means that the second resource user can obtain the corresponding resource content from the resource end. The scheduling end then obtains the transmission carrier of the second resource user from the resource occupation request sent by the second resource user, and sends the transmission carrier of the second resource user and the identifier of the first resource user with the lowest priority to the resource end, so that the resource end identifies the first resource user to be released based on the identifier of the first resource user, and replaces the transmission carrier of the first resource user with the lowest priority with the transmission carrier of the second resource user, so that the high-priority second resource user can realize resource occupation, and realizes dynamic allocation of resources based on the priority of the resource users when the resource users exceed the maximum supported number to meet different business needs.
[0109] As a second implementation:
[0110] Based on the above embodiments, this embodiment provides an implementation method: Figure 6A flow chart of another resource scheduling method provided in an embodiment of the present application illustrates how to control resource occupancy when the priority of the second resource user end is lower than the first resource user end with the lowest priority among the first resource users, such as Figure 6 As shown, the above step 403 includes the following steps:
[0111] Step 601: Determine a first resource user with the lowest priority from at least two first resource users.
[0112] Step 602 : Compare the priority relationship between the first resource user with the lowest priority and the second resource user.
[0113] Step 603: Determine that the first resource user with the lowest priority has a higher priority than the second resource user, and send a message to the second resource user to prompt rejection of resource occupation.
[0114] In this embodiment, by comparing the priority relationship between the first resource user with the lowest priority and the second resource user, it is determined that the priority of the first resource user with the lowest priority is higher than that of the second resource user, and then a message is sent to the second resource user to prompt the rejection of resource occupation. In other words, since the priority of the second resource user is lower than that of the first resource user with the lowest priority, the second resource user cannot occupy the resources occupied by the first resource user with the lowest priority. This achieves dynamic allocation of resources based on the priority of the resource users when the number of resource users exceeds the maximum supported number to meet different business needs.
[0115] As a third implementation method:
[0116] Based on the above embodiments, this embodiment provides an implementation method: Figure 7 A flow chart of another resource scheduling method provided in an embodiment of the present application illustrates how to control resource occupancy when the priority of the second resource user end is the same as the priority of the first resource user end with the lowest priority among the first resource users, such as Figure 7 As shown, the above step 403 includes the following steps:
[0117] Step 701: Determine a first resource user with the lowest priority from at least two first resource users.
[0118] Step 702 : Compare the priority relationship between the first resource user with the lowest priority and the second resource user.
[0119] Step 703: Determine that the first resource user with the lowest priority has the same priority as the second resource user with the lowest priority, and obtain resource demand information from the first resource user with the lowest priority.
[0120] The resource demand information is used to indicate whether the first resource user with the lowest priority releases the occupation of the resource user.
[0121] In this embodiment, if the priority of the second resource user is the same as the priority of the first resource user with the lowest priority, it is impossible to determine whether the second resource user can occupy the resources occupied by the first resource user with the lowest priority based on the priority. In this case, resource demand information is obtained from the first resource user with the lowest priority, and based on the obtained resource demand information, it is determined whether the first resource user with the lowest priority should release its occupation of the resource end.
[0122] Step 704: Send the transmission bearer of the second resource user and the identifier of the first resource user with the lowest priority to the resource end according to the resource demand information, or send a message for prompting rejection of resource occupation to the second resource user.
[0123] In one implementation method of the embodiment of the present application, it is determined that the resource demand information represents the release of the occupation of the resource end by the first resource user with the lowest priority, and the scheduling end sends the transmission carrier of the second resource user and the identifier of the first resource user with the lowest priority to the resource end, so that the resource end replaces the transmission carrier of the first resource user with the lowest priority with the transmission carrier of the second resource user according to the obtained identifier of the first resource user with the lowest priority, and writes the resource content requested by the second resource user into the transmission carrier of the second resource user, thereby realizing the resource occupation of the second resource user and allocating resources reasonably.
[0124] In another implementation method of the embodiment of the present application, it is determined that the resource demand information indicates that the first resource user with the lowest priority does not release the occupation of the resource end, then a message is sent to the second resource user to prompt the rejection of resource occupation, that is, the second resource user cannot obtain the corresponding resources.
[0125] In one implementation of the embodiment of the present application, in order to meet the reliability of resource scheduling, when the first resource user with the lowest priority and the second resource user with the same priority, before obtaining resource demand information from the first resource user with the lowest priority, it also includes:
[0126] The identifier of the second resource user is sent to the first resource user with the lowest priority. The identifier of the second resource user is used to generate and display prompt information for the first resource user with the lowest priority. That is, the first resource user generates prompt information for prompting the user whether to release the occupation of the resource end according to the obtained identifier of the second resource user, and provides the released resources to the second resource user, and displays it, and then responds to the user operation to generate resource demand information. The scheduling end determines whether the second resource user can replace the first resource user with the lowest priority to occupy the resources based on the information on whether the first resource user carries in the resource demand information to release the occupation of the resource end, thereby improving the reliability of resource allocation.
[0127] In order to implement the above embodiment, this embodiment provides an implementation method: Figure 8 A flow chart of another resource scheduling method provided in an embodiment of the present application is shown as follows: Figure 8 As shown, the resource scheduling method is executed by the resource end and may include the following steps:
[0128] Step 801: receiving transmission bearers of at least two first resource users sent by a scheduling end.
[0129] Step 802: write the resource content into a transmission carrier, wherein the transmission carrier is used for the corresponding first resource user to monitor to obtain the written resource content.
[0130] In this embodiment, the resource end writes the resource content requested by each resource user end into the corresponding transmission carrier, so that each resource user end monitors the corresponding transmission carrier, and obtains the resource content in the corresponding transmission carrier when it is monitored that the transmission carrier contains resource content, thereby realizing that multiple resource users simultaneously obtain resource content from the resource end, that is, multiple resource users have access at the same time.
[0131] Based on the above embodiments, this embodiment provides a resource scheduling method. Fig. 9 A flow chart of another resource scheduling method provided in an embodiment of the present application is shown as follows: Fig. 9 As shown, the method comprises the following steps:
[0132] Step 901: receiving transmission bearers of at least two first resource users sent by a scheduling end.
[0133] Step 902: receiving resource parameters of each first resource user sent by the scheduling end, and generating resource content corresponding to each first resource user according to the resource parameters of each first resource user.
[0134] It should be noted that step 902 may be performed after step 901 or before step 902, or step 901 and step 902 may be performed synchronously, that is, the transmission carriers and corresponding resource parameters of at least two first resource use ends sent by the scheduling end and received by the resource end may be received synchronously. This is not limited in this embodiment.
[0135] Step 903: Write the resource content of each first resource user into the corresponding transmission carrier.
[0136] Based on the above embodiments, this embodiment provides an implementation method: Fig.10 A flow chart of another resource scheduling method provided in an embodiment of the present application illustrates that the resource occupation request also includes the priority of the corresponding resource user. By setting the priority of each resource user, when the number of resource users exceeds the set threshold, the scheduling end allocates resources based on the priority, thereby improving the effect of resource scheduling management. Fig.10 As shown, after the above steps 802 and 903, the following steps are also included:
[0137] Step 1001: receiving information of a transmission bearer of a second resource user and a first resource user with the lowest priority sent by a scheduling end.
[0138] The information of the first resource user with the lowest priority includes identification information of the first resource user, and the identification information is used to indicate a transmission carrier corresponding to the first resource user.
[0139] Step 1002: Use the transmission bearer of the second resource user to replace the transmission bearer of the first resource user with the lowest priority.
[0140] In this embodiment, for the convenience of distinction and description, the resource user end that meets the set threshold number is called the first resource user end, and the resource user end that exceeds the set threshold number is called the second resource user end. When the scheduling end determines that the total number of the first resource user end and the second resource user end is greater than the set threshold, that is, the number of resource users that use the resource end at the same time exceeds the set threshold, it is necessary to determine whether the priority of the second resource user end is higher than the priority of the first resource user end with the lowest priority. If it is determined that the priority of the second resource user end is higher than the priority of the first resource user end with the lowest priority, the scheduling end sends the transmission carrier of the second resource user end and the information of the first resource user end with the lowest priority to the resource end. The resource end identifies the first resource user end to be released based on the identifier of the first resource user end obtained, and replaces the transmission carrier of the first resource user end with the transmission carrier of the second resource user end, so that the second resource user end with the high priority realizes resource occupation, and realizes that when the resource user end exceeds the maximum supported number, resources are dynamically allocated based on the priority of the resource user end to meet different business needs.
[0141] It should be noted that the above explanation of the scheduling end execution method can refer to the above Figure 1-7 The explanations in the embodiments are of the same principle and will not be repeated in this embodiment.
[0142] In order to implement the above embodiment, this embodiment provides an implementation method: Fig.11 A flow chart of another resource scheduling method provided in an embodiment of the present application is shown as follows: Fig.11 As shown, the resource scheduling method is executed by the resource user and may include the following steps:
[0143] Step 1101: Send a resource occupation request to the scheduling end, where the resource occupation request includes a transmission bearer.
[0144] Step 1102: monitor the transmission carrier to obtain the resource content written in the transmission carrier.
[0145] In this embodiment, each resource user monitors the corresponding transmission carrier, and when it monitors that the transmission carrier contains resource content, it obtains the resource content in the corresponding transmission carrier, thereby enabling multiple resource users to obtain resource content from the resource end at the same time, that is, simultaneous access of multiple resource users.
[0146] Based on the above embodiment, in an implementation manner of the embodiment of the present application, the resource occupation request also includes resource parameters and / or the priority of the corresponding resource user.
[0147] Among them, resource parameters can be used by the resource end to generate resource content. They are relevant parameters for each resource user to indicate the resources it needs, so that the resource end can provide matching resource content according to the relevant parameters; the priority of the resource user can be used to allocate resources based on the priority of each resource user when the number of resource users requesting resource occupancy from the same resource end exceeds a threshold.
[0148] Based on the above embodiments, the embodiments of the present application provide an implementation method, such as 12 is a flow chart of another resource scheduling method provided in the embodiments of the present application, such as Fig.12 As shown, after step 1102, the following steps are also included:
[0149] Step 1201: Receive the identifier of the resource user sent by the scheduling end.
[0150] Step 1202: Generate and display prompt information according to the identifier of the resource user.
[0151] Step 1203: Generate resource demand information in response to the user's operation on the prompt information.
[0152] Step 1204: Send resource requirement information to the scheduling end.
[0153] The resource demand information is used to indicate whether the resource user with the lowest priority releases the occupation of the resource user.
[0154] Among them, the identifier of the resource user is used by the resource user to generate and display prompt information.
[0155] In this embodiment, for the convenience of distinction and description, the resource usage end that meets the set threshold number is called the first resource usage end, and the resource usage end that exceeds the set threshold number is called the second resource usage end. When the scheduling end determines that the total number of the first resource user end and the second resource user end is greater than the set threshold, that is, the number of resource users that simultaneously use the resource end exceeds the set threshold, it is necessary to determine whether the priority of the second resource user end is higher than the priority of the first resource user end with the lowest priority. If it is determined that the second resource user end requesting resource occupation has the same priority as the first resource user end with the lowest priority, it is necessary to determine whether the first resource user end with the lowest priority currently occupying the resource releases the occupation of the resource end. The scheduling end sends the identifier of the second resource user end to the first resource user end with the lowest priority. The first resource user end with the lowest priority receives the identifier of the second resource user end sent by the scheduling end. According to the obtained identifier of the second resource user end, prompt information for prompting the user whether to release the occupation of the resource end is generated, and the released resources are provided to the second resource user end, and displayed. Then, in response to the user operation on the prompt information, resource demand information is generated, and the resource demand information is sent to the scheduling end, so that the scheduling end determines whether the second resource user end can replace the first resource user end with the lowest priority of the same priority to occupy the resource based on whether the first resource user end with the lowest priority carried in the resource demand information releases the occupation information of the resource end, thereby improving the reliability of resource allocation.
[0156] It should be noted that the above explanation of the scheduling end execution method can refer to the above Figure 1-7 The explanations in the embodiments and the explanations of the resource end execution method mentioned above can be referred to above Figure 8-10 The explanations in the embodiments are of the same principle and will not be repeated in this embodiment.
[0157] Based on the above embodiments, this embodiment provides an interactive method for resource scheduling. Fig.13 The flowchart of a resource scheduling interaction method provided in the embodiment of the present application illustrates how to control resource occupancy when the priority of the second resource user is higher than that of the first resource user with the lowest priority. Fig.13 As shown, the method comprises the following steps:
[0158] Step 1: The scheduling end connects to the resource end.
[0159] Step 2: The scheduling end and the resource end are connected successfully.
[0160] In this embodiment, the connection between the scheduling end and the resource end may be a long connection, that is, it is always in a connected state, or it may be a connection made when there is a resource occupation request.
[0161] Step 3: At least two first resource-using terminals send a resource occupation request to the scheduling terminal to request occupation of the resource terminal resources.
[0162] The resource occupation request sent by each first resource user includes a transmission carrier, resource parameters and the priority of the corresponding resource user.
[0163] Step 4: The scheduling end determines whether the number of the first resource-using ends is less than or equal to a set threshold, and determines the connection status with the resource end.
[0164] The dispatching end detects the connection status with the resource end to determine that the resource end is in a normal state and can provide the corresponding resource content. The dispatching end also queries the number of first resource users requesting to occupy the resource end resources, and determines that the number of first resource users is less than or equal to the set threshold, that is, the number of first resource users does not exceed the maximum number of resource users that can occupy the resource end resources at the same time, and then determines that the resource occupation request can be responded to.
[0165] Step 5: The scheduling end sends the transmission carrier and resource parameters of each first resource user end to the resource end.
[0166] Step 6: The resource end generates resource content requested by each first resource user end according to the resource parameters of each first resource user end, and writes the resource content of each first resource user end into a corresponding transmission carrier.
[0167] Step 7: Each first resource user monitors the corresponding transmission carrier to obtain resource content in the corresponding transmission carrier.
[0168] Step 8: The second resource user sends a resource occupation request to the scheduling end to request occupation of the resource end resources.
[0169] The resource occupation request sent by the second resource user includes a transmission carrier, resource parameters and a priority of the corresponding resource user.
[0170] Step 9: The scheduling end determines that the total number of the first resource-using end and the second resource-using end is greater than a set threshold, and determines the connection status with the resource end.
[0171] Step 10: The scheduling end compares and determines that the priority of the first resource user end with the lowest priority is lower than the priority of the second resource user end.
[0172] Step 11: The scheduling end sends the transmission bearer and resource parameters of the second resource user end, and the identifier of the first resource user end with the lowest priority to the resource end.
[0173] Step 12: stop generating resource content corresponding to the first resource user with the lowest priority, and stop writing the corresponding resource content into the corresponding transmission carrier.
[0174] After receiving the identifier of the first resource user with the lowest priority, the resource end stops generating resource content corresponding to the first resource user with the lowest priority and stops writing corresponding resource content into the transmission carrier of the first resource user with the lowest priority according to the identifier.
[0175] Step 13: The resource end generates resource content requested by the second resource user end according to the resource parameters of the second resource user end, and writes the resource content requested by the second resource user end into a transmission carrier corresponding to the second resource user end.
[0176] Step 14: The second resource user monitors the corresponding transmission carrier to obtain resource content in the corresponding transmission carrier.
[0177] It should be noted that the explanations and beneficial effects achieved in the aforementioned resource scheduling method embodiment are also applicable to the interactive method for resource scheduling in this embodiment. The principles are the same and will not be repeated in this embodiment.
[0178] Based on the above embodiments, this embodiment provides an interactive method for resource scheduling. Fig.14 The flowchart of another interactive method for resource scheduling provided by the embodiment of the present application illustrates how to control resource occupancy when the priority of the second resource user is lower than that of the first resource user with the lowest priority. Fig.14 As shown, the method comprises the following steps:
[0179] Step 21, the scheduling end is connected to the resource end.
[0180] Step 22: The scheduling end is successfully connected to the resource end.
[0181] In this embodiment, the connection between the scheduling end and the resource end may be a long connection, that is, it is always in a connected state, or it may be a connection made when there is a resource occupation request.
[0182] Step 23: At least two first resource-using terminals send a resource occupation request to the scheduling terminal to request occupation of the resource terminal resources.
[0183] The resource occupation request sent by each first resource user includes a transmission carrier, resource parameters and the priority of the corresponding resource user.
[0184] Step 24, the scheduling end determines whether the number of the first resource-using ends is less than or equal to a set threshold, and determines the connection status with the resource end.
[0185] The dispatching end detects the connection status with the resource end to determine that the resource end is in a normal state and can provide the corresponding resource content. The dispatching end also queries the number of first resource users requesting to occupy the resource end resources, and determines that the number of first resource users is less than or equal to the set threshold, that is, the number of first resource users does not exceed the maximum number of resource users that can occupy the resource end resources at the same time, and then determines that the resource occupation request can be responded to.
[0186] Step 25: The scheduling end sends the transmission bearer and resource parameters of each first resource user end to the resource end.
[0187] Step 26: The resource end generates resource content requested by each first resource user end according to the resource parameters of each first resource user end, and writes the resource content of each first resource user end into a corresponding transmission carrier.
[0188] Step 27: Each first resource user monitors the corresponding transmission carrier to obtain resource content in the corresponding transmission carrier.
[0189] Step 28: The second resource user sends a resource occupation request to the scheduling end to request occupation of the resource end resources.
[0190] The resource occupation request sent by the second resource user includes a transmission carrier, resource parameters and a priority of the corresponding resource user.
[0191] Step 29: The scheduling end determines that the total number of the first resource-using end and the second resource-using end is greater than a set threshold, and determines the connection status with the resource end.
[0192] Step 30: The scheduling end compares and determines that the priority of the first resource user end with the lowest priority is lower than the priority of the second resource user end.
[0193] Step 31: The scheduling end sends a message to the second resource user end to prompt rejection of resource occupation.
[0194] The second resource user end cannot replace the first resource user end in obtaining resource content from the resource end because the second resource user end has a lower priority than the first resource user end with the lowest priority.
[0195] It should be noted that the explanations and beneficial effects achieved in the aforementioned resource scheduling method embodiment are also applicable to the interactive method for resource scheduling in this embodiment. The principles are the same and will not be repeated in this embodiment.
[0196] Based on the above embodiments, this embodiment provides an interactive method for resource scheduling. Fig.15The flowchart of another interactive method for resource scheduling provided by the embodiment of the present application illustrates how to control resource occupancy when the priority of the second resource user is the same as the priority of the first resource user with the lowest priority. Fig.15 As shown, the method comprises the following steps:
[0197] Step 41, the scheduling end is connected to the resource end.
[0198] Step 42: The scheduling end is successfully connected to the resource end.
[0199] In this embodiment, the connection between the scheduling end and the resource end may be a long connection, that is, it is always in a connected state, or it may be a connection made when there is a resource occupation request.
[0200] Step 43: At least two first resource-using terminals send a resource occupation request to the scheduling terminal to request occupation of resources of the resource terminal.
[0201] The resource occupation request sent by each first resource user includes a transmission carrier, resource parameters and the priority of the corresponding resource user.
[0202] Step 44, the scheduling end determines whether the number of the first resource-using ends is less than or equal to a set threshold, and determines the connection status with the resource end.
[0203] The dispatching end detects the connection status with the resource end to determine that the resource end is in a normal state and can provide the corresponding resource content. The dispatching end also queries the number of first resource users requesting to occupy the resource end resources, and determines that the number of first resource users is less than or equal to the set threshold, that is, the number of first resource users does not exceed the maximum number of resource users that can occupy the resource end resources at the same time, and then determines that the resource occupation request can be responded to.
[0204] Step 45: The scheduling end sends the transmission carrier and resource parameters of each first resource user end to the resource end.
[0205] Step 46: The resource end generates resource content requested by each first resource user end according to the resource parameters of each first resource user end, and writes the resource content of each first resource user end into a corresponding transmission carrier.
[0206] Step 47: Each first resource user monitors the corresponding transmission carrier to obtain resource content in the corresponding transmission carrier.
[0207] Step 48: The second resource user sends a resource occupation request to the scheduling end to request occupation of resources of the resource end.
[0208] The resource occupation request sent by the second resource user includes a transmission carrier, resource parameters and a priority of the corresponding resource user.
[0209] Step 49: The scheduling end determines that the total number of the first resource-using end and the second resource-using end is greater than a set threshold, and determines the connection status with the resource end.
[0210] Step 50: The scheduling end compares and determines that the priority of the first resource user end with the lowest priority is the same as the priority of the second resource user end.
[0211] Step 51: The scheduling end sends an identifier of a second resource user end to a first resource user end with the lowest priority.
[0212] Step 52: The first resource user with the lowest priority generates resource demand information based on the identifier of the second resource user, and sends the generated resource demand information to the scheduling end.
[0213] In step 53, the scheduling end analyzes the acquired resource demand information, and executes step 55 or step 54 according to whether the first resource user end with the lowest priority represented in the resource demand information releases the occupation of the resource end.
[0214] Step 54, the scheduling end determines that the resource demand information indicates that the first resource user with the lowest priority releases its occupation of the resource end, and then the scheduling end sends the transmission carrier, resource parameters and the identifier of the first resource user with the lowest priority of the second resource user to the resource end.
[0215] Thus, the resource end replaces the transmission carrier of the first resource user end with the lowest priority with the transmission carrier of the second resource user end. Specifically, the resource end stops generating the resource content corresponding to the first resource user end with the lowest priority and stops writing the corresponding resource content into the transmission carrier of the first resource user end with the lowest priority according to the received identifier of the first resource user end with the lowest priority. Furthermore, the resource end generates the resource content requested by the second resource user end according to the received resource parameters of the second resource user end, writes the resource content requested by the second resource user end into the transmission carrier corresponding to the second resource user end, and the second resource user end monitors the corresponding transmission carrier to obtain the corresponding resource content from the transmission carrier.
[0216] Step 55, the scheduling end determines that the first resource user end whose resource demand information indicates the lowest priority does not release the occupation of the resource end, and then the scheduling end sends a message to the second resource user end to prompt the rejection of resource occupation.
[0217] It should be noted that the explanations and beneficial effects achieved in the aforementioned resource scheduling method embodiment are also applicable to the interactive method for resource scheduling in this embodiment. The principles are the same and will not be repeated in this embodiment.
[0218] In order to implement the above embodiment, the present application proposes a resource scheduling device.
[0219] Fig.16 A schematic diagram of the structure of a resource scheduling device proposed in an embodiment of the present application.
[0220] like Fig.16 As shown, the resource scheduling device 100 may include: a first acquisition module 110 , a second acquisition module 120 and a sending module 130 .
[0221] The first acquisition module 110 is used to acquire resource occupation requests sent by at least two first resource users, where the resource occupation requests include a transmission carrier.
[0222] The second acquisition module 120 is used to respectively acquire the transmission carrier of each first resource user from the resource occupation request sent by each first resource user.
[0223] The sending module 130 is used to send the transmission carrier of each first resource user to the resource end, wherein the transmission carrier is used for the resource end to write the resource content requested by the resource occupation request, and is used for the corresponding first resource user to monitor to obtain the written resource content.
[0224] In a possible case, the resource occupation request also includes resource parameters; the resource scheduling device 100 may further include:
[0225] A third acquisition module, used to respectively acquire resource parameters of each first resource user from the resource occupation request sent by each first resource user;
[0226] The second sending module is used to send resource parameters of each first resource using end to the resource end, wherein the resource parameters are used by the resource end to generate resource content.
[0227] In another possible case, the resource occupation request also includes the priority of the corresponding resource user; the resource scheduling device 100 may further include:
[0228] The fourth acquisition module is used to acquire the resource occupation request sent by the second resource user.
[0229] The first determination module is used to determine the priority of the second resource users according to the resource occupation request of the second resource users if the total number of the first resource users and the second resource users is greater than a set threshold, and to determine the priority of each first resource user according to the resource occupation request of each first resource user.
[0230] The control module is used to control resource occupation according to the priority relationship between the second resource user and each first resource user.
[0231] In another possible case, the control module can also be used to:
[0232] Determine a first resource user with the lowest priority from among at least two first resource users;
[0233] Comparing the priority relationship between the first resource user and the second resource user of the lowest priority;
[0234] If the priority of the second resource user end is higher than that of the first resource user end with the lowest priority, obtain the transmission carrier of the second resource user end from the resource occupation request sent by the second resource user end, and send the transmission carrier of the second resource user end and the identifier of the first resource user end with the lowest priority to the resource end; wherein the transmission carrier of the second resource user end is used by the resource end to replace the transmission carrier of the first resource user end with the lowest priority;
[0235] If the first resource user with the lowest priority has a higher priority than the second resource user, a message for prompting the second resource user to reject resource occupation is sent to the second resource user.
[0236] In another possible case, the control module can also be used to:
[0237] If the first resource user end with the lowest priority and the second resource user end have the same priority, obtaining resource demand information from the first resource user end with the lowest priority; wherein the resource demand information is used to indicate whether the first resource user end with the lowest priority releases the occupation of the resource end;
[0238] According to the resource demand information, the transmission carrier of the second resource user and the identifier of the first resource user with the lowest priority are sent to the resource end, or a message for prompting rejection of resource occupation is sent to the second resource user.
[0239] In another possible case, the control module can also be used to:
[0240] An identifier of a second resource user is sent to a first resource user with the lowest priority; the identifier is used for the first resource user with the lowest priority to generate and display prompt information; wherein the prompt information is used to prompt a user whether to release occupation of the resource user and provide the released resources to the second resource user.
[0241] In another possible case, the resource scheduling device 100 may further include:
[0242] The second determining module is used to determine whether the number of first resource usage terminals is less than or equal to a set threshold.
[0243] It should be noted that the above Figure 1-7The explanation of the resource calling method embodiment in the above also applies to the resource calling device of this embodiment, and will not be repeated here.
[0244] In order to implement the above embodiment, the present application proposes another resource scheduling device.
[0245] Fig.17 A schematic diagram of the structure of another resource scheduling device proposed in an embodiment of the present application.
[0246] like Fig.17 As shown, the resource scheduling device 200 may include: a receiving module 210 and a writing module 220 .
[0247] The receiving module 210 is used to receive transmission carriers of at least two first resource users sent by the scheduling end.
[0248] The writing module 220 is used to write the resource content into the transmission carrier; wherein the transmission carrier is used for the corresponding first resource user to monitor to obtain the written resource content.
[0249] In a possible case, the resource scheduling device 200 may further include:
[0250] The second receiving module is used to receive the resource parameters of each first resource user sent by the scheduling end.
[0251] The generating module is used to generate resource contents corresponding to each first resource using end according to the resource parameters of each first resource using end.
[0252] In another possible case, the resource scheduling device 200 may further include:
[0253] The third receiving module is used to receive the transmission carrier of the second resource user and the information of the first resource user with the lowest priority sent by the scheduling end.
[0254] The replacement module is used to adopt the transmission carrier of the second resource user end to replace the transmission carrier of the first resource user end with the lowest priority.
[0255] It should be noted that the above Figure 8-10 The explanation of the resource calling method embodiment in the above also applies to the resource calling device of this embodiment, and will not be repeated here.
[0256] In order to implement the above embodiment, the present application proposes another resource scheduling device.
[0257] Fig.18 This is a schematic diagram of the structure of another resource scheduling device proposed in an embodiment of the present application.
[0258] like Fig.18As shown, the resource scheduling device 300 may include: a sending module 310 and a monitoring module 320 .
[0259] The sending module 310 is used to send a resource occupation request to the scheduling end, and the resource occupation request includes a transmission carrier.
[0260] The monitoring module 320 is used to monitor the transmission carrier to obtain the resource content written in the transmission carrier.
[0261] In a possible case, the resource occupation request also includes resource parameters and / or the priority of the corresponding resource user.
[0262] In another possible case, the resource scheduling device 300 may further include:
[0263] The identification receiving module is used to receive the identification of the resource user sent by the scheduling end.
[0264] The first generating module is used to generate and display prompt information according to the identifier of the resource user.
[0265] The second generating module is used to generate resource demand information in response to a user operation on the prompt information.
[0266] The information sending module is used to send resource demand information to the scheduling end.
[0267] It should be noted that the above Figure 11-12 The explanation of the resource calling method embodiment in the above also applies to the resource calling device of this embodiment, and will not be repeated here.
[0268] In order to implement the above embodiments, the present application also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the above embodiments are implemented. Figures 1 to 7 The resource scheduling method, and / or, Figure 8-Figure 10 resource scheduling method, and / or, Figure 11-12 The electronic device mentioned above may be, but is not limited to, a robot.
[0269] In order to implement the above embodiments, the present application also proposes a non-temporary computer-readable storage medium having a computer program stored thereon, which implements the above embodiments when the computer program is executed by a processor. Figures 1 to 7 The resource scheduling method, and / or, Figure 8-Figure 10 resource scheduling method, and / or, Figure 11-12 The electronic device mentioned above may be, but is not limited to, a robot.
[0270] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0271] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0272] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0273] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0274] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0275] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0276] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0277] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A resource scheduling method, characterized in that: Applied to the dispatching end, the method includes: Obtaining resource occupation requests sent by at least two first resource users, wherein the resource occupation requests include a transmission carrier and resource parameters; When the number of the first resource users is less than or equal to a set threshold and the resource end is in a normal connection state, respectively obtaining a transmission carrier and a resource parameter of each of the first resource users from a resource occupation request sent by each of the first resource users, wherein the transmission carrier includes a surface object; Sending the transmission carrier and resource parameters of each of the first resource use ends to the resource end, so that the resource end generates resource content according to the resource parameters, and writes the resource content into the surface object, wherein the surface object is used for the resource end to write the resource content requested by the resource occupation request, and for the corresponding first resource use end to use the surfaceHolder interface to monitor the resource content written into the surface object, and when monitoring that the resource content is written into the surface object, obtain the resource content from the surface object; The resource occupation request also includes the priority of the corresponding resource user end, and after sending the transmission carrier of each of the first resource users to the resource end, further includes: Obtaining a resource occupation request sent by the second resource user, and comparing whether the total number of the first resource user and the second resource user is greater than a set threshold, if the total number of the first resource user and the second resource user is greater than the set threshold, determining the priority of the second resource user according to the resource occupation request of the second resource user, and determining the priority of each of the first resource users according to the resource occupation request of each of the first resource users; Determine a first resource user with the lowest priority from at least two of the first resource users, compare the priority relationship between the first resource user with the lowest priority and the second resource user, and control resource occupation according to the comparison result; wherein: If the comparison result is that the first resource user with the lowest priority and the second resource user have the same priority, then the identifier of the second resource user is sent to the first resource user with the lowest priority, resource demand information is obtained from the first resource user with the lowest priority, and the transmission carrier of the second resource user and the identifier of the first resource user with the lowest priority are sent to the resource user according to the resource demand information, or a message for prompting the rejection of resource occupation is sent to the second resource user; wherein the identifier of the second resource user is used for the first resource user with the lowest priority to generate and display prompt information, the prompt information is used to prompt the user whether to release the occupation of the resource user, and provide the released resources to the second resource user, and the resource demand information is used to indicate whether the first resource user with the lowest priority releases the occupation of the resource user.
2. The resource scheduling method according to claim 1, characterized in that: Controlling resource usage based on comparison results also includes: If the comparison result is that the priority of the second resource user end is higher than the first resource user end with the lowest priority, then obtaining the transmission carrier of the second resource user end from the resource occupation request sent by the second resource user end, and sending the transmission carrier of the second resource user end and the identifier of the first resource user end with the lowest priority to the resource end; wherein the transmission carrier of the second resource user end is used by the resource end to replace the transmission carrier of the first resource user end with the lowest priority; If the comparison result is that the first resource user with the lowest priority has a higher priority than the second resource user, a message for prompting the second resource user to reject resource occupation is sent to the second resource user.
3. A resource scheduling method, characterized in that: Applied to the resource end, the method includes: Receiving the transmission carriers and resource parameters of at least two first resource users sent by the scheduling end using the method as claimed in claim 1 or 2, wherein the transmission carrier includes a surface object; According to the resource parameters of each of the first resource usage ends, resource content corresponding to each of the first resource usage ends is generated, and the resource content is written into the surface object, wherein the surface object is used for the resource end to write the resource content requested by the resource occupation request, and for the corresponding first resource usage end to use the surfaceHolder interface to monitor the resource content written in the surface object, and when it is monitored that the resource content is written in the surface object, the resource content is obtained from the surface object.
4. The resource scheduling method according to claim 3, characterized in that: After receiving the transmission carriers of at least two first resource users sent by the scheduling end, the method further includes: receiving information of a transmission carrier of a second resource user and a first resource user with the lowest priority sent by the scheduling end; The transmission bearer of the second resource user is used to replace the transmission bearer of the first resource user with the lowest priority.
5. A resource scheduling method, characterized in that: Applied to a resource user end, the resource user end includes a first resource user end, and the method includes: Sending a resource occupation request to the scheduling end, wherein the resource occupation request includes a transmission carrier and resource parameters, wherein the transmission carrier includes a surface object; The surfaceHolder interface is used to monitor the resource content written in the surface object. When it is monitored that the resource content is written in the surface object, the resource content written in the surface object using the method as described in claim 1 or 2 is obtained from the surface object.
6. The resource scheduling method according to claim 5, characterized in that: The resource user includes a second resource user, which, after obtaining the resource content written in the transmission carrier, further includes: Receiving an identifier of a second resource user sent by the scheduling end; Generate and display prompt information according to the identifier of the second resource user; In response to a user operation on the prompt information, generating resource demand information; The resource requirement information is sent to the scheduling end.
7. A resource scheduling device, characterized in that: Applied to the dispatching end, the device comprises: A first acquisition module, configured to acquire resource occupation requests sent by at least two first resource users, wherein the resource occupation requests include a transmission carrier and resource parameters; A second acquisition module is used to respectively acquire a transmission carrier and resource parameters of each first resource user from a resource occupation request sent by each first resource user when the number of the first resource users is less than or equal to a set threshold and the resource user is in a normal connection state, wherein the transmission carrier includes a surface object; A sending module, used for sending the transmission carrier and resource parameters of each first resource user end to the resource end, so that the resource end generates resource content according to the resource parameters, and writes the resource content into the surface object, wherein the surface object is used for the resource end to write the resource content requested by the resource occupation request, and for the corresponding first resource user end to use the surfaceHolder interface to monitor the resource content written into the surface object, and when monitoring that the resource content is written into the surface object, obtain the resource content from the surface object; The resource occupation request also includes the priority of the corresponding resource user end, and after sending the transmission carrier of each of the first resource users to the resource end, further includes: Obtaining a resource occupation request sent by the second resource user, and comparing whether the total number of the first resource user and the second resource user is greater than a set threshold, if the total number of the first resource user and the second resource user is greater than the set threshold, determining the priority of the second resource user according to the resource occupation request of the second resource user, and determining the priority of each of the first resource users according to the resource occupation request of each of the first resource users; Determine a first resource user with the lowest priority from at least two of the first resource users, compare the priority relationship between the first resource user with the lowest priority and the second resource user, and control resource occupation according to the comparison result; wherein: If the comparison result is that the first resource user with the lowest priority and the second resource user have the same priority, then the identifier of the second resource user is sent to the first resource user with the lowest priority, resource demand information is obtained from the first resource user with the lowest priority, and the transmission carrier of the second resource user and the identifier of the first resource user with the lowest priority are sent to the resource user according to the resource demand information, or a message for prompting the rejection of resource occupation is sent to the second resource user; wherein the identifier of the second resource user is used for the first resource user with the lowest priority to generate and display prompt information, the prompt information is used to prompt the user whether to release the occupation of the resource user, and provide the released resources to the second resource user, and the resource demand information is used to indicate whether the first resource user with the lowest priority releases the occupation of the resource user.
8. A resource scheduling device, characterized in that: Applied to the resource end, the device comprises: A receiving module, used to receive the transmission carrier and resource parameters of at least two first resource users sent by the scheduling end using the method according to claim 1 or 2, wherein the transmission carrier includes a surface object; A writing module is used to generate resource content corresponding to each of the first resource usage ends according to the resource parameters of each of the first resource usage ends, and write the resource content into the surface object, wherein the surface object is used for the resource end to write the resource content requested by the resource occupation request, and for the corresponding first resource usage end to use the surfaceHolder interface to monitor the resource content written in the surface object, and when it is monitored that the resource content is written in the surface object, obtain the resource content from the surface object.
9. A resource scheduling device, characterized in that: Applied to a resource user end, the resource user end includes a first resource user end, and the device includes: A sending module, used to send a resource occupation request to the scheduling end, wherein the resource occupation request includes a transmission carrier and resource parameters, wherein the transmission carrier includes a surface object; A monitoring module is used to monitor the resource content written in the surface object using the surfaceHolder interface, and when it is monitored that the resource content is written in the surface object, obtain the resource content written in the surface object using the method described in claim 1 or 2 from the surface object.
10. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the resource scheduling method according to any one of claims 1 to 6 is implemented.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the resource scheduling method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and system for achieving camera resource sharing
CN101594510A
Method and device for controlling camera
CN109462726A