Cache parameter reading method, system and equipment for multi-sub-library application and medium
In the multi-division library application on the application side, if the server obtains the parameter list abnormally, the parameter list is obtained from other databases, which solves the problem of empty or invalidation of cache parameters caused by server downtime or exceptions, and improves the system's fault tolerance and business continuity.
Patent Information
- Application Number
- CN202411645415.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-07
AI Technical Summary
In the case where the server is down or abnormal, the application side cannot obtain the necessary business data, resulting in the cache parameters being empty or invalid, affecting the continuous service of the application side.
On the application side, if the read cache is empty, a parameter list query request is sent to the server side. If the server obtains the parameter list process abnormally, the parameter list will be obtained from other libraries and returned as cache parameters.
By obtaining data from other databases when the server is not available, the system's fault tolerance is improved, ensuring that the application side can still obtain effective cache parameters in the server abnormal situation, and ensuring the continuity and stability of the business.
Smart Images

Figure CN119576989A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a cache parameter reading method, system, device and medium for multi-library applications. Background Art
[0002] The existing business application parameter service adopts a multi-database application system architecture, that is, data is stored in multiple application instances in a distributed manner to cope with large-scale data processing and high-concurrency access requirements. Under this architecture, each database application needs to obtain necessary business data from the parameter server during operation. These business parameters are crucial to the normal operation of the database application. However, the parameter server application in the existing solution is a key node and is not designed as a high-availability system. When the server application crashes or other abnormal conditions occur, the application cannot obtain the required business data from the server, resulting in the cache parameters in the application cache being empty or invalid when reading the application cache parameters, which in turn affects the application's ability to provide continuous services, leading to situations such as transaction failures.
[0003] Therefore, how to improve the reliability of reading cache parameters of multi-database applications is a problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of the present application is to provide a method, system, device and medium for reading cache parameters of multi-library applications, aiming to solve the technical problem of how to improve the reliability of reading cache parameters of multi-library applications.
[0005] To achieve the above purpose, the present application proposes a cache parameter reading method for a multi-library application, which is applied to an application end. The cache parameter reading method for a multi-library application includes:
[0006] For any application instance under any sub-library in the multi-library application, read the cache of the application instance, and if the cache is empty, send a parameter list query request to the server to obtain the first parameter list corresponding to the application instance from the server based on the parameter list query request;
[0007] In case the first parameter list acquisition process is abnormal, a second parameter list corresponding to the application instance is obtained from other sub-libraries in the multi-library application, the second parameter list is used as cache parameters stored in the cache, and the cache parameters are returned.
[0008] In one embodiment, after the step of obtaining the first parameter list corresponding to the application instance from the server, the step further includes:
[0009] If the first parameter list is obtained from the server, it is determined that the process of obtaining the first parameter list is normal;
[0010] If the first parameter list acquisition process is normal, use the first parameter list as cache parameters stored in the cache, and return the cache parameters;
[0011] If a preset abnormal prompt instruction is obtained from the server, it is determined that the first parameter list acquisition process is abnormal.
[0012] In one embodiment, the step of using the second parameter list as cache parameters stored in the cache and returning the cache parameters includes:
[0013] If the second parameter list is obtained from the other sub-libraries, it is determined that the process of obtaining the second parameter list is normal;
[0014] If the second parameter list acquisition process is normal, use the second parameter list as cache parameters stored in the cache, and return the cache parameters;
[0015] If the second parameter list is not obtained from the other sub-libraries, or the sub-library does not exist in other sub-libraries, it is determined that the process of obtaining the second parameter list is abnormal;
[0016] In case the second parameter list acquisition process is abnormal, a third parameter list corresponding to the application instance is acquired from other application instances under the sub-library, the third parameter list is used as cache parameters stored in the cache, and the cache parameters are returned.
[0017] In one embodiment, the cache parameter is configured with an expiration time, and after the step of using the third parameter list as the cache parameter stored in the cache and returning the cache parameter, the method further includes:
[0018] Extending the expiration time to obtain an updated expiration time;
[0019] After the updated expiration time, the cache parameters in the cache are deleted, and the process returns to the step of executing the read operation of the cache of the application instance.
[0020] The present application also proposes a cache parameter reading method for a multi-database application, which is applied to a server, wherein the server includes a plurality of identical replica databases. The cache parameter reading method for the multi-database application includes:
[0021] Receiving a parameter list query request sent by the application end, and querying each replica database based on the parameter list query request, wherein the parameter list query request is generated by the application end when the cache of the application instance read is empty;
[0022] In the case that the query fails to obtain the first parameter list requested by the parameter list query request, a preset exception prompt instruction is returned to the application end, wherein the exception prompt instruction is used to inform the application end that the first parameter list acquisition process is abnormal, and instruct the application end to obtain the parameter list from other sub-libraries in the multi-library application.
[0023] In one embodiment, the step of querying each replica database based on the parameter list query request includes:
[0024] Splitting the parameter list query request to obtain multiple parameter sub-list query requests;
[0025] For any parameter sublist query request, sending the parameter sublist query request to a corresponding replica database, and querying the parameter sublist in the replica database based on the parameter sublist query request;
[0026] After traversing each parameter sublist query request, if each parameter sublist query request has a corresponding parameter sublist, constructing a first parameter list based on each parameter sublist, and returning the first parameter list to the application end;
[0027] If there is no corresponding parameter sublist for any parameter sublist query request, it is determined that the query fails to obtain the first parameter list requested by the parameter list query request.
[0028] In one embodiment, the parameter list query request includes a keyword primary key and a level key, and the step of querying the parameter sublist in the replica database based on the parameter sublist query request includes:
[0029] In the replica database, matching a corresponding target parameter sublist based on the keyword primary key and the level key;
[0030] In the case where the target parameter sublist is obtained through matching, the target parameter sublist is used as the parameter sublist;
[0031] In the case that the target parameter sub-list is not matched, the level key is updated based on the level key of the level above the level corresponding to the level key, and based on the updated level key, the step of matching the corresponding target parameter sub-list based on the keyword primary key and the level key is returned to be executed.
[0032] In the case that the level corresponding to the level key does not have an upper level, the keyword primary key is updated based on a preset matching symbol, and the parameter sub-list is obtained based on matching the updated keyword primary key with the level key.
[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a cache parameter reading system for a multi-database application, the cache parameter reading system for a multi-database application comprising: an application end and a server end, the server end comprising a plurality of identical replica databases;
[0034] The application end is used to read the cache of any application instance under any sub-library in the multi-library application, and if the cache is empty, send a parameter list query request to the server end, so as to obtain the first parameter list corresponding to the application instance from the server end based on the parameter list query request;
[0035] In the case that the first parameter list acquisition process is abnormal, obtaining a second parameter list corresponding to the application instance from other sub-libraries in the multi-library application, using the second parameter list as cache parameters stored in the cache, and returning the cache parameters;
[0036] The server is used to receive the parameter list query request sent by the application, and query each replica database based on the parameter list query request;
[0037] In the case that the query fails to obtain the first parameter list requested by the parameter list query request, a preset exception prompt instruction is returned to the application end, wherein the exception prompt instruction is used to inform the application end that the first parameter list acquisition process is abnormal, and instruct the application end to obtain the parameter list from other sub-libraries in the multi-library application.
[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the cache parameter reading method for the multi-library application as described above.
[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the cache parameter reading method for the multi-library application as described above are implemented.
[0040] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the cache parameter reading method for the multi-library application as described above.
[0041] One or more technical solutions proposed in this application have at least the following technical effects:
[0042] The present application first reads the cache of any application instance under any sub-library in a multi-library application. If the cache is read to be empty, a parameter list query request is sent to the server to obtain the first parameter list corresponding to the application instance from the server based on the parameter list query request, thereby ensuring that the application instance can obtain the latest parameter list from the server when the cache data is missing, thereby ensuring business continuity and data consistency; in the event of an abnormality in the first parameter list acquisition process, a second parameter list corresponding to the application instance is obtained from other sub-libraries in the multi-library application, the second parameter list is used as the cache parameter stored in the cache, and the cache parameter is returned, so that when the server is unable to provide services, data can be obtained from other sub-libraries on the application side, thereby improving the fault tolerance of the system and ensuring the normal operation of the application-side business. Even when the server is unavailable, data can be obtained normally, thereby maintaining the continuous service capability of the application-side business.
[0043] In summary, this application avoids the problem of the application side being unable to obtain necessary business data due to server-side application crashes or other abnormal conditions by redirecting the data acquisition source to other sub-databases when the server side is unavailable, thereby ensuring that valid cache parameters can be read in abnormal situations on the server side, ensuring business continuity and stability, and achieving the effect of improving the reliability of reading cache parameters for multi-database applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0046] Figure 1 A flow chart of the first embodiment of the method for reading cache parameters of a multi-library application of the present application;
[0047] Figure 2 A schematic diagram of a scenario of a method for reading cache parameters of a multi-library application provided in Example 1 of the present application;
[0048] Figure 3 A schematic diagram of a degradation process of a cache parameter reading method for a multi-library application provided in Example 1 of the present application;
[0049] Figure 4A flow chart of the second embodiment of the method for reading cache parameters for multi-database application of the present application;
[0050] Figure 5 A schematic diagram of a parameter matching process of a cache parameter reading method for a multi-library application provided in Example 2 of the present application;
[0051] Figure 6 This is a schematic diagram of the module structure of the cache parameter reading system for multi-library application in the embodiment of the present application;
[0052] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the cache parameter reading method of the multi-library application in the embodiment of the present application.
[0053] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0054] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0055] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0056] The main solution of the embodiment of the present application is: for any application instance under any sub-library in the multi-library application, read the cache of the application instance; if the cache is read to be empty, send a parameter list query request to the server to obtain the first parameter list corresponding to the application instance from the server based on the parameter list query request; in the event that the first parameter list acquisition process is abnormal, obtain the second parameter list corresponding to the application instance from other sub-libraries in the multi-library application, use the second parameter list as the cache parameter stored in the cache, and return the cache parameter.
[0057] Since the parameter server application in the existing solution is a key node and is not designed as a high-availability system, when the server application crashes or encounters other abnormal conditions, the application cannot obtain the required business data from the server, resulting in the cache parameters in the application cache being empty or invalid when reading the cache parameters on the application side, which in turn affects the application's continuous service and causes situations such as transaction failure. Therefore, how to improve the reliability of reading cache parameters for multi-database applications is a problem that needs to be solved urgently.
[0058] The present application provides a solution, which avoids the problem of the application side being unable to obtain necessary business data due to server-side application crashes or other abnormal conditions by redirecting the data acquisition source to other sub-databases when the server side is unavailable, thereby ensuring that valid cache parameters can be read in abnormal situations on the server side, ensuring business continuity and stability, and achieving the effect of improving the reliability of reading cache parameters of multi-database applications.
[0059] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device that can realize the above functions. The following takes an electronic device as an example to illustrate this embodiment and the following embodiments.
[0060] Based on this, the embodiment of the present application provides a cache parameter reading method for a multi-library application, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the cache parameter reading method for multi-database application of the present application.
[0061] In this embodiment, the cache parameter reading method of the multi-library application is applied to the application end, and the cache parameter reading method of the multi-library application includes steps S10 to S20:
[0062] Step S10, for any application instance under any sub-library in the multi-library application, read the cache of the application instance, and if the cache is empty, send a parameter list query request to the server to obtain a first parameter list corresponding to the application instance from the server based on the parameter list query request;
[0063] It should be noted that a multi-database application refers to a distributed database architecture in which data is stored in multiple independent application instances to improve data processing capabilities and system scalability; a database refers to multiple independent databases on the application side, each of which can contain multiple different application instances; an application instance refers to an execution instance of a single application running on the application-side server; a parameter list query request refers to a request initiated by an application instance to the server to obtain a parameter list required for the application instance business; and a first parameter list refers to a parameter list obtained directly from the server.
[0064] It is understandable that since the cache parameters in the application instance cache are empty or invalid, step S10 is performed. By sending a parameter list query request to the server, the problem of the application not being able to run normally due to missing cache data can be avoided, thereby obtaining cache parameters from a reliable server and ensuring business continuity.
[0065] Exemplarily, for any application instance under any sub-library in a multi-library application, in the process of reading cache parameters in the cache of the application instance, if the cache parameters read are empty, a parameter list query request is sent to the server through the application end.
[0066] In a feasible implementation manner, step S10 may further include steps S101 to S103 after step S10:
[0067] Step S101, if the first parameter list is obtained from the server, it is determined that the process of obtaining the first parameter list is normal;
[0068] It is understandable that since it is necessary to verify whether the operation of obtaining the parameter list from the server is successful, performing step S101 can avoid the problem of incorrectly processing subsequent business logic due to unverified data acquisition results, thereby confirming that the server data acquisition is successful, and then ensuring that the application instance can use the latest parameter list.
[0069] Step S102: if the first parameter list acquisition process is normal, use the first parameter list as cache parameters stored in the cache, and return the cache parameters;
[0070] It is understandable that after successfully obtaining the first parameter list, it needs to be stored in the cache of the application instance for quick access, so performing step S102 can avoid the problem of having to re-acquire data from the server for each business operation due to the failure to cache the parameter list, thereby achieving the effect of improving the response speed of the application instance and reducing the server load.
[0071] Step S103: If a preset abnormal prompt instruction is obtained from the server, it is determined that the first parameter list acquisition process is abnormal.
[0072] It should be noted that the preset abnormal prompt instruction refers to an instruction preset on the server side, and the instruction is used to inform the application side through the server side that an abnormality occurs in the acquisition process of the first parameter list.
[0073] It is understandable that since it is necessary to identify and handle the abnormal situation when the server cannot provide the required data, performing step S103 can avoid system errors or business interruptions caused by failure to identify server failures, thereby timely triggering the backup data acquisition strategy, that is, obtaining the parameter list from other sub-databases on the application side, ensuring that the application instance can read the cache parameters when the server is abnormal and continue to maintain normal operation.
[0074] In this implementation, by verifying the parameter list results obtained by the server and updating the cache after the application obtains the valid parameter list, the need to re-query the server for each business operation is avoided, thereby ensuring that the application instance can quickly access the latest business parameters, improving system reliability and response speed, and avoiding the problem of the application instance being unable to obtain the correct parameters due to failure to obtain data on the server. By identifying anomalies in the acquisition process, a reliable guarantee is provided for subsequent fault handling and data recovery.
[0075] Step S20, when the first parameter list acquisition process is abnormal, obtain a second parameter list corresponding to the cache parameter from other sub-libraries in the multi-sub-library application, use the second parameter list as the cache parameter stored in the cache, and return the cache parameter;
[0076] It should be noted that the second parameter list refers to the parameter list obtained from other sub-databases of the application endpoint when the server cannot provide data; the cache parameter refers to the data stored in the cache of the application instance to support fast access to business logic.
[0077] It is understandable that since exceptions often occur in the process of obtaining the parameter list from the server, resulting in the inability to obtain a valid parameter list, step S20 is performed to obtain the adoption number list from other sub-databases on the application side. This can avoid the problem of data acquisition failure caused by server failure, thereby achieving the redundancy of the distributed database architecture, that is, the multi-database architecture to ensure system availability.
[0078] Exemplarily, when the first parameter list acquisition process is abnormal, the second parameter list corresponding to the cache parameters is acquired from other sub-libraries in the multi-sub-library application through the application end.
[0079] In a feasible implementation manner, the step of using the second parameter list as cache parameters stored in the cache and returning the cache parameters in step S20 may include steps S201 to S204:
[0080] Step S201, if the second parameter list is obtained from the other sub-libraries, it is determined that the process of obtaining the second parameter list is normal;
[0081] It is understandable that when the server cannot provide data, it is necessary to verify whether the operation of obtaining the parameter list from other sub-databases on the application side is successful. Therefore, performing step S201 can avoid the problem of incorrectly processing subsequent business logic due to failure to verify the data acquisition results, thereby confirming that the data from other sub-databases is successfully obtained and ensuring that the application instance can use the backup data.
[0082] Step S202: if the second parameter list acquisition process is normal, use the second parameter list as cache parameters stored in the cache, and return the cache parameters;
[0083] It is understandable that after successfully obtaining the parameter list from other sub-libraries, the parameter list needs to be stored in the cache of the application instance for quick access, so step S202 is performed. This can avoid the problem that the application instance needs to re-obtain data from the sub-library the next time it is accessed due to the failure to cache the parameter list, thereby achieving the effect of improving the response speed of the application instance and reducing the load on the sub-library.
[0084] Step S203, if the second parameter list is not obtained from the other sub-libraries, or the sub-library does not exist in other sub-libraries, it is determined that the process of obtaining the second parameter list is abnormal;
[0085] It is understandable that when an attempt to obtain data from other sub-databases fails or other sub-databases do not exist, it is necessary to identify and handle such abnormal situations. Therefore, performing step S203 can avoid system errors or business interruptions caused by failure to identify failure to obtain sub-database data, thereby achieving timely triggering of higher-level data recovery strategies, that is, obtaining parameter lists from other application instances of the same sub-database, thereby ensuring that the application instance can take corresponding measures when sub-database data acquisition is abnormal, thereby maintaining business continuity.
[0086] Step S204, when the second parameter list acquisition process is abnormal, obtain the third parameter list corresponding to the application instance from other application instances under the sub-library, use the third parameter list as the cache parameter stored in the cache, and return the cache parameter.
[0087] It should be noted that the third parameter list refers to a parameter list obtained from other application instances in the same sub-library when the server and other sub-libraries are unable to provide data.
[0088] It is understandable that various anomalies may occur in the process of obtaining parameter lists from other sub-libraries, such as no other sub-libraries are configured except the current sub-library, or a valid parameter list cannot be obtained from other sub-libraries, so step S204 is performed to avoid the problem of data acquisition failure caused by communication failure between sub-libraries, thereby achieving the effect of further ensuring data integrity and system stability through data sharing between application instances.
[0089] For example, please refer to Figure 2 , Figure 2A scenario diagram of a cache parameter reading method for a multi-library application provided in Example 1 of the present application. The system in which the cache parameter reading method for a multi-library application is operated includes an application end on the left side of the figure and a server end on the right side. The application end is configured with a parameter service SDK (Software Development Kit), which can be used to automatically call the server end to obtain a parameter list and put it into the cache using the cache manager when the application instance deployed on the application end is restarted, so as to ensure that there is no abnormality in the business-related parameter logic after the restart; it can also be used to configure the parameter expiration time, that is, when the parameter expires, the SDK automatically calls the server end to obtain the parameter list and uses the cache manager to first delete the old parameter list in the cache, and then put the new list into the cache; it can also be used to configure a timer, that is, automatically call the server end at a fixed time to obtain the parameter list and use the cache manager to first delete the old parameter list in the cache, and then put the new list into the cache. The first-level downgrade is when the cache on the application end is empty, and the parameter list corresponding to the application instance (i.e., the first parameter list) is obtained from the server sub-library 1, server sub-library 2, etc., i.e., each copy database in the server end. The second level of downgrade means that when all server applications are abnormal, the parameter list (i.e., the second parameter list) is obtained from other sub-libraries of this application. The third level of downgrade means that when a valid parameter list cannot be obtained from the server and other sub-libraries, the parameter list (i.e., the third parameter list) is obtained from other application instances in this sub-library.
[0090] In this implementation, by adopting distributed data backup and cache management, verifying that the second parameter list is successfully obtained from other sub-databases, and caching these parameters to the application instance, the risk of the application instance being unable to access key business data when the server is unavailable is avoided, while reducing network latency and data access overhead. When data acquisition is abnormal, by identifying and handling this situation, possible business interruption is avoided, ensuring that the system can take emergency measures, such as triggering data recovery strategies, thereby maintaining business continuity and stability, and achieving the effect of improving system availability and response efficiency.
[0091] In a feasible implementation manner, the cache parameter configuration includes an expiration time, and step S204 may further include steps S301 to S302:
[0092] Step S301, extending the expiration time to obtain an updated expiration time;
[0093] It should be noted that the expiration time refers to the duration that the cache parameters remain valid in the application instance cache.
[0094] It is understandable that, because it is necessary to maintain the validity of cached data in certain circumstances to cope with frequent data access demands or server pressure, performing step S301 can avoid unnecessary network requests and server loads caused by premature expiration of cached data, thereby achieving the effect of optimizing system performance and reducing server pressure by extending the life cycle of cached data.
[0095] Step S302: after the updated expiration time, delete the cache parameters in the cache, and return to the step of reading the cache of the application instance.
[0096] It is understandable that in order to ensure that the cached data does not become outdated and maintain the accuracy and consistency of the data, step S302 is performed, which can avoid business logic errors or data inconsistencies caused by the cached data not being updated for a long time, thereby maintaining data freshness and system reliability by regularly clearing and updating the cached data.
[0097] For example, please refer to Figure 3 , Figure 3 A schematic diagram of the downgrade processing flow of the cache parameter reading method for a multi-library application provided in Example 1 of the present application. When the business of the application instance on the application side starts, the cache parameters in the cache are read first. If the cache parameters exist and are not expired, the business is processed normally based on the cache parameters; if the cache exists but is expired, or the cache parameters do not exist, that is, the cache is empty, a first-level downgrade is performed, that is, a parameter list (that is, a first parameter list) is obtained from the server. After the server returns the parameter list, if the acquisition process is normal, the parameter list is stored in the cache as a cache parameter for normal business processing; if the acquisition process is abnormal, a second-level downgrade is performed, that is, a parameter list (that is, a second parameter list) is obtained from other sub-libraries. After the other sub-libraries return the parameter list, if the acquisition process is normal, the parameter list is stored in the cache as a cache parameter for normal business processing; if the acquisition process is abnormal, the third level downgrade is performed, that is, the parameter list (that is, the third parameter list) is obtained from other instances of the current sub-library, and then the parameter list is stored in the cache as a cache parameter, and the expiration time of the cache parameter, that is, the invalidation time, is extended, and finally normal business processing is performed based on the cache parameter.
[0098] In this implementation, by adopting a strategy for dynamically adjusting cache expiration, the life cycle of cached data is flexibly adjusted, thereby avoiding the problem of frequent data refresh and increased server pressure due to fixed expiration time of cached data, thereby reducing unnecessary network requests and data loading, and ensuring that cached data will not become outdated, maintaining the stability and response speed of the system, and optimizing cache management according to the actual data reading mode to maintain data freshness and system performance.
[0099] The present embodiment provides a method for reading cache parameters of multi-database applications. By redirecting the data acquisition source to other sub-databases when the server is unavailable, the problem of the application side being unable to obtain necessary business data due to server-side application crashes or other abnormal conditions is avoided, thereby ensuring that valid cache parameters can be read in abnormal circumstances on the server side, ensuring business continuity and stability, and achieving the effect of improving the reliability of reading cache parameters of multi-database applications.
[0100] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 , Figure 4 This is a flow chart of the second embodiment of the cache parameter reading method for multi-database application of the present application.
[0101] In this embodiment, the cache parameter reading method for the multi-database application is applied to a server, and the server includes a plurality of identical replica databases.
[0102] It should be noted that in the server of this application, read operations and write operations are separated and processed on different servers, so that data support is provided by multiple read databases, reducing the risk of accidents and improving the feasibility of the system. At the same time, the server supports the master-slave mode, with local backup and off-site backup, and can flexibly switch the master and standby databases at any time, thereby reducing the risk of accidents. In addition, the server supports blue version operation, blue-green balance, green version operation and other modes through the master control allocation mechanism, and cooperates with the gray release mechanism of the blue and green versions to realize the blue-green gray release of scheduled tasks, which is convenient for operation and maintenance management, and the server can control the start and stop of scheduled tasks by modifying the task configuration parameters, so as to support application release, hardware operation and maintenance, emergency switching and other operations, and ensure the integrity and continuity of the business.
[0103] The cache parameter reading method of the multi-library application includes steps S01 to S02:
[0104] Step S01, receiving a parameter list query request sent by an application end, and querying each replica database based on the parameter list query request, wherein the parameter list query request is generated by the application end when the cache of the application instance read is empty;
[0105] It is understandable that, since traditional database queries are often based on a single database, performing step S01 can avoid processing delays and database pressure caused by a single query request that is too large in volume, and by distributing the query requests to multiple databases, query efficiency and system reliability are improved.
[0106] Exemplarily, a parameter list query request sent by the application is received by the server, and each replica database in the server is queried based on the parameter list query request.
[0107] In a feasible implementation manner, the step of querying each replica database based on the parameter list query request in step S01 may include steps S011 to S014:
[0108] Step S011, splitting the parameter list query request to obtain multiple parameter sub-list query requests;
[0109] It should be noted that the parameter sublist query request refers to dividing the original parameter list query request into multiple small query requests, each request only contains a part of the parameters requested by the original request.
[0110] It is understandable that since the efficiency of obtaining traditional parameter lists is low, performing step S011 can avoid processing delays and database pressure caused by a single query request that is too large, and can reduce the pressure on a single server by splitting the request, thereby speeding up the query processing operation and improving the system's availability.
[0111] Step S012: for any parameter sublist query request, send the parameter sublist query request to the corresponding replica database, and query the parameter sublist in the replica database based on the parameter sublist query request;
[0112] It should be noted that the server includes a write server and multiple read servers. The write server corresponds to the master database, and each read server corresponds to a replica database. The replica database refers to a copy instance of the server's master database. It contains all the data of the master database and is used to share the reading pressure and provide data redundancy. When the master database is updated, these updates will be asynchronously copied to each replica database to ensure that the results returned by the read server are consistent with the master database; the parameter sublist refers to the partial parameter list results obtained from the replica database.
[0113] It is understandable that in order to utilize database replicas for load balancing and data redundancy, step S012 is performed, which can avoid the problem of low query efficiency or even query failure caused by single-point database failure or overload, and achieve the effect of improving system reliability and query response speed through distributed query.
[0114] Exemplarily, for any parameter sublist query request, the parameter sublist query request is sent by the server to a corresponding replica database in the server, so as to query the parameter sublist in the replica database based on the parameter sublist query request.
[0115] Step S013, after traversing each parameter sublist query request, if each parameter sublist query request has a corresponding parameter sublist, construct a first parameter list based on each parameter sublist, and return the first parameter list to the application end;
[0116] Step S014: if any parameter sublist query request does not have a corresponding parameter sublist, it is determined that the query does not obtain the first parameter list requested by the parameter list query request.
[0117] In this embodiment, by evenly distributing query requests to multiple databases for execution, the problem of low query efficiency or even query failure caused by single-point database failure or overload can be avoided, thereby accelerating query processing operations and improving system availability.
[0118] Step S02, when the query fails to obtain the first parameter list requested by the parameter list query request, a preset exception prompt instruction is returned to the application end, wherein the exception prompt instruction is used to inform the application end that the first parameter list acquisition process is abnormal, and instruct the application end to obtain the parameter list from other sub-libraries in the multi-library application.
[0119] It is understandable that when the parameter list required for the request cannot be obtained on the server side, the cache parameters in the cache of the application side will be empty, or invalid cache parameters will be stored in the cache. Therefore, step S02 is performed to return the exception prompt instruction to the application side to prompt the application side to obtain the required second parameter list from other sub-libraries in the multi-library application. This can avoid the problem of data acquisition failure caused by server failure, thereby achieving the redundancy of the distributed database architecture, that is, the multi-library architecture to ensure system availability.
[0120] In this embodiment, by performing distributed query and returning exception prompts, not only the burden on a single database is reduced, the parallelism and fault tolerance of data access are improved through distributed query of replica databases, and the problem of application-side data acquisition failure caused by server-side failure is avoided, thereby ensuring that valid cache parameters can be read in the event of an abnormality on the server side, ensuring business continuity and stability, and achieving the effect of improving the reliability of reading cache parameters of multi-library applications.
[0121] In a feasible implementation manner, the parameter list query request includes a keyword primary key and a hierarchical key, and the step of querying the parameter sublist in the replica database based on the parameter sublist query request in step S012 may include steps S100 to S400:
[0122] Step S100, in the replica database, matching a corresponding target parameter sublist based on the keyword primary key and the hierarchical key;
[0123] It should be noted that the keyword primary key refers to the keyword used to uniquely identify a record in the database, and is usually used to quickly locate a specific data row; the hierarchical key refers to the key used to indicate the position of data in the hierarchical structure. This key can help navigate and query data in a multi-level database structure. The same keyword primary key can correspond to multiple levels of hierarchical keys; the target parameter sublist refers to a specific parameter set obtained by querying the keyword primary key and hierarchical key, which is part of the result of the parameter list query request.
[0124] It is understandable that, since in the traditional database positioning process, positioning is often only based on the keyword primary key, without considering that data usually exists in different levels, and in distributed databases it is usually necessary to accurately locate and retrieve data, so performing step S100 can avoid the problem of low data retrieval efficiency or retrieval errors caused by inaccurate queries due to failure to consider hierarchical factors, and realize hierarchical matching to improve query efficiency while ensuring the accuracy of query results.
[0125] Step S200, when the target parameter sub-list is obtained through matching, the target parameter sub-list is used as the parameter sub-list;
[0126] It is understandable that since the target data needs to be returned as a valid result after being queried, performing step S200 can avoid incomplete parameter sublists due to failure to properly process query results, thereby ensuring the correctness of the parameter sublist by confirming the query results.
[0127] Step S300, when the target parameter sublist is not obtained by matching, the hierarchy key is updated based on the hierarchy key of the level one level above the level corresponding to the hierarchy key, and the step of matching the corresponding target parameter sublist based on the keyword primary key and the hierarchy key is returned based on the updated hierarchy key;
[0128] It is understandable that, since when data is not found at the current level, it is necessary to trace back to the previous level to find relevant data, so performing step S300 can avoid query failure caused by missing hierarchical data, and achieve the effect of improving query flexibility and data retrieval success rate through hierarchical tracing.
[0129] Step S400, when there is no previous level at the level corresponding to the level key, the keyword primary key is updated based on a preset matching symbol, and the parameter sub-list is obtained based on matching the updated keyword primary key with the level key.
[0130] It should be noted that the preset wildcard symbol refers to a symbol used to represent any character or string in database queries, such as "*" or "%". This symbol can be used in the keyword primary key to match a character sequence of any length. When the level corresponding to the hierarchical key does not exist at the previous level, the preset wildcard symbol is used to update the keyword primary key.
[0131] It is understandable that when there is no previous level data available for tracing at the top level or a specific level of the database hierarchy structure, it is necessary to retrieve data through other means, so step S400 is performed. By adopting a unified query method, it is possible to avoid the problem of data retrieval failure caused by the inability to accurately match at the top level or a specific level of the database hierarchy structure. Even at the highest level or a specific level of the hierarchy structure, flexible data matching can be achieved through unified symbols, thereby ensuring the searchability of the data and the fault tolerance of the system, and achieving the effect of being able to retrieve relevant parameter sublists under the limitations of the data hierarchy structure, further improving the reliability of the system.
[0132] For example, please refer to Figure 5 , Figure 5 A schematic diagram of the parameter matching process of the cache parameter reading method for a multi-library application provided in Example 2 of the present application. In the parameter matching process, first, the key definitions of each level corresponding to the KeyCode, i.e., the keyword primary key, are determined so as to input the required level key. Then, the number of input request parameters is verified, i.e., it is determined whether the number of input request parameters is less than or equal to the configuration level, i.e., the preset number. If not, an error prompt is output; if so, the parameter matching is performed through the query request of the input request parameter, i.e., the parameter sublist. In the case where the target parameter sublist is matched, the corresponding data is obtained; in the case where the target parameter sublist is not matched, and there is a superior organization, the level key of the superior organization, i.e., the previous level, is taken to re-match the parameters. For example, the parameter sublist corresponding to the level key of the Akey primary key plus the Guangdong Province range level is value1, and the parameter sublist corresponding to the level key of the Akey primary key plus the Shenzhen City range level is value2. Then, Akey is used to add the Shenzhen City range level key to obtain value2, and Akey is used to add the Guangzhou City range level key to obtain value1. When there is no superior organization, that is, the level corresponding to the hierarchical key does not have an upper level, the key, that is, the keyword primary key, is updated to a universal symbol, and parameter matching is performed based on the universal symbol and the hierarchical key.
[0133] In this embodiment, by performing multi-level matching and hierarchical tracing based on keyword primary keys and hierarchical keys, the problem of inaccurate or failed data retrieval in the replica database due to low efficiency of direct query based on keyword primary keys or data hierarchy mismatch is avoided, and efficient and accurate retrieval of target parameter sublists in a distributed database environment is achieved. It also ensures that the query strategy can be flexibly adjusted through the hierarchical structure when data is missing, thereby improving the query flexibility of the system and the success rate of data retrieval.
[0134] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the cache parameter reading method of the multi-library application of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0135] This application also provides a cache parameter reading system for multi-library applications, please refer to Figure 6 , the cache parameter reading system of the multi-database application includes an application end 10 and a server end 20, and the server end 20 includes a plurality of identical replica databases;
[0136] The application end 10 is used to read the cache of any application instance under any sub-library in the multi-library application, and if the cache is empty, send a parameter list query request to the server end 20 to obtain a first parameter list corresponding to the application instance from the server end 20 based on the parameter list query request;
[0137] In the case that the first parameter list acquisition process is abnormal, obtaining a second parameter list corresponding to the application instance from other sub-libraries in the multi-library application, using the second parameter list as cache parameters stored in the cache, and returning the cache parameters;
[0138] The server 20 is used to receive the parameter list query request sent by the application 10, and query each replica database based on the parameter list query request;
[0139] In the case that the query fails to obtain the first parameter list requested by the parameter list query request, a preset exception prompt instruction is returned to the application end 10, wherein the exception prompt instruction is used to inform the application end that the first parameter list acquisition process is abnormal, and instruct the application end to obtain the parameter list from other sub-libraries in the multi-library application.
[0140] Optionally, the application end 10 is further used for:
[0141] If the first parameter list is obtained from the server, it is determined that the process of obtaining the first parameter list is normal;
[0142] If the first parameter list acquisition process is normal, use the first parameter list as cache parameters stored in the cache, and return the cache parameters;
[0143] If a preset abnormal prompt instruction is obtained from the server, it is determined that the first parameter list acquisition process is abnormal.
[0144] Optionally, the application end 10 is further used for:
[0145] If the second parameter list is obtained from the other sub-libraries, it is determined that the process of obtaining the second parameter list is normal;
[0146] If the second parameter list acquisition process is normal, use the second parameter list as cache parameters stored in the cache, and return the cache parameters;
[0147] If the second parameter list is not obtained from the other sub-libraries, or the sub-library does not exist in other sub-libraries, it is determined that the process of obtaining the second parameter list is abnormal;
[0148] In case the second parameter list acquisition process is abnormal, a third parameter list corresponding to the application instance is acquired from other application instances under the sub-library, the third parameter list is used as cache parameters stored in the cache, and the cache parameters are returned.
[0149] Optionally, the cache parameter configuration includes an expiration time, and the application end 10 is further used for:
[0150] Extending the expiration time to obtain an updated expiration time;
[0151] After the updated expiration time, the cache parameters in the cache are deleted, and the process returns to the step of executing the read operation of the cache of the application instance.
[0152] Optionally, the server 20 is further configured to:
[0153] Splitting the parameter list query request to obtain multiple parameter sub-list query requests;
[0154] For any parameter sublist query request, sending the parameter sublist query request to a corresponding replica database, and querying the parameter sublist in the replica database based on the parameter sublist query request;
[0155] After traversing each parameter sublist query request, if each parameter sublist query request has a corresponding parameter sublist, constructing a first parameter list based on each parameter sublist, and returning the first parameter list to the application end;
[0156] If any parameter sublist query request does not have a corresponding parameter sublist, it is determined that the query does not obtain the first parameter list requested by the parameter list query request.
[0157] Optionally, the parameter list query request includes a keyword primary key and a level key, and the server 20 is further configured to:
[0158] In the replica database, matching a corresponding target parameter sublist based on the keyword primary key and the level key;
[0159] In case the target parameter sublist is obtained through matching, the target parameter sublist is used as the parameter sublist;
[0160] In the case where the target parameter sublist is not obtained through matching, the hierarchy key is updated based on the hierarchy key of the level one level above the level corresponding to the hierarchy key, and the step of matching the corresponding target parameter sublist based on the keyword primary key and the hierarchy key is returned based on the updated hierarchy key;
[0161] In the case that the level corresponding to the level key does not have an upper level, the keyword primary key is updated based on a preset matching symbol, and the parameter sub-list is obtained based on matching the updated keyword primary key with the level key.
[0162] The cache parameter reading system for multi-library applications provided by the present application adopts the cache parameter reading method for multi-library applications in the above-mentioned embodiment, which can solve the technical problem of how to improve the reliability of reading cache parameters for multi-library applications. Compared with the prior art, the beneficial effects of the cache parameter reading system for multi-library applications provided by the present application are the same as the beneficial effects of the cache parameter reading method for multi-library applications provided by the above-mentioned embodiment, and the other technical features of the cache parameter reading system for multi-library applications are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0163] The present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the cache parameter reading method for the multi-library application in the above-mentioned embodiment 1.
[0164] Reference below Figure 7, which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0165] like Figure 7 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0166] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0167] The electronic device provided by the present application adopts the cache parameter reading method of the multi-library application in the above-mentioned embodiment, which can solve the technical problem of how to improve the reliability of reading the cache parameters of the multi-library application. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the cache parameter reading method of the multi-library application provided by the above-mentioned embodiment, and the other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0168] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0169] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0170] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the cache parameter reading method for the multi-library application in the above-mentioned embodiment.
[0171] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0172] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0173] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device: for any application instance under any sub-library in the multi-library application, read the cache of the application instance, if the cache is read to be empty, send a parameter list query request to the server, so as to obtain the first parameter list corresponding to the application instance from the server based on the parameter list query request; in the event that the first parameter list acquisition process is abnormal, obtain the second parameter list corresponding to the application instance from other sub-libraries in the multi-library application, use the second parameter list as the cache parameter stored in the cache, and return the cache parameter.
[0174] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0175] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0176] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0177] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the cache parameter reading method for the multi-library application, and can solve the technical problem of how to improve the reliability of reading the cache parameters of the multi-library application. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the cache parameter reading method for the multi-library application provided in the above embodiment, and will not be repeated here.
[0178] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the cache parameter reading method for the multi-library application as described above.
[0179] The computer program product provided by the present application can solve the technical problem of how to improve the reliability of reading cache parameters of multi-library applications. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the cache parameter reading method of the multi-library application provided by the above embodiment, which will not be repeated here.
[0180] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for reading cache parameters of a multi-library application, characterized in that: Applied to the application side, the cache parameter reading method of the multi-library application includes: For any application instance under any sub-library in the multi-library application, read the cache of the application instance, and if the cache is empty, send a parameter list query request to the server to obtain the first parameter list corresponding to the application instance from the server based on the parameter list query request; In case the first parameter list acquisition process is abnormal, a second parameter list corresponding to the application instance is obtained from other sub-libraries in the multi-library application, the second parameter list is used as cache parameters stored in the cache, and the cache parameters are returned.
2. The cache parameter reading method for multi-library application according to claim 1, characterized in that: After the step of obtaining the first parameter list corresponding to the application instance from the server, the following step further includes: If the first parameter list is obtained from the server, it is determined that the process of obtaining the first parameter list is normal; If the first parameter list acquisition process is normal, use the first parameter list as cache parameters stored in the cache, and return the cache parameters; If a preset abnormal prompt instruction is obtained from the server, it is determined that the first parameter list acquisition process is abnormal.
3. The cache parameter reading method for multi-library application according to claim 1, characterized in that: The step of using the second parameter list as cache parameters stored in the cache and returning the cache parameters comprises: If the second parameter list is obtained from the other sub-libraries, it is determined that the process of obtaining the second parameter list is normal; If the second parameter list acquisition process is normal, use the second parameter list as cache parameters stored in the cache, and return the cache parameters; If the second parameter list is not obtained from the other sub-libraries, or the sub-library does not exist in other sub-libraries, it is determined that the process of obtaining the second parameter list is abnormal; In case the second parameter list acquisition process is abnormal, a third parameter list corresponding to the application instance is acquired from other application instances under the sub-library, the third parameter list is used as cache parameters stored in the cache, and the cache parameters are returned.
4. The cache parameter reading method for multi-library application according to claim 3, characterized in that: The cache parameter is configured with an expiration time, and after the step of using the third parameter list as the cache parameter stored in the cache and returning the cache parameter, the step further includes: Extending the expiration time to obtain an updated expiration time; After the updated expiration time, the cache parameters in the cache are deleted, and the process returns to the step of executing the read operation of the cache of the application instance.
5. A method for reading cache parameters of a multi-library application, characterized in that: Applied to a server, the server includes multiple identical replica databases, and the cache parameter reading method of the multi-replica database application includes: Receiving a parameter list query request sent by the application end, and querying each replica database based on the parameter list query request, wherein the parameter list query request is generated by the application end when the cache of the application instance read is empty; In the case that the query fails to obtain the first parameter list requested by the parameter list query request, a preset exception prompt instruction is returned to the application end, wherein the exception prompt instruction is used to inform the application end that the first parameter list acquisition process is abnormal, and instruct the application end to obtain the parameter list from other sub-libraries in the multi-library application.
6. The cache parameter reading method for multi-library application according to claim 5, characterized in that: The step of querying each replica database based on the parameter list query request includes: Splitting the parameter list query request to obtain multiple parameter sub-list query requests; For any parameter sublist query request, sending the parameter sublist query request to a corresponding replica database, and querying the parameter sublist in the replica database based on the parameter sublist query request; After traversing each parameter sublist query request, if each parameter sublist query request has a corresponding parameter sublist, constructing a first parameter list based on each parameter sublist, and returning the first parameter list to the application end; If any parameter sublist query request does not have a corresponding parameter sublist, it is determined that the query does not obtain the first parameter list requested by the parameter list query request.
7. The cache parameter reading method for multi-library application according to claim 6, characterized in that: The parameter list query request includes a keyword primary key and a level key, and the step of querying the parameter sublist in the replica database based on the parameter sublist query request includes: In the replica database, matching a corresponding target parameter sublist based on the keyword primary key and the level key; In case the target parameter sublist is obtained through matching, the target parameter sublist is used as the parameter sublist; In the case where the target parameter sublist is not obtained through matching, the hierarchy key is updated based on the hierarchy key of the level one level above the level corresponding to the hierarchy key, and the step of matching the corresponding target parameter sublist based on the keyword primary key and the hierarchy key is returned based on the updated hierarchy key; In the case that the level corresponding to the level key does not have an upper level, the keyword primary key is updated based on a preset matching symbol, and the parameter sub-list is obtained based on matching the updated keyword primary key with the level key.
8. A cache parameter reading system for multi-library applications, characterized in that: The cache parameter reading system of the multi-database application includes an application end and a server end, and the server end includes a plurality of identical replica databases; The application end is used to read the cache of any application instance under any sub-library in the multi-library application, and if the cache is empty, send a parameter list query request to the server end, so as to obtain the first parameter list corresponding to the application instance from the server end based on the parameter list query request; In the case that the first parameter list acquisition process is abnormal, a second parameter list corresponding to the application instance is acquired from other sub-libraries in the multi-library application, the second parameter list is used as cache parameters stored in the cache, and the cache parameters are returned; The server is used to receive the parameter list query request sent by the application, and query each replica database based on the parameter list query request; In the case that the query fails to obtain the first parameter list requested by the parameter list query request, a preset exception prompt instruction is returned to the application end, wherein the exception prompt instruction is used to inform the application end that the first parameter list acquisition process is abnormal, and instruct the application end to obtain the parameter list from other sub-libraries in the multi-library application.
9. An electronic device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the cache parameter reading method for a multi-library application as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the cache parameter reading method for a multi-library application as described in any one of claims 1 to 7 are implemented.