A task scheduling method, apparatus, device and medium

By sequentially sorting and storing task data on both the server and client sides and adjusting the pointer positions, the problem of data loss between the server and client is solved, duplicate task execution is avoided, server load is reduced, and data transmission efficiency is improved.

CN116800372BActive Publication Date: 2026-03-10BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-15
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

When transmitting task data between the server and the client, data loss is a common problem. Existing technologies solve this problem by having the server repeatedly transmit task data, but this leads to excessive workload on the server, repeated task execution, and difficulties in data replay.

Method used

The task data is sorted and stored sequentially on both the server and the client. Each task data has a unique index identifier. By adjusting the pointer position on the server, anti-loss data is sent to the client to adjust its pointer position and perform task anti-loss operation. The pointers include the execution pointer and the task pointer.

Benefits of technology

It effectively solves the problem of data loss during transmission, avoids the duplication of tasks, reduces the workload and bandwidth consumption of the server, and improves the data response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116800372B_ABST
    Figure CN116800372B_ABST
Patent Text Reader

Abstract

This disclosure relates to a task scheduling method, apparatus, device, and medium. The method, applied to a server, includes: responding to a client's task retrieval request by sending multiple task data sets to the client. These task data sets are sequentially ordered and stored on both the server and client, with each task data set having a unique index identifier. The method further involves adjusting the position of a pointer on the server and sending anti-loss data to the client to cause the client to adjust its pointer position, thus performing a task anti-loss operation. The pointer includes an execution pointer and a task pointer. The execution pointer points to the index identifier where data was lost, and the task pointer points to the index identifier of the last task data set in the sequentially ordered set. This disclosure effectively solves the problem of data loss during transmission, avoids duplicate task execution, reduces the server's workload and bandwidth consumption, and the sequential data storage helps improve data retrieval speed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a task scheduling method and device, equipment and medium. BACKGROUND

[0002] With the rapid development of Internet technology and computer technology, more and more businesses need to be implemented through interaction. Due to network or device problems, task data loss is inevitable when transmitting task data between the server and the client, which affects the implementation of the business.

[0003] In the related art, the way to solve the task data loss is mostly implemented through the mechanism of repeated transmission of task data by the server, but such a way has the problems of heavy workload of the server, different results returned by the same task due to repeated execution, and difficulty in data playback. SUMMARY

[0004] In order to solve the above technical problems, the present disclosure provides a task scheduling method, device, equipment and medium.

[0005] The present disclosure provides a task scheduling method, which is applied to a server and includes the following steps.

[0006] In response to a task pulling request of a client, a plurality of task data are sent to the client, wherein the plurality of task data are sequentially sorted and stored in the server and the client, and each task data has a unique index identifier.

[0007] An execution task loss prevention operation is performed by adjusting a pointer pointing position of the server and sending anti-loss data to the client to make the client adjust its pointer pointing position, wherein the pointer includes an execution pointer and a task pointer, the execution pointer points to an index identifier of data loss, and the task pointer points to an index identifier of the last task data in the sequentially sorted plurality of task data.

[0008] The present disclosure also provides a task scheduling device, which is arranged in a server and includes the following steps.

[0009] A data sending module is configured to send a plurality of task data to the client in response to a task pulling request of the client, wherein the plurality of task data are sequentially sorted and stored in the server and the client, and each task data has a unique index identifier.

[0010] The anti-loss module is configured to perform an anti-loss operation of the task by adjusting a pointing position of a pointer of the server and sending anti-loss data to the client to enable the client to adjust a pointing position of a pointer of the client, the pointer comprising an execution pointer and a task pointer, the execution pointer pointing to an index identifier of data loss, and the task pointer pointing to an index identifier of a last task data in the sequentially ordered plurality of task data.

[0011] The electronic device includes a processor, a memory for storing executable instructions of the processor, and the processor is configured to read the executable instructions from the memory and execute the instructions to implement the task scheduling method provided in the embodiments of the present disclosure.

[0012] The electronic device includes a processor, a memory for storing executable instructions of the processor, and the processor is configured to read the executable instructions from the memory and execute the instructions to implement the task scheduling method provided in the embodiments of the present disclosure.

[0013] The electronic device includes a processor, a memory for storing executable instructions of the processor, and the processor is configured to read the executable instructions from the memory and execute the instructions to implement the task scheduling method provided in the embodiments of the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0014] The above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent by describing in detail the embodiments thereof with reference to the attached drawings. The same or similar components are denoted by the same or similar reference numerals throughout the drawings. It is to be understood that the drawings are schematic and elements are not necessarily drawn to scale.

[0015] Figure 1 A flowchart of a task scheduling method provided in the embodiments of the present disclosure is shown in FIG. 1.

[0016] Figure 2A schematic diagram of task data sorting provided by an embodiment of the present disclosure;

[0017] Figure 3 A flowchart of another task scheduling method provided by an embodiment of the present disclosure;

[0018] Figure 4 A schematic diagram of a pointing position adjustment of a task pointer provided by an embodiment of the present disclosure;

[0019] Figure 5 A flowchart of another task scheduling method provided by an embodiment of the present disclosure;

[0020] Figure 6 A schematic diagram of a pointing position adjustment of an execution pointer provided by an embodiment of the present disclosure;

[0021] Figure 7 A schematic diagram of data compression provided by an embodiment of the present disclosure;

[0022] Figure 8 A structural schematic diagram of a task scheduling apparatus provided by an embodiment of the present disclosure;

[0023] Figure 9 A structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] Embodiments of the present disclosure will be described in more detail by referring to the drawings. Although certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein, but rather the embodiments are provided to more thoroughly and completely understand the present disclosure. It is understood that the drawings and embodiments of the present disclosure are for exemplary purposes only and are not intended to limit the scope of protection of the present disclosure.

[0025] It is understood that each step recited in the method embodiments of the present disclosure can be executed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present disclosure is not limited in this respect.

[0026] The term “comprising” and variations thereof as used herein are open-ended, that is, “including but not limited to”. The term “based on” is “based, at least in part, on”. The term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one additional embodiment”; the term “some embodiments” means “at least some embodiments”. Related definitions of other terms will be given in the description below.

[0027] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0028] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0029] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0030] Due to network or device issues, task data loss is inevitable during transmission between the server and client, impacting business operations. Most related technologies address task data loss by repeatedly transmitting task data on the server side. However, this approach has several drawbacks: the server needs to identify whether a task is being executed repeatedly, and the continuous retransmission of tasks consumes unnecessary bandwidth and increases the server's workload. Furthermore, because the server is unaware of the specific execution status of the task, it may misjudge and blindly retransmit tasks, leading to duplicate executions or even the same task returning multiple different data results. In cases of large amounts of data, data replay becomes extremely difficult. To address these issues, this disclosure provides a task scheduling method, which will be described below with reference to specific embodiments.

[0031] Figure 1 This is a flowchart illustrating a task scheduling method provided in an embodiment of the present disclosure. The method can be executed by a task scheduling device, which can be implemented in software and / or hardware, and is generally integrated into an electronic device. Figure 1 As shown, this method is applied to the server side and includes:

[0032] Step 101: In response to the client's task retrieval request, send multiple task data to the client.

[0033] The client can be an electronic device used to execute tasks. A task fetch request can be understood as a request sent by the client to retrieve task data. Multiple task data are sequentially ordered and stored on both the server and client, with each task data having a unique index identifier.

[0034] Specifically, the server can receive task retrieval requests sent by the client and send multiple corresponding task data to the server. The data can be sent sequentially or in parallel, with no specific restrictions.

[0035] Prior to step 101 above, the task scheduling method of this embodiment may further include: acquiring multiple task requests and generating corresponding multiple task data; sorting and storing the multiple task data in order according to the receiving time and / or priority of each task request, and setting a unique index identifier for each task data according to the sorting result.

[0036] An index identifier (index) can be a unique identifier added to the task data in this embodiment of the disclosure to reflect the sorting result. The index identifier can be represented in the form of letters and / or numbers. Each task data has a unique index identifier, and the task result after each task data is executed also has the same index identifier as the corresponding task data. The client and the server sort and store the task data and its task results in order.

[0037] When a user wants to implement a business function, they can send multiple task requests to the server through the aforementioned client or other clients. The server can receive these requests and generate corresponding task data for each. Then, the server can sort the task data sequentially according to the receiving time of each request, and / or according to the priority of each request, from highest to lowest, and store the data. A unique index is added to each task data based on the sorting result. Optionally, each task data also has a unique task identifier (ID) to distinguish different tasks.

[0038] For example, Figure 2 This is a schematic diagram of task data sorting provided in an embodiment of the present disclosure, such as... Figure 2 As shown in the figure, the seven task data are arranged in order and their corresponding index identifiers. Each box in the figure represents a task data, and the numbers 1-7 represent index identifiers, while x1-x7 represent task identifiers. Each task data has a unique index identifier and task identifier.

[0039] Step 102: Adjust the pointer position on the server side and send anti-loss data to the client to make the client adjust its pointer position and perform the anti-loss operation.

[0040] In this context, a pointer can be understood as a marker point in data processing, and the position pointed to by the pointer can be understood as the index identifier corresponding to the task data or task result that the pointer points to. Pointers can include execution pointers and task pointers, and both the client and server have these two types of pointers. An execution pointer can point to the index identifier where data is lost, and a task pointer can point to the index identifier of the last task data in a sequence of ordered task data.

[0041] For example, such as Figure 2 As shown in the figure, the task execution pointer and the task pointer are displayed in the server or client. The index of the task execution pointer is 3, and the index of the task pointer is 7. Assuming no data loss, the data in the server and client and the positions pointed to by the two pointers are the same.

[0042] It is understandable that the task pointer and execution pointer can form a sliding window, which can be composed of index identifiers between the task pointer and the execution pointer. The size of the sliding window is jointly determined by the positions pointed to by the task pointer and the execution pointer. When the positions pointed to by the task pointer and / or the execution pointer change, the size of the sliding window changes. Before the position pointed to by the execution pointer, the task data and task results are consistent between the server and the client, and there is no loss problem. However, the task data between the positions pointed to by the execution pointer and the task pointer are consistent between the server and the client, but the task results are not consistent between the server and the client, and there is a loss problem.

[0043] Specifically, after the server sends multiple task data to the client, the client can execute the tasks within those tasks to obtain multiple task results, and then feed these results back to the server. The server then performs a task loss prevention operation by adjusting the positions of its own and the client's task pointers and execution pointers after data transmission. The client's pointer adjustment can be performed by the server after sending the loss prevention data. The task loss prevention operation can be understood as preventing data loss during task execution between the server and client. In this embodiment, the task loss prevention operation includes both loss prevention for task data transmission and loss prevention for task result transmission.

[0044] For example, Figure 3 A flowchart illustrating another task scheduling method provided in this disclosure embodiment is shown below. Figure 3 As shown, in some embodiments, when the task loss prevention operation includes a task data transmission loss prevention operation, and the task pointer includes a first task pointer on the client and a second task pointer on the server, step 102 above may include the following steps:

[0045] Step 301: Obtain the first index identifier sent by the client after receiving multiple task data. The first index identifier is the index identifier pointed to by the client's first task pointer.

[0046] Here, the first task pointer can be a task pointer in the client, and the first index identifier can be the index identifier of the last task data among multiple sequentially ordered task data in the client pointed to by the first task pointer. The first index identifier changes as the number of task data in the client increases. For example, if the client includes 5 task data, the first 4 task data are ordered, and the index identifier of the 5th task data is 6, then the first task pointer points to the index identifier of the 4th task data, that is, the first index identifier is 4.

[0047] Specifically, when the task loss prevention operation is a task data transmission loss prevention operation, after the server sends multiple task data to the client, the client can sort and store the received multiple task data in order, and identify the index identifier of the last task data in the sorted multiple task data. The identification process can be that the first task pointer is moved from the task data with index identifier 1 according to the sorting order, until the sorting order is interrupted and then it stops. At this time, the first task pointer points to the last task data in the sorted multiple task data. The index identifier of the last task data is determined as the first index identifier and sent to the server; the server can receive the first index identifier.

[0048] Step 302: Based on the comparison result between the second index identifier pointed to by the second task pointer and the first index identifier, send anti-loss data to the client so that the client moves the position pointed to by the first task pointer and performs anti-loss operation for task data transmission.

[0049] The second task pointer can be a task pointer in the server, and the second index identifier can be the index identifier of the last task data among multiple sequentially ordered task data in the server pointed to by the second task pointer. The second index identifier changes as the number of task data in the server increases.

[0050] In this embodiment of the disclosure, based on the comparison result between the second index identifier pointed to by the second task pointer and the first index identifier, anti-loss data is sent to the client to cause the client to move the position pointed to by the first task pointer and perform anti-loss operation for task data transmission. This includes: comparing the first index identifier with the second index identifier; when the comparison result is that the second index identifier is different from the first index identifier, the task data after the first index identifier is sent to the client as anti-loss data, so that the client moves the position pointed to by the first task pointer according to the arrangement order of multiple task data until the first index identifier and the second index identifier are the same.

[0051] Specifically, after obtaining the client's first index identifier, the server compares it with the second index identifier. If the comparison result shows that the first index identifier and the second index identifier are different, it can be determined that there is a data loss problem in the task data transmission. The task data after the first index identifier can be resent to the client as loss-prevention data. When the client receives the task data after the first index identifier, it can store it according to the index identifier order, storing the lost task data and discarding duplicate task data. Then, it continues to move the position pointed to by the first task pointer from the first index identifier according to the sorting order of multiple task data until the sorting order is broken, at which point it stops and sends the first task identifier of the new first task pointer to the server. The server compares the new first index identifier with the second index identifier again until the first index identifier and the second index identifier are the same. At this point, the client receives all the task data sent by the server, and there is no data loss problem.

[0052] For example, Figure 4 A schematic diagram illustrating the adjustment of the target position of a task pointer provided in an embodiment of this disclosure, as shown below. Figure 4 As shown in the figure, the process of preventing data loss in task transmission is achieved by adjusting the position of the client's task pointer. In the figure, the first index is 7 and the second index is 9. The server determines that there is a loss problem and resends the task data of 8 and 9 after 7 to the client. After receiving the task data of 8 and 9, the client first stores the task data of 8. When storing the task data of 9, it is determined that it is a duplicate. At this time, the task data of 9 can be discarded, and the client continues to move the first task pointer from 7 until it stops at 9. At this time, the first index is 9, which is the same as the second index, so it is determined that all task data has been successfully transmitted and there is no loss problem.

[0053] Optionally, when the client already contains task data, the first index identifier can be added to the task retrieval request in step 101 and sent to the server. The server can extract the first index identifier from the task retrieval request. When the server determines that the first index identifier and the second index identifier are the same, it can determine that the task data in the client and the server are consistent, and can respond to the task retrieval request by sending all the task data after the second index identifier to the client. When the server determines that the first index identifier and the second index identifier are different, it can respond to the task retrieval request by sending all the task data after the second index identifier to the client after performing the above anti-loss operation to determine that the first index identifier and the second index identifier are the same.

[0054] In the above solution, the task data transmission loss prevention operation can be achieved by comparing the index identifiers corresponding to the task pointers between the server and the client, and re-sending the data and adjusting the position of the task pointer on the client according to the comparison result until the index identifiers pointed to by the task pointers on the server and the client are the same. This solves the problem of task data loss during transmission.

[0055] For example, Figure 5 A flowchart illustrating another task scheduling method provided in this disclosure is shown below. Figure 5 As shown, in some embodiments, when the task loss prevention operation includes a task result transmission loss prevention operation, and the execution pointer includes a first execution pointer on the server and a second execution pointer on the client, step 102 above may include the following steps:

[0056] Step 501: Obtain the results of multiple tasks after the client executes multiple task data.

[0057] Specifically, when the task loss prevention operation is for preventing the transmission of task results, after the server sends multiple task data to the client, the client can execute the tasks based on the multiple task data, obtain multiple task results, and send these results back to the server. The server can then retrieve all the task results. However, due to network or device issues, task result transmission may result in data loss, and the server may not receive all the task results.

[0058] Optionally, the task corresponding to the task data can be determined according to the actual situation. For example, the task can be to display an image or perform an image sharing.

[0059] Step 502: Move the first execution pointer according to the results of multiple tasks and determine the third index identifier.

[0060] Here, the first execution pointer can be the execution pointer in the server, and the third index identifier can be the index identifier in the server pointed to by the first execution pointer where data is lost. Here, data loss can refer to the loss of task results.

[0061] In this embodiment of the disclosure, moving the first execution pointer according to multiple task results and determining the third index identifier may include: marking each task data according to the multiple task results, and moving the position pointed to by the first execution pointer according to the order of the multiple task data; when the first execution pointer moves to the task data that lacks a result mark, it stops moving, and the index identifier of the task data that lacks a result mark is determined as the third index identifier.

[0062] Specifically, after receiving multiple task results, the server can mark each task result under its corresponding task data. Then, following the order of the task data, it moves the first execution pointer starting from the task data with the smallest index. When the first execution pointer points to each task data, it checks if a task result has been marked. If so, it continues moving until the server determines that a task data lacks a result mark. At this point, the first execution pointer stops moving and points to the index of the task data lacking a result mark; this index is the third index. Optionally, even if the server receives task results from task data after the third index, it only marks the task result under the corresponding task data and does not move the first execution pointer further.

[0063] Step 503: Return the received result data, including the third index identifier, to the client as anti-loss data, so that the client moves the position pointed to by the second execution pointer and performs the anti-loss operation for the transmission of task results.

[0064] The result reception data can be understood as the server's feedback data on whether it has received all the task results sent by the client. This result reception data may include the aforementioned third index identifier and other task results and result marking information.

[0065] In this embodiment of the disclosure, returning the received result data including the third index identifier as anti-loss data to the client, so that the client moves the position pointed to by the second execution pointer to perform the anti-loss operation of task result transmission, may include: returning the received result data including the third index identifier to the client, so that the client moves the position pointed to by the second execution pointer according to the received result data, stopping when it reaches the third index identifier and resending the task result of the task data corresponding to the third index identifier to the server; receiving the task result corresponding to the third index identifier, marking the result, and continuing to move the position pointed to by the first execution pointer until the first execution pointer points to the index identifier of the last task data, and the second execution pointer also points to the index identifier of the last task data at this time.

[0066] The second execution pointer can be the execution pointer in the client, and the location pointed to by the second execution pointer can be the index identifier of data loss in the client. Here, data loss can refer to the loss of the aforementioned marker information.

[0067] After determining the third index identifier, the server can send the received result data, including the third index identifier and marking information, to the client as loss-prevention data. The client can move the second execution pointer according to the order of the received result data, starting from the task data with the smallest index identifier. When the second execution pointer points to each task data, it checks if it has marking information. If so, it continues moving until the client reaches the task data corresponding to the third index identifier, which lacks marking information. At this point, the second execution pointer stops moving and points to the third index identifier of the task data lacking marking information. The client determines that the task result for the task data corresponding to the third index identifier was not successfully sent and can resend the task result to the server. After receiving the task result corresponding to the third index identifier, the server marks the task result under the corresponding task data and continues moving the first execution pointer until it points to the index identifier of the last task data in the server, confirming that all task data has a result. The server then sends the marking information of the third index identifier back to the client. The client also continues moving the second execution pointer until it points to the index identifier of the last task data. The client can then confirm that all task results were successfully sent and there is no task result loss issue.

[0068] For example, Figure 6 A schematic diagram illustrating the adjustment of the pointer's position according to an embodiment of this disclosure is shown below. Figure 6 As shown in the diagram, the process of preventing task result transmission loss is achieved by adjusting the execution pointer positions of the server and client. In the diagram, the third index identifier determined by the server is 4. The task result at index 4 is lost, while the results of other tasks are marked. The client can resend the task result at index 4 to the server. The server receives the task result at index 4, marks it as received, and modifies the position of index 4 in the diagram to indicate whether the client's result has been received. Then, it sends the mark information of index 4 back to the client. The client modifies the position of index 4 in the diagram to indicate whether the server's mark information has been received. After a period of time, the positions of the first execution pointer of the server and the second execution pointer of the client are both moved to index 9, which means that all task results have been successfully transmitted and there is no loss problem.

[0069] In the above scheme, for the task result transmission prevention operation in the task loss prevention operation, the server can determine the index identifier corresponding to the execution pointer and send it to the client. The client then resends the lost task results under the index identifier until the execution pointers of both the server and the client point to the last task data, thus realizing the prevention of task result loss and solving the problem of task result loss during transmission.

[0070] The task scheduling scheme provided in this disclosure involves the server responding to a client's task retrieval request by sending multiple task data to the client. These task data are sequentially ordered and stored on both the server and client, with each task data having a unique index identifier. By adjusting the pointer position on the server and sending anti-loss data to the client to prompt the client to adjust its pointer position, a task loss prevention operation is performed. The pointers include an execution pointer and a task pointer. The execution pointer points to the index identifier where data loss occurred, and the task pointer points to the index identifier of the last task data in the sequentially ordered set. By employing this technical solution, based on the sequential ordering and storage of task data on both the server and client, adjusting the positions of the execution pointer and task pointer during data transmission enables task loss prevention, effectively solving the problem of data loss during transmission and preventing duplicate task execution. This reduces the server's workload and bandwidth consumption, and sequential data storage helps improve data retrieval speed.

[0071] In some embodiments, the task scheduling method may further include: compressing data for multiple task data by saving the index identifiers and offsets of at least a portion of the task data, wherein the at least a portion of the task data includes the last task data in a plurality of sequentially ordered task data.

[0072] The task data includes at least the last task data in a sequence of ordered task data. The specific number and selection of the remaining task data can be determined based on actual circumstances, and this embodiment does not impose any limitations on this. The offset can be the specific offset of the current task data relative to the first task data in the compressed task data.

[0073] Specifically, after performing the aforementioned task loss prevention process, when saving data from multiple tasks, the server can save only the index identifiers and offsets of at least a portion of the task data, thus achieving data compression. Subsequently, the data can be quickly replayed using the index identifiers and offsets. It is understandable that the server can also use the above method to compress data when storing results from multiple tasks, and the client can also use the above method to compress data when storing data from multiple tasks and results from multiple tasks.

[0074] For example, Figure 7 This is a schematic diagram illustrating a data compression method provided in an embodiment of the present disclosure, such as... Figure 7As shown in the figure, the data compression process can be included. The data can include task data, task results, or other sequentially arranged data. Before compression, the data can include 5 sequentially arranged data. After compression, only the index identifier and index identifier offset of the 2nd and 5th task data are saved. In the figure, index represents the index identifier and offset represents the index identifier offset. The 2nd data is used to compress the two data 1-2, with an index identifier of 2 and an index identifier offset of 2. The 5th data is used to compress the three data 3-5, with an index identifier of 5 and an index identifier offset of 3 relative to the 3rd data.

[0075] In actual server-side and client-side applications, if data is allowed to grow indefinitely, it takes a long time to replay during a restart, thus affecting availability. The embodiments disclosed in this disclosure can achieve data compression by saving only the index identifier and offset of a portion of the data, so that data can be replayed quickly later, improving availability.

[0076] In some embodiments, the client can execute multiple task data in a pre-arranged order or in parallel, and the client performs a deletion operation after receiving the tagging information for the results of multiple tasks from the server. That is, the client can execute tasks corresponding to multiple task data in a sequential or parallel manner; and if the client wants to delete a task result, it can only do so after the server returns the tagging information; otherwise, the task result is saved, avoiding the situation where different result data is generated due to repeated task execution. For example, see... Figure 7 Before receiving the tag information 4, the client can only delete the task results 1-3.

[0077] This solution addresses data loss by sequentially storing tasks and controlling the pointer positions on both the server and client sides. Specifically, it ensures that task data sent by the server is not lost, and that task results returned by the client are not lost. This solution offers the following advantages: First, the server can more easily identify which task data is lost, effectively guaranteeing no data loss during task delivery. Second, the server and client task execution are decoupled. The server only needs to be concerned with whether result data has been received and whether sent task data has been lost; whether tasks need to be repeated and whether results need to be repeatedly reported are precisely managed by the client. This avoids duplicate task execution and reduces server load and network bandwidth consumption. Furthermore, the sequential data storage method on both the server and client sides facilitates faster replay of task data later.

[0078] Figure 8 This is a schematic diagram of a task scheduling device provided in an embodiment of the present disclosure. The device can be implemented by software and / or hardware, and is generally integrated into an electronic device.Figure 8 As shown, the device is located on the server side and includes:

[0079] The data sending module 801 is used to send multiple task data to the client in response to the client's task retrieval request. The multiple task data are ordered and stored sequentially in the server and the client, and each task data has a unique index identifier.

[0080] The anti-loss module 802 is used to adjust the pointer position of the server and send anti-loss data to the client so that the client adjusts its pointer position and performs task anti-loss operation. The pointer includes an execution pointer and a task pointer. The execution pointer points to the index identifier of the data loss and the task pointer points to the index identifier of the last task data in the sequentially ordered multiple task data.

[0081] Optionally, the task loss prevention operation includes a task data transmission loss prevention operation, the task pointer includes a first task pointer of the client and a second task pointer of the server, and the loss prevention module 802 includes:

[0082] The first identification unit is used to obtain a first index identifier sent by the client after receiving the multiple task data, wherein the first index identifier is the index identifier pointed to by the client's first task pointer;

[0083] The first processing unit is configured to send anti-loss data to the client based on the comparison result between the second index identifier pointed to by the second task pointer and the first index identifier, so that the client moves the position pointed to by the first task pointer and performs an anti-loss operation for task data transmission.

[0084] Optionally, the first processing unit is used for:

[0085] The first index identifier is compared with the second index identifier. If the comparison result is that the second index identifier is different from the first index identifier, the task data after the first index identifier is sent to the client as anti-loss data, so that the client moves the position pointed to by the first task pointer according to the arrangement order of the multiple task data until the first index identifier is the same as the second index identifier.

[0086] Optionally, the task loss prevention operation includes a task result transmission loss prevention operation, the execution pointer includes a first execution pointer on the server and a second execution pointer on the client, and the loss prevention module 802 includes:

[0087] The result unit is used to obtain multiple task results after the client executes the multiple task data;

[0088] The second identification unit is used to move the first execution pointer according to the results of the multiple tasks and determine the third index identifier;

[0089] The second processing unit is used to return the received result data, including the third index identifier, to the client as anti-loss data, so that the client moves the position pointed to by the second execution pointer and performs the anti-loss operation for the transmission of task results.

[0090] Optionally, the second identification unit is used for:

[0091] Each task data is marked according to the results of the multiple tasks, and the position of the first execution pointer is moved according to the order of the multiple task data.

[0092] When the first execution pointer moves to task data that lacks a result marker, it stops moving and the index identifier of the task data that lacks a result marker is determined as the third index identifier.

[0093] Optionally, the second processing unit is used for:

[0094] The result receiving data, including the third index identifier, is returned to the client, so that the client moves the position pointed to by the second execution pointer according to the result receiving data, stops when it moves to the third index identifier, and sends the task result of the task data corresponding to the third index identifier to the server.

[0095] The task result corresponding to the third index identifier is received and marked as a result. The position of the first execution pointer is moved until the first execution pointer points to the index identifier of the last task data. At this time, the second execution pointer also points to the index identifier of the last task data.

[0096] Optionally, the apparatus further includes a data receiving module, configured to: before sending multiple task data to the server in response to a task retrieval request from a client,

[0097] Retrieve multiple task requests and generate corresponding task data;

[0098] According to the receiving time and / or priority of each task request, the multiple task data are sorted and stored sequentially, and a unique index identifier is set for each task data according to the sorting result.

[0099] Optionally, the device further includes a data compression module for:

[0100] For the multiple task data, data compression is performed by saving the index identifier and offset of at least a portion of the task data, wherein the at least a portion of the task data includes the last task data in the multiple sequentially ordered task data.

[0101] The task scheduling device provided in this disclosure can execute the task scheduling method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0102] This disclosure also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the task scheduling method provided in any embodiment of this disclosure.

[0103] Figure 9 This is a schematic diagram of an electronic device provided in an embodiment of the present disclosure. See below for details. Figure 9 The diagram illustrates a structural schematic suitable for implementing the electronic device 900 in the embodiments of this disclosure. The electronic device 900 in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0104] like Figure 9 As shown, electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 901, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 902 or a program loaded from storage device 908 into random access memory (RAM) 903. RAM 903 also stores various programs and data required for the operation of electronic device 900. Processing device 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.

[0105] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0106] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the task scheduling method of embodiments of this disclosure.

[0107] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0108] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0109] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0110] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: respond to a client's task retrieval request by sending multiple task data to the client, wherein the multiple task data are sequentially ordered and stored in the server and the client, and each task data has a unique index identifier; and perform a task loss prevention operation by adjusting the pointer position of the server and sending anti-loss data to the client to cause the client to adjust its pointer position, wherein the pointer includes an execution pointer and a task pointer, the execution pointer pointing to the index identifier of data loss, and the task pointer pointing to the index identifier of the last task data in the sequentially ordered multiple task data.

[0111] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0112] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0113] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.

[0114] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0115] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction 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 be, 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 machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0116] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0117] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0118] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A task scheduling method, characterized by, The application is applied to a server, comprising: sending a plurality of task data to a client in response to a task pulling request of the client, wherein the plurality of task data is sequentially arranged and stored in the server and the client, and each of the task data has a unique index identifier; performing a task loss prevention operation by adjusting a pointer pointing position of the server and sending loss prevention data to the client to make the client adjust the pointer pointing position of the client, wherein the pointer comprises an execution pointer and a task pointer, the execution pointer points to an index identifier of data loss, the task pointer points to an index identifier of a last task data in the sequentially arranged plurality of task data, and the task loss prevention operation comprises a loss prevention operation of task data transmission and a loss prevention operation of task result transmission.

2. The method of claim 1, wherein, When the task loss prevention operation comprises the loss prevention operation of task data transmission, the task pointer comprises a first task pointer of the client and a second task pointer of the server, and the performing of the task loss prevention operation by adjusting the pointer pointing position of the server and sending the loss prevention data to the client to make the client adjust the pointer pointing position of the client comprises: obtaining a first index identifier sent by the client after receiving the plurality of task data, wherein the first index identifier is an index identifier pointed by the first task pointer; sending loss prevention data to the client according to a comparison result between a second index identifier pointed by the second task pointer and the first index identifier, to make the client move a pointing position of the first task pointer and perform the loss prevention operation of task data transmission.

3. The method of claim 2, wherein, The sending of the loss prevention data to the client according to the comparison result between the second index identifier pointed by the second task pointer and the first index identifier, to make the client move the pointing position of the first task pointer and perform the loss prevention operation of task data transmission, comprises: comparing the first index identifier with the second index identifier, when the comparison result is that the second index identifier is different from the first index identifier, sending task data after the first index identifier to the client as the loss prevention data, to make the client move the pointing position of the first task pointer according to an arrangement order of the plurality of task data until the first index identifier is the same as the second index identifier.

4. The method of claim 1, wherein, When the task loss prevention operation comprises the loss prevention operation of task result transmission, the execution pointer comprises a first execution pointer of the server and a second execution pointer of the client, and the performing of the task loss prevention operation by adjusting the pointer pointing position of the server and sending the loss prevention data to the client to make the client adjust the pointer pointing position of the client comprises: obtaining a plurality of task results after the client performs the plurality of task data; moving the first execution pointer according to the plurality of task results, and determining a third index identifier; returning, to the client, result receiving data including the third index identifier as anti-loss data to make the client move a pointing position of a second execution pointer and perform an anti-loss operation of task result transmission.

5. The method of claim 4, wherein, According to the plurality of task results, the first execution pointer is moved, and a third index identifier is determined, including: According to the plurality of task results, each of the task data is marked with a result, and the first execution pointer is moved in a pointing position according to the arrangement order of the plurality of task data; When the first execution pointer moves to task data lacking a result mark, the moving is stopped, and an index identifier of the task data lacking the result mark is determined as the third index identifier.

6. The method of claim 4, wherein, According to the plurality of task results, each of the task data is marked with a result, and the first execution pointer is moved in a pointing position according to the arrangement order of the plurality of task data; According to the plurality of task results, each of the task data is marked with a result, and the first execution pointer is moved in a pointing position according to the arrangement order of the plurality of task data; Before sending the plurality of task data to the server in response to a task pulling request of the client, the method further includes:

7. The method of claim 1, wherein, Obtaining a plurality of task requests and generating a plurality of corresponding task data; According to the receiving time and / or priority of each of the task requests, the plurality of task data is sequentially sorted and stored, and a unique index identifier is set for each of the task data according to the sorting result. The method further includes:

8. The method of claim 1, wherein, For the plurality of task data, data compression is performed by saving at least part of the index identifier and offset of the task data, the at least part of the task data including the last task data in the plurality of task data sorted in sequence. The method further includes:

9. A task scheduling apparatus characterized by comprising: A data sending module is arranged in the server, configured to send a plurality of task data to the client in response to a task pulling request of the client, wherein the plurality of task data is sequentially sorted and stored in the server and the client, and each of the task data has a unique index identifier. An anti-loss module is arranged in the server, configured to perform a task anti-loss operation by adjusting a pointing position of a pointer of the server and sending anti-loss data to the client to make the client adjust a pointing position of a pointer of the client, the pointer including an execution pointer and a task pointer, the execution pointer pointing to an index identifier of data loss, the task pointer pointing to an index identifier of the last task data in the plurality of task data sorted in sequence, and the task anti-loss operation including an anti-loss operation of task data transmission and an anti-loss operation of task result transmission. The electronic device includes:

10. An electronic device, comprising: a processor; ​ a memory for storing the processor-executable instructions; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the task scheduling method according to any one of claims 1-8.

11. A computer readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is configured to execute the task scheduling method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Data retransmission method and system, network adapter, device, server and storage medium

    CN111786748A