Service scheduling method and device, equipment and storage medium
By introducing a checkpoint-based service fault tolerance/reuse mechanism in multi-service scheduling, the problems of waste of resources, increased service time and hardware limitation in multi-service scheduling are solved, and the rapid processing of idempotent services is realized.
Patent Information
- Application Number
- CN202311542563.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2025-05-20
- Estimated Expiration
- 2043-11-17
AI Technical Summary
The prior art has problems such as wasting resources, increasing service time and hardware limitations in multi-service scheduling.
Through the checkpoint-based service fault tolerance/reuse mechanism, a rapid processing process for idempotent services, especially long-term services, is realized. The specific method includes receiving user input data and adjusting parameters, obtaining data detection results, determining whether the adjustment parameters exist in the checkpoint, and outputting adjustment results based on the results or adjusting data detection results through operators.
It greatly accelerates the service processing process, saves resources, reduces service time-consuming, and realizes service fault tolerance and reuse through multi-level caching and checkpointing mechanisms.
Smart Images

Figure CN120020718A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer application technologies, specifically to technologies such as cloud computing, data storage, data detection, etc., and can be applied to scenarios of scheduling multiple services. In particular, it relates to a service scheduling method, apparatus, device, and storage medium. Background Art
[0002] With the continuous development of computer information processing technologies, a large number of information processing systems need to schedule multiple services.
[0003] Currently, for multi-service scheduling, there are two solutions. One is microservice autonomy, and the other is service integration.
[0004] However, currently, the microservice autonomy solution wastes bandwidth and resources and increases service time consumption. The service integration solution is restricted by hardware. Summary of the Invention
[0005] The present disclosure provides a service scheduling method, apparatus, device, and storage medium, which can perform a service fault tolerance / reuse mechanism based on checkpoints. For idempotent services, especially those with long processing times, the service processing flow can be significantly accelerated.
[0006] According to a first aspect of the present disclosure, a service scheduling method is provided. The method includes:
[0007] Receiving input data of a user and at least one adjustment parameter; obtaining a data detection result of the input data; sequentially determining whether each adjustment parameter exists in a first checkpoint; when an adjustment parameter exists in the first checkpoint, outputting an adjustment result corresponding to the adjustment parameter; when an adjustment parameter does not exist in the first checkpoint, adjusting the data detection result through a first operator corresponding to the adjustment parameter and outputting an adjustment result corresponding to the adjustment parameter, where the first operator is used to output an adjustment result corresponding to the input adjustment parameter according to the input adjustment parameter.
[0008] According to a second aspect of the present disclosure, a service scheduling apparatus is provided. The apparatus includes: a receiving unit, an obtaining unit, a determining unit, and an output unit.
[0009] The receiving unit is configured to receive input data of a user and at least one adjustment parameter.
[0010] The obtaining unit is configured to obtain a data detection result of the input data.
[0011] The determining unit is configured to sequentially determine whether each adjustment parameter exists in the first checkpoint.
[0012] The output unit is configured to, when an adjustment parameter exists in the first checkpoint, output an adjustment result corresponding to the adjustment parameter.
[0013] The output unit is further configured to, when there is no adjustment parameter in the first checkpoint, adjust the data detection result through a first operator corresponding to the adjustment parameter, and output an adjustment result corresponding to the adjustment parameter, where the first operator is configured to output an adjustment result corresponding to the input adjustment parameter according to the input adjustment parameter.
[0014] According to a third aspect of the present disclosure, there is provided an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to the first aspect.
[0015] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method according to the first aspect.
[0016] According to a fifth aspect of the present disclosure, there is provided a computer program product, including a computer program, where the computer program implements the method according to the first aspect when executed by a processor.
[0017] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:
[0019] Figure 1 It is a schematic flowchart of the service scheduling method provided by an embodiment of the present disclosure;
[0020] Figure 2 Provided by an embodiment of the present disclosure Figure 1 One implementation flowchart of S102 in
[0021] Figure 3 It is another schematic flowchart of the service scheduling method provided by an embodiment of the present disclosure;
[0022] Figure 4 Provided by an embodiment of the present disclosure Figure 1 Another implementation flowchart of S102 in
[0023] Figure 5 It is a schematic composition diagram of the service scheduling device provided by an embodiment of the present disclosure;
[0024] Figure 6Schematic block diagram of an exemplary electronic device 600 that can be used to implement the embodiments of the present disclosure. Detailed implementation manners
[0025] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, descriptions of well-known functions and structures are omitted below for clarity and conciseness.
[0026] It should be understood that in the embodiments of the present disclosure, the character " / " generally represents an "or" relationship between the associated objects before and after. Terms such as "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features.
[0027] With the continuous development of computer information processing technology, a large number of information processing systems need to schedule multiple services.
[0028] Currently, there are two solutions for multi-service scheduling. One is microservice autonomy, and the other is service integration.
[0029] However, the current microservice autonomy solution wastes bandwidth and resources and increases service time consumption. The service integration solution is limited by hardware.
[0030] Exemplarily, for existing multi-service scheduling, there are two solutions: microservice autonomy and service integration. Microservice autonomy means that the provider of a single service provides its own independent service, with minimal autonomy as its essential feature. The monolithic application service is disassembled into independent service units to achieve decoupling between system functional modules, facilitating service upgrade, elastic scaling, and service reuse. Microservice autonomy causes data streams to be repeatedly transmitted between serial services, wasting bandwidth and resources, and also bringing a linear increase in transmission time consumption, increasing service time consumption. If something goes wrong in a certain serial link, the user needs to re-initiate a request, and the service serially starts transmitting data for processing from the beginning.
[0031] Service integration is a technology that integrates multiple different services to provide a more complete solution. It can combine different services into a single service and access and manage them through an interface. This technology enables enterprises to more efficiently manage and integrate various services, thereby improving the efficiency and effectiveness of business processes. To solve the problem of long time consumption in the process of streaming data transmission, the solution that always comes to mind is to transmit this data only once, process the data within the same service, and then return it to the user. Although this solution is simple and crude, it has a fatal flaw. As the service integration degree is too high, vertical expansion has become the bottleneck of the service and a problem that must be solved. Hardware limits excessive integration.
[0032] Under this background technology, the present disclosure provides a service scheduling method, which can perform a service fault tolerance / reuse mechanism based on checkpoints. For idempotent services, especially those with long processing times, it can significantly accelerate the service processing flow.
[0033] Exemplarily, the execution subject of this service scheduling method can be a computer or a server, or it can also be other devices with data processing capabilities. There is no limitation on the execution subject of this method here.
[0034] In some embodiments, the server can be a single server, or it can also be a server cluster composed of multiple servers. In some implementation manners, the server cluster can also be a distributed cluster. There is no limitation on the specific implementation manner of the server in the present disclosure.
[0035] Figure 1 It is a schematic flowchart of the service scheduling method provided by the embodiments of the present disclosure. As Figure 1 shown, this method can include S101 - S105.
[0036] S101. Receive the input data of the user and at least one adjustment parameter.
[0037] Exemplarily, taking the example that the user uses photo editing software to edit photos, the input data of the user can include the original photo taken by the user, and the adjustment parameters can include beautification parameters, such as pimple, mole, and blemish parameters, intelligent white balance parameters, sharpening parameters, face slimming parameters, intelligent color brightening parameters, etc.
[0038] S102. Obtain the data detection result of the input data.
[0039] Exemplarily, after receiving the input data of the user, the input data can be input into the operator corresponding to the input data, and the input data is detected through the operator corresponding to the input data to obtain the data detection result corresponding to the input data.
[0040] S103. Determine in sequence whether each adjustment parameter exists in the first checkpoint.
[0041] Exemplarily, the first checkpoint can be understood as an area that caches data corresponding to each operation before the current operation. For example, taking the case where a user uses image editing software to retouch images, the data can include each adjustment parameter, the operation can be understood as determining whether each adjustment parameter exists in the first checkpoint, and the area can be understood as a region on the memory of the terminal device running the image editing software. The first checkpoint and the first checkpoint can be different areas of the same cache. The first checkpoint can also be referred to as a cache, or a data storage area, etc., which is not limited herein. The adjustment parameter can be compared with the data in the first checkpoint to determine whether the first checkpoint contains at least one adjustment parameter input by the user.
[0042] Based on the above embodiments, exemplarily, taking the case where a user uses image editing software to retouch images, the scheduling service divides the scheduling stage into two stages: a detection stage and a beautification stage. In the beautification stage, the operators can only make requests serially, and the time consumption will increase linearly with the number of capabilities, and they can be centrally deployed. The adjustment parameters in the beautification stage can include pimple, nevus, and mole parameters, intelligent white balance parameters, sharpening parameters, face slimming parameters, intelligent color brightening parameters, etc. It is possible to determine in sequence whether each adjustment parameter is cached in the image editing software, that is, to determine whether each adjustment parameter exists in the first checkpoint.
[0043] S104. When an adjustment parameter exists in the first checkpoint, output the adjustment result corresponding to the adjustment parameter.
[0044] Exemplarily, the status of the adjustment parameter can be read in the first checkpoint. The status of the adjustment parameter is divided into available status and empty status. When the status of the adjustment parameter read is available, it means that the adjustment parameter exists in the first checkpoint, and the adjustment parameter can be offset, that is, obtain the adjustment result corresponding to the adjustment parameter and output it, and then continue to determine whether the next adjustment parameter is cached in the first checkpoint until all adjustment parameters are determined.
[0045] Based on the above embodiments, exemplarily, when the face slimming parameter input by the user is 20%, the status of the face slimming parameter of 20% can be read in the first checkpoint. When the status of the face slimming parameter of 20% read is available, it means that the adjustment parameter of the face slimming parameter of 20% exists in the first checkpoint, and the adjustment parameter of the face slimming parameter of 20% can be offset, that is, obtain the result corresponding to the face slimming parameter of 20% and output it.
[0046] S105. When an adjustment parameter does not exist in the first checkpoint, adjust the data detection result through the first operator corresponding to the adjustment parameter, and output the adjustment result corresponding to the adjustment parameter.
[0047] Among them, the first operator is used to output an adjustment result corresponding to an input adjustment parameter according to the input adjustment parameter.
[0048] Exemplarily, the status of the adjustment parameter can be read in the first checkpoint. The status of the adjustment parameter is divided into available status and empty status. When the status of the adjustment parameter read is empty, it means that there is no adjustment parameter in the first checkpoint. The first operator corresponding to the adjustment parameter can be used to adjust the above data detection result according to the adjustment parameter to obtain the adjustment result corresponding to the adjustment parameter, and output the adjustment result corresponding to the adjustment parameter. Then continue to judge whether the next adjustment parameter is cached in the first checkpoint until all adjustment parameters are judged.
[0049] Based on the above embodiments, exemplarily, when the face slimming parameter input by the user is 20%, the status of the face slimming parameter of 20% can be read in the first checkpoint. When the status of the face slimming parameter of 20% read is empty, it means that there is no such adjustment parameter as the face slimming parameter of 20% in the first checkpoint. The first operator corresponding to the face slimming parameter can be used to adjust the data detection result according to the face slimming parameter of 20% to obtain the face contour after 20% face slimming, that is, the adjustment result corresponding to the adjustment parameter of the face slimming parameter of 20%, and output the above adjustment result. Among them, the data detection result can include the face contour, the positions of the facial features of the face on the face, the skin beautification data corresponding to the face, etc.
[0050] The present disclosure receives input data of a user and at least one adjustment parameter; then obtains a data detection result of the input data; then sequentially determines whether each adjustment parameter exists in the first checkpoint; when the adjustment parameter exists in the first checkpoint, outputs an adjustment result corresponding to the adjustment parameter; when the adjustment parameter does not exist in the first checkpoint, adjusts the data detection result through the first operator corresponding to the adjustment parameter, and outputs an adjustment result corresponding to the adjustment parameter. It adopts a strategy of multi-level cache gradually invalidating, maximally saving resources and minimizing service time consumption. At the same time, based on the checkpoint for service fault tolerance / reuse mechanism, for idempotent services, especially services with long time consumption, the service processing flow can be significantly accelerated. In addition, the present disclosure splits the large operator service into modules, and after splitting, it is uniformly coordinated and scheduled by the scheduling layer. Therefore, the scheduler can also freely combine different resources, data interfaces and operators.
[0051] Figure 2 For the Figure 1 embodiment provided by the present disclosure Figure 2 as shown Figure 1 in, S102 in
[0052] S201. Detect the input data according to the second checkpoint.
[0053] S202. When there is input data in the second checkpoint, determine the data detection result corresponding to the input data.
[0054] Exemplarily, the status of the input data can be read in the second checkpoint. The status of the input data is divided into available status and empty status. When the status of the input data read is available, it means that there is input data in the second checkpoint, and the data detection result corresponding to the input data can be obtained and output.
[0055] Based on the above embodiments, exemplarily, taking the example of a user using image editing software to edit pictures, when the data input by the user is the original Figure 1 picture taken, the status of the original Figure 1 picture can be read in the second checkpoint. When the status of the original Figure 1 picture read is available, it means that there is the original Figure 1 input data in the second checkpoint, and the data detection result corresponding to the original Figure 1 picture can be obtained and output. Among them, the data detection result corresponding to the original Figure 1 picture can include the facial contour in the original Figure 1 picture, the positions of the facial features of the face in the original Figure 1 picture on the face, the skin beautification data corresponding to the face in the original Figure 1 picture, etc.
[0056] S203. When there is no input data in the second checkpoint, detect the input data through the second operator corresponding to the input data to obtain the data detection result corresponding to the input data.
[0057] Exemplarily, when the status of the input data read is empty, it means that there is no input data in the second checkpoint. The input data can be detected through the second operator corresponding to the input data to obtain the data detection result corresponding to the input data. Among them, the second operator is used to output the data detection result corresponding to the input data according to the input input data.
[0058] Based on the above embodiments, exemplarily, taking the example of a user using image editing software to edit pictures, the scheduling service divides the scheduling stage into two stages: the detection stage and the beautification stage. In the detection stage, the original picture needs to be detected, which can be carried out in parallel. The detection service can package the software development kit (SDK) in the picture editing scenario, saving computing resources. If this part of the concurrent detection is deployed separately, only the service network bandwidth will be increased, and the time-consuming will not increase linearly in theory. When the data input by the user is the original Figure 2 picture taken, the status of the original Figure 2 picture can be read in the second checkpoint. When the status of the originalFigure 2 When the status is empty, it means that the original Figure 2 This input data can be processed by the second operator on the original Figure 2 for detection to obtain the original Figure 2 face contour in Figure 2 the position of the facial features of the face in Figure 2 the skin beautification data corresponding to the face in Figure 2 The detection of the original Figure 2 by the second operator can include performing human contour detection on the original Figure 2 to obtain human contour data, performing skin beautification detection on the original Figure 2 to obtain skin beautification data, and aggregating the human contour data and the skin beautification data to obtain the corresponding Figure 2 data detection result of the original
[0059] In this embodiment, the input data is detected according to the second checkpoint; when the input data exists in the second checkpoint, the data detection result corresponding to the input data is determined; when the input data does not exist in the second checkpoint, the input data is detected by the second operator corresponding to the input data to obtain the data detection result corresponding to the input data. Based on the pre-production mechanism, the data that needs to be prepared in advance can be uniformly pre-processed and cached. For the cached data, the data detection result corresponding to the cached data can be directly reused, so that the service only focuses on the data input by the user and does not need to process and update the auxiliary data that depends on the outside multiple times, greatly accelerating the service processing flow.
[0060] Figure 3 Another process schematic diagram of the service scheduling method provided by the embodiments of the present disclosure is shown. As Figure 3 shown, the method may include S301 - S302.
[0061] S301. Obtain the validity period of the target checkpoint.
[0062] Exemplarily, a validity period can be set for the target checkpoint, and the target checkpoint includes the first checkpoint and / or the second checkpoint. It can be understood that the validity period can be set only for the first checkpoint, or only for the second checkpoint, or for both the first checkpoint and the second checkpoint.
[0063] Exemplarily, the validity period of the target checkpoint is related to the data usage scenario of the target checkpoint; the data usage scenario includes a global scenario and a process scenario. The validity period of the target checkpoint in the global scenario is different from that in the process scenario. The validity period of the target checkpoint can be set according to different actual data usage scenarios to ensure business continuity and data integrity, avoid data loss and duplicate work, and improve operation efficiency and the coherence of the workflow.
[0064] Based on the above embodiments, exemplarily, when the data usage scenario of the first checkpoint is the global scenario, the first checkpoint may include a first global checkpoint. When the data usage scenario of the first checkpoint is the process scenario, the first checkpoint may include a first process checkpoint. There are duplicate data in the input data stream. To remove the duplicate data, it is necessary to record which data has flowed into the application. When new data flows in, it is determined whether the new data has flowed into the application based on the data that has already flowed in. If the new data has flowed into the application, the result corresponding to the new data can be directly and quickly returned, which can be called the first global checkpoint. For the first global checkpoint, the validity period can be set to 8 hours. For this type of cache, the hit rate is relatively low and it is often used for retries and recoveries after system network anomalies, as well as for repeated operations in preprocessing or offset scheduling of adjusted parameters. To check whether the input stream conforms to a specific pattern, it is necessary to cache the previously flowed-in elements in the form of a state. For example, determining whether the face data in an image data stream can be used can be called the first process checkpoint. For the first process checkpoint, the validity period can be set to 3 days. For this type of cache, the hit rate is relatively high and it is often used for detecting data caching and reusing adjusted parameters. Similarly, the second checkpoint may include a second global checkpoint and a second process checkpoint. The method of setting the validity period for the second global checkpoint and the second process checkpoint can refer to the method of setting the validity period for the first global checkpoint and the first process checkpoint above, and will not be elaborated here.
[0065] S302. When the validity period of the target checkpoint expires, delete the target checkpoint.
[0066] Exemplarily, when the validity period of the target checkpoint is 8 hours, the target checkpoint can be deleted 8 hours after the target checkpoint is established.
[0067] In this embodiment, by obtaining the validity period of the target checkpoint and deleting the target checkpoint when the validity period of the target checkpoint expires, invalid data can be cleaned up in a timely manner, improving data processing efficiency and further reducing service consumption.
[0068] In some embodiments, the above method further includes: when an exception occurs in a task, restoring the task according to the first checkpoint or the second checkpoint.
[0069] Exemplarily, a checkpoint is the core mechanism for fault tolerance / reuse in the scheduling layer. The scheduling layer can perform snapshot storage of the data processed by the operators of each device and machine. In most cases, the service can use the checkpoint mechanism to accelerate the service response; if the program crashes, the processed data can be restored from these snapshots.
[0070] Exemplarily, when an exception occurs in a task and the checkpoint corresponding to the task with the exception is the first checkpoint, the first checkpoint can be read, and the status and execution of the error-prone task can be restored to the first checkpoint.
[0071] In this embodiment, when an exception occurs in a task, restoring the task according to the first checkpoint or the second checkpoint can reduce the time for repeatedly executing the task and improve the efficiency of executing the task.
[0072] In some embodiments, when there is no adjustment parameter in the first checkpoint, after adjusting the processing result through the operator corresponding to the adjustment parameter to obtain the adjustment result corresponding to the adjustment parameter, the above method further includes: asynchronously storing the adjustment result corresponding to the adjustment parameter.
[0073] Exemplarily, after obtaining the adjustment result corresponding to the adjustment parameter, the adjustment result can be asynchronously stored while outputting the adjustment result, that is, a checkpoint of the adjustment result is established, and it can also be understood as caching the adjustment result in the state backend. Currently, the state backend is divided into two types, Redis and BOS. Redis stores structured data (such as detection data, which can include the face contour, the positions of facial features in the face, etc.), and BOS stores streaming data (such as the captured pictures). The Redis state backend (RedisStateBackend) can store structured data. After serializing all detections, they can be stored in the cloud cache folder (cloudcache) of the network disk. The BosStateBackend is based on the file system and can be understood as a distributed file system. It should be noted that although BosStateBackend is selected for use, the data being processed is still stored in the memory of the operator, and only during checkpointing will the state snapshot be written to the specified file system.
[0074] In this embodiment, by asynchronously storing the adjustment results corresponding to the adjustment parameters, the saving of the first checkpoint is separated from data processing, without suspending the entire application, ensuring the normal operation of the program. At the same time, during the next data processing, for the same data, the corresponding results can be directly output, accelerating the service processing flow.
[0075] In some embodiments, when there is no input data in the second checkpoint, after processing the input data through the operator corresponding to the input data to obtain the processing result corresponding to the input data, the method further includes: asynchronously storing the processing result corresponding to the input data.
[0076] Exemplarily, the specific method for asynchronously storing the processing result corresponding to the input data can refer to the method for asynchronously storing the adjustment result corresponding to the adjustment parameter above, and will not be elaborated here.
[0077] In this embodiment, by asynchronously storing the processing result corresponding to the input data, the saving of the second checkpoint is separated from data processing, without suspending the entire application, ensuring the normal operation of the program. At the same time, during the next data processing, for the same data, the corresponding results can be directly output, accelerating the service processing flow.
[0078] In some embodiments, the method further includes: selecting the consistency level to be exactly once.
[0079] Exemplarily, a checkpoint is the core mechanism for fault tolerance / reuse in the scheduling layer. The scheduling layer stores snapshots of the data processed by the operators of each device and machine. In most cases, the service can use the checkpoint mechanism to accelerate the service response; if the program crashes, it can resume processing the data from these snapshots. Fault tolerance and consistency are two important concepts in distributed systems, and there is a close relationship between them. Fault tolerance refers to the ability of a distributed system to still operate normally when a failure occurs, ensuring the reliability and stability of the system. Fault tolerance mechanisms include fault detection, fault recovery, and fault tolerance processing, etc. Consistency means that the data states of different nodes in a distributed system are consistent. For different access requests to the same data, the system should give the same result, that is, the correctness of the result obtained after successfully handling the failure and recovery compared with the result obtained without any failure. In other words, it is whether the occurrence of a failure affects the obtained result. The relationship between fault tolerance and consistency is that a system with good fault tolerance can handle node failures, network partitions, etc. without affecting consistency, thus ensuring the high availability and high reliability of the system. At the same time, a system that guarantees consistency also needs to have a certain degree of fault tolerance so that the system can correctly handle requests when a failure occurs, thus ensuring data consistency. Consistency is divided into three levels: at-most-once: at most once, which means that after a failure occurs, the calculation result may be lost, that is, the correctness of the result cannot be guaranteed. at-least-once: at least once, which means that the calculation result may be greater than the correct value, but will never be less than the correct value, that is, the calculation program may calculate more after a failure, but will never calculate less. exactly-once: exactly once, which means that the system guarantees that the value of the calculation result obtained after a failure is the same as the correct value.
[0080] In this embodiment, by selecting the consistency level of exactly once, it can be ensured that the value of the calculation result obtained after a failure is the same as the correct value, avoiding errors and reducing resource consumption at the same time.
[0081] In some embodiments, the above method further includes: creating a savepoint.
[0082] Wherein, the savepoint is the data that needs to be cached inside the third operator, and the third operator is any one of the first operators or any one of the second operators.
[0083] Exemplarily, the scheduler provides a customizable save function, namely the savepoint. In principle, the algorithm used to create the savepoint is exactly the same as that of the checkpoint. The difference is that the checkpoint is used and maintained by the scheduling layer, while the savepoint is the data that needs to be cached inside the operator. This part of the data is returned to the scheduler, and the scheduler returns it back to the operator along the original path, and the operator decides how to use it. The structure is that in the data structure returned by the operator to the scheduling layer, there is a json object with the key "persist", and its value will be cached by the scheduling service.
[0084] Based on the above embodiments, exemplarily, taking the example that the user uses image editing software to edit pictures, after obtaining the adjustment result corresponding to the adjustment parameters, while outputting the adjustment result, the adjustment result can also be asynchronously stored, that is, a checkpoint of the adjustment result is established, and the adjustment result is the beautified picture. At the same time, a savepoint can also be created to cache data such as the facial contour of the original picture and the positions of the facial features in the original picture, and this part of the data is returned to the scheduler, and the scheduler returns it back to the operator along the original path, and the operator decides how to use it.
[0085] In this embodiment, by creating a savepoint, the data in the savepoint can be reused, and this part of the data does not need to be processed and updated multiple times. The service only focuses on user data, which further accelerates the service processing flow.
[0086] Figure 4 For the Figure 1 Another implementation flow diagram of S102 in the present disclosure. As Figure 4 shown, Figure 1 S102 in
[0087] S401: Input the first picture into the second operator.
[0088] S402: Output the data detection result corresponding to the first picture through the second operator.
[0089] Exemplarily, the above input data may include the first picture, and the first picture may be the original picture of a human face taken by the user. The second operator has the function of outputting the data detection result corresponding to the first picture according to the input first picture. Input the first picture into the second operator, and the second operator can detect the first picture and output the data detection result corresponding to the first picture.
[0090] In this embodiment, by specifying that the input data may include the first picture, inputting the first picture into the second operator, and then outputting the data detection result corresponding to the first picture through the second operator, when the input data is the first picture, the data detection result corresponding to the first picture can be output through the second operator, providing data support for subsequent data processing.
[0091] In an exemplary embodiment, the embodiment of the present disclosure further provides a service scheduling device, which can be used to implement the service scheduling method in the foregoing embodiment. Figure 5 It is a schematic diagram of the composition of the service scheduling device provided by the embodiment of the present disclosure. As Figure 5 shown, the device may include: a receiving unit 501, an obtaining unit 502, a judging unit 503, and an output unit 504.
[0092] The receiving unit 501 is configured to receive input data of a user and at least one adjustment parameter.
[0093] The obtaining unit 502 is configured to obtain a data detection result of the input data.
[0094] The judging unit 503 is configured to sequentially judge whether each adjustment parameter exists in the first checkpoint.
[0095] The output unit 504 is configured to output an adjustment result corresponding to the adjustment parameter when the adjustment parameter exists in the first checkpoint.
[0096] The output unit 504 is further configured to, when the adjustment parameter does not exist in the first checkpoint, adjust the data detection result through a first operator corresponding to the adjustment parameter, and output an adjustment result corresponding to the adjustment parameter, where the first operator is configured to output an adjustment result corresponding to the input adjustment parameter according to the input adjustment parameter.
[0097] Optionally, the obtaining unit 502 is specifically configured to detect the input data according to a second checkpoint; when the input data exists in the second checkpoint, determine a data detection result corresponding to the input data; when the input data does not exist in the second checkpoint, detect the input data through a second operator corresponding to the input data, and obtain a data detection result corresponding to the input data, where the second operator is configured to output a data detection result corresponding to the input data according to the input data.
[0098] Optionally, as Figure 5 shown, the device may further include: a setting unit 505.
[0099] The setting unit 505 is configured to obtain a validity period of a target checkpoint, where the target checkpoint includes the first checkpoint and / or the second checkpoint; when the validity period of the target checkpoint expires, delete the target checkpoint.
[0100] Optionally, the validity period of the target checkpoint is related to a data usage scenario of the target checkpoint; the data usage scenario includes a global scenario and a process scenario, and the validity period of the target checkpoint in the global scenario is different from the validity period of the target checkpoint in the process scenario.
[0101] Optionally, as Figure 5 shown, the device may further include: a recovery unit 506.
[0102] A recovery unit 506, configured to recover a task according to a first checkpoint or a second checkpoint when an exception occurs in the task.
[0103] Optionally, as Figure 5 shown, the apparatus may further include: a storage unit 507.
[0104] The storage unit 507 is configured to asynchronously store an adjustment result corresponding to an adjustment parameter.
[0105] Optionally, the storage unit 507 is further configured to asynchronously store a processing result corresponding to input data.
[0106] Optionally, the storage unit 507 is further configured to create a save point, where the save point is data that needs to be cached inside a third operator, and the third operator is any one of the first operators or any one of the second operators.
[0107] Optionally, the obtaining unit 502 is specifically configured to input a first picture into a second operator; and output a data detection result corresponding to the first picture through the second operator.
[0108] In the technical solution of the present disclosure, the acquisition, storage, and application of user personal information involved all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0109] According to an embodiment of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium, and a computer program product.
[0110] In an exemplary embodiment, the electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method as described in the above embodiments.
[0111] In an exemplary embodiment, the readable storage medium may be a non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to cause a computer to execute the method as described in the above embodiments.
[0112] In an exemplary embodiment, the computer program product includes a computer program, and the computer program implements the method as described in the above embodiments when executed by a processor.
[0113] Figure 6FIG. 0 shows a schematic block diagram of an exemplary electronic device 600 that may be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, for example, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as, personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0114] As Figure 6 shown, the electronic device 600 includes a computing unit 601 that may perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 may also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0115] A plurality of components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0116] The computing unit 601 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 executes the various methods and processes described above, such as the service scheduling method. For example, in some embodiments, the service scheduling method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the service scheduling method described above can be executed. Alternatively, in other embodiments, the computing unit 601 can be configured to execute the service scheduling method by any other suitable means (e.g., by means of firmware).
[0117] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), systems-on-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0118] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to the processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program codes can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0119] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0120] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0121] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0122] A computer system can include a client and a server. The client and the server are generally far apart from each other and typically interact through a communication network. The relationship between the client and the server is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, or a server of a distributed system, or a server incorporating a blockchain.
[0123] It should be understood that the various forms of processes shown above can be used, with steps reordered, added or deleted. For example, the steps described in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitations are imposed herein.
[0124] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub - combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A service scheduling method, the method comprising: receiving user input data and at least one adjustment parameter; Obtaining a data detection result of the input data; Determining in sequence whether each of the adjustment parameters exists in the first checkpoint; When the adjustment parameter exists in the first checkpoint, outputting an adjustment result corresponding to the adjustment parameter; When the adjustment parameter does not exist in the first checkpoint, the data detection result is adjusted by a first operator corresponding to the adjustment parameter, and the adjustment result corresponding to the adjustment parameter is output, and the first operator is used to output the adjustment result corresponding to the adjustment parameter according to the input adjustment parameter.
2. According to the method of claim 1, the step of obtaining the data detection result of the input data comprises: Testing the input data according to a second checkpoint; When the input data exists in the second checkpoint, determining a data detection result corresponding to the input data; When the input data does not exist in the second checkpoint, the input data is detected by a second operator corresponding to the input data to obtain a data detection result corresponding to the input data, and the second operator is used to output the data detection result corresponding to the input data based on the input data.
3. The method according to claim 1 or 2, further comprising: Acquire a validity period of a target checkpoint, where the target checkpoint includes the first checkpoint and / or the second checkpoint; When the validity period of the target checkpoint expires, the target checkpoint is deleted.
4. According to the method of claim 3, the validity period of the target checkpoint is related to the data usage scenario of the target checkpoint; the data usage scenario includes a global scenario and a process scenario, and the validity period of the target checkpoint in the global scenario is different from the validity period of the target checkpoint in the process scenario.
5. The method according to any one of claims 1 to 4, further comprising: When an exception occurs in a task, the task is restored according to the first checkpoint or the second checkpoint.
6. The method according to any one of claims 1 to 5, wherein when the adjustment parameter does not exist in the first checkpoint, the processing result is adjusted by an operator corresponding to the adjustment parameter to obtain an adjustment result corresponding to the adjustment parameter, the method further comprises: The adjustment results corresponding to the adjustment parameters are asynchronously stored.
7. The method according to any one of claims 2 to 6, wherein when the input data does not exist in the second checkpoint, after the input data is processed by the operator corresponding to the input data to obtain the processing result corresponding to the input data, the method further comprises: The processing results corresponding to the input data are asynchronously stored.
8. The method according to any one of claims 1 to 7, further comprising: Select the fault tolerance level as exactly once.
9. The method according to any one of claims 1 to 8, further comprising: A save point is created, where the save point is data that needs to be cached inside a third operator, and the third operator is any one of the first operators or any one of the second operators.
10. The method according to any one of claims 1 to 9, wherein the input data comprises a first image, and the step of obtaining a data detection result of the input data comprises: Inputting the first picture into the second operator; The data detection result corresponding to the first image is output through the second operator.
11. A service scheduling device, comprising: A receiving unit, configured to receive user input data and at least one adjustment parameter; An acquisition unit, used for acquiring a data detection result of the input data; A judging unit, used to judge in turn whether each of the adjustment parameters exists in the first checkpoint; an output unit, configured to output an adjustment result corresponding to the adjustment parameter when the adjustment parameter exists in the first checkpoint; The output unit is also used to adjust the data detection result through the first operator corresponding to the adjustment parameter and output the adjustment result corresponding to the adjustment parameter when the adjustment parameter does not exist in the first checkpoint. The first operator is used to output the adjustment result corresponding to the adjustment parameter according to the input adjustment parameter.
12. The device according to claim 11, wherein the acquisition unit is specifically configured to: Testing the input data according to a second checkpoint; When the input data exists in the second checkpoint, determining a data detection result corresponding to the input data; When the input data does not exist in the second checkpoint, the input data is detected by a second operator corresponding to the input data to obtain a data detection result corresponding to the input data, and the second operator is used to output the data detection result corresponding to the input data based on the input data.
13. The device according to claim 11 or 12, further comprising: A setting unit, configured to obtain a validity period of a target checkpoint, wherein the target checkpoint includes the first checkpoint and / or the second checkpoint; When the validity period of the target checkpoint expires, the target checkpoint is deleted.
14. According to the device of claim 13, the validity period of the target checkpoint is related to the data usage scenario of the target checkpoint; the data usage scenario includes a global scenario and a process scenario, and the validity period of the target checkpoint in the global scenario is different from the validity period of the target checkpoint in the process scenario.
15. The device according to any one of claims 11 to 14, further comprising: A recovery unit is used to recover the task according to the first checkpoint or the second checkpoint when an exception occurs in the task.
16. The device according to any one of claims 11 to 15, further comprising: The storage unit is used to asynchronously store the adjustment result corresponding to the adjustment parameter.
17. The device according to any one of claims 12 to 16, wherein the storage unit is further used for: The processing results corresponding to the input data are asynchronously stored.
18. The device according to any one of claims 11 to 17, further comprising: A selection unit is used to select the level of the fault tolerance mechanism as exactly once.
19. The device according to any one of claims 11 to 18, wherein the storage unit is further used for: A save point is created, where the save point is data that needs to be cached inside a third operator, and the third operator is any one of the first operators or any one of the second operators.
20. The device according to any one of claims 11 to 19, wherein the input data comprises a first picture, and the acquisition unit is specifically configured to: Inputting the first picture into the second operator; The data detection result corresponding to the first image is output through the second operator.
21. An electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; 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 method according to any one of claims 1 to 10.
22. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method according to any one of claims 1-10.
23. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Fault tolerant batch processing
CN102473122A
Task calling method and device and MEC server
CN113010299A
Video processing method and device, electronic device and storage medium
CN113158918A
Method and device for processing data, equipment and storage medium
CN114201242A
Checkpointing for GPU-as-a-service in cloud computing environment
US10275851B1