Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). It will be further understood by those within the art that virtually any disjunctive word and/or phrase presenting two or more alternative terms, whether in the description, claims, or drawings, should be understood to contemplate the possibilities of including one of the terms, either of the terms, or both terms. For example, the phrase "a or B" should be understood to include the possibility of "a" or "B", or "a and B".
An embodiment of the present disclosure provides a data processing method, including: determining at least one response time reference value corresponding to a specific request according to a preset rule, acquiring the response time related to the specific request, determining the response time reference value matched with the response time according to the preset rule, and updating a count value corresponding to the matched response time reference value, wherein the count value represents the number of the response time matched with the response time reference value.
Fig. 1 schematically illustrates an exemplary system architecture 100 to which the data processing methods and apparatus may be applied, according to an embodiment of the present disclosure.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 101, 102, 103 to interact with a server 105 over a network 104. Various applications may be installed on the terminal devices 101, 102, 103, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server or a cluster of servers providing various services, for example, a background management server providing support for respective applications. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
For example, the user may issue a request, such as a login request, or a search request, etc., to the server through the terminal device 101, 102, or 103. The server 105 may respond to the request and record the response time for analysis processing.
It should be noted that the data processing method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the data processing apparatus provided by the embodiments of the present disclosure may be generally disposed in the server 105. The data processing method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the data processing apparatus provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
Fig. 2 schematically shows a flow chart of a data processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S204.
In operation S201, at least one response time reference value corresponding to a specific request is determined according to a preset rule.
In operation S202, a response time with respect to a specific request is acquired.
In operation S203, a response time reference value to which the response time is matched is determined according to a preset rule.
In operation S204, a count value corresponding to the matched response time reference value is updated, wherein the count value characterizes the number of response times matching the response time reference value.
According to the embodiment of the present disclosure, as shown in fig. 3, a user may send a request to a server through a browser or an application, and the server may parse the user request and send data related to the user request to the user, so as to respond to the user request. For example, a user may enter a web address www.baidu.com in the browser and then enter a car, the browser initiates a request to the server, and the server may respond to the request by sending information about the web address to the browser, thereby completing a response.
In the disclosed embodiments, a respective response time reference value may be created for each type of request. Each type of rule for creating the response time reference value may be the same or different, and specifically, the creation rule may be set according to actual situations.
For example, determining at least one response time reference value with respect to a specific request according to a preset rule may include: the method includes determining a plurality of time segment intervals according to a particular request, and determining a plurality of response time reference values based on a processing rule corresponding to each time segment interval.
For example, a plurality of time segment intervals may be created, within which rounding is performed with corresponding processing rules. For example, assume that the response time for an i-type request is denoted TiFirst, T can beiThe time division method is divided into six time division intervals from a to f, and each division interval can correspond to the following rules:
a) at TiSatisfies 1. ltoreq. TiWhen the temperature is less than or equal to 100, TiOriginal value;
b) at T
iT is more than or equal to 101
iWhen the content is less than or equal to 1000,
c) at T
iT is more than or equal to 1001
iWhen the content is less than or equal to 5000,
d) at T
iSatisfies 5001 ≤ T
iWhen the content is less than or equal to 30000,
e) at T
iSatisfies T of 30001 ≤
iWhen the content of the active carbon is less than or equal to 300000,
f) at TiSatisfy TiWhen > 300000, TiFixed (e.g., 300000).
According to the above rule, if Ti50, the corresponding response time reference value is 50; if T isi112, the corresponding response time reference value is 110; if T isi119, the corresponding response time reference value is 110; if T isi2105, the corresponding response time reference value is 2100; if T isi2199, corresponding to a response time reference value of 2100; if T isi2200, the corresponding response time reference value is 2200; if T isi5622, the corresponding response time reference value is 5000; if T isi5999, corresponding to a response time reference value of 5000; if T isi6000, the corresponding response time reference value is 6000; if T isi6000, the corresponding response time reference value is 6000; if T isi90034, the corresponding response time reference value is 90000; if T isi99999, corresponding to a response time reference of 90000; if T isi100000, corresponding response timeThe inter-reference value is 100000; if T isi300001, corresponding to a response time reference value of 300000; if T isi999999, corresponding to a response time reference value of 300000. It can be seen that a fixed set of response time reference values can be obtained according to the above exemplary rules.
It is understood that different types of requests may correspond to different segment intervals, and the processing rules corresponding to the segment intervals may also be different. For example, the closer the time is to the normal response time, the shorter the segmentation interval may be. The present disclosure is not limited to specific preset rules, and those skilled in the art can determine their corresponding response time reference values for each type of request according to actual situations.
In the disclosed embodiment, a fixed-length barrel container may be created for the response time reference value corresponding to a certain request, and the key of the barrel container may be the response time reference value corresponding to the request. For example, a fixed length cask as shown in FIG. 4A may be created according to the rules in the example above.
According to the embodiments of the present disclosure, after the response time reference value is created, a specific response time or all response times with respect to the request may be acquired. For example, assuming that an application responds to a request 1000 times, 1000 response times may be obtained.
In embodiments of the present disclosure, a response time reference value to which the response time matches may be determined. For example, the acquired response time may be processed according to the same rule as the creation of the response time reference value, and the response time reference value that is the same as the processed response time may be determined as the matching response time reference value.
In the embodiment of the present disclosure, each response time reference value may correspond to a timer, and the timer corresponding to each response time reference value may be set to 0 initially. And after the obtained response time is matched with a certain response time reference value, adding 1 to a counter corresponding to the matched response time reference value.
For example, as shown in FIG. 4B, the response time obtained is 2ms, 1 ≦ T according to the rule in the example aboveiWhen the temperature is less than or equal to 100, TiOriginal valueThen the reference value of the response time matched with the response time is 2, and the counter corresponding to the reference value of the response time of 2 is increased by 1.
As another example, as shown in FIG. 4C, the response time is obtained as 5ms, 1 ≦ T according to the rule in the above exampleiWhen the temperature is less than or equal to 100, TiIf the value is the original value, the response time reference value matched with the response time is 5, and the counter corresponding to the response time reference value of 5 is increased by 1.
As another example, as shown in FIG. 4D, the response time obtained is 101ms, and according to the rule in the above example, 101 ≦ T
iWhen the content is less than or equal to 1000,
the response time reference value for the response time match is 100 and the counter corresponding to the response time reference value of 100 is incremented by 1.
As another example, as shown in FIG. 4E, the response time obtained is 108ms, 101 ≦ T according to the rules in the above example
iWhen the content is less than or equal to 1000,
the response time reference value for the response time match is 100 and the counter corresponding to the response time reference value of 100 is incremented by 1.
As another example, as shown in FIG. 4F, the response time obtained is 1010ms, 1001 ≦ T according to the rules in the above example
iWhen the content is less than or equal to 5000,
the response time reference value for the response time match is 1000 and the counter corresponding to the response time reference value of 1000 is incremented by 1.
And by analogy, matching and recording the acquired response time and the response time reference value. For example, the response time of each time is 1ms, 3ms, 5ms, 225ms, 800ms, 110ms, 335ms, and … … respectively, the response times are sequentially matched with the reference value of the response time, and then the count value corresponding to the reference value is updated.
The embodiment of the disclosure can reflect the condition of the response time through the response time reference value and the corresponding count value thereof, and when the response time is counted, the total comparison and the ordering are not needed, but the counting is carried out according to the count value of each response time reference value, so that the calculation complexity can be reduced, the calculation speed is increased, and the calculation efficiency is improved.
Fig. 5 schematically shows a flow chart of a data processing method according to another embodiment of the present disclosure.
As shown in fig. 5, the method includes operations S201 to S204 and operation S501. Operations S201 to S204 are the same as or similar to the method described above with reference to fig. 2, and are not repeated herein.
In operation S501, a count value corresponding to at least one response time reference value is counted according to the statistical parameter.
In this embodiment of the present disclosure, counting the count value corresponding to the at least one response time reference value according to the statistical parameter may include: and determining a statistic value according to the statistic parameters and the obtained number of the response time, and determining a response time reference value corresponding to the statistic value according to a count value corresponding to at least one response time reference value.
For example, the TPn of the response time may be calculated, for example, TP90 of the response time, i.e., Top Percent 90, may be calculated. Then 90% may be a statistical parameter and if the number of response times acquired is 1000, the statistical value may be 1000 × 90% — 900.
In the prior art, the TP90 can be calculated by only sorting all 1000 response times, and then finding the response time corresponding to the 900 th data in the sorting as the value of TP 90.
The embodiment of the disclosure may determine the response time reference value corresponding to the statistic value according to the count value corresponding to the response time reference value.
For example, the corresponding count values may be sequentially accumulated according to the order of at least one response time reference value, and when the accumulated count values and the statistics values satisfy a condition, the corresponding time reference value corresponding to the statistics values is determined.
For example, as shown in fig. 6, the positions of the statistics 900 may be determined by sequentially accumulating the corresponding count values from small to large according to the reference value. For example, if the count value of the reference value 1 is 343 and less than 900, the accumulation is continued, if the count value corresponding to the reference value 2 is accumulated, the accumulated count value is 343+298 and 641 and less than 900, if the count value corresponding to the reference value 3 is accumulated, the accumulated count value is 641+260 and 901, and if the count value exceeds 900, the response time reference value corresponding to the statistical value 900 should be 3 ms.
It can be understood that, according to the embodiment of the present disclosure, the corresponding count value may be accumulated from large to small according to the reference value, so as to determine the position of the statistic 900. For example, 1000-.
The embodiment of the disclosure can reflect the condition of the response time through the response time reference value and the corresponding count value thereof, and when the response time is counted, the total comparison and the ordering are not needed, but the counting is performed according to the count value of each response time reference value, so that the calculation complexity can be reduced, the calculation throughput in unit time can be improved, the calculation speed can be increased, and the calculation efficiency can be improved.
Fig. 7A and 7B schematically illustrate block diagrams of a data processing apparatus 700 according to an embodiment of the present disclosure.
As shown in fig. 7A, the data processing apparatus 700 includes a first determining module 710, an obtaining module 720, a second determining module 730, and an updating module 740.
The first determining module 710 determines at least one response time reference value corresponding to a specific request according to a preset rule.
The retrieving module 720 retrieves a response time for the particular request.
The second determining module 730 determines the response time reference value matched with the response time according to a preset rule.
The update module 740 updates a count value corresponding to the matched response time reference value, wherein the count value characterizes the number of response times matching the response time reference value.
According to an embodiment of the present disclosure, determining at least one response time reference value with respect to a specific request according to a preset rule may include: the method includes determining a plurality of time segment intervals according to a particular request, and determining a plurality of response time reference values based on a processing rule corresponding to each time segment interval.
According to the embodiment of the disclosure, determining the response time reference value matched with the response time according to the preset rule may include: and processing the response time according to a preset rule, and determining a response time reference value which is the same as the processed response time as a matched response time reference value.
According to an embodiment of the present disclosure, each response time reference value corresponds to a counter. The count value corresponding to the matched response time reference value may be updated by adding 1 to the counter corresponding to the matched response time reference value.
As shown in fig. 7B, the data processing apparatus 700 may further include a statistics module 750.
The counting module 750 counts a count value corresponding to the at least one response time reference value according to the counting parameter.
According to the embodiment of the present disclosure, counting the count value corresponding to the at least one response time reference value according to the statistical parameter may include: and determining a statistic value according to the statistic parameters and the obtained number of the response time, and determining a response time reference value corresponding to the statistic value according to a count value corresponding to at least one response time reference value.
According to an embodiment of the present disclosure, determining a response time reference value corresponding to a statistic according to a count value corresponding to at least one response time reference value may include: and sequentially accumulating the corresponding count values according to the sequence of at least one response time reference value, and determining the corresponding time reference value corresponding to the statistic value when the count value obtained by accumulation and the statistic value meet the condition.
According to the embodiment of the present disclosure, the data processing apparatus 700 may, for example, perform the method described above with reference to fig. 2 or fig. 5, which is not described herein again.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any of the first determining module 710, the obtaining module 720, the second determining module 730, the updating module 740, and the counting module 750 may be combined into one module to be implemented, or any one of the modules may be divided into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first determining module 710, the obtaining module 720, the second determining module 730, the updating module 740, and the statistics module 750 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware, and firmware, or in a suitable combination of any of them. Alternatively, at least one of the first determining module 710, the obtaining module 720, the second determining module 730, the updating module 740 and the statistics module 750 may be at least partially implemented as a computer program module, which when executed may perform a corresponding function.
FIG. 8 schematically shows a block diagram of a data processing system suitable for implementing the above described method according to an embodiment of the present disclosure. The computer system illustrated in FIG. 8 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the disclosure.
As shown in fig. 8, a data processing system 800 according to an embodiment of the present disclosure includes a processor 801 which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. The processor 801 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 801 may also include onboard memory for caching purposes. Processor 501 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 803, various programs and data necessary for the operation of the system 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. The processor 801 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 802 and/or RAM 803. Note that the programs may also be stored in one or more memories other than the ROM 802 and RAM 803. The processor 801 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
System 800 may also include an input/output (I/O) interface 805, also connected to bus 804, according to an embodiment of the disclosure. The system 800 may also include one or more of the following components connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program, when executed by the processor 801, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable medium, which may be embodied in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer readable medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, a computer readable medium may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, optical fiber cable, radio frequency signals, etc., or any suitable combination of the foregoing.
For example, according to embodiments of the present disclosure, a computer-readable medium may include one or more memories other than ROM 802 and/or RAM 803 and/or ROM 802 and RAM 803 described above.
The flowchart 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 disclosure. 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 or flowchart illustration, and combinations of blocks in the block diagrams 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.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.