WO2020220225A1 - Resource acquisition method, related apparatus, and computer storage medium - Google Patents

Resource acquisition method, related apparatus, and computer storage medium Download PDF

Info

Publication number
WO2020220225A1
WO2020220225A1 PCT/CN2019/085059 CN2019085059W WO2020220225A1 WO 2020220225 A1 WO2020220225 A1 WO 2020220225A1 CN 2019085059 W CN2019085059 W CN 2019085059W WO 2020220225 A1 WO2020220225 A1 WO 2020220225A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
resource request
target
logic
stack
Prior art date
Application number
PCT/CN2019/085059
Other languages
French (fr)
Chinese (zh)
Inventor
查克拉博蒂·齐元吉
谢时岳
张建明
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2019/085059 priority Critical patent/WO2020220225A1/en
Priority to CN201980095065.XA priority patent/CN113767368A/en
Publication of WO2020220225A1 publication Critical patent/WO2020220225A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Definitions

  • the present invention relates to the field of Internet technology, in particular to a resource acquisition method, related devices and computer storage media.
  • the resource may be a data resource provided by a preset resource module, such as a key resource generated by a key generator, an algorithm resource provided by an algorithm engine module, and so on.
  • a preset resource module such as a key resource generated by a key generator, an algorithm resource provided by an algorithm engine module, and so on.
  • hardware locks are used to isolate different CPUs. For each CPU, when an application needs to use resources, it needs to query idle resources through the CPU and configure commands to preempt the hardware lock, which is used to lock the idle resources. In order to release the hardware lock after using the free resources, the next re-grab lock is performed.
  • each CPU For each CPU, it will go through the process of command parsing-execution-response-result return.
  • the working clock cycle of each CPU is generally hundreds of microseconds or even milliseconds.
  • each CPU will run separately through its own thread to preempt the idle resource and the hardware lock of the idle resource for the CPU.
  • the preemption speed of a certain CPU may be slower than the preemption speed of another CPU, making it difficult for the CPU to grab resources, thereby affecting the normal business communication and business performance of the CPU.
  • the embodiment of the invention discloses a resource acquisition method, a related device and a computer storage medium, which can solve the problems that data resources in the prior art are difficult to occupy and affect normal business communication and business performance.
  • an embodiment of the present invention discloses a method for obtaining a resource.
  • the method includes: a logic stack can receive and store at least one resource request, wherein each resource request is sent by a processor core, and the resource request There is a one-to-one correspondence with the processor core, and the resource request is used to request logic resources for the corresponding processor core.
  • the resource allocation logic circuit can allocate the target logic resource to the target resource request, and only one resource request can be allocated logic resources in a working clock cycle, where the target resource request refers to The resource request with the highest priority in the logic stack.
  • the logic stack can be used to store at least one resource request.
  • the logic stack can only process one resource request within a working clock cycle, ensuring that every resource request stored in the logic stack can be processed, thereby It can ensure that the resource request of each processor core can finally grab the resource.
  • it can solve the problem that individual CPUs cannot always grab resources when multi-threading is used to allocate resources for multiple CPUs in the traditional technology, which affects the normal business communication and business performance of the individual CPUs.
  • the resource allocation logic circuit may query whether there are idle resources for the target processor core, and the target processor core is sent to the target resource request Processor cores.
  • the resource allocation logic circuit finds that there is an idle resource, it can allocate the idle resource as a target logic resource to the target processor core.
  • the idle resources refer to unused or unoccupied resources.
  • the resource allocation logic circuit can select idle resources as the target logic resources to allocate to the target processor core for use, avoiding allocating some occupied logic resources currently being used to the target processor core, resulting in the target processor core Unavailable, which improves the rationality and reliability of resource allocation.
  • the resource allocation logic circuit after the resource allocation logic circuit allocates the target processor core, it can also automatically preempt the target protection lock corresponding to the target logic resource according to the target resource request, so that the target processor core can be based on this
  • the target protection lock accesses the target logical resource.
  • the resource allocation logic circuit may also report the lock grab result to the target processor core through an interrupt response, and the lock grab result is used to indicate that the target protection lock is successfully seized. It is convenient for the target processor core to obtain the target protection lock after receiving the lock grab result, and then access and use the target logical resource based on the target protection lock.
  • the resource allocation logic circuit can allocate the target logic resource to the target processor core according to the target resource request, while also successfully seizing the target protection lock of the target logic resource, and the CPU is querying the target logic resource in the traditional technology. Compared with the need to issue another lock grab command later, it can greatly reduce the process steps of resource acquisition and improve the convenience and efficiency of resource acquisition.
  • any processor core (CPU) in this application sends the resource request of the processor core, it can automatically release the control right or occupancy right of the processor core, and then the resource allocation logic circuit will follow the processor core’s
  • the resource request queries idle resources and automatically seizes the protection lock corresponding to the idle resources after the idle resources are found, which can reduce the CPU occupation and increase the CPU utilization rate.
  • each resource request carries an identifier
  • the identifier is used to indicate the processor core to which the corresponding resource request belongs.
  • the logic stack can determine the identifier carried in the resource request. Then, according to the identifier, it is determined whether to store the resource request in the logic stack.
  • the logic stack can determine whether to store the resource request of the processor core in the logic stack according to the identifier of the processor core, so as to ensure that at least one resource request of each processor core is stored in the logic stack, thereby ensuring Subsequent resources will be allocated for at least one resource request of each processor core, which can prevent multiple resource requests from certain processor cores from entering the logic stack, causing resource requests from other processor cores to fail to stack after the logic stack is full.
  • the resource request of each processing core provides a fair opportunity for stacking, avoiding some processor cores in the traditional technology that the CPU is difficult to seize resources, thereby affecting the normal business communication and business performance of the CPU.
  • the storage capacity of the logic stack supports the storage of m resource requests, and the total number of processor cores is m, the logic stack only allows one of multiple resource requests with the same identifier A resource request is stored in the logic stack.
  • the storage capacity of the logical stack supports storage of n resource requests, and the total number of processor cores is m and n>m, then the logical stack allows at least the first processor core Two resource requests are stored in the logic stack, and the first processor core is any one of the m processor cores.
  • the logic stack is a first-in first-out unit FIFO logic stack.
  • the resource allocation logic circuit is deployed independently of the processor core.
  • the processor core is deployed in the communication device, that is, the communication device further includes a processor core, and the number of the processor core is not limited.
  • the logic stack receives a cancel command for the first resource request, and the first resource request is any one of at least one resource request. Further, the logic stack may perform queue-insertion and de-stack processing for the first resource request according to the cancel command, so as to delete the first resource request stored in the logic stack.
  • the logic stack supports the provision of a queue-insertion and pop-up mechanism to cancel the first resource request that you want to cancel, which improves the flexibility of resource acquisition.
  • the resource allocation logic circuit may report the cancellation result to the processor core corresponding to the first resource request through an interrupt response, where the cancellation result is used To indicate that the logic stack has completed the cancellation of the first resource request.
  • the cancellation result is sent to the processor core to which the first resource request belongs in an interruption manner, so as to notify the completion of the cancellation of the first resource request, and improve the flexibility of resource acquisition.
  • an embodiment of the present invention provides a communication device, including a logic stack and a resource allocation logic circuit, where:
  • the logic stack is configured to receive at least one resource request and store the at least one resource request in the logic stack, wherein each resource request is sent by a processor core, and the resource request and the processing There is a one-to-one correspondence between the processor cores, and the resource request is used to request logical resources for the corresponding processor core;
  • the resource allocation logic circuit is used to allocate a target logic resource for a target resource request, and allocate logic resources for only one resource request within a working clock cycle, wherein the target resource request refers to the logic stack and has The highest priority resource request.
  • the resource allocation logic circuit is specifically configured to query whether there are free resources for the target processor core after receiving the target resource request; In the case of resources, the idle resource is allocated to the target processor core as the target logical resource, and the target processor core refers to the processor core that sends the target resource request.
  • the resource allocation logic circuit is further configured to The target resource request automatically preempts the target protection lock corresponding to the target logic resource, wherein the target processor core accesses the target logic resource based on the target protection lock; and reports the lock grab result to the target processing through an interrupt response Device core, wherein the lock preemption result is used to indicate that the target protection lock has been successfully preempted.
  • each resource request carries an identifier
  • the identifier is used to indicate the processor core to which the corresponding resource request belongs
  • the logic stack is also used to After the resource request, determine the identifier carried in the resource request; according to the identifier carried in the resource request, determine whether to store the resource request in the logic stack.
  • the storage capacity of the logical stack supports storage of m resource requests, and the total number of processor cores is m, then the logical stack is only allowed to have the same identification One of the multiple resource requests is stored in the logic stack.
  • the storage capacity of the logical stack supports storage of n resource requests, and the total number of processor cores is m and n is greater than m, then the logical stack allows the first At least two resource requests of a processor core are stored in the logic stack, and the first processor core is any one of the m processor cores.
  • the logic stack is a first-in first-out unit FIFO logic stack.
  • the resource allocation logic circuit is independent of the processor core.
  • the apparatus further includes: a plurality of the processor cores.
  • the logic stack is further configured to receive a cancel command for a first resource request, where the first resource request is any one of the at least one resource request;
  • the cancel command deletes the first resource request stored in the logic stack.
  • the resource allocation logic circuit is configured to report the cancellation result to the first resource request station through an interrupt response.
  • the corresponding processor core, wherein the cancellation result is used to indicate that the logic stack has completed the cancellation of the first resource request.
  • an embodiment of the present invention provides a communication system including m processor cores, a logic stack, and a resource allocation logic circuit.
  • a communication system including m processor cores, a logic stack, and a resource allocation logic circuit.
  • the processor core can be deployed in the host device, and the logic stack, resource allocation logic circuit, protection lock, and resources can be deployed in the slave device.
  • the communication system may include m master devices and slave devices, and the slave devices can be correspondingly used to execute the method described in the first aspect above through various components deployed in their own devices. Exemplarily, take the communication system including m master devices and slave devices as an example, where,
  • the host device is used to send a resource request to the slave device
  • the slave device is configured to receive at least one resource request, and store the at least one resource request in the logical stack of the slave device, each resource request is sent by a processor core, and the resource There is a one-to-one correspondence between the request and the processor core, and the resource request is used to request logical resources for the corresponding processor core;
  • the slave device is also used to allocate target logic resources to target resource requests, and allocate logic resources to only one resource request within a working clock cycle, where the target resource request refers to the logic stack and The resource request with the highest priority.
  • the slave device is specifically configured to, after receiving the target resource request, query whether there is an idle resource for the target processor core; when the idle resource is queried, The idle resource is allocated to the target processor core as the target logical resource, and the target processor core is the processor core that sends the target resource request.
  • the slave device after the slave device allocates idle resources as the target logic resource to the target processor core, the slave device is further configured to automatically preempt the target logic according to the target resource request.
  • the target protection lock corresponding to the resource where the target processor core accesses the target logical resource based on the target protection lock; the lock grab result is reported to the target processor core through an interrupt response, where the lock grab result is used to indicate that the target protection lock has been successfully seized.
  • each resource request carries an identifier, which is used to indicate the processor core to which the corresponding resource request belongs, and the slave device is also used for receiving a resource request Then, the identifier carried in the resource request is determined; according to the identifier carried in the resource request, it is determined whether to store the resource request in the logic stack.
  • the storage capacity of the logic stack supports the storage of m resource requests, and the total number of processor cores is m, then the logic stack only allows one of the multiple resource requests with the same identifier A resource request is stored in the logic stack.
  • the storage capacity of the logical stack supports storage of n resource requests, the total number of processor cores is m, and n>m, and the logical stack allows at least two of the first processor cores Each resource request is stored in the logic stack, and the first processor core is any one of the m processor cores.
  • the logic stack is a first-in first-out unit FIFO logic stack.
  • the slave device is further configured to receive a cancellation command for a first resource request, where the first resource request is any one of at least one resource request; according to the cancellation Command to delete the first resource request stored in the logic stack.
  • the slave device after deleting the first resource request, is further configured to report the cancellation result to the host device corresponding to the first resource request through an interrupt response, wherein the cancellation The result is used to indicate that the logic stack has completed the cancellation of the first resource request.
  • a communication device in a fourth aspect, includes a processor deployed with a logic stack and a resource allocation logic circuit. In actual operation, the processor is used to execute the method described in the first aspect.
  • the communication device may further include any one or a combination of the following: logic resources, protection locks, and at least one processor core.
  • a computer-readable storage medium is provided, and the computer-readable storage medium is used to execute instructions of the method described in the first aspect.
  • a chip product is provided to implement the foregoing first aspect or the method in any possible implementation manner of the first aspect.
  • Fig. 1 is a schematic diagram of a scenario in which a CPU preempts data resources provided by the prior art.
  • Fig. 2 is a schematic diagram of another scenario where a CPU preempts data resources provided by the prior art.
  • Fig. 3 is a schematic structural diagram of a communication system provided by an embodiment of the present invention.
  • Fig. 4 is a schematic diagram of a logical stack storage provided by an embodiment of the present invention.
  • Fig. 5 is a schematic structural diagram of another communication system provided by an embodiment of the present invention.
  • Fig. 6 is a schematic flowchart of a resource acquisition method provided by an embodiment of the present invention.
  • Fig. 7 is a schematic diagram of a logic stack provided by an embodiment of the present invention.
  • FIG. 8 is a schematic flowchart of another resource acquisition method provided by an embodiment of the present invention.
  • Fig. 9 is a schematic diagram of a change of a logic stack provided by an embodiment of the present invention.
  • Fig. 10 is a schematic structural diagram of a communication device provided by an embodiment of the present invention.
  • Fig. 11 is a schematic structural diagram of a communication device provided by an embodiment of the present invention.
  • FIG. 1 shows a schematic diagram of a scenario where a CPU preempts data resources.
  • the schematic diagram shown in Figure 1 includes 3 lock grab requests, N resources, and N hardware locks. Among them, each hardware lock correspondingly protects a resource, which is used to encrypt and protect the resource.
  • Each lock grab request is generated by a CPU when it needs to use resources, and different lock grab requests correspond to different CPUs.
  • the figure shows the lock grab requests generated by each of the three CPUs, specifically CPU1request (lock grab request), CPU2request and CPU3request; N resources are resource 1 to resource N, and N hardware locks are Lock1 to LockN .
  • a query request can be generated, and the CPU calls the loop query program to query the available idle data resources (hereinafter referred to as idle resources). For example, the CPU queries each resource by calling the loop query level.
  • the status information includes occupied or idle. When the status information is occupied, it indicates that the resource is being occupied, such as being used by other applications. When the status information is idle, it means that the resource is not currently occupied and is idle, and the application can use the idle resource at this time. When the CPU finds that the status information is an idle resource, it indicates that the resource is an idle resource currently available to the application.
  • the CPU can issue a lock grab command.
  • the lock grab command is used to grab the hardware lock corresponding to the idle resource, so as to unlock the idle resource by using the hardware lock to obtain the idle resource.
  • the application program cannot query the available idle resources through the CPU, it can run the sleep waiting program and wait to continue to find the available idle resources.
  • the application can query the available idle resources through the CPU every time.
  • all resources may be fully occupied, and the CPU cannot query available idle resources.
  • the application will still go through the process of query request resolution -> query request execution -> query request response -> result return.
  • the query cycle of an idle resource usually reaches the order of hundreds of microseconds or even milliseconds.
  • at least one sleep waiting function needs to be inserted between every two query requests.
  • the time consumed to complete an idle resource query is usually on the order of milliseconds or even tens of milliseconds. .
  • the query speed of the CPU may be slower than that of another CPU, which makes it difficult for the CPU to query and preempt available idle resources, thereby affecting normal business communications and business services quality.
  • Figure 2 shows a schematic diagram of a process in which a CPU preempts data resources.
  • the horizontal axis represents time, and the figure shows the specific implementation process of three CPUs along the time axis for their respective CPUs to seize data resources.
  • the time sequence for each of the three CPUs to issue query requests for idle resources is: CPU2>CPU1>CPU3.
  • the query request sent by the CPU 2 is processed first to query whether there are available idle resources in the device. After the query is found, the CPU 2 can preempt the hardware lock corresponding to the idle resource, so that the CPU can unlock the idle resource through the hardware lock to use the idle resource.
  • the CPU2 may also report a query result, which is used to indicate that the CPU2 has inquired about available idle resources, or used to indicate that the CPU2 has not inquired about available idle resources.
  • the idle resource may be released for use by other CPUs.
  • CPU1 in the process of CPU2 inquiring about free resources, CPU1 also has a demand for use of free resources, and it sends a query request to query the available free resources in the device. As shown in the figure, the time when CPU1 sends the query request is later than the time when CPU2 sends the query request. When CPU1 queries idle resources through a query request, because the idle resources have been queried by CPU2, CPU1 can return the query result at this time. The query result is used to indicate that the idle resources have been preempted by CPU2 and there are currently no available idle resources to notify CPU1 waits to query again or ends the process.
  • the CPU1 can run the sleep waiting program, and after waiting for a preset time, continue to request the query through the query and preempt available idle resources.
  • CPU2 has used and released idle resources.
  • CPU3 sends a query request to meet its own demand for idle resources.
  • CPU3 queries and preempts free resources through query requests.
  • FIG. 3 is a schematic structural diagram of a communication system according to an embodiment of the present invention.
  • the communication system 300 shown in FIG. 3 includes m processor cores 302, a logic stack 304, and a resource allocation logic circuit 306.
  • the communication system may further include a protection lock 308 and a resource 310.
  • the number of the protection locks 308 and the resources 310 is not limited, and there may be one or more.
  • the figure shows multiple protection locks 308 and multiple resources 310 as examples.
  • m is a positive integer. among them,
  • the processor core 302 is configured to send a resource request when it is detected that the resource needs to be used, so as to obtain the idle resource required by the processor core.
  • the idle resources refer to resources that are not used by other processor cores.
  • the resources include but are not limited to computing resources, storage resources, and network resources.
  • the resource may be a key derivation module deployed in a communication system, and the key derivation The module is used to provide a communication key to ensure the safe transmission of data.
  • the resource is a hardware logic resource, and the processor core performs a corresponding logic operation or completes a corresponding function through the hardware logic resource.
  • the logic stack 304 is used to cache the resource request sent by the processor core 302 (that is, the query request mentioned above in this application), and the resource request is used to request the acquisition of idle resources for the processor core 302 to use.
  • the number of storage resource requests supported in the logic stack 304 is not limited and depends on the storage capacity of the logic stack 304.
  • the logic stack 304 When n is greater than m, the logic stack 304 is allowed to store at least two resource requests of the first processor core, which is any one of the m processor cores; in other words, in the logic stack 304 When the number n of storage resource requests supported by the stack 304 is greater than the total number m of processor cores, the logical stack 304 supports storing at least two idle resources of the same processor core 302.
  • each resource request carries an identifier
  • the identifier is used to indicate the processor core that sends the resource request.
  • the identifier may include, but is not limited to, the name of the processor core, the identity ID, and other information.
  • the logic stack 304 can automatically identify the identifier carried in the resource request to record the identifier of the processor core corresponding to the resource request. Further, the logic stack 304 can determine whether to store the resource request in the logic stack 304 according to the identifier carried in the resource request. For details, please refer to the foregoing description of storage according to the storage capacity of the logic stack 304.
  • the number n of storage resource requests supported in the logic stack 304 can also be referred to as the depth (or length) of the logic stack 304, which is not limited.
  • the depth n of the logic stack 304 and the total number m of processor cores are usually equal. At this time, only one of the multiple resource requests with the same identifier is allowed to be stored in the logic stack 304. .
  • each resource request carries the identifier (cpu_id) of the same processor core.
  • the logic stack 304 receives the resource request sent by the same processor core for the first time, it can automatically identify and record the identifier (cpu_id) carried in the resource request, and store the resource request in the logic stack.
  • the logic stack 304 If the logic stack 304 subsequently receives the resource request sent by the same processor core again, it can be directly discarded, and an exception notification message is sent to the same processor core.
  • the exception notification message is used to notify the logic stack 304 that the resource request cannot currently be processed .
  • the storage order of resource requests in the logic stack 304 is not limited.
  • the storage order of resource requests in the logic stack 304 is related to the order in which the logic stack 304 receives each resource request, and the specific implementation of the logic stack 304 storing resource requests is not limited.
  • the logic stack 304 may store according to the receiving time of each resource request.
  • the resource request received earliest may be stored in the logic stack 304 first, and the resource request received last may be stored in the logic stack 304 last.
  • the logic stack 304 may be stored according to the priority of each resource request. For example, a resource request with a higher priority is stored in the logic stack 304 first, and a resource request with a lower priority is stored secondly.
  • the logic stack 304 can be stored according to the service level of each resource request. For example, the resource request with a higher service level is stored in the logic stack 304 first, and then the resource request with a lower service level is stored. This application does not limit it. .
  • the logic stack 304 may specifically include, but is not limited to, the first in first out unit (FIFO) logic stack, the last in first out unit (LIFO) logic stack, and the low latency logic Stack and user-defined logic stack, etc.
  • FIFO first in first out unit
  • LIFO last in first out unit
  • LFO low latency logic Stack and user-defined logic stack, etc.
  • This application will take the logic stack as the FIFO logic stack as an example to explain the relevant content.
  • the first-in-first-out FIFO design can ensure that the first-in-first-out resource request in the logic stack 304 is preferentially popped out, thereby realizing resource request polling And fairness of processing.
  • the communication system (specifically, the logic stack 304 or the resource allocation logic circuit 306) supports the processing of a single resource request in the same working clock cycle. Specifically, in the same working clock cycle, the logic stack 304 only supports the pushing or popping of one resource request, and the resource allocation logic circuit 306 supports allocating logic resources for one resource request. Among them, the working clock period refers to the period of time consumed for processing a single resource request.
  • FIG. 4 showing a schematic diagram of the storage of a logic stack 304.
  • the logic stack 304 shown in FIG. 4 stores resource requests of four CPUs, which may be specifically one resource request of each of CPU1 to CPU4 in the figure. Wherein, in the same working clock cycle, the logic stack 304 only allows one CPU's resource request to be pushed into or out of the stack, so as to realize the in-stack storage or out of the stack processing of the resource request.
  • the resource allocation logic circuit 306 is used to process the resource request in the logic stack 304 and allocate available idle resources for the resource request.
  • the resource allocation logic circuit 306 is also used to query whether there are available idle resources among the k resources 310. Specifically, when the resource allocation logic circuit 306 detects that the target resource request is popped from the logic stack 304, the resource allocation logic circuit 306 can receive the target resource request popped from the logic stack 304, and can further query whether there is currently available If the idle resource exists, the queried idle resource can be used as the target logical resource to be allocated to the target processor core that sends the target resource request.
  • the resource allocation logic circuit 306 can be implemented by, for example, an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
  • the PLD can be a complex program logic device. (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), generic array logic (generic array logic, GAL) or a combination of hardware resource implementation.
  • the resource allocation logic circuit 306 is hardware logic independent of the m processor cores, that is, the resource allocation logic circuit 306 can be deployed independently of the m processor cores.
  • the resource request sent by the processor core may also carry attribute information of the processor core.
  • the attribute information refers to the information used to describe the attributes of the processor core, for example, it may include but not limited to the identifier of the processor core, the type of service supported by the processor core, the quality of service (QOS) index, the service level or Other attribute information, etc.
  • the service quality indicators include but are not limited to delay, throughput, loss rate, priority, or other indicators used to affect service communication quality.
  • the service level includes but is not limited to the QOS level and the class of service (COS) level, which can also be referred to as the QOS service level and COS service level for short.
  • the QOS service level is mainly divided according to bandwidth or transmission time.
  • the COS service level usually refers to the transmission priority of traffic.
  • the COS service level of the processor core here may be the priority of data transmission required when the processor core supports business communication.
  • the resource allocation logic circuit 306 after the resource allocation logic circuit 306 receives the resource request sent by the processor core, it can allocate the matching idle resources to the processor core according to the attribute information in the resource request. For example, when the attribute information is a service type supported by the processor core, after receiving the resource request, the resource allocation logic circuit 306 can query whether there are idle resources corresponding to the communication service supporting the processing of the service type among the k resources 310, For use by the processor core. When the attribute information is other attribute information of the processor core, similarly, after the resource allocation logic circuit 306 receives the resource request, it can query whether there are idle resources meeting the requirements of the other attribute information among the k resources 310 for the processor Nuclear use.
  • the protection lock 308 is used to protect the resource 310, specifically, it is used to lock the resource 310, for example, to lock the communication portal that accesses the resource.
  • the number of the protection locks 308 is not limited.
  • the same protection lock can be used to lock and protect one or more resources 310, and each resource 310 can be protected by one protection lock 308.
  • k resources 310 are used to lock and protect k protection locks 308 as an example.
  • the resource 310 and the protection lock 308 are in a one-to-one correspondence, that is, one resource is locked to one protection lock.
  • the protection lock 308 may be a software lock or a hardware lock.
  • the software lock is realized by software or program code.
  • the hardware lock can be implemented by hardware logic circuits, dedicated hardware integrated circuits, or hardened hardware cores.
  • the resource 310 is a resource used by the m processor cores provided by the communication system 300, and the resource may be a hardware logic resource or a data resource, which is not limited.
  • the number of the resources is also not limited, and it can be one or more.
  • k resources are taken as an example, and each resource needs a protection lock for security protection.
  • the resource allocation logic circuit 306 when the resource allocation logic circuit 306 receives the resource request sent by the processor core, it can query from the k resources whether there are idle resources that are not used or preempted. If an idle resource is queried, the resource allocation logic circuit 306 can automatically issue a lock grab command to grab the protection lock corresponding to the idle resource. It is convenient to subsequently use the protection lock to unlock the idle resources, so that the processor core corresponding to the resource request can use the unlocked idle resources. In other words, the processor core can access and use idle resources based on the protection lock.
  • the resource allocation logic circuit 306 may also send the preemption result to the processor core through an interrupt response to notify that the protection lock has been successfully preempted.
  • the resource allocation logic circuit 306 may also send a resource response to the processor core. The resource response is used to notify whether the current free resource is successfully seized. (Or the protection lock corresponding to free resources).
  • the resource allocation logic circuit 306 may return the first resource response to the processor core in an interrupt mode, and the first resource response is used In order to notify that the idle resource has been successfully seized, it can optionally also be used to notify that the protection lock corresponding to the idle resource has been successfully seized.
  • the resource allocation logic circuit 306 does not inquire about the existence of idle resources required by the resource request, the resource allocation logic circuit 306 can end the process; or the second resource response can still be returned to the processor core in an interrupt mode. The second resource response is used to notify that the idle resource has not been successfully preempted at present and wait for the next preemption.
  • any one or more of the m processor cores 302 may be deployed separately or in the same device.
  • the m processor cores may be correspondingly deployed in m host devices, and each host device has a processor core deployed.
  • the at least two processor cores may be deployed in the same host device.
  • the host device includes but is not limited to processor CPU, controller, mobile phone, tablet computer (table personal computer), personal digital assistant (personal digital assistant, PDA), mobile internet device (mobile internet device, MID), wearable device (wearable device), in-vehicle equipment, and other devices that support network communication.
  • the logic stack 304 and the resource allocation logic circuit 306 may be deployed in the same device, specifically in the same device as the processor core, or in another device different from the processor core.
  • the logic stack 304 and the resource allocation logic circuit 306 can both be deployed to the slave device Among them, the slave device includes but is not limited to mobile phones, tablet computers (table personal computers), personal digital assistants (personal digital assistants, PDAs), mobile internet devices (MIDs), and wearable devices (wearable devices) , In-vehicle equipment and other equipment supporting network communication.
  • the protection lock 308 and the resource 310 can be deployed in the same device, which can be different from the device deployed by the logic stack 304 and the resource allocation logic circuit 306, or can be deployed to be the same as the logic stack 304 and the resource allocation logic circuit 306.
  • the present invention is not limited.
  • the protection lock 308 and the resource 310 can be deployed in the above slave device.
  • FIG. 5 shows another communication system of the present invention.
  • the communication system as shown in FIG. 5 includes m host devices 502 and slave devices 504. Each host device 502 has a processor core 302 deployed, and the slave device 404 has a logic stack 304 and a resource allocation logic circuit 306. , K protection locks 308 and k resources 310.
  • the hardware or components deployed in the device refer to the relevant description in the embodiment of FIG. 3 for details, which will not be repeated here.
  • FIG. 6 is a schematic flowchart of a resource acquisition method provided by an embodiment of the present invention.
  • the method shown in FIG. 6 may include the following implementation steps:
  • Step S602 The processor core 302 sends a resource request to the logic stack 304, where the resource request is used to request logic resources for the processor core 302. Accordingly, the logic stack 304 receives the resource request.
  • any one of the m processor cores 302 may send a resource request when there is a resource usage requirement. For example, when an application program needs to use logic resources, it can send a resource request through the processor core CPU where the application program is running. After the resource request is sent, the control or occupation right of the processor core CPU can be automatically released , In order to reduce CPU usage by applications and increase CPU usage.
  • Step S604 The logic stack 304 receives at least one resource request, and stores the at least one resource request in the logic stack 304. Among them, each resource request is sent by one processor core, and there is a one-to-one correspondence between the resource request and the processor core.
  • the logic stack 304 can receive a resource request sent by any one of the m processor cores. Similarly, when multiple processor cores among the m processor cores send resource requests, the logic stack 304 may receive at least one resource request, and the at least one resource request is for at least one processor among the m processor cores. Each resource request is sent by one processor core, and the same processor core can send one or more resource requests. Further, the logic stack 304 may store at least one resource request received in the logic stack 304. Regarding the specific implementation manner of storing the resource request in the logic stack 304, the present invention does not limit it.
  • the resource request of any processor core 302 can be stored in the logic stack 304 according to a preset storage rule.
  • the preset storage rule is customized by the system and used to determine the storage location and storage sequence of resource requests in the logic stack 304.
  • the preset storage rule may be the time sequence of resource request reception, or resource request transmission The order of priority and so on.
  • FIG. 7 shows a specific storage schematic diagram of a logic stack 304.
  • the four CPUs are CPU1 to CPU4.
  • the order in which the four CPUs send resource requests is: CPU1, CPU3, CPU4, and CPU2.
  • the logic stack 304 can store the resource requests of the four CPUs in the logic stack 304 according to the sequence of the receiving time of the resource request.
  • the logic stack 304 first receives the resource request of CPU1, and first writes the resource request of CPU1 to the logic stack 304 for storage; then, receives the resource request of CPU3, and writes the resource request of CPU3 to Stored in the logic stack 304, and so on, the logic stack 304 finally receives the resource request of the CPU2, and finally writes the resource request of the CPU2 to the logic stack 304 for storage.
  • any resource request carries an identifier
  • the identifier is used to indicate the processor core to which the any resource request belongs, that is, the processor core that sends the any resource request.
  • the logic stack 304 After the logic stack 304 receives any resource request, it can obtain the identifier carried in the resource request by parsing the resource request. Then, according to the identifier carried in the resource request, it is determined whether to store the resource request in the logic stack 304. Specifically, when the storage capacity of the logic stack 304 supports the storage of m resource requests, after the logic stack 304 identifies the identifier carried in the resource request, only one resource request with the identifier is allowed to be stored in the logic stack 304.
  • the received resource request can be directly discarded at this time, and an exception message is sent to the processor core to which the resource request belongs to notify the logic stack 304 that it cannot currently store or process The resource request. If no resource request with the identifier is stored in the logic stack 304, the received resource request may be stored in the logic stack 304.
  • the logic stack 304 can determine whether to store the received resource request according to its own storage capacity. For example, there is currently a remaining storage capacity in the logic stack 304 that is sufficient to support By storing the received resource request, the received resource request can be stored in the logic stack 304.
  • the logic stack 304 supports storing at least two resource requests of a certain processor core (for example, the first processor core), and the first processor core is any one of the m processor cores. .
  • Step S606 After the target resource request is popped from the logic stack 304, the resource allocation logic circuit 306 allocates the target logic resource for the target resource request.
  • logic resources are allocated to only one resource request in one working clock cycle, and the target resource request refers to the resource request with the highest priority in the logic stack 304.
  • the resource request in the logic stack 304 can be processed according to a preset mechanism.
  • the preset mechanism can be self-defined by the system, such as a FIFO mechanism.
  • the logic stack 304 supports the in-stack storage and out-stack processing of a resource request in each working clock cycle.
  • the target resource request in the logic stack 304 is taken as an example to describe the related content.
  • the target resource request may be the resource request with the highest priority in the logic stack 304.
  • the resource allocation logic circuit 306 may allocate the target logic resource to the target resource request for use by the target processor core that sends the target resource request.
  • the logic stack 304 may perform popping processing on the target resource request according to a preset rule, so as to send the target resource request to the resource allocation logic circuit 306 for processing.
  • the resource allocation logic circuit 306 can respond to the target resource request to query whether there are free resources for the target processor core.
  • the specific resource allocation logic circuit 306 can query whether there are k resources 310 There are idle resources, and the idle resources refer to resources that are not used or preempted. If there is an idle resource, the resource allocation logic circuit 306 may use the idle resource as a target logic resource and allocate it to the target processor core.
  • the resources involved in this application may refer to resources that meet the requirements of different communication services.
  • the resource allocation logic circuit 306 After the resource allocation logic circuit 306 receives the target resource request, it needs to allocate corresponding target logic resources to the target processor core according to the actual business requirements of the target processor core.
  • the target resource request carries attribute information of the target processor core, and the attribute information is information used to describe the attributes of the target processor core, which may include, but is not limited to, quality of service QOS indicators, QOS service levels, COS Information such as service level, identification, and business type.
  • the resource allocation logic circuit 306 can respond to the target resource request and query whether there is an idle resource that matches the attribute information of the target processor core.
  • the resource allocation logic circuit 306 may use the idle resource as a target logic resource and allocate it to the target processor core for use. If it does not exist, the resource allocation logic circuit 306 can end the process; or, send a notification message to the target processor core, the notification message is used to notify the resource allocation logic circuit 306 that the target processor core cannot currently allocate the target logic resource, and there is no available Free resources.
  • the resource allocation logic circuit 306 can respond to the resource request and query whether there is an idle resource within 100ms of the network delay that supports the processing of the communication service. If it exists, the idle resource is allocated to the target processor core for use, that is, the idle resource As the resource allocation logic circuit 306, the target logic resource allocated to the target processor core is used.
  • the resource allocation logic circuit 306 may send a resource response to the target processor core after responding to the target resource request, and the resource response may be used to notify whether the target logic resource has been successfully preempted or allocated for the target processor core.
  • Step S608 The resource allocation logic circuit 306 automatically preempts the target protection lock corresponding to the target logic resource according to the target resource request, wherein the target processor core accesses the target logic resource based on the target protection lock, and the target processor core refers to sending the target resource The requested processor core.
  • Step S610 The resource allocation logic circuit 306 reports the lock grab result to the target processor core through an interrupt response, where the lock grab result is used to indicate that the target protection lock is successfully seized.
  • the resource allocation logic circuit 306 can also automatically preempt the target protection lock corresponding to the target logic resource after assigning the target logic resource to the target processor core, so that the target processor core can access based on the target protection lock The target logic resource, and then use the target logic resource. Further, the resource allocation logic circuit 306 may report the lock grab result to the target processor core through an interrupt response, and the lock grab result is used to indicate that the target protection lock is successfully seized.
  • Step S612 The target processor core receives the lock grab result, and obtains the target protection lock according to the lock grab result, so as to access and use the target logical resource based on the target protection lock.
  • the target processor core receives the lock grab result reported by the resource allocation logic circuit 306, and can further read the target protection lock indicated by the lock grab result from a preset register based on the lock grab result, and then access the target based on the target protection lock Logical resource to use the target logical resource.
  • the target processor core receives the lock preemption result, it can directly use the target protection lock to access and use the target logical resources. It is no longer necessary to configure the preemption protection lock through the target processor core (such as CPU) as in the traditional technology. Command to preempt the protection lock. Compared with traditional technology, it can greatly simplify the process of resource acquisition, save time, reduce CPU usage, and improve CPU utilization.
  • the target processor core may update the status of the target logical resource. For example, update the status of the target logical resource to occupied, indicating that the target logical resource is currently Is being used, in an occupied state. After the target processor core has used the target logical resource, the target logical resource can be released, and then the state of the target processor is updated to idle, which means that the target logical resource is not used and is in an idle state.
  • the resource acquisition method described in FIG. 8 may include the following implementation steps:
  • Step S802 The processor core 302 sends a cancel command for the first resource request to the logic stack 304, where the first resource request is any resource request in at least one resource request.
  • the logic stack 304 receives the cancel command for the first resource request.
  • any one of the m processor cores sends a corresponding resource request
  • any one of the processor cores does not want to apply for logic resources for any one of the processor cores
  • the processor core may send a revocation command to the logic stack 304, and the revocation command is used to request the revocation of the resource request of any processor core, that is, the processing of the logic stack 304 on the resource request of any processor core is withdrawn.
  • This application uses the first resource request as an example to describe the relevant content. Specifically, after sending the first resource request, the processor core 302 to which the first resource request belongs wants to temporarily cancel the processing of the first resource request due to special reasons.
  • the stack 304 has a newly added queue-insertion and de-stack mechanism, which can only be initiated by the cancel command for the first resource request.
  • the processor core 302 to which the first resource request belongs wants to cancel the first resource request, it can send a cancel command for the first resource request to the logic stack 304.
  • the logic stack 304 can receive the cancel command, and the first resource request can be any one of the at least one resource request sent by the m processor cores.
  • the resource request corresponding to the cancel command can be deleted according to the cancel command, and the storage order of the resource request in the logical stack can be ignored, and the queue can be removed from the stack.
  • Step S804 According to the cancel command, the logic stack 304 performs queue insertion and ejection processing on the first resource request stored in the logic stack 304 to delete the first resource request.
  • Step S806 After deleting the first resource request, the resource allocation logic circuit 306 may report the cancellation result to the processor core 302 corresponding to the first resource request through an interrupt response. The cancellation result is used to indicate that the logic stack 304 has completed the cancellation of the first resource request.
  • the logic stack 304 After the logic stack 304 receives the cancel command, it can respond to the cancel command to insert and pop the first resource request stored in the logic stack 304 to delete the first resource request from the logic stack 304, so that the first resource request is no longer A resource request for logical resource allocation processing.
  • the resource allocation logic circuit 306 can report the cancellation result to the processor core to which the first resource request belongs through an interrupt response, where the cancellation result is used to indicate that the logic stack 304 has successfully completed the Cancellation of the first resource request.
  • the CPU3 sends the resource request of the CPU3, it wants to temporarily withdraw the resource request of the CPU3. Then, the CPU3 can send the cancel command of the CPU3 to the logic stack 304, and the cancel command is used to request to cancel the resource request of the CPU3, and the logic stack 304 is not processing the resource request of the CPU3.
  • the logic stack 304 receives the cancel command of the CPU3, it needs to update the respective resource requests of the four CPUs stored in the logic stack 304, so that the resource request of CPU3 can be inserted and removed from the stack, and the resources of the CPU3 are deleted and withdrawn.
  • FIG. 9 showing a schematic diagram of the logic stack 304 being inserted from the queue.
  • the present invention adopts a logic stack to process the resource requests of each CPU in the stack one by one to ensure the fairness and rationality of the CPU's preemption of resources, and avoid the problems that some CPUs are difficult to preempt resources in the traditional technology.
  • FIG. 10 is a schematic structural diagram of a communication device 1000 according to an embodiment of the present invention.
  • the communication device 1000 shown in FIG. 10 includes a logic stack 1004 and a resource allocation logic circuit 1006.
  • the communication device may further include a processor core 1002, the number of the processor core 1002 is not limited, and there may be one or more. among them:
  • the logic stack 1004 is configured to receive at least one resource request and store the at least one resource request in the logic stack 1004, wherein each resource request is sent by a processor core 1002, and the resource request and There is a one-to-one correspondence between the processor cores, and the resource request is used to request logical resources for the corresponding processor cores;
  • the resource allocation logic circuit 1006 is configured to allocate a target logic resource to a target resource request, and allocate logic resources to only one resource request within a working clock cycle, wherein the target resource request refers to being located in the logic stack 1004 And has the highest priority resource request.
  • the resource allocation logic circuit 1006 is specifically configured to query whether there are idle resources for the target processor core after receiving the target resource request; when the idle resources are inquired, the The idle resource is allocated to a target processor core as the target logical resource, and the target processor core refers to a processor core that sends the target resource request.
  • the resource allocation logic circuit 1006 is further configured to Request to automatically preempt the target protection lock corresponding to the target logic resource, wherein the target processor core accesses the target logic resource based on the target protection lock; and report the lock grab result to the target processor core through an interrupt response,
  • the lock preemption result is used to indicate that the target protection lock has been successfully preempted.
  • each resource request carries an identifier
  • the identifier is used to indicate the processor core to which the corresponding resource request belongs
  • the logic stack 1004 is also used to, after receiving a resource request, Determine the identifier carried in the resource request; determine whether to store the resource request in the logic stack according to the identifier carried in the resource request.
  • the storage capacity of the logic stack 1004 supports storage of m resource requests, and the total number of the processor cores is m, then the logic stack 1004 only allows multiple resources with the same identifier A resource request in the request is stored in the logic stack.
  • the storage capacity of the logical stack 1004 supports storage of n resource requests, and the total number of processor cores is m and n is greater than m, then the logical stack 1004 allows the first processor At least two resource requests of the cores are stored in the logic stack, and the first processor core is any one of the m processor cores.
  • the logic stack 1004 is a first-in first-out unit FIFO logic stack.
  • the resource allocation logic circuit 1006 is independent of the processor core 1002.
  • the processor core 1002 is deployed in the communication device 1000.
  • the logic stack 1004 is further configured to receive a cancel command for a first resource request, where the first resource request is any one of the at least one resource request; according to the cancel command, Deleting the first resource request stored in the logic stack.
  • the resource allocation logic circuit 1006 is further configured to report the cancellation result to the processor core corresponding to the first resource request through an interrupt response, where The cancellation result is used to indicate that the logic stack has completed the cancellation of the first resource request.
  • each component involved in the communication device in the embodiment of the present invention can be implemented by hardware, for example, it can be implemented by an application-specific integrated circuit (ASIC), or a programmable logic device (programmable logic device, PLD), the above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof Implementation is not limited in the present invention.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • CPLD complex programmable logic device
  • FPGA field-programmable gate array
  • GAL generic array logic
  • FIG. 10 is only a possible implementation of the embodiment of the present application.
  • the communication device may also include more or fewer components, which is not limited here.
  • the content not shown or described in the embodiment of the present invention reference may be made to the relevant description in the foregoing method embodiment, which is not repeated here.
  • FIG. 11 is a schematic structural diagram of a communication device according to an embodiment of the present invention.
  • the communication device 110 shown in FIG. 11 includes one or more processors 1101, a communication interface 1102, and a memory 1103. Among them, a logic stack and a resource allocation logic circuit are deployed in the processor 1101. Optionally, any one or more of the m processor cores (not shown) may be deployed in the processor 1101, and the processor core may also be deployed outside the processor 1101 in actual applications , Is not limited. Among them, the processor 1101, the communication interface 1102, and the memory 1103 may be connected via a bus, or communication may be achieved by other means such as wireless transmission.
  • the embodiment of the present invention takes the connection via the bus 1104 as an example, where the memory 1103 is used to store instructions, and the processor 1101 is used to execute instructions stored in the memory 1103.
  • the memory 1103 stores program codes, and the processor 1101 can call the program codes stored in the memory 1103 to implement the implementation steps in the method embodiments shown in FIGS. 1 to 9 and/or other content described in the text. I won’t go into details here.
  • the processor 1101 may be composed of one or more general-purpose processors, such as a controller and a central processing unit (CPU).
  • the processor 1101 is configured to run related program codes by calling the deployed related hardware to implement the related descriptions in the embodiments shown in FIG. 1 to FIG. 9, which will not be repeated here.
  • the communication interface 1102 may be a wired interface (for example, an Ethernet interface) or a wireless interface (for example, a wireless fidelity (WiFi) interface), which is used to communicate with other modules or devices.
  • a wired interface for example, an Ethernet interface
  • a wireless interface for example, a wireless fidelity (WiFi) interface
  • the communication interface 1102 in the embodiment of the present application may be specifically used to receive a resource request sent by a processor core.
  • the memory 1103 may include volatile memory (Volatile Memory), such as random access memory (Random Access Memory, RAM); the memory may also include non-volatile memory (Non-Volatile Memory), such as read-only memory (Read-Only Memory). Memory, ROM, Flash Memory, Hard Disk Drive (HDD), or Solid-State Drive (SSD); the memory 1103 may also include a combination of the foregoing types of memories.
  • volatile memory such as random access memory (Random Access Memory, RAM)
  • non-Volatile Memory such as read-only memory (Read-Only Memory).
  • Memory ROM, Flash Memory, Hard Disk Drive (HDD), or Solid-State Drive (SSD)
  • SSD Solid-State Drive
  • the memory may be used to store a group of program codes, so that the processor can call the program codes stored in the memory to implement relevant steps involved in the embodiments of the present invention.
  • FIG. 11 is only a possible implementation of the embodiment of the present application.
  • the communication device may also include more or fewer components, which is not limited here.
  • the content not shown or described in the embodiment of the present invention reference may be made to the relevant description in the foregoing method embodiment, which is not repeated here.
  • the embodiment of the present invention also provides a communication system, which includes m processor cores, a logic stack, and a resource allocation logic circuit. Optionally, it may also include protection locks and resources. Wherein, when the processor core is deployed in the host device, and the logic stack, resource allocation logic circuit, protection lock, and resources are deployed in the slave device, the communication system may specifically include m host devices and slave devices. Regarding the relevant description of the communication system, please refer to the relevant description in the embodiment of FIG. 1 for details, which will not be repeated here.
  • the embodiment of the present invention also provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, and when it runs on a communication device, the method flow shown in the embodiment of FIG. 6 or FIG. 8 can be realized .
  • the embodiment of the present invention also provides a computer program product.
  • the computer program product runs on a communication device, the method flow shown in the embodiment of FIG. 6 or FIG. 8 is realized.
  • the steps of the method or algorithm described in combination with the disclosure of the embodiments of the present invention may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions.
  • Software instructions can be composed of corresponding software modules, which can be stored in random access memory (English: Random Access Memory, RAM), flash memory, read-only memory (English: Read Only Memory, ROM), erasable and programmable Read-only memory (English: Erasable Programmable ROM, EPROM), electrically erasable programmable read-only memory (English: EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM, or well-known in the art Any other form of storage medium.
  • An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and can write information to the storage medium.
  • the storage medium may also be an integral part of the processor.
  • the processor and the storage medium may be located in the ASIC.
  • the ASIC may be located in the communication device.
  • the processor and the storage medium may also exist as separate components in the communication device.
  • the program can be stored in a computer readable storage medium. When executed, it may include the processes of the above-mentioned method embodiments.
  • the aforementioned storage media include: ROM, RAM, magnetic disks or optical disks and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Advance Control (AREA)

Abstract

Embodiments of the present invention disclose a resource acquisition method, a related apparatus, and a computer storage medium. The method comprises: receiving at least one resource request, and storing the at least one resource request in a logical stack, each resource request being sent by a processor core, the resource request corresponding to the processor core on a one-to-one basis, and the resource request being used to request a logical resource for the corresponding processor core; and allocating a target logical resource to a target resource request, wherein only one logical resource is allowed to be allocated to one resource request within an operating clock cycle, and the target resource request is a resource request located in the logical stack and having the highest priority level. Embodiments of the present invention resolve the issue in which existing multi-threaded parallel allocations of logical resources to resource requests cause difficulty in the allocation of a logical resource to a certain resource request, affecting a service and performance corresponding to the resource request.

Description

资源获取方法、相关装置及计算机存储介质Resource acquisition method, related device and computer storage medium 技术领域Technical field
本发明涉及互联网技术领域,尤其涉及资源获取方法、相关装置及计算机存储介质。The present invention relates to the field of Internet technology, in particular to a resource acquisition method, related devices and computer storage media.
背景技术Background technique
随着工艺制程的提升和互联网业务需求的提升,芯片级系统(system on chip,SOC)设计变得更加复杂,同一芯片上集成的CPU数量也越来越多。受限于成本和功耗等原因,中央处理器(central processing unit,CPU)支持调用资源的数量有限,且多个CPU支持调用同一资源。该资源可为预设资源模块提供的数据资源,例如密钥生成器生成的密钥资源、算法引擎模块提供的算法资源等等。考虑到CPU的信息安全问题,不同CPU之间采用硬件锁来隔离。对于每个CPU而言,当应用程序需要使用资源时,需通过CPU查询空闲资源并配置抢占硬件锁的命令,该硬件锁用于对空闲资源进行加锁保护。以在使用完该空闲资源后释放硬件锁,从而进行下次的重抢锁。With the improvement of technological processes and the improvement of Internet business requirements, the design of system on chip (SOC) has become more complicated, and the number of CPUs integrated on the same chip has also increased. Due to reasons such as cost and power consumption, the central processing unit (CPU) supports a limited number of resources to be called, and multiple CPUs support the calling of the same resource. The resource may be a data resource provided by a preset resource module, such as a key resource generated by a key generator, an algorithm resource provided by an algorithm engine module, and so on. Taking into account the information security of the CPU, hardware locks are used to isolate different CPUs. For each CPU, when an application needs to use resources, it needs to query idle resources through the CPU and configure commands to preempt the hardware lock, which is used to lock the idle resources. In order to release the hardware lock after using the free resources, the next re-grab lock is performed.
针对每个CPU而言,其都会经历命令解析-执行-响应-结果返回等过程。每个CPU的工作时钟周期一般会在数百微妙甚至毫秒级。在多个CPU通过多线程并行运行的场景中,每个CPU都会通过各自的一个线程单独运行,以为该CPU抢占空闲资源以及该空闲资源的硬件锁。在实际应用中,受限于CPU硬件限制等原因,可能会出现某CPU的抢占速度慢于另外CPU抢占速度,导致该CPU难以抢到资源,从而影响该CPU正常地业务通信和业务性能。For each CPU, it will go through the process of command parsing-execution-response-result return. The working clock cycle of each CPU is generally hundreds of microseconds or even milliseconds. In a scenario where multiple CPUs run in parallel through multiple threads, each CPU will run separately through its own thread to preempt the idle resource and the hardware lock of the idle resource for the CPU. In practical applications, due to CPU hardware limitations and other reasons, the preemption speed of a certain CPU may be slower than the preemption speed of another CPU, making it difficult for the CPU to grab resources, thereby affecting the normal business communication and business performance of the CPU.
发明内容Summary of the invention
本发明实施例公开了资源获取方法、相关装置及计算机存储介质,能够解决现有技术中存在的数据资源很难抢占、影响正常业务通信和业务性能等问题。The embodiment of the invention discloses a resource acquisition method, a related device and a computer storage medium, which can solve the problems that data resources in the prior art are difficult to occupy and affect normal business communication and business performance.
第一方面,本发明实施例公开提供了一种资源获取方法,所述方法包括:逻辑栈可接收并存储至少一个资源请求,其中每个资源请求为一个处理器核发送的,且该资源请求和处理器核之间是一一对应的,该资源请求用于为对应的处理器核请求逻辑资源。当目标资源请求从逻辑栈中出栈时,资源分配逻辑电路可为目标资源请求分配目标逻辑资源,在一个工作时钟周期内只能为一个资源请求分配逻辑资源,其中,该目标资源请求是指逻辑栈中具有最高优先级的资源请求。In the first aspect, an embodiment of the present invention discloses a method for obtaining a resource. The method includes: a logic stack can receive and store at least one resource request, wherein each resource request is sent by a processor core, and the resource request There is a one-to-one correspondence with the processor core, and the resource request is used to request logic resources for the corresponding processor core. When the target resource request is popped from the logic stack, the resource allocation logic circuit can allocate the target logic resource to the target resource request, and only one resource request can be allocated logic resources in a working clock cycle, where the target resource request refers to The resource request with the highest priority in the logic stack.
通过实施本发明实施例,能够利用逻辑栈来存储至少一个资源请求,逻辑栈在一个工作时钟周期内只能处理一个资源请求,确保存储在逻辑栈中的每一个资源请求都可以被处理,从而能够确保每个处理器核的资源请求最终都能够抢到资源。进而能解决传统技术中采用多线程为多CPU分配资源时存在个别CPU始终抢不到资源,从而影响该个别CPU的正常业务通信以及业务性能等问题。By implementing the embodiments of the present invention, the logic stack can be used to store at least one resource request. The logic stack can only process one resource request within a working clock cycle, ensuring that every resource request stored in the logic stack can be processed, thereby It can ensure that the resource request of each processor core can finally grab the resource. In turn, it can solve the problem that individual CPUs cannot always grab resources when multi-threading is used to allocate resources for multiple CPUs in the traditional technology, which affects the normal business communication and business performance of the individual CPUs.
结合第一方面,在一些可能的实施例中,资源分配逻辑电路在接收到目标资源请求后,可查询是否有供目标处理器核使用的空闲资源,该目标处理器核为发送给目标资源请求的处理器核。资源分配逻辑电路在查询到有空闲资源时,可将该空闲资源作为目标逻辑资源分配给目标处理器核。该空闲资源是指未被使用或未被占用的资源。With reference to the first aspect, in some possible embodiments, after receiving the target resource request, the resource allocation logic circuit may query whether there are idle resources for the target processor core, and the target processor core is sent to the target resource request Processor cores. When the resource allocation logic circuit finds that there is an idle resource, it can allocate the idle resource as a target logic resource to the target processor core. The idle resources refer to unused or unoccupied resources.
通过实施本步骤,资源分配逻辑电路可选择空闲资源作为目标逻辑资源,以分配给目标处理器核使用,避免分配一些当前正在被使用的占用逻辑资源给目标处理器核,导致该目标处理器核无法使用,提升了资源分配的合理性和可靠性。By implementing this step, the resource allocation logic circuit can select idle resources as the target logic resources to allocate to the target processor core for use, avoiding allocating some occupied logic resources currently being used to the target processor core, resulting in the target processor core Unavailable, which improves the rationality and reliability of resource allocation.
结合第一方面,在一些可能的实施例中,资源分配逻辑电路在分配目标处理器核之后,还可根据目标资源请求自动抢占该目标逻辑资源对应的目标保护锁,便于目标处理器核基于该目标保护锁访问该目标逻辑资源。进一步地,资源分配逻辑电路还可通过中断响应将抢锁结果上报给目标处理器核,该抢锁结果用于指示成功抢占到目标保护锁。便于目标处理器核在接收抢锁结果后可获取该目标保护锁,进而基于该目标保护锁访问并使用该目标逻辑资源。With reference to the first aspect, in some possible embodiments, after the resource allocation logic circuit allocates the target processor core, it can also automatically preempt the target protection lock corresponding to the target logic resource according to the target resource request, so that the target processor core can be based on this The target protection lock accesses the target logical resource. Further, the resource allocation logic circuit may also report the lock grab result to the target processor core through an interrupt response, and the lock grab result is used to indicate that the target protection lock is successfully seized. It is convenient for the target processor core to obtain the target protection lock after receiving the lock grab result, and then access and use the target logical resource based on the target protection lock.
通过实施本步骤,资源分配逻辑电路可根据目标资源请求,为目标处理器核分配目标逻辑资源的同时,还成功抢占到该目标逻辑资源的目标保护锁,和传统技术中CPU在查询目标逻辑资源后还需要再发一条抢锁命令相比,其能大大减少资源获取的流程步骤,提升资源获取的便捷性和高效性。此外,本申请中任一处理器核(CPU)发送完该处理器核的资源请求后,可自动释放该处理器核的控制权或占用权,后续由资源分配逻辑电路根据该处理器核的资源请求查询空闲资源并在找到空闲资源之后自动抢占空闲资源对应的保护锁,这样可减少CPU的占用,提升CPU的使用率。By implementing this step, the resource allocation logic circuit can allocate the target logic resource to the target processor core according to the target resource request, while also successfully seizing the target protection lock of the target logic resource, and the CPU is querying the target logic resource in the traditional technology. Compared with the need to issue another lock grab command later, it can greatly reduce the process steps of resource acquisition and improve the convenience and efficiency of resource acquisition. In addition, after any processor core (CPU) in this application sends the resource request of the processor core, it can automatically release the control right or occupancy right of the processor core, and then the resource allocation logic circuit will follow the processor core’s The resource request queries idle resources and automatically seizes the protection lock corresponding to the idle resources after the idle resources are found, which can reduce the CPU occupation and increase the CPU utilization rate.
结合第一方面,在一些可能的实施例中,每一资源请求携带有标识,该标识用于指示对应资源请求所属的处理器核。逻辑栈在接收到任一资源请求后,可确定该资源请求中携带的标识。进而根据该标识,确定是否将该资源请求存入逻辑栈中。With reference to the first aspect, in some possible embodiments, each resource request carries an identifier, and the identifier is used to indicate the processor core to which the corresponding resource request belongs. After receiving any resource request, the logic stack can determine the identifier carried in the resource request. Then, according to the identifier, it is determined whether to store the resource request in the logic stack.
通过实施本步骤,逻辑栈可依据处理器核的标识来决定是否在逻辑栈中存放该处理器核的资源请求,以保证逻辑栈中存储有每个处理器核的至少一个资源请求,从而确保后续会为每个处理器核的至少一个资源请求分配资源,能够避免某些处理器核的多个资源请求进入逻辑栈,导致逻辑栈存满之后其他处理器核的资源请求无法入栈,给每个处理核的资源请求提供了公平的入栈机会,避免传统技术中存在的某些处理器核CPU很难抢占到资源,进而影响该CPU的正常业务通信以及业务性能等问题。By implementing this step, the logic stack can determine whether to store the resource request of the processor core in the logic stack according to the identifier of the processor core, so as to ensure that at least one resource request of each processor core is stored in the logic stack, thereby ensuring Subsequent resources will be allocated for at least one resource request of each processor core, which can prevent multiple resource requests from certain processor cores from entering the logic stack, causing resource requests from other processor cores to fail to stack after the logic stack is full. The resource request of each processing core provides a fair opportunity for stacking, avoiding some processor cores in the traditional technology that the CPU is difficult to seize resources, thereby affecting the normal business communication and business performance of the CPU.
结合第一方面,在一些可能的实施例中,逻辑栈的存储容量支持存储n个资源请求,处理器核的总数量为m、且n=m,则逻辑栈只允许m个处理器核中每个处理器核的一个资源请求存入逻辑栈。With reference to the first aspect, in some possible embodiments, the storage capacity of the logic stack supports storage of n resource requests, the total number of processor cores is m, and n=m, then the logic stack only allows m processor cores A resource request for each processor core is stored in the logic stack.
结合第一方面,在一些可能的实施例中,逻辑栈的存储容量支持存储m个资源请求,且处理器核的总数量为m,则逻辑栈只允许具有相同标识的多个资源请求中的一个资源请求存入逻辑栈。With reference to the first aspect, in some possible embodiments, the storage capacity of the logic stack supports the storage of m resource requests, and the total number of processor cores is m, the logic stack only allows one of multiple resource requests with the same identifier A resource request is stored in the logic stack.
结合第一方面,在一些可能的实施例中,逻辑栈的存储容量支持存储n个资源请求,处理器核的总数量为m、且n>m,则逻辑栈允许第一处理器核的至少两个资源请求存入逻辑栈,该第一处理器核为m个处理器核中的任一个处理器核。With reference to the first aspect, in some possible embodiments, the storage capacity of the logical stack supports storage of n resource requests, and the total number of processor cores is m and n>m, then the logical stack allows at least the first processor core Two resource requests are stored in the logic stack, and the first processor core is any one of the m processor cores.
结合第一方面,在一些可能的实施例中,逻辑栈为先进先出单元FIFO逻辑栈。With reference to the first aspect, in some possible embodiments, the logic stack is a first-in first-out unit FIFO logic stack.
结合第一方面,在一些可能的实施例中,资源分配逻辑电路独立于处理器核部署。With reference to the first aspect, in some possible embodiments, the resource allocation logic circuit is deployed independently of the processor core.
结合第一方面,在一些可能的实施例中,处理器核部署于通信装置中,即通信装置还包括处理器核,该处理器核的数量并不做限定。With reference to the first aspect, in some possible embodiments, the processor core is deployed in the communication device, that is, the communication device further includes a processor core, and the number of the processor core is not limited.
结合第一方面,在一些可能的实施例中,逻辑栈接收针对第一资源请求的撤销命令,该第一资源请求为至少一个资源请求中的任一个。进一步逻辑栈根据该撤销命令,可对该第一资源请求进行插队出栈处理,以删除逻辑栈中存储的第一资源请求。With reference to the first aspect, in some possible embodiments, the logic stack receives a cancel command for the first resource request, and the first resource request is any one of at least one resource request. Further, the logic stack may perform queue-insertion and de-stack processing for the first resource request according to the cancel command, so as to delete the first resource request stored in the logic stack.
通过实施本步骤,逻辑栈支持提供插队出栈机制,以对想要撤销的第一资源请求进行撤销,提升了资源获取的灵活度。By implementing this step, the logic stack supports the provision of a queue-insertion and pop-up mechanism to cancel the first resource request that you want to cancel, which improves the flexibility of resource acquisition.
结合第一方面,在一些可能的实施例中,在删除第一资源请求后,资源分配逻辑电路可通过中断响应将撤销结果上报给第一资源请求所对应的处理器核,其中该撤销结果用于指示逻辑栈已完成第一资源请求的撤销。With reference to the first aspect, in some possible embodiments, after the first resource request is deleted, the resource allocation logic circuit may report the cancellation result to the processor core corresponding to the first resource request through an interrupt response, where the cancellation result is used To indicate that the logic stack has completed the cancellation of the first resource request.
通过实施本步骤,采用中断的方式向第一资源请求所属的处理器核发送撤销结果,以通知完成针对第一资源请求的撤销,提升资源获取的灵活性。By implementing this step, the cancellation result is sent to the processor core to which the first resource request belongs in an interruption manner, so as to notify the completion of the cancellation of the first resource request, and improve the flexibility of resource acquisition.
第二方面,本发明实施例提供了一种通信装置,包括逻辑栈和资源分配逻辑电路,其中,In a second aspect, an embodiment of the present invention provides a communication device, including a logic stack and a resource allocation logic circuit, where:
所述逻辑栈,用于接收至少一个资源请求,并将所述至少一个资源请求存储到所述逻辑栈,其中每一资源请求为一处理器核发送的,且所述资源请求与所述处理器核之间是一一对应的,所述资源请求用于为对应的处理器核请求逻辑资源;The logic stack is configured to receive at least one resource request and store the at least one resource request in the logic stack, wherein each resource request is sent by a processor core, and the resource request and the processing There is a one-to-one correspondence between the processor cores, and the resource request is used to request logical resources for the corresponding processor core;
所述资源分配逻辑电路,用于为目标资源请求分配目标逻辑资源,且在一个工作时钟周期内只为一个资源请求分配逻辑资源,其中所述目标资源请求是指位于所述逻辑栈内且具有最高优先级的资源请求。The resource allocation logic circuit is used to allocate a target logic resource for a target resource request, and allocate logic resources for only one resource request within a working clock cycle, wherein the target resource request refers to the logic stack and has The highest priority resource request.
结合第二方面,在一些可能的实施例中,所述资源分配逻辑电路具体用于在接收到所述目标资源请求之后,查询是否有供目标处理器核使用的空闲资源;在查询到有空闲资源时,将所述空闲资源作为所述目标逻辑资源分配给目标处理器核,所述目标处理器核是指发送所述目标资源请求的处理器核。With reference to the second aspect, in some possible embodiments, the resource allocation logic circuit is specifically configured to query whether there are free resources for the target processor core after receiving the target resource request; In the case of resources, the idle resource is allocated to the target processor core as the target logical resource, and the target processor core refers to the processor core that sends the target resource request.
结合第二方面,在一些可能的实施例中,所述资源分配逻辑电路在将所述空闲资源作为所述目标逻辑资源分配给目标处理器核之后,所述资源分配逻辑电路还用于根据所述目标资源请求自动抢占所述目标逻辑资源对应的目标保护锁,其中所述目标处理器核基于所述目标保护锁访问所述目标逻辑资源;通过中断响应将抢锁结果上报给所述目标处理器核,其中所述抢锁结果用于指示已成功抢占到所述目标保护锁。With reference to the second aspect, in some possible embodiments, after the resource allocation logic circuit allocates the idle resource as the target logic resource to the target processor core, the resource allocation logic circuit is further configured to The target resource request automatically preempts the target protection lock corresponding to the target logic resource, wherein the target processor core accesses the target logic resource based on the target protection lock; and reports the lock grab result to the target processing through an interrupt response Device core, wherein the lock preemption result is used to indicate that the target protection lock has been successfully preempted.
结合第二方面,在一些可能的实施例中,所述每一资源请求携带有标识,所述标识用于指示对应的资源请求所属的处理器核,所述逻辑栈还用于在接收到一个资源请求之后,确定所述资源请求中携带的标识;根据所述资源请求携带的标识,确定是否将所述资源请求存入所述逻辑栈。With reference to the second aspect, in some possible embodiments, each resource request carries an identifier, and the identifier is used to indicate the processor core to which the corresponding resource request belongs, and the logic stack is also used to After the resource request, determine the identifier carried in the resource request; according to the identifier carried in the resource request, determine whether to store the resource request in the logic stack.
结合第二方面,在一些可能的实施例中,所述逻辑栈的存储容量支持存储n个资源请求,所述处理器核的总数量为m、且n=m,则所述逻辑栈只允许所述m个处理器核中每一处理器核的一个资源请求存入所述逻辑栈。With reference to the second aspect, in some possible embodiments, the storage capacity of the logical stack supports storage of n resource requests, and the total number of processor cores is m and n=m, then the logical stack only allows One resource request of each of the m processor cores is stored in the logic stack.
结合第二方面,在一些可能的实施例中,所述逻辑栈的存储容量支持存储m个资源请求,且所述处理器核的总数量为m,则所述逻辑栈只允许具备相同标识的多个资源请求中的一个资源请求存入所述逻辑栈。With reference to the second aspect, in some possible embodiments, the storage capacity of the logical stack supports storage of m resource requests, and the total number of processor cores is m, then the logical stack is only allowed to have the same identification One of the multiple resource requests is stored in the logic stack.
结合第二方面,在一些可能的实施例中,所述逻辑栈的存储容量支持存储n个资源请 求,所述处理器核的总数量为m、且n大于m,则所述逻辑栈允许第一处理器核的至少两个资源请求存入所述逻辑栈,所述第一处理器核为所述m个处理器核中的任一个。With reference to the second aspect, in some possible embodiments, the storage capacity of the logical stack supports storage of n resource requests, and the total number of processor cores is m and n is greater than m, then the logical stack allows the first At least two resource requests of a processor core are stored in the logic stack, and the first processor core is any one of the m processor cores.
结合第二方面,在一些可能的实施例中,所述逻辑栈为先进先出单元FIFO逻辑栈。With reference to the second aspect, in some possible embodiments, the logic stack is a first-in first-out unit FIFO logic stack.
结合第二方面,在一些可能的实施例中,所述资源分配逻辑电路独立于所述处理器核。With reference to the second aspect, in some possible embodiments, the resource allocation logic circuit is independent of the processor core.
结合第二方面,在一些可能的实施例中,所述装置还包括:多个所述处理器核。With reference to the second aspect, in some possible embodiments, the apparatus further includes: a plurality of the processor cores.
结合第二方面,在一些可能的实施例中,所述逻辑栈还用于接收针对第一资源请求的撤销命令,所述第一资源请求为所述至少一个资源请求中的任一个;根据所述撤销命令,删除所述逻辑栈中存储的所述第一资源请求。With reference to the second aspect, in some possible embodiments, the logic stack is further configured to receive a cancel command for a first resource request, where the first resource request is any one of the at least one resource request; The cancel command deletes the first resource request stored in the logic stack.
结合第二方面,在一些可能的实施例中,所述逻辑栈在删除所述第一资源请求之后,所述资源分配逻辑电路用于通过中断响应将撤销结果上报给所述第一资源请求所对应的处理器核,其中所述撤销结果用于指示所述逻辑栈已完成所述第一资源请求的撤销。With reference to the second aspect, in some possible embodiments, after the logic stack deletes the first resource request, the resource allocation logic circuit is configured to report the cancellation result to the first resource request station through an interrupt response. The corresponding processor core, wherein the cancellation result is used to indicate that the logic stack has completed the cancellation of the first resource request.
关于本发明实施例中未示出或未阐述的内容,可对应参考前述第一方面所述方法实施例中的相关介绍,这里不做赘述。Regarding content not shown or explained in the embodiment of the present invention, reference may be made to the relevant introduction in the method embodiment described in the first aspect, which is not repeated here.
第三方面,本发明实施例提供了一种通信系统,包括m个处理器核、逻辑栈和资源分配逻辑电路。可选地,还可包括保护锁以及资源。其中,处理器核可部署在主机设备中,逻辑栈、资源分配逻辑电路、保护锁以及资源可部署在从机设备中。相应地该通信系统可包括m个主机设备和从机设备,该从机设备通过自身设备中部署的各部件可对应用于执行如上第一方面所描述的方法。示例性地,以通信系统包括m个主机设备和从机设备为例,其中,In the third aspect, an embodiment of the present invention provides a communication system including m processor cores, a logic stack, and a resource allocation logic circuit. Optionally, it may also include protection locks and resources. Among them, the processor core can be deployed in the host device, and the logic stack, resource allocation logic circuit, protection lock, and resources can be deployed in the slave device. Correspondingly, the communication system may include m master devices and slave devices, and the slave devices can be correspondingly used to execute the method described in the first aspect above through various components deployed in their own devices. Exemplarily, take the communication system including m master devices and slave devices as an example, where,
所述主机设备,用于向所述从机设备发送资源请求;The host device is used to send a resource request to the slave device;
所述从机设备,用于接收至少一个资源请求,并将所述至少一个资源请求存储到所述从机设备的逻辑栈中,每一资源请求为一个处理器核发送的,且所述资源请求与所述处理器核之间是一一对应的,所述资源请求用于为对应的处理器核请求逻辑资源;The slave device is configured to receive at least one resource request, and store the at least one resource request in the logical stack of the slave device, each resource request is sent by a processor core, and the resource There is a one-to-one correspondence between the request and the processor core, and the resource request is used to request logical resources for the corresponding processor core;
所述从机设备,还用于为目标资源请求分配目标逻辑资源,且在一个工作时钟周期内只为一个资源请求分配逻辑资源,其中,所述目标资源请求是指位于所述逻辑栈内且具有最高优先级的资源请求。The slave device is also used to allocate target logic resources to target resource requests, and allocate logic resources to only one resource request within a working clock cycle, where the target resource request refers to the logic stack and The resource request with the highest priority.
结合第三方面,在一些可能的实施例中,所述从机设备具体用于在接收到目标资源请求之后,查询是否有供目标处理器核使用的空闲资源;在查询到有空闲资源时,将空闲资源作为目标逻辑资源分配给目标处理器核,该目标处理器核为发送目标资源请求的处理器核。With reference to the third aspect, in some possible embodiments, the slave device is specifically configured to, after receiving the target resource request, query whether there is an idle resource for the target processor core; when the idle resource is queried, The idle resource is allocated to the target processor core as the target logical resource, and the target processor core is the processor core that sends the target resource request.
结合第三方面,在一些可能的实施例中,所述从机设备在将空闲资源作为目标逻辑资源分配给目标处理器核之后,所述从机设备还用于根据目标资源请求自动抢占目标逻辑资源对应的目标保护锁,其中目标处理器核基于目标保护锁访问目标逻辑资源;通过中断响应将抢锁结果上报给目标处理器核,其中抢锁结果用于指示已成功抢占到目标保护锁。With reference to the third aspect, in some possible embodiments, after the slave device allocates idle resources as the target logic resource to the target processor core, the slave device is further configured to automatically preempt the target logic according to the target resource request. The target protection lock corresponding to the resource, where the target processor core accesses the target logical resource based on the target protection lock; the lock grab result is reported to the target processor core through an interrupt response, where the lock grab result is used to indicate that the target protection lock has been successfully seized.
结合第三方面,在一些可能的实施例中,每一资源请求携带有标识,该标识用于指示对应的资源请求所属的处理器核,所述从机设备还用于在接收到一个资源请求后,确定该资源请求中携带的标识;根据该资源请求携带的标识,确定是否将资源请求存入逻辑栈中。With reference to the third aspect, in some possible embodiments, each resource request carries an identifier, which is used to indicate the processor core to which the corresponding resource request belongs, and the slave device is also used for receiving a resource request Then, the identifier carried in the resource request is determined; according to the identifier carried in the resource request, it is determined whether to store the resource request in the logic stack.
结合第三方面,在一些可能的实施例中,逻辑栈的存储容量支持存储n个资源请求, 处理器核的总数量为m、且n=m,则逻辑栈只允许m个处理器核中每个处理器核的一个资源请求存入逻辑栈。With reference to the third aspect, in some possible embodiments, the storage capacity of the logical stack supports storage of n resource requests, the total number of processor cores is m and n=m, then the logical stack only allows m processor cores A resource request for each processor core is stored in the logic stack.
结合第三方面,在一些可能的实施例中,逻辑栈的存储容量支持存储m个资源请求,且处理器核的总数量为m,则逻辑栈只允许具有相同标识的多个资源请求中的一个资源请求存入逻辑栈。With reference to the third aspect, in some possible embodiments, the storage capacity of the logic stack supports the storage of m resource requests, and the total number of processor cores is m, then the logic stack only allows one of the multiple resource requests with the same identifier A resource request is stored in the logic stack.
结合第三方面,在一些可能的实施例中,逻辑栈的存储容量支持存储n个资源请求,处理器核的总数量为m、且n>m,逻辑栈允许第一处理器核的至少两个资源请求存入逻辑栈,第一处理器核为m个处理器核中的任一个处理器核。With reference to the third aspect, in some possible embodiments, the storage capacity of the logical stack supports storage of n resource requests, the total number of processor cores is m, and n>m, and the logical stack allows at least two of the first processor cores Each resource request is stored in the logic stack, and the first processor core is any one of the m processor cores.
结合第三方面,在一些可能的实施例中,逻辑栈为先进先出单元FIFO逻辑栈。With reference to the third aspect, in some possible embodiments, the logic stack is a first-in first-out unit FIFO logic stack.
结合第三方面,在一些可能的实施例中,所述从机设备还用于接收针对第一资源请求的撤销命令,该第一资源请求为至少一个资源请求中的任一个资源请求;根据撤销命令删除逻辑栈中存储的第一资源请求。With reference to the third aspect, in some possible embodiments, the slave device is further configured to receive a cancellation command for a first resource request, where the first resource request is any one of at least one resource request; according to the cancellation Command to delete the first resource request stored in the logic stack.
结合第三方面,在一些可能的实施例中,在删除第一资源请求之后,所述从机设备还用于通过中断响应将撤销结果上报给第一资源请求所对应的主机设备,其中该撤销结果用于指示逻辑栈已完成第一资源请求的撤销。With reference to the third aspect, in some possible embodiments, after deleting the first resource request, the slave device is further configured to report the cancellation result to the host device corresponding to the first resource request through an interrupt response, wherein the cancellation The result is used to indicate that the logic stack has completed the cancellation of the first resource request.
第四方面,提供了一种通信设备,该通信设备包括部署有逻辑栈和资源分配逻辑电路的处理器,在实际运行时该处理器用于执行如上第一方面所描述的方法。可选地,该通信设备中还可包括以下中的任一项或多项的组合:逻辑资源、保护锁以及至少一个处理器核。In a fourth aspect, a communication device is provided. The communication device includes a processor deployed with a logic stack and a resource allocation logic circuit. In actual operation, the processor is used to execute the method described in the first aspect. Optionally, the communication device may further include any one or a combination of the following: logic resources, protection locks, and at least one processor core.
第五方面,提供了一种计算机可读存储介质,所述计算机可读存储介质用于执行上述第一方面所描述的方法的指令。In a fifth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium is used to execute instructions of the method described in the first aspect.
第六方面,提供了一种芯片产品,以执行上述第一方面或第一方面的任意可能的实施方式中的方法。In a sixth aspect, a chip product is provided to implement the foregoing first aspect or the method in any possible implementation manner of the first aspect.
本发明在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。On the basis of the implementation manners provided in the above aspects, the present invention can be further combined to provide more implementation manners.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art.
图1是现有技术提供的一种CPU抢占数据资源的场景示意图。Fig. 1 is a schematic diagram of a scenario in which a CPU preempts data resources provided by the prior art.
图2是现有技术提供的另一种CPU抢占数据资源的场景示意图。Fig. 2 is a schematic diagram of another scenario where a CPU preempts data resources provided by the prior art.
图3是本发明实施例提供的一种通信系统的结构示意图。Fig. 3 is a schematic structural diagram of a communication system provided by an embodiment of the present invention.
图4是本发明实施例提供的一种逻辑栈存储的示意图。Fig. 4 is a schematic diagram of a logical stack storage provided by an embodiment of the present invention.
图5是本发明实施例提供的另一种通信系统的结构示意图。Fig. 5 is a schematic structural diagram of another communication system provided by an embodiment of the present invention.
图6是本发明实施例提供的一种资源获取方法的流程示意图。Fig. 6 is a schematic flowchart of a resource acquisition method provided by an embodiment of the present invention.
图7是本发明实施例提供的一种逻辑栈的示意图。Fig. 7 is a schematic diagram of a logic stack provided by an embodiment of the present invention.
图8是本发明实施例提供的另一种资源获取方法的流程示意图。FIG. 8 is a schematic flowchart of another resource acquisition method provided by an embodiment of the present invention.
图9是本发明实施例提供的一种逻辑栈的变更示意图。Fig. 9 is a schematic diagram of a change of a logic stack provided by an embodiment of the present invention.
图10是本发明实施例提供的一种通信装置的结构示意图。Fig. 10 is a schematic structural diagram of a communication device provided by an embodiment of the present invention.
图11是本发明实施例提供的一种通信设备的结构示意图。Fig. 11 is a schematic structural diagram of a communication device provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明的附图,对本发明实施例中的技术方案进行详细描述。The technical solutions in the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings of the present invention.
如图1示出一种CPU抢占数据资源的场景示意图。如图1的示意图中包括有3个抢锁请求、N个资源以及N个硬件锁。其中,每个硬件锁对应保护一个资源,用于对该资源进行加密保护。每个抢锁请求由一个CPU在需要使用资源时产生,不同抢锁请求对应不同的CPU。图中分别示出了3个CPU各自产生的抢锁请求,具体可为CPU1request(抢锁请求)、CPU2request和CPU3request;N个资源分别为资源1~资源N,N个硬件锁分别为Lock1~LockN。Figure 1 shows a schematic diagram of a scenario where a CPU preempts data resources. The schematic diagram shown in Figure 1 includes 3 lock grab requests, N resources, and N hardware locks. Among them, each hardware lock correspondingly protects a resource, which is used to encrypt and protect the resource. Each lock grab request is generated by a CPU when it needs to use resources, and different lock grab requests correspond to different CPUs. The figure shows the lock grab requests generated by each of the three CPUs, specifically CPU1request (lock grab request), CPU2request and CPU3request; N resources are resource 1 to resource N, and N hardware locks are Lock1 to LockN .
当设备上的应用程序需使用资源时可产生查询请求,进一步通过CPU调用loop查询程序查询可用的空闲数据资源(以下简称空闲资源),示例性的,CPU通过调用loop查询程度查询每个资源各自的状态信息,该状态信息包括占用或空闲。当状态信息为占用时,表示该资源正在被占用,例如被其他应用程序使用。当状态信息为空闲时,表示该资源当前没被占用,处于空闲,应用程序此时可使用该空闲资源。当CPU查询到状态信息为空闲的资源时,表示该资源为应用程序当前可用的空闲资源。When the application on the device needs to use resources, a query request can be generated, and the CPU calls the loop query program to query the available idle data resources (hereinafter referred to as idle resources). For example, the CPU queries each resource by calling the loop query level. The status information, the status information includes occupied or idle. When the status information is occupied, it indicates that the resource is being occupied, such as being used by other applications. When the status information is idle, it means that the resource is not currently occupied and is idle, and the application can use the idle resource at this time. When the CPU finds that the status information is an idle resource, it indicates that the resource is an idle resource currently available to the application.
相应地,在查询到空闲资源后,CPU可发出抢锁命令。该抢锁命令用于抢占空闲资源对应的硬件锁,以利用该硬件锁对该空闲资源进行解锁,从而获得该空闲资源。当应用程序通过CPU无法查询到可用的空闲资源时,则可运行sleep等待程序,等候继续查找可用的空闲资源。Correspondingly, after inquiring about free resources, the CPU can issue a lock grab command. The lock grab command is used to grab the hardware lock corresponding to the idle resource, so as to unlock the idle resource by using the hardware lock to obtain the idle resource. When the application program cannot query the available idle resources through the CPU, it can run the sleep waiting program and wait to continue to find the available idle resources.
然而在实践中发现,在资源充足的情况下,应用程序每次通过CPU都可查询到可用的空闲资源。在资源紧张的情况下,所有资源可能被全部占用,CPU无法查询到可用的空闲资源。然而在没有可用的空闲资源的情况之下,应用程序还是会经历查询请求解析->查询请求执行->查询请求响应->结果返回的过程。在实际应用中,抢锁请求在芯片总线上传输还存在一定的时延消耗,因此一个空闲资源的查询周期通常会达到数百微妙甚至毫秒的量级。此外,在考虑异步多线程调度场景,每两个查询请求之间需插入至少一个sleep等待函数,该场景下完成一次空闲资源的查询所消耗的时间,通常会达到毫秒甚至几十毫秒的量级。在这几十毫秒的时间间隔内,该CPU的查询速度可能会慢于另一CPU的查询速度,导致该CPU很难查询并抢占到可用的空闲资源,从而影响正常的业务通信,影响业务服务质量。However, in practice, it has been found that in the case of sufficient resources, the application can query the available idle resources through the CPU every time. In the case of resource shortage, all resources may be fully occupied, and the CPU cannot query available idle resources. However, when there are no free resources available, the application will still go through the process of query request resolution -> query request execution -> query request response -> result return. In practical applications, there is a certain delay in the transmission of lock grab requests on the chip bus. Therefore, the query cycle of an idle resource usually reaches the order of hundreds of microseconds or even milliseconds. In addition, considering the asynchronous multi-threaded scheduling scenario, at least one sleep waiting function needs to be inserted between every two query requests. In this scenario, the time consumed to complete an idle resource query is usually on the order of milliseconds or even tens of milliseconds. . In this time interval of tens of milliseconds, the query speed of the CPU may be slower than that of another CPU, which makes it difficult for the CPU to query and preempt available idle resources, thereby affecting normal business communications and business services quality.
如图2示出一种CPU抢占数据资源的过程示意图。其中横轴表示时间,图中示出三个CPU沿着时间轴进行各自CPU抢占数据资源的具体实施过程。如图2,三个CPU各自发出针对空闲资源的查询请求的时间先后顺序依次为:CPU2>CPU1>CPU3。如图,针对提供有限空闲资源的设备而言,CPU2发送的查询请求优先被处理,查询设备中是否存在有可用的空闲资源。当查询到后,CPU2可抢占该空闲资源对应的硬件锁,便于CPU通过该硬件锁对空闲资源进行解锁以使用该空闲资源。可选地,CPU2还可上报查询结果,该查询结果用于指示CPU2查询到可用的空闲资源,或者用于指示CPU2未查询到可用的空闲资源。可选地,在CPU2使用完该空闲资源后,可释放该空闲资源,以供其他CPU使用。Figure 2 shows a schematic diagram of a process in which a CPU preempts data resources. The horizontal axis represents time, and the figure shows the specific implementation process of three CPUs along the time axis for their respective CPUs to seize data resources. As shown in Figure 2, the time sequence for each of the three CPUs to issue query requests for idle resources is: CPU2>CPU1>CPU3. As shown in the figure, for a device that provides limited idle resources, the query request sent by the CPU 2 is processed first to query whether there are available idle resources in the device. After the query is found, the CPU 2 can preempt the hardware lock corresponding to the idle resource, so that the CPU can unlock the idle resource through the hardware lock to use the idle resource. Optionally, the CPU2 may also report a query result, which is used to indicate that the CPU2 has inquired about available idle resources, or used to indicate that the CPU2 has not inquired about available idle resources. Optionally, after the CPU 2 finishes using the idle resource, the idle resource may be released for use by other CPUs.
如图在CPU2查询空闲资源过程中,CPU1也存在空闲资源的使用需求,通过发送查询请求,以查询设备中可用的空闲资源。如图所示,CPU1发送查询请求的时间晚于CPU2发送查询请求的时间。CPU1通过查询请求查询空闲资源时,由于该空闲资源已被CPU2查询抢占,则此时CPU1可返回查询结果,该查询结果用于指示空闲资源已被CPU2抢占,当前无可用的空闲资源,以通知CPU1等待再查询或结束流程。可选地,CPU1可运行sleep等待程序,在等待预设时长后,继续通过该查询请求查询并抢占可用的空闲资源。同理,在CPU1等待过程中,CPU2已使用并释放空闲资源,此时CPU3发送查询请求以满足自身需空闲资源的使用需求。相应地,CPU3通过查询请求查询并抢占空闲资源。当CPU1运行完sleep等待程序后,可继续通过自身的查询请求查询设备中是否存在空闲资源。由于此时该空闲资源已被CPU3抢占,则CPU1可上报相应地查询结果,该查询结果用于指示该空闲资源已被CPU3抢占,当前无可用的空闲资源。As shown in the figure, in the process of CPU2 inquiring about free resources, CPU1 also has a demand for use of free resources, and it sends a query request to query the available free resources in the device. As shown in the figure, the time when CPU1 sends the query request is later than the time when CPU2 sends the query request. When CPU1 queries idle resources through a query request, because the idle resources have been queried by CPU2, CPU1 can return the query result at this time. The query result is used to indicate that the idle resources have been preempted by CPU2 and there are currently no available idle resources to notify CPU1 waits to query again or ends the process. Optionally, the CPU1 can run the sleep waiting program, and after waiting for a preset time, continue to request the query through the query and preempt available idle resources. In the same way, while CPU1 is waiting, CPU2 has used and released idle resources. At this time, CPU3 sends a query request to meet its own demand for idle resources. Correspondingly, CPU3 queries and preempts free resources through query requests. After CPU1 runs the sleep waiting program, it can continue to query whether there are idle resources in the device through its own query request. Since the idle resource has been preempted by the CPU 3 at this time, the CPU 1 can report the corresponding query result, which is used to indicate that the idle resource has been preempted by the CPU 3, and there is currently no idle resource available.
由图可知,在CPU数量较多的场景下,CPU抢占空闲资源较难,很容易导致CPU无法抢到空闲资源,从而影响CPU的正常业务通信,影响业务性能。It can be seen from the figure that in a scenario with a large number of CPUs, it is difficult for the CPU to seize idle resources, and it is easy for the CPU to fail to grab the idle resources, which affects the normal business communication of the CPU and affects business performance.
为解决上述问题,本申请提出一种资源获取方法、所述方法适用的相关装置和系统。请参见图3,是本发明实施例提供的一种通信系统的结构示意图。如图3所示的通信系统300包括m个处理器核302、逻辑栈304和资源分配逻辑电路306。可选地,该通信系统还可包括保护锁308和资源310。该保护锁308和资源310的数量并不做限定,其可为一个或多个,图示分别以多个保护锁308和多个资源310为例示出。m为正整数。其中,To solve the above-mentioned problems, this application proposes a resource acquisition method, and related devices and systems to which the method is applicable. Refer to FIG. 3, which is a schematic structural diagram of a communication system according to an embodiment of the present invention. The communication system 300 shown in FIG. 3 includes m processor cores 302, a logic stack 304, and a resource allocation logic circuit 306. Optionally, the communication system may further include a protection lock 308 and a resource 310. The number of the protection locks 308 and the resources 310 is not limited, and there may be one or more. The figure shows multiple protection locks 308 and multiple resources 310 as examples. m is a positive integer. among them,
处理器核302用于在检测到需要使用资源时,发送资源请求,以获取该处理器核所需使用的空闲资源。该空闲资源是指未被其他处理器核使用的资源,该资源包括但不限于计算资源、存储资源以及网络资源等,例如该资源可为通信系统中部署的密钥派生模块,该密钥派生模块用于提供通信密钥,以保证数据的安全传输。在一种可选的情况中,该资源为硬件逻辑资源,处理器核通过该硬件逻辑资源进行相应的逻辑运算或完成相应的功能。The processor core 302 is configured to send a resource request when it is detected that the resource needs to be used, so as to obtain the idle resource required by the processor core. The idle resources refer to resources that are not used by other processor cores. The resources include but are not limited to computing resources, storage resources, and network resources. For example, the resource may be a key derivation module deployed in a communication system, and the key derivation The module is used to provide a communication key to ensure the safe transmission of data. In an optional situation, the resource is a hardware logic resource, and the processor core performs a corresponding logic operation or completes a corresponding function through the hardware logic resource.
逻辑栈304用于缓存处理器核302发送的资源请求(即本申请上文的查询请求),该资源请求用于请求获取供处理器核302使用的空闲资源。逻辑栈304中支持存储资源请求的数量并不限定,取决于逻辑栈304的存储容量。逻辑栈304中支持存储同一处理器核302发送的一个或多个资源请求。具体的,当逻辑栈304的存储容量支持存储n个资源请求,且n=m,则逻辑栈304中只允许存储m个处理器核302中每个处理器核的一个资源请求。当n大于m时,逻辑栈304中允许存储第一处理器核的至少两个资源请求,该第一处理器核为m个处理器核中的任一个处理器核;换句话说,在逻辑栈304支持存储资源请求的数量n大于处理器核的总数量m时,逻辑栈304中支持存储同一处理器核302的至少两个空闲资源。The logic stack 304 is used to cache the resource request sent by the processor core 302 (that is, the query request mentioned above in this application), and the resource request is used to request the acquisition of idle resources for the processor core 302 to use. The number of storage resource requests supported in the logic stack 304 is not limited and depends on the storage capacity of the logic stack 304. The logic stack 304 supports storing one or more resource requests sent by the same processor core 302. Specifically, when the storage capacity of the logic stack 304 supports the storage of n resource requests, and n=m, the logic stack 304 is only allowed to store one resource request for each of the m processor cores 302. When n is greater than m, the logic stack 304 is allowed to store at least two resource requests of the first processor core, which is any one of the m processor cores; in other words, in the logic stack 304 When the number n of storage resource requests supported by the stack 304 is greater than the total number m of processor cores, the logical stack 304 supports storing at least two idle resources of the same processor core 302.
可选地,每个资源请求中携带有标识,该标识用于指示发送该资源请求的处理器核,其可包括但不限于处理器核的名称、身份标识ID等信息。相应地,逻辑栈304接收处理器核302发送的资源请求后,可自动识别资源请求中携带的标识,以记录发送该资源请求所对应的处理器核的标识。进一步地,逻辑栈304可根据资源请求中携带的标识决定是否将该资源请求存入逻辑栈304中,具体可参见前述依据逻辑栈304的存储容量进行存储的相 关阐述。其中逻辑栈304中支持存储资源请求的数量n,也可称为该逻辑栈304的深度(或长度),不做限定。Optionally, each resource request carries an identifier, and the identifier is used to indicate the processor core that sends the resource request. The identifier may include, but is not limited to, the name of the processor core, the identity ID, and other information. Correspondingly, after the logic stack 304 receives the resource request sent by the processor core 302, it can automatically identify the identifier carried in the resource request to record the identifier of the processor core corresponding to the resource request. Further, the logic stack 304 can determine whether to store the resource request in the logic stack 304 according to the identifier carried in the resource request. For details, please refer to the foregoing description of storage according to the storage capacity of the logic stack 304. The number n of storage resource requests supported in the logic stack 304 can also be referred to as the depth (or length) of the logic stack 304, which is not limited.
考虑到资源请求处理的合理性,逻辑栈304的深度n和处理器核的总数量m通常相等,此时逻辑栈304中只允许具备相同标识的多个资源请求中的一个资源请求入栈存储。具体的,当同一处理器核发送有多个资源请求时,每个资源请求中携带有该同一处理器核的标识(cpu_id)。相应地逻辑栈304在首次接收到该同一处理器核发送的资源请求后,可自动识别并记录该资源请求中携带的标识(cpu_id),并将该资源请求存入逻辑栈中。若该逻辑栈304后续再次接收到同一处理器核发送的资源请求时,可直接丢弃,向该同一处理器核发送异常通知消息,该异常通知消息用于通知逻辑栈304当前无法处理该资源请求。Considering the rationality of resource request processing, the depth n of the logic stack 304 and the total number m of processor cores are usually equal. At this time, only one of the multiple resource requests with the same identifier is allowed to be stored in the logic stack 304. . Specifically, when multiple resource requests are sent by the same processor core, each resource request carries the identifier (cpu_id) of the same processor core. Correspondingly, after the logic stack 304 receives the resource request sent by the same processor core for the first time, it can automatically identify and record the identifier (cpu_id) carried in the resource request, and store the resource request in the logic stack. If the logic stack 304 subsequently receives the resource request sent by the same processor core again, it can be directly discarded, and an exception notification message is sent to the same processor core. The exception notification message is used to notify the logic stack 304 that the resource request cannot currently be processed .
针对逻辑栈304中资源请求的存储顺序,并不做限定。示例性地,资源请求在逻辑栈304中的存储顺序和逻辑栈304接收各资源请求的先后顺序有关,关于逻辑栈304存储资源请求的具体实施方式不做限定。例如,逻辑栈304可根据各资源请求的接收时间进行存储,示例性地最早接收的资源请求可被优先存储于逻辑栈304中,最晚接收的资源请求被最后存储于逻辑栈304中。或者,逻辑栈304可依据各资源请求的优先级来存储,如优先级较高的资源请求被优先存储于逻辑栈304中,其次存储优先级较低的资源请求。或者,逻辑栈304可依据各资源请求的服务等级来存储,例如将服务等级较高的资源请求优先存储到逻辑栈304中,再存储服务等级较低的资源请求等等,本申请不做限定。The storage order of resource requests in the logic stack 304 is not limited. Exemplarily, the storage order of resource requests in the logic stack 304 is related to the order in which the logic stack 304 receives each resource request, and the specific implementation of the logic stack 304 storing resource requests is not limited. For example, the logic stack 304 may store according to the receiving time of each resource request. Illustratively, the resource request received earliest may be stored in the logic stack 304 first, and the resource request received last may be stored in the logic stack 304 last. Alternatively, the logic stack 304 may be stored according to the priority of each resource request. For example, a resource request with a higher priority is stored in the logic stack 304 first, and a resource request with a lower priority is stored secondly. Alternatively, the logic stack 304 can be stored according to the service level of each resource request. For example, the resource request with a higher service level is stored in the logic stack 304 first, and then the resource request with a lower service level is stored. This application does not limit it. .
在实际应用中,逻辑栈304具体可包括但不限于先进先出单元(first in first out unit,FIFO)逻辑栈、后进先出单元(last in first out unit,LIFO)逻辑栈、低时延逻辑栈以及用户定制逻辑栈等。本申请下文将以逻辑栈为FIFO逻辑栈为例进行相关内容的阐述,其中先进先出FIFO的设计能够保证逻辑栈304中先进入的资源请求被优先出栈处理,从而实现了资源请求轮询和处理的公平性。In practical applications, the logic stack 304 may specifically include, but is not limited to, the first in first out unit (FIFO) logic stack, the last in first out unit (LIFO) logic stack, and the low latency logic Stack and user-defined logic stack, etc. This application will take the logic stack as the FIFO logic stack as an example to explain the relevant content. The first-in-first-out FIFO design can ensure that the first-in-first-out resource request in the logic stack 304 is preferentially popped out, thereby realizing resource request polling And fairness of processing.
为保障资源请求处理的逻辑性,在同一工作时钟周期内通信系统(具体可为逻辑栈304或资源分配逻辑电路306)支持单个资源请求的处理。具体的在同一工作时钟周期,逻辑栈304仅支持一个资源请求的进栈或出栈,资源分配逻辑电路306支持为一个资源请求分配逻辑资源。其中,工作时钟周期是指单个资源请求被处理所需消耗的周期时长。请参见图4示出一种逻辑栈304的存储示意图。如图4所示的逻辑栈304中存储有4个CPU的资源请求,如图具体可为CPU1~CPU4各自的一个资源请求。其中,在同一工作时钟周期内,该逻辑栈304只允许一个CPU的资源请求进栈或出栈,以实现资源请求的进栈存储或出栈处理。In order to ensure the logic of resource request processing, the communication system (specifically, the logic stack 304 or the resource allocation logic circuit 306) supports the processing of a single resource request in the same working clock cycle. Specifically, in the same working clock cycle, the logic stack 304 only supports the pushing or popping of one resource request, and the resource allocation logic circuit 306 supports allocating logic resources for one resource request. Among them, the working clock period refers to the period of time consumed for processing a single resource request. Please refer to FIG. 4 showing a schematic diagram of the storage of a logic stack 304. The logic stack 304 shown in FIG. 4 stores resource requests of four CPUs, which may be specifically one resource request of each of CPU1 to CPU4 in the figure. Wherein, in the same working clock cycle, the logic stack 304 only allows one CPU's resource request to be pushed into or out of the stack, so as to realize the in-stack storage or out of the stack processing of the resource request.
资源分配逻辑电路306用于处理逻辑栈304中的资源请求,为该资源请求分配可用的空闲资源。可选地,该资源分配逻辑电路306还用于查询k个资源310中是否有可用的空闲资源。具体的,在资源分配逻辑电路306检测到目标资源请求从逻辑栈304中出栈时,该资源分配逻辑电路306可接收逻辑栈304中出栈的目标资源请求,进一步可查询当前是否存在有可用的空闲资源,如果存在,可将查询的空闲资源作为目标逻辑资源,以分配给发送该目标资源请求的目标处理器核使用。The resource allocation logic circuit 306 is used to process the resource request in the logic stack 304 and allocate available idle resources for the resource request. Optionally, the resource allocation logic circuit 306 is also used to query whether there are available idle resources among the k resources 310. Specifically, when the resource allocation logic circuit 306 detects that the target resource request is popped from the logic stack 304, the resource allocation logic circuit 306 can receive the target resource request popped from the logic stack 304, and can further query whether there is currently available If the idle resource exists, the queried idle resource can be used as the target logical resource to be allocated to the target processor core that sends the target resource request.
在实际应用中,资源分配逻辑电路306具体可通过诸如专用集成电路 (application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其组合等硬件资源实现。实际产品部署时,该资源分配逻辑电路306为独立于m个处理器核的硬件逻辑,即资源分配逻辑电路306可独立于m个处理器核单独部署。In practical applications, the resource allocation logic circuit 306 can be implemented by, for example, an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD can be a complex program logic device. (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), generic array logic (generic array logic, GAL) or a combination of hardware resource implementation. In actual product deployment, the resource allocation logic circuit 306 is hardware logic independent of the m processor cores, that is, the resource allocation logic circuit 306 can be deployed independently of the m processor cores.
可选地,处理器核发送的资源请求中还可携带有该处理器核的属性信息。该属性信息是指用于描述处理器核属性的信息,例如其可包括但不限于处理器核的标识、处理器核支持的业务类型、服务质量(quality of service,QOS)指标、服务等级或其他属性信息等。其中,服务质量指标包括但不限于时延、吞吐量、丢失率、优先级、或者其他用于影响业务通信质量的指标。服务等级包括但不限于QOS等级和服务种类(class of service,COS)等级,也可简称为QOS服务等级和COS服务等级。其中,QOS服务等级主要依据带宽或传输时间来划分,例如处理器核业务通信时所需的带宽越大,则该处理器核的QOS服务等级越高;反之,处理器核业务通信时所需的带宽越小,则该处理器核的QOS服务等级越低。COS服务等级通常是指流量的传输优先级,示例性,这里处理器核的COS服务等级可以是处理器核支持业务通信时所要求传输数据的优先级。Optionally, the resource request sent by the processor core may also carry attribute information of the processor core. The attribute information refers to the information used to describe the attributes of the processor core, for example, it may include but not limited to the identifier of the processor core, the type of service supported by the processor core, the quality of service (QOS) index, the service level or Other attribute information, etc. Among them, the service quality indicators include but are not limited to delay, throughput, loss rate, priority, or other indicators used to affect service communication quality. The service level includes but is not limited to the QOS level and the class of service (COS) level, which can also be referred to as the QOS service level and COS service level for short. Among them, the QOS service level is mainly divided according to bandwidth or transmission time. For example, the larger the bandwidth required for processor core business communication, the higher the QOS service level of the processor core; conversely, the processor core business communication requires The smaller the bandwidth, the lower the QOS service level of the processor core. The COS service level usually refers to the transmission priority of traffic. For example, the COS service level of the processor core here may be the priority of data transmission required when the processor core supports business communication.
相应地,资源分配逻辑电路306接收该处理器核发送的资源请求后,可具体根据该资源请求中的属性信息为该处理器核分配与之相匹配的空闲资源。例如,当该属性信息为处理器核支持的业务类型时,资源分配逻辑电路306接收该资源请求后,可查询k个资源310中是否有支持处理该业务类型的通信业务所对应的空闲资源,以供处理器核使用。当属性信息为处理器核的其他属性信息时,同理资源分配逻辑电路306接收该资源请求后,可查询k个资源310中是否存在有满足该其他属性信息要求的空闲资源,以供处理器核使用。Correspondingly, after the resource allocation logic circuit 306 receives the resource request sent by the processor core, it can allocate the matching idle resources to the processor core according to the attribute information in the resource request. For example, when the attribute information is a service type supported by the processor core, after receiving the resource request, the resource allocation logic circuit 306 can query whether there are idle resources corresponding to the communication service supporting the processing of the service type among the k resources 310, For use by the processor core. When the attribute information is other attribute information of the processor core, similarly, after the resource allocation logic circuit 306 receives the resource request, it can query whether there are idle resources meeting the requirements of the other attribute information among the k resources 310 for the processor Nuclear use.
保护锁308用于对资源310进行保护,具体的用于资源310进行加锁保护,例如对访问该资源的通信入口进行锁定等。该保护锁308的数量并不做限定,具体的同一保护锁可用于对一个或多个资源310进行加锁保护,每个资源310可使用一个保护锁308进行保护。图示以k个资源310对应用k个保护锁308进行加锁保护为例,其中资源310和保护锁308是一一对应的关系,即一个资源对应用一个保护锁进行锁定。The protection lock 308 is used to protect the resource 310, specifically, it is used to lock the resource 310, for example, to lock the communication portal that accesses the resource. The number of the protection locks 308 is not limited. The same protection lock can be used to lock and protect one or more resources 310, and each resource 310 can be protected by one protection lock 308. In the figure, k resources 310 are used to lock and protect k protection locks 308 as an example. The resource 310 and the protection lock 308 are in a one-to-one correspondence, that is, one resource is locked to one protection lock.
在实际应用中,该保护锁308具体可为软件锁或硬件锁。其中,软件锁是由软件或程序代码实现的。硬件锁可以由硬件逻辑电路,专用的硬件集成电路或者固化硬件核等实现。In practical applications, the protection lock 308 may be a software lock or a hardware lock. Among them, the software lock is realized by software or program code. The hardware lock can be implemented by hardware logic circuits, dedicated hardware integrated circuits, or hardened hardware cores.
资源310为通信系统300提供给m个处理器核使用的资源,该资源具体可为硬件逻辑资源,也可为数据资源,不做限定。该资源的数量也并不做限定,其可为一个或多个,图示中以k个资源为例示出,每个资源各需一个保护锁进行安全保护。在实际应用中,资源分配逻辑电路306接收处理器核发送的资源请求时,可从k个资源中查询是否存在有未被使用或未被抢占的空闲资源。如果查询到空闲资源时,资源分配逻辑电路306可自动发出抢锁命令,以抢占该空闲资源对应的保护锁。便于后续利用该保护锁对空闲资源进行解锁,从而该资源请求对应的处理器核可以使用解锁后的空闲资源。换句话说,处理器核可基于 该保护锁来访问并使用空闲资源。The resource 310 is a resource used by the m processor cores provided by the communication system 300, and the resource may be a hardware logic resource or a data resource, which is not limited. The number of the resources is also not limited, and it can be one or more. In the figure, k resources are taken as an example, and each resource needs a protection lock for security protection. In actual applications, when the resource allocation logic circuit 306 receives the resource request sent by the processor core, it can query from the k resources whether there are idle resources that are not used or preempted. If an idle resource is queried, the resource allocation logic circuit 306 can automatically issue a lock grab command to grab the protection lock corresponding to the idle resource. It is convenient to subsequently use the protection lock to unlock the idle resources, so that the processor core corresponding to the resource request can use the unlocked idle resources. In other words, the processor core can access and use idle resources based on the protection lock.
可选地,资源分配逻辑电路306在抢占保护锁后,还可通过中断响应将抢锁结果发送给该处理器核,以通知当前已成功抢占到保护锁。可选地,资源分配逻辑电路306在处理完处理器核发送的资源请求之后,资源分配逻辑电路306还可向该处理器核发送资源响应,该资源响应用于通知当前是否成功抢占到空闲资源(或空闲资源对应的保护锁)。具体的,当资源分配逻辑电路306查询到存在有该资源请求对应所需的空闲资源时,资源分配逻辑电路306可采用中断的方式向处理器核返回第一资源响应,该第一资源响应用于通知当前已成功抢占空闲资源,可选地还可用于通知当前已成功抢占到空闲资源对应的保护锁。当资源分配逻辑电路306未查询到存在有该资源请求对应所需的空闲资源时,则资源分配逻辑电路306可结束流程;或者仍可采用中断的方式向处理器核返回第二资源响应,该第二资源响应用于通知当前未能成功抢占空闲资源,等待下次再抢占。Optionally, after the resource allocation logic circuit 306 preempts the protection lock, it may also send the preemption result to the processor core through an interrupt response to notify that the protection lock has been successfully preempted. Optionally, after the resource allocation logic circuit 306 has processed the resource request sent by the processor core, the resource allocation logic circuit 306 may also send a resource response to the processor core. The resource response is used to notify whether the current free resource is successfully seized. (Or the protection lock corresponding to free resources). Specifically, when the resource allocation logic circuit 306 finds that there is an idle resource corresponding to the resource request, the resource allocation logic circuit 306 may return the first resource response to the processor core in an interrupt mode, and the first resource response is used In order to notify that the idle resource has been successfully seized, it can optionally also be used to notify that the protection lock corresponding to the idle resource has been successfully seized. When the resource allocation logic circuit 306 does not inquire about the existence of idle resources required by the resource request, the resource allocation logic circuit 306 can end the process; or the second resource response can still be returned to the processor core in an interrupt mode. The second resource response is used to notify that the idle resource has not been successfully preempted at present and wait for the next preemption.
在实际应用中,m个处理器核302中的任一个或多个处理器核302可单独部署、或部署在同一设备中。示例性地,以m个处理器核单独部署为例,m个处理器核分别可对应部署在m个主机设备中,每个主机设备中部署有一个处理器核。以m个处理器核中的至少两个处理核共同部署为例,该至少两个处理器核可部署在同一主机设备中。该主机设备包括但不限于处理器CPU、控制器、手机、平板电脑(table personal computer)、个人数字助理(personal digital assistant,PDA)、移动上网装置(mobile internet device,MID)、可穿戴式设备(wearable device)、车载设备以及其他支持和网络通信的设备等。In practical applications, any one or more of the m processor cores 302 may be deployed separately or in the same device. Illustratively, taking the independent deployment of m processor cores as an example, the m processor cores may be correspondingly deployed in m host devices, and each host device has a processor core deployed. Taking the common deployment of at least two of the m processor cores as an example, the at least two processor cores may be deployed in the same host device. The host device includes but is not limited to processor CPU, controller, mobile phone, tablet computer (table personal computer), personal digital assistant (personal digital assistant, PDA), mobile internet device (mobile internet device, MID), wearable device (wearable device), in-vehicle equipment, and other devices that support network communication.
逻辑栈304和资源分配逻辑电路306可部署同一设备中,具体可部署在与处理器核相同的设备中,也可部署在与处理器核不同的另一设备中。示例性地,以逻辑栈304和资源分配逻辑电路306部署到有别于m个处理器核外的从机设备中为例,该逻辑栈304和资源分配逻辑电路306均可部署到从机设备中,该从机设备包括但不限于手机、平板电脑(table personal computer)、个人数字助理(personal digital assistant,PDA)、移动上网装置(mobile internet device,MID)、可穿戴式设备(wearable device)、车载设备以及其他支持和网络通信的设备等。The logic stack 304 and the resource allocation logic circuit 306 may be deployed in the same device, specifically in the same device as the processor core, or in another device different from the processor core. Illustratively, taking the logic stack 304 and the resource allocation logic circuit 306 deployed to slave devices other than m processor cores as an example, the logic stack 304 and the resource allocation logic circuit 306 can both be deployed to the slave device Among them, the slave device includes but is not limited to mobile phones, tablet computers (table personal computers), personal digital assistants (personal digital assistants, PDAs), mobile internet devices (MIDs), and wearable devices (wearable devices) , In-vehicle equipment and other equipment supporting network communication.
保护锁308和资源310可部署在同一设备中,该设备可为有别于逻辑栈304和资源分配逻辑电路306部署的设备,也可部署到与逻辑栈304和资源分配逻辑电路306部署的相同设备中,本发明并不做限定。示例性地,该保护锁308和资源310可部署到上文的从机设备中,具体的请参见图5示出本发明的另一种通信系统。如图5所述的通信系统包括m个主机设备502和从机设备504,每个主机设备502中部署有一个处理器核302,从机设备404中部署有逻辑栈304、资源分配逻辑电路306、k个保护锁308以及k个资源310,关于设备中部署的各硬件或部件,具体可参见图3所述实施例中的相关阐述,这里不在赘述。The protection lock 308 and the resource 310 can be deployed in the same device, which can be different from the device deployed by the logic stack 304 and the resource allocation logic circuit 306, or can be deployed to be the same as the logic stack 304 and the resource allocation logic circuit 306. In the equipment, the present invention is not limited. Exemplarily, the protection lock 308 and the resource 310 can be deployed in the above slave device. For details, please refer to FIG. 5 which shows another communication system of the present invention. The communication system as shown in FIG. 5 includes m host devices 502 and slave devices 504. Each host device 502 has a processor core 302 deployed, and the slave device 404 has a logic stack 304 and a resource allocation logic circuit 306. , K protection locks 308 and k resources 310. Regarding the hardware or components deployed in the device, refer to the relevant description in the embodiment of FIG. 3 for details, which will not be repeated here.
基于前述实施例,下面阐述本发明涉及资源获取的具体实施例。请参见图6,是本发明实施例提供的一种资源获取方法的流程示意图。如图6所示的方法可包括如下实施步骤:Based on the foregoing embodiments, specific embodiments related to resource acquisition of the present invention are described below. Refer to FIG. 6, which is a schematic flowchart of a resource acquisition method provided by an embodiment of the present invention. The method shown in FIG. 6 may include the following implementation steps:
步骤S602、处理器核302向逻辑栈304发送资源请求,该资源请求用于为处理器核302请求逻辑资源。相应地,逻辑栈304接收该资源请求。Step S602: The processor core 302 sends a resource request to the logic stack 304, where the resource request is used to request logic resources for the processor core 302. Accordingly, the logic stack 304 receives the resource request.
本申请中,m个处理器核中的任一处理器核302在存在资源使用需求时,可发送资源 请求。例如,当某个应用程序需要使用逻辑资源时,可通过运行该应用程序所在的处理器核CPU发送资源请求,在发送完毕资源请求后,可自动释放该处理器核CPU的控制权或占用权,以减少应用程序对CPU的占用,提升CPU的使用率。In this application, any one of the m processor cores 302 may send a resource request when there is a resource usage requirement. For example, when an application program needs to use logic resources, it can send a resource request through the processor core CPU where the application program is running. After the resource request is sent, the control or occupation right of the processor core CPU can be automatically released , In order to reduce CPU usage by applications and increase CPU usage.
步骤S604、逻辑栈304接收至少一个资源请求,并将该至少一个资源请求存储到逻辑栈304中。其中,每一资源请求为一个处理器核发送的,且该资源请求与处理器核之间是一一对应的。Step S604: The logic stack 304 receives at least one resource request, and stores the at least one resource request in the logic stack 304. Among them, each resource request is sent by one processor core, and there is a one-to-one correspondence between the resource request and the processor core.
逻辑栈304可接收m个处理器核中任一处理器核发送的资源请求。同理,当m个处理器核中有多个处理器核发送资源请求时,该逻辑栈304可接收到至少一个资源请求,该至少一个资源请求为m个处理器核中的至少一个处理器核发送的,其中每个资源请求为一个处理器核发送的,同一处理器核可发送一个或多个资源请求。进一步,逻辑栈304可将接收的至少一个资源请求存放到逻辑栈304中。关于资源请求在逻辑栈304中存储的具体实施方式,本发明不做限定。The logic stack 304 can receive a resource request sent by any one of the m processor cores. Similarly, when multiple processor cores among the m processor cores send resource requests, the logic stack 304 may receive at least one resource request, and the at least one resource request is for at least one processor among the m processor cores. Each resource request is sent by one processor core, and the same processor core can send one or more resource requests. Further, the logic stack 304 may store at least one resource request received in the logic stack 304. Regarding the specific implementation manner of storing the resource request in the logic stack 304, the present invention does not limit it.
示例性地,在逻辑栈304接收到任一处理器核302发送的资源请求后,可根据预设存储规则将该任一处理器核302的资源请求存储至逻辑栈304中。该预设存储规则为系统自定义设置的,用于确定资源请求在逻辑栈304中的存储位置和存储顺序等信息,例如该预设存储规则可为资源请求的接收时间顺序、或者资源请求传输的优先级顺序等等。Exemplarily, after the logic stack 304 receives the resource request sent by any processor core 302, the resource request of any processor core 302 can be stored in the logic stack 304 according to a preset storage rule. The preset storage rule is customized by the system and used to determine the storage location and storage sequence of resource requests in the logic stack 304. For example, the preset storage rule may be the time sequence of resource request reception, or resource request transmission The order of priority and so on.
举例来说,如图7示出一种逻辑栈304的具体存储示意图。如图7,以4个处理器核(CPU)发送一个资源请求为例,四个CPU分别为CPU1~CPU4。四个CPU发送资源请求的先后顺序依次为:CPU1、CPU3、CPU4以及CPU2。相应地,逻辑栈304可按照资源请求接收时间的先后顺序将四个CPU的资源请求存储至逻辑栈304中。示例性的,逻辑栈304先接收到CPU1的资源请求,并先将该CPU1的资源请求写入至逻辑栈304中存储;接着,接收到CPU3的资源请求,将该CPU3的资源请求写入至逻辑栈304中存储,依次类推,逻辑栈304最后接收到CPU2的资源请求,将该CPU2的资源请求最后写入至逻辑栈304中存储。For example, FIG. 7 shows a specific storage schematic diagram of a logic stack 304. As shown in Figure 7, taking 4 processor cores (CPUs) sending a resource request as an example, the four CPUs are CPU1 to CPU4. The order in which the four CPUs send resource requests is: CPU1, CPU3, CPU4, and CPU2. Correspondingly, the logic stack 304 can store the resource requests of the four CPUs in the logic stack 304 according to the sequence of the receiving time of the resource request. Exemplarily, the logic stack 304 first receives the resource request of CPU1, and first writes the resource request of CPU1 to the logic stack 304 for storage; then, receives the resource request of CPU3, and writes the resource request of CPU3 to Stored in the logic stack 304, and so on, the logic stack 304 finally receives the resource request of the CPU2, and finally writes the resource request of the CPU2 to the logic stack 304 for storage.
可选地,任一资源请求中携带有标识,该标识用于指示该任一资源请求所属的处理器核,即发送该任一资源请求的处理器核。在逻辑栈304接收任一个资源请求之后,可通过解析该资源请求获得该资源请求中携带的标识。进而根据该资源请求携带的标识,决定是否将该资源请求存入逻辑栈304中。具体的,当逻辑栈304的存储容量支持存储m个资源请求时,则逻辑栈304识别资源请求中携带的标识后,只允许具备该标识的一个资源请求存入该逻辑栈304中。如果逻辑栈304中已存储有该标识的一个资源请求,则此时可直接丢弃该接收的资源请求,向该资源请求所属的处理器核发送异常消息,以通知逻辑栈304当前无法存储或处理该资源请求。如果逻辑栈304中未存储该标识的任何资源请求,则可将接收的资源请求存入逻辑栈304中。Optionally, any resource request carries an identifier, and the identifier is used to indicate the processor core to which the any resource request belongs, that is, the processor core that sends the any resource request. After the logic stack 304 receives any resource request, it can obtain the identifier carried in the resource request by parsing the resource request. Then, according to the identifier carried in the resource request, it is determined whether to store the resource request in the logic stack 304. Specifically, when the storage capacity of the logic stack 304 supports the storage of m resource requests, after the logic stack 304 identifies the identifier carried in the resource request, only one resource request with the identifier is allowed to be stored in the logic stack 304. If a resource request with the identifier is already stored in the logic stack 304, the received resource request can be directly discarded at this time, and an exception message is sent to the processor core to which the resource request belongs to notify the logic stack 304 that it cannot currently store or process The resource request. If no resource request with the identifier is stored in the logic stack 304, the received resource request may be stored in the logic stack 304.
当逻辑栈304的存储容量支持存储n个资源请求时,n大于m,则逻辑栈304可依据自身存储容量来决定是否存储接收的资源请求,例如逻辑栈304中当前还存在剩余存储容量足以支持存储该接收的资源请求,则可将该接收的资源请求存入该逻辑栈304中。此情况下,逻辑栈304中支持存储有某个处理器核(例如第一处理器核)的至少两个资源请求,该第一处理器核为m个处理器核中的任一个处理器核。When the storage capacity of the logic stack 304 supports the storage of n resource requests, and n is greater than m, the logic stack 304 can determine whether to store the received resource request according to its own storage capacity. For example, there is currently a remaining storage capacity in the logic stack 304 that is sufficient to support By storing the received resource request, the received resource request can be stored in the logic stack 304. In this case, the logic stack 304 supports storing at least two resource requests of a certain processor core (for example, the first processor core), and the first processor core is any one of the m processor cores. .
步骤S606、在目标资源请求从逻辑栈304出栈后,资源分配逻辑电路306为该目标资源请求分配目标逻辑资源。其中,在一个工作时钟周期内只为一个资源请求分配逻辑资源,该目标资源请求是指位于逻辑栈304中具有最高优先级的资源请求。Step S606: After the target resource request is popped from the logic stack 304, the resource allocation logic circuit 306 allocates the target logic resource for the target resource request. Wherein, logic resources are allocated to only one resource request in one working clock cycle, and the target resource request refers to the resource request with the highest priority in the logic stack 304.
本申请中,逻辑栈304将接收的任一资源请求存入本逻辑栈304后,可根据预设机制对该逻辑栈304中的资源请求进行处理。该预设机制可为系统自定义设置的,例如FIFO机制,在每个工作时钟周期内该逻辑栈304支持一个资源请求的入栈存储和出栈处理。本申请这里以逻辑栈304中的目标资源请求为例进行相关内容的阐述,该目标资源请求可为逻辑栈304中具备最高优先级的资源请求。具体的,当目标资源请求从逻辑栈304中出栈时,资源分配逻辑电路306可为该目标资源请求分配目标逻辑资源,以供发送该目标资源请求的目标处理器核使用。In this application, after the logic stack 304 stores any received resource request into the logic stack 304, the resource request in the logic stack 304 can be processed according to a preset mechanism. The preset mechanism can be self-defined by the system, such as a FIFO mechanism. The logic stack 304 supports the in-stack storage and out-stack processing of a resource request in each working clock cycle. In this application, the target resource request in the logic stack 304 is taken as an example to describe the related content. The target resource request may be the resource request with the highest priority in the logic stack 304. Specifically, when the target resource request is popped from the logic stack 304, the resource allocation logic circuit 306 may allocate the target logic resource to the target resource request for use by the target processor core that sends the target resource request.
具体实现中,逻辑栈304根据预设规则,可对目标资源请求进行出栈处理,以将该目标资源请求发送给资源分配逻辑电路306处理。相应地,资源分配逻辑电路306接收该目标资源请求后,可响应该目标资源请求查询是否有供目标处理器核使用的空闲资源,具体的资源分配逻辑电路306可从k个资源310中查询是否存在有空闲资源,该空闲资源是指未被使用或者未被抢占的资源。如果存在有空闲资源,则资源分配逻辑电路306可将该空闲资源作为目标逻辑资源,分配给目标处理器核。In a specific implementation, the logic stack 304 may perform popping processing on the target resource request according to a preset rule, so as to send the target resource request to the resource allocation logic circuit 306 for processing. Correspondingly, after the resource allocation logic circuit 306 receives the target resource request, it can respond to the target resource request to query whether there are free resources for the target processor core. The specific resource allocation logic circuit 306 can query whether there are k resources 310 There are idle resources, and the idle resources refer to resources that are not used or preempted. If there is an idle resource, the resource allocation logic circuit 306 may use the idle resource as a target logic resource and allocate it to the target processor core.
可选地,本申请中涉及的资源可以是指满足不同通信业务需求的资源。资源分配逻辑电路306接收目标资源请求后,需根据目标处理器核的实际业务需求为该目标处理器核分配相应地目标逻辑资源。示例性地,该目标资源请求中携带有目标处理器核的属性信息,该属性信息为用于描述目标处理器核属性的信息,其可包括但不限于服务质量QOS指标、QOS服务等级、COS服务等级、标识以及业务类型等信息。资源分配逻辑电路306接收目标资源请求后,可响应该目标资源请求,查询是否存在有与该目标处理器核的属性信息相匹配的空闲资源。如果存在,资源分配逻辑电路306可将该空闲资源作为目标逻辑资源,分配给目标处理器核使用。如果不存在,则资源分配逻辑电路306可结束流程;或者,向目标处理器核发送通知消息,该通知消息用于通知资源分配逻辑电路306当前无法为目标处理器核分配目标逻辑资源,无可用的空闲资源。Optionally, the resources involved in this application may refer to resources that meet the requirements of different communication services. After the resource allocation logic circuit 306 receives the target resource request, it needs to allocate corresponding target logic resources to the target processor core according to the actual business requirements of the target processor core. Exemplarily, the target resource request carries attribute information of the target processor core, and the attribute information is information used to describe the attributes of the target processor core, which may include, but is not limited to, quality of service QOS indicators, QOS service levels, COS Information such as service level, identification, and business type. After receiving the target resource request, the resource allocation logic circuit 306 can respond to the target resource request and query whether there is an idle resource that matches the attribute information of the target processor core. If it exists, the resource allocation logic circuit 306 may use the idle resource as a target logic resource and allocate it to the target processor core for use. If it does not exist, the resource allocation logic circuit 306 can end the process; or, send a notification message to the target processor core, the notification message is used to notify the resource allocation logic circuit 306 that the target processor core cannot currently allocate the target logic resource, and there is no available Free resources.
举例来说,以目标处理器核的属性信息为网络时延100ms为例。资源分配逻辑电路306接收目标处理器核发送的资源请求后,该目标处理器核的资源请求中携带有网络时延100ms。资源分配逻辑电路306可响应该资源请求,查询当前是否存在有支持处理通信业务的网络时延100ms内的空闲资源,如果存在,则将该空闲资源分配给目标处理器核使用,即将该空闲资源作为资源分配逻辑电路306分配给目标处理器核使用的目标逻辑资源。For example, take the attribute information of the target processor core as a network delay of 100 ms as an example. After the resource allocation logic circuit 306 receives the resource request sent by the target processor core, the resource request of the target processor core carries a network delay of 100 ms. The resource allocation logic circuit 306 can respond to the resource request and query whether there is an idle resource within 100ms of the network delay that supports the processing of the communication service. If it exists, the idle resource is allocated to the target processor core for use, that is, the idle resource As the resource allocation logic circuit 306, the target logic resource allocated to the target processor core is used.
可选地,资源分配逻辑电路306在响应该目标资源请求后,可向目标处理器核发送资源响应,该资源响应可用于通知是否已成功为目标处理器核抢占或分配目标逻辑资源。Optionally, the resource allocation logic circuit 306 may send a resource response to the target processor core after responding to the target resource request, and the resource response may be used to notify whether the target logic resource has been successfully preempted or allocated for the target processor core.
步骤S608、资源分配逻辑电路306根据目标资源请求,自动抢占目标逻辑资源对应的目标保护锁,其中,目标处理器核基于该目标保护锁访问目标逻辑资源,该目标处理器核是指发送目标资源请求的处理器核。Step S608: The resource allocation logic circuit 306 automatically preempts the target protection lock corresponding to the target logic resource according to the target resource request, wherein the target processor core accesses the target logic resource based on the target protection lock, and the target processor core refers to sending the target resource The requested processor core.
步骤S610、资源分配逻辑电路306通过中断响应将抢锁结果上报给目标处理器核,其中抢锁结果用于指示成功抢占到目标保护锁。Step S610: The resource allocation logic circuit 306 reports the lock grab result to the target processor core through an interrupt response, where the lock grab result is used to indicate that the target protection lock is successfully seized.
为提升资源获取的处理效率,资源分配逻辑电路306在为目标处理器核分配目标逻辑资源后,还可自动抢占该目标逻辑资源对应的目标保护锁,便于目标处理器核基于该目标保护锁访问该目标逻辑资源,进而使用该目标逻辑资源。进一步地,资源分配逻辑电路306可通过中断响应将抢锁结果上报给目标处理器核,该抢锁结果用于指示以成功抢占到目标保护锁。In order to improve the processing efficiency of resource acquisition, the resource allocation logic circuit 306 can also automatically preempt the target protection lock corresponding to the target logic resource after assigning the target logic resource to the target processor core, so that the target processor core can access based on the target protection lock The target logic resource, and then use the target logic resource. Further, the resource allocation logic circuit 306 may report the lock grab result to the target processor core through an interrupt response, and the lock grab result is used to indicate that the target protection lock is successfully seized.
步骤S612、目标处理器核接收该抢锁结果,根据该抢锁结果获得目标保护锁,以基于该目标保护锁访问并使用目标逻辑资源。Step S612: The target processor core receives the lock grab result, and obtains the target protection lock according to the lock grab result, so as to access and use the target logical resource based on the target protection lock.
目标处理器核接收资源分配逻辑电路306上报的抢锁结果,进一步可基于该抢锁结果从预设寄存器中读取该抢锁结果所指示的目标保护锁,进而基于该目标保护锁来访问目标逻辑资源,以使用该目标逻辑资源。换句话说,目标处理器核接收抢锁结果后,可直接利用目标保护锁来访问并使用目标逻辑资源,无需再同传统技术一样还需通过目标处理器核(例如CPU)配置抢占保护锁的命令,以抢占保护锁。相比于传统技术,其能大大简化资源获取的流程,节省时间,减少CPU的占用,提升CPU的利用率。The target processor core receives the lock grab result reported by the resource allocation logic circuit 306, and can further read the target protection lock indicated by the lock grab result from a preset register based on the lock grab result, and then access the target based on the target protection lock Logical resource to use the target logical resource. In other words, after the target processor core receives the lock preemption result, it can directly use the target protection lock to access and use the target logical resources. It is no longer necessary to configure the preemption protection lock through the target processor core (such as CPU) as in the traditional technology. Command to preempt the protection lock. Compared with traditional technology, it can greatly simplify the process of resource acquisition, save time, reduce CPU usage, and improve CPU utilization.
可选地,在目标处理器核使用目标逻辑资源的过程中,目标处理器核可对该目标逻辑资源的状态进行更新,例如将该目标逻辑资源的状态更新为占用,表示该目标逻辑资源当前正在被使用,处于占用状态。当目标处理器核使用完该目标逻辑资源后,可释放该目标逻辑资源,进而将该目标处理器的状态更新为空闲,表示该目标逻辑资源未被使用,处于空闲状态。Optionally, when the target processor core uses the target logical resource, the target processor core may update the status of the target logical resource. For example, update the status of the target logical resource to occupied, indicating that the target logical resource is currently Is being used, in an occupied state. After the target processor core has used the target logical resource, the target logical resource can be released, and then the state of the target processor is updated to idle, which means that the target logical resource is not used and is in an idle state.
考虑到资源请求撤回的应用场景,例如误操作、或临时不为主机设备请求空闲资源等场景,本申请提出另一种资源获取方法的流程。请参见图8所述的资源获取方法可包括如下实施步骤:Considering the application scenarios of resource request withdrawal, such as misoperation, or temporarily not requesting idle resources for the host device, etc., this application proposes another resource acquisition method process. The resource acquisition method described in FIG. 8 may include the following implementation steps:
步骤S802、处理器核302向逻辑栈304发送针对第一资源请求的撤销命令,该第一资源请求为至少一个资源请求中的任一资源请求。相应地,逻辑栈304接收针对第一资源请求的撤销命令。Step S802: The processor core 302 sends a cancel command for the first resource request to the logic stack 304, where the first resource request is any resource request in at least one resource request. Correspondingly, the logic stack 304 receives the cancel command for the first resource request.
本申请中,当m个处理器核中的任一处理器核发送相应地资源请求后,如果该任一处理器核不想再为该任一处理器核申请逻辑资源时,则该任一处理器核可向逻辑栈304发送撤销命令,该撤销命令用于请求撤销该任一处理器核的资源请求,即撤回逻辑栈304对该任一处理器核的资源请求的处理。本申请这里以第一资源请求为例进行相关内容的详述。具体的,该第一资源请求所属的处理器核302在发送第一资源请求后,由于特殊原因想临时撤销该第一资源请求的处理,为实现第一资源请求的临时撤销,本发明在逻辑栈304中新增了插队出栈机制,该插队出栈机制只能由针对该第一资源请求的撤销命令发起。例如,第一资源请求所属的处理器核302想撤销第一资源请求时,可向逻辑栈304发送针对该第一资源请求的撤销命令。相应地,逻辑栈304可接收该撤销命令,该第一资源请求可为m个处理器核发送的至少一个资源请求中的任一个资源请求。根据撤销命令删除撤销命令对应的资源请求,可以无视资源请求在逻辑栈中的存储顺序,插队出栈。In this application, after any one of the m processor cores sends a corresponding resource request, if any one of the processor cores does not want to apply for logic resources for any one of the processor cores, then any one of the processor cores will be processed The processor core may send a revocation command to the logic stack 304, and the revocation command is used to request the revocation of the resource request of any processor core, that is, the processing of the logic stack 304 on the resource request of any processor core is withdrawn. This application uses the first resource request as an example to describe the relevant content. Specifically, after sending the first resource request, the processor core 302 to which the first resource request belongs wants to temporarily cancel the processing of the first resource request due to special reasons. In order to realize the temporary cancellation of the first resource request, the present invention is logically The stack 304 has a newly added queue-insertion and de-stack mechanism, which can only be initiated by the cancel command for the first resource request. For example, when the processor core 302 to which the first resource request belongs wants to cancel the first resource request, it can send a cancel command for the first resource request to the logic stack 304. Correspondingly, the logic stack 304 can receive the cancel command, and the first resource request can be any one of the at least one resource request sent by the m processor cores. The resource request corresponding to the cancel command can be deleted according to the cancel command, and the storage order of the resource request in the logical stack can be ignored, and the queue can be removed from the stack.
步骤S804、逻辑栈304根据该撤销命令,对逻辑栈304中存储的第一资源请求进行插队出栈处理,以删除该第一资源请求。Step S804: According to the cancel command, the logic stack 304 performs queue insertion and ejection processing on the first resource request stored in the logic stack 304 to delete the first resource request.
步骤S806、资源分配逻辑电路306在删除第一资源请求后,可通过中断响应将撤销结 果上报给第一资源请求所对应的处理器核302。其中,撤销结果用于指示逻辑栈304已完成第一资源请求的撤销。Step S806: After deleting the first resource request, the resource allocation logic circuit 306 may report the cancellation result to the processor core 302 corresponding to the first resource request through an interrupt response. The cancellation result is used to indicate that the logic stack 304 has completed the cancellation of the first resource request.
逻辑栈304接收该撤销命令后,可响应该撤销命令,对逻辑栈304中存储的第一资源请求进行插队出栈,以从逻辑栈304中删除该第一资源请求,以不再对该第一资源请求进行逻辑资源的分配处理。可选地,在删除第一资源请求后,资源分配逻辑电路306可通过中断响应将撤销结果上报给第一资源请求所属的处理器核,其中该撤销结果用于指示逻辑栈304已成功完成该第一资源请求的撤销。After the logic stack 304 receives the cancel command, it can respond to the cancel command to insert and pop the first resource request stored in the logic stack 304 to delete the first resource request from the logic stack 304, so that the first resource request is no longer A resource request for logical resource allocation processing. Optionally, after deleting the first resource request, the resource allocation logic circuit 306 can report the cancellation result to the processor core to which the first resource request belongs through an interrupt response, where the cancellation result is used to indicate that the logic stack 304 has successfully completed the Cancellation of the first resource request.
举例来说,引用图7所述示例,假设CPU3发送该CPU3的资源请求后,想临时撤回该CPU3的资源请求。则CPU3可向逻辑栈304发送CPU3的撤销命令,该撤销命令用于请求撤销CPU3的资源请求,逻辑栈304不在处理该CPU3的资源请求。相应地,逻辑栈304接收该CPU3的撤销命令后,需对逻辑栈304中存储的4个CPU各自的资源请求进行更新,以对CPU3的资源请求进行插队出栈,删除并撤回该CPU3的资源请求,具体可参见图9示出了逻辑栈304插队出栈的示意图。For example, referring to the example described in FIG. 7, suppose that after the CPU3 sends the resource request of the CPU3, it wants to temporarily withdraw the resource request of the CPU3. Then, the CPU3 can send the cancel command of the CPU3 to the logic stack 304, and the cancel command is used to request to cancel the resource request of the CPU3, and the logic stack 304 is not processing the resource request of the CPU3. Correspondingly, after the logic stack 304 receives the cancel command of the CPU3, it needs to update the respective resource requests of the four CPUs stored in the logic stack 304, so that the resource request of CPU3 can be inserted and removed from the stack, and the resources of the CPU3 are deleted and withdrawn. For details of the request, refer to FIG. 9 showing a schematic diagram of the logic stack 304 being inserted from the queue.
通过实施本发明实施例,能够解决传统技术中多CPU通过多线程抢占资源过程中所存在的某一CPU很难抢占资源,从而影响该CPU正常的业务通信和业务性能等问题。本发明采用逻辑栈可对栈中每个CPU的资源请求进行一一处理,以保证CPU抢占资源的公平性和合理性,避免传统技术中存在某些CPU很难抢占资源等问题。By implementing the embodiments of the present invention, it is possible to solve the problem that a certain CPU that exists in the process of multi-CPU preempting resources through multi-threading in the traditional technology is difficult to preempt resources, thereby affecting the normal business communication and business performance of the CPU. The present invention adopts a logic stack to process the resource requests of each CPU in the stack one by one to ensure the fairness and rationality of the CPU's preemption of resources, and avoid the problems that some CPUs are difficult to preempt resources in the traditional technology.
结合图1-图9所述实施例中的相关阐述,下面介绍本发明涉及的相关装置和系统。请参见图10,是本发明实施例提供的一种通信装置1000的结构示意图。如图10所示的通信装置1000包括逻辑栈1004和资源分配逻辑电路1006。可选地,该通信装置还可包括处理器核1002,该处理器核1002的数量并不做限定,其可为一个或多个。其中:With reference to the relevant explanations in the embodiments described in Figs. 1-9, the relevant devices and systems involved in the present invention are described below. Refer to FIG. 10, which is a schematic structural diagram of a communication device 1000 according to an embodiment of the present invention. The communication device 1000 shown in FIG. 10 includes a logic stack 1004 and a resource allocation logic circuit 1006. Optionally, the communication device may further include a processor core 1002, the number of the processor core 1002 is not limited, and there may be one or more. among them:
所述逻辑栈1004,用于接收至少一个资源请求,并将所述至少一个资源请求存储到所述逻辑栈1004,其中每一资源请求为一处理器核1002发送的,且所述资源请求与所述处理器核之间是一一对应的,所述资源请求用于为对应的处理器核请求逻辑资源;The logic stack 1004 is configured to receive at least one resource request and store the at least one resource request in the logic stack 1004, wherein each resource request is sent by a processor core 1002, and the resource request and There is a one-to-one correspondence between the processor cores, and the resource request is used to request logical resources for the corresponding processor cores;
所述资源分配逻辑电路1006,用于为目标资源请求分配目标逻辑资源,且在一个工作时钟周期内只为一个资源请求分配逻辑资源,其中所述目标资源请求是指位于所述逻辑栈1004内且具有最高优先级的资源请求。The resource allocation logic circuit 1006 is configured to allocate a target logic resource to a target resource request, and allocate logic resources to only one resource request within a working clock cycle, wherein the target resource request refers to being located in the logic stack 1004 And has the highest priority resource request.
在一些可能的实施例中,所述资源分配逻辑电路1006具体用于在接收到所述目标资源请求之后,查询是否有供目标处理器核使用的空闲资源;在查询到有空闲资源时,将所述空闲资源作为所述目标逻辑资源分配给目标处理器核,所述目标处理器核是指发送所述目标资源请求的处理器核。In some possible embodiments, the resource allocation logic circuit 1006 is specifically configured to query whether there are idle resources for the target processor core after receiving the target resource request; when the idle resources are inquired, the The idle resource is allocated to a target processor core as the target logical resource, and the target processor core refers to a processor core that sends the target resource request.
在一些可能的实施例中,所述资源分配逻辑电路1006在将所述空闲资源作为所述目标逻辑资源分配给目标处理器核之后,所述资源分配逻辑电路1006还用于根据所述目标资源请求自动抢占所述目标逻辑资源对应的目标保护锁,其中所述目标处理器核基于所述目标保护锁访问所述目标逻辑资源;通过中断响应将抢锁结果上报给所述目标处理器核,其中所述抢锁结果用于指示已成功抢占到所述目标保护锁。In some possible embodiments, after the resource allocation logic circuit 1006 allocates the idle resource as the target logic resource to the target processor core, the resource allocation logic circuit 1006 is further configured to Request to automatically preempt the target protection lock corresponding to the target logic resource, wherein the target processor core accesses the target logic resource based on the target protection lock; and report the lock grab result to the target processor core through an interrupt response, The lock preemption result is used to indicate that the target protection lock has been successfully preempted.
在一些可能的实施例中,所述每一资源请求携带有标识,所述标识用于指示对应的资 源请求所属的处理器核,所述逻辑栈1004还用于在接收到一个资源请求之后,确定所述资源请求中携带的标识;根据所述资源请求携带的标识,确定是否将所述资源请求存入所述逻辑栈。In some possible embodiments, each resource request carries an identifier, and the identifier is used to indicate the processor core to which the corresponding resource request belongs, and the logic stack 1004 is also used to, after receiving a resource request, Determine the identifier carried in the resource request; determine whether to store the resource request in the logic stack according to the identifier carried in the resource request.
在一些可能的实施例中,所述逻辑栈1004的存储容量支持存储n个资源请求,所述处理器核的总数量为m、且n=m,则所述逻辑栈1004只允许所述m个处理器核中每一处理器核的一个资源请求存入所述逻辑栈1004。In some possible embodiments, the storage capacity of the logical stack 1004 supports storage of n resource requests, and the total number of processor cores is m, and n=m, then the logical stack 1004 only allows the m One resource request of each processor core in the two processor cores is stored in the logic stack 1004.
在一些可能的实施例中,所述逻辑栈1004的存储容量支持存储m个资源请求,且所述处理器核的总数量为m,则所述逻辑栈1004只允许具备相同标识的多个资源请求中的一个资源请求存入所述逻辑栈。In some possible embodiments, the storage capacity of the logic stack 1004 supports storage of m resource requests, and the total number of the processor cores is m, then the logic stack 1004 only allows multiple resources with the same identifier A resource request in the request is stored in the logic stack.
在一些可能的实施例中,所述逻辑栈1004的存储容量支持存储n个资源请求,所述处理器核的总数量为m、且n大于m,则所述逻辑栈1004允许第一处理器核的至少两个资源请求存入所述逻辑栈,所述第一处理器核为所述m个处理器核中的任一个。In some possible embodiments, the storage capacity of the logical stack 1004 supports storage of n resource requests, and the total number of processor cores is m and n is greater than m, then the logical stack 1004 allows the first processor At least two resource requests of the cores are stored in the logic stack, and the first processor core is any one of the m processor cores.
在一些可能的实施例中,所述逻辑栈1004为先进先出单元FIFO逻辑栈。In some possible embodiments, the logic stack 1004 is a first-in first-out unit FIFO logic stack.
在一些可能的实施例中,所述资源分配逻辑电路1006独立于所述处理器核1002。In some possible embodiments, the resource allocation logic circuit 1006 is independent of the processor core 1002.
在一些可能的实施例中,所述处理器核1002部署于所述通信装置1000中。In some possible embodiments, the processor core 1002 is deployed in the communication device 1000.
在一些可能的实施例中,所述逻辑栈1004还用于接收针对第一资源请求的撤销命令,所述第一资源请求为所述至少一个资源请求中的任一个;根据所述撤销命令,删除所述逻辑栈中存储的所述第一资源请求。In some possible embodiments, the logic stack 1004 is further configured to receive a cancel command for a first resource request, where the first resource request is any one of the at least one resource request; according to the cancel command, Deleting the first resource request stored in the logic stack.
在一些可能的实施例中,在删除所述第一资源请求之后,所述资源分配逻辑电路1006还用于通过中断响应将撤销结果上报给所述第一资源请求所对应的处理器核,其中所述撤销结果用于指示所述逻辑栈已完成所述第一资源请求的撤销。In some possible embodiments, after deleting the first resource request, the resource allocation logic circuit 1006 is further configured to report the cancellation result to the processor core corresponding to the first resource request through an interrupt response, where The cancellation result is used to indicate that the logic stack has completed the cancellation of the first resource request.
在实际应用中,本发明实施例中通信装置涉及的各部件具体可通过硬件实现,例如其可通过专用集成电路(application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合实现,本发明不做限定。In practical applications, each component involved in the communication device in the embodiment of the present invention can be implemented by hardware, for example, it can be implemented by an application-specific integrated circuit (ASIC), or a programmable logic device (programmable logic device, PLD), the above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof Implementation is not limited in the present invention.
需要说明的,图10仅仅是本申请实施例的一种可能的实现方式,实际应用中,通信装置还可以包括更多或更少的部件,这里不作限制。关于本发明实施例中未示出或未描述的内容,可参见前述方法实施例中的相关阐述,这里不再赘述。It should be noted that FIG. 10 is only a possible implementation of the embodiment of the present application. In actual applications, the communication device may also include more or fewer components, which is not limited here. Regarding the content not shown or described in the embodiment of the present invention, reference may be made to the relevant description in the foregoing method embodiment, which is not repeated here.
通过实施本发明实施例,能够解决传统技术中存在的某一CPU很难抢占资源,从而影响该CPU正常的业务通信和业务性能等问题。By implementing the embodiments of the present invention, it is possible to solve the problem that a certain CPU in the traditional technology is difficult to seize resources, thereby affecting the normal business communication and business performance of the CPU.
请参见图11,是本发明实施例提供的一种通信设备的结构示意图。如图11所示的通信设备110包括一个或多个处理器1101、通信接口1102和存储器1103。其中,处理器1101中部署有逻辑栈、资源分配逻辑电路。可选地,该处理器1101中还可部署有m个处理器核中的任一个或多个处理器核(图未示),在实际应用中该处理器核也可部署在处理器1101外部,并不做限定。其中,处理器1101、通信接口1102和存储器1103可通过总线方式连接,也可通过无线传输等其他手段实现通信。本发明实施例以通过总线1104连接为例其中, 该存储器1103用于存储指令,该处理器1101用于执行该存储器1103存储的指令。该存储器1103存储程序代码,且处理器1101可以调用存储器1103中存储的程序代码以实现图1-图9中所示方法实施例中的实施步骤,和/或文本中描述的其他内容,本发明这里不做赘述。Refer to FIG. 11, which is a schematic structural diagram of a communication device according to an embodiment of the present invention. The communication device 110 shown in FIG. 11 includes one or more processors 1101, a communication interface 1102, and a memory 1103. Among them, a logic stack and a resource allocation logic circuit are deployed in the processor 1101. Optionally, any one or more of the m processor cores (not shown) may be deployed in the processor 1101, and the processor core may also be deployed outside the processor 1101 in actual applications , Is not limited. Among them, the processor 1101, the communication interface 1102, and the memory 1103 may be connected via a bus, or communication may be achieved by other means such as wireless transmission. The embodiment of the present invention takes the connection via the bus 1104 as an example, where the memory 1103 is used to store instructions, and the processor 1101 is used to execute instructions stored in the memory 1103. The memory 1103 stores program codes, and the processor 1101 can call the program codes stored in the memory 1103 to implement the implementation steps in the method embodiments shown in FIGS. 1 to 9 and/or other content described in the text. I won’t go into details here.
可选地,处理器1101可以由一个或多个通用处理器构成,例如控制器、中央处理器(central processing unit,CPU)。处理器1101通过调用部署的相关硬件,用于运行相关的程序代码以实现图1-图9中所示实施例中的相关阐述,这里不在赘述。Optionally, the processor 1101 may be composed of one or more general-purpose processors, such as a controller and a central processing unit (CPU). The processor 1101 is configured to run related program codes by calling the deployed related hardware to implement the related descriptions in the embodiments shown in FIG. 1 to FIG. 9, which will not be repeated here.
应理解的,通信接口1102可以为有线接口(例如以太网接口)或无线接口(例如无线局域网(wireless fidelity,WiFi)接口),用于与其他模块或装置设备进行通信。例如,本申请实施例中通信接口1102具体可用于接收处理器核发送的资源请求等。It should be understood that the communication interface 1102 may be a wired interface (for example, an Ethernet interface) or a wireless interface (for example, a wireless fidelity (WiFi) interface), which is used to communicate with other modules or devices. For example, the communication interface 1102 in the embodiment of the present application may be specifically used to receive a resource request sent by a processor core.
存储器1103可以包括易失性存储器(Volatile Memory),例如随机存取存储器(Random Access Memory,RAM);存储器也可以包括非易失性存储器(Non-Volatile Memory),例如只读存储器(Read-Only Memory,ROM)、快闪存储器(Flash Memory)、硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);存储器1103还可以包括上述种类的存储器的组合。存储器可用于存储一组程序代码,以便于处理器调用存储器中存储的程序代码以实现本发明实施例中涉及的相关步骤。The memory 1103 may include volatile memory (Volatile Memory), such as random access memory (Random Access Memory, RAM); the memory may also include non-volatile memory (Non-Volatile Memory), such as read-only memory (Read-Only Memory). Memory, ROM, Flash Memory, Hard Disk Drive (HDD), or Solid-State Drive (SSD); the memory 1103 may also include a combination of the foregoing types of memories. The memory may be used to store a group of program codes, so that the processor can call the program codes stored in the memory to implement relevant steps involved in the embodiments of the present invention.
需要说明的,图11仅仅是本申请实施例的一种可能的实现方式,实际应用中,通信设备还可以包括更多或更少的部件,这里不作限制。关于本发明实施例中未示出或未描述的内容,可参见前述方法实施例中的相关阐述,这里不再赘述。It should be noted that FIG. 11 is only a possible implementation of the embodiment of the present application. In actual applications, the communication device may also include more or fewer components, which is not limited here. Regarding the content not shown or described in the embodiment of the present invention, reference may be made to the relevant description in the foregoing method embodiment, which is not repeated here.
本发明实施例还提供一种通信系统,该系统包括m个处理器核、逻辑栈和资源分配逻辑电路。可选地,还可包括保护锁和资源。其中,当该处理器核部署在主机设备中,逻辑栈、资源分配逻辑电路、保护锁和资源部署在从机设备中时,该通信系统具体可包括m个主机设备和从机设备。关于通信系统的相关阐述,具体可参见图1所述实施例中的相关阐述,这里不在赘述。The embodiment of the present invention also provides a communication system, which includes m processor cores, a logic stack, and a resource allocation logic circuit. Optionally, it may also include protection locks and resources. Wherein, when the processor core is deployed in the host device, and the logic stack, resource allocation logic circuit, protection lock, and resources are deployed in the slave device, the communication system may specifically include m host devices and slave devices. Regarding the relevant description of the communication system, please refer to the relevant description in the embodiment of FIG. 1 for details, which will not be repeated here.
本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在通信装置上运行时,图6或图8实施例中所示的方法流程得以实现。The embodiment of the present invention also provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, and when it runs on a communication device, the method flow shown in the embodiment of FIG. 6 or FIG. 8 can be realized .
本发明实施例还提供一种计算机程序产品,当所述计算机程序产品在通信装置上运行时,图6或图8实施例中所示的方法流程得以实现。The embodiment of the present invention also provides a computer program product. When the computer program product runs on a communication device, the method flow shown in the embodiment of FIG. 6 or FIG. 8 is realized.
结合本发明实施例公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(英文:Random Access Memory,RAM)、闪存、只读存储器(英文:Read Only Memory,ROM)、可擦除可编程只读存储器(英文:Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(英文:Electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于通信装置中。当然,处理器和存储介质也可以作为分立组件存在于通信装置中。The steps of the method or algorithm described in combination with the disclosure of the embodiments of the present invention may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions. Software instructions can be composed of corresponding software modules, which can be stored in random access memory (English: Random Access Memory, RAM), flash memory, read-only memory (English: Read Only Memory, ROM), erasable and programmable Read-only memory (English: Erasable Programmable ROM, EPROM), electrically erasable programmable read-only memory (English: EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM, or well-known in the art Any other form of storage medium. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in the ASIC. In addition, the ASIC may be located in the communication device. Of course, the processor and the storage medium may also exist as separate components in the communication device.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过 计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through a computer program. The program can be stored in a computer readable storage medium. When executed, it may include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM, RAM, magnetic disks or optical disks and other media that can store program codes.

Claims (22)

  1. 一种资源获取方法,其特征在于,所述方法包括:A resource acquisition method, characterized in that the method includes:
    接收至少一个资源请求,并将所述至少一个资源请求存储到逻辑栈,每一资源请求为一个处理器核发送的,且所述资源请求与所述处理器核之间是一一对应的,所述资源请求用于为对应的处理器核请求逻辑资源;Receiving at least one resource request, and storing the at least one resource request in the logic stack, each resource request is sent by a processor core, and there is a one-to-one correspondence between the resource request and the processor core, The resource request is used to request logic resources for the corresponding processor core;
    为目标资源请求分配目标逻辑资源,且在一个工作时钟周期内只为一个资源请求分配逻辑资源,其中,所述目标资源请求是指位于所述逻辑栈内且具有最高优先级的资源请求。A target logical resource is allocated to a target resource request, and logical resources are allocated to only one resource request within a working clock cycle, where the target resource request refers to a resource request with the highest priority located in the logical stack.
  2. 根据权利要求1所述的方法,其特征在于,所述为目标资源请求分配逻辑资源,包括:The method according to claim 1, wherein the allocating logical resources for the target resource request comprises:
    在接收到所述目标资源请求之后,查询是否有供目标处理器核使用的空闲资源;After receiving the target resource request, query whether there are free resources for the target processor core;
    在查询到有空闲资源时,将所述空闲资源作为所述目标逻辑资源分配给所述目标处理器核,所述目标处理器核是指发送所述目标资源请求的处理器核。When an idle resource is inquired, the idle resource is allocated to the target processor core as the target logical resource, and the target processor core refers to the processor core that sends the target resource request.
  3. 根据权利要求2所述的方法,其特征在于,在将所述空闲资源作为所述目标逻辑资源分配给所述目标处理器核之后,所述方法还包括:The method according to claim 2, wherein after allocating the idle resource as the target logical resource to the target processor core, the method further comprises:
    根据所述目标资源请求自动抢占所述目标逻辑资源对应的目标保护锁,其中,所述目标处理器核基于所述目标保护锁访问所述目标逻辑资源;Automatically preempting the target protection lock corresponding to the target logic resource according to the target resource request, wherein the target processor core accesses the target logic resource based on the target protection lock;
    通过中断响应将抢锁结果上报给所述目标处理器核,其中所述抢锁结果用于指示已成功抢占到所述目标保护锁。The lock grab result is reported to the target processor core through an interrupt response, where the lock grab result is used to indicate that the target protection lock has been successfully seized.
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述每一资源请求携带有标识,所述标识用于指示对应的资源请求所属的处理器核,所述方法还包括:The method according to any one of claims 1-3, wherein each resource request carries an identifier, and the identifier is used to indicate the processor core to which the corresponding resource request belongs, and the method further comprises :
    在接收到一个资源请求之后,确定所述资源请求中携带的标识;After receiving a resource request, determine the identifier carried in the resource request;
    根据所述资源请求携带的标识,确定是否将所述资源请求存入所述逻辑栈。According to the identifier carried in the resource request, it is determined whether to store the resource request in the logic stack.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述逻辑栈的存储容量支持存储n个资源请求,所述处理器核的总数量为m、且n=m,则所述逻辑栈只允许所述m个处理器核中每个处理器核的一个资源请求存入所述逻辑栈。The method according to any one of claims 1 to 4, wherein the storage capacity of the logical stack supports storage of n resource requests, the total number of processor cores is m and n=m, then The logic stack allows only one resource request of each of the m processor cores to be stored in the logic stack.
  6. 根据权利要求4所述的方法,其特征在于,所述逻辑栈的存储容量支持存储m个资源请求,且所述处理器核的总数量为m,则所述逻辑栈只允许具有相同标识的多个资源请求中的一个资源请求存入所述逻辑栈。The method according to claim 4, wherein the storage capacity of the logical stack supports the storage of m resource requests, and the total number of the processor cores is m, then the logical stack only allows those with the same identifier One of the multiple resource requests is stored in the logic stack.
  7. 根据权利要求1-4中任一项所述的方法,其特征在于,所述逻辑栈的存储容量支持存储n个资源请求,所述处理器核的总数量为m、且n>m,则所述逻辑栈允许第一处理器核的至少两个资源请求存入所述逻辑栈,所述第一处理器核为所述m个处理器核中的任一个处理器核。The method according to any one of claims 1 to 4, wherein the storage capacity of the logical stack supports storage of n resource requests, and the total number of processor cores is m and n>m, then The logic stack allows at least two resource requests of the first processor core to be stored in the logic stack, and the first processor core is any one of the m processor cores.
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,所述逻辑栈为先进先出单元FIFO逻辑栈。The method according to any one of claims 1-7, wherein the logic stack is a first-in first-out unit FIFO logic stack.
  9. 根据权利要求1-8中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-8, wherein the method further comprises:
    接收针对第一资源请求的撤销命令,所述第一资源请求为所述至少一个资源请求中的任一个;Receiving a cancellation command for a first resource request, where the first resource request is any one of the at least one resource request;
    根据所述撤销命令,删除所述逻辑栈中存储的所述第一资源请求。According to the cancel command, the first resource request stored in the logic stack is deleted.
  10. 根据权利要求9所述的方法,其特征在于,所述在删除所述第一资源请求之后,所述方法还包括:The method according to claim 9, characterized in that, after deleting the first resource request, the method further comprises:
    通过中断响应将撤销结果上报给所述第一资源请求所对应的处理器核,其中所述撤销结果用于指示所述逻辑栈已完成所述第一资源请求的撤销。The cancellation result is reported to the processor core corresponding to the first resource request through an interrupt response, where the cancellation result is used to indicate that the logic stack has completed the cancellation of the first resource request.
  11. 一种通信装置,其特征在于,包括逻辑栈和资源分配逻辑电路,其中,A communication device, which is characterized by comprising a logic stack and a resource allocation logic circuit, wherein:
    所述逻辑栈,用于接收至少一个资源请求,并将所述至少一个资源请求存储到所述逻辑栈,其中每一资源请求为一处理器核发送的,且所述资源请求与所述处理器核之间是一一对应的,所述资源请求用于为对应的处理器核请求逻辑资源;The logic stack is configured to receive at least one resource request and store the at least one resource request in the logic stack, wherein each resource request is sent by a processor core, and the resource request and the processing There is a one-to-one correspondence between the processor cores, and the resource request is used to request logical resources for the corresponding processor core;
    所述资源分配逻辑电路,用于为目标资源请求分配目标逻辑资源,且在一个工作时钟周期内只为一个资源请求分配逻辑资源,其中所述目标资源请求是指位于所述逻辑栈内且具有最高优先级的资源请求。The resource allocation logic circuit is used to allocate a target logic resource for a target resource request, and allocate logic resources for only one resource request within a working clock cycle, wherein the target resource request refers to the logic stack and has The highest priority resource request.
  12. 根据权利要求11所述的装置,其特征在于,所述资源分配逻辑电路具体用于:The device according to claim 11, wherein the resource allocation logic circuit is specifically configured to:
    在接收到所述目标资源请求之后,查询是否有供目标处理器核使用的空闲资源;After receiving the target resource request, query whether there are free resources for the target processor core;
    在查询到有空闲资源时,将所述空闲资源作为所述目标逻辑资源分配给目标处理器核,所述目标处理器核是指发送所述目标资源请求的处理器核。When an idle resource is found, the idle resource is allocated to a target processor core as the target logical resource, and the target processor core refers to the processor core that sends the target resource request.
  13. 根据权利要求12所述的装置,其特征在于,所述资源分配逻辑电路在将所述空闲资源作为所述目标逻辑资源分配给目标处理器核之后,所述资源分配逻辑电路还用于:The apparatus according to claim 12, wherein after the resource allocation logic circuit allocates the idle resource as the target logic resource to the target processor core, the resource allocation logic circuit is further configured to:
    根据所述目标资源请求自动抢占所述目标逻辑资源对应的目标保护锁,其中所述目标处理器核基于所述目标保护锁访问所述目标逻辑资源;Automatically seize the target protection lock corresponding to the target logical resource according to the target resource request, wherein the target processor core accesses the target logical resource based on the target protection lock;
    通过中断响应将抢锁结果上报给所述目标处理器核,其中所述抢锁结果用于指示已成功抢占到所述目标保护锁。The lock grab result is reported to the target processor core through an interrupt response, where the lock grab result is used to indicate that the target protection lock has been successfully seized.
  14. 根据权利要求11-13中任一项所述的装置,其特征在于,所述每一资源请求携带有标识,所述标识用于指示对应的资源请求所属的处理器核,所述逻辑栈还用于:The device according to any one of claims 11-13, wherein each resource request carries an identifier, and the identifier is used to indicate the processor core to which the corresponding resource request belongs, and the logical stack also Used for:
    在接收到一个资源请求之后,确定所述资源请求中携带的标识;After receiving a resource request, determine the identifier carried in the resource request;
    根据所述资源请求携带的标识,确定是否将所述资源请求存入所述逻辑栈。According to the identifier carried in the resource request, it is determined whether to store the resource request in the logic stack.
  15. 根据权利要求11-14中任一项所述的装置,其特征在于,所述逻辑栈的存储容量支持存储n个资源请求,所述处理器核的总数量为m、且n=m,则所述逻辑栈只允许所述m个处理器核中每一处理器核的一个资源请求存入所述逻辑栈。The device according to any one of claims 11-14, wherein the storage capacity of the logical stack supports storage of n resource requests, and the total number of processor cores is m and n=m, then The logic stack allows only one resource request of each of the m processor cores to be stored in the logic stack.
  16. 根据权利要求11-14中任一项所述的装置,其特征在于,所述逻辑栈的存储容量支持存储m个资源请求,且所述处理器核的总数量为m,则所述逻辑栈只允许具备相同标识的多个资源请求中的一个资源请求存入所述逻辑栈。The device according to any one of claims 11-14, wherein the storage capacity of the logical stack supports storage of m resource requests, and the total number of processor cores is m, then the logical stack Only one resource request among multiple resource requests with the same identifier is allowed to be stored in the logic stack.
  17. 根据权利要求11-14中任一项所述的装置,其特征在于,所述逻辑栈的存储容量支持存储n个资源请求,所述处理器核的总数量为m、且n大于m,则所述逻辑栈允许第一处理器核的至少两个资源请求存入所述逻辑栈,所述第一处理器核为所述m个处理器核中的任一个。The device according to any one of claims 11-14, wherein the storage capacity of the logical stack supports storage of n resource requests, and the total number of processor cores is m and n is greater than m, then The logic stack allows at least two resource requests of the first processor core to be stored in the logic stack, and the first processor core is any one of the m processor cores.
  18. 根据权利要求11-17中任一项所述的装置,其特征在于,所述逻辑栈为先进先出 单元FIFO逻辑栈。The device according to any one of claims 11-17, wherein the logic stack is a first-in first-out unit FIFO logic stack.
  19. 根据权利要求11-18中任一项所述的装置,其特征在于,所述资源分配逻辑电路独立于所述处理器核。The device according to any one of claims 11-18, wherein the resource allocation logic circuit is independent of the processor core.
  20. 根据权利要求11-19中任一项所述的装置,其特征在于,所述装置还包括:多个所述处理器核。The device according to any one of claims 11-19, wherein the device further comprises: a plurality of the processor cores.
  21. 根据权利要求11-20中任一项所述的装置,其特征在于,所述逻辑栈还用于:The device according to any one of claims 11-20, wherein the logical stack is further used for:
    接收针对第一资源请求的撤销命令,所述第一资源请求为所述至少一个资源请求中的任一个;Receiving a cancellation command for a first resource request, where the first resource request is any one of the at least one resource request;
    根据所述撤销命令,删除所述逻辑栈中存储的所述第一资源请求。According to the cancel command, the first resource request stored in the logic stack is deleted.
  22. 根据权利要求21所述的装置,其特征在于,所述逻辑栈在删除所述第一资源请求之后,所述资源分配逻辑电路用于:The device according to claim 21, wherein after the logic stack deletes the first resource request, the resource allocation logic circuit is configured to:
    通过中断响应将撤销结果上报给所述第一资源请求所对应的处理器核,其中所述撤销结果用于指示所述逻辑栈已完成所述第一资源请求的撤销。The cancellation result is reported to the processor core corresponding to the first resource request through an interrupt response, where the cancellation result is used to indicate that the logic stack has completed the cancellation of the first resource request.
PCT/CN2019/085059 2019-04-29 2019-04-29 Resource acquisition method, related apparatus, and computer storage medium WO2020220225A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/085059 WO2020220225A1 (en) 2019-04-29 2019-04-29 Resource acquisition method, related apparatus, and computer storage medium
CN201980095065.XA CN113767368A (en) 2019-04-29 2019-04-29 Resource acquisition method, related device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/085059 WO2020220225A1 (en) 2019-04-29 2019-04-29 Resource acquisition method, related apparatus, and computer storage medium

Publications (1)

Publication Number Publication Date
WO2020220225A1 true WO2020220225A1 (en) 2020-11-05

Family

ID=73029303

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/085059 WO2020220225A1 (en) 2019-04-29 2019-04-29 Resource acquisition method, related apparatus, and computer storage medium

Country Status (2)

Country Link
CN (1) CN113767368A (en)
WO (1) WO2020220225A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190496A (en) * 2021-04-23 2021-07-30 深圳市汇顶科技股份有限公司 Kernel communication method, device, chip, electronic equipment and storage medium
CN114064076A (en) * 2021-11-12 2022-02-18 天津航空机电有限公司 Method for preventing abnormal change of data of memory caused by power-off of airborne equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268670B (en) * 2021-12-31 2024-03-29 上海创时汽车科技有限公司 Ethernet asynchronous message processing system and method based on time triggering

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100043009A1 (en) * 2008-08-18 2010-02-18 Marchand Benoit Resource Allocation in Multi-Core Environment
CN103559088A (en) * 2012-05-21 2014-02-05 辉达公司 Resource management subsystem that maintains fairness and order
US20160110209A1 (en) * 2014-10-20 2016-04-21 Electronics And Telecommunications Research Institute Apparatus and method for performing multi-core emulation based on multi-threading
CN106663029A (en) * 2014-08-05 2017-05-10 高通股份有限公司 Directed event signaling for multiprocessor systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100043009A1 (en) * 2008-08-18 2010-02-18 Marchand Benoit Resource Allocation in Multi-Core Environment
CN103559088A (en) * 2012-05-21 2014-02-05 辉达公司 Resource management subsystem that maintains fairness and order
CN106663029A (en) * 2014-08-05 2017-05-10 高通股份有限公司 Directed event signaling for multiprocessor systems
US20160110209A1 (en) * 2014-10-20 2016-04-21 Electronics And Telecommunications Research Institute Apparatus and method for performing multi-core emulation based on multi-threading

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190496A (en) * 2021-04-23 2021-07-30 深圳市汇顶科技股份有限公司 Kernel communication method, device, chip, electronic equipment and storage medium
CN113190496B (en) * 2021-04-23 2023-12-26 深圳市汇顶科技股份有限公司 Kernel communication method, device, chip, electronic equipment and storage medium
CN114064076A (en) * 2021-11-12 2022-02-18 天津航空机电有限公司 Method for preventing abnormal change of data of memory caused by power-off of airborne equipment

Also Published As

Publication number Publication date
CN113767368A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
US9639409B2 (en) Device and method for communicating between cores
WO2017133623A1 (en) Data stream processing method, apparatus, and system
WO2020220225A1 (en) Resource acquisition method, related apparatus, and computer storage medium
WO2019223596A1 (en) Method, device, and apparatus for event processing, and storage medium
EP2898655B1 (en) System and method for small batching processing of usage requests
WO2019233322A1 (en) Resource pool management method and apparatus, resource pool control unit, and communication device
US8918791B1 (en) Method and system for queuing a request by a processor to access a shared resource and granting access in accordance with an embedded lock ID
US20110265098A1 (en) Message Passing with Queues and Channels
CN113485822A (en) Memory management method, system, client, server and storage medium
CA2536037A1 (en) Fast and memory protected asynchronous message scheme in a multi-process and multi-thread environment
CN102298539A (en) Method and system for scheduling shared resources subjected to distributed parallel treatment
WO2014173364A1 (en) Shared resource access method and device
US11231964B2 (en) Computing device shared resource lock allocation
CN115185880B (en) Data storage method and device
CN112148695A (en) Resource lock management method and device
CN116414534A (en) Task scheduling method, device, integrated circuit, network equipment and storage medium
US10318362B2 (en) Information processing apparatus, information processing method, and non-transitory computer-readable storage medium
CN114201416A (en) Communication scheduling method for control core MCU and calculation core MPU
CN112099728A (en) Method and device for executing write operation and read operation
Golchin et al. Tuned pipes: end-to-end throughput and delay guarantees for USB devices
CN116089049B (en) Asynchronous parallel I/O request-based process synchronous scheduling method, device and equipment
CN114911632B (en) Method and system for controlling interprocess communication
CN113407357A (en) Method and device for inter-process data movement
CN115878333A (en) Method, device and equipment for judging consistency between process groups
CN115576661A (en) Data processing system, method and controller

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19927011

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19927011

Country of ref document: EP

Kind code of ref document: A1