Telecommunication industry service cache optimization method and system
By computed and loading and logically separating the cached data of the telecommunications industry business interface, the problem of excessive processing time of the service interface under high concurrency is solved, and the effect of improving the processing capacity and throughput of the service interface is achieved.
Patent Information
- Application Number
- CN202411722684.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-01
AI Technical Summary
In the case of high concurrency, the processing time of the service interface is long and cannot meet the service throughput requirements. The main reasons include database performance bottlenecks, complex data processing, network latency, concurrency control and resource limitations.
Cache optimization is completed by computing and loading cache data, and logically separating business processing and cache processing. The specific steps include calculating the cached data structure in advance and storing it in the cache, and then loading the cached data into the service processing application memory through the process, and separating the cached processing logic from the service processing logic, which is only responsible for the processing and processing of the cached data.
Through cache optimization, the processing capacity and throughput of the business interface are improved, the number of accesses to the database is reduced, the system response time is reduced, and the resource utilization is optimized, improving the overall performance and scalability of the system.
Smart Images

Figure CN119739506A_ABST
Abstract
Description
Background Art
[0002] If the business interface simply obtains data from the database to process the business, it will cause the service processing time to be long and fail to meet the business throughput requirements under the objective concurrency. The reasons include:
[0003] 1. Database performance bottleneck:
[0004] Inefficient database query: If the query statement is not optimized or the index is not set properly, the query speed will be slow. Exhaustion of database connection pool: In high concurrency situations, if the database connection pool is not configured properly, the connection pool may be exhausted, resulting in new requests being unable to obtain database connections.
[0005] 2. Complex data processing:
[0006] Complex business logic: If the business logic needs to process a large amount of data or perform complex calculations, it will take longer to process. Data format conversion: After the data is acquired, it may need to be converted or processed, which will also increase the processing time.
[0007] 3. Network delay:
[0008] Network latency between the database and application server: If the database and application server are deployed in different geographical locations or network environments, network latency may become a factor affecting performance. Network latency between the client and server: The network latency between the client request and the server response can also affect the overall response time.
[0009] 4. Concurrency Control:
[0010] Lock contention: In high-concurrency situations, multiple requests may compete for the same resources (such as database row locks), resulting in longer waiting times.
[0011] Thread pool exhaustion: If the server thread pool is not configured properly, the thread pool may be exhausted, resulting in the inability to process new requests.
[0012] 5. Resource Limitations:
[0013] CPU and memory limitations: If the server's CPU and memory resources are insufficient, it will lead to slower processing speeds or even service crashes. I / O performance limitations: Insufficient disk I / O performance will also affect the speed of database queries and writes. Summary of the invention
[0014] The present application provides a telecommunications industry service cache optimization method and system for improving the processing capability of a service interface and increasing the throughput of the service interface.
[0015] In a first aspect, a method for optimizing service cache in a telecommunications industry is provided, comprising the following steps:
[0016] Calculate and load cached data;
[0017] Logically separate business processing from cache processing to complete cache optimization.
[0018] In the above technical solution, cache data is calculated and loaded; business processing and cache processing are logically separated to complete cache optimization; the processing capacity of the business interface is improved, and the throughput of the business interface is improved.
[0019] In a specific implementation scheme, the step of computing and loading cached data specifically includes:
[0020] Combined with the business implementation method, the cache data structure is calculated in advance and placed in the cache, and then the cache is further loaded into the business processing application memory through the process.
[0021] In a specific implementation scheme, business processing and cache processing are logically separated to complete the cache optimization steps, which specifically include:
[0022] The calculation of some business processing and cache processing logic is floated, and the business processing and cache processing are logically separated to complete cache optimization.
[0023] In a specific implementation scheme, the cache processing logic does not participate in the business logic processing, but is only responsible for the processing and processing of cache data and fetching cache data that meets the conditions.
[0024] In a second aspect, a telecommunications industry service cache optimization system is provided, including:
[0025] A calculation loading module is used to calculate and load cache data;
[0026] The logic separation module is used to logically separate business processing and cache processing to achieve cache optimization.
[0027] In the above technical solution, cache data is calculated and loaded; business processing and cache processing are logically separated to complete cache optimization; the processing capacity of the business interface is improved, and the throughput of the business interface is improved.
[0028] In a specific implementation scheme, computing and loading cached data specifically includes:
[0029] Combined with the business implementation method, the cache data structure is calculated in advance and placed in the cache, and then the cache is further loaded into the business processing application memory through the process.
[0030] In a specific implementation scheme, business processing and cache processing are logically separated, and cache optimization is completed, including:
[0031] The calculation of some business processing and cache processing logic is floated, and the business processing and cache processing are logically separated to complete cache optimization.
[0032] In a specific implementation scheme, the cache processing logic does not participate in the business logic processing, but is only responsible for the processing and processing of cache data and fetching cache data that meets the conditions.
[0033] According to a third aspect, an electronic device is provided, comprising a processor, wherein the processor is coupled to a memory, wherein at least one computer program is stored in the memory, and wherein the at least one computer program is loaded and executed by the processor so that the electronic device implements any one of the telecommunications industry service cache optimization methods.
[0034] In the above technical solution, cache data is calculated and loaded; business processing and cache processing are logically separated to complete cache optimization; the processing capacity of the business interface is improved, and the throughput of the business interface is improved.
[0035] In a fourth aspect, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor so that the computer-readable storage medium implements any one of the telecommunications industry service cache optimization methods.
[0036] In the above technical solution, cache data is calculated and loaded; business processing and cache processing are logically separated to complete cache optimization; the processing capacity of the business interface is improved, and the throughput of the business interface is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flowchart of a method for optimizing telecom industry service cache provided by an embodiment of the present application;
[0038] Figure 2 A structural block diagram of a telecommunications industry service cache optimization system provided in an embodiment of the present application;
[0039] Figure 3 A specific flow chart of cache data calculation and loading provided in an embodiment of the present application;
[0040] Figure 4 A specific flow chart of logic separation provided for an embodiment of the present application;
[0041] Figure 5 A specific flow chart of the telecommunications industry service cache optimization method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The present application is further described in detail below through the accompanying drawings and embodiments. Through these descriptions, the characteristics and advantages of the present application will become clearer and more specific.
[0043] The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise noted.
[0044] In addition, the technical features involved in different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
[0045] To facilitate understanding of the telecom industry service cache optimization method and system provided by the embodiment of the present application, its application scenario is first explained. The telecom industry service cache optimization method and system provided by the embodiment of the present application are used to improve the processing capability of the service interface and improve the throughput of the service interface. The service interface simply obtains data processing services through the database, which will cause the service processing time to be long, and the service throughput requirements cannot be met under the objective concurrency. The reasons include: 1. Database performance bottleneck: low database query efficiency: if the query statement is not optimized or the index setting is improper, the query speed will be slowed down. Database connection pool exhaustion: in high concurrency, if the database connection pool is not configured reasonably, the connection pool may be exhausted, resulting in the inability of new requests to obtain database connections. 2. Complex data processing: complex business logic: if the business logic needs to process a large amount of data or perform complex calculations, it will cause the processing time to be longer. Data format conversion: after the data is acquired, format conversion or processing may be required, and these operations will also increase the processing time. 3. Network delay: network delay between the database and the application server: if the database and the application server are deployed in different geographical locations or network environments, network delay may become a factor affecting performance. Network delay between client and server: Network delay between client request and server response will also affect the overall response time. 4. Concurrency control: Lock contention: In high concurrency situations, multiple requests may compete for the same resources (such as database row locks), resulting in longer waiting times. Thread pool exhaustion: If the server thread pool is not configured properly, the thread pool may be exhausted, resulting in new requests being unable to be processed. 5. Resource limitations: CPU and memory limitations: If the server's CPU and memory resources are insufficient, the processing speed will slow down, and even the service will crash. I / O performance limitations: Insufficient disk I / O performance will also affect the speed of database queries and writes. To this end, the embodiments of the present application provide a telecommunications industry service cache optimization method and system to enhance the processing capabilities of service interfaces and improve the throughput of service interfaces. The following is a detailed description of the embodiments in conjunction with specific drawings.
[0046] refer to Figures 1 to 5 , Figure 1 A flowchart of a method for optimizing telecom industry service cache provided by an embodiment of the present application; Figure 2 A structural block diagram of a telecommunications industry service cache optimization system provided in an embodiment of the present application; Figure 3 A specific flow chart of cache data calculation and loading provided in an embodiment of the present application; Figure 4 A specific flow chart of logic separation provided for an embodiment of the present application; Figure 5 A specific flow chart of the telecommunications industry service cache optimization method provided in an embodiment of the present application.
[0047] exist Figure 1In the embodiment of the present application, a method for optimizing service cache in the telecommunication industry is provided, comprising the following steps:
[0048] Calculate and load cached data;
[0049] Logically separate business processing from cache processing to complete cache optimization.
[0050] In the above technical solution, cache data is calculated and loaded; business processing and cache processing are logically separated to complete cache optimization; the processing capacity of the business interface is improved, and the throughput of the business interface is improved.
[0051] In a specific implementation scheme, the step of computing and loading cached data specifically includes:
[0052] Combined with the business implementation method, the cache data structure is calculated in advance and placed in the cache, and then the cache is further loaded into the business processing application memory through the process.
[0053] Specifically, in combination with the business implementation method, the cache data structure is calculated in advance and placed in the cache, and then the cache is further loaded into the business processing application memory through the process, including:
[0054] 1. Determine cache objects and data structures:
[0055] According to business needs, determine the data objects that need to be cached, such as database query results, calculation results, etc.
[0056] According to the characteristics of data objects, design appropriate data structures, such as strings, hash tables, lists, sets, etc., for efficient storage and retrieval in the cache.
[0057] 2. Cache data pre-calculation and storage:
[0058] Outside of the business processing flow, calculate the data that needs to be cached in advance and store it in the cache according to the designed data structure.
[0059] Preferably, use a high-performance cache system such as Redis, and use its rich data structure support to achieve efficient cache storage and retrieval. Process loading cache data: When the business processing application starts or when needed, the data in the cache is loaded into the application memory through the process. This is achieved by writing a dedicated loading logic and using the API or client library provided by the cache system. Business processing and cache update: During business processing, data is read from the cache first to reduce access to the database or other storage systems. When the cache data needs to be updated, the cache is automatically updated or manually refreshed according to business needs.
[0060] In the above technical solution, 1. Improve system performance: By pre-calculating and storing cache data, the number of accesses to the database or other storage systems during business processing is reduced, and the system response time is reduced. Loading cache data into application memory further improves the data access speed and improves the overall performance of the system. 2. Optimize resource utilization: Pre-calculating and storing cache data avoids the overhead of repeated calculation and storage, and optimizes the utilization of system resources. By automatically updating or manually refreshing the cache, the accuracy and consistency of the cache data are ensured, and data redundancy and waste are avoided.
[0061] 3. Improve user experience: Improved system performance and optimized resource utilization make business processing faster and more efficient, thereby improving user experience and satisfaction. 4. Enhanced system scalability: The use of cache enables the system to better cope with high concurrency and large data volume scenarios, enhancing the scalability and stability of the system. 5. Facilitate monitoring and maintenance: The cache system usually provides a wealth of monitoring and statistical functions, which facilitates monitoring of cache usage and performance, and provides strong support for system maintenance and optimization.
[0062] In a specific implementation scheme, business processing and cache processing are logically separated to complete the cache optimization steps, which specifically include:
[0063] The calculation of some business processing and cache processing logic is floated, and the business processing and cache processing are logically separated to complete cache optimization.
[0064] Specifically, some business processing and cache processing logic are calculated and floated, and business processing and cache processing are logically separated, including:
[0065] 1. Identify computational logic that can be floated: In-depth analysis of business processing flows to identify logic that can be calculated and cached in advance to reduce repeated calculations during business processing. These computational logics usually include complex queries, data aggregation, statistical calculations, etc.
[0066] 2. Design cache strategies and data structures: Based on the identified computational logic, design appropriate cache strategies, such as cache storage location, validity period, update strategy, etc. Select appropriate data structures to store cache data for efficient storage and retrieval in the cache.
[0067] 3. Implement calculation floating and cache storage: Extract the identified calculation logic from the business processing flow and pre-calculate it before business processing. Store the pre-calculated results in the cache for quick access during business processing.
[0068] 4. Business processing and cache access: During business processing, data is read from the cache first. If the required data does not exist in the cache, business processing is performed and the cache is updated.
[0069] 5. Logic separation and code refactoring: Completely separate the business processing logic from the cache processing logic to ensure the independence between the two. Refactor the code and encapsulate the cache processing logic into a dedicated module or class for better management and maintenance.
[0070] 6. Testing and optimization: Conduct comprehensive testing on the optimized system to ensure the correctness and consistency of the cache. Based on the test results, optimize the cache strategy and data structure to improve the performance and stability of the system.
[0071] In the above technical solution, 1. Improve system performance: Through calculation floating and cache storage, repeated calculations in the business processing process are reduced, and the response time of the system is reduced. The access speed of the cache is usually faster than that of the database or other storage systems, which further improves the performance of the system. 2. Optimize resource utilization: The use of cache avoids the overhead of repeated calculations and optimizes the utilization of system resources. Through reasonable cache strategies and data structures, cache redundancy and waste can be reduced, and resource utilization can be improved. 3. Enhance system scalability: The use of cache enables the system to better cope with high concurrency and large data volume scenarios, enhancing the scalability of the system. Through calculation floating and logical separation, the system can be more easily modularized and componentized, which is convenient for subsequent expansion and maintenance. 4. Improve code readability and maintainability: Logical separation and code refactoring make the code structure clearer and improve the readability and maintainability of the code. The cache processing logic is encapsulated in a special module or class, which is convenient for subsequent management and optimization. 5. Facilitate monitoring and debugging: The cache system usually provides a wealth of monitoring and statistical functions, which can easily monitor the usage and performance of the cache. When problems occur, it is easier to locate and solve cache-related faults.
[0072] In a specific implementation scheme, the cache processing logic does not participate in the business logic processing, but is only responsible for the processing and processing of cache data and fetching cache data that meets the conditions.
[0073] Specifically, refer to Figures 3 to 5 The telecommunications industry service cache optimization method includes: combining the service implementation mode, calculating the cache data structure in advance and putting it into the cache, and then further loading the cache into the service processing application memory through the process; separating the service processing from the cache processing logic, some logic needs to do certain calculation floating, and the cache processing logic does not participate in the service logic processing, but is only responsible for the processing of cache data and processing and extracting the cache data that meets the conditions. In the above technical solution, the processing capacity of the service interface is improved, and the throughput of the service interface is improved.
[0074] exist Figure 2 In the embodiment of the present application, a telecommunication industry service cache optimization system is provided, including:
[0075] A calculation loading module is used to calculate and load cache data;
[0076] The logic separation module is used to logically separate business processing and cache processing to achieve cache optimization.
[0077] In the above technical solution, cache data is calculated and loaded; business processing and cache processing are logically separated to complete cache optimization; the processing capacity of the business interface is improved, and the throughput of the business interface is improved.
[0078] In a specific implementation scheme, computing and loading cached data specifically includes:
[0079] Combined with the business implementation method, the cache data structure is calculated in advance and placed in the cache, and then the cache is further loaded into the business processing application memory through the process.
[0080] In a specific implementation scheme, business processing and cache processing are logically separated, and cache optimization is completed, including:
[0081] The calculation of some business processing and cache processing logic is floated, and the business processing and cache processing are logically separated to complete cache optimization.
[0082] In a specific implementation scheme, the cache processing logic does not participate in the business logic processing, but is only responsible for the processing and processing of cache data and fetching cache data that meets the conditions.
[0083] An embodiment of the present application also provides an electronic device, which includes a processor, the processor is coupled to a memory, and the memory stores at least one computer program. The at least one computer program is loaded and executed by the processor so that the electronic device implements any one of the telecommunications industry service cache optimization methods.
[0084] In the above technical solution, cache data is calculated and loaded; business processing and cache processing are logically separated to complete cache optimization; the processing capacity of the business interface is improved, and the throughput of the business interface is improved.
[0085] An embodiment of the present application also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor so that the computer-readable storage medium implements any one of the telecommunications industry service cache optimization methods.
[0086] In the above technical solution, cache data is calculated and loaded; business processing and cache processing are logically separated to complete cache optimization; the processing capacity of the business interface is improved, and the throughput of the business interface is improved.
[0087] Those skilled in the art will appreciate that the present application may be implemented as a system, method or computer program product.
[0088] Therefore, the present disclosure may be specifically implemented in the following forms, namely: it may be completely hardware, it may be completely software (including firmware, resident software, microcode, etc.), or it may be a combination of hardware and software, generally referred to herein as a "circuit", "module" or "system". In addition, in some embodiments, the present application may also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium may contain computer-readable program code.
[0089] Any combination of one or more computer-readable media can be used. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0090] Although the embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art can change, modify, replace and modify the above embodiments within the scope of the present application. On this basis, a variety of replacements and improvements can be made to the present application, all of which fall within the scope of protection of the present application.
Claims
1. A method for optimizing service cache in the telecommunication industry, characterized in that: The following steps are involved: Calculate and load cached data; Logically separate business processing from cache processing to complete cache optimization.
2. The telecommunication industry service cache optimization method according to claim 1, characterized in that: The steps for calculating and loading cache data include: Combined with the business implementation method, the cache data structure is calculated in advance and placed in the cache, and then the cache is further loaded into the business processing application memory through the process.
3. The telecommunication industry service cache optimization method according to claim 2, characterized in that: Logically separate business processing from cache processing and complete the cache optimization steps, including: The calculation of some business processing and cache processing logic is floated, and the business processing and cache processing are logically separated to complete cache optimization.
4. The method for optimizing telecommunication industry service cache according to claim 3, characterized in that: The cache processing logic does not participate in business logic processing, but is only responsible for processing and processing cache data and retrieving cache data that meets the conditions.
5. A telecommunications industry service cache optimization system, characterized in that: include: A calculation loading module is used to calculate and load cache data; The logic separation module is used to logically separate business processing and cache processing to achieve cache optimization.
6. The telecommunication industry service cache optimization system according to claim 5, characterized in that: The calculation and loading of cache data specifically includes: Combined with the business implementation method, the cache data structure is calculated in advance and placed in the cache, and then the cache is further loaded into the business processing application memory through the process.
7. The telecommunication industry service cache optimization system according to claim 6, characterized in that: Logically separate business processing from cache processing to complete cache optimization, including: The calculation of some business processing and cache processing logic is floated, and the business processing and cache processing are logically separated to complete cache optimization.
8. The telecommunication industry service cache optimization system according to claim 7, characterized in that: The cache processing logic does not participate in business logic processing, but is only responsible for processing and processing cache data and retrieving cache data that meets the conditions.
9. An electronic device, characterized in that: The electronic device includes a processor, the processor is coupled to a memory, the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor so that the electronic device implements the telecommunications industry service cache optimization method as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that the computer-readable storage medium implements the telecommunication industry service cache optimization method as described in any one of claims 1 to 4.