CN110659974A - Implementation method for realizing budget concurrency control based on queue principle - Google Patents
Implementation method for realizing budget concurrency control based on queue principle Download PDFInfo
- Publication number
- CN110659974A CN110659974A CN201910933725.9A CN201910933725A CN110659974A CN 110659974 A CN110659974 A CN 110659974A CN 201910933725 A CN201910933725 A CN 201910933725A CN 110659974 A CN110659974 A CN 110659974A
- Authority
- CN
- China
- Prior art keywords
- user
- queue
- time
- current
- budget
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 230000002159 abnormal effect Effects 0.000 claims description 2
- 238000012163 sequencing technique Methods 0.000 claims description 2
- 238000012369 In process control Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000010965 in-process control Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/12—Accounting
- G06Q40/125—Finance or payroll
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2308—Concurrency control
- G06F16/2315—Optimistic concurrency control
- G06F16/2322—Optimistic concurrency control using timestamps
-
- 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
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/10—Office automation; Time management
- G06Q10/103—Workflow collaboration or project management
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Finance (AREA)
- Accounting & Taxation (AREA)
- Human Resources & Organizations (AREA)
- General Business, Economics & Management (AREA)
- General Engineering & Computer Science (AREA)
- Entrepreneurship & Innovation (AREA)
- Economics (AREA)
- Marketing (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Technology Law (AREA)
- Development Economics (AREA)
- Databases & Information Systems (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention provides a method for realizing budget concurrent control based on a queue principle, which belongs to the technical field of computers and effectively performs budget control under the concurrent condition by utilizing the queue first-in first-out principle to queue with minimum granularity, thereby avoiding the problem of control failure under the concurrent condition and ensuring the performance of budget control.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method for realizing budget concurrent control based on a queue principle, which ensures the accuracy of control through the queue principle under the condition that the budget control is concurrent.
Background
With the construction of the management accounting system comprehensively promoted by the finance department, more and more enterprises pay attention to the role of the management accounting in enterprise management, the core work of the management accounting is budget management, advance prediction, control in affairs and assessment analysis after affairs cannot be carried out without budget, and the management accounting can really play a role in enterprise management only by promoting comprehensive budget management. Comprehensive budget management is undoubtedly the key point for managing accounting to exercise internal control in an enterprise. The budget control is an effective gripper for comprehensive budget management and is a core means for realizing the in-process control.
How to ensure that the budget control accurately and quickly carries out the budget control under the condition that the real-time control process is concurrent is a difficult problem in front of software developers.
Disclosure of Invention
In order to solve the technical problems, the invention provides a method for realizing budget concurrent control based on a queue principle, which solves the problem that when a comprehensive budget system controls a business system document, a plurality of users simultaneously take the same index execution number to perform budget control, the budget is exceeded, effectively improves the control accuracy of the comprehensive budget system and improves the management and control capability of enterprises. The present invention has the great advantage of creating queue in the smallest granularity and reducing the performance of program submission caused by waiting in queue.
The technical scheme of the invention is as follows:
a realization method for realizing budget concurrency control based on a queue principle comprises the following steps:
a: a queue structure policy comprising: a queue storage structure;
b: an enqueuing strategy, wherein enqueuing is performed according to the operation time of the user;
c: a dequeue strategy, wherein when a user performs budget control in a service system, the user circularly checks whether a current user is the same as a first user in a queue, if so, the user jumps out of the loop, continuously executes the following service logic and writes back an execution number, if not, the first user in the queue is judged whether the user failure time is exceeded, and if not, the polling is continuously performed; if the ratio exceeds: forcibly dequeuing the first user in the queue, and polling from the beginning of a new first user until the current user is the same as the first user in the queue;
d: and (3) an exception checking strategy, namely, after the first user in the queue exceeds the user failure time and is automatically dequeued, checking whether the user is in the queue or not when the execution number is written back, and if the user is not in the queue, prompting, controlling that the check is failed and needing to be checked again.
Further, in the above-mentioned case,
in step a, the queue storage structure mainly includes the following parts:
1) a main key: refers to a physical primary key;
2) indexes are as follows: primary key values of budget indicators;
3) the user: operating a user;
4) the enqueue time is as follows: the user operates the time.
The concrete structure is as follows:
queue table:
alias name | Column name | Type of field | Remarks for note |
Main key | ID | Varchar(36) | Record master key |
Index (I) | Metrics | Varchar(36) | |
User' s | User | Varchar(100) | |
Time of enqueue | QueueTime | Varchar(1000) |
Further, in the above-mentioned case,
and the enqueuing strategy inserts the corresponding budget control index, the user and the enqueuing time into the Queue table.
The dequeue strategy needs to configure polling interval time and user expiration time.
The dequeue strategy is as follows: defining a first Queue user, starting execution time, then sequencing the Queue table according to time, and comparing the user who is firstly queued with the current operation user at set intervals.
The method comprises the following specific steps:
(1) if the current user and the first enqueue user are the same user, continuing to execute subsequent business operation and then dequeuing;
(2) when the current operation user and the user who is firstly enqueued are not the same user, assigning the user who is firstly enqueued to the first-time queue user, detecting whether the first user in the queue is consistent with the current user again according to the polling interval time, and if so, executing the step (1); if not, detecting whether the first user in the current queue is consistent with the first user in the first queue, if so, executing (3), otherwise, executing (4)
(3) Detecting whether the time difference from the beginning to the present exceeds the user failure time, if not, continuing to circularly detect, if so, resetting the beginning time to the current time after the current user is forcibly dequeued, and assigning a first user in the queue to a first user in the queue;
(4) and assigning the first user of the current queue to the first queue user, and resetting the starting execution time. And continuing to circularly detect.
Further, in the above-mentioned case,
and D, when the business system document occurs, if the user failure time is exceeded, the execution number is not written back, and when the write-back is performed, whether the user is still in the queue is checked, if not, an abnormal prompt is thrown out, and if the write-back is performed continuously, the execution number is not written back.
The invention has the advantages that
By utilizing the principle of queue first-in first-out, budget control is effectively carried out under the concurrent condition, queuing is carried out with the minimum granularity, the problem of control failure under the concurrent condition is avoided, and meanwhile, the performance of budget control is ensured.
The problem of control failure of budget management software under the concurrent condition is well solved, and the accuracy of control data is ensured while the budget control performance is ensured through the queue with the minimum granularity.
Drawings
Fig. 1 is a schematic diagram of a process for implementing budget concurrency control based on a queue principle.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
The invention comprises the following contents: and implementing a queue structure strategy, an enqueue strategy, a dequeue strategy and an exception checking strategy.
The queue structure policy
The queue structure policy comprises: the queue stores the structure.
A queue storage structure:
1) the primary key refers to a physical primary key.
2) Indexes are as follows: primary key value of budget indicator.
3) The user: and operating the user.
4) The enqueue time is as follows: the user operates the time.
The concrete structure is as follows:
queue table:
alias name | Column name | Type of field | Remarks for note |
Main key | ID | Varchar(36) | Record master key |
Index (I) | Metrics | Varchar(36) | |
User' s | User | Varchar(100) | |
Time of enqueue | QueueTime | Varchar(1000) |
The enqueuing strategy
The enqueuing strategy is as follows: and queuing is carried out according to the operation time of the user, so that the fairness of control is ensured.
Dequeue strategy
The dequeue strategy is as follows: when the user performs budget control on a service system, circularly checking whether a current user is the same as a first user in the queue, if so, jumping out of a circle, continuously executing the subsequent service logic and writing back the execution number, if not, judging whether the first user in the queue exceeds the user failure time, and if not, continuously polling; if the ratio exceeds: and forcibly dequeuing the first user in the queue, and polling from the beginning of a new first user until the current user is the same as the first user in the queue.
The exception handling policy
The exception handling strategy is as follows: and after the first user in the queue exceeds the user failure time and is automatically dequeued, checking whether the user is in the queue or not during the write-back of the execution number, and if the user is not in the queue, prompting, controlling that the check is failed and needing to be checked again.
The details are as follows
1. Defining a queue storage structure:
2. the enqueuing implementation method comprises the following steps:
3. the dequeuing implementation method comprises the following steps:
4. concurrency control checking method
5. The exception handling method comprises the following steps:
6. calling example
1) Examination example
2) Write back execution
v/Exception handling
CheckQueue("admin");
V/processing write back execution number
...................
// dequeue
QueuePop("admin");
The above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (8)
1. A realization method for realizing budget concurrency control based on a queue principle is characterized in that,
the method comprises the following steps:
a: a queue structure policy comprising: a queue storage structure;
b: an enqueuing strategy, wherein enqueuing is performed according to the operation time of the user;
c: a dequeue strategy, wherein when a user performs budget control in a service system, the user circularly checks whether a current user is the same as a first user in a queue, if so, the user jumps out of the loop, continuously executes the following service logic and writes back an execution number, if not, the first user in the queue is judged whether the user failure time is exceeded, and if not, the polling is continuously performed; if the ratio exceeds: forcibly dequeuing the first user in the queue, and polling from the beginning of a new first user until the current user is the same as the first user in the queue;
d: and (3) an exception checking strategy, namely, after the first user in the queue exceeds the user failure time and is automatically dequeued, checking whether the user is in the queue or not when the execution number is written back, and if the user is not in the queue, prompting, controlling that the check is failed and needing to be checked again.
2. The method according to claim 1, wherein,
in step a, the queue storage structure mainly includes the following parts:
1) a main key: refers to a physical primary key;
2) indexes are as follows: primary key values of budget indicators;
3) the user: operating a user;
4) the enqueue time is as follows: the user operates the time.
4. the method of claim 3,
and the enqueuing strategy inserts the corresponding budget control index, the user and the enqueuing time into the Queue table.
5. The method of claim 1,
the dequeue strategy needs to configure polling interval time and user expiration time.
6. The method of claim 5,
the dequeue strategy is as follows: defining a first Queue user, starting execution time, then sequencing the Queue table according to time, and comparing the user who is firstly queued with the current operation user at set intervals.
7. The method of claim 6,
the method comprises the following specific steps:
(1) if the current user and the first enqueue user are the same user, continuing to execute subsequent business operation and then dequeuing;
(2) when the current operation user and the user who is firstly enqueued are not the same user, assigning the user who is firstly enqueued to the first-time queue user, detecting whether the first user in the queue is consistent with the current user again according to the polling interval time, and if so, executing the step (1); if not, detecting whether the first user of the current queue is consistent with the first-time queue user,
if yes, execute (3), if not, execute (4)
(3) Detecting whether the time difference from the beginning to the present exceeds the user failure time, if not, continuing to circularly detect, if so, resetting the beginning time to the current time after the current user is forcibly dequeued, and assigning a first user in the queue to a first user in the queue;
(4) and assigning the first user of the current queue to the first queue user, and resetting the starting execution time. And continuing to circularly detect.
8. The method of claim 1,
and D, when the business system document occurs, if the user failure time is exceeded, the execution number is not written back, and when the write-back is performed, whether the user is still in the queue is checked, if not, an abnormal prompt is thrown out, and if the write-back is performed continuously, the execution number is not written back.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910933725.9A CN110659974A (en) | 2019-09-29 | 2019-09-29 | Implementation method for realizing budget concurrency control based on queue principle |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910933725.9A CN110659974A (en) | 2019-09-29 | 2019-09-29 | Implementation method for realizing budget concurrency control based on queue principle |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110659974A true CN110659974A (en) | 2020-01-07 |
Family
ID=69039855
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910933725.9A Pending CN110659974A (en) | 2019-09-29 | 2019-09-29 | Implementation method for realizing budget concurrency control based on queue principle |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110659974A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030065892A1 (en) * | 2001-09-28 | 2003-04-03 | Bonola Thomas J. | Concurrent non-blocking FIFO array |
CN102521095A (en) * | 2011-12-19 | 2012-06-27 | 盛科网络(苏州)有限公司 | Simulation method and simulation system for chips in unordered queue |
CN110011934A (en) * | 2019-03-15 | 2019-07-12 | 浙江大学 | A kind of mixing queue architecture and mixed scheduling method for Input queue switch |
-
2019
- 2019-09-29 CN CN201910933725.9A patent/CN110659974A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030065892A1 (en) * | 2001-09-28 | 2003-04-03 | Bonola Thomas J. | Concurrent non-blocking FIFO array |
CN102521095A (en) * | 2011-12-19 | 2012-06-27 | 盛科网络(苏州)有限公司 | Simulation method and simulation system for chips in unordered queue |
CN110011934A (en) * | 2019-03-15 | 2019-07-12 | 浙江大学 | A kind of mixing queue architecture and mixed scheduling method for Input queue switch |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020181813A1 (en) | Task scheduling method based on data processing and related device | |
US8763012B2 (en) | Scalable, parallel processing of messages while enforcing custom sequencing criteria | |
EP2893444B1 (en) | Quota-based resource management | |
US9529626B2 (en) | Facilitating equitable distribution of thread resources for job types associated with tenants in a multi-tenant on-demand services environment | |
US10552213B2 (en) | Thread pool and task queuing method and system | |
CN111338791A (en) | Method, device and equipment for scheduling cluster queue resources and storage medium | |
CN110263048B (en) | Method and device for processing large-batch data, computer equipment and storage medium | |
US10558810B2 (en) | Device monitoring policy | |
CN104011680A (en) | Scheduling virtual central processing units of virtual machines among physical processing units | |
CN111949497B (en) | Message queue system and message processing method based on same | |
CN109685454A (en) | Data checking method, device, equipment and storage medium | |
CN109117280B (en) | Electronic device, method for limiting inter-process communication thereof and storage medium | |
CN109492024A (en) | Data processing method, device, computer equipment and storage medium | |
JP2006309586A (en) | Program, method and device for batch scheduling | |
CN113391911B (en) | Dynamic scheduling method, device and equipment for big data resources | |
CN110968410A (en) | Task failure retry method and device, computer equipment and storage medium | |
Liu et al. | Towards low-latency I/O services for mixed workloads using ultra-low latency SSDs | |
CN114327894A (en) | Resource allocation method, device, electronic equipment and storage medium | |
CN110659974A (en) | Implementation method for realizing budget concurrency control based on queue principle | |
CN110033242B (en) | Working time determining method, device, equipment and medium | |
CN115237577A (en) | Job scheduling method and device based on priority queue | |
CN108874325B (en) | Data printing method and system | |
CN115687491A (en) | Data analysis task scheduling system based on relational database | |
CN1825288A (en) | Method for implementing process multi-queue dispatching of embedded SRAM operating system | |
CN115454718A (en) | Automatic database backup file validity detection method |
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 |