Application processing method and device, equipment, medium and product

By writing the application instance list to multiple Redis cluster lists, the problem of applications inaccessible when Redis clusters are down is solved, and the efficiency of application processing is improved.

CN119031036APending Publication Date: 2024-11-26CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411107600.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

When the Redis cluster is down, the application cannot access it, resulting in inefficiency in the system.

Method used

By analyzing the preset application, a list of application instances is obtained, and it is written to the Redis cluster list based on the preset write mode. When receiving the application processing request, the Redis cluster list responds to the processing request. Ensure write and read operations of the application instance list.

Benefits of technology

When the Redis cluster goes down, the application processing request response can still be completed through multiple Redis clusters, which improves the efficiency of application processing and solves the problem of inaccessibility of applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031036A_ABST
    Figure CN119031036A_ABST
Patent Text Reader

Abstract

The invention discloses an application processing method and device, equipment, a medium and a product, and relates to the technical field of computers.The method comprises the steps that a preset application is analyzed, and an application instance list is obtained; writing the application instance list into a remote dictionary service Redis cluster list based on a preset writing mode; and when an application processing request is received, responding to the application processing request through the Redis cluster list to obtain a processing result. Therefore, after the application is analyzed to obtain the corresponding application instance list, the application instance list is written into the Redis cluster list, and finally, when the application processing request is received, the application processing request can be responded through the Redis cluster list to obtain the corresponding processing result, so that the problem that the application cannot be accessed when the Redis cluster crashes is solved, and the application processing efficiency is improved. And the application processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an application processing method, device, equipment, medium and product. Background Art

[0002] Redis cluster is a distributed deployment architecture of Redis database, which aims to solve the problem that single-node Redis cannot meet the needs of large-scale data storage and high-concurrency request processing. Redis cluster is designed based on distributed architecture, which allows data to be distributed to multiple nodes for storage and processing, thereby improving the scalability and fault tolerance of the system.

[0003] Redis cluster has the advantages of high availability, horizontal expansion, performance optimization, fault tolerance and automatic recovery, data replication and backup, and simplified expansion and maintenance. Therefore, it is used more and more frequently in the group. Currently, the industry's high availability of Redis is mainly considered in the design of Redis itself, such as sentinel mode, cluster mode, etc.

[0004] However, this mechanism does not consider an extreme case, that is, when the entire Redis cluster goes down, the application will be inaccessible.

[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0006] The main purpose of this application is to provide an application processing method, device, equipment, storage medium and computer program product, which aims to solve the technical problem that the application cannot be accessed when the Redis cluster is down.

[0007] To achieve the above objectives, the present application proposes an application processing method, the method comprising:

[0008] Parse the preset applications to obtain a list of application instances;

[0009] Based on a preset writing mode, the application instance list is written into a remote dictionary service Redis cluster list;

[0010] When an application processing request is received, the application processing request is responded to through the Redis cluster list to obtain a processing result.

[0011] In one embodiment, the write mode includes one or more of a strong mode, a weak mode, and an asynchronous mode. The step of writing the application instance list into the remote dictionary service Redis cluster list based on the preset write mode includes:

[0012] If the write mode is the strong mode, the application instance list is traversed and written into several Redis clusters in the Redis cluster list, and after the traversal and writing are completed, the writing result is output, and the writing result includes one or more of a successful writing instance and a failed writing instance;

[0013] If the write mode is a weak mode, the multiple application instances in the application instance list are synchronously written to the multiple Redis clusters in the Redis cluster list, and after recording the write status of the application instance list, the write result is output based on the write status of the application instance list;

[0014] If the write mode is the asynchronous mode, the application instance list is traversed and written into several Redis clusters in the Redis cluster list, and when there are application instances in the application instance list that have completed writing, after the write result is output, the application instances that have not been written into the application instance list are asynchronously written into the Redis cluster list.

[0015] In one embodiment, upon receiving the application processing request, responding to the application processing request through the Redis cluster list to obtain the processing result comprises:

[0016] Based on the application processing request, the Redis cluster list is traversed and read to obtain a reading result;

[0017] If the read result is that data exists, the application data corresponding to the read result is extracted, and the application processing request is processed based on the application data to obtain a processing result.

[0018] In one embodiment, after the step of traversing and reading the Redis cluster list based on the application processing request to obtain a reading result, the method further includes:

[0019] If the reading result is that no data exists, analyzing whether the application instance list needs to be updated;

[0020] When the application instance list needs to be updated, the application instance list is updated to obtain an updated application instance list, and the updated application instance list is written into the Redis cluster list;

[0021] When the application instance list does not need to be updated, warning information is output based on the application processing request.

[0022] In one embodiment, after the step of writing the application instance list into the remote dictionary service Redis cluster list based on a preset writing mode, the method further includes:

[0023] Perform a timed detection on the Redis cluster list based on a preset heartbeat task to obtain a detection result;

[0024] Based on the detection result, the Redis clusters in the Redis cluster list are managed by a Redis management tool.

[0025] In one embodiment, the step of performing a timed detection on the Redis cluster list based on a preset heartbeat task to obtain a detection result includes:

[0026] Based on the time interval set by the heartbeat task, the Redis cluster list is traversed and executed through a preset execution request to obtain an execution result;

[0027] In the case where the execution result fails, the Redis management tool is used to analyze whether the cluster that failed to execute needs to be fused, and an analysis result is obtained;

[0028] The detection result is output based on the analysis result and the execution result.

[0029] In addition, to achieve the above-mentioned purpose, the present application also proposes an application processing device, the application processing device comprising:

[0030] A parsing module is used to parse the preset applications and obtain a list of application instances;

[0031] A writing module, used for writing the application instance list into a remote dictionary service Redis cluster list based on a preset writing mode;

[0032] The processing module is used to respond to the application processing request through the Redis cluster list when receiving the application processing request to obtain a processing result.

[0033] In addition, to achieve the above objectives, the present application also proposes an application processing 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 application processing method described above.

[0034] In addition, to achieve the above objectives, 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 a processor, the steps of the application processing method described above are implemented.

[0035] 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, the steps of the application processing method described above are implemented.

[0036] One or more technical solutions proposed in this application have at least the following technical effects:

[0037] The embodiment of the present application proposes an application processing method, device, equipment, storage medium and computer program product, which parses the preset application to obtain an application instance list; based on the preset write mode, writes the application instance list into the remote dictionary service Redis cluster list; when receiving an application processing request, responds to the application processing request through the Redis cluster list to obtain a processing result. Thus, after parsing the application to obtain the corresponding application instance list, the application instance list is written into the Redis cluster list, and finally, when receiving the application processing request, the application processing request can be responded to through the Redis cluster list to obtain the corresponding processing result, which solves the problem that the application cannot be accessed when the Redis cluster is down, and improves the efficiency of application processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] 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.

[0039] 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 labor.

[0040] Figure 1 A flowchart of the first embodiment of the application processing method of the present application is provided;

[0041] Figure 2 A schematic diagram of a strong mode write involved in the application processing method of this application;

[0042] Figure 3 A schematic diagram of a weak mode write involving a processing method for application of this application;

[0043] Figure 4 A schematic diagram of an asynchronous mode writing method for the application processing method of the present application;

[0044] Figure 5 A schematic diagram of a practical application example written for the application processing method of this application;

[0045] Figure 6 This is a schematic diagram of a user login business scenario involving the application processing method of this application;

[0046] Figure 7A flowchart of the second embodiment of the application processing method of the present application is provided;

[0047] Figure 8 A schematic diagram of the application processing method for this application involving reading a Redis cluster list;

[0048] Fig. 9 This is a schematic diagram of Redis cluster data reading in a business scenario involving the application processing method of this application;

[0049] Fig.10 This is a schematic diagram of the centralized data reading of Redis in the scenario of user business request verification involved in the application processing method of this application;

[0050] Fig.11 A schematic diagram of a processing method for the application of this application involving using a heartbeat detection task to perform health detection on clusters in a Redis cluster list;

[0051] Fig.12 A schematic diagram of the processing method for this application involving analyzing whether a cluster needs to be circuit-broken;

[0052] Fig.13 This is a schematic diagram of the module structure of the application processing device according to the embodiment of the present application;

[0053] Fig.14 A schematic diagram of the device structure of the hardware operating environment involved in the application processing method in the embodiment of the present application.

[0054] 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

[0055] 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.

[0056] 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.

[0057] The main solution of the embodiment of the present application is: if the write mode is strong mode, the application instance list is traversed and written into several Redis clusters in the Redis cluster list, and after the traversal and writing are completed, the writing result is output, and the writing result includes one or more of the writing successful instance and the writing failed instance; if the write mode is weak mode, several application instances in the application instance list are synchronously written into several Redis clusters in the Redis cluster list, and after recording the writing status of the application instance list, the writing result is output based on the writing status of the application instance list; if the write mode is asynchronous mode, the application instance list is traversed and written into several Redis clusters in the Redis cluster list, and if there is an application instance in the application instance list that has completed writing, after the writing result is output, the application instance that has not been written in the application instance list is asynchronously written into the Redis cluster list. The Redis cluster list is traversed and read based on the application processing request to obtain the reading result; if the reading result is that there is data, the application data corresponding to the reading result is extracted, and the application processing request is processed based on the application data to obtain the processing result. If the read result is that there is no data, then analyze whether the application instance list needs to be updated; if the application instance list needs to be updated, update the application instance list to obtain an updated application instance list, and write the updated application instance list into the Redis cluster list; if the application instance list does not need to be updated, output alarm information based on the application processing request. Perform a timed detection on the Redis cluster list based on the preset heartbeat task to obtain a detection result; based on the detection result, manage the Redis clusters in the Redis cluster list through the Redis management tool. Based on the time interval set by the heartbeat task, traverse and execute the Redis cluster list through the preset execution request to obtain the execution result; if there is an execution failure in the execution result, analyze whether the cluster that failed to execute needs to be fused through the Redis management tool to obtain the analysis result; output the detection result based on the analysis result and the execution result. Thereby solving the problem that the application cannot be accessed when the Redis cluster is down, realizing the processing of the application, and improving the efficiency of application processing.Based on the scheme of the present invention, from the fact that high availability of Redis is mainly considered in the design of Redis itself, such as sentinel mode, cluster mode, etc., but this mechanism has not considered an extreme case, that is, when the entire Redis cluster is down, the application will be inaccessible, thus the problem of low efficiency is designed, and the effectiveness of the application processing method of the present invention is verified when processing the application processing request. Finally, the efficiency of application processing performed by the method of the present invention is significantly improved.

[0058] In this embodiment, for ease of description, the following description is made with the application processing device as the execution subject.

[0059] Since Redis cluster in the existing technology has the advantages of high availability, horizontal expansion, performance optimization, fault tolerance and automatic recovery, data replication and backup, and simplified expansion and maintenance, it is used more and more frequently in the group. At present, the industry's high availability of Redis is mainly considered in the design of Redis itself, such as sentinel mode, cluster mode, etc., but this mechanism has not considered an extreme situation, that is, when the entire Redis cluster is completely down, the application will be inaccessible, which will cause the efficiency of application processing to decrease.

[0060] The present application provides a solution. In an application processing scenario, a list of application instances corresponding to an application is simultaneously written into multiple Redis, namely, a Redis cluster list. Thus, when an application processing request is received, even if a single Redis cluster is down, the response to the application processing request can be completed, thereby providing users with better services.

[0061] From the above embodiments, it can be seen that the present application parses the preset application to obtain the application instance list; based on the preset write mode, the application instance list is written into the remote dictionary service Redis cluster list; when an application processing request is received, the application processing request is responded to through the Redis cluster list to obtain the processing result. Thus, after parsing the application to obtain the corresponding application instance list, the application instance list is written into the Redis cluster list, and finally, when the application processing request is received, the application processing request can be responded to through the Redis cluster list to obtain the corresponding processing result, which solves the problem that the application cannot be accessed when the Redis cluster is down, and improves the efficiency of application processing.

[0062] It should be noted that the execution subject of this embodiment may 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 capable of realizing the above functions, an application processing device, etc. The following takes the application processing device as an example to illustrate this embodiment and the following embodiments.

[0063] Based on this, the present application embodiment provides an application processing method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the application processing method of this application.

[0064] In this embodiment, the application processing method includes steps S01 to S05:

[0065] Step S01, parsing the preset application to obtain a list of application instances;

[0066] It should be noted that the application in this embodiment is set according to actual business needs, and can specifically refer to business processing applications, chat applications, information query applications, etc., and the application instance refers to a specific, actually running, specific instance created from an application. It can be an independently running copy of a certain application or an application in a specific usage scenario. Specifically, an application can have multiple application instances, each of which may run in a different environment or provide services to different users. For example, an application of an e-commerce platform can run multiple instances at the same time, each instance serving different users or processing different transactions;

[0067] Redis cluster is a distributed deployment mode of Redis database, which aims to improve performance, scalability and fault tolerance. When the application processes the request response, since the Redis cluster acts as a database to store the data required by the application, the application connects to a node of the Redis cluster and sends data storage and retrieval requests to the appropriate node in the cluster, which can effectively improve the efficiency of application processing. However, the above method does not take into account the situation where the Redis cluster goes down. When the entire Redis cluster goes down, the application will be inaccessible, which can easily lead to user dissatisfaction.

[0068] Step S02, based on a preset writing mode, writing the application instance list into a remote dictionary service Redis cluster list;

[0069] In this embodiment, multiple Redis clusters are provided, which form a Redis cluster list. Multi-active synchronization can be performed between multiple Redis clusters. Multiple clusters can be deployed in different computer rooms. When a cluster in a single computer room goes down, it can still be accessed through other clusters.

[0070] This embodiment provides three writing modes. Specifically, different writing modes can be used to write the corresponding application instances in the application instance list into the Redis cluster list when dealing with different business scenarios. The three writing modes are strong mode, weak mode and asynchronous mode.

[0071] After understanding the three different writing modes, it should be clear that in step S02 of this embodiment, in the preset writing mode, the step of writing the application instance list into the remote dictionary service Redis cluster list includes:

[0072] Step S021, if the write mode is the strong mode, traverse and write the application instance list into several Redis clusters in the Redis cluster list, and after the traversal and writing are completed, output the writing result, wherein the writing result includes one or more of a successful writing instance and a failed writing instance;

[0073] Step S022: if the write mode is a weak mode, synchronously write several application instances in the application instance list to several Redis clusters in the Redis cluster list, and after recording the write status of the application instance list, output the write result based on the write status of the application instance list;

[0074] Step S023, if the write mode is the asynchronous mode, the application instance list is traversed and written into several Redis clusters in the Redis cluster list, and when there are application instances in the application instance list that have completed writing, after outputting the writing result, the application instances that have not been written in the application instance list are asynchronously written into the Redis cluster list.

[0075] The application instance list in this embodiment is described as one application having only one application instance, but in actual usage scenarios, it should be set according to actual business needs, and will not be described in detail here;

[0076] Strong mode writes such as Figure 2 As shown, because the ultimate function of the application instance is to provide application processing, the situation of the application when receiving the application processing request can be simulated during writing, that is, instance 1 is written to the first cluster in the Redis cluster list, and it is queried whether the writing is successful. If the writing is successful, the instance 2 is continued to be written. If the writing fails, an exception is thrown, and then the instance 2 is written, and the detection is performed synchronously until all instances are written to complete, and the writing results of each instance are obtained, that is, there are several successful writings and several failed writings. The advantages of using the strong mode writing method are: 1. The data consistency and synchronization timeliness between clusters are relatively high, 2. Both reading and writing are not strongly dependent on all clusters, and a single cluster failure has no effect, but there are two problems with the strong writing method, that is, the failure of writing in the middle process may cause inconsistent data between instances, and when there are more clusters, it takes a long time, so it can be clearly seen that the strong mode writing of this embodiment is suitable for the case of fewer instances and clusters;

[0077] Weak mode writes Figure 3 As shown, write instance 1 to Redis, then analyze whether the write is successful, and record the write status (i.e., write success, write failure, write duration, etc.). While writing instance 1, synchronously write instance 2 to instance N, and also record the write status. Finally, analyze based on many write statuses (i.e., do an "or" calculation). As long as the write status of one instance is successful, the analysis is successful. If all application instances fail to write to the Redis cluster list, the analysis is a write failure.

[0078] Asynchronous mode writing Figure 4 As shown, the application instances are traversed and written into the Redis cluster list. As long as there is one that is written successfully, the output is write successful. Then the application instances are asynchronously written to the remaining Redis clusters. If all clusters fail to write, the output write result is write failure.

[0079] Specifically, the application example in this embodiment is given as one, so the write mode adopts the strong mode, and the write scenario is as follows: Figure 5 As shown, the application instance in the application is written to Redis cluster 1. If the writing fails, it is synchronously written to Redis cluster 2. If it still fails, it continues to traverse and write to subsequent Redis clusters until all clusters are traversed and written. In this case, the writing result is output as writing failure;

[0080] If the writing is successful, the corresponding application business processing can be connected, that is, the business processing can be completed accordingly when the processing request of the application is received.

[0081] More specifically, this embodiment is described using an actual user login scenario. Figure 6 As shown, when the user logs in, the user's login request is received, and then the user's login verification is performed. If the verification fails, the user is notified. If the verification succeeds, the corresponding session data is written to Redis cluster 1. At the same time, based on the actual write mode, the session data is written to the remaining Redis clusters in the Redis cluster list. If all writes fail, the application returns the login failure information to the user and prompts the user to try again.

[0082] This embodiment adopts the above scheme, specifically by parsing the preset application to obtain the application instance list; based on the preset write mode, the application instance list is written into the remote dictionary service Redis cluster list; when receiving the application processing request, the application processing request is responded to through the Redis cluster list to obtain the processing result. Therefore, after parsing the application to obtain the corresponding application instance list, the application instance list is written into the Redis cluster list, and finally when the application processing request is received, the application processing request can be responded to through the Redis cluster list to obtain the corresponding processing result, which solves the problem that the application cannot be accessed when the Redis cluster is down, and improves the efficiency of application processing.

[0083] 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 7 Step S05, when receiving the application processing request, responding to the application processing request through the Redis cluster list, the steps of obtaining the processing result include: S051~S055:

[0084] Step S051, traversing and reading the Redis cluster list based on the application processing request to obtain a reading result;

[0085] Step S055: if the read result is that data exists, then extract the application data corresponding to the read result, and process the application processing request based on the application data to obtain a processing result.

[0086] After the application instance list is written to the Redis cluster list, the response to the application processing request can be realized, such as Figure 8 As shown, several Redis clusters in the Redis cluster list are traversed and read to obtain a reading result, wherein the reading result includes existing data and non-existing data, and the specific reading is to read from multiple clusters in sequence. As long as the corresponding data is read from one cluster, the read data is returned to the application for request processing to obtain a processing result;

[0087] If the corresponding data cannot be read, the output reading result is empty (null);

[0088] The above method reads from multiple clusters in sequence. If one cluster is healthy and has data, it will be returned. If it is down, the exception will be ignored, thus avoiding the impact of a single cluster failure on application data reading due to non-existent clusters.

[0089] Specifically, in the above step S051, after the step of traversing and reading the Redis cluster list based on the application processing request to obtain the reading result, the method further includes:

[0090] Step S052: if the reading result is that no data exists, analyzing whether the application instance list needs to be updated;

[0091] Step S053, when the application instance list needs to be updated, the application instance list is updated to obtain an updated application instance list, and the updated application instance list is written into the Redis cluster list;

[0092] Step S054: when the application instance list does not need to be updated, output warning information based on the application processing request.

[0093] It should be clear that in this embodiment, multiple clusters are used for joint response, so the fault situation is eliminated first, and whether the application instance list needs to be updated is analyzed. If the application instance list needs to be updated, the application instance list is updated, and then the new application instance list is written into the Redis cluster list. Among them, due to the upgrade of business and the increase in demand, the update of applications is becoming more and more frequent. Therefore, in this embodiment, corresponding application instance list timing detection can also be provided to complete the update of the Redis cluster list to avoid the above situation.

[0094] Taking into account the occurrence of some extreme situations, this embodiment outputs warning information based on the application processing request when it is detected that the application instance list does not need to be updated.

[0095] More specifically, the reading process of this embodiment is as follows: Fig. 9 As shown, after the application receives the processing request, it reads Redis cluster 1 (that is, the first one in the Redis cluster list). If the corresponding data is read, the corresponding application data is directly returned, and the business processing of the application is performed. If the corresponding data is not read, Redis cluster 2 is read synchronously until the data is queried in the entire Redis cluster list or the data location cannot be queried.

[0096] This embodiment is described with a specific application login, such as Fig.10As shown, the user sends a service request verification in the application. In the previous embodiment, the writing of the application instance data has been completed. Therefore, the session data in the Redis cluster list can be read at this time to query whether there is corresponding application data in the cluster list to verify that the user's request has permission. If there is permission, the request sent by the user is executed. If there is no permission, an error is reported. In addition, when there is no data in the entire Redis cluster list or a failure result is returned, the user is prompted to log in invalid, and a message is sent to prompt the user to log in again.

[0097] Furthermore, this embodiment also provides a corresponding cluster status health detection and fuse solution. Therefore, in the above embodiment 1, after the step S02, based on a preset write mode, of writing the application instance list into the remote dictionary service Redis cluster list, the method further includes:

[0098] Step S03, performing a timed detection on the Redis cluster list based on a preset heartbeat task to obtain a detection result;

[0099] Step S04: Based on the detection result, the Redis clusters in the Redis cluster list are managed by a Redis management tool.

[0100] In this embodiment, the detection and management strategies of the cluster are as follows: Fig.11 As shown, after writing is completed, the heartbeat task is started. In this embodiment, the default interval is 3000ms for detection, and all clusters in the Redis cluster list are regularly detected to obtain the detection results;

[0101] It should be clear that the detection result is whether the cluster is healthy. If the cluster is healthy, set the cluster health status to true, and it can be used. If the cluster is unhealthy, set the cluster health status to false, that is, it cannot be used. Based on the detection result, the corresponding Redis cluster in the Redis cluster is managed through the Redis management tool;

[0102] In addition, the detection methods in this embodiment include direct detection (calling the jedis exists method to determine whether the cluster is normal, and returning false if it is not normal) and Sentinel fuse (calling the jedis exists method to determine whether the cluster is normal, and judging the cluster status according to the Sentinel rule configuration, avoiding returning false if it is abnormal once), where jedis exists is a method call in the Redis Java client library Jedis. In Jedis, the exists method is used to check whether the specified key exists in the Redis database and return a Boolean value as the result.

[0103] Furthermore, in the above step S03, the step of performing a timed detection on the Redis cluster list based on a preset heartbeat task and obtaining the detection result includes:

[0104] Step S031, based on the time interval set by the heartbeat task, traverse and execute the Redis cluster list through a preset execution request to obtain an execution result;

[0105] Step S032, when there is an execution failure in the execution result, analyzing whether the cluster that failed to execute needs to be fused by the Redis management tool, and obtaining an analysis result;

[0106] Step S033: outputting detection results based on the analysis results and execution results.

[0107] The above-mentioned Redis management tool is Redis Sentinel. Redis Sentinel is a tool for managing Redis high availability (HA). It can monitor the Redis master server and its backups (replicas), and automatically perform failover when the master server fails, ensuring the continuity and availability of the Redis service. Redis Sentinel uses the sentinel process to monitor the Redis server and automatically handles the fault when a fault is detected.

[0108] like Fig.12 As shown in the figure, in order to avoid misoperation caused by jitter at the network layer, health detection supports configuration through sentinel. It can be configured to determine how many times a fault occurs within a period of time before it is removed. If health detection is abnormal, the faulty cluster will be automatically removed from the cluster list and automatically added to the cluster list after detection is restored.

[0109] The management of Redis clusters in the Redis cluster list includes deactivation and recovery, etc., but the management is based on the analysis results and the detection results output by the execution results. It can be understood that the detection results are a combination of the execution results and the analysis results. In some cases, even if the cluster is successfully executed, if there are problems with the execution time and efficiency of the cluster, a corresponding warning will be issued to allow the management tool to analyze whether the circuit is broken, and finally output the detection results after comprehensive determination;

[0110] In addition to health detection, it also supports circuit breaking and faulty cluster elimination during the execution process. It uses a unified Redis client to intercept the execution method uniformly and enter the circuit breaking logic processing when an error occurs. When many errors occur during execution, the circuit breaker is performed and the instance is eliminated. The execution circuit breaker also supports configuration through sentinel, which can be configured to eliminate the instance only after a certain number of failures occur within a period of time.

[0111] This embodiment uses the above scheme to traverse and read the Redis cluster list based on the application processing request to obtain a reading result; if the reading result is that data exists, the application data corresponding to the reading result is extracted, and the application processing request is processed based on the application data to obtain a processing result. Therefore, after parsing the application to obtain the corresponding application instance list, the application instance list is written into the Redis cluster list, and finally when the application processing request is received, the application processing request can be responded to through the Redis cluster list to obtain the corresponding processing result, which solves the problem that the application cannot be accessed when the Redis cluster is down, and improves the efficiency of application processing.

[0112] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the application processing method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0113] This application also provides an application processing device, please refer to Fig.13 , the application processing device comprises:

[0114] The parsing module 10 is used to parse the preset application and obtain a list of application instances;

[0115] A writing module 20, used to write the application instance list into a remote dictionary service Redis cluster list based on a preset writing mode;

[0116] The processing module 30 is used to respond to the application processing request through the Redis cluster list when receiving the application processing request to obtain a processing result.

[0117] The application processing device provided by the present application adopts the application processing method in the above embodiment, which can solve the technical problem that the application cannot be accessed when the Redis cluster is down. Compared with the prior art, the beneficial effects of the application processing device provided by the present application are the same as the beneficial effects of the application processing method provided by the above embodiment, and other technical features in the application processing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0118] The present application provides an application processing device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed 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 application processing method in the above-mentioned embodiment 1.

[0119] Reference below Fig.14 , which shows a schematic diagram of the structure of an application processing device suitable for implementing an embodiment of the present application. The application processing device in the embodiment of the present application may include but is 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. Fig.14 The application processing device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0120] like Fig.14 As shown, the application processing 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 application processing 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 may allow the application processing device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an application processing 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 may be implemented or have instead.

[0121] 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.

[0122] The application processing device provided by the present application adopts the application processing method in the above embodiment, which can solve the technical problem that the application cannot be accessed when the Redis cluster is down. Compared with the prior art, the beneficial effects of the application processing device provided by the present application are the same as the beneficial effects of the application processing method provided by the above embodiment, and the other technical features in the application processing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0123] 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.

[0124] 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.

[0125] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the application processing method in the above-mentioned embodiment.

[0126] 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, 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), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), 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, 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), etc., or any suitable combination of the above.

[0127] The computer-readable storage medium may be included in the application processing device; or may exist independently without being assembled into the application processing device.

[0128] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the application processing device, the application processing device: parses the preset application to obtain an application instance list; based on a preset write mode, writes the application instance list into a remote dictionary service Redis cluster list; and upon receiving an application processing request, responds to the application processing request through the Redis cluster list to obtain a processing result.

[0129] 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).

[0130] 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.

[0131] 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.

[0132] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned application processing method, and can solve the technical problem that the application cannot access the Redis cluster when it is down. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the application processing method provided in the above-mentioned embodiment, and will not be repeated here.

[0133] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned application processing method when executed by a processor.

[0134] The computer program product provided by this application can solve the technical problem that the application cannot access the Redis cluster when it is down. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the application processing method provided by the above embodiment, which will not be repeated here.

[0135] 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 applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. An application processing method, characterized in that: The method includes: Parse the preset applications to obtain a list of application instances; Based on a preset writing mode, the application instance list is written into a remote dictionary service Redis cluster list; When an application processing request is received, the application processing request is responded to through the Redis cluster list to obtain a processing result.

2. The method according to claim 1, characterized in that The write mode includes one or more of a strong mode, a weak mode and an asynchronous mode. The step of writing the application instance list into the remote dictionary service Redis cluster list based on the preset write mode includes: If the write mode is the strong mode, the application instance list is traversed and written into several Redis clusters in the Redis cluster list, and after the traversal and writing are completed, the writing result is output, and the writing result includes one or more of a successful writing instance and a failed writing instance; If the write mode is a weak mode, the multiple application instances in the application instance list are synchronously written to the multiple Redis clusters in the Redis cluster list, and after recording the write status of the application instance list, the write result is output based on the write status of the application instance list; If the write mode is the asynchronous mode, the application instance list is traversed and written into several Redis clusters in the Redis cluster list, and when there are application instances in the application instance list that have completed writing, after the write result is output, the application instances that have not been written into the application instance list are asynchronously written into the Redis cluster list.

3. The method according to claim 1, characterized in that When receiving the application processing request, responding to the application processing request through the Redis cluster list to obtain the processing result includes: Based on the application processing request, the Redis cluster list is traversed and read to obtain a reading result; If the read result is that data exists, the application data corresponding to the read result is extracted, and the application processing request is processed based on the application data to obtain a processing result.

4. The method according to claim 3, characterized in that After the step of traversing and reading the Redis cluster list based on the application processing request to obtain a reading result, the method further includes: If the reading result is that no data exists, analyzing whether the application instance list needs to be updated; When the application instance list needs to be updated, the application instance list is updated to obtain an updated application instance list, and the updated application instance list is written into the Redis cluster list; When the application instance list does not need to be updated, warning information is output based on the application processing request.

5. The method according to claim 1, characterized in that After the step of writing the application instance list into the remote dictionary service Redis cluster list based on the preset writing mode, the method further includes: Perform a timed detection on the Redis cluster list based on a preset heartbeat task to obtain a detection result; Based on the detection result, the Redis clusters in the Redis cluster list are managed by a Redis management tool.

6. The method according to claim 5, characterized in that The step of performing a timed detection on the Redis cluster list based on a preset heartbeat task to obtain a detection result comprises: Based on the time interval set by the heartbeat task, the Redis cluster list is traversed and executed through a preset execution request to obtain an execution result; In the case where the execution result fails, the Redis management tool is used to analyze whether the cluster that failed to execute needs to be fused, and an analysis result is obtained; The detection result is output based on the analysis result and the execution result.

7. An application processing device, characterized in that: The device comprises: A parsing module is used to parse the preset applications and obtain a list of application instances; A writing module, used for writing the application instance list into a remote dictionary service Redis cluster list based on a preset writing mode; The processing module is used to respond to the application processing request through the Redis cluster list when receiving the application processing request to obtain a processing result.

8. An application processing 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 application processing method according to any one of claims 1 to 6.

9. 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 application processing method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the application processing method according to any one of claims 1 to 6 are implemented.