A query interface data processing system
By analyzing the data update frequency and access frequency in the query interface data processing system, and dynamically adjusting the cache time and capacity, the existing technology problems of low query interface data processing efficiency and high database access pressure are solved, and more efficient data processing is achieved. and cache optimization.
Patent Information
- Application Number
- CN202410704520.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-03
AI Technical Summary
In the existing technology, query interface data processing efficiency is low, database access pressure is high, and query data cannot be cached effectively, resulting in low efficiency.
A query interface data processing system is designed, including an information acquisition module, a data storage module, a classification module, a data monitoring module and a data processing module. It dynamically adjusts the cache by analyzing data update frequency, access frequency, cache hit rate and network performance. time and capacity to optimize cache database performance.
It improves the accuracy of data prioritization and cache database performance evaluation, reduces database access pressure, and improves the efficiency of query interface data processing.
Smart Images

Figure CN118277435B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a query interface data processing system. Background Art
[0002] In contemporary software development, query interfaces are an important way to provide data retrieval capabilities. They allow users to request data stored in the system through defined query parameters. With the continuous growth of data volume and the increasing complexity of business logic, how to efficiently and accurately process these query requests has become a key issue.
[0003] Chinese Patent Publication No.: CN116894063A discloses an interface data query method and system. The interface data query method provided by the present application is applied to an interface data query system, wherein the system includes an interface server and a query server, and the method includes: the interface server determines the response data corresponding to the API access request for an application program interface API access request; the interface server determines the request data corresponding to the API access request, the response data corresponding to the API access request, and the combination of the intermediate operations performed and the intermediate data generated in the process of determining the response data corresponding to the API access request as an interface data; the interface server sends the target interface data to be displayed to the query server; the query server receives the target interface data and sends the target interface data to the designated query client, so that the designated query client displays the target interface data to the query user on the designated query client side. In this way, the interface data can be efficiently queried; it can be seen that when querying the data, the scheme does not cache the queried data, and there are problems of low query interface data processing efficiency and high database access pressure. Summary of the invention
[0004] To this end, the present invention provides a query interface data processing system to overcome the problems of low query interface data processing efficiency and high database access pressure in the prior art.
[0005] To achieve the above object, the present invention provides a query interface data processing system, the system comprising:
[0006] Information acquisition module, used to obtain system database information, average request response time, cache database information and network information;
[0007] A data storage module, used for storing data in a cache database according to the division result of data priority levels;
[0008] A level classification module is used to analyze the abnormality of the data update frequency according to the acquired data update frequency, and to classify the data priority level according to the analysis result of the abnormality of the data update frequency and the access frequency of the data;
[0009] A data monitoring module is used to evaluate the performance of the cache database according to the cache hit rate within the monitoring period and the average request response time obtained within the monitoring period, and is also used to make a primary adjustment to the evaluation process of the cache database performance according to the obtained server read speed, and is also used to make a secondary adjustment to the evaluation process of the cache database performance according to the obtained server memory;
[0010] The data processing module is used to manage the data cache time and cache capacity of the cache database in the next management cycle according to the evaluation results of the cache database performance in the management cycle and the priority level of the data.
[0011] Furthermore, the level classification module is provided with a level classification unit, and the level classification unit is used to classify the priority level of the data according to the analysis result of the abnormality of the data update frequency in the system database and the access frequency of the data, wherein:
[0012] When the data update frequency is normal, if f0i≤f1, the level division unit determines that the priority level of the data numbered i is level one, and sets the cache time of the data in the cache database to Ai1; if f1<f0i<f2, the level division unit determines that the priority level of the data numbered i is level two, and sets the cache time of the data in the cache database to Ai2; if f0i≥f2, the level division unit determines that the priority level of the data numbered i is level three, and sets the cache time of the data in the cache database to Ai3;
[0013] When the update frequency of data is abnormal, if f0i≤f1×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)], the level division unit determines that the priority level of the data numbered i is level one, and sets the cache time of the data in the cache database to Ai1; if f1×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)]<f0i<f2×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)], the level division unit determines that the priority level of the data numbered i is level two, and sets the cache time of the data in the cache database to Ai2; if f0i≥f2×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)], the level division unit determines that the priority level of the data numbered i is level three, and sets the cache time of the data in the cache database to Ai3;
[0014] Wherein, f0i is the access frequency of data numbered i, f1 is the first preset access frequency, and f2 is the second preset access frequency.
[0015] Furthermore, the data monitoring module is provided with a hit rate monitoring unit, which is used to compare the cache hit rate m0 within the monitoring period with the preset hit rate m1, and analyze the abnormality of the cache hit rate of the cache database according to the comparison result, wherein:
[0016] When m0≤m1, the hit rate monitoring unit determines that the cache hit rate of the cache database in the current monitoring period is abnormal;
[0017] When m0>m1, the hit rate monitoring unit determines that the cache hit rate of the cache database in the current monitoring period is normal.
[0018] Furthermore, the data monitoring module is provided with a performance evaluation unit, which is used to evaluate the performance of the cache database according to the analysis result of the cache hit rate of the cache database and the average request response time t0 obtained during the monitoring period, wherein:
[0019] When the cache hit rate of the cache database is normal, if t0≤t1, the performance evaluation unit determines that the performance of the cache database in the current monitoring period is normal; if t0>t1, the performance evaluation unit determines that the performance of the cache database in the current monitoring period is abnormal;
[0020] When the cache hit rate of the cache database is abnormal, if t0≤t1×[1-(m1-m0) / m1], the performance evaluation unit determines that the performance of the cache database in the current monitoring period is normal; if t0>t1×[1-(m1-m0) / m1], the performance evaluation unit determines that the performance of the cache database in the current monitoring period is abnormal.
[0021] Furthermore, the data monitoring module is provided with a first adjustment unit, which is used to compare the obtained server reading speed g0 with the preset reading speed g1, and adjust the evaluation process of the cache database performance according to the comparison result, wherein:
[0022] When g0≤g1, the first adjustment unit determines that the reading speed of the server is normal and does not make any adjustment;
[0023] When g0>g1, the first adjustment unit determines that the reading speed of the server is abnormal, and adjusts the evaluation process of the cache database performance, and sets the adjusted preset response time to t1', and sets t1'=t1×[1-γ×(g0-g1) / (g0+g1)], where γ is the preset reading adjustment coefficient.
[0024] Furthermore, the data monitoring module is provided with a second adjustment unit, which is used to compare the acquired server memory n0 with the preset memory n1, and make a secondary adjustment to the evaluation process of the cache database performance according to the comparison result, wherein:
[0025] When n0≤n1, the second adjustment unit determines that the server memory is normal and does not make any adjustment;
[0026] When n0>n1, the second adjustment unit determines that the server memory is abnormal, and makes a secondary adjustment to the cache database performance evaluation process, setting the adjusted preset reading speed to g1', and setting g1'=g1×(1+e 3(n0 -n1) / (n0+n1)-3 ).
[0027] Furthermore, the data processing module is provided with a capacity management unit, and the capacity management unit is used to manage the cache capacity of the cache database in the next management period according to the evaluation result of the database performance in the management period, wherein:
[0028] When k1 / k0≤u, the capacity management unit determines that the performance of the cache database in the current management cycle is normal, and sets the cache capacity of the cache database in the next management cycle to Q1, setting Q1=q0;
[0029] When k1 / k0>u, the capacity management unit determines that the performance of the cache database in the current management cycle is abnormal, and sets the cache capacity of the cache database in the next management cycle to Q2, setting Q2=q0×{1+ln[(k1 / k0-u)+1]};
[0030] Among them, k1 is the number of monitoring cycles of cache database performance anomalies within the management cycle, k0 is the number of monitoring cycles within the management cycle, u is the preset anomaly ratio, and q0 is the cache capacity of the cache database in the current management cycle.
[0031] Furthermore, the data processing module is provided with a time management unit, which is used to manage the cache time of the data in the cache database in the next management cycle according to the access frequency of the cache data in the cache database in the management cycle, the division result of the data priority and the management result of the cache capacity of the cache database in the next management cycle, wherein:
[0032] When Gfi≤gf0, the time management unit determines that the access frequency of the data numbered i in the current management cycle is normal. If Qq≤Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R1, and sets R1=Aia; If Qq>Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R2, and sets R2=Aia×{1+{exp{sin[(Qq-Q0)×(π / 2) / (Qq+Q0)]}-1} / 2};
[0033] When Gfi>gf0, the time management unit determines that the access frequency of the data numbered i in the current management cycle is abnormal. If Qq≤Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R3, and sets R3=Aia×[1+α×(Gfi-gf0) / (Gfi+gf0)]; If Qq>Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R4, and sets R4=Aia×{1+{exp{sin[(Qq-Q0)×(π / 2) / (Qq+Q0)]}-1} / 2+α×(Gfi-gf0) / (Gfi+gf0)};
[0034] Among them, Gfi is the access frequency of cache data numbered i in the management cycle, gf0 is the preset access threshold, Aia is the cache time of data numbered i, a=1,2,3; Qq is the management result of the cache capacity of the cache database in the next management cycle, q=1,2, Q0 is the preset capacity threshold, and α is the preset adjustment coefficient.
[0035] Furthermore, the query interface data processing system also includes a cache optimization module, which is used to optimize the management process of data cache time and cache capacity of the cache database in the next management period according to the network bandwidth and network delay obtained in the management period. The cache optimization module includes a management optimization unit, which compares the obtained network bandwidth d0 with the preset network bandwidth d1, and optimizes the management process of cache capacity of the cache database in the next management period according to the comparison result, wherein:
[0036] When d0≤d1, the management optimization unit determines that the network bandwidth is abnormal, and optimizes the management process of the cache capacity of the cache database in the next management cycle, and sets the optimized preset abnormal proportion as u', setting u'=u×[1+β×(d1-d0) / d1], where β is the preset optimization coefficient;
[0037] When d0>d1, the management optimization unit determines that the network bandwidth is normal and does not perform optimization.
[0038] Furthermore, the cache optimization module is provided with an optimization adjustment unit, which compares the average network delay y0 obtained during the management period with the preset delay y1, and performs secondary optimization on the management process of the cache capacity of the cache database according to the comparison result, wherein:
[0039] When y0≤y1, the optimization adjustment unit determines that the network delay in the current management period is normal and does not perform optimization;
[0040] When y0>y1, the optimization and adjustment unit determines that the network delay in the current management cycle is abnormal, and performs secondary optimization on the management process of the cache capacity of the cache database, and sets the optimized preset network bandwidth to d1', setting d1'=d1×{1+(π / 2)×arctan[sin(y0-y1) / (y0+y1)]}.
[0041] Compared with the prior art, the beneficial effects of the present invention are that the level division module improves the accuracy of data update frequency abnormality analysis by setting a preset update frequency, thereby improving the accuracy of data priority division, and improves the accuracy of data priority division by setting a preset access frequency. The data monitoring module improves the accuracy of cache hit rate abnormality analysis by setting a preset hit rate, improves the accuracy of cache database performance evaluation by setting a preset response time, reduces the influence of server read speed on response time by setting a preset read speed and a preset read adjustment coefficient, thereby improving the accuracy of cache database performance evaluation, reduces the influence of server memory on response time by setting a preset server memory, thereby improving the accuracy of cache database performance evaluation, thereby improving the accuracy of cache time and cache capacity management, and the data processing module improves the accuracy of cache time and cache capacity management by setting a preset The abnormal proportion is used to improve the accuracy of the cache capacity analysis of the cache database in the next management cycle, thereby improving the accuracy of the data cache time analysis in the cache database. By setting the preset access threshold, the preset capacity threshold and the preset adjustment coefficient to improve the accuracy of the data cache time management in the cache database in the next management cycle, the efficiency of the query interface data processing is improved and the access pressure of the database is reduced. The cache optimization module reduces the impact of the server network bandwidth on the cache capacity management by setting the preset network bandwidth and the preset optimization coefficient, thereby improving the accuracy of the data cache time management in the cache database in the next management cycle. By setting the preset network delay to reduce the impact of the server network delay on the cache capacity management, the accuracy of the data cache time management in the cache database in the next management cycle is improved, thereby improving the efficiency of the query interface data processing and reducing the access pressure of the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1This is a schematic diagram of the structure of the query interface data processing system of this embodiment;
[0043] Figure 2 This is a schematic diagram of the structure of the level division module of this embodiment;
[0044] Figure 3 This is a schematic diagram of the structure of the data monitoring module of this embodiment;
[0045] Figure 4 This is a structural diagram of the data processing module of this embodiment;
[0046] Figure 5 This is a schematic diagram of the structure of the cache optimization module of this embodiment. DETAILED DESCRIPTION
[0047] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0048] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0049] It should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0050] See also Figure 1 As shown, it is a schematic diagram of the structure of the query interface data processing system of this embodiment, and the system includes:
[0051] An information acquisition module is used to obtain system database information, average request response time, cache database information and network information. The system database information includes the access frequency and update frequency of data in the system database; the cache database information is the cache hit rate of data in the cache database, and the cache hit rate is the ratio of the number of successful requests for cached data to the total number of requests; the request response time is the time from the client sending a request to the client receiving a response, and the network information includes the network bandwidth and average network delay of the server; the system database in this embodiment is a database that stores all data of the online mall, which can be a relational database such as Oracle; the cache database is a database that stores cache data to reduce the response time of requests and reduce system load, and can be Redis, etc.; in this embodiment, no specific limitation is made on the acquisition method of system database information, average request response time, cache database information and network information, and those skilled in the art can freely set it, as long as the acquisition requirements of system database information, request response time, cache database information and network information are met, wherein the system database information, average request response time, cache database information and network information can be obtained through Redis monitoring tools and server logs;
[0052] A level classification module, used to analyze the abnormality of the data update frequency according to the update frequency of the acquired data, and to classify the priority of the data according to the analysis result of the abnormality of the data update frequency and the access frequency of the data, and the level classification module is connected to the information acquisition module;
[0053] A data storage module, used for storing data in a cache database according to the data priority classification result, the data storage module is connected to the classification module;
[0054] The data monitoring module is used to evaluate the performance of the cache database according to the cache hit rate within the monitoring period and the average request response time obtained within the monitoring period, and is also used to adjust the evaluation process of the cache database performance once according to the obtained server read speed, and is also used to adjust the evaluation process of the cache database performance twice according to the obtained server memory; the server read speed described in this embodiment is the ability of the server to read data from the main memory, and the specific value is the size of data read by the server central processing unit from the main memory per unit time; in this embodiment, no specific limitation is made on the setting of the monitoring period, and those skilled in the art can set it freely, and only need to meet the setting requirements of the monitoring period, wherein the monitoring period can be set to 5min, 10min, etc.; in this embodiment, no specific limitation is made on the acquisition method of the server read speed and the server memory, and those skilled in the art can set it freely, and only need to meet the acquisition requirements of the server read speed and the server memory, wherein the server read speed and the server memory can be obtained through Nagios;
[0055] A data processing module is used to manage the data cache time and cache capacity of the cache database in the next management period according to the evaluation results of the cache database performance and the priority level of the data in the management period. The data processing module is connected to the data monitoring module. In this embodiment, the setting of the management period is not specifically limited, and those skilled in the art can freely set it as long as the setting requirements of the management period are met. Among them, the setting of the management period should be greater than the setting of the monitoring period, and the management period can be set to 10 days, 15 days, etc.;
[0056] The cache optimization module is used to optimize the management process of data cache time and cache capacity of the cache database in the next management period according to the network bandwidth and network delay obtained in the management period. The cache optimization module is connected to the data processing module.
[0057] Specifically, the data storage module generates a unique cache key using the request parameters of the query request, and matches it with the key of the cache data in the cache database. If the match is successful, the data storage module returns the cache data corresponding to the key that is the same as the cache key in the cache database to the user. If the match fails, the data storage module calls the system database query interface to obtain the data corresponding to the query request as the query data, and stores the obtained query data in the cache database with the cache key as the key and the query data as the value, and uses the query data stored in the cache database as the cache data.
[0058] Specifically, the key described in this embodiment is a unique identifier of the cached data in the cache database, which is similar to the primary key of the database. The query request is a request issued by the client to the server to obtain the required query data. The method of generating the cache key is not specifically limited in this embodiment, and technical personnel in this field can set it freely, as long as the requirements for generating the cache key are met. The cache key can generate a unique key by means of parameter splicing and hash operation. It is worth noting that when the system database data changes, the system clears the cached data in the corresponding cache database. The method of clearing data is not specifically limited in this embodiment, and technical personnel in this field can set it freely, as long as the requirements for clearing data are met. The method of clearing data can be active clearing or asynchronous clearing.
[0059] See also Figure 2 As shown, it is a schematic diagram of the structure of the level division module of this embodiment, and the level division module includes:
[0060] An update analysis unit, for analyzing the abnormality of the data update frequency according to the update frequency of the acquired data;
[0061] The level division unit is used to divide the priority level of the data according to the analysis result of the abnormality of the data update frequency and the access frequency of the data. The level division unit is connected to the update analysis unit.
[0062] Specifically, the update analysis unit compares the update frequency of the data in the acquired system database with the preset update frequency p1, and analyzes the abnormality of the data update frequency according to the comparison result, wherein:
[0063] When p0i≤p1, the update analysis unit determines that the update frequency of the data numbered i is normal;
[0064] When p0i>p1, the update analysis unit determines that the update frequency of the data numbered i is abnormal;
[0065] Wherein, p0i is the update frequency of the data numbered i.
[0066] Specifically, the update analysis unit improves the accuracy of data update frequency abnormality analysis by setting a preset update frequency, thereby improving the accuracy of data priority classification, thereby improving the accuracy of cache time and cache capacity management, and ultimately improving the efficiency of query interface data processing and reducing database access pressure; in this embodiment, the setting of the preset update frequency is not specifically limited, and technical personnel in this field can set it freely, as long as the setting requirements of the preset update frequency are met, among which the optimal value of p1 is 0.5 times / hour.
[0067] Specifically, the level division unit divides the priority level of the data according to the analysis result of the abnormality of the data update frequency in the system database and the access frequency of the data, wherein:
[0068] When the data update frequency is normal, if f0i≤f1, the level division unit determines that the priority level of the data numbered i is level one, and sets the cache time of the data in the cache database to Ai1; if f1<f0i<f2, the level division unit determines that the priority level of the data numbered i is level two, and sets the cache time of the data in the cache database to Ai2; if f0i≥f2, the level division unit determines that the priority level of the data numbered i is level three, and sets the cache time of the data in the cache database to Ai3;
[0069] When the update frequency of data is abnormal, if f0i≤f1×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)], the level division unit determines that the priority level of the data numbered i is level one, and sets the cache time of the data in the cache database to Ai1; if f1×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)]<f0i<f2×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)], the level division unit determines that the priority level of the data numbered i is level two, and sets the cache time of the data in the cache database to Ai2; if f0i≥f2×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)], the level division unit determines that the priority level of the data numbered i is level three, and sets the cache time of the data in the cache database to Ai3;
[0070] Wherein, f0i is the access frequency of data numbered i, f1 is the first preset access frequency, and f2 is the second preset access frequency.
[0071] Specifically, the level division unit improves the accuracy of data priority division by setting a preset access frequency, thereby improving the accuracy of cache time and cache capacity management, ultimately improving the efficiency of query interface data processing and reducing the access pressure of the database; in this embodiment, there is no specific limitation on the setting of the preset access frequency, and technical personnel in this field can set it freely, as long as the setting requirements of the preset access frequency are met, wherein the optimal value of f1 is 50 times / second, and the optimal value of f2 is 150 times / second; in this embodiment, there is no specific limitation on the value of the cache time corresponding to the data priority level, and technical personnel in this field can set it freely, as long as the value requirements of the cache time corresponding to the data priority level are met, wherein the cache time when the data priority level is level one can be set to 6h, the cache time when the data priority level is level two can be set to 2h, and the cache time when the data priority level is level three can be set to 1h. It is worth noting that in this embodiment, the data numbering is unique, and the same data has the same numbering in the system database and the cache database.
[0072] See also Figure 3 As shown, it is a schematic diagram of the structure of the data monitoring module of this embodiment, and the data monitoring module includes:
[0073] A hit rate monitoring unit, used to analyze the abnormality of the cache hit rate of the cache database according to the cache hit rate within the monitoring period;
[0074] A performance evaluation unit, used to evaluate the performance of the cache database according to the analysis result of the cache hit rate of the cache database and the average request response time obtained during the monitoring period, the performance evaluation unit being connected to the hit rate monitoring unit;
[0075] A first adjustment unit, used for adjusting the evaluation process of cache database performance according to the acquired server reading speed, the first adjustment unit being connected to the performance evaluation unit;
[0076] The second adjustment unit is used to perform secondary adjustment on the evaluation process of cache database performance according to the acquired server memory, and the second adjustment unit is connected to the first adjustment unit.
[0077] Specifically, the hit rate monitoring unit compares the cache hit rate m0 within the monitoring period with the preset hit rate m1, and analyzes the abnormality of the cache hit rate of the cache database according to the comparison result, wherein:
[0078] When m0≤m1, the hit rate monitoring unit determines that the cache hit rate of the cache database in the current monitoring period is abnormal;
[0079] When m0>m1, the hit rate monitoring unit determines that the cache hit rate of the cache database in the current monitoring period is normal.
[0080] Specifically, the hit rate monitoring unit improves the accuracy of cache hit rate abnormality analysis by setting a preset hit rate, thereby improving the accuracy of cache database performance evaluation, thereby improving the accuracy of cache time and cache capacity management, and ultimately improving the efficiency of query interface data processing and reducing database access pressure; in this embodiment, there is no specific limitation on the setting of the preset hit rate, and technical personnel in this field can set it freely as long as the setting requirements of the preset hit rate are met, among which the optimal value of m1 is 0.75.
[0081] Specifically, the performance evaluation unit evaluates the performance of the cache database according to the analysis result of the cache hit rate of the cache database and the average request response time t0 obtained during the monitoring period, wherein:
[0082] When the cache hit rate of the cache database is normal, if t0≤t1, the performance evaluation unit determines that the performance of the cache database in the current monitoring period is normal; if t0>t1, the performance evaluation unit determines that the performance of the cache database in the current monitoring period is abnormal;
[0083] When the cache hit rate of the cache database is abnormal, if t0≤t1×[1-(m1-m0) / m1], the performance evaluation unit determines that the performance of the cache database in the current monitoring period is normal; if t0>t1×[1-(m1-m0) / m1], the performance evaluation unit determines that the performance of the cache database in the current monitoring period is abnormal;
[0084] Wherein, t1 is the preset response time.
[0085] Specifically, the performance evaluation unit improves the accuracy of cache database performance evaluation by setting a preset response time, thereby improving the accuracy of cache time and cache capacity management, ultimately improving the efficiency of query interface data processing and reducing database access pressure; in this embodiment, there is no specific limitation on the setting of the preset response time, and technical personnel in this field can set it freely as long as the setting requirements of the preset response time are met, where the optimal value of t1 is 1 second.
[0086] Specifically, the first adjustment unit compares the obtained server reading speed g0 with the preset reading speed g1, and adjusts the evaluation process of the cache database performance according to the comparison result, wherein:
[0087] When g0≤g1, the first adjustment unit determines that the reading speed of the server is normal and does not make any adjustment;
[0088] When g0>g1, the first adjustment unit determines that the reading speed of the server is abnormal, and adjusts the evaluation process of the cache database performance, and sets the adjusted preset response time to t1', and sets t1'=t1×[1-γ×(g0-g1) / (g0+g1)], where γ is the preset reading adjustment coefficient.
[0089] Specifically, the first adjustment unit reduces the impact of the server read speed on the response time by setting a preset read speed and a preset read adjustment coefficient, so as to improve the accuracy of the cache database performance evaluation, thereby improving the accuracy of the cache time and cache capacity management, and ultimately improving the efficiency of the query interface data processing and reducing the access pressure of the database; in this embodiment, there is no specific limitation on the setting of the preset read speed and the preset read adjustment coefficient, and technical personnel in this field can set them freely, as long as the setting requirements of the preset read speed and the preset read adjustment coefficient are met, wherein the optimal value of g1 is 7GB / s, and the optimal value of γ is 0.82.
[0090] Specifically, the second adjustment unit compares the acquired server memory n0 with the preset memory n1, and performs secondary adjustment on the evaluation process of the cache database performance according to the comparison result, wherein:
[0091] When n0≤n1, the second adjustment unit determines that the server memory is normal and does not make any adjustment;
[0092] When n0>n1, the second adjustment unit determines that the server memory is abnormal, and makes a secondary adjustment to the cache database performance evaluation process, setting the adjusted preset reading speed to g1', and setting g1'=g1×(1+e 3(n0 -n1) / (n0+n1)-3 ).
[0093] Specifically, the second adjustment unit reduces the impact of server memory on response time by setting a preset server memory to improve the accuracy of cache database performance evaluation, thereby improving the accuracy of cache time and cache capacity management, and ultimately improving the efficiency of query interface data processing and reducing database access pressure; in this embodiment, the setting of the preset server memory is not specifically limited, and technical personnel in this field can set it freely as long as the setting requirements of the preset server memory are met, where the optimal value of n1 is 32GB RAM.
[0094] See also Figure 4 As shown, it is a schematic diagram of the structure of the data processing module of this embodiment, and the data processing module includes:
[0095] A capacity management unit, used to manage the cache capacity of the cache database in the next management period according to the evaluation result of the database performance in the management period;
[0096] The time management unit is used to manage the cache time of the data in the cache database in the next management cycle according to the access frequency of the data in the cache database within the management cycle, the data priority division result and the management result of the cache capacity of the cache database in the next management cycle. The time management unit is connected to the capacity management unit.
[0097] Specifically, the capacity management unit manages the cache capacity of the cache database in the next management period according to the evaluation result of the database performance in the management period, wherein:
[0098] When k1 / k0≤u, the capacity management unit determines that the performance of the cache database in the current management cycle is normal, and sets the cache capacity of the cache database in the next management cycle to Q1, setting Q1=q0;
[0099] When k1 / k0>u, the capacity management unit determines that the performance of the cache database in the current management cycle is abnormal, and sets the cache capacity of the cache database in the next management cycle to Q2, setting Q2=q0×{1+ln[(k1 / k0-u)+1]};
[0100] Among them, k1 is the number of monitoring cycles of cache database performance anomalies within the management cycle, k0 is the number of monitoring cycles within the management cycle, u is the preset anomaly ratio, and q0 is the cache capacity of the cache database in the current management cycle.
[0101] Specifically, the capacity management unit sets a preset abnormality ratio to improve the accuracy of the cache capacity analysis of the cache database in the next management cycle, thereby improving the accuracy of the data cache time analysis in the cache database, thereby improving the efficiency of the query interface data processing and reducing the access pressure of the database; in this embodiment, the setting of the preset abnormality ratio is not specifically limited, and those skilled in the art can set it freely, as long as the setting requirements of the preset abnormality ratio are met, where the optimal value of u is 0.15.
[0102] Specifically, the time management unit manages the cache time of the data in the cache database in the next management period according to the access frequency of the cache data in the cache database in the management period, the division result of the data priority and the management result of the cache capacity of the cache database in the next management period, wherein:
[0103] When Gfi≤gf0, the time management unit determines that the access frequency of the data numbered i in the current management cycle is normal. If Qq≤Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R1, and sets R1=Aia; If Qq>Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R2, and sets R2=Aia×{1+{exp{sin[(Qq-Q0)×(π / 2) / (Qq+Q0)]}-1} / 2};
[0104] When Gfi>gf0, the time management unit determines that the access frequency of the data numbered i in the current management cycle is abnormal. If Qq≤Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R3, and sets R3=Aia×[1+α×(Gfi-gf0) / (Gfi+gf0)]; If Qq>Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R4, and sets R4=Aia×{1+{exp{sin[(Qq-Q0)×(π / 2) / (Qq+Q0)]}-1} / 2+α×(Gfi-gf0) / (Gfi+gf0)};
[0105] Among them, Gfi is the access frequency of cache data numbered i in the management cycle, gf0 is the preset access threshold, Aia is the cache time of data numbered i, a=1,2,3; Qq is the management result of the cache capacity of the cache database in the next management cycle, q=1,2, Q0 is the preset capacity threshold, and α is the preset adjustment coefficient.
[0106] Specifically, the time management unit sets a preset access threshold, a preset capacity threshold and a preset adjustment coefficient to improve the accuracy of data cache time management in the cache database in the next management cycle, thereby improving the efficiency of query interface data processing and reducing the access pressure on the database; in this embodiment, there is no specific limitation on the setting of the preset access threshold, the preset capacity threshold and the preset adjustment coefficient, and technical personnel in this field can set them freely as long as the setting requirements of the preset access threshold, the preset capacity threshold and the preset adjustment coefficient are met. Among them, when the management cycle is 10 days, the optimal value of gf0 is 120 times / second, the optimal value of Q0 is 50GB, and the optimal value of α is 0.72.
[0107] See also Figure 5 As shown, it is a schematic diagram of the structure of the cache optimization module of this embodiment, and the cache optimization module includes:
[0108] A management optimization unit, used to optimize the management process of the cache capacity of the cache database in the next management cycle according to the acquired network bandwidth;
[0109] The optimization and adjustment unit is used to perform secondary optimization on the management process of the cache capacity of the cache database according to the average network delay obtained in the management cycle, and the optimization and adjustment unit is connected to the management optimization unit.
[0110] Specifically, the management optimization unit compares the obtained network bandwidth d0 with the preset network bandwidth d1, and optimizes the management process of the cache capacity of the cache database in the next management cycle according to the comparison result, wherein:
[0111] When d0≤d1, the management optimization unit determines that the network bandwidth is abnormal, and optimizes the management process of the cache capacity of the cache database in the next management cycle, and sets the optimized preset abnormal proportion as u', setting u'=u×[1+β×(d1-d0) / d1], where β is the preset optimization coefficient;
[0112] When d0>d1, the management optimization unit determines that the network bandwidth is normal and does not perform optimization.
[0113] Specifically, the management optimization unit reduces the impact of the server network bandwidth on cache capacity management by setting a preset network bandwidth and a preset optimization coefficient, thereby improving the accuracy of data cache time management in the cache database in the next management cycle, thereby improving the efficiency of query interface data processing and reducing the access pressure on the database; in this embodiment, there is no specific limitation on the setting of the preset network bandwidth and the preset optimization coefficient, and technical personnel in this field can set them freely as long as the setting requirements of the preset network bandwidth and the preset optimization coefficient are met, where the optimal value of d1 is 1Gbps, and the optimal value of β is 0.78.
[0114] Specifically, the optimization and adjustment unit compares the average network delay y0 obtained in the management period with the preset delay y1, and performs secondary optimization on the management process of the cache capacity of the cache database according to the comparison result, wherein:
[0115] When y0≤y1, the optimization adjustment unit determines that the network delay in the current management period is normal and does not perform optimization;
[0116] When y0>y1, the optimization and adjustment unit determines that the network delay in the current management cycle is abnormal, and performs secondary optimization on the management process of the cache capacity of the cache database, and sets the optimized preset network bandwidth to d1', setting d1'=d1×{1+(π / 2)×arctan[sin(y0-y1) / (y0+y1)]}.
[0117] Specifically, the optimization and adjustment unit reduces the impact of server network delay on cache capacity management by setting a preset network delay, thereby improving the accuracy of data cache time management in the cache database in the next management cycle, thereby improving the efficiency of query interface data processing and reducing database access pressure; in this embodiment, there is no specific limitation on the setting of the preset delay, and technical personnel in this field can set it freely as long as the setting requirements of the preset network delay are met, where the optimal value of y1 is 0.2s.
[0118] Specifically, the query interface data processing system described in this embodiment is applied to the processing of query data interface result data in an online shopping mall. It divides the priority of common data in the system database and evaluates the performance of the cache database. The cache time and cache capacity of the data in the cache database are managed by combining the two, thereby improving the efficiency of interface data processing and reducing the access pressure on the database.
[0119] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A query interface data processing system, characterized in that: include, Information acquisition module, used to obtain system database information, average request response time, cache database information and network information; A data storage module, used for storing data in a cache database according to the division result of data priority levels; A level classification module is used to analyze the abnormality of the data update frequency according to the acquired data update frequency, and to classify the data priority level according to the analysis result of the abnormality of the data update frequency and the access frequency of the data; A data monitoring module is used to evaluate the performance of the cache database according to the cache hit rate within the monitoring period and the average request response time obtained within the monitoring period, and is also used to make a primary adjustment to the evaluation process of the cache database performance according to the obtained server read speed, and is also used to make a secondary adjustment to the evaluation process of the cache database performance according to the obtained server memory; A data processing module is used to manage the data cache time and cache capacity of the cache database in the next management cycle according to the evaluation results of the cache database performance in the management cycle and the priority level of the data; The data monitoring module is provided with a first adjustment unit, which is used to compare the obtained server reading speed g0 with the preset reading speed g1, and adjust the evaluation process of the cache database performance according to the comparison result, wherein: When g0≤g1, the first adjustment unit determines that the reading speed of the server is normal and does not make any adjustment; When g0>g1, the first adjustment unit determines that the read speed of the server is abnormal, and adjusts the evaluation process of the cache database performance once, and sets the adjusted preset response time as t1', setting t1'=t1×[1-γ×(g0-g1) / (g0+g1)], γ is the preset read adjustment coefficient, and t1 is the preset response time; The data monitoring module is provided with a second adjustment unit, which is used to compare the acquired server memory n0 with the preset memory n1, and make a secondary adjustment to the evaluation process of the cache database performance according to the comparison result, wherein: When n0≤n1, the second adjustment unit determines that the server memory is normal and does not make any adjustment; When n0>n1, the second adjustment unit determines that the server memory is abnormal, and makes a secondary adjustment to the cache database performance evaluation process, setting the adjusted preset reading speed to g1', and setting g1'=g1×(1+e 3(n0-n1) / (n0+n1)-3 ); A cache optimization module is used to optimize the management process of data cache time and cache capacity of the cache database in the next management period according to the network bandwidth and network delay obtained in the management period. The cache optimization module includes a management optimization unit, which compares the obtained network bandwidth d0 with the preset network bandwidth d1, and optimizes the management process of cache capacity of the cache database in the next management period according to the comparison result, wherein: When d0≤d1, the management optimization unit determines that the network bandwidth is abnormal, and optimizes the management process of the cache capacity of the cache database in the next management cycle, and sets the optimized preset abnormal proportion to u', setting u'=u×[1+β×(d1-d0) / d1], β is the preset optimization coefficient, and u is the preset abnormal proportion; When d0>d1, the management optimization unit determines that the network bandwidth is normal and does not perform optimization; The cache optimization module is provided with an optimization adjustment unit, which compares the average network delay y0 obtained in the management period with the preset delay y1, and performs secondary optimization on the management process of the cache capacity of the cache database according to the comparison result, wherein: When y0≤y1, the optimization adjustment unit determines that the network delay in the current management period is normal and does not perform optimization; When y0>y1, the optimization and adjustment unit determines that the network delay in the current management cycle is abnormal, and performs secondary optimization on the management process of the cache capacity of the cache database, and sets the optimized preset network bandwidth to d1', setting d1'=d1×{1+(π / 2)×arctan[sin(y0-y1) / (y0+y1)]}.
2. The query interface data processing system according to claim 1, characterized in that: The level classification module is provided with an update analysis unit and a level classification unit. The update analysis unit compares the update frequency of the acquired data in the system database with the preset update frequency p1, and analyzes the abnormality of the data update frequency according to the comparison result, wherein: When p0i≤p1, the update analysis unit determines that the update frequency of the data numbered i is normal; When p0i>p1, the update analysis unit determines that the update frequency of the data numbered i is abnormal; Wherein, p0i is the update frequency of data numbered i; The level division unit is used to divide the priority level of data according to the analysis result of the abnormality of data update frequency in the system database and the access frequency of data, wherein: When the data update frequency is normal, if f0i≤f1, the level division unit determines that the priority level of the data numbered i is level one, and sets the cache time of the data in the cache database to Ai1; if f1<f0i<f2, the level division unit determines that the priority level of the data numbered i is level two, and sets the cache time of the data in the cache database to Ai2; if f0i≥f2, the level division unit determines that the priority level of the data numbered i is level three, and sets the cache time of the data in the cache database to Ai3; When the update frequency of data is abnormal, if f0i≤f1×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)], the level division unit determines that the priority level of the data numbered i is level one, and sets the cache time of the data in the cache database to Ai1; if f1×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)]<f0i<f2×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)], the level division unit determines that the priority level of the data numbered i is level two, and sets the cache time of the data in the cache database to Ai2; if f0i≥f2×[1-sin(p0i-p1)×(π / 2) / (p0i+p1)], the level division unit determines that the priority level of the data numbered i is level three, and sets the cache time of the data in the cache database to Ai3; Wherein, f0i is the access frequency of data numbered i, f1 is the first preset access frequency, and f2 is the second preset access frequency.
3. The query interface data processing system according to claim 2, characterized in that: The data monitoring module is provided with a hit rate monitoring unit, which is used to compare the cache hit rate m0 within the monitoring period with the preset hit rate m1, and analyze the abnormality of the cache hit rate of the cache database according to the comparison result, wherein: When m0≤m1, the hit rate monitoring unit determines that the cache hit rate of the cache database in the current monitoring period is abnormal; When m0>m1, the hit rate monitoring unit determines that the cache hit rate of the cache database in the current monitoring period is normal.
4. The query interface data processing system according to claim 3, characterized in that: The data monitoring module is provided with a performance evaluation unit, which is used to evaluate the performance of the cache database according to the analysis result of the cache hit rate of the cache database and the average request response time t0 obtained during the monitoring period, wherein: When the cache hit rate of the cache database is normal, if t0≤t1, the performance evaluation unit determines that the performance of the cache database in the current monitoring period is normal; if t0>t1, the performance evaluation unit determines that the performance of the cache database in the current monitoring period is abnormal; When the cache hit rate of the cache database is abnormal, if t0≤t1×[1-(m1-m0) / m1], the performance evaluation unit determines that the performance of the cache database in the current monitoring period is normal; if t0>t1×[1-(m1-m0) / m1], the performance evaluation unit determines that the performance of the cache database in the current monitoring period is abnormal.
5. The query interface data processing system according to claim 4, characterized in that: The data processing module is provided with a capacity management unit, and the capacity management unit is used to manage the cache capacity of the cache database in the next management period according to the evaluation result of the database performance in the management period, wherein: When k1 / k0≤u, the capacity management unit determines that the performance of the cache database in the current management cycle is normal, and sets the cache capacity of the cache database in the next management cycle to Q1, setting Q1=q0; When k1 / k0>u, the capacity management unit determines that the performance of the cache database in the current management cycle is abnormal, and sets the cache capacity of the cache database in the next management cycle to Q2, setting Q2=q0×{1+ln[(k1 / k0-u)+1]}; Among them, k1 is the number of monitoring cycles of cache database performance anomalies within the management cycle, k0 is the number of monitoring cycles within the management cycle, u is the preset anomaly ratio, and q0 is the cache capacity of the cache database in the current management cycle.
6. The query interface data processing system according to claim 5, characterized in that: The data processing module is provided with a time management unit, which is used to manage the cache time of the data in the cache database in the next management period according to the access frequency of the cache data in the cache database in the management period, the division result of the data priority and the management result of the cache capacity of the cache database in the next management period, wherein: When Gfi≤gf0, the time management unit determines that the access frequency of the data numbered i in the current management cycle is normal. If Qq≤Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R1, and sets R1=Aia; If Qq>Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R2, and sets R2=Aia×{1+{exp{sin[(Qq-Q0)×(π / 2) / (Qq+Q0)]}-1} / 2}; When Gfi>gf0, the time management unit determines that the access frequency of the data numbered i in the current management cycle is abnormal. If Qq≤Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R3, and sets R3=Aia×[1+α×(Gfi-gf0) / (Gfi+gf0)]; If Qq>Q0, the time management unit sets the cache time of the cache data numbered i in the cache database of the next management cycle to R4, and sets R4=Aia×{1+{exp{sin[(Qq-Q0)×(π / 2) / (Qq+Q0)]}-1} / 2+α×(Gfi-gf0) / (Gfi+gf0)}; Among them, Gfi is the access frequency of cache data numbered i in the management cycle, gf0 is the preset access threshold, Aia is the cache time of data numbered i, a=1,2,3; Qq is the management result of the cache capacity of the cache database in the next management cycle, q=1,2, Q0 is the preset capacity threshold, and α is the preset adjustment coefficient.
