CN115686746A - Access method, task processing method, computing device, and computer storage medium - Google Patents

Access method, task processing method, computing device, and computer storage medium Download PDF

Info

Publication number
CN115686746A
CN115686746A CN202211314194.3A CN202211314194A CN115686746A CN 115686746 A CN115686746 A CN 115686746A CN 202211314194 A CN202211314194 A CN 202211314194A CN 115686746 A CN115686746 A CN 115686746A
Authority
CN
China
Prior art keywords
task
execution unit
work queue
access
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211314194.3A
Other languages
Chinese (zh)
Inventor
尚旭春
丁宁
邓泽林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202211314194.3A priority Critical patent/CN115686746A/en
Publication of CN115686746A publication Critical patent/CN115686746A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

The embodiment of the invention provides an access method, a task processing method, a device computing device and a computer storage medium. The access method comprises the following steps: acquiring a task to be processed sent by an execution unit, wherein the task to be processed carries identification information of the execution unit; acquiring an access control table, wherein the access control table is used for recording access authority information of a work queue; retrieving the access control table based on the identification information to determine whether the execution unit has access to the work queue; and sending the task to be processed to the work queue under the condition that the execution unit has the access right of the work queue. The technical scheme provided by the embodiment of the invention can ensure that the work queue only needs to process the to-be-processed task sent by the execution unit with the access right, thereby avoiding the technical problem that the resource of the hardware equipment is stolen or maliciously occupied.

Description

Access method, task processing method, computing device, and computer storage medium
Technical Field
The embodiment of the invention relates to the technical field of virtualization, in particular to an access method, a task processing method, computing equipment and a computer storage medium.
Background
The virtualization technology is to create a plurality of isolated Virtual Machines (VMs) on a host under the assistance and control of a VM monitor, and an operating system and an application program can run on each VM without being aware of each other. Virtualization technology is currently in widespread use as a mechanism to integrate multiple workloads (e.g., multiple users' virtual machines) onto a single host while keeping them isolated from each other.
The host is usually configured with hardware devices, such as a network card, a GPU (Graphics Processing Unit), and the like. In order to improve the work efficiency of the hardware device, the hardware device usually corresponds to a first-in first-out work queue. In a virtual machine or a host, an execution unit, such as a thread, in charge of program execution may send a task to be processed to a work queue of a hardware device, so that the hardware device processes the task to be processed in the work queue.
The inventor finds that the related art has the technical problem that the resources of the hardware equipment can be stolen or maliciously occupied in the process of realizing the concept of the invention.
Disclosure of Invention
The embodiment of the invention provides an access method, a task processing device, a computing device and a computer storage medium.
In a first aspect, an embodiment of the present invention provides an access method, including:
acquiring a to-be-processed task sent by an execution unit, wherein the to-be-processed task carries identification information of the execution unit;
acquiring an access control table, wherein the access control table is used for recording access authority information of a work queue;
retrieving the access control table based on the identification information to determine whether the execution unit has access to the work queue;
and sending the task to be processed to the work queue under the condition that the execution unit has the access right of the work queue.
In a second aspect, an embodiment of the present invention provides a task processing method, including:
acquiring a task to be processed from a work queue, wherein the task to be processed is sent to an access controller by an execution unit, the task to be processed carries identification information of the execution unit, the access controller acquires an access control table for recording access right information of the work queue after receiving the task to be processed, retrieves the access control representation based on the identification information to determine whether the execution unit has the access right of the work queue, and sends the task to be processed to the work queue under the condition that the execution unit has the access right of the work queue;
and processing the task to be processed.
In a third aspect, an embodiment of the present invention provides an access method, including:
obtaining subscription information of a plurality of candidate execution units running in the computing equipment aiming at the work queue;
generating access authority information of the work queue according to the subscription information;
recording the access authority information into an access control table so as to retrieve the access control table based on the identification information after acquiring the to-be-processed task which is sent by an execution unit and carries the identification information of the execution unit, so as to determine whether the execution unit has the access authority of the work queue, and sending the to-be-processed task to the work queue under the condition that the execution unit has the access authority of the work queue.
In a fourth aspect, an embodiment of the present invention provides an access apparatus, including:
the first task acquisition module is used for acquiring a to-be-processed task sent by an execution unit, wherein the to-be-processed task carries identification information of the execution unit;
the access control list acquisition module is used for acquiring an access control list, and the access control list is used for recording the access authority information of the work queue;
a retrieval module, configured to retrieve the access control table based on the identification information to determine whether the execution unit has an access right of the work queue;
and the task sending module is used for sending the task to be processed to the work queue under the condition that the execution unit has the access right of the work queue.
In a fifth aspect, an embodiment of the present invention provides a task processing apparatus, including:
the second task obtaining module is used for obtaining a task to be processed from a work queue, the task to be processed is sent to an access controller by an execution unit, the task to be processed carries identification information of the execution unit, the access controller obtains an access control table used for recording access authority information of the work queue after receiving the task to be processed, the access control table is searched based on the identification information to determine whether the execution unit has the access authority of the work queue, and the task to be processed is sent to the work queue under the condition that the execution unit has the access authority of the work queue;
and the task processing module is used for processing the task to be processed.
In a sixth aspect, an embodiment of the present invention provides an access apparatus, including:
the information acquisition module is used for acquiring subscription information of a plurality of candidate execution units running in the computing equipment aiming at the work queue;
the information generating module is used for generating the access authority information of the work queue according to the subscription information;
and the information recording module is used for recording the access authority information into an access control table so as to retrieve the access control table based on the identification information after acquiring the to-be-processed task which is sent by an execution unit and carries the identification information of the execution unit, so as to determine whether the execution unit has the access authority of the work queue, and sending the to-be-processed task to the work queue under the condition that the execution unit has the access authority of the work queue.
In a seventh aspect, an embodiment of the present invention provides a computing device, including a processing component and a storage component;
the storage component stores one or more computer instructions; the one or more computer instructions are used for being called and executed by the processing component to implement the access method provided by the embodiment of the invention, or to implement the task processing method provided by the embodiment of the invention.
In an eighth aspect, an embodiment of the present invention provides a computer storage medium, which stores a computer program, where when the computer program is executed by a computer, the computer program implements the access method provided in the embodiment of the present invention, or implements the task processing method provided in the embodiment of the present invention.
The embodiment of the invention obtains the task to be processed sent by the execution unit, wherein the task to be processed carries the identification information of the execution unit; acquiring an access control table, wherein the access control table is used for recording access authority information of a work queue; retrieving the access control table based on the identification information to determine whether the execution unit has access to the work queue; the technical scheme includes that the to-be-processed tasks are sent to the work queue under the condition that the execution unit has the access authority of the work queue, after the to-be-processed tasks are received, whether the corresponding execution unit has the authority to access a work column or not is determined by retrieving an access control table, and the to-be-processed tasks are sent to the work queue when the execution unit has the access authority, so that the work queue only needs to process the to-be-processed tasks sent by the execution unit with the access authority, and the technical problem that resources of hardware equipment are stolen or maliciously occupied is avoided.
These and other aspects of the invention will be apparent from and elucidated with reference to the embodiments described hereinafter.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flow chart that schematically illustrates an access method provided by an embodiment of the present invention;
FIG. 2 is a flow chart that schematically illustrates an access method provided by an embodiment of the present invention;
FIG. 3 is a flow chart that schematically illustrates a method for task processing, in accordance with an embodiment of the present invention;
FIG. 4 is a flow chart that schematically illustrates an access method, in accordance with a further embodiment of the present invention;
FIG. 5 is a block diagram that schematically illustrates an access method provided by an embodiment of the present invention;
FIG. 6 is a block diagram that schematically illustrates an access device, in accordance with an embodiment of the present invention;
fig. 7 is a block diagram schematically illustrating a task processing apparatus according to an embodiment of the present invention;
FIG. 8 is a block diagram that schematically illustrates an access device, in accordance with another illustrative embodiment of the present invention;
fig. 9 is a block diagram that schematically illustrates a computing device, in accordance with an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention.
In some flows described in the present specification and claims and above figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel as they occur herein, with the order of the operations being given as 101, 102, etc. merely to distinguish between various operations, and the order of the operations itself does not represent any order of performance. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit the types of "first" and "second".
The virtualization technology is that a plurality of isolated virtual machines are created on a host under the assistance and control of a virtual machine monitor, and an operating system and an application program can run on each virtual machine without mutual awareness. Virtualization technology is currently in widespread use as a mechanism to integrate multiple workloads (e.g., multiple users' virtual machines) onto a single host while keeping them isolated from each other.
Currently, virtualization technical solutions mainly include software simulation virtualization and hardware-assisted virtualization. Although the software simulation virtualization is good in compatibility, each time an execution Unit, such as a thread, in a virtual machine or a host machine, responsible for program execution needs to intercept and capture the access of a hardware device, such as a network card or a GPU (Graphics Processing Unit), and convert a corresponding device operation into an operation on a physical machine, and after the operation is completed, the software converts an operation result and notifies the converted operation result to a corresponding thread, which may cause a large performance overhead. Therefore, hardware-assisted virtualization is becoming the mainstream virtualization scheme.
In order to improve the work efficiency of the hardware device, the hardware device usually corresponds to a first-in first-out work queue. Work queues may include exclusive Work queues (DWQs) and Shared Work Queues (SWQs). The DWQ can be exclusively accessed by a certain thread, and only the DWQ has the permission to send the task to be processed to the DWQ; the SWQ, that is, the work queue, can be shared by a plurality of threads, and the plurality of threads can send the task to be processed to the SWQ.
In the hardware-assisted virtualization scheme, the work queue is a granularity at which virtualization can be cut, that is, the work queue of the hardware device is a basic unit of virtualization and can be allocated to a corresponding process as required. The work queue assigned to the virtual machine may be an SWQ, which may be shared by multiple processes.
At this time, the inventor finds that, in order to identify from which task to be processed is received in the SWQ, a label may be marked on the task to be processed before the process pushes the task to be processed to the SWQ, and the label may uniquely correspond to the process, so that the hardware device may know from which task to be processed comes and to whom a processing result is returned after the task is processed.
The inventor finds that, in the related art, although the hardware device can know from which the to-be-processed task comes and to whom the processing result is returned after the task is processed through a mode of tagging the to-be-processed task, the hardware device cannot confirm whether the to-be-processed task with the tag is allowed to be submitted to the current SWQ for processing, and the to-be-processed task sent to the SWQ can only be received in a full disk manner. Therefore, a process without the SWQ access right can send a task to be processed to the SWQ, and as the hardware equipment cannot confirm whether the process has the right to access the SWQ, only the request of the process can be processed, so that resources are stolen, and for the process with the SWQ access right, the Service resources of the process are occupied by the process without the right, so that the Quality of Service (QOS) is reduced, and the user experience is influenced.
In order to solve the technical problems in the related art, the embodiment of the invention obtains the to-be-processed task sent by the execution unit, wherein the to-be-processed task carries the identification information of the execution unit; acquiring an access control table, wherein the access control table is used for recording access authority information of a work queue; retrieving an access control table based on the identification information to determine whether the execution unit has an access right to the work queue; the technical scheme includes that a task to be processed is sent to a work queue under the condition that an execution unit has access authority of the work queue, after the task to be processed is received, whether the corresponding execution unit has authority to access a work column or not is determined by retrieving an access control table, and the task to be processed is sent to the work queue only when the execution unit has the access authority, so that the task to be processed sent by the execution unit with the access authority can be processed by the work queue, and the technical problem that resources of hardware equipment are stolen or maliciously occupied is avoided.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
Fig. 1 schematically shows a flowchart of an access method provided by an embodiment of the present invention, where the access method may be executed by an access controller, and may include the following steps:
101, acquiring a to-be-processed task sent by an execution unit, wherein the to-be-processed task carries identification information of the execution unit;
102, acquiring an access control table, wherein the access control table is used for recording access authority information of a work queue;
103, retrieving an access control table based on the identification information to determine whether the execution unit has an access right to the work queue;
and 104, in the case that the execution unit has the access right of the work queue, sending the task to be processed to the work queue.
According to the embodiment of the present invention, the execution unit may include, for example, a thread running in a virtual machine, and may also include a thread running in a host machine.
According to embodiments of the invention, the queue of work may comprise, for example, a SWQ.
According to the embodiment of the present invention, after the execution Unit generates the to-be-processed task, the to-be-processed task may be first sent to a marking device, such as a Central Processing Unit (CPU), deployed in a host computer and used for marking a label, where the marking device marks a label, that is, identification information, uniquely corresponding to the execution Unit on the to-be-processed task, and then sends the to-be-processed task carrying the identification information of the execution Unit to the access controller.
According to an embodiment of the present invention, the identification information may include, for example, a PASID (Process Address Space Identifier).
According to the embodiment of the invention, the access controller can be deployed in an operating system of the host.
According to the embodiment of the invention, after the task to be processed is obtained, the access controller may obtain an access control table pre-stored in the memory from the memory of the host, where the access control table may be used to record access authority information of the work queue, where the access authority information may include, for example, at least one thread deployed in the host and access authority corresponding to the thread, and the access authority may include, for example, authority and no authority.
According to the embodiment of the present invention, each work queue may correspond to a separate access control table, but is not limited thereto, and the access control table may also record access authority information of the work queues of all hardware devices on the host, for example, the access control table may be divided into a plurality of table areas, and each table area records access authority information of one work queue.
Table 1 below schematically illustrates one implementation of an access control table.
Table 1 access control table
Identification information Access rights
PASID1 Has authority
PASID2 Without permission
…… ……
PASIDn Has authority
Table 1 above may represent an access control table corresponding to a certain work queue according to an embodiment of the present invention. The access control table is composed of a plurality of table entries, and each table entry is composed of two parts, namely identification information corresponding to an execution unit and whether the execution unit has access authority or not.
According to the embodiment of the invention, after the to-be-processed task is obtained, whether the execution unit sending the to-be-processed task has the access authority of the work queue can be determined by searching the access control table.
According to an embodiment of the present invention, an access control table may be generated by:
obtaining subscription information of a plurality of candidate execution units running in the computing equipment aiming at the work queue;
generating access authority information of the work queue according to the subscription information;
and recording the access authority information into an access control table.
According to the embodiment of the invention, only the identification information of a plurality of candidate execution units can be recorded in the initial access control table, and after a certain candidate execution unit subscribes to the work queue, the access authority corresponding to the candidate execution unit can be changed into the authorized access authority in the initial access control table.
According to the embodiment of the invention, in the case that the execution unit is determined to have the access right of the work queue, the task to be processed can be sent to the corresponding work queue. In the event that it is determined that the execution unit does not have access rights to the work queue, a prompt may be output to prompt the execution unit to not have access rights to the work queue.
According to an embodiment of the present invention, sending the task to be processed to the work queue may specifically be implemented as:
determining a plurality of candidate work queues for processing the tasks to be processed;
respectively determining load information of a plurality of candidate work queues;
determining a work queue from a plurality of candidate work queues based on the load information;
and sending the task to be processed to a work queue.
According to an embodiment of the present invention, the plurality of candidate work queues may be candidate work queues each having access rights to execution units.
According to the embodiment of the invention, the hardware device can correspond to a plurality of work queues, and the execution unit can be determined to have access authority to the plurality of work queues corresponding to the hardware device by retrieving the access control table, so that the plurality of work queues can be determined as candidate work queues.
According to the embodiment of the invention, the access control table can record the access authority information of the hardware equipment besides the access authority information of the work queue. For example, when the access control table records that the execution unit has access right to a certain hardware device, it may be determined that the execution unit has access right to each work queue of the hardware device.
According to an embodiment of the present invention, after the candidate work queues are determined, the load information of each candidate work queue may be determined separately. The load information may include, for example, the number of unprocessed tasks in each work queue. Because the work queue has the characteristic of first-in first-out, the larger the number of unprocessed tasks in the work queue is, the longer the time for the tasks to be processed by the hardware device is required when the tasks to be processed are pushed to the work queue.
According to the embodiment of the invention, after the load information of the candidate work queues is determined, the candidate work queue with the lowest load in the load information can be determined as the work queue for receiving the task to be processed. The lowest load may include, for example, a minimum number of unprocessed tasks in the work queue.
According to the embodiment of the invention, the task to be processed carries the first work queue identifier.
According to another embodiment of the present invention, sending the task to be processed to the work queue may be specifically implemented as:
determining a plurality of candidate work queues for processing the tasks to be processed;
determining a work queue corresponding to the first work queue identification from the plurality of candidate work queues;
and sending the task to be processed to a work queue.
According to an embodiment of the present invention, the plurality of candidate work queues may be candidate work queues each having access rights to the execution units.
According to the embodiment of the invention, the hardware device can correspond to a plurality of work queues, and the execution unit can be determined to have access authority to the plurality of work queues corresponding to the hardware device by searching the access control table, so that the plurality of work queues can be determined as candidate work queues.
According to the embodiment of the invention, the access control table can record the access authority information of the hardware equipment besides the access authority information of the work queue. For example, when the access control table records that the execution unit has access right to a certain hardware device, it may be determined that the execution unit has access right to each work queue of the hardware device.
According to the embodiment of the invention, when the execution unit generates the task to be processed, a certain work queue can be designated to process the task to be processed, so that the task to be processed can carry the first work queue identifier of the work queue expected to process the task to be processed.
According to the embodiment of the invention, after a plurality of candidate work queues are determined, whether the plurality of candidate work queues comprise a work queue corresponding to a first work queue identifier or not can be judged, and if the plurality of candidate work queues comprise a work queue corresponding to the first work queue identifier, the work queue corresponding to the first work queue identifier is determined as a work queue for receiving a task to be processed; if the plurality of candidate work queues do not include the work queue corresponding to the first work queue identifier, permission prompt information for prompting that the execution unit does not have the access permission of the work queue corresponding to the first work queue identifier may be output.
According to an embodiment of the invention, the access method further comprises:
acquiring a task processing result which is sent by a work queue and corresponds to a task to be processed, acquiring the task to be processed from the work queue by cloud computing equipment, processing the task to be processed, generating the task to be processed, and sending the task to the work queue;
and sending the task processing result to an execution unit.
According to an embodiment of the present invention, sending the task processing result to the execution unit may be specifically implemented as:
and sending the task processing result to the execution unit based on the identification information.
According to an embodiment of the invention, after the cloud computing device processes the task to be processed to generate the task processing result, the task processing result may still carry the identification information of the execution unit, so that the task processing result may be sent to the execution unit based on the identification information of the execution unit.
According to another embodiment of the invention, the access controller may record the pending task and the identification information of the execution unit in a task record before sending the pending task to the work queue. After receiving the task processing result returned by the work queue, the access controller may retrieve the task record table, and determine, based on the task record table, the identification information of the execution unit corresponding to the task processing result, so as to send the task processing result to the corresponding execution unit based on the identification information of the execution unit.
According to the embodiment of the present invention, based on the identification information, sending the task processing result to the execution unit may specifically be implemented as:
traversing a plurality of candidate execution units running in a computing device;
determining an execution unit corresponding to the identification information in the plurality of candidate execution units;
and sending the task processing result to an execution unit.
According to the embodiment of the invention, under the condition that the execution unit is deployed in the virtual machine, the task to be processed carries the virtual machine identifier of the virtual machine.
According to the embodiment of the present invention, sending the task processing result to the execution unit may be specifically implemented as:
determining a target virtual machine corresponding to the virtual machine identifier from a plurality of candidate virtual machines deployed in the computing device;
determining an execution unit corresponding to the identification information from a plurality of candidate execution units running in the target virtual machine;
and sending the task processing result to an execution unit.
Table 2 below schematically shows one implementation of an access control table according to an embodiment of the present invention.
Table 2 access control table
Identification information Virtual machine identification Access rights
PASID1 VM1 Has authority
PASID2 Without permission
…… ……
PASIDn VMn Has authority
According to the embodiment of the present invention, when the execution unit is an execution unit deployed in a virtual machine, the access control table may further record, in correspondence with the identification information of the execution unit, a virtual machine identification of the virtual machine in which the execution unit is deployed.
According to the embodiment of the present invention, after the access controller obtains the task processing result, it may first determine whether the execution unit to which the identification information corresponding to the task processing result belongs is deployed in the virtual machine, and if the execution unit is deployed in the virtual machine, it may be determined which virtual machine it is deployed in based on the virtual machine identification recorded in the access control table, so that the execution unit corresponding to the identification information may be determined from a plurality of candidate execution units deployed in the virtual machine.
According to an embodiment of the present invention, sending the task processing result to the execution unit may be specifically implemented as:
acquiring a polling request sent by an execution unit according to a preset time interval;
and responding to the polling request, and sending the task processing result to the execution unit.
According to the embodiment of the invention, after the execution unit sends the task to be processed to the access controller, the execution unit may send a polling request to the access controller according to a preset time interval, where the polling request is used for requesting a task processing result. The preset time interval may be, for example, 10 seconds, 30 seconds, 1 minute, and the like, and the value of the preset time interval is not specifically limited in the embodiment of the present invention.
According to the embodiment of the invention, after receiving the polling request from the execution unit, if the access controller does not receive the task processing result from the work queue, the access controller may ignore the polling request, and if the access controller receives the task processing result from the work queue, the access controller may send the task processing result to the execution unit in response to the polling request.
According to the embodiments of the present invention, by returning the task processing result to the corresponding execution unit based on the identification information, isolation between the plurality of execution units sharing the SWQ can be achieved.
Fig. 2 schematically shows a flowchart of an access method provided by an embodiment of the present invention.
As shown in fig. 2, after the task to be processed is generated, the task to be processed may be first sent to the marking device of the host machine. The marking device can mark the PASID which is uniquely corresponding to the execution unit on the task to be processed. In addition, the marking device can also judge whether the execution unit is deployed on the virtual machine, and if the execution unit is deployed on the virtual machine, the marking device can also mark the virtual machine identification on the task to be processed.
After marking is completed, the marking device may send the pending task to the access controller. The access controller obtains an access control table, determines whether the execution unit carried by the task to be processed has the access right of the work queue or not based on the PASID of the execution unit carried by the task to be processed, and pushes the task to be processed to the work queue if the execution unit carries the access right of the work queue so that the computing device can obtain the task to be processed from the work queue for processing.
Fig. 3 schematically illustrates a flowchart of a task processing method according to an embodiment of the present invention, where the task processing method may be performed by a cloud computing device, and may include the following steps:
301, acquiring a to-be-processed task from a work queue, wherein the to-be-processed task is sent to an access controller by an execution unit, the to-be-processed task carries identification information of the execution unit, after receiving the to-be-processed task, the access controller acquires an access control table for recording access right information of the work queue, and retrieves an access control representation based on the identification information to determine whether the execution unit has the access right of the work queue, and under the condition that the execution unit has the access right of the work queue, the to-be-processed task is sent to the work queue;
and 302, processing the task to be processed.
According to an embodiment of the present invention, the task processing method may be applied to a cloud server (ECS) and executed by a cloud computing device in the ECS. The cloud computing device may correspond to a cloud computing service, such as a cloud host, a cloud space, cloud development, a cloud testing service, and so forth.
According to the embodiment of the present invention, a specific implementation process of sending the to-be-processed task to the work queue may refer to the access method shown in fig. 1, which is not described herein again.
Fig. 4 schematically shows a flowchart of an access method provided by another embodiment of the present invention, where the access method may be executed by an access controller, and may include the following steps:
401, obtaining subscription information of a plurality of candidate execution units running in a computing device for a work queue;
402, generating access authority information of the work queue according to the subscription information;
and 403, recording the access right information into an access control table, so as to retrieve the access control table based on the identification information after acquiring the to-be-processed task which is sent by the execution unit and carries the identification information of the execution unit, to determine whether the execution unit has the access right of the work queue, and sending the to-be-processed task to the work queue under the condition that the execution unit has the access right of the work queue.
Table 3 below schematically shows one implementation of an access control table.
Table 3 access control table
Identification information Access rights
PASID1 Has authority
PASID2 Without permission
…… ……
PASIDn Has authority
Table 3 above may represent an access control table corresponding to a certain work queue according to an embodiment of the present invention. The access control table is composed of a plurality of table entries, and each table entry is composed of two parts, namely identification information corresponding to an execution unit and whether the execution unit has access authority or not.
According to the embodiment of the invention, only the identification information of a plurality of candidate execution units can be recorded in the initial access control table, and after a certain candidate execution unit subscribes to the work queue, the access authority corresponding to the candidate execution unit can be changed into the authorized access authority in the initial access control table.
According to the embodiment of the invention, after the access control table is generated, the access control table can be stored in the memory of the host.
According to the embodiment of the invention, after the access control table is stored in the memory of the host machine, if a new execution unit subscribes to the work queue, the access control table stored in the memory can be updated, and the access authority of the execution unit in the access control table is updated to have authority.
Fig. 5 is a block diagram schematically illustrating an access method provided in an embodiment of the present invention.
As shown in fig. 5, a virtual machine 501 runs on the host, a virtual machine process 5011 and a virtual machine process 5012 run in the virtual machine 501, and a host process 502 and a host process 503 run on the host.
In embodiments of the present invention, virtual machine 501, host process 502, and host process 503 may all access shared work queue 507 of computing device 508.
An access controller 505 runs in the host operating system 504, and all the tasks to be processed that need to be sent to the shared work queue 507 need to be sent to the access controller 505 first. After acquiring the to-be-processed task, the access controller 505 may acquire an access control table 510 from the memory 506 of the host, determine whether the task sender has an access right of the shared work queue 507 based on the PASID of the task sender carried in the to-be-processed task, and send the to-be-processed task to the shared work queue 507 when the task sender has the access right of the shared work queue 507.
For example, the virtual machine process 5011, the virtual machine process 5012, the host process 502, and the host process 503 all send a task waiting for processing to the access controller 505, where the PASID of the virtual machine process 5011 is PASID1, the PASID of the virtual machine process 5012 is PASID2, the PASID of the host process 502 is PASID3, and the PASID of the host process 503 is PASID4. In the case where the access controller 505 determines that the virtual machine process 5011 and the host process 502 have the access right of the shared work queue 507 and the virtual machine process 5012 and the host process 503 do not have the access right of the shared work queue 507 by retrieving the access control table, the access controller 505 may send the to-be-processed tasks sent by the virtual machine process 5011 and the host process 502 to the shared work queue 507 and return permission prompt information to the virtual machine process 5012 and the host process 503 to prompt the virtual machine process 5012 and the host process 503 not to have the access right of the shared work queue.
Fig. 6 schematically shows a block diagram of an access device according to an embodiment of the present invention, and the access device 600 may include a first task obtaining module 601, an access control table obtaining module 602, a retrieving module 603, and a task sending module 604.
A first task obtaining module 601, configured to obtain a to-be-processed task sent by an execution unit, where the to-be-processed task carries identification information of the execution unit;
an access control table obtaining module 602, configured to obtain an access control table, where the access control table is used to record access authority information of a work queue;
a retrieving module 603 configured to retrieve an access control table based on the identification information to determine whether the execution unit has an access right to the work queue;
and a task sending module 604, configured to send the to-be-processed task to the work queue when the execution unit has an access right to the work queue.
According to an embodiment of the present invention, the task sending module 604 includes:
a first queue determination unit configured to determine a plurality of candidate work queues for processing a task to be processed;
a load determining unit, configured to determine load information of a plurality of candidate work queues respectively;
a second queue determination unit configured to determine a work queue from the plurality of candidate work queues based on the load information;
and the first task sending unit is used for sending the tasks to be processed to the work queue.
According to the embodiment of the invention, the task to be processed carries the first work queue identifier.
According to an embodiment of the present invention, the task sending module 604 includes:
a third queue determination unit configured to determine a plurality of candidate work queues for processing the to-be-processed task;
a fourth queue determination unit, configured to determine a work queue corresponding to the first work queue identifier from the multiple candidate work queues;
and the second task sending unit is used for sending the tasks to be processed to the work queue.
According to an embodiment of the invention, the access device 600 further comprises:
the result acquisition module is used for acquiring a task processing result which is sent by the work queue and corresponds to the task to be processed, wherein the task processing result comprises the task to be processed and generated after the task to be processed is acquired from the work queue by the cloud computing equipment and sent to the work queue;
and the result sending module is used for sending the task processing result to the execution unit.
According to an embodiment of the invention, the result sending module comprises:
the request acquisition unit is used for acquiring the polling request sent by the execution unit according to the preset time interval;
and the request sending unit is used for responding to the polling request and sending the task processing result to the execution unit.
According to an embodiment of the invention, the result sending module comprises:
and the first result sending unit is used for sending the task processing result to the execution unit based on the identification information.
According to an embodiment of the present invention, the result transmitting unit includes:
a traversal subunit configured to traverse a plurality of candidate execution units operating in the computing device;
an execution unit determination subunit configured to determine an execution unit corresponding to the identification information from among the plurality of candidate execution units;
and the second result sending subunit is used for sending the task processing result to the execution unit.
According to the embodiment of the invention, under the condition that the execution unit is deployed in the virtual machine, the task to be processed carries the virtual machine identifier of the virtual machine.
According to an embodiment of the invention, the result sending module comprises:
a virtual machine determining unit, configured to determine, from multiple candidate virtual machines deployed in a computing device, a target virtual machine corresponding to a virtual machine identifier;
an execution unit determination unit configured to determine an execution unit corresponding to the identification information, among a plurality of candidate execution units operating in the target virtual machine;
and the third result determining unit is used for sending the task processing result to the executing unit.
The access device of fig. 6 may perform the access method of the embodiment shown in fig. 1, and the implementation principle and the technical effect are not described in detail. The specific manner in which each module and unit of the access device in the above embodiments perform operations has been described in detail in the embodiments related to the method, and will not be elaborated herein.
Fig. 7 schematically illustrates a block diagram of a task processing device according to an embodiment of the present invention, where the task processing device 700 includes a second task obtaining module 701 and a task processing module 702.
The second task obtaining module 701 is configured to obtain a to-be-processed task from a work queue, where the to-be-processed task is sent to an access controller by an execution unit, the to-be-processed task carries identification information of the execution unit, and after receiving the to-be-processed task, the access controller obtains an access control table for recording access right information of the work queue, and retrieves an access control representation based on the identification information to determine whether the execution unit has an access right of the work queue, and sends the to-be-processed task to the work queue under the condition that the execution unit has the access right of the work queue;
a task processing module 702, configured to process the task to be processed.
The task processing device shown in fig. 7 may execute the task processing method described in the embodiment shown in fig. 2, and details of an implementation principle and a technical effect thereof are omitted. The specific manner in which each module and unit of the task processing device in the above embodiments perform operations has been described in detail in the embodiments related to the method, and will not be described in detail here.
Fig. 8 schematically shows a block diagram of an access device according to another embodiment of the present invention, where the access device 800 includes an information obtaining module 801, an information generating module 802, and an information recording module 803.
An information obtaining module 801, configured to obtain subscription information of a plurality of candidate execution units running in a computing device for a work queue;
an information generating module 802, configured to generate access right information of the work queue according to the subscription information;
an information recording module 803, configured to record the access right information into an access control table, so that after a to-be-processed task sent by an execution unit and carrying identification information of the execution unit is acquired, the access control table is retrieved based on the identification information to determine whether the execution unit has the access right of the work queue, and the to-be-processed task is sent to the work queue under the condition that the execution unit has the access right of the work queue.
The access device shown in fig. 8 may perform the access method described in the embodiment shown in fig. 3, and details of implementation principles and technical effects are not repeated. The specific manner in which each module and unit of the access device in the above embodiments perform operations has been described in detail in the embodiments related to the method, and will not be described in detail here.
In one possible design, the access device and the task processing device provided by the embodiment of the present invention may be implemented as a computing device, as shown in fig. 9, the computing device may include a storage component 901 and a processing component 902;
the storage component 901 stores one or more computer instructions, wherein the one or more computer instructions are used for the processing component 902 to call and execute, so as to implement the access method and the task processing method provided by the embodiment of the present invention.
Of course, a computing device may also necessarily include other components, such as input/output interfaces, communication components, and so forth. The input/output interface provides an interface between the processing component and a peripheral interface module, which may be an output device, an input device, etc. The communication component is configured to facilitate wired or wireless communication between the computing device and other devices, and the like.
The computing device may be a physical device or an elastic computing host provided by a cloud computing platform, and the computing device may be a cloud server, and the processing component, the storage component, and the like may be a basic server resource rented or purchased from the cloud computing platform.
When the computing device is a physical device, the computing device may be implemented as a distributed cluster consisting of a plurality of servers or terminal devices, or may be implemented as a single server or a single terminal device.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program, and when the computer program is executed by a computer, the computer program can implement the access method and the task processing method provided by the embodiment of the invention.
The embodiment of the invention also provides a computer program product, which comprises a computer program, and the computer program can realize the access method and the task processing method provided by the embodiment of the invention when being executed by a computer.
The processing components in the respective embodiments above may include one or more processors executing computer instructions to perform all or part of the steps of the methods described above. Of course, the processing elements may also be implemented as one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components configured to perform the above-described methods.
The storage component is configured to store various types of data to support operations in the device. The memory components may be implemented by any type or combination of volatile and non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (12)

1. An access method, comprising:
acquiring a to-be-processed task sent by an execution unit, wherein the to-be-processed task carries identification information of the execution unit;
acquiring an access control table, wherein the access control table is used for recording access authority information of a work queue;
retrieving the access control table based on the identification information to determine whether the execution unit has access to the work queue;
and sending the task to be processed to the work queue under the condition that the execution unit has the access right of the work queue.
2. The method of claim 1, wherein sending the pending task to the work queue comprises:
determining a plurality of candidate work queues for processing the task to be processed;
respectively determining load information of the plurality of candidate work queues;
determining the work queue from the plurality of candidate work queues based on the load information;
and sending the task to be processed to the work queue.
3. The method of claim 1, wherein the pending task carries a first work queue identifier;
the sending the to-be-processed task to the work queue comprises:
determining a plurality of candidate work queues for processing the tasks to be processed;
determining the work queue corresponding to the first work queue identification from the plurality of candidate work queues;
and sending the task to be processed to the work queue.
4. The method of claim 1, further comprising:
acquiring a task processing result which is sent by the work queue and corresponds to the task to be processed, wherein the task processing result is generated after the task to be processed is acquired from the work queue by cloud computing equipment and processed and is sent to the work queue;
and sending the task processing result to the execution unit.
5. The method of claim 1, wherein sending the task processing results to the execution unit comprises:
acquiring a polling request sent by the execution unit according to a preset time interval;
and responding to the polling request, and sending the task processing result to the execution unit.
6. The method of claim 4, wherein sending the task processing results to the execution unit comprises:
and sending the task processing result to the execution unit based on the identification information.
7. The method of claim 6, wherein sending the task processing result to the execution unit based on the identification information comprises:
traversing a plurality of candidate execution units running in a computing device;
determining an execution unit corresponding to the identification information from the plurality of candidate execution units;
and sending the task processing result to the execution unit.
8. The method according to claim 4, wherein, in a case where the execution unit is deployed in a virtual machine, the task to be processed carries a virtual machine identifier of the virtual machine;
the sending the task processing result to the execution unit includes:
determining a target virtual machine corresponding to the virtual machine identification from a plurality of candidate virtual machines deployed in a computing device;
determining an execution unit corresponding to the identification information from a plurality of candidate execution units running in the target virtual machine;
and sending the task processing result to the execution unit.
9. A method for processing a task, comprising:
acquiring a task to be processed from a work queue, wherein the task to be processed is sent to an access controller by an execution unit, the task to be processed carries identification information of the execution unit, the access controller acquires an access control table for recording access right information of the work queue after receiving the task to be processed, retrieves the access control representation based on the identification information to determine whether the execution unit has the access right of the work queue, and sends the task to be processed to the work queue under the condition that the execution unit has the access right of the work queue;
and processing the task to be processed.
10. An access method, comprising:
obtaining subscription information of a plurality of candidate execution units running in the computing equipment aiming at the work queue;
generating access authority information of the work queue according to the subscription information;
recording the access authority information into an access control table so as to retrieve the access control table based on the identification information after acquiring the to-be-processed task which is sent by an execution unit and carries the identification information of the execution unit, so as to determine whether the execution unit has the access authority of the work queue, and sending the to-be-processed task to the work queue under the condition that the execution unit has the access authority of the work queue.
11. A computing device comprising a processing component and a storage component;
the storage component stores one or more computer instructions; the one or more computer instructions are for execution by the processing component to invoke implementing the access method of any one of claims 1 to 8, or implementing the task processing method of claim 9, or implementing the access method of claim 10.
12. A computer storage medium, characterized in that a computer program is stored, which, when executed by a computer, implements the access method according to any one of claims 1 to 8, or implements the task processing method according to claim 9, or implements the access method according to claim 10.
CN202211314194.3A 2022-10-25 2022-10-25 Access method, task processing method, computing device, and computer storage medium Pending CN115686746A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211314194.3A CN115686746A (en) 2022-10-25 2022-10-25 Access method, task processing method, computing device, and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211314194.3A CN115686746A (en) 2022-10-25 2022-10-25 Access method, task processing method, computing device, and computer storage medium

Publications (1)

Publication Number Publication Date
CN115686746A true CN115686746A (en) 2023-02-03

Family

ID=85100115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211314194.3A Pending CN115686746A (en) 2022-10-25 2022-10-25 Access method, task processing method, computing device, and computer storage medium

Country Status (1)

Country Link
CN (1) CN115686746A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116820344A (en) * 2023-07-03 2023-09-29 摩尔线程智能科技(北京)有限责任公司 Memory access circuit, memory access method, integrated circuit, and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116820344A (en) * 2023-07-03 2023-09-29 摩尔线程智能科技(北京)有限责任公司 Memory access circuit, memory access method, integrated circuit, and electronic device
CN116820344B (en) * 2023-07-03 2024-04-26 摩尔线程智能科技(北京)有限责任公司 Memory access circuit, memory access method, integrated circuit, and electronic device

Similar Documents

Publication Publication Date Title
CN108399101B (en) Method, device and system for scheduling resources
US20140289286A1 (en) System and method for performance tuning of garbage collection algorithms
US8572621B2 (en) Selection of server for relocation of application program based on largest number of algorithms with identical output using selected server resource criteria
WO2016204804A1 (en) Virtualized network function monitoring
CN106844055B (en) Task execution method and device
CN108073423B (en) Accelerator loading method and system and accelerator loading device
US20170153909A1 (en) Methods and Devices for Acquiring Data Using Virtual Machine and Host Machine
EP3637252A1 (en) Virtual machine deployment method and omm virtual machine
EP2998862A1 (en) Method, device, and system for memory management
CN109359060B (en) Data extraction method, device, computing equipment and computer storage medium
US20200097314A1 (en) Method and Apparatus for Processing Request
CN110278101B (en) Resource management method and equipment
CN106845215A (en) Based on safety protecting method and device under virtualized environment
CN115686746A (en) Access method, task processing method, computing device, and computer storage medium
CN113992578B (en) Method, device, equipment and storage medium for switching servers of cloud desktop terminal
CN111756711A (en) Flow control method, device, system and storage medium
KR20150007698A (en) Load distribution system for virtual desktop service
CN114553762A (en) Method and device for processing flow table items in flow table
US20220206836A1 (en) Method and Apparatus for Processing Virtual Machine Migration, Method and Apparatus for Generating Virtual Machine Migration Strategy, Device and Storage Medium
CN107045452B (en) Virtual machine scheduling method and device
CN112182606A (en) Access request processing method and device, electronic equipment and readable storage medium
CN109032762B (en) Virtual machine backtracking method and related equipment
CN111399999A (en) Computer resource processing method and device, readable storage medium and computer equipment
CN111277626A (en) Server upgrading method and device, electronic equipment and medium
CN109558249B (en) Control method and device for concurrent operation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination