CN114356517B - Method, system, electronic equipment and storage medium for managing serial bus resources - Google Patents
Method, system, electronic equipment and storage medium for managing serial bus resources Download PDFInfo
- Publication number
- CN114356517B CN114356517B CN202111602665.6A CN202111602665A CN114356517B CN 114356517 B CN114356517 B CN 114356517B CN 202111602665 A CN202111602665 A CN 202111602665A CN 114356517 B CN114356517 B CN 114356517B
- Authority
- CN
- China
- Prior art keywords
- communication queue
- resource
- resource calling
- queue
- calling operation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 63
- 238000004891 communication Methods 0.000 claims abstract description 261
- 238000007726 management method Methods 0.000 claims abstract description 41
- 230000008569 process Effects 0.000 claims abstract description 25
- 238000004590 computer program Methods 0.000 claims description 8
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 230000009471 action Effects 0.000 description 3
- 125000004122 cyclic group Chemical group 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/548—Queue
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Telephonic Communication Services (AREA)
- Information Transfer Systems (AREA)
Abstract
The application discloses a serial bus resource management method, comprising the following steps: registering a first resource calling operation through a registration interface provided by the circulating communication queue, and adding the first resource calling operation to the circulating communication queue; registering a second resource calling operation through a registration interface provided by the single communication queue, and adding the second resource calling operation to the single communication queue; registering a third resource calling operation through a registration interface provided by the instant messaging queue, and adding the third resource calling operation to the instant messaging queue; and circularly executing resource calling operation in the circulating communication queue, the single communication queue and the instant communication queue. The method and the device can avoid contention for the serial bus resources among the processes and improve the utilization rate of the serial bus resources. The application also discloses a serial bus resource management system, a storage medium and electronic equipment, which have the beneficial effects.
Description
Technical Field
The present invention relates to the field of server management, and in particular, to a method, a system, an electronic device, and a storage medium for managing serial bus resources.
Background
The BMC (Baseboard Management Controller, baseboard controller) can manage various resources through a serial bus such as I2C, USB. In the related art, each process in the BMC directly accesses the serial bus according to the time sequence and the requirement of the process.
The serial bus speed of I2C, USB is not high, a plurality of operations cannot be responded simultaneously, the time of each process of the BMC accessing the serial bus is uncertain, when one process is accessing the serial bus, other processes need to wait for the accessing process to finish accessing if the serial bus is also used simultaneously, information acquisition delay is caused, and meanwhile, a certain probability is high that no process accesses the serial bus at a certain time, and idle waste of serial bus resources is caused.
Therefore, how to avoid contention for the serial bus resource between processes and improve the utilization rate of the serial bus resource is a technical problem that needs to be solved by those skilled in the art at present.
Disclosure of Invention
The purpose of the application is to provide a serial bus resource management method, a system, electronic equipment and a storage medium, which can avoid contending and robbing serial bus resources among processes and improve the utilization rate of the serial bus resources.
In order to solve the above technical problems, the present application provides a serial bus resource management method, which is applied to a serial bus resource manager, where the serial bus resource manager includes a circular communication queue, a single communication queue and an instant communication queue, and the serial bus resource management method includes:
registering a first resource calling operation through a registration interface provided by the circulating communication queue, and adding the first resource calling operation to the circulating communication queue;
registering a second resource calling operation through a registration interface provided by the single communication queue, and adding the second resource calling operation to the single communication queue;
registering a third resource calling operation through a registration interface provided by the instant messaging queue, and adding the third resource calling operation to the instant messaging queue;
and circularly executing the resource calling operation in the circular communication queue, the single communication queue and the instant communication queue.
Optionally, executing the resource calling operation in the circular communication queue, the single communication queue and the instant communication queue in a circulating manner includes:
step 1: executing each first resource calling operation in the circulating communication queue in sequence, and entering a step 2 after all the first resource calling operations are executed;
step 2: executing each second resource calling operation in the single communication queue in sequence, and entering a step 3 after all the second resource calling operations are executed;
step 3: and (3) executing each third resource calling operation in the instant messaging queue in sequence, and entering the step (1) after all the third resource calling operations are executed.
Optionally, executing each of the first resource calling operations in the circular communication queue in turn includes:
selecting a current first resource calling operation from the circulating communication queue;
determining the interval times according to the operation parameters of the current first resource calling operation;
judging whether the circulation times of the circulation communication queue are integral multiples of the interval times or not;
if yes, executing the current first resource calling operation;
if not, the step of selecting the current first resource calling operation from the circular communication queue is entered.
Optionally, in the process of circularly executing the resource calling operations in the circular communication queue, the single communication queue and the instant communication queue, the method further includes:
after executing a first resource calling operation in the circulating communication queue, recording an operation executing position of the circulating communication queue, and sequentially executing each third resource calling operation in the instant communication queue;
and after the execution of all the third resource calling operations is finished, continuing to circularly execute the resource calling operations in the circular communication queue, the single communication queue and the instant communication queue from the operation execution position of the circular communication queue.
Optionally, in the process of circularly executing the resource calling operations in the circular communication queue, the single communication queue and the instant communication queue, the method further includes:
after executing a second resource calling operation in the single communication queue, recording an operation execution position of the single communication queue, and sequentially executing each third resource calling operation in the instant communication queue;
and after the execution of all the third resource calling operations is finished, continuously and circularly executing the resource calling operations in the circulating communication queue, the single communication queue and the instant communication queue from the operation execution position of the single communication queue.
Optionally, the method further comprises:
receiving an operation creation request, and determining an operation type of the operation creation request; wherein the operation types include a loop operation, a single operation, and an instant operation;
if the operation type of the operation creation request is the circular operation, a step of registering a first resource calling operation through a registration interface provided by the circular communication queue is entered;
if the operation type of the operation creation request is the single operation, entering a step of registering a second resource calling operation through a registration interface provided by the single communication queue;
if the operation type of the operation creation request is the instant operation, the method enters the step of registering a third resource calling operation through a registration interface provided by the instant communication queue.
Optionally, after registering the first resource calling operation through the registration interface provided by the circular communication queue, the method further includes:
acquiring an operation ID of the first resource calling operation so as to store a corresponding execution result into a memory according to the operation ID of the first resource calling operation;
correspondingly, after registering the second resource calling operation through the registration interface provided by the single communication queue, the method further comprises:
acquiring the operation ID of the second resource calling operation so as to store a corresponding execution result into a memory according to the operation ID of the second resource calling operation;
correspondingly, after registering the third resource calling operation through the registration interface provided by the instant messaging queue, the method further comprises the following steps:
and acquiring the operation ID of the third resource calling operation so as to store the corresponding execution result into a memory according to the operation ID of the third resource calling operation.
The application also provides a serial bus resource management system, which is applied to a serial bus resource manager, wherein the serial bus resource manager comprises a circulating communication queue, a single communication queue and an instant communication queue, and the serial bus resource management system comprises:
the circulating queue management module is used for registering a first resource calling operation through a registration interface provided by the circulating communication queue and adding the first resource calling operation to the circulating communication queue;
the single queue management module is used for registering a second resource calling operation through a registration interface provided by the single communication queue and adding the second resource calling operation to the single communication queue;
the instant queue management module is used for registering a third resource calling operation through a registration interface provided by the instant communication queue and adding the third resource calling operation to the instant communication queue;
and the resource management module is used for circularly executing resource calling operations in the circular communication queue, the single communication queue and the instant communication queue.
The present application also provides a storage medium having stored thereon a computer program which, when executed, implements the steps performed by the above-described serial bus resource management method.
The application also provides electronic equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps executed by the serial bus resource management method when calling the computer program in the memory.
The application provides a serial bus resource management method, which is applied to a serial bus resource manager, wherein the serial bus resource manager comprises a circulating communication queue, a single communication queue and an instant communication queue, and the serial bus resource management method comprises the following steps: registering a first resource calling operation through a registration interface provided by the circulating communication queue, and adding the first resource calling operation to the circulating communication queue; registering a second resource calling operation through a registration interface provided by the single communication queue, and adding the second resource calling operation to the single communication queue; registering a third resource calling operation through a registration interface provided by the instant messaging queue, and adding the third resource calling operation to the instant messaging queue; and circularly executing the resource calling operation in the circular communication queue, the single communication queue and the instant communication queue.
The method is realized based on a serial bus resource manager comprising a circular communication queue, a single communication queue and an instant communication queue, wherein the circular communication queue is used for storing resource calling operation which needs to be circularly executed, the single communication queue is used for storing resource calling operation which only needs to be executed once, and the instant communication queue is used for storing resource calling operation which needs to be executed immediately. The method and the device can register and add the first resource calling operation, the second resource calling operation and the third resource calling operation by using the registration interfaces provided by the communication queues, and further circularly execute the resource calling operation in the circulating communication queues, the single communication queues and the instant communication queues. The application also provides a serial bus resource management system, a storage medium and an electronic device, which have the beneficial effects and are not described herein.
Drawings
For a clearer description of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for managing serial bus resources according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a serial bus resource management system according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Referring to fig. 1, fig. 1 is a flowchart of a serial bus resource management method according to an embodiment of the present application.
The specific steps may include:
s101: registering a first resource calling operation through a registration interface provided by the circulating communication queue, and adding the first resource calling operation to the circulating communication queue;
the embodiment can be applied to a serial bus resource manager, which can be built-in software of a BMC, or can be a resource manager realized by an MCU (Microcontroller Unit, micro control unit) or a singlechip. The serial bus resource manager may be an I2C (Inter-Integrated Circuit, two-wire serial bus) resource manager or a USB (Universal Serial Bus ) resource manager, depending on the type of bus. The serial bus resource manager comprises a circulating communication queue, a single communication queue and an instant communication queue.
The loop communication queue is used for storing first resource calling operation which needs to be executed in a loop, such as temperature inquiry, device working state and the like, wherein the first resource calling operation needs to be executed once every certain time of the loop execution. An operation creation request can be received before the step, and the operation type of the operation creation request is determined; wherein the operation types include a loop operation, a single operation, and an instant operation; if the operation type of the operation creation request is the circular operation, a step of registering a first resource calling operation through a registration interface provided by the circular communication queue is entered, and the first resource calling operation is added to the circular communication queue after the first resource calling operation is registered. As a possible implementation manner, after the first resource calling operation is registered through the registration interface provided by the circular communication queue, the operation ID of the first resource calling operation may also be obtained, so that a corresponding execution result is stored into the memory according to the operation ID of the first resource calling operation.
S102: registering a second resource calling operation through a registration interface provided by the single communication queue, and adding the second resource calling operation to the single communication queue;
the single communication queue is used for storing a second resource calling operation which is only needed to be executed once, such as a static information obtaining operation. After the second resource calling operation in the single communication queue is executed, the automatic logout can be performed without repeated execution. An operation creation request can be received before the step, and the operation type of the operation creation request is determined; wherein the operation types include a loop operation, a single operation, and an instant operation; if the operation type of the operation creation request is the single operation, a step of registering a second resource calling operation through a registration interface provided by the single communication queue is entered, and the second resource calling operation is added to the single communication queue after registering the second resource calling operation. After registering the second resource calling operation through the registration interface provided by the single communication queue, the operation ID of the second resource calling operation may also be obtained, so that the corresponding execution result is stored to the memory according to the operation ID of the second resource calling operation.
S103: registering a third resource calling operation through a registration interface provided by the instant messaging queue, and adding the third resource calling operation to the instant messaging queue;
the instant messaging queue is used for storing a third resource calling operation which needs to be executed immediately, such as an operation of performing power-off protection on a target component. An operation creation request can be received before the step, and the operation type of the operation creation request is determined; wherein the operation types include a loop operation, a single operation, and an instant operation; if the operation type of the operation creation request is the instant operation, entering the step of registering a third resource calling operation through a registration interface provided by the instant communication queue, and adding the third resource calling operation to the instant communication queue after registering the third resource calling operation. After registering a third resource calling operation through a registration interface provided by the instant messaging queue, an operation ID of the third resource calling operation may also be obtained, so that a corresponding execution result is stored in a memory according to the operation ID of the third resource calling operation. The present embodiment is not limited to the execution order of S102, and S103, and may be executed sequentially or simultaneously.
S104: and circularly executing the resource calling operation in the circular communication queue, the single communication queue and the instant communication queue.
The serial bus resource manager may perform the cycle execution of three queues, and the cycle execution sequence of the three queues is not limited herein.
The embodiment is realized based on a serial bus resource manager comprising a circular communication queue, a single communication queue and an instant communication queue, wherein the circular communication queue is used for storing resource calling operations needing to be circularly executed, the single communication queue is used for storing resource calling operations needing to be executed only once, and the instant communication queue is used for storing resource calling operations needing to be immediately executed. The embodiment can register and add the first resource calling operation, the second resource calling operation and the third resource calling operation by using the registration interfaces provided by the communication queues, so as to circularly execute the resource calling operations in the circular communication queues, the single communication queues and the instant communication queues.
As a further introduction to the corresponding embodiment of fig. 1, the resource calling operations in the circular communication queue, the single communication queue, and the instant communication queue may be circularly performed by:
mode 1:
step A1: executing each first resource calling operation in the circulating communication queue in sequence, and entering a step A2 after all the first resource calling operations are executed;
step A2: executing each second resource calling operation in the single communication queue in sequence, and entering a step A3 after all the second resource calling operations are executed;
step A3: and C, executing each third resource calling operation in the instant messaging queue in sequence, and entering a step A1 after all the third resource calling operations are executed.
Mode 2:
step B1: executing each first resource calling operation in the circulating communication queue in sequence, and entering a step B2 after all the first resource calling operations are executed;
step B2: executing each third resource calling operation in the instant messaging queue in sequence, and entering a step B3 after all the third resource calling operations are executed;
step B3: and B1, executing each second resource calling operation in the single communication queue in sequence, and entering a step B1 after all the second resource calling operations are executed.
Mode 3:
step C1: executing each second resource calling operation in the single communication queue in sequence, and entering a step C2 after all the second resource calling operations are executed;
step C2: executing each first resource calling operation in the circulating communication queue in sequence, and entering a step C3 after all the first resource calling operations are executed;
step C3: and C1, executing each third resource calling operation in the instant messaging queue in sequence, and entering the step C1 after all the third resource calling operations are executed.
As a possible implementation manner, the process of sequentially executing each first resource calling operation in the circular communication queue includes: selecting a current first resource calling operation from the circulating communication queue; determining the interval times according to the operation parameters of the current first resource calling operation; judging whether the circulation times of the circulation communication queue are integral multiples of the interval times or not; if yes, executing the current first resource calling operation; if not, the step of selecting the current first resource calling operation from the circular communication queue is entered. Taking the first resource calling operation as an example of the temperature obtaining operation, adding 1 to the current cycle number of all the first resource calling operations in the circular communication queue, wherein the interval number of the operation parameters of the temperature obtaining operation is 8, and if the current cycle number is an integer multiple of 8, executing the temperature obtaining operation.
As a possible implementation manner, in the process of circularly executing the resource calling operations in the circular communication queue, the single communication queue and the instant communication queue, whether the instant communication queue is empty or not can be judged after each first resource calling operation or one second resource calling operation is executed, if not, the resource calling operation in the instant communication queue is executed, and if not, the next resource calling operation is executed according to the original execution sequence.
After executing a first resource calling operation in the circulating communication queue, recording an operation executing position of the circulating communication queue, and sequentially executing each third resource calling operation in the instant communication queue; and after the execution of all the third resource calling operations is finished, continuing to circularly execute the resource calling operations in the circular communication queue, the single communication queue and the instant communication queue from the operation execution position of the circular communication queue.
After executing a second resource calling operation in the single communication queue, recording an operation execution position of the single communication queue, and sequentially executing each third resource calling operation in the instant communication queue; and after the execution of all the third resource calling operations is finished, continuously and circularly executing the resource calling operations in the circulating communication queue, the single communication queue and the instant communication queue from the operation execution position of the single communication queue.
The above procedure is illustrated:
the first resource calling operation of the circular communication queue comprises X1, X2 and X3, and the second resource calling operation of the single communication queue comprises Y1, Y2 and Y3. The cycle sequence is as follows: a circulating communication queue, a single communication queue and an instant communication queue. After executing the X2, if the instant messaging queue is not empty, executing each third resource calling operation in the instant messaging queue, and after all the third resource calling operations are executed, continuing to circularly execute the X3. After executing the X3, if the instant messaging queue is not empty, executing each third resource calling operation in the instant messaging queue, and after all the third resource calling operations are executed, continuing to circularly execute the Y1.
The flow described in the above embodiment is explained below by way of an embodiment in practical application. The present embodiment provides a scheme for maximizing BMC utilization of I2C using an I2C resource manager.
According to the embodiment, the I2C resource manager of the built-in software of the BMC or the external special MCU or the singlechip is used for realizing I2C resource management by the I2C resource manager, so that I2C resources are utilized to the maximum extent, the processes in the BMC are prevented from waiting for the I2C resources, and meanwhile, I2C resources are prevented from idling. The I2C resource manager provides three I2C resource utilization queues, a circulating communication queue, a single communication queue and an instant communication queue. The three queues are all provided with registration interfaces, the I2C actual operation execution logic of the registration parameters and the final queue is distinguished, each operation is registered to generate an operation ID, the operation IDs are mainly used for distinguishing operation and operation results, the I2C resource manager puts the corresponding execution results into a fixed memory according to the operation IDs after the three queues actually execute the I2C operation, each process takes the execution results of the operation registered by the process according to the operation IDs, and the three queue registration parameters comprise modes (read/write/read/write), the length of write data, the written data and the length of read data; the results of the queue execution all include: the operation ID, the length of the read data, the length of the write data, the written data, and the memory stores all of these data in the memory, with the three different queue parameters described below.
The cyclic communication queue is a queue which needs to continuously and circularly perform I2C, and the queue is generally provided with operations which can change in real time, such as operations for acquiring the temperature of a certain device, wherein each operation has interval number setting besides a common parameter, when the number of cyclic access in the cyclic queue is integral multiple of the interval number, the operation can be performed, the interval number is used for adjusting the time interval of some operations, if some information needs to be continuously updated but does not need to be too high, the interval number is adjusted to be larger, and some information needs to be acquired at a high frequency, and the interval number is smaller.
The single communication queue is used for executing the operation which only needs to be acquired once, and the operation after the single acquisition is automatically logged out and cannot be repeatedly executed, for example, some static information only needs to be acquired once and can be put in the whole queue.
The instant messaging queue is a queue for processing operations which need to be processed immediately, if power-off protection and the like are needed to be carried out on a certain component, the priority of the whole queue is highest, the interval for executing the operations of the other two queues can read whether the whole queue is empty or not, if not, the operations of the whole queue are processed preferentially, and the operations of the whole queue are executed and then returned to the original execution queue to be executed continuously.
The three queues of the I2C resource manager are circularly executed, thereby ensuring the hundred percent utilization of the I2C resources, realizing the highest utilization of the I2C resources under the condition of unchanged hardware architecture, solving the problems of low I2C utilization rate and the like in program operation caused by the competing of the I2C resources among various processes, uniformly managing the I2C resources, realizing the separation of software and hardware operation, ensuring that the operation result of the resource manager can not only use memory but also use other media such as a database hard disk and the like, and having good cross-platform portability.
According to the embodiment, the BMC on the server uses the I2C resource manager to remarkably improve the polling frequency of the I2C equipment, and the embodiment can also enhance the I2C resource utilization rate of the BMC, so that the I2C low-cost bus can exert the maximum energy efficiency in the design range, and the cost of replacing the high-speed bus is saved. The embodiment can also be applied to the use management of other serial buses such as USB.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a serial bus resource management system provided in an embodiment of the present application, where the system may be applied to a serial bus resource manager, the serial bus resource manager includes a circular communication queue, a single communication queue and an instant communication queue, and the serial bus resource management system includes:
a circular queue management module 201, configured to register a first resource calling operation through a registration interface provided by the circular communication queue, and add the first resource calling operation to the circular communication queue;
a single queue management module 202, configured to register a second resource calling operation through a registration interface provided by the single communication queue, and add the second resource calling operation to the single communication queue;
the instant queue management module 203 is configured to register a third resource calling operation through a registration interface provided by the instant messaging queue, and add the third resource calling operation to the instant messaging queue;
the resource management module 204 is configured to circularly execute resource calling operations in the circular communication queue, the single communication queue and the instant communication queue.
The embodiment is realized based on a serial bus resource manager comprising a circular communication queue, a single communication queue and an instant communication queue, wherein the circular communication queue is used for storing resource calling operations needing to be circularly executed, the single communication queue is used for storing resource calling operations needing to be executed only once, and the instant communication queue is used for storing resource calling operations needing to be immediately executed. The embodiment can register and add the first resource calling operation, the second resource calling operation and the third resource calling operation by using the registration interfaces provided by the communication queues, so as to circularly execute the resource calling operations in the circular communication queues, the single communication queues and the instant communication queues.
Optionally, the process of circularly executing the resource calling operations in the circular communication queue, the single communication queue and the instant communication queue by the resource management module 204 includes:
step 1: executing each first resource calling operation in the circular communication queue in turn, and entering step 2 after all the first resource calling operations are executed:
step 2: executing each second resource calling operation in the single communication queue in turn, and entering step 3 after all the second resource calling operations are executed:
step 3: and (3) executing each third resource calling operation in the instant messaging queue in sequence, and entering the step (1) after all the third resource calling operations are executed.
Further, the process of the resource management module 204 sequentially executing each of the first resource calling operations in the circular communication queue includes: selecting a current first resource calling operation from the circulating communication queue; determining the interval times according to the operation parameters of the current first resource calling operation; judging whether the circulation times of the circulation communication queue are integral multiples of the interval times or not; if yes, executing the current first resource calling operation; if not, the step of selecting the current first resource calling operation from the circular communication queue is entered.
Further, the method further comprises the following steps:
the first scheduling module is used for recording the operation execution position of the circulating communication queue after executing one first resource calling operation in the circulating communication queue, and sequentially executing each third resource calling operation in the instant communication queue; and the method is also used for continuously and circularly executing the resource calling operation in the circular communication queue, the single communication queue and the instant communication queue from the operation executing position of the circular communication queue after all the third resource calling operation is executed.
Further, the method further comprises the following steps:
the second scheduling module is used for recording the operation execution position of the single communication queue after executing one second resource calling operation in the single communication queue and sequentially executing each third resource calling operation in the instant communication queue; and the method is also used for continuously and circularly executing the resource calling operation in the circular communication queue, the single communication queue and the instant communication queue from the operation execution position of the single communication queue after all the third resource calling operation is executed.
Further, the method further comprises the following steps:
the operation registration module is used for receiving an operation creation request and determining the operation type of the operation creation request; wherein the operation types include a loop operation, a single operation, and an instant operation; the method is also used for entering a step of registering a first resource calling operation through a registration interface provided by the circular communication queue if the operation type of the operation creation request is the circular operation; the method is also used for entering a step of registering a second resource calling operation through a registration interface provided by the single communication queue if the operation type of the operation creation request is the single operation; and if the operation type of the operation creation request is the instant operation, entering the step of registering a third resource calling operation through a registration interface provided by the instant communication queue.
Further, the method further comprises the following steps:
the first storage module is used for acquiring the operation ID of the first resource calling operation after the first resource calling operation is registered through a registration interface provided by the circular communication queue so as to store a corresponding execution result into a memory according to the operation ID of the first resource calling operation;
the second storage module is used for acquiring the operation ID of the second resource calling operation after the second resource calling operation is registered through the registration interface provided by the single communication queue so as to store a corresponding execution result into the memory according to the operation ID of the second resource calling operation;
and the third storage module is used for acquiring the operation ID of the third resource calling operation after registering the third resource calling operation through a registration interface provided by the instant messaging queue so as to store a corresponding execution result into the memory according to the operation ID of the third resource calling operation.
Since the embodiments of the system portion and the embodiments of the method portion correspond to each other, the embodiments of the system portion refer to the description of the embodiments of the method portion, which is not repeated herein.
The present application also provides a storage medium having stored thereon a computer program which, when executed, performs the steps provided by the above embodiments. The storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The application also provides an electronic device, which may include a memory and a processor, where the memory stores a computer program, and the processor may implement the steps provided in the foregoing embodiments when calling the computer program in the memory. Of course the electronic device may also include various network interfaces, power supplies, etc.
In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it would be obvious to those skilled in the art that various improvements and modifications can be made to the present application without departing from the principles of the present application, and such improvements and modifications fall within the scope of the claims of the present application.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Claims (10)
1. The serial bus resource management method is characterized by being applied to a serial bus resource manager, wherein the serial bus resource manager comprises a circulating communication queue, a single communication queue and an instant communication queue, and the serial bus resource management method comprises the following steps:
registering a first resource calling operation through a registration interface provided by the circulating communication queue, and adding the first resource calling operation to the circulating communication queue;
registering a second resource calling operation through a registration interface provided by the single communication queue, and adding the second resource calling operation to the single communication queue;
registering a third resource calling operation through a registration interface provided by the instant messaging queue, and adding the third resource calling operation to the instant messaging queue;
and circularly executing the resource calling operation in the circular communication queue, the single communication queue and the instant communication queue.
2. The method according to claim 1, wherein the cyclically executing resource call operations in the circular communication queue, the single communication queue, and the instant communication queue includes:
step 1: executing each first resource calling operation in the circulating communication queue in sequence, and entering a step 2 after all the first resource calling operations are executed;
step 2: executing each second resource calling operation in the single communication queue in sequence, and entering a step 3 after all the second resource calling operations are executed;
step 3: and (3) executing each third resource calling operation in the instant messaging queue in sequence, and entering the step (1) after all the third resource calling operations are executed.
3. The method of claim 2, wherein sequentially performing each of the first resource call operations in the circular communication queue comprises:
selecting a current first resource calling operation from the circulating communication queue;
determining the interval times according to the operation parameters of the current first resource calling operation;
judging whether the circulation times of the circulation communication queue are integral multiples of the interval times or not;
if yes, executing the current first resource calling operation;
if not, the step of selecting the current first resource calling operation from the circular communication queue is entered.
4. The method according to claim 1, further comprising, in the process of circularly executing the resource calling operations in the circular communication queue, the single communication queue, and the instant communication queue:
after executing a first resource calling operation in the circulating communication queue, recording an operation executing position of the circulating communication queue, and sequentially executing each third resource calling operation in the instant communication queue;
and after the execution of all the third resource calling operations is finished, continuing to circularly execute the resource calling operations in the circular communication queue, the single communication queue and the instant communication queue from the operation execution position of the circular communication queue.
5. The method according to claim 1, further comprising, in the process of circularly executing the resource calling operations in the circular communication queue, the single communication queue, and the instant communication queue:
after executing a second resource calling operation in the single communication queue, recording an operation execution position of the single communication queue, and sequentially executing each third resource calling operation in the instant communication queue;
and after the execution of all the third resource calling operations is finished, continuously and circularly executing the resource calling operations in the circulating communication queue, the single communication queue and the instant communication queue from the operation execution position of the single communication queue.
6. The serial bus resource management method according to claim 1, further comprising:
receiving an operation creation request, and determining an operation type of the operation creation request; wherein the operation types include a loop operation, a single operation, and an instant operation;
if the operation type of the operation creation request is the circular operation, a step of registering a first resource calling operation through a registration interface provided by the circular communication queue is entered;
if the operation type of the operation creation request is the single operation, entering a step of registering a second resource calling operation through a registration interface provided by the single communication queue;
if the operation type of the operation creation request is the instant operation, the method enters the step of registering a third resource calling operation through a registration interface provided by the instant communication queue.
7. The method according to any one of claims 1 to 6, further comprising, after registering the first resource call operation through a registration interface provided by the circular communication queue:
acquiring an operation ID of the first resource calling operation so as to store a corresponding execution result into a memory according to the operation ID of the first resource calling operation;
correspondingly, after registering the second resource calling operation through the registration interface provided by the single communication queue, the method further comprises:
acquiring the operation ID of the second resource calling operation so as to store a corresponding execution result into a memory according to the operation ID of the second resource calling operation;
correspondingly, after registering the third resource calling operation through the registration interface provided by the instant messaging queue, the method further comprises the following steps:
and acquiring the operation ID of the third resource calling operation so as to store the corresponding execution result into a memory according to the operation ID of the third resource calling operation.
8. A serial bus resource management system, characterized in that it is applied to a serial bus resource manager, where the serial bus resource manager includes a circular communication queue, a single communication queue and an instant communication queue, and the serial bus resource management system includes:
the circulating queue management module is used for registering a first resource calling operation through a registration interface provided by the circulating communication queue and adding the first resource calling operation to the circulating communication queue;
the single queue management module is used for registering a second resource calling operation through a registration interface provided by the single communication queue and adding the second resource calling operation to the single communication queue;
the instant queue management module is used for registering a third resource calling operation through a registration interface provided by the instant communication queue and adding the third resource calling operation to the instant communication queue;
and the resource management module is used for circularly executing resource calling operations in the circular communication queue, the single communication queue and the instant communication queue.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the serial bus resource management method of any one of claims 1 to 7 when the computer program in the memory is invoked by the processor.
10. A storage medium having stored therein computer executable instructions which when loaded and executed by a processor implement the steps of the serial bus resource management method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111602665.6A CN114356517B (en) | 2021-12-24 | 2021-12-24 | Method, system, electronic equipment and storage medium for managing serial bus resources |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111602665.6A CN114356517B (en) | 2021-12-24 | 2021-12-24 | Method, system, electronic equipment and storage medium for managing serial bus resources |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114356517A CN114356517A (en) | 2022-04-15 |
CN114356517B true CN114356517B (en) | 2023-08-04 |
Family
ID=81102298
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111602665.6A Active CN114356517B (en) | 2021-12-24 | 2021-12-24 | Method, system, electronic equipment and storage medium for managing serial bus resources |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114356517B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109254936A (en) * | 2017-07-12 | 2019-01-22 | 龙芯中科技术有限公司 | The method and apparatus for being inserted into data transmission queue structure's body |
CN113051204A (en) * | 2019-12-27 | 2021-06-29 | 中车大连电力牵引研发中心有限公司 | Serial backplane bus communication method and system |
CN113495863A (en) * | 2020-03-18 | 2021-10-12 | 阿里巴巴集团控股有限公司 | Method and apparatus for adapting service data to universal serial bus channel |
-
2021
- 2021-12-24 CN CN202111602665.6A patent/CN114356517B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109254936A (en) * | 2017-07-12 | 2019-01-22 | 龙芯中科技术有限公司 | The method and apparatus for being inserted into data transmission queue structure's body |
CN113051204A (en) * | 2019-12-27 | 2021-06-29 | 中车大连电力牵引研发中心有限公司 | Serial backplane bus communication method and system |
CN113495863A (en) * | 2020-03-18 | 2021-10-12 | 阿里巴巴集团控股有限公司 | Method and apparatus for adapting service data to universal serial bus channel |
Also Published As
Publication number | Publication date |
---|---|
CN114356517A (en) | 2022-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110837410A (en) | Task scheduling method and device, electronic equipment and computer readable storage medium | |
US9529651B2 (en) | Apparatus and method for executing agent | |
CN106020984B (en) | Method and device for creating process in electronic equipment | |
CN109842621A (en) | A kind of method and terminal reducing token storage quantity | |
CN111459622A (en) | Method and device for scheduling virtual CPU, computer equipment and storage medium | |
CN114356517B (en) | Method, system, electronic equipment and storage medium for managing serial bus resources | |
CN111597056A (en) | Distributed scheduling method, system, storage medium and device | |
US11360702B2 (en) | Controller event queues | |
CN116880986A (en) | Task scheduling method and device, vehicle-mounted controller, electronic equipment and storage medium | |
CN109669735B (en) | Application starting method and device based on delayed registration and storage medium | |
CN106844036B (en) | Physical equipment access method and device | |
CN115658156A (en) | Timed task implementation method and device based on linux system | |
CN115878333A (en) | Method, device and equipment for judging consistency between process groups | |
CN113806055A (en) | Lightweight task scheduling method, system, device and storage medium | |
CN113961364A (en) | Large-scale lock system implementation method and device, storage medium and server | |
CN113641472A (en) | Method and device for realizing different conversion and same sharing of distributed application | |
CN112540886A (en) | CPU load value detection method and device | |
CN112130900A (en) | User information management method, system, equipment and medium for BMC | |
CN112395081A (en) | Resource online automatic recovery method, system, server and storage medium | |
CN112463544B (en) | Program running monitoring method, device, equipment and storage medium | |
CN111324472B (en) | Method and device for judging garbage items of information to be detected | |
CN111726418B (en) | Cloud resource allocation method and device, terminal equipment and storage medium | |
CN117170745B (en) | RISC-V external interrupt processing method, system and related equipment | |
CN111930214B (en) | Method and device for resetting FPGA (field programmable Gate array) accelerator card and FPGA accelerator card | |
EP1659493A1 (en) | Replacing idle process when doing fast messaging |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |