CN109446464B - Concurrency number determination method and device and server - Google Patents

Concurrency number determination method and device and server Download PDF

Info

Publication number
CN109446464B
CN109446464B CN201811334177.XA CN201811334177A CN109446464B CN 109446464 B CN109446464 B CN 109446464B CN 201811334177 A CN201811334177 A CN 201811334177A CN 109446464 B CN109446464 B CN 109446464B
Authority
CN
China
Prior art keywords
preset
time
request
current
concurrency
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
Application number
CN201811334177.XA
Other languages
Chinese (zh)
Other versions
CN109446464A (en
Inventor
张民遐
刘宽平
赵君辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Gaodeng Weixing Technology Co.,Ltd.
Original Assignee
Shenzhen Gaodeng Computer Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Gaodeng Computer Technology Co Ltd filed Critical Shenzhen Gaodeng Computer Technology Co Ltd
Priority to CN201811334177.XA priority Critical patent/CN109446464B/en
Publication of CN109446464A publication Critical patent/CN109446464A/en
Application granted granted Critical
Publication of CN109446464B publication Critical patent/CN109446464B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a concurrency number determining method, a concurrency number determining device and a server, and relates to the technical field of computer data processing. The method comprises the steps of obtaining the number of request messages in a first preset time length; and then according to the preset determination rule and the number of the request messages, determining the concurrency number from the counting time to the current time, so that the time of the counted concurrency number is close to the current time, and the timeliness of the concurrency number is improved. In addition, the time length between the statistical time and the current time is a second preset time length which is greater than or equal to the first preset time length, namely, a new concurrency number can be determined every other second preset time length, so that the timeliness of the determined concurrency number is improved.

Description

Concurrency number determination method and device and server
Technical Field
The invention relates to the technical field of computer data processing, in particular to a concurrency number determining method, a concurrency number determining device and a server.
Background
The concurrency number may refer to a Query Per Second (QPS), which is a measure of how much traffic a specific Query server processes within a specified time, and may refer to the number of connections accessing a server site within one Second. For example, when a web page is browsed, the server may establish links with the browser of the browser, each link representing a concurrency. Since the virtual host is established on a multi-user basis, i.e. a plurality of user terminals share one server. If a plurality of user terminals access the same server at the same time, the server can record the number of connections accessing the server at the same time, but in the prior art, the concurrency number is generally calculated by analyzing log data, so that the consumed resources are large, the concurrency number is difficult to be used as real-time data, namely, the determined concurrency number is delayed data, and the timeliness of the concurrency number is low.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a concurrency number determining method, a concurrency number determining device and a server, which can solve the problem of low timeliness of the determined concurrency number.
In order to achieve the above object, the technical solutions provided by the embodiments of the present invention are as follows:
in a first aspect, an embodiment of the present invention provides a concurrency number determining method, where the method includes:
acquiring the number of request messages within a first preset time length;
and determining the concurrency number from the counting time to the current time according to a preset determination rule and the number of the request messages, wherein the time length between the counting time and the current time is a second preset time length which is greater than or equal to the first preset time length.
Optionally, the obtaining the number of the request packets within the first preset time duration includes:
and acquiring a request message sent by the user terminal based on an optical character recognition interface, and counting the number of the request message in the first preset time.
Optionally, the first preset duration is one second, and the counting the number of the request packets in the first preset duration includes:
and associating the current second and a preset request name as a Key based on a Key-Value database, caching, and determining the number of the request messages in the current second based on the corresponding relation between the Value obtained through a preset strategy and the number of the request messages.
Optionally, the Value obtained by the preset policy includes:
and within the current second, calling the Key once when the request message is the request message corresponding to the preset request name, and performing accumulation operation on a preset initial Value to obtain the Value after the Key is called.
Optionally, before obtaining the number of the request packets within the first preset time, the method further includes:
and classifying the request message according to the request name corresponding to the request message.
Optionally, the determining, according to a preset determination rule and the number of the request packets, a concurrency number from a statistical time to a current time includes:
and determining the maximum quantity of the quantities corresponding to the multiple sets of the first preset time lengths as the concurrency number from the counting time to the current time.
In a second aspect, an embodiment of the present invention provides a concurrency number determining apparatus, where the apparatus includes:
the device comprises an obtaining unit, a sending unit and a receiving unit, wherein the obtaining unit is used for obtaining the number of request messages in a first preset time length;
and the determining unit is used for determining the concurrency number from the counting time to the current time according to a preset determining rule and the number of the request messages, wherein the time length between the counting time and the current time is a second preset time length which is greater than or equal to the first preset time length.
Optionally, the obtaining unit is further configured to:
and acquiring a request message sent by the user terminal based on an optical character recognition interface, and counting the number of the request message in the first preset time.
Optionally, the obtaining unit is further configured to:
and associating the current second and a preset request name as a Key based on a Key-Value database, caching, and determining the number of the request messages in the current second based on the corresponding relation between the Value obtained through a preset strategy and the number of the request messages.
In a third aspect, an embodiment of the present invention provides a server, including:
a storage unit;
a processing unit; and
a concurrency number determination device including one or more software functional modules stored in the storage unit and executed by the processing unit, the concurrency number determination device comprising:
the device comprises an obtaining unit, a sending unit and a receiving unit, wherein the obtaining unit is used for obtaining the number of request messages in a first preset time length;
and the determining unit is used for determining the concurrency number from the counting time to the current time according to a preset determining rule and the number of the request messages, wherein the time length between the counting time and the current time is a second preset time length which is greater than or equal to the first preset time length.
Compared with the prior art, the concurrency number determining method, the concurrency number determining device and the server provided by the invention at least have the following beneficial effects: the method comprises the steps of obtaining the number of request messages in a first preset time length; and then according to the preset determination rule and the number of the request messages, determining the concurrency number from the counting time to the current time, so that the time of the counted concurrency number is close to the current time, and the timeliness of the concurrency number is improved. In addition, the time length between the statistical time and the current time is a second preset time length which is greater than or equal to the first preset time length, namely, a new concurrency number can be determined every other second preset time length, so that the timeliness of the determined concurrency number is improved.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments will be briefly described below. It is appreciated that the following drawings depict only some embodiments of the invention and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
Fig. 1 is a schematic diagram of interaction between a server and a user terminal according to an embodiment of the present invention.
Fig. 2 is a block diagram of a server according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating a concurrency number determination method according to an embodiment of the present invention.
Fig. 4 is a block diagram of a concurrency number determining apparatus according to an embodiment of the present invention.
Icon: 10-a server; 11-a processing unit; 12-a communication unit; 13-a storage unit; 20-a user terminal; 100-concurrency number determination means; 110-an obtaining unit; 120-determination unit.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely a few embodiments of the invention, and not all embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Furthermore, the terms "first," "second," and the like are used merely to distinguish one description from another, and are not to be construed as indicating or implying relative importance.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, an interaction diagram of a server 10 and a user terminal 20 according to an embodiment of the present invention is provided. The server 10 provided by the embodiment of the present invention can establish a communication connection with at least one user terminal 20 through a network to perform data interaction. In addition, the server 10 may count the number of concurrencies caused by the access of the user terminal 20 to the server 10. The concurrency number may refer to a Query Per Second (QPS), which is a measure of how much traffic a specific Query server 10 processes in a specified time, and may refer to the number of connections accessing a service site in one Second.
For example, in a banking institution, it is usually necessary to read and authenticate the user's identification card, and then handle corresponding services after the authentication is passed, such as changing the password or registering a new card or other services. At this time, the user terminal 20 may scan the identity card to obtain corresponding identity information, and then send a request message for identity authentication to the server 10, and the server 10 or another server 10 communicatively connected to the server 10 may authenticate the identity based on the request message. In addition, if a plurality of user terminals 20 simultaneously transmit request messages to the server 10 at the same time, the server 10 may count the number of concurrent requests.
The number of the user terminals 20 communicatively connected to the server 10 may be one or more, and the number may be set according to actual circumstances, and is not particularly limited herein.
In the present embodiment, the user terminal 20 may be, but is not limited to, a smart phone, a Personal Computer (PC), a tablet PC, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and the like. The network may be, but is not limited to, a wired network or a wireless network.
Fig. 2 is a block diagram of a server 10 according to an embodiment of the present invention. In this embodiment, the server 10 may include a processing unit 11, a communication unit 12, a storage unit 13, and a concurrency determination apparatus 100, where the processing unit 11, the communication unit 12, the storage unit 13, and the concurrency determination apparatus 100 are directly or indirectly electrically connected to each other to implement data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The processing unit 11 may be an integrated circuit chip having signal processing capabilities. The processing unit 11 may be a general purpose processor. For example, the Processor may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Network Processor (NP), or the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed.
The communication unit 12 is used for establishing a communication connection between the server 10 and the user terminal 20 or other servers 10 via a network, and transceiving data via the network.
The storage unit 13 may be, but is not limited to, a random access memory, a read only memory, a programmable read only memory, an erasable programmable read only memory, an electrically erasable programmable read only memory, or the like. In this embodiment, the storage unit 13 may be configured to store data such as a Key-Value database and a preset duration. Of course, the storage unit 13 may also be used for storing a program, which the processing unit 11 executes upon receiving an execution instruction.
Further, the concurrency number determining apparatus 100 includes at least one software function module which may be stored in the storage unit 13 in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the server 10. The processing unit 11 is configured to execute executable modules stored in the storage unit 13, such as software functional modules and computer programs included in the concurrency number determination apparatus 100.
It is understood that the configuration shown in fig. 2 is merely a schematic diagram of the configuration of the server 10, and that the server 10 may include more or less components than those shown in fig. 2. The components shown in fig. 2 may be implemented in hardware, software, or a combination thereof.
Fig. 3 is a flowchart illustrating a method for determining a concurrency number according to an embodiment of the present invention. The method for determining the number of concurrency provided by the embodiment of the invention can be applied to the server 10, and the server 10 executes each step of the method for determining the number of concurrency, so that the timeliness of the determined number of concurrency can be improved, and the phenomenon that the determined number of concurrency loses reference function due to the fact that the determined number of concurrency is too long from the current moment can be avoided. The concurrency number may be used for pressure monitoring of the server 10, and may be used as a basis for system framework and business process optimization of the server 10. For example, the larger the concurrency number is, the greater the pressure of the server 10 is, and at this time, the data processing service may be shared by other servers 10, so as to reduce the data processing pressure of the current server 10.
In this embodiment, the concurrency number determination method may include the steps of:
step S210, obtaining the number of request messages in a first preset time length;
step S220, according to a preset determination rule and the number of the request messages, determining the concurrency number from the counting time to the current time, wherein the time length between the counting time and the current time is a second preset time length which is greater than or equal to the first preset time length.
The steps of the concurrency determination method shown in fig. 3 will be described in detail below:
step S210, obtaining the number of request messages within a first preset duration.
The first preset duration may be set according to an actual situation, and the number of the request messages may be understood as the number of the request messages.
In this embodiment, step S210 may include: acquiring a request message sent by the user terminal 20 based on the optical character recognition interface, and counting the number of the request messages in a first preset time length.
An Optical Character Recognition (OCR) interface refers to a collection interface in an electronic device. Such as an interface for an external scanner or digital camera in a personal computer. OCR is understood to be a process in which a scanner or digital camera inspects characters printed on paper, determines their shapes by detecting dark and light patterns, and then translates the shapes into computer text using character recognition methods; the characters in the paper document are optically converted into image files with black and white dot matrixes for the print characters, and the characters in the images are converted into text formats through recognition software for further editing and processing by character processing software. For example, in identification card authentication, the user terminal 20 may extract identity information corresponding to the identification card by using a scanner or a digital camera based on OCR, and then the user terminal 20 transmits the identity information to the server 10 for authentication.
In this embodiment, step S210 may include: and based on a Key-Value database, associating the current second and the preset request name as a Key, caching, and determining the number of the request messages in the current second based on the corresponding relation between the Value obtained through a preset strategy and the number of the request messages.
The association between the current second and the preset request name is Key, which can be understood as: and establishing a mapping relation between the current one-second time information and a preset request name, and using the mapping relation as Key. For example, if the current second of a day is 00:00:01, the preset request name may be a name representing "identification" used for identification of an identification card, and the preset request name may be a name representing "identification" used for identification of the identification card, then the mapping relationship between "00: 00: 01" and "identification" may be established and used as a Key, so that the Key is used to count the concurrence number of the request name "identification" in the current second. In addition, after the statistics is completed, the user can also search the concurrence number with the time of 00:00:01 and the request name of 'identification' through the mapping relation. Of course, the preset request name may be set according to actual situations, and is not limited specifically here.
In this embodiment, the preset policy may be set according to actual conditions, for example, in the current second, every time an access request is received, a Key is called, and every time a Key is called, an addition operation is performed on a Value of the Key. In addition, each time a fixed constant, such as the numbers 1, 2, 3, etc., may be added to the Value.
When caching Key, Redis can be used for caching. Redis is an open source log-type and Key-Value database which is written by using ANSI C language, supports network, can be based on memory and can also be persistent, and provides API of multiple languages. The ANSI is a character code, and 1 byte in the range of 0x 00-0 x7f is usually used to represent 1 english character in order to make the computer support more languages. An API refers to an Application Programming Interface (API).
Understandably, Redis is a Key-Value storage system. Redis supports master-slave synchronization. Data may be synchronized from a master server 10 to any number of slave servers 10, and a slave server 10 may be a master server 10 associated with other slave servers 10. This enables Redis to perform single-level tree replication. The storage disk can write data intentionally or unintentionally. Due to the implementation of the publish/subscribe mechanism, when the tree is synchronized anywhere from the database, a channel can be subscribed to and the complete message publication record of the master server 10 can be received. Based on this, it is helpful to improve scalability of synchronization to read operations and to facilitate data backup so that source data can be retrieved from other servers 10 even if the source data is lost or damaged.
In this embodiment, if there are a plurality of servers 10 in the network environment, the server 10 executing the concurrency number determination method may be the main server 10.
For example, the first preset time period is one second. Step S210 may include: and in the current second, calling a Key once when the request message is the request message corresponding to the preset request name, and performing accumulation operation on the preset initial Value to obtain the Value after the Key is called.
Understandably, the request message includes the request type and the request name of the request message. After receiving the request message, the server 10 can call the Key corresponding to the message name of the request message. If the message name of the request message is the same as the preset message name in the Key or has a preset mapping relation, the Key corresponds to the request message. After each call, the Value corresponding to Key can be incremented by 1. Before the Key is called for the first time, the Value may be a preset Value (a preset initial Value), and may be set according to an actual situation.
Specifically, for example, the first preset duration is one second, for example, the preset initial Value is 0, if an access request is received within one second, a Key is called once, 1 is added to the initial Value after the Key is called once, and the final Value is 1 after the Value is added to 1. If the access request is received three times within one second, the Key is called 3 times correspondingly, then the accumulation operation of adding 1 to the initial Value three times is carried out, and then the final Value of 3 is obtained.
Prior to step S210, the concurrency number determination method may further include: and classifying the request message according to the request name corresponding to the request message.
For example, in a banking institution, the service types of the request message may include a transfer service, a withdrawal service, a register new card service, a change of encryption service, and the like. Understandably, based on the step, after the request message is classified, the concurrency number corresponding to each type of classified service is determined, which is helpful for a manager to monitor and manage the processing pressure of each type of service.
Step S220, according to a preset determination rule and the number of the request messages, determining the concurrency number from the counting time to the current time, wherein the time length between the counting time and the current time is a second preset time length which is greater than or equal to the first preset time length.
Understandably, the second preset duration can be set according to the actual situation, and the statistical time corresponds to the second preset duration. For example, the second preset time period is set to be a time period between 5 seconds and 60 seconds, for example, if the second preset time period is 5 seconds, and in the same day, if the current time is 00:00:10 (may refer to the time when zero-minute-ten seconds end), the statistical time is 00:00:05 (may refer to the time when zero-minute-zero-five seconds end; that is, the second preset time period is pushed back from the current time). The server 10 calculates the number of concurrencies of request messages during the periods 00:00:05-00:00: 10.
In this embodiment, the preset determination rule for determining the concurrency number may be set according to the actual situation, for example, step S220 may include: and determining the maximum number of the numbers corresponding to the multiple first preset durations as the concurrency number in the period from the counting time to the current time, or determining the average value of the total number of the message requests in the period from the counting time to the current time to the time as the concurrency number.
Specifically, for example, the first preset time period is 1 second, and the second preset time period is 5 seconds, the server 10 may obtain the number of 5 request messages in 5 seconds, and then select the maximum number from the 5 numbers to serve as the concurrency number.
Or the first preset time length is the same as the second preset time length, and is 5 seconds, and then the average value of the message request number in 5 seconds is used as the concurrency number. That is, the server 10 may obtain the total number of request messages in 5 seconds, and then divide the total number by the time 5 seconds to obtain the concurrency number.
That is, the server 10 may obtain a new concurrency number every 5 seconds by the above method, so that the time of the determined concurrency number is close to the current time, thereby improving the timeliness of the concurrency number, and the concurrency number may be used as effective data for analysis and processing by related personnel or the server 10. For example, the concurrency number may be used for pressure monitoring of the server 10, and may be used as a basis for optimization of the system framework and business process of the server 10.
Based on the above design, the server 10 may obtain the QPS value in real time in the program, and then perform different business processes according to the value, so as to prevent the service from crashing due to exceeding the load limit, and at the same time, may also be used to display the QPS value, and send an early warning prompt according to the QPS value for the service processing capability, for example, if the QPS value exceeds a preset threshold. The preset threshold may be set according to an actual situation, for example, whether the request exceeds the upper limit of the load may be determined by determining whether the QPS value of a second is greater than a threshold, and then different service logic processes may be performed according to the determination.
Fig. 4 is a block diagram of a concurrency determination apparatus 100 according to an embodiment of the present invention. The concurrency number determining apparatus 100 provided by the embodiment of the present invention may be applied to the server 10, and the concurrency number determining apparatus 100 may be configured to execute or implement each step of the concurrency number determining method, so as to solve the problem of low timeliness of the determined concurrency number in the prior art. The concurrency number determination apparatus 100 may include an obtaining unit 110 and a determining unit 120.
An obtaining unit 110, configured to obtain the number of request packets in a first preset time duration.
Optionally, the obtaining unit 110 is further configured to: acquiring a request message sent by the user terminal 20 based on the optical character recognition interface, and counting the number of the request messages in a first preset time length.
Optionally, the obtaining unit 110 is further configured to: and based on a Key-Value database, associating the current second and the preset request name as a Key, caching, and determining the number of the request messages in the current second based on the corresponding relation between the Value obtained through a preset strategy and the number of the request messages.
Optionally, the obtaining unit 110 is further configured to: and in the current second, calling a Key once when the request message is the request message corresponding to the preset request name, and performing accumulation operation on the preset initial Value to obtain the Value after the Key is called.
The determining unit 120 is configured to determine the concurrency number from the statistical time to the current time according to a preset determination rule and the number of the request messages, where a time duration between the statistical time and the current time is a second preset time duration greater than or equal to the first preset time duration.
Optionally, the concurrency number determination apparatus 100 may further include a classification unit. Before the obtaining unit 110 obtains the number of the request messages within the first preset duration, the classifying unit is configured to classify the request messages according to the request names corresponding to the request messages.
It should be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the concurrency number determination apparatus 100 described above may refer to the corresponding process of each step in the foregoing method, and will not be described in detail herein.
The embodiment of the invention also provides a computer readable storage medium. The readable storage medium has stored therein a computer program that, when run on a computer, causes the computer to execute the concurrency number determination method as described in the above embodiments.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by hardware, or by software plus a necessary general hardware platform, and based on such understanding, the technical solution of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the method described in the embodiments of the present invention.
In summary, the present invention provides a concurrency number determination method, a device and a server. The method comprises the steps of obtaining the number of request messages in a first preset time length; and then according to the preset determination rule and the number of the request messages, determining the concurrency number from the counting time to the current time, so that the time of the counted concurrency number is close to the current time, and the timeliness of the concurrency number is improved. In addition, the time length between the statistical time and the current time is a second preset time length which is greater than or equal to the first preset time length, namely, a new concurrency number can be determined every other second preset time length, so that the timeliness of the determined concurrency number is improved.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, system, and method may be implemented in other ways. The apparatus, system, and method embodiments described above are illustrative only, as the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
Alternatively, all or part of the implementation may be in software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (4)

1. A concurrency determination method, comprising:
acquiring the number of request messages within a first preset time length;
determining the concurrency number from the counting time to the current time according to a preset determination rule and the number of the request messages, wherein the method comprises the following steps: determining that the maximum number of the numbers corresponding to the multiple sets of the first preset time lengths is the concurrency number in the period from the counting time to the current time, or determining that the average value of the total number of the message requests in the period from the counting time to the current time is the concurrency number;
wherein, the counting time and the current time are a second preset time which is longer than or equal to the first preset time, and the obtaining the number of the request messages in the first preset time comprises:
acquiring a request message sent by a user terminal based on an optical character recognition interface, and counting the number of the request message within a first preset time, wherein the first preset time is one second, and the counting the number of the request message within the first preset time comprises the following steps:
based on a Key-Value database, associating a current second and a preset request name as a Key and caching, and determining the number of the request messages in the current second based on a corresponding relation between a Value obtained through a preset strategy and the number of the request messages, wherein the Value obtained through the preset strategy comprises the following steps:
and within the current second, calling the Key once when the request message is the request message corresponding to the preset request name, and performing accumulation operation on a preset initial Value to obtain the Value after the Key is called.
2. The method according to claim 1, wherein before obtaining the number of request packets within the first preset duration, the method further comprises:
and classifying the request message according to the request name corresponding to the request message.
3. A concurrency determination device, comprising:
the device comprises an obtaining unit, a sending unit and a receiving unit, wherein the obtaining unit is used for obtaining the number of request messages in a first preset time length;
a determining unit, configured to determine a concurrency number from a statistical time to a current time according to a preset determination rule and the number of the request packets, including: determining that the maximum number of the numbers corresponding to the multiple sets of the first preset time lengths is the concurrency number in the period from the counting time to the current time, or determining that the average value of the total number of the message requests in the period from the counting time to the current time is the concurrency number;
wherein, the duration between the statistical time and the current time is a second preset duration which is greater than or equal to the first preset duration, and the obtaining unit is further configured to: acquiring a request message sent by a user terminal based on an optical character recognition interface, and counting the number of the request message in the first preset time;
the first preset duration is one second, and the obtaining unit is further configured to:
based on a Key-Value database, associating a current second and a preset request name as a Key and caching, and determining the number of the request messages in the current second based on a corresponding relation between a Value obtained through a preset strategy and the number of the request messages, wherein the Value obtained through the preset strategy comprises the following steps:
and within the current second, calling the Key once when the request message is the request message corresponding to the preset request name, and performing accumulation operation on a preset initial Value to obtain the Value after the Key is called.
4. A server, comprising:
a storage unit;
a processing unit; and
a concurrency number determination device including one or more software functional modules stored in the storage unit and executed by the processing unit, the concurrency number determination device comprising:
the device comprises an obtaining unit, a sending unit and a receiving unit, wherein the obtaining unit is used for obtaining the number of request messages in a first preset time length;
a determining unit, configured to determine a concurrency number from a statistical time to a current time according to a preset determination rule and the number of the request packets, including: determining that the maximum number of the numbers corresponding to the multiple sets of the first preset time lengths is the concurrency number in the period from the counting time to the current time, or determining that the average value of the total number of the message requests in the period from the counting time to the current time is the concurrency number;
wherein, the duration between the statistical time and the current time is a second preset duration which is greater than or equal to the first preset duration, and the obtaining unit is further configured to: acquiring a request message sent by a user terminal based on an optical character recognition interface, and counting the number of the request message in the first preset time;
the first preset duration is one second, and the obtaining unit is further configured to:
based on a Key-Value database, associating a current second and a preset request name as a Key and caching, and determining the number of the request messages in the current second based on a corresponding relation between a Value obtained through a preset strategy and the number of the request messages, wherein the Value obtained through the preset strategy comprises the following steps:
and within the current second, calling the Key once when the request message is the request message corresponding to the preset request name, and performing accumulation operation on a preset initial Value to obtain the Value after the Key is called.
CN201811334177.XA 2018-11-09 2018-11-09 Concurrency number determination method and device and server Active CN109446464B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811334177.XA CN109446464B (en) 2018-11-09 2018-11-09 Concurrency number determination method and device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811334177.XA CN109446464B (en) 2018-11-09 2018-11-09 Concurrency number determination method and device and server

Publications (2)

Publication Number Publication Date
CN109446464A CN109446464A (en) 2019-03-08
CN109446464B true CN109446464B (en) 2021-02-02

Family

ID=65550885

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811334177.XA Active CN109446464B (en) 2018-11-09 2018-11-09 Concurrency number determination method and device and server

Country Status (1)

Country Link
CN (1) CN109446464B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398857A (en) * 2008-11-12 2009-04-01 北京星网锐捷网络技术有限公司 Data synchronization method in embedded distribution system and embedded distribution system
CN103051724A (en) * 2012-12-28 2013-04-17 北京思特奇信息技术股份有限公司 Socket synchronization method based on long connection

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101707618B (en) * 2009-12-10 2013-01-30 福建星网锐捷网络有限公司 Authentication control method, device, system and authentication server
US10003802B1 (en) * 2012-04-18 2018-06-19 Matrox Graphics Inc. Motion-based adaptive quantization
CN104408088B (en) * 2014-11-11 2020-06-19 奇安信科技集团股份有限公司 Concurrent request control method and device
CN107276912B (en) * 2016-04-07 2021-08-27 华为技术有限公司 Memory, message processing method and distributed storage system
CN107547548B (en) * 2017-09-05 2020-06-30 北京京东尚科信息技术有限公司 Data processing method and system
CN107566516B (en) * 2017-09-25 2019-12-03 平安科技(深圳)有限公司 Concurrent amount control method, application server and system
CN108551465B (en) * 2018-03-09 2020-06-09 平安科技(深圳)有限公司 Server concurrency control method and device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398857A (en) * 2008-11-12 2009-04-01 北京星网锐捷网络技术有限公司 Data synchronization method in embedded distribution system and embedded distribution system
CN103051724A (en) * 2012-12-28 2013-04-17 北京思特奇信息技术股份有限公司 Socket synchronization method based on long connection

Also Published As

Publication number Publication date
CN109446464A (en) 2019-03-08

Similar Documents

Publication Publication Date Title
US10606806B2 (en) Method and apparatus for storing time series data
US8701127B2 (en) Web services access to content items stored by collaboration systems
CN106933614B (en) Single-page application upgrading method and device
US20150319238A1 (en) Method, device and storage medium for data processing
CN110019873B (en) Face data processing method, device and equipment
US20190073271A1 (en) Device backup and wipe
CN111680008A (en) Log processing method and system, readable storage medium and intelligent device
WO2017174013A1 (en) Data storage management method and apparatus, and data storage system
CN111274256A (en) Resource control method, device, equipment and storage medium based on time sequence database
CN112328592A (en) Data storage method, electronic device and computer readable storage medium
CN109710502B (en) Log transmission method, device and storage medium
KR20170090874A (en) Self defense security apparatus with behavior and environment analysis and operating method thereof
CN113535677B (en) Data analysis query management method, device, computer equipment and storage medium
CN114125015A (en) Data acquisition method and system
CN109446464B (en) Concurrency number determination method and device and server
CN111046393B (en) Vulnerability information uploading method and device, terminal equipment and storage medium
KR102482044B1 (en) some kind of data processing
US20140025824A1 (en) Load dispersion system, control method for load dispersion system, and storage medium
CN113852610B (en) Message processing method, device, computer equipment and storage medium
CN109409090B (en) Website background detection method and device and server
CN107526530B (en) Data processing method and device
US11526446B1 (en) Modifying caching amongst services from a history of requests and responses
CN109656805B (en) Method and device for generating code link for business analysis and business server
US9984074B2 (en) Information processing apparatus and non-transitory computer readable medium
JP2019508762A (en) Evaluation information matching method, apparatus and server

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
CB02 Change of applicant information

Address after: 27D, building 2, building 1, Dachong Business Center (phase II), 9678 Shennan Avenue, Dachong community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen Gaodeng Computer Technology Co.,Ltd.

Address before: 570100 Hainan Ecological Software Park

Applicant before: HAINAN GAODENG TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20221221

Address after: Room 812, Kechuang Building, No. 860, West Wangjiang Road, High tech Zone, Hefei City, Anhui Province, 230000

Patentee after: Anhui Gaodeng Weixing Technology Co.,Ltd.

Address before: 27D, building 2, building 1, Dachong Business Center (phase II), 9678 Shennan Avenue, Dachong community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: Shenzhen Gaodeng Computer Technology Co.,Ltd.

TR01 Transfer of patent right