A method and device for QoS bandwidth allocation based on distributed transactions
By initializing the port, calculating incremental bandwidth and associating it with transactions in a distributed transaction environment, the problem of inefficient concurrency caused by serial locking is solved, bandwidth allocation efficiency and concurrency capabilities are improved, and the performance needs of users are met.
Patent Information
- Application Number
- CN202211443264.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-17
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-11-17
AI Technical Summary
In a distributed transaction environment, the concurrency efficiency reduction caused by serial locking of physical ports during Qos bandwidth allocation in telecom service management.
By initializing the port, loading the Qos bandwidth parameters of the physical port, calculating the incremental bandwidth to be allocated, associating bandwidth allocation with transactions as an operation of distributed transactions, pre-allocating bandwidth, and updating and persisting bandwidth data when transactions are committed , reduce the locking granularity of port resources.
It significantly improves the efficiency of bandwidth allocation, improves the concurrency ability of managing services in a distributed transaction environment, and meets the performance needs of users.
Smart Images

Figure CN115801584B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network management, and in particular to a method and device for allocating QoS bandwidth based on distributed transactions. Background Art
[0002] With the widespread and in-depth application of the Internet, various computing technologies and network technologies have been continuously introduced, and distributed technologies have also emerged. At present, telecommunications network management systems also generally adopt distributed technologies, that is, services are divided into different applications according to different levels and functions, and these applications are deployed on different physical nodes.
[0003] When a distributed telecommunications network management system manages business data, it will inevitably cross multiple physical nodes, multiple application services, and multiple databases. In order to ensure the consistency and integrity of business data, distributed transactions are the most commonly used mechanism. Distributed transactions provide a mechanism to incorporate all operations involved in an activity into an indivisible execution unit. In a distributed system, traditional transactions cannot directly guarantee the indivisibility of all operations in the distributed system through the services provided by the database, and distributed transactions are required to ensure data consistency. Distributed transactions can effectively ensure that all operations can be executed and submitted at the same time. As long as any one of the operations fails, the distributed transaction will roll back all operations.
[0004] Telecom packet transmission network has different service levels, such as VP layer, VC layer and client layer VPN, etc. Each level of service has Quality of Service (Qos) bandwidth control, and the demand for service bandwidth is ultimately converted into the Qos bandwidth demand of the physical port it passes through. When the network manager creates a service that meets the user's bandwidth requirements, if the physical port it passes through can allocate bandwidth that meets the user's requirements, the creation is successful, otherwise it fails. In a distributed transaction environment, telecommunications service management involves multiple nodes, multiple services, multiple processes, and multiple databases. If N services are created concurrently and all pass through the same physical port, at this time, when allocating bandwidth for the physical port passed by each service, the physical port is locked in sequence according to the first-come-first-served strategy. This process is executed serially. In extreme cases, the Nth service fails due to insufficient bandwidth allocation, but waits for the bandwidth allocation time of the previous (N-1) services. This allocation strategy greatly reduces the efficiency of concurrency.
[0005] In view of this, how to overcome the defects of the prior art and solve the problem of reduced concurrency efficiency caused by serial locking of physical ports in distributed transaction QoS bandwidth allocation is a problem to be solved in the technical field. Summary of the invention
[0006] In view of the above defects or improvement requirements of the prior art, the present invention solves the problem of reduced concurrency efficiency caused by serial locking of physical ports in distributed transaction QoS bandwidth allocation.
[0007] The embodiment of the present invention adopts the following technical solution:
[0008] In a first aspect, the present invention provides a method for QoS bandwidth allocation based on distributed transactions, specifically: initializing the port, loading the QoS bandwidth parameters of all physical ports used by the service, wherein the bandwidth parameters include the total port bandwidth, the used bandwidth and the pre-allocated bandwidth; the distributed transaction initiates a physical port bandwidth request, calculates the incremental bandwidth to be allocated, and associates the bandwidth allocation with the distributed transaction as an operation of the distributed transaction; updates the used bandwidth value and the pre-allocated bandwidth value of the port, and synchronizes and persists them, and submits and executes the distributed transaction.
[0009] Preferably, the method further comprises: when a distributed transaction initiates a request, each resource port required by each distributed transaction is locked separately; after the incremental bandwidth allocation is completed, during the distributed transaction execution phase, the port resources are unlocked.
[0010] Preferably, calculating the incremental bandwidth to be allocated specifically includes: when the distributed transaction is to allocate bandwidth, calculating the bandwidth that the distributed transaction needs to allocate in advance;
[0011] When the distributed transaction is to release bandwidth, the incremental bandwidth to be released is calculated.
[0012] Preferably, bandwidth allocation is associated with the distributed transaction as an operation of the distributed transaction, specifically including: allocating bandwidth or releasing bandwidth is regarded as an operation of the distributed transaction, establishing an association relationship with the distributed transaction, and being executed together when the transaction is submitted.
[0013] Preferably, the incremental bandwidth to be allocated is calculated, specifically including: calculating the incremental bandwidth of the port to be allocated according to the Cir value of the service QoS set by the user; judging whether the available bandwidth of the requested port meets the incremental bandwidth requirement according to the used bandwidth and the incremental bandwidth; if the incremental bandwidth requirement is met, pre-allocating the incremental bandwidth and updating the pre-allocated bandwidth value in the cache; if the incremental bandwidth requirement is not met, the allocation fails, and an error is returned to the distributed transaction requesting the allocation.
[0014] Preferably, the used bandwidth value and pre-allocated bandwidth value of the port in the cache are updated, specifically including: when allocating bandwidth, the pre-allocated bandwidth value of the port in the application phase is added with the incremental bandwidth value associated with the distributed transaction, the used bandwidth value of the port in the transaction submission phase is added with the incremental bandwidth value associated with the distributed transaction, the pre-allocated bandwidth value of the port is subtracted from the incremental bandwidth value associated with the distributed transaction, and the bandwidth data is persisted at the same time; when releasing bandwidth, the port data in the cache does not need to be updated in the application phase, the used bandwidth value of the port in the transaction submission phase is subtracted from the incremental bandwidth value associated with the distributed transaction, and the bandwidth data is persisted at the same time.
[0015] Preferably, when the distributed transaction is committed, it specifically includes: when allocating bandwidth, the distributed transaction is committed, the used bandwidth and pre-allocated bandwidth of the port in the cache are updated and persisted; when releasing bandwidth, the distributed transaction is committed, only the used bandwidth of the port in the cache is updated and persisted.
[0016] Preferably, when the distributed transaction is rolled back, it also includes that when bandwidth is allocated, the distributed transaction is rolled back, and the value of the pre-allocated bandwidth is updated to the result of subtracting the incremental bandwidth from the current pre-allocated bandwidth, and the data is not persisted; when bandwidth is released, the distributed transaction is rolled back, the port's used bandwidth and pre-allocated bandwidth are not updated, and the data is not persisted.
[0017] Preferably, the distributed transaction initiates a physical port bandwidth request, and also includes: when a user creates, deletes or modifies a service, the distributed transaction initiates a physical port bandwidth request. Bandwidth allocation and bandwidth release are divided into two stages: the application stage, which is the pre-allocation of bandwidth for bandwidth allocation and the generation of incremental bandwidth to be released for bandwidth release; the submission stage (or rollback), the distributed transaction is submitted, the update of cached data is confirmed, and it is persisted.
[0018] On the other hand, the present invention provides a device for QoS bandwidth allocation based on distributed transactions, specifically: including at least one processor and a memory, at least one processor and the memory are connected via a data bus, the memory stores instructions that can be executed by at least one processor, and after the instructions are executed by the processor, they are used to complete the method for QoS bandwidth allocation based on distributed transactions in the first aspect.
[0019] Compared with the prior art, the beneficial effects of the embodiments of the present invention are: by pre-allocating incremental bandwidth and associating bandwidth allocation with distributed transactions, the locking granularity of port resources is reduced, and the efficiency of allocating bandwidth is significantly improved while ensuring the integrity and consistency of transactions through the method of incrementally allocating QoS bandwidth, thereby greatly improving the concurrency capability of managing services in a distributed transaction environment and meeting the performance requirements of users. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 A flow chart of a method for QoS bandwidth allocation based on distributed transactions provided in an embodiment of the present invention;
[0022] Figure 2 A flow chart of another method for QoS bandwidth allocation based on distributed transactions provided by an embodiment of the present invention;
[0023] Figure 3 It is a timing diagram of the existing QoS bandwidth allocation process;
[0024] Figure 4 A timing diagram of the QoS bandwidth allocation process provided by an embodiment of the present invention;
[0025] Figure 5 A schematic diagram of the structure of a device for QoS bandwidth allocation based on distributed transactions provided in an embodiment of the present invention;
[0026] The reference numerals are as follows:
[0027] 11: processor; 12: memory. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0029] The present invention is an architecture of a specific functional system, so the specific embodiments mainly illustrate the functional logical relationship between the various structural modules, and do not limit the specific software and hardware implementation methods.
[0030] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other. The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0031] Embodiment 1:
[0032] In order to solve the problem of low concurrency efficiency when allocating bandwidth in the existing distributed transaction environment, in the distributed transaction environment, on the premise of ensuring the integrity and consistency of business data, the allocation efficiency of business QoS bandwidth is improved to meet the performance requirements of user management business. This embodiment provides a method for QoS bandwidth allocation based on distributed transactions.
[0033] like Figure 1 As shown, the specific steps of the method for QoS bandwidth allocation based on distributed transactions provided by an embodiment of the present invention are as follows.
[0034] Step 101: Initialize the port and load the QoS bandwidth parameters of all physical ports used by the service, where the bandwidth parameters include the total port bandwidth (port rate), used bandwidth, and pre-allocated bandwidth.
[0035] In order to allocate bandwidth, it is necessary to initialize the physical port and obtain the QoS bandwidth parameters of the available physical port. Specifically, when allocating port QoS bandwidth for distributed transactions, first obtain the following information:
[0036] 1. The total bandwidth of the port;
[0037] 2. The used bandwidth of the port;
[0038] 3. Pre-allocated bandwidth of the port.
[0039] Hardware fundamentals that do not change, such as the total port bandwidth, can be written to the cache after the initial acquisition, or written to a persistent storage such as a database, and loaded into the cache when initialized or needed, so as to quickly find and allocate port bandwidth.
[0040] In this embodiment, a pre-allocated method is used to allocate QoS bandwidth to each distributed transaction. Each port records its own used bandwidth and pre-allocated bandwidth. The maximum value of the sum of the used bandwidth and the pre-allocated bandwidth is equal to the total bandwidth. The values of the used bandwidth and the pre-allocated bandwidth will change according to the request and release of each distributed transaction, so they can also be loaded into the cache to improve data reading and writing efficiency.
[0041] Step 102: The distributed transaction initiates a physical port bandwidth request, calculates the incremental bandwidth to be allocated, and associates the bandwidth allocation with the distributed transaction as an operation of the distributed transaction.
[0042] The method provided in this embodiment separates bandwidth request and actual allocation, pre-allocates bandwidth when a distributed transaction initiates a bandwidth request, reserves the required bandwidth for each distributed transaction, and avoids conflicts between multiple distributed transactions.
[0043] When a distributed transaction Ta is started, a bandwidth request Ra for the physical port Pa is initiated to the Qos bandwidth control module. The bandwidth is calculated, and the incremental bandwidth Ba to be allocated is generated, and the incremental bandwidth Ba is included in the pre-allocated bandwidth of the port. In the specific implementation, when the user creates, deletes or modifies a service, the bandwidth used will change, and a bandwidth request is required. At this time, the distributed transaction initiates a physical port bandwidth request.
[0044] When there are multiple distributed transactions, in order to avoid conflicts during bandwidth pre-allocation, when a distributed transaction initiates a request, each resource port required by each distributed transaction is locked separately to avoid changes in the port's available bandwidth resources during the calculation and allocation of the incremental bandwidth Ba, resulting in insufficient bandwidth for the business. At the same time, the granularity of the lock is reduced. Compared with the existing method, the resource object locked at one time is changed from all required ports to one port.
[0045] Step 103: Update the used bandwidth value and pre-allocated bandwidth value of the port, synchronize and persist them, submit the distributed transaction and execute it.
[0046] After bandwidth pre-allocation, the pre-allocated bandwidth is submitted as an operation of the distributed service, and the allocated incremental bandwidth is associated with the distributed service. The pre-allocated incremental bandwidth is regarded as physically used in the service logic. When the distributed transaction is submitted, the bandwidth is actually allocated to the distributed transaction according to the associated incremental bandwidth value; after the distributed transaction is executed, the corresponding bandwidth is released according to the associated incremental bandwidth value.
[0047] In actual implementation, it is also necessary to determine whether the distributed transaction Ta is committed or rolled back. If it is committed, the allocated bandwidth needs to be used, and bandwidth is allocated for the distributed transaction according to the incremental bandwidth Ba associated with the distributed transaction Ta; if it is rolled back, no bandwidth is needed, and the pre-allocated incremental bandwidth Ba of the port is removed without actual allocation.
[0048] For submitted distributed transactions, it is necessary to further determine whether the type of bandwidth request Ra is to allocate bandwidth or release bandwidth. Both releasing bandwidth and allocating bandwidth are changes in bandwidth usage values, so releasing bandwidth can be considered a special form of allocating bandwidth. When a distributed transaction allocates bandwidth, it means that bandwidth allocation needs to be increased to allocate bandwidth for distributed transactions. When a distributed transaction releases bandwidth, it means that bandwidth allocation needs to be reduced to generate incremental bandwidth to be released, but there is no need to change the used bandwidth value and the pre-allocated bandwidth value to avoid inconsistent bandwidth values caused by rollback.
[0049] During step 103, the values of used bandwidth, pre-allocated bandwidth and remaining bandwidth have been determined, and the port will not cause conflicts when receiving bandwidth allocation applications. In order to reduce the occupation of port resources, after the incremental bandwidth allocation is completed in step 102, the port resources are unlocked in the distributed transaction execution phase in step 103 and thereafter.
[0050] After the actual allocation is completed, it is also necessary to update the used bandwidth value and pre-allocated bandwidth value of the port in the cache, convert the bandwidth allocated to the distributed transaction for continuous use from the pre-allocated bandwidth to the used bandwidth, and synchronize and persist it for subsequent use.
[0051] After steps 101 to 103 provided in this embodiment, the bandwidth request and the actual bandwidth allocation can be separated, so that the port only needs to be locked during the bandwidth request period, and does not need to be locked during the execution phase of the distributed transaction, so that multiple distributed transactions can be executed in parallel when using multiple port resources together, thereby improving execution efficiency.
[0052] In the method provided in this embodiment, bandwidth allocation and bandwidth release are divided into two stages: (1) the application stage, which is to pre-allocate bandwidth for bandwidth allocation and to generate incremental bandwidth to be released for bandwidth release. In this stage, only numerical calculations are performed and no actual bandwidth changes are performed. (2) the submission stage (or rollback), in which the distributed transaction is submitted, the cache data is updated and persisted. In this stage, the actual bandwidth changes are performed according to the values calculated in the application stage. In actual implementation, the application stage needs to determine whether there are enough resources for allocation, and changes in resource values will occur. Therefore, port resources only need to be locked in the application stage to avoid using dirty data or conflicts. In the submission stage, the resource allocation values will not change, so there is no need to lock them.
[0053] When a distributed transaction initiates a physical port bandwidth request, the service calls the interface for allocating Qos bandwidth and passes the opened distributed transaction object information to the interface. The distributed transaction object information includes operations for allocating or releasing bandwidth. In actual implementation, in order to improve, external services can be provided in the form of interfaces to receive bandwidth allocation or release requests for distributed transactions. The interface should contain current transaction object information, such as: creating an interface for allocating the required Qos bandwidth for service calls, and opened distributed transaction object information. The interface can be in the form of a local call or a remote call, and the distributed transaction mechanism can support both forms.
[0054] In actual implementation, in order to associate bandwidth allocation with distributed transactions as an operation of distributed transactions, bandwidth allocation or bandwidth release is regarded as an operation of distributed transactions, and an association relationship is established with distributed transactions, so that they are executed together when the transaction is submitted. When a distributed transaction applies for bandwidth, the category of bandwidth request Ra is determined, whether it is to allocate bandwidth or release bandwidth. There is no essential difference in processing strategy between bandwidth allocation and bandwidth release. Bandwidth allocation increases the used bandwidth, while bandwidth release is the opposite, which is to reduce the used bandwidth. Bandwidth release can be regarded as a special case of bandwidth allocation. Whether bandwidth allocation or bandwidth release is regarded as an operation of the current transaction, and an association relationship is established with the current transaction so that it can be executed together when the transaction is submitted.
[0055] In actual implementation, Figure 2 As shown, the following steps may be used to calculate the incremental bandwidth to be allocated in step 102 and complete the pre-allocation of bandwidth.
[0056] Step 201: Calculate the port incremental bandwidth to be allocated according to the user specified bandwidth rate (Cir) value set by the user for the service QoS.
[0057] When the bandwidth request service Ra is to allocate bandwidth, the incremental port bandwidth Ba to be allocated is calculated according to the Cir value of the service QoS set by the user. When the bandwidth request service Ra is to release bandwidth, the incremental port bandwidth Ba to be released is calculated according to the Cir value of the service QoS set by the user.
[0058] Step 202: According to the used bandwidth and the incremental bandwidth, it is determined whether the available bandwidth of the requested port meets the incremental bandwidth requirement.
[0059] Determine whether the port has available remaining bandwidth. If the total bandwidth of the port is TB and the used bandwidth is UsedCir, then the judgment formula for meeting the bandwidth requirement is: TB>=UsedCir+Ba. If the formula is met, it means that there is a remaining bandwidth value available for allocation. If the formula is not met, the incremental bandwidth is greater than the remaining bandwidth, indicating that the bandwidth value available for allocation is insufficient.
[0060] Step 203: If the incremental bandwidth requirement is met, the incremental bandwidth is pre-allocated and the pre-allocated bandwidth value in the cache is updated.
[0061] Pre-allocate incremental bandwidth and update the pre-allocated bandwidth value in the cache. In actual implementation, step 201 and step 202 are inseparable atomic operations. Otherwise, under concurrent conditions, the existing remaining bandwidth may be different from the remaining bandwidth at the time of judgment due to the concurrent transaction changing the UsedCir value, and the available bandwidth may be incorrectly modified due to reading dirty data. The pre-allocation of incremental bandwidth is an operation within the scope of the current distributed transaction.
[0062] Step 204: If the incremental bandwidth requirement is not met, the allocation fails and an error is returned to the distributed transaction requesting the allocation.
[0063] When the bandwidth of the port is insufficient, it cannot respond to the bandwidth allocation request of the distributed transaction, returns an error message, and the caller rolls back the distributed transaction. When the caller rolls back the transaction, since the physical bandwidth has not been actually allocated, it only needs to subtract the incremental bandwidth value allocated this time from the pre-allocated bandwidth value, that is, cancel the pre-allocated incremental bandwidth value.
[0064] After steps 201 to 204 provided in this embodiment, the calculation and pre-allocation of the incremental bandwidth can be completed.
[0065] After bandwidth pre-allocation, the used bandwidth value and pre-allocated bandwidth value of the port in the cache are updated so that the next distributed transaction can accurately obtain the available bandwidth of the current port when applying for bandwidth. When applying for bandwidth allocation, the application stage is essentially to calculate whether there is available bandwidth. And pre-allocate bandwidth, increase the incremental bandwidth value allocated this time, when the caller submits the transaction, the used bandwidth value of the port is accumulated with the incremental bandwidth value associated with the transaction, and the pre-allocated bandwidth is subtracted from the incremental bandwidth value of this time, and the bandwidth data is persisted at the same time. When applying for bandwidth release, there is no need to update the used bandwidth and pre-allocated bandwidth at the application stage, because if the incremental bandwidth has been released by the used bandwidth at this time, other transactions will successfully apply for the same incremental bandwidth, but when the transaction applying for bandwidth release is rolled back, the error of the used bandwidth of the port exceeds the upper limit will occur. Therefore, to release bandwidth, you only need to update the used bandwidth when submitting the transaction. For the bandwidth release scenario, when the caller submits the transaction, the used bandwidth value of the port is subtracted from the incremental bandwidth value associated with the transaction, and the bandwidth data is persisted at the same time.
[0066] The following uses examples from actual scenarios to compare the differences between the existing bandwidth allocation method and the bandwidth allocation method provided in this embodiment.
[0067] In a real scenario, three services a, b, and c are created concurrently. Three distributed transactions Ta, Tb, and Tc are opened for each service. All three services are allocated QoS bandwidth from ports (PortA, PortB, PortC, and PortD).
[0068] like Figure 3As shown, in the existing allocation method, when creating a service, firstly, a one-time request is made to lock all port resources (Lock), then the required QoS bandwidth is allocated from the port as the used bandwidth, and finally the port used bandwidth is submitted (Commit) and the port resources are released (Unlock). According to this allocation method, if the order of the three services requesting to lock the port resources is a, b, and c, transaction Ta locks the port resources from T1 to T5 and allocates QoS bandwidth, submits the port used bandwidth at T6, and unlocks the port resources at T7. That is to say, from T1 to T7, transaction Ta monopolizes the port resources, and transactions Tb and Tc need to wait for the port resources to be released. The total time consumed for the three services to allocate QoS bandwidth is: T19-T1. When deleting a service, the port bandwidth needs to be released, which is similar to the above process. The above allocation method is actually serial. The larger the concurrent service volume, the worse its performance, which seriously reduces the efficiency of managing (creating, deleting, and modifying) services and is difficult to meet user needs.
[0069] like Figure 4 As shown, in the QoS bandwidth allocation method provided by this embodiment, first, according to step 101, the bandwidth parameters of the port are obtained. When three services a, b, and c are created, the distributed transactions Ta, Tb, and Tc are opened, and bandwidth requests are initiated and bandwidth is pre-allocated according to step 102. The time periods for transaction Ta to allocate bandwidth and lock port resources (PortA, PortB, PortC, and PortD) are (T1-T2), (T2-T3), (T3-T4), and (T4-T5), respectively, the time periods for transaction Tb to lock port resources are (T2-T3), (T3-T4), (T4-T5), and (T5-T6), and the time periods for transaction Tc to lock port resources are (T3-T4), (T4-T5), (T5-T6), and (T6-T7). Then, according to step 103, the transaction is submitted and executed, wherein the execution (Commit) stage does not need to be locked, and the incremental bandwidth of each transaction can be submitted. The total time consumed for allocating QoS bandwidth for the three services is: T7-T1.
[0070] Compared with the existing method, the method provided in this embodiment does not need to lock the required port resources at one time when the management business application of the distributed transaction requests to allocate QoS bandwidth. Each port is locked separately, and the bandwidth is allocated incrementally, and the granularity of the operation is finer and more accurate. Comparing the total time consumed for bandwidth allocation of port resources of the two, the total time consumed by the former is T19-T1, and the total time consumed by the latter is T7-T1. The former consumes T19-T7 more time than the latter.
[0071] In actual implementation, the method provided in this embodiment can be used as an independent service process as needed, or can be placed in other service processes, and can complete all the functions described above.
[0072] The method for allocating QoS bandwidth based on distributed transactions provided in this embodiment reduces the locking granularity of port resources and adopts a method for incrementally allocating QoS bandwidth. While ensuring the integrity and consistency of transactions, it significantly improves the efficiency of allocating bandwidth, thereby greatly improving the concurrency capability of managing services in a distributed transaction environment and meeting the performance requirements of users.
[0073] Embodiment 2:
[0074] Based on the method of QoS bandwidth allocation based on distributed transactions provided in the above embodiment 1, the present invention also provides a device for QoS bandwidth allocation based on distributed transactions that can be used to implement the above method, as shown in the figure, which is a schematic diagram of the device architecture of the embodiment of the present invention. The device for QoS bandwidth allocation based on distributed transactions in this embodiment includes one or more processors 11 and a memory 12. Among them, Figure 5 A processor 11 is taken as an example.
[0075] The processor 11 and the memory 12 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0076] The memory 12 is a non-volatile computer-readable storage medium for a QoS bandwidth allocation method based on distributed transactions, and can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the QoS bandwidth allocation method based on distributed transactions in Example 1. The processor 11 executes various functional applications and data processing of the device for QoS bandwidth allocation based on distributed transactions by running the non-volatile software programs, instructions and modules stored in the memory 12, that is, implementing the QoS bandwidth allocation method based on distributed transactions in Example 1.
[0077] The memory 12 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 12 may optionally include a memory remotely arranged relative to the processor 11, and these remote memories may be connected to the processor 11 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0078] The program instructions / modules are stored in the memory 12. When executed by one or more processors 11, the method for allocating QoS bandwidth based on distributed transactions in the above embodiment 1 is executed. For example, the above described Figure 1 and Figure 2 The steps shown.
[0079] A person skilled in the art may understand that all or part of the steps in the various methods of the embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0080] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for QoS bandwidth allocation based on distributed transactions, characterized in that: Specifically include: Initialize the port and load the QoS bandwidth parameters of all physical ports used by the service, where the bandwidth parameters include the total port bandwidth, used bandwidth, and pre-allocated bandwidth; The distributed transaction initiates a physical port bandwidth request, calculates the incremental bandwidth to be allocated, and associates the bandwidth allocation with the distributed transaction as an operation of the distributed transaction, wherein the first port used by the first distributed transaction is locked separately, and after the incremental bandwidth allocation is completed, the first port is unlocked; the second port resource used by the first distributed transaction is locked separately, and at the same time, the first port used by the second distributed transaction is locked separately, and after the incremental bandwidth allocation is completed, the first port and the second port are unlocked; Update the used bandwidth value and pre-allocated bandwidth value of the port, synchronize and persist them, submit the distributed transaction and execute it.
2. The method for QoS bandwidth allocation based on distributed transactions according to claim 1, characterized in that: The calculating of the incremental bandwidth to be allocated specifically includes: When the distributed transaction is allocated bandwidth, the pre-allocated bandwidth required for the distributed transaction is calculated; When the distributed transaction is to release bandwidth, the incremental bandwidth to be released is calculated.
3. The method for QoS bandwidth allocation based on distributed transactions according to claim 1, characterized in that: The bandwidth allocation is associated with the distributed transaction as an operation of the distributed transaction, specifically including: The allocation or release of bandwidth is regarded as an operation of a distributed transaction, and is associated with the distributed transaction, and is executed together when the transaction is committed.
4. The method for QoS bandwidth allocation based on distributed transactions according to claim 1, characterized in that: The calculating of the incremental bandwidth to be allocated specifically includes: Calculate the port incremental bandwidth to be allocated based on the user-specified bandwidth rate value set by the user for the service QoS; According to the used bandwidth and the incremental bandwidth, it is determined whether the available bandwidth of the requested port meets the incremental bandwidth requirement; If the incremental bandwidth requirement is met, the incremental bandwidth is pre-allocated and the pre-allocated bandwidth value in the cache is updated; If the incremental bandwidth requirement is not met, the allocation fails and an error is returned to the distributed transaction requesting the allocation.
5. The method for QoS bandwidth allocation based on distributed transactions according to claim 1, characterized in that: The updating of the used bandwidth value and the pre-allocated bandwidth value of the port specifically includes: When allocating bandwidth, the pre-allocated bandwidth value of the port in the application phase is added to the incremental bandwidth value associated with the distributed transaction, the used bandwidth value of the port in the transaction submission phase is added to the incremental bandwidth value associated with the distributed transaction, and the pre-allocated bandwidth value of the port is subtracted from the incremental bandwidth value associated with the distributed transaction. At the same time, the bandwidth data is persisted; When releasing bandwidth, there is no need to update the port data in the cache during the application phase. In the transaction submission phase, the used bandwidth value of the port is subtracted from the incremental bandwidth value associated with the distributed transaction, and the bandwidth data is persisted.
6. The method for QoS bandwidth allocation based on distributed transactions according to claim 1, characterized in that: When a distributed transaction is committed, it includes: When bandwidth is allocated, the distributed transaction is committed, the used bandwidth and pre-allocated bandwidth of the port in the cache are updated and persisted; When the bandwidth is released, the distributed transaction is committed, and only the used bandwidth of the port in the cache is updated and persisted.
7. The method for QoS bandwidth allocation based on distributed transactions according to claim 1, characterized in that: When a distributed transaction is rolled back, it also includes When allocating bandwidth, the distributed transaction is rolled back and the value of the pre-allocated bandwidth is updated to the result of subtracting the incremental bandwidth from the current pre-allocated bandwidth. The data is not persisted. When the bandwidth is released, the distributed transaction rolls back, the port's used bandwidth and pre-allocated bandwidth are not updated, and the data is not persisted.
8. The method for QoS bandwidth allocation based on distributed transactions according to claim 1, characterized in that: The distributed transaction initiates a physical port bandwidth request, further comprising: When a user creates, deletes, or modifies a service, a distributed transaction initiates a physical port bandwidth request; Bandwidth allocation and bandwidth release are divided into two stages: the application stage, for bandwidth allocation, the pre-allocation of bandwidth stage, for bandwidth release, the generation of incremental bandwidth to be released; the commit stage or rollback stage, the distributed transaction is committed, the update of cached data is confirmed, and it is persisted.
9. A device for QoS bandwidth allocation based on distributed transactions, characterized in that: The method comprises at least one processor and a memory, wherein the at least one processor and the memory are connected via a data bus, and the memory stores instructions that can be executed by the at least one processor, and after being executed by the processor, the instructions are used to complete the method for QoS bandwidth allocation based on distributed transactions as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Message transmission method and device
CN106161283A
Power line carrier communication data transmission method based on QoS (Quality of Service)
CN107317602A
A method and apparatus for quality of service control of distribute storage
CN108989439A
Resource processing method and device for distributed batch task scheduling, equipment and medium
CN113590320A
Variable Application of Quality of Service
US20190208445A1
