High-concurrency counting method based on MySQL counter and web server

A counting method and counter technology, which is applied in the web field, can solve problems such as low counting performance, inability to perform concurrent counting, easy blocking of counters, etc., and achieve the effect of improving efficiency

Active Publication Date: 2018-03-30
NUBIA TECHNOLOGY CO LTD
View PDF9 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The main purpose of the present invention is to propose a high concurrent counting method and web server based on MySQL counter tables, aiming to solve the problem that concurrent counting cannot be performed when using MySQL counter tables for counting in the prior art, resulting in easy blocking of counters and low counting performance technical problem

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • High-concurrency counting method based on MySQL counter and web server
  • High-concurrency counting method based on MySQL counter and web server
  • High-concurrency counting method based on MySQL counter and web server

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0048] It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0049] In the following description, use of suffixes such as 'module', 'part' or 'unit' for denoting elements is only for facilitating description of the present invention, and has no specific meaning by itself. Therefore, 'module', 'part' or 'unit' may be used in combination.

[0050] Web (World Wide Web, also known as WWW or World Wide Web) is an information service system that integrates text, sound, animation, video and other media information on the Internet. The entire web system consists of a Web server, a browser (Browser) and communication protocols. It consists of 3 parts. The communication protocol used by the Web system is the Hypertext Transfer Protocol (HTTP, HyperTextTransfer Protocol), which can transmit any type of data object, and is the main protocol for publishing multimedia information on the Int...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

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 concurrent counting operations on a large quantity of counting events at the same moment, it is guaranteed that the counting operation of the MySQL counter cannot be clogged,and the efficiency of high-concurrent counting is greatly improved.

Description

technical field [0001] The invention relates to the field of web technologies, in particular to a high concurrency counting method based on a MySQL counter table and a web server. Background technique [0002] MySQL counter tables are very common in web applications. For example, it is necessary to count the number of clicks by users on the website, the number of file downloads, and the number of new users on the website, etc., all of which need to use counters. Usually, web developers will create a separate table for count-related data, which can make the counter table small and fast, but in MySQL, there will be a row-level transaction for the row update operation of the counter of this record, that is, this Each record will have a global mutex. At the same time, only one process (or thread) can update the record. Therefore, in the case of high concurrency, the update operation of the counter will become very slow, causing the process (thread) to block and making the perfo...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30G06F9/54
CPCG06F9/546G06F9/547G06F2209/541G06F2209/548G06F16/25G06F16/958
Inventor 郑秋燕
Owner NUBIA TECHNOLOGY CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products