High-concurrency counting method based on MySQL counter and web server
The invention discloses a high-concurrency counting method based on a MySQL counter. The method comprises the steps of setting multiple trenches in the MySQL counter, and storing multiple trench values corresponding to the multiple trenches into a preset stack; detecting whether counting events occu...
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Patent |
Sprache: | chi ; eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | The invention discloses a high-concurrency counting method based on a MySQL counter. The method comprises the steps of setting multiple trenches in the MySQL counter, and storing multiple trench values corresponding to the multiple trenches into a preset stack; detecting whether counting events occur or not in real time; if the counting events are detected, storing the counting events to a messagequeue; opening multiple counting threads of which the number is the same as that of the trenches to make all the counting stacks read the counting events from the message queue, reading the trench values from the preset stack, updating the counting events to the trench values, deleting the counting events which are already counted from the message queue, and returning the updated trench values tothe preset stack. Compared with the prior art, through the message queue, the counting operation of a web application and the counting operation of the MySQL counter are decoupled; by setting the multiple trenches to conduct |
---|