A task recovery method and device, electronic equipment and storage medium
By storing task request data and processing it using a recovery server when business services are degraded, the problem of business service interruption is solved, and task processing efficiency and business continuity are improved under degraded conditions.
Patent Information
- Application Number
- CN202111505600.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2041-12-10
AI Technical Summary
In existing technologies, when the basic services that business services depend on are downgraded, the relevant processes are usually blocked, leading to business service interruption and losses.
When the target business service is degraded, the task request data is stored, and a recovery server is selected from the candidate server set. A recovery instruction message is sent to obtain the task request data for processing, thus avoiding direct blocking of the server interface.
In the case of degradation, business service interruption is avoided, task processing efficiency is improved, and the continuity and performance of business services are ensured.
Smart Images

Figure CN114185659B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer technology, and particularly relates to a task recovery method and device, electronic equipment, storage medium and computer program product. BACKGROUND
[0002] With the development of application services, when providing service processing for a plurality of business functions involved in the application services, in many cases, it is necessary to call the basic services on which the business services depend for related business service processing. For example, when a user uses a shopping application service to place an order, the basic services on which the order business service depends need to be called for related process processing based on the order operation.
[0003] At present, when the basic services on which the business services depend are degraded, the way of directly blocking the related process and returning error information is usually adopted, which will block the normal execution of the server interface, causing the business service to be interrupted and causing losses to the business service. Therefore, there is a problem of affecting business service processing after degradation in the related art. SUMMARY
[0004] The present disclosure provides a task recovery method, device, electronic equipment, storage medium and computer program product to at least solve the problem of affecting business service processing after degradation in the related art. The technical solutions of the present disclosure are as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a task recovery method is provided, comprising:
[0006] receiving a target processing task for processing a target business service;
[0007] when it is determined that the target business service meets a degradation condition, degrading the target processing task, and storing task request data corresponding to the target processing task;
[0008] for a recovery server corresponding to the target processing task in the degraded state selected from a candidate server set, sending a recovery indication message corresponding to the target processing task in the degraded state to the recovery server, so that the recovery server detects a recovery condition corresponding to the target processing task in the degraded state, and when the recovery condition is met, acquires the task request data and processes the target processing task based on the task request data.
[0009] In a possible implementation manner, when it is determined that the target business service meets the degradation condition, the target processing task is degraded, and the task request data corresponding to the target processing task is stored, comprising:
[0010] determining a service state of a basic server relied on by the target service, and when the service state is determined to be a degraded state, obtaining a target service execution attribute corresponding to the target service;
[0011] When the target service execution attribute corresponds to a service execution attribute corresponding to degradation, it is determined that the target service meets a degradation condition, the target processing task is degraded, and task request data corresponding to the target processing task is stored.
[0012] In a possible implementation, the target service execution attribute includes service responsiveness and service dependency, and when the target service execution attribute corresponds to a service execution attribute corresponding to degradation, it is determined that the target service meets a degradation condition, including:
[0013] comparing the service responsiveness with a responsiveness corresponding to degradation to obtain a first comparison result;
[0014] comparing the service dependency with a dependency corresponding to degradation to obtain a second comparison result;
[0015] When the first comparison result is that the service responsiveness is less than or equal to the responsiveness corresponding to degradation, and the second comparison result is that the service dependency is less than or equal to the dependency corresponding to degradation, it is determined that the target service meets a degradation condition.
[0016] In a possible implementation, the obtaining of the target service execution attribute corresponding to the target service includes:
[0017] obtaining a service request interface corresponding to the target processing task;
[0018] determining the target service execution attribute corresponding to the target service according to interface information corresponding to the service request interface.
[0019] In a possible implementation, the storing of the task request data corresponding to the target processing task includes:
[0020] determining a target storage from a set of degradation task data storages, and writing the task request data into the target storage;
[0021] When it is determined that a write degree of the target storage reaches a write degree threshold, migrating data in the target storage to a degradation task data storage space, and switching the currently written storage from the target storage to another data storage in the set of data storages.
[0022] According to a second aspect of the embodiments of the present disclosure, a task recovery method is provided, including:
[0023] receiving a recovery indication message; the recovery indication information is indication information for recovering the target processing task in the degraded state;
[0024] based on the recovery indication information, obtaining a task identifier corresponding to task request data corresponding to the target processing task;
[0025] obtaining task request data corresponding to the task identifier from the degraded task data storage space; the task request data is stored in the degraded task data storage space when the target processing task is degraded;
[0026] when the recovery condition is met, processing the target processing task based on the task request data.
[0027] In a possible implementation manner, when the recovery condition is met, processing the target processing task based on the task request data, includes:
[0028] when the recovery condition is met, reading service request parameters and task execution methods from the task request data;
[0029] requesting and playing back the service request parameters according to the task execution method, and taking the request playback result as the processing result of the target processing task.
[0030] In a possible implementation manner, after the step of when the recovery condition is met, processing the target processing task based on the task request data, further includes:
[0031] deleting the task request data obtained from the degraded task data storage space;
[0032] sending a data deletion instruction to a storage server corresponding to the degraded task data storage space, the data deletion instruction carrying the task identifier, so that the storage server obtains the task request data according to the task identifier in response to the data deletion instruction, and deletes the task request data corresponding to the task identifier.
[0033] In a possible implementation manner, the sending of the data deletion instruction to the storage server corresponding to the degraded task data storage space includes:
[0034] sending a data deletion instruction to a storage server corresponding to the degraded task data storage space, the data deletion instruction carrying the task identifier and a deletion permission indication key, the deletion permission indication key being returned by the storage server to the recovery server when the recovery server obtains the task request data corresponding to the task identifier from the degraded task data storage space;
[0035] The storage server receives the deletion permission indication key carried in the data deletion instruction, performs deletion permission verification based on the deletion permission indication key, and deletes the task request data corresponding to the task identifier when the verification is successful.
[0036] According to a third aspect of the present disclosure, a task recovery apparatus is provided, comprising:
[0037] The task receiving unit is configured to execute the receiving of target processing tasks that process the target business service.
[0038] The degraded data storage unit is configured to degrade the target processing task when it is determined that the target business service meets the degraded conditions, and to store the task request data corresponding to the target processing task.
[0039] The recovery instruction unit is configured to send a recovery instruction message corresponding to the target processing task in a degraded state to the recovery server selected from the candidate server set, so that the recovery server can detect the recovery conditions corresponding to the target processing task in a degraded state, and when the recovery conditions are met, obtain the task request data and process the target processing task based on the task request data.
[0040] In one possible implementation, the degraded data storage unit is specifically configured to determine the service status of the underlying server on which the target business service depends; when the service status is determined to be degraded, obtain the target business execution attribute corresponding to the target business service; when the target business execution attribute corresponds to the degraded business execution attribute, determine that the target business service meets the degraded conditions, degrade the target processing task, and store the task request data corresponding to the target processing task.
[0041] In one possible implementation, the target service execution attributes include service responsiveness and service dependency. The degraded data storage unit is further configured to compare the service responsiveness with the responsiveness corresponding to the degrade to obtain a first comparison result; compare the service dependency with the dependency corresponding to the degrade to obtain a second comparison result; and determine that the target service meets the degrade conditions when the first comparison result is that the service responsiveness is less than or equal to the responsiveness corresponding to the degrade, and the second comparison result is that the service dependency is less than or equal to the dependency corresponding to the degrade.
[0042] In a possible implementation, the degraded data storage unit is specifically further configured to perform obtaining a service request interface corresponding to the target processing task; and determining target business execution attributes corresponding to the target business service according to interface information corresponding to the service request interface.
[0043] In a possible implementation, the degraded data storage unit is specifically configured to perform determining a target storage from a set of degraded task data storages, and writing the task request data into the target storage; and when determining that a write degree of the target storage reaches a write degree threshold, migrating data in the target storage to a degraded task data storage space, and switching the currently written storage from the target storage to another data storage in the set of data storages.
[0044] According to a fourth aspect of the embodiments of the present disclosure, a task recovery apparatus is provided, applied to a recovery server selected from a set of candidate servers, and comprising:
[0045] A recovery indication receiving unit is configured to perform receiving a recovery indication message; the recovery indication information is indication information for recovering a target processing task in a degraded state;
[0046] A task identifier obtaining unit is configured to perform obtaining, based on the recovery indication information, a task identifier corresponding to task request data corresponding to the target processing task;
[0047] A task request data obtaining unit is configured to perform obtaining, from a degraded task data storage space, task request data corresponding to the task identifier; the task request data is stored in the degraded task data storage space when the target processing task is degraded;
[0048] A recovery processing unit is configured to perform, when the recovery condition is met, processing the target processing task based on the task request data.
[0049] In a possible implementation, the recovery processing unit is specifically configured to perform, when the recovery condition is met, reading a service request parameter and a task execution method from the task request data; performing request playback processing on the service request parameter according to the task execution method, and taking a request playback result as a processing result of the target processing task.
[0050] In a possible implementation, the apparatus further comprises:
[0051] A first deleting unit is configured to perform deleting the task request data obtained from the degraded task data storage space;
[0052] The second deletion unit is configured to send a data deletion instruction to a storage server corresponding to the degraded task data storage space, the data deletion instruction carrying the task identifier, so that the storage server acquires the task request data according to the task identifier in response to the data deletion instruction, and deletes the task request data corresponding to the task identifier.
[0053] In a possible implementation, the second deletion unit is specifically configured to send a data deletion instruction to a storage server corresponding to the degraded task data storage space, the data deletion instruction carrying the task identifier and a deletion permission indication key, the deletion permission indication key being returned by the storage server to the recovery server when the recovery server acquires the task request data corresponding to the task identifier from the degraded task data storage space; the storage server receives the deletion permission indication key carried in the data deletion instruction, performs deletion permission verification based on the deletion permission indication key, and deletes the task request data corresponding to the task identifier when the verification is passed.
[0054] According to a fifth aspect of the embodiments of the present disclosure, an electronic device is provided, including a memory and a processor, the memory stores a computer program, and the processor implements the task recovery method according to any one of the preceding aspects when executing the computer program.
[0055] According to a sixth aspect of the embodiments of the present disclosure, a storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the task recovery method according to any one of the preceding aspects.
[0056] According to a seventh aspect of the embodiments of the present disclosure, a computer program product is provided, the program product includes a computer program, the computer program is stored in a readable storage medium, and at least one processor of a device reads and executes the computer program from the readable storage medium, so that the device executes the task recovery method described in any one of the embodiments of the first aspect and the second aspect.
[0057] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
[0058] The scheme of the present disclosure, by receiving a target processing task for processing a target service, when it is determined that the target service meets the downgrade condition, the target processing task is downgraded, and the task request data corresponding to the target processing task is stored, and then for the recovery server corresponding to the target processing task in the degraded state selected from the candidate server set, the recovery indication message corresponding to the target processing task in the degraded state is sent to the recovery server, so that the recovery server detects the recovery condition corresponding to the target processing task in the degraded state, when the recovery condition is met, the task request data is acquired, and the target processing task is processed based on the task request data. In this way, the normal execution of the server interface can be not blocked after the degradation, avoiding the loss caused by the service interruption of the business service, and the recovery server can process the task in time when the degradation is recovered, improving the task processing efficiency of the business service.
[0059] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0060] The accompanying drawings incorporated in the specification and forming a part of it, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure, and do not constitute an undue limitation on the present disclosure.
[0061] Figure 1 is an application environment diagram of a task recovery method according to an exemplary embodiment.
[0062] Figure 2 is a flowchart of a task recovery method according to an exemplary embodiment.
[0063] Figure 3 is a schematic diagram of a service request processing flow when degradation occurs according to an exemplary embodiment.
[0064] Figure 4 is a flowchart of another task recovery method according to an exemplary embodiment.
[0065] Figure 5 is a schematic diagram of a degradation data recovery process according to an exemplary embodiment.
[0066] Figure 6 is a flowchart of another task recovery method according to an exemplary embodiment.
[0067] Figure 7 is a block diagram of a task recovery device according to an exemplary embodiment.
[0068] Figure 8is a block diagram of another task recovery device according to an exemplary embodiment.
[0069] Figure 9 is an internal structure diagram of an electronic device according to an exemplary embodiment.
[0070] Figure 10 is an internal structure diagram of another electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0071] In order for those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below in conjunction with the accompanying drawings.
[0072] It should be noted that the terms "first", "second", and the like in the specification and claims of the present disclosure and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation described in the following exemplary embodiments does not represent all implementations consistent with the present disclosure.
[0073] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties.
[0074] The task recovery method provided by the present disclosure can be applied to an application environment as shown in Figure 1 The terminal 110 is connected to the server 120 through a network, and the terminal 110 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 120 can be implemented by an independent server or a server cluster composed of multiple servers.
[0075] Since the business service can be deployed on multiple servers, the server 120 can provide the terminal 110 with relevant business services of application functions, such as shopping order, payment and other business services. The terminal 110 can be installed with multiple application clients, such as shopping applications, search applications, social communication applications, email client applications, etc. The server 120 can provide various business services for each application client, such as the server supporting the business service of the shopping application. When the basic server 150 relied on by the server 120 is in a degraded state, the server 120 can upload the received task request data to the storage server 130; based on the recovery server 140 selected from the candidate server set in advance, it can download the stored task request data from the storage server 130, and then when the degradation is recovered, the recovery server 140 can call the basic server 150 to process the corresponding business process according to the task request data.
[0076] Figure 2 is a flowchart of a task recovery method according to an exemplary embodiment, as shown in Figure 2 , the method can be used in the server 120 and other computer devices in Figure 1 , including the following steps.
[0077] In step S210, a target processing task for processing a target business service is received;
[0078] The target business service can be a business service provided by the server 120 for the terminal 110, such as a related business service provided to realize the application function when the user uses the application service.
[0079] In actual application, based on the user's operation on the application service, the target business service can be triggered, and then the server can receive the target processing task for processing the target business service to process the corresponding business process for the target processing task.
[0080] In step S220, when it is determined that the target business service meets the degradation condition, the target processing task is degraded, and the task request data corresponding to the target processing task is stored;
[0081] After receiving the target processing task, the target processing task can be degraded when it is determined that the target business service meets the degradation condition, and the task request data corresponding to the target processing task can be stored. The task request data can include service request parameters and task execution methods, and processing the service request parameters based on the task execution methods can complete the target processing task.
[0082] Specifically, the target business service can include a process with high real-time requirement and strong dependency, and a process with low real-time requirement and non-strong dependency. If the underlying server on which the target business service depends is degraded, the target processing task for processing the process with low real-time requirement and non-strong dependency can be stored, so that the target processing task is requested to be played back based on the task request data when the degradation is recovered.
[0083] In an example, when a shopping order service (i.e., a target business service) is processed, the underlying server needs to be called. For example, the shopping order service needs to query the inventory of goods (i.e., a process with high real-time requirement and strong dependency), and needs to feed back the inventory of goods to the seller (i.e., a process with low real-time requirement and non-strong dependency). If the underlying server is degraded due to server failure or high load, the processing task for processing the process with low real-time requirement and non-strong dependency can store the task request data corresponding to the processing task (i.e., a target processing task), and can return an execution success return value to the user after storage, thereby greatly improving the response efficiency and performance of the server when the degradation occurs.
[0084] In step S230, a recovery indication message corresponding to the target processing task in the degraded state is sent to the recovery server corresponding to the target processing task in the degraded state selected from the candidate server set, so that the recovery server detects the recovery condition corresponding to the target processing task in the degraded state, and when the recovery condition is met, the task request data is acquired and the target processing task is processed based on the task request data.
[0085] In a specific implementation, a server can be selected from the candidate server set based on the candidate server set, and the selected server can be used as a recovery server corresponding to the target processing task in the degraded state, so that the compensation process after the degradation recovery can be performed by the recovery server when the degradation recovery is performed.
[0086] For example, a business service can be deployed on multiple servers. By selecting a server from the multiple servers belonging to the same business service in advance, the selected server can be used as a recovery server. Since the business service running on the recovery server is the same as the business service running on other servers, the difference between the recovery server and other servers is that the recovery server undertakes the function of compensating and recovering data, i.e., the recovery server can perceive whether the previously degraded underlying server is recovered.
[0087] In an optional embodiment, the recovery server selection can be performed for multiple servers (i.e., candidate server set) belonging to the same service based on the coordination configuration system. When a server successfully completes the recovery server related configuration in the coordination configuration system, the server can be determined as the selected recovery server. The multiple servers can also perform periodic detection on the coordination configuration system. If no recovery server is detected, the recovery server related configuration can be performed, and then the recovery server can be selected according to the configuration time sequence.
[0088] After determining the recovery server, a recovery indication message corresponding to the target processing task in the degraded state can be sent to the recovery server. The recovery indication message can carry a task identifier corresponding to the task request data corresponding to the target processing task in the degraded state. Then, the recovery server can detect the recovery condition corresponding to the target processing task in the degraded state, and when the recovery condition is met, the task request data can be obtained, and the target processing task can be processed based on the task request data.
[0089] In the above task recovery method, the target processing task for processing the target service is received. When it is determined that the target service meets the degradation condition, the target processing task is degraded, and the task request data corresponding to the target processing task is stored. Then, for the recovery server corresponding to the target processing task in the degraded state selected from the candidate server set, a recovery indication message corresponding to the target processing task in the degraded state is sent to the recovery server, so that the recovery server detects the recovery condition corresponding to the target processing task in the degraded state. When the recovery condition is met, the task request data is obtained, and the target processing task is processed based on the task request data. In this way, the normal execution of the server interface can be not blocked after degradation, and the loss caused by service interruption to the service is avoided. The recovery server can perform task processing in time when the degradation is recovered, and the task processing efficiency of the service is improved.
[0090] In an exemplary embodiment, when it is determined that the target service meets the degradation condition, the target processing task is degraded, and the task request data corresponding to the target processing task is stored, including: determining the service state of the basic server on which the target service depends, when it is determined that the service state is in the degraded state, obtaining the target business execution attribute corresponding to the target service; when the target business execution attribute corresponds to the business execution attribute corresponding to the degradation, it is determined that the target service meets the degradation condition, the target processing task is degraded, and the task request data corresponding to the target processing task is stored.
[0091] In a specific implementation, based on the target service, the server can send a call request to the underlying server on which it depends, and when the underlying server is in a non-degraded state, the server can return response information for the call request, and then the server can determine the service state of the underlying server on which the target service depends according to whether the response information sent by the underlying server is received, such as when the response information sent by the underlying server is not received, the service state can be determined to be a degraded state.
[0092] In an example, based on the target service execution attribute of the target service, it can be determined that the target service is a process with high real-time requirement and strong dependence or a process with low real-time requirement and non-strong dependence. When the service state is determined to be a degraded state, that is, the underlying server is degraded and cannot provide the underlying service on which the target service depends, the target service execution attribute corresponding to the target service can be obtained, and then when the target service execution attribute corresponds to the service execution attribute corresponding to the degradation, it can be determined that the target service meets the degradation condition, that is, for the process with low real-time requirement and non-strong dependence, the target processing task can be degraded, and the task request data corresponding to the target processing task can be stored.
[0093] The technical scheme of the embodiment determines the service state of the underlying server on which the target service depends, obtains the target service execution attribute corresponding to the target service when the service state is determined to be a degraded state, and then determines that the target service meets the degradation condition when the target service execution attribute corresponds to the service execution attribute corresponding to the degradation, degrades the target processing task, and stores the task request data corresponding to the target processing task. The target service execution attribute corresponding to the target service can be used to determine whether the target processing task meets the degradation condition, and the task request data corresponding to the target processing task can be stored when the degradation occurs for the process with low real-time requirement and non-strong dependence. The normal execution of the server can not be blocked when the service state is degraded, and the loss caused by service interruption to the business service can be avoided.
[0094] In an example embodiment, the target service execution attribute includes business response and business dependence, and when the target service execution attribute corresponds to the service execution attribute corresponding to the degradation, it is determined that the target service meets the degradation condition, including: comparing the business response with the response corresponding to the degradation to obtain a first comparison result; comparing the business dependence with the dependence corresponding to the degradation to obtain a second comparison result; when the first comparison result is that the business response is less than or equal to the response corresponding to the degradation, and the second comparison result is that the business dependence is less than or equal to the dependence corresponding to the degradation, it is determined that the target service meets the degradation condition.
[0095] As an example, the target business execution attribute can include a business response degree and a business dependency degree, the business response degree can represent a real-time requirement of the business process, and the business dependency degree can represent a dependency degree of the business process on the underlying service, such as the response degree and the business dependency degree of a process with high real-time requirement and strong dependency, which are higher than the response degree and the business dependency degree of a process with low real-time requirement and non-strong dependency.
[0096] In actual application, the business response degree can be compared with the response degree corresponding to the degradation to obtain a first comparison result, and the business dependency degree can be compared with the dependency degree corresponding to the degradation to obtain a second comparison result, and then it can be determined that the target business service meets the degradation condition when the first comparison result is that the business response degree is less than or equal to the response degree corresponding to the degradation, and the second comparison result is that the business dependency degree is less than or equal to the dependency degree corresponding to the degradation.
[0097] For example, when the first comparison result is that the business response degree is less than or equal to the response degree corresponding to the degradation, it can be determined that the real-time requirement of the business process corresponding to the target business service is not high, and when the second comparison result is that the business dependency degree is less than or equal to the dependency degree corresponding to the degradation, it can be determined that the business process corresponding to the target business service is non-strongly dependent on the underlying service, and then it can be determined that the target business service meets the degradation condition, i.e., the business process corresponding to the target business service is a process with low real-time requirement and non-strong dependency.
[0098] The technical solution of the embodiment compares the business response degree with the response degree corresponding to the degradation to obtain a first comparison result, then compares the business dependency degree with the dependency degree corresponding to the degradation to obtain a second comparison result, and then determines that the target business service meets the degradation condition when the first comparison result is that the business response degree is less than or equal to the response degree corresponding to the degradation, and the second comparison result is that the business dependency degree is less than or equal to the dependency degree corresponding to the degradation, which can perform degradation-related processing for processes with low real-time requirement and non-strong dependency, and can avoid losses caused by service interruption to business services.
[0099] In an example embodiment, the target business execution attribute corresponding to the target business service is obtained, including: obtaining a service request interface corresponding to the target processing task; and determining the target business execution attribute corresponding to the target business service according to interface information corresponding to the service request interface.
[0100] In the server, there can be multiple service request interfaces, and each service request interface can correspond to a business process of a business service.
[0101] After receiving the target processing task for processing the target service, the service request interface corresponding to the target processing task can be acquired. Since the service request interface has a corresponding relationship with the business process of the target service, the target business execution attribute corresponding to the target service can be determined according to the interface information corresponding to the service request interface.
[0102] For example, when a user requests a server interface (i.e., a service request interface), it can be determined according to the interface information corresponding to the server interface that the interface is internally a process with high real-time requirement and strong dependence, or a process with low real-time requirement and non-strong dependence.
[0103] The technical solution of the embodiment can determine whether the internal process of the service request interface is a process with low real-time requirement and non-strong dependence based on the service request interface, so as to perform related processing after degradation for the process with low real-time requirement and non-strong dependence, thereby improving the processing efficiency and performance of the server when degradation occurs.
[0104] In an example embodiment, storing task request data corresponding to a target processing task includes: determining a target storage from a set of data storages corresponding to a degraded task, writing the task request data into the target storage; when it is determined that the writing degree of the target storage reaches a writing degree threshold, migrating the data in the target storage to a degraded task data storage space, and switching the target storage to another data storage in the set of data storages.
[0105] The data storage can be a file memory mapping in the server, which is a mapping of the internal file of the server in the memory of the server. The server can have multiple data storages, and the multiple data storages can be switched with each other.
[0106] In an example, in the case where the server has two file memory mappings (i.e., a set of data storages), data storage can be performed through mutual switching between the two file memory mappings. For example, file memory mapping A (i.e., a target storage) can be used to sequentially write data (i.e., task request data) into the memory of the server, and file memory mapping B can be used to write data in the memory of the server into the disk file of the server, and the data in the disk file can be asynchronously uploaded to a file server (i.e., a storage server corresponding to a degraded task data storage space), so that the recovery server can download data and perform request playback and compensation operations after degradation recovery.
[0107] In yet another example, by writing the task request data into the server memory after degradation, the data in the server memory can be written into the server disk file after a specified time interval, or a specified number of writes, or the data is full (i.e., the write degree reaches the write degree threshold), and the memory mapping of the file to be written in the memory (i.e., the currently written memory) can be switched.
[0108] The technical solution of the embodiment determines the target memory currently being written from the data memory set corresponding to the degraded task, writes the task request data into the target memory, and then migrates the data in the target memory to the degraded task data storage space when it is determined that the write degree of the target memory reaches the write degree threshold, and switches the currently written memory from the target memory to another data memory in the data memory set. The task request data can be stored in the degraded task data storage space when degradation occurs, which can improve the response efficiency and performance of the server and avoid affecting the online business throughput due to a large amount of pressure on the server database.
[0109] In order for those skilled in the art to better understand the above steps, the embodiments of the present disclosure are exemplarily illustrated by an example below, but it should be understood that the embodiments of the present disclosure are not limited thereto.
[0110] As shown in Figure 3 , when a user requests a server interface (i.e., a service request interface), if the interface is a process with high real-time requirement and strong dependence, when the basic server on which the business service (i.e., the target business service) depends is in a degraded state, the error information or the preset return value can be directly returned to the user; when it is not in a degraded state and executes successfully, it can enter step two; if the interface is a process with low real-time requirement and non-strong dependence, when the basic server on which the business service depends is in a non-degraded state and executes successfully, the return value of successful execution can be returned to the user, and when the basic server on which the business service depends is in a degraded state, it can enter step three; the service request parameters and the task execution method (i.e., the task request data) can be saved through the file memory mapping A and the file memory mapping B (i.e., the data memory set), and the return value of successful execution can be returned to the user after successful saving.
[0111] Figure 4 is a flowchart of another task recovery method according to an example embodiment, applied to a recovery server selected from a candidate server set, as shown in Figure 4 , taking the recovery server 140 in Figure 1 as an example, the method includes the following steps.
[0112] In step S410, a recovery indication message is received; the recovery indication information is indication information for recovering the target processing task in the degraded state;
[0113] In a specific implementation, for the recovery server selected from the candidate server set, the recovery indication message can be received, and the recovery indication information is indication information for recovering the target processing task in the degraded state. Then, the recovery server will undertake the functions of compensation and recovery data. By detecting the recovery condition corresponding to the target processing task in the degraded state, when the recovery condition is met, the recovery server can process the target processing task based on the obtained task request data, that is, the compensation process can be performed when the recovery server senses that the previously degraded base server is recovered.
[0114] In step S420, based on the recovery indication information, the task identifier corresponding to the task request data corresponding to the target processing task is obtained;
[0115] After receiving the recovery indication information, the recovery indication message can carry the task identifier corresponding to the task request data corresponding to the target processing task in the degraded state. Then, the recovery server can obtain the task identifier corresponding to the task request data corresponding to the target processing task based on the recovery indication information, so as to determine the target processing task in the degraded state to be recovered according to the task identifier.
[0116] In step S430, the task request data corresponding to the task identifier is obtained from the degraded task data storage space; the task request data is stored in the degraded task data storage space when the target processing task is degraded;
[0117] The degraded task data storage space can have a corresponding storage server, such as a file server, which can store the task request data corresponding to the target processing task in the degraded state to be recovered.
[0118] In actual application, the recovery server can obtain the task request data corresponding to the task identifier from the degraded task data storage space, and the task request data is stored in the degraded task data storage space when the target processing task is degraded. For example, the task request data can be uploaded to the storage server corresponding to the degraded task data storage space when the degradation occurs, so that the recovery server can download the data and perform the request playback and compensation operation after the degradation is recovered.
[0119] In an example, the recovery server can detect the storage server corresponding to the degraded task data storage space to determine whether there is already uploaded task request data, and when there is task request data corresponding to the target processing task in the degraded state to be recovered, the task request data can be downloaded to the local recovery server. The recovery server can also repeatedly detect the storage server corresponding to the degraded task data storage space according to a specified time interval.
[0120] In step S440, when the recovery condition is met, the target processing task is processed based on the task request data.
[0121] In actual application, since the recovery server can perceive whether the previously degraded basic server is recovered, the recovery condition can be determined when the basic server is recovered, and then the recovery server can process the target processing task based on the downloaded task request data, such as request playback and compensation operation after degradation recovery.
[0122] Specifically, the recovery server can call the degraded basic server according to a preset time threshold, and when the basic server returns a response information to the call request sent by the recovery server, it can be determined that the previously degraded basic server has been recovered. Since the preset time threshold can be set to a small time value, the recovery server can perceive in time after degradation recovery to call the basic server and perform data compensation operation and request playback in time.
[0123] In the above task recovery method, by receiving the recovery indication message, based on the recovery indication information, the task identifier corresponding to the task request data of the target processing task is obtained, and then the task request data corresponding to the task identifier is obtained from the degraded task data storage space, and when the recovery condition is met, the target processing task is processed based on the task request data. The recovery server can perceive the recovered state of the previously degraded basic server in time, and can perform task processing in time when the degradation is recovered, thereby improving the server processing efficiency when degradation occurs.
[0124] In an example embodiment, when the recovery condition is met, the target processing task is processed based on the task request data, including: when the recovery condition is met, reading the service request parameter and the task execution method from the task request data; performing request playback processing on the service request parameter according to the task execution method, and taking the request playback result as the processing result of the target processing task.
[0125] In a specific implementation, when the recovery condition is met, the recovery server can read the service request parameter and the task execution method from the task request data, and then can perform request playback processing on the service request parameter according to the task execution method, and take the request playback result as the processing result of the target processing task, so that the data compensation operation can be performed at the first time after the degradation of the basic service is recovered, and the request playback is completed.
[0126] The technical solution of the embodiment can read the service request parameter and the task execution method from the task request data when the recovery condition is met, and then perform request playback processing on the service request parameter according to the task execution method, and take the request playback result as the processing result of the target processing task, so that the request playback can be performed on the task request data in time based on the recovery server when the degradation is recovered, and the processing effectiveness of the server when the degradation occurs is ensured.
[0127] In an exemplary embodiment, after the step of processing the target processing task based on the task request data when the recovery condition is met, the method further includes: deleting the task request data obtained from the degraded task data storage space; and sending a data deletion instruction to the storage server corresponding to the degraded task data storage space, the data deletion instruction carrying a task identifier, so that the storage server obtains the task request data according to the task identifier and deletes the task request data corresponding to the task identifier in response to the data deletion instruction.
[0128] In a specific implementation, the recovery server can delete the task request data obtained from the degraded task data storage space, and can send a data deletion instruction to the storage server corresponding to the degraded task data storage space, the data deletion instruction can carry a task identifier, and then the storage server can obtain the task request data according to the task identifier and delete the task request data corresponding to the task identifier in response to the data deletion instruction.
[0129] The technical solution of the embodiment can delete the task request data obtained from the degraded task data storage space, and send a data deletion instruction to the storage server corresponding to the degraded task data storage space, the data deletion instruction carrying a task identifier, so that the storage server obtains the task request data according to the task identifier and deletes the task request data corresponding to the task identifier in response to the data deletion instruction, which can delete the task request data that has been processed after the degradation is recovered, save storage space, and improve server performance.
[0130] In an example embodiment, the data deletion instruction is sent to the storage server corresponding to the degraded task data storage space, the data deletion instruction carrying a task identifier and a deletion permission indication key, the deletion permission indication key being returned by the storage server to the recovery server when the recovery server acquires task request data corresponding to the task identifier from the degraded task data storage space; the storage server receives the deletion permission indication key carried by the data deletion instruction, and performs deletion permission verification based on the deletion permission indication key, and when the verification is passed, the task request data corresponding to the task identifier is deleted.
[0131] In an example, when the recovery server acquires task request data corresponding to a task identifier from the degraded task data storage space, the storage server can return a deletion permission indication key to the recovery server, which can be used to delete the task request data corresponding to the task identifier, and the storage server can store the deletion permission indication key corresponding to the task identifier. When the storage server receives the data deletion instruction sent by the recovery server, the deletion permission indication key stored in advance can be acquired according to the task identifier carried in the data deletion instruction, and then the stored deletion permission indication key can be compared with the deletion permission indication key received in the data deletion instruction (i.e. deletion permission verification), and when the comparison is consistent, it can be determined that the verification is passed, and the task request data corresponding to the task identifier is deleted.
[0132] The technical scheme of the embodiment, by sending a data deletion instruction to the storage server corresponding to the degraded task data storage space, the data deletion instruction carrying a task identifier and a deletion permission indication key, the deletion permission indication key being returned by the storage server to the recovery server when the recovery server acquires task request data corresponding to the task identifier from the degraded task data storage space, and then the storage server receives the deletion permission indication key carried by the data deletion instruction, and performs deletion permission verification based on the deletion permission indication key, and when the verification is passed, the task request data corresponding to the task identifier is deleted, the deletion permission verification can be performed based on the deletion permission indication key, and the accuracy and security of data deletion are ensured.
[0133] In order for those skilled in the art to better understand the above steps, the embodiments of the present disclosure are exemplarily illustrated by an example below, but it should be understood that the embodiments of the present disclosure are not limited thereto.
[0134] As Figure 5As shown, in the election phase, since the business service can be deployed on multiple servers, each server can initiate an election, and then a recovery server corresponding to the target processing task in the degraded state can be selected from the candidate server set. For example, server A and server B can both initiate an election, and through the selection result of the candidate server set, server A can be determined as the recovery server and server B can be determined as the non-recovery server. In the degradation phase, server A and server B can save the parameter memory mapping (i.e., store the task request data corresponding to the target processing task) when the degradation occurs for the process with low real-time requirement and non-strong dependency. Then, in the first recovery phase, the server A as the recovery server can detect the file storage server (i.e., the storage server corresponding to the degraded task data storage space), and when it is determined that the parameter file (i.e., the task request data) is saved, the saved parameter file can be downloaded to the local server A. In the second recovery phase, the recovery server can perceive whether the downstream basic server previously degraded is recovered, and if the degradation is recovered, the recovery server can read the data from the downloaded saved parameter file and call the corresponding downstream basic server one by one to perform the compensation operation and request playback based on the saved parameter file. In the third recovery phase, for the parameter file that has completed the compensation operation and request playback, the corresponding parameter file can be deleted from the file storage server, and the corresponding parameter file downloaded in the local recovery server can also be deleted.
[0135] Figure 6 is a flowchart of still another task recovery method according to an exemplary embodiment. As shown, the method is used in a computer device such as a server, and includes the following steps. Figure 6
[0136] In step S610, a target processing task for processing a target service is received. In step S620, when it is determined that the target service meets a downgrade condition, the target processing task is downgraded, and task request data corresponding to the target processing task is stored. In step S630, a recovery indication message corresponding to the target processing task in a downgraded state is sent to a recovery server corresponding to the target processing task in a downgraded state selected from a candidate server set, so that the recovery server detects a recovery condition corresponding to the target processing task in a downgraded state, acquires the task request data when the recovery condition is met, and processes the target processing task based on the task request data. In step S640, a recovery indication message is received; the recovery indication message is indication information for recovering the target processing task in a downgraded state. In step S650, based on the recovery indication information, a task identifier corresponding to task request data corresponding to the target processing task is acquired. In step S660, task request data corresponding to the task identifier is acquired from a downgraded task data storage space; the task request data is stored in the downgraded task data storage space when the target processing task is downgraded. In step S670, when the recovery condition is met, the target processing task is processed based on the task request data. In step S680, the task request data acquired from the downgraded task data storage space is deleted. In step S690, a data deletion instruction is sent to a storage server corresponding to the downgraded task data storage space; the data deletion instruction carries the task identifier, so that the storage server acquires the task request data according to the task identifier and deletes the task request data corresponding to the task identifier in response to the data deletion instruction. It should be noted that the specific limitations of the above steps can be referred to the specific limitations of the task recovery method described above, and will not be described here.
[0137] It should be understood that, although Figure 2 、 Figure 4 、 Figure 6 The steps in the flowchart of the above method are displayed in sequence according to the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, Figure 2 、 Figure 4 、 Figure 6At least one of the steps in the above method can include multiple steps or multiple stages, which are not necessarily performed at the same time, but can be performed at different times, and the order of execution of these steps or stages is not necessarily sequential, but can be performed alternately or alternately with at least one part of other steps or steps in other steps.
[0138] It can be understood that the same / similar parts between each embodiment of the above method in the specification can be referred to each other, and each embodiment focuses on the difference from other embodiments, and the related part can be referred to the description of other method embodiments.
[0139] Figure 7 is a task recovery device block diagram according to an exemplary embodiment. Referring to Figure 7 The device comprises:
[0140] The processing task receiving unit 701 is configured to execute receiving a target processing task for processing a target service;
[0141] The degradation data storage unit 702 is configured to execute degrading the target processing task when it is determined that the target service meets the degradation condition, and storing the task request data corresponding to the target processing task;
[0142] The recovery indication unit 703 is configured to execute sending a recovery indication message corresponding to the target processing task in the degraded state to a recovery server selected from a candidate server set corresponding to the target processing task in the degraded state, so that the recovery server detects a recovery condition corresponding to the target processing task in the degraded state, and when the recovery condition is met, acquires the task request data and processes the target processing task based on the task request data.
[0143] In a possible implementation manner, the degradation data storage unit 702 is specifically configured to execute determining the service state of the basic server relied on by the target service, acquiring the target service execution attribute corresponding to the target service when it is determined that the service state is in the degraded state, and determining that the target service meets the degradation condition when the target service execution attribute corresponds to the service execution attribute corresponding to the degradation, degrading the target processing task, and storing the task request data corresponding to the target processing task.
[0144] In a possible implementation, the target service execution attribute includes service responsiveness and service dependency, and the degradation data storage unit 702 is specifically further configured to perform comparison between the service responsiveness and degradation corresponding responsiveness to obtain a first comparison result, comparison between the service dependency and degradation corresponding dependency to obtain a second comparison result, and determination that the target service meets the degradation condition when the first comparison result is that the service responsiveness is less than or equal to the degradation corresponding responsiveness and the second comparison result is that the service dependency is less than or equal to the degradation corresponding dependency.
[0145] In a possible implementation, the degradation data storage unit 702 is specifically further configured to perform acquisition of a service request interface corresponding to the target processing task, and determination of target service execution attribute corresponding to the target service according to interface information corresponding to the service request interface.
[0146] In a possible implementation, the degradation data storage unit 702 is specifically configured to perform determination of a target storage from a data storage set corresponding to the degradation task, writing of the task request data into the target storage, and migration of data in the target storage to a degradation task data storage space and switching of the currently written storage from the target storage to another data storage in the data storage set when it is determined that a write degree of the target storage reaches a write degree threshold.
[0147] As to the apparatus in the above-described embodiments, the specific manners in which various modules perform operations have been described in details in the embodiments of the method, and will not be described in details here.
[0148] Figure 8 is another task recovery apparatus block diagram according to an exemplary embodiment. Referring to Figure 8 , the apparatus is applied to a recovery server selected from a candidate server set, and includes:
[0149] The recovery indication receiving unit 801 is configured to perform reception of a recovery indication message; the recovery indication information is indication information for recovery of a target processing task in a degraded state;
[0150] The task identifier acquisition unit 802 is configured to perform acquisition of a task identifier corresponding to task request data corresponding to the target processing task based on the recovery indication information;
[0151] The task request data obtaining unit 803 is configured to obtain task request data corresponding to the task identifier from the degraded task data storage space; the task request data is stored in the degraded task data storage space when the target processing task is degraded.
[0152] The recovery processing unit 804 is configured to perform processing on the target processing task based on the task request data when the recovery condition is met.
[0153] In a possible implementation, the recovery processing unit 804 is specifically configured to read a service request parameter and a task execution method from the task request data when the recovery condition is met; perform request playback processing on the service request parameter according to the task execution method, and take a request playback result as a processing result of the target processing task.
[0154] In a possible implementation, the task recovery apparatus further includes:
[0155] The first deletion unit is configured to delete the task request data obtained from the degraded task data storage space.
[0156] The second deletion unit is configured to send a data deletion instruction to a storage server corresponding to the degraded task data storage space, where the data deletion instruction carries the task identifier, so that the storage server, in response to the data deletion instruction, obtains the task request data according to the task identifier, and deletes the task request data corresponding to the task identifier.
[0157] In a possible implementation, the second deletion unit is specifically configured to send a data deletion instruction to a storage server corresponding to the degraded task data storage space, where the data deletion instruction carries the task identifier and a deletion permission indication key, and the deletion permission indication key is returned by the storage server to the recovery server when the recovery server obtains the task request data corresponding to the task identifier from the degraded task data storage space; the storage server, after receiving the deletion permission indication key carried in the data deletion instruction, performs deletion permission verification based on the deletion permission indication key, and when the verification is passed, deletes the task request data corresponding to the task identifier.
[0158] As to the apparatus in the above-described embodiments, the specific manners in which various modules perform operations have been described in details in the embodiments of the method, and will not be described in details here.
[0159] Figure 9is a block diagram of an electronic device 900 for task resumption according to an example embodiment. For example, the electronic device 900 can be a server. Referring to Figure 9 The electronic device 900 includes a processing component 920, which further includes one or more processors, and a memory resource represented by a memory 922 for storing instructions, such as application programs, executable by the processing component 920. The application programs stored in the memory 922 can include one or more than one module each corresponding to a set of instructions. In addition, the processing component 920 is configured to execute the instructions to perform the above method.
[0160] The electronic device 900 can also include a power component 924 configured to perform power management of the electronic device 900, a wired or wireless network interface 926 configured to connect the electronic device 900 to a network, and an input / output (I / O) interface 928. The electronic device 900 can operate based on an operating system stored in the memory 922, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, or the like.
[0161] In an example embodiment, a computer readable storage medium including instructions, such as the memory 922 including instructions, is also provided, which can be executed by the processor of the electronic device 900 to complete the above method. The storage medium can be a computer readable storage medium, such as a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0162] In an example embodiment, a computer program product including instructions is also provided, which can be executed by the processor of the electronic device 900 to complete the above method.
[0163] Figure 10 is a block diagram of another electronic device 1000 for task resumption according to an example embodiment. For example, the electronic device 1000 can be a server. Referring to Figure 10 The electronic device 1000 includes a processing component 1020, which further includes one or more processors, and a memory resource represented by a memory 1022 for storing instructions, such as application programs, executable by the processing component 1020. The application programs stored in the memory 1022 can include one or more than one module each corresponding to a set of instructions. In addition, the processing component 1020 is configured to execute the instructions to perform the above method.
[0164] The electronic device 1000 can further include a power supply component 1024 configured to perform power management of the electronic device 1000, a wired or wireless network interface 1026 configured to connect the electronic device 1000 to a network, and an input / output (I / O) interface 1028. The electronic device 1000 can operate based on an operating system stored in the memory 1022, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, or the like.
[0165] In an exemplary embodiment, there is also provided a computer readable storage medium including instructions, such as the memory 1022 including instructions, which can be executed by the processor of the electronic device 1000 to complete the above method. The storage medium can be a computer readable storage medium, such as a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0166] In an exemplary embodiment, there is also provided a computer program product including instructions, which can be executed by the processor of the electronic device 1000 to complete the above method.
[0167] It should be noted that the above-described apparatus, electronic device, computer readable storage medium, computer program product, etc. according to the description of the method embodiments can also include other implementations, and the specific implementation can refer to the description of the related method embodiments, which will not be described here.
[0168] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features of the present disclosure disclosed herein. It is intended that the present disclosure cover any and all variations of the present disclosure which come within the scope of the claims and a concept underlying the present disclosure. It is intended that the specification and examples be considered exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0169] It should be understood that the present disclosure is not limited to the precise structures herein described and illustrated in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the claims which follow.
Claims
1. A task recovery method characterized by, The method comprises: receiving a target processing task for processing a target service service; in response to the fact that a basic server relied on by the target service service cannot provide a basic service relied on by the target service service, and the fact that a target service execution attribute corresponding to the target service service corresponds to a service execution attribute corresponding to degradation, determining that the target service service meets a degradation condition; when it is determined that the target service service meets the degradation condition, degrading the target processing task, and storing task request data corresponding to the target processing task; for a recovery server corresponding to the target processing task in a degraded state selected from a candidate server set, sending a recovery indication message corresponding to the target processing task in a degraded state to the recovery server, so that the recovery server detects a recovery condition corresponding to the target processing task in a degraded state, and when the recovery condition is met, acquires the task request data and processes the target processing task based on the task request data.
2. The method of claim 1, wherein, When it is determined that the target service service meets the degradation condition, the target processing task is degraded, and the task request data corresponding to the target processing task is stored, comprising: determining the service state of the basic server relied on by the target service service, and when it is determined that the service state is a degraded state, acquiring a target service execution attribute corresponding to the target service service; when the target service execution attribute corresponds to a service execution attribute corresponding to degradation, it is determined that the target service service meets the degradation condition, the target processing task is degraded, and the task request data corresponding to the target processing task is stored.
3. The method of claim 2, wherein, The target service execution attribute comprises service response and service dependency, and when the target service execution attribute corresponds to a service execution attribute corresponding to degradation, it is determined that the target service service meets the degradation condition, comprising: comparing the service response with a response corresponding to degradation to obtain a first comparison result; comparing the service dependency with a dependency corresponding to degradation to obtain a second comparison result; when the first comparison result is that the service response is less than or equal to the response corresponding to degradation, and the second comparison result is that the service dependency is less than or equal to the dependency corresponding to degradation, it is determined that the target service service meets the degradation condition.
4. The method of claim 2, wherein, The target service execution attribute corresponding to the target service service is acquired, comprising: acquiring a service request interface corresponding to the target processing task; determining the target service execution attribute corresponding to the target service service according to interface information corresponding to the service request interface.
5. The method according to any one of claims 1 to 4, characterized in that, The task request data corresponding to the target processing task is stored, comprising: determining a target storage from a set of degraded task data storage, and writing the task request data into the target storage; when it is determined that the writing degree of the target storage reaches a writing degree threshold, migrating the data in the target storage to a degraded task data storage space, and switching the currently written storage from the target storage to another data storage in the set of data storages.
6. A task recovery method characterized by comprising: The method is applied to a recovery server selected from a candidate server set by a server providing a service, and the method comprises: receiving a recovery indication message; the recovery indication message is indication information for recovering a target processing task in a degraded state; the target processing task in the degraded state corresponds to a target service that meets a degradation condition, and the server providing the service is configured to determine that the target service meets the degradation condition in response to an underlying server on which the target service depends being unable to provide underlying services on which the target service depends and a target service execution attribute corresponding to the target service corresponding to a service execution attribute corresponding to degradation; based on the recovery indication message, obtaining a task identifier corresponding to task request data corresponding to the target processing task; obtaining task request data corresponding to the task identifier from a degraded task data storage space; the task request data is stored in the degraded task data storage space when the target processing task is degraded; 7. The method of claim 6, wherein, when the recovery condition is met, processing the target processing task based on the task request data. The step of processing the target processing task based on the task request data when the recovery condition is met comprises: when the recovery condition is met, reading service request parameters and task execution methods from the task request data; 8. The method according to claim 6 or 7, characterized in that, performing request playback processing on the service request parameters according to the task execution methods, and taking the request playback result as the processing result of the target processing task. After the step of processing the target processing task based on the task request data when the recovery condition is met, the method further comprises: deleting the task request data obtained from the degraded task data storage space; 9. The method of claim 8, wherein, sending a data deletion instruction to a storage server corresponding to the degraded task data storage space, the data deletion instruction carrying the task identifier, so that the storage server obtains the task request data according to the task identifier and deletes the task request data corresponding to the task identifier in response to the data deletion instruction. The step of sending a data deletion instruction to a storage server corresponding to the degraded task data storage space comprises: sending a data deletion instruction to a storage server corresponding to the degraded task data storage space, the data deletion instruction carrying the task identifier and a deletion permission indication key, the deletion permission indication key being returned by the storage server to the recovery server when the recovery server obtains the task request data corresponding to the task identifier from the degraded task data storage space; 10. A task recovery apparatus characterized by comprising: When the storage server receives the deletion permission indication key carried by the data deletion instruction, the storage server performs deletion permission verification based on the deletion permission indication key, and when the verification is passed, the storage server deletes the task request data corresponding to the task identifier. The method comprises: a processing task receiving unit configured to receive a target processing task for processing a target service; The downgrade condition judging unit is configured to determine that the target service meets the downgrade condition in response to the fact that the basic server on which the target service depends fails to provide a basic service on which the target service depends and the target service execution attribute corresponding to the target service corresponds to the service execution attribute corresponding to the downgrade. The downgrade data storage unit is configured to downgrade the target processing task and store the task request data corresponding to the target processing task when it is determined that the target service meets the downgrade condition. The recovery indication unit is configured to send a recovery indication message corresponding to the target processing task in the downgrade state to a recovery server selected from the candidate server set, so that the recovery server detects a recovery condition corresponding to the target processing task in the downgrade state, acquires the task request data based on the task request data when the recovery condition is met, and processes the target processing task based on the task request data.
11. The apparatus of claim 10, wherein, The downgrade data storage unit is specifically configured to determine the service state of the basic server on which the target service depends, acquire the target service execution attribute corresponding to the target service when it is determined that the service state is in the downgrade state, and determine that the target service meets the downgrade condition when the target service execution attribute corresponds to the service execution attribute corresponding to the downgrade, downgrade the target processing task, and store the task request data corresponding to the target processing task.
12. The apparatus of claim 11, wherein, The target service execution attribute includes a service response degree and a service dependency degree, and the downgrade data storage unit is specifically further configured to compare the service response degree with the response degree corresponding to the downgrade to obtain a first comparison result, compare the service dependency degree with the dependency degree corresponding to the downgrade to obtain a second comparison result, and determine that the target service meets the downgrade condition when the first comparison result is that the service response degree is less than or equal to the response degree corresponding to the downgrade and the second comparison result is that the service dependency degree is less than or equal to the dependency degree corresponding to the downgrade.
13. The apparatus of claim 11, wherein, The downgrade data storage unit is specifically further configured to acquire the service request interface corresponding to the target processing task and determine the target service execution attribute corresponding to the target service according to the interface information corresponding to the service request interface.
14. The apparatus of any one of claims 10 to 13, wherein, The downgrade data storage unit is specifically configured to determine a target storage from a set of data storage corresponding to the downgrade task, and write the task request data into the target storage. When it is determined that the write-in degree of the target storage reaches a write-in degree threshold, the data in the target storage is migrated to a downgrade task data storage space, and the currently written storage is switched from the target storage to another data storage in the set of data storages.
15. A task recovery apparatus characterized by comprising: The recovery server is selected from a candidate server set by a server providing a service, and includes: The recovery indication receiving unit is configured to receive a recovery indication message; the recovery indication message is indication information for recovering a target processing task in a degraded state; the target processing task in the degraded state corresponds to a target service that meets a degradation condition, and the server providing the service is configured to determine that the target service meets the degradation condition in response to the fact that a basic server relied on by the target service is unable to provide a basic service relied on by the target service and the fact that a target service execution attribute corresponding to the target service corresponds to a service execution attribute corresponding to degradation; The task identifier obtaining unit is configured to obtain a task identifier corresponding to task request data of the target processing task based on the recovery indication message; The task request data obtaining unit is configured to obtain the task request data corresponding to the task identifier from a degraded task data storage space; the task request data is stored in the degraded task data storage space when the target processing task is degraded; The recovery processing unit is configured to process the target processing task based on the task request data when a recovery condition is met.
16. The apparatus of claim 15, wherein, The recovery processing unit is specifically configured to read a service request parameter and a task execution method from the task request data when the recovery condition is met; perform request playback processing on the service request parameter according to the task execution method, and use a request playback result as a processing result of the target processing task.
17. The apparatus of claim 15 or 16, wherein, Further comprising: The first deletion unit is configured to delete the task request data obtained from the degraded task data storage space; The second deletion unit is configured to send a data deletion instruction to a storage server corresponding to the degraded task data storage space, the data deletion instruction carrying the task identifier, so that the storage server obtains the task request data according to the task identifier and deletes the task request data corresponding to the task identifier in response to the data deletion instruction.
18. The apparatus of claim 17, wherein, The second deletion unit is specifically configured to send a data deletion instruction to a storage server corresponding to the degraded task data storage space, the data deletion instruction carrying the task identifier and a deletion permission indication key; the deletion permission indication key is returned by the storage server to the recovery server when the recovery server obtains the task request data corresponding to the task identifier from the degraded task data storage space; The storage server receives the deletion permission indication key carried in the data deletion instruction, performs deletion permission verification based on the deletion permission indication key, and deletes the task request data corresponding to the task identifier when the verification is passed.
19. An electronic device, comprising: Comprise: A processor; A memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the task recovery method according to any one of claims 1 to 9.
20. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the task recovery method as claimed in any one of claims 1 to 9.
21. A computer program product, comprising instructions therein, wherein, The instructions are executed by the processor of the electronic device, and the electronic device is enabled to perform the task recovery method as claimed in any one of claims 1 to 9.
Citation Information
Patent Citations
Service level control method and system of online service system
CN107317702A
Service overload protection method and device and server
CN112860465A