CN116166408A - Task processing method and device, electronic equipment and storage medium - Google Patents

Task processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116166408A
CN116166408A CN202111412864.0A CN202111412864A CN116166408A CN 116166408 A CN116166408 A CN 116166408A CN 202111412864 A CN202111412864 A CN 202111412864A CN 116166408 A CN116166408 A CN 116166408A
Authority
CN
China
Prior art keywords
processed
subtask
data volume
data
subtasks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111412864.0A
Other languages
Chinese (zh)
Inventor
贺彬彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Wuhan Kingsoft Office Software Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Wuhan Kingsoft Office Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd, Wuhan Kingsoft Office Software Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN202111412864.0A priority Critical patent/CN116166408A/en
Publication of CN116166408A publication Critical patent/CN116166408A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention relates to a task processing method, a task processing device, electronic equipment and a storage medium. The task processing method comprises the following steps: acquiring each subtask to be processed of a first task; for each subtask to be processed, determining the current priority corresponding to the subtask to be processed; the current priority is generated based on the data quantity to be processed of the subtask to be processed and/or the time consumption of the data quantity to be processed of the subtask to be processed; and processing the subtasks to be processed according to the sequence of the current priorities of the subtasks to be processed. According to the embodiment of the invention, the processing time of each subtask to be processed is reasonably distributed, the user does not need to manually follow the processing progress of the subtask to be processed, and the use convenience experience of the user is improved.

Description

Task processing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a task processing method, a task processing device, electronic equipment and a storage medium.
Background
In daily study, life and work, users often use terminal devices to perform task processing. Taking a processing task as an example of translating data in a plurality of documents (e.g., text documents, form documents, presentation documents, documents in a portable document format, etc.), the plurality of documents are generally processed one by one. If the previously processed document is time consuming, then it also takes a longer time to post-queue the document to be processed, which results in a longer user waiting time. It can be known that, in the related art, the task processing time is not reasonably allocated, and the user needs to manually follow up the task data processing progress. Resulting in a reduced user convenience experience for the user.
Disclosure of Invention
The embodiment of the invention aims to provide a task processing method, a device, electronic equipment and a storage medium, so as to solve the technical problem of unreasonable processing time allocation of processing tasks in the related technology. The specific technical scheme is as follows:
according to a first aspect of the present invention, there is provided a task processing method, comprising:
acquiring each subtask to be processed of a first task;
for each subtask to be processed, determining a current priority corresponding to the subtask to be processed, wherein the current priority is generated based on the data quantity to be processed of the subtask to be processed and/or the time consumption duration of the data quantity to be processed of the subtask to be processed;
and processing the subtasks to be processed according to the sequence of the current priorities of the subtasks to be processed.
Optionally, the determining the current priority corresponding to the subtask to be processed includes:
generating a first priority identifier of the data volume to be processed of the subtask to be processed according to the first time consumption duration, the second time consumption duration and the initial priority identifier of the data volume to be processed of the subtask to be processed;
and determining the current priority identification of the data quantity to be processed of the subtask to be processed through the first priority identification.
Optionally, the determining, by using the first priority identifier, the current priority identifier of the to-be-processed data volume of the to-be-processed subtask includes:
acquiring a priority identification threshold;
comparing the first priority identification with the priority identification threshold;
taking the first priority identifier as a current priority identifier under the condition that the first priority identifier is smaller than the priority identifier threshold value;
and taking the priority identification threshold value as the current priority identification under the condition that the first priority identification is larger than the priority identification threshold value.
Optionally, the method further comprises:
determining a second consumption duration of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed; or alternatively, the process may be performed,
and determining a second time consumption of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed and the total data volume of the subtask to be processed.
Optionally, the method further comprises:
generating an initial priority identification of the data volume to be processed of the subtask to be processed according to the serial number identification of the data volume to be processed of the subtask to be processed in the subtask to be processed;
And under the condition that the first condition is met, processing the to-be-processed data volume blocks of the to-be-processed subtask according to the ordering of the initial priority identifiers of the to-be-processed data volume blocks of the to-be-processed subtask.
Optionally, the method further comprises:
updating the current priority of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed and the first consumption time length of the data volume to be processed of the subtask to be processed; or alternatively, the process may be performed,
and updating the current priority of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed, the total data volume of the subtask to be processed and the first consumption duration of the data volume to be processed of the subtask to be processed.
Optionally, the acquiring each sub-task to be processed of the first task includes:
dividing the subtask to be processed into at least one data volume block according to the first data volume, and obtaining the divided data volume block as the data volume block to be processed.
Optionally, the processing the subtasks to be processed according to the order of the current priorities of the subtasks to be processed includes:
acquiring a current priority identification of the subtask to be processed;
Sorting the current priority identifiers of the subtasks to be processed according to the identifier values, and setting the processing order of the data quantity to be processed of the subtasks to be processed, which corresponds to the current priority identifier which is sorted in the relative first position, as a first order; setting the processing order of the data quantity to be processed of the subtasks to be processed, which corresponds to the current priority identification of the relative secondary bit, as a second order;
and after the processing of the data quantity to be processed of the subtasks to be processed, which is set to the first order, is finished, processing the data quantity to be processed of the subtasks to be processed, which is set to the second order.
According to a second aspect of the present invention, there is provided a task processing device comprising:
the acquisition module is used for acquiring each subtask to be processed of the first task;
the determining module is used for determining the current priority corresponding to each sub-task to be processed, wherein the current priority is generated based on the data quantity to be processed of the sub-task to be processed and/or the time consumption of the data quantity to be processed of the sub-task to be processed;
and the processing module is used for processing the subtasks to be processed according to the sequence of the current priorities of the subtasks to be processed.
According to a third aspect of the present invention there is provided an electronic device comprising a memory for storing a computer program and a processor; the processor is configured to execute the computer program to implement the task processing method according to any one of the first aspects of the present invention.
According to a fourth aspect of the present invention, there is provided a computer-readable storage medium storing a computer program readable by a computer for executing the task processing method according to any one of the first aspects of the present invention when the computer program is read and executed by the computer.
According to the embodiment of the invention, each subtask to be processed of the first task is obtained; for each subtask to be processed, determining the current priority corresponding to the subtask to be processed; the current priority is generated based on the amount of data to be processed of the subtask to be processed and/or based on the time duration of consumption of the amount of data to be processed of the subtask to be processed; and processing the subtasks to be processed according to the sequence of the current priorities of the subtasks to be processed. In this way, the corresponding current priority can be determined for the subtasks to be processed in real time according to the data volume to be processed and/or the consumed time length of the subtasks to be processed, and the subtasks to be processed are processed sequentially according to the sequence of the values of the current priority identifiers of the subtasks to be processed. Under the condition of updating the current priority, adaptively updating the processing sequence of the subtasks to be processed, so as to adjust the processing sequence of the subtasks to be processed. And in the process of processing a plurality of subtasks to be processed, different subtasks to be processed exist in the processing queue, the current priorities of the subtasks to be processed are updated in real time, when the subtasks to be processed are processed according to the sequence of the current priorities, instead of waiting for the other subtask to be processed after all the subtasks to be processed are processed, so that the processing time of each subtask to be processed is reasonably distributed, the processing progress of the subtasks to be processed is not required to be manually followed by a user, and the convenience and experience of the user are improved.
Other features of the present invention and its advantages will become apparent from the following detailed description of exemplary embodiments of the invention, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a hardware configuration diagram of an electronic device according to one embodiment;
FIG. 2 is a flow diagram of a task processing method according to one embodiment;
FIG. 3 is a flow diagram of a first task divided into subtasks to be processed according to one embodiment;
FIG. 4 is a functional block diagram of a task processing device according to one embodiment.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless it is specifically stated otherwise.
The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of exemplary embodiments may have different values.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
< hardware configuration >
Fig. 1 is a schematic diagram of a composition structure of an electronic device 1000 to which a task processing method according to an embodiment of the present invention can be applied.
In this embodiment, the electronic device includes a memory for storing a computer program and a processor for executing the computer program to implement a task processing method provided by the present invention.
As shown in fig. 1, the electronic device 1000 may include a processor 1100, a memory 1200, and a computer program (not shown) stored in the memory 1200 and capable of running on the processor 1100, where the processor 1100 implements a task processing method provided by the present invention when executing the computer program.
In this embodiment, the electronic device 1000 may be any terminal device capable of processing tasks, such as a smart phone, a mobile phone, a tablet computer, a palm computer, a desktop computer, a notebook computer, and the like.
In addition to the processor 1100, the memory 1200 and the computer program, the electronic device 1000 comprises an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker (not shown in the figure) and a microphone (not shown in the figure). The processor 1100 may be a central processing unit (central processing unit, CPU), a graphics processor (graphics processing unit, GPU), a microprocessor/micro control unit (Microcontroller Unit, MCU), etc. for executing a computer program written in an instruction set of architecture such as x86, advanced reduced instruction set processor (Advanced RISC Machines, arm), reduced instruction set computer (Reduced Instruction Set Computer, RISC), single word length fixed point instruction average execution speed (Microprocessor without interlocked piped stages, MIPS), internet data stream single instruction sequence extension (Streaming SIMD Extensions, SSE). The Memory 1200 includes, for example, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), nonvolatile Memory, and the like. The interface device 1300 includes, for example, a Universal Serial Bus (USB) interface, a serial interface, a parallel interface, and the like. The communication device 1400 can perform wired communication using an optical fiber or a cable, or perform wireless communication, for example, and specifically can include WiFi communication, bluetooth communication, 2G/3G/4G/5G communication, and the like. The display device 1500 is, for example, a liquid crystal display, a touch display, or the like. The input device 1600 may include, for example, a touch screen, keyboard, mouse, somatosensory input, and the like. The speaker is used for outputting audio signals. The microphone is used for collecting audio signals.
The memory 1200 of the electronic device 1000 is used for storing a computer program for controlling the processor 1100 to operate to implement the document processing method according to the embodiment of the present invention. The skilled person can design the computer program according to the embodiments described in the present invention. How the computer program controls the processor to operate is well known in the art and will not be described in detail here. The electronic device 1000 may be installed with an intelligent operating system (e.g., windows, linux, android, IOS) and application software (e.g., text documents, form documents, presentation documents, documents in portable document format).
It will be appreciated by those skilled in the art that although a plurality of devices of the electronic device 1000 are shown in fig. 1, the electronic device 1000 of an embodiment of the present invention may involve only some of the devices thereof, for example, only the processor 1100 and the memory 1200.
It should be noted that, the task processing method provided by the present invention may be executed by a client (terminal device) or may be executed by a server (server). The following description will take the above task processing method executed by the server as an example.
Various embodiments and examples according to the present invention are described below with reference to the accompanying drawings.
< method >
As shown in fig. 2, the task processing method of the present embodiment may include steps 2100 to 2300:
the invention provides a task processing method, which comprises the following steps:
step 2100: acquiring each subtask to be processed of a first task;
step 2200: for each subtask to be processed, determining the current priority corresponding to the subtask to be processed, wherein the current priority is generated based on the data quantity to be processed of the subtask to be processed and/or the time consumption of the data quantity to be processed of the subtask to be processed;
step 2300: and processing the subtasks to be processed according to the sequence of the current priorities of the subtasks to be processed.
The task refers to an object for which the server responds to the processing instruction. The object may be a text document, a form document, a presentation document, a portable document format document, etc. The processing instruction may be issued by the terminal device, i.e. the communication procedure of the processing instruction is: and generating a processing instruction by the terminal equipment, and then sending the processing instruction to the server.
In the embodiment of the invention, the first task comprises a plurality of subtasks to be processed, and each subtask to be processed of the first task is obtained, namely, the data content of each subtask to be processed is obtained. The data content refers to the content of words, numerals, letters, words and the like contained in each subtask to be processed. Wherein the first task is to perform a task for a plurality of documents, which may be, for example, translation. The subtasks to be processed are tasks of each document to be processed by the server, and the tasks may be, for example, translations.
Illustratively, where the first task is a translation task for a plurality of text documents, the subtask to be processed may refer to a translation task for one text document, one text document may contain 1 page of data content, or one text document may also contain 10 lines of data content, and so on. In the case where the first task is a translation task for a plurality of table documents, the subtasks to be processed may refer to a translation task for one table document, one table document may contain 3 data contents, or one table document may also contain 5 columns of data contents, or one table document may also contain 8 cells of data contents, or the like. The method comprises the steps of displaying data content displayed by a display interface of a client (terminal equipment) by naked eyes when a user is in a plane view, wherein the display interface normally and accurately displays the data content as a reference, and rows are areas formed by transverse lines; columns are areas of vertical lines; the form formed by the intersection of the rows and columns is a cell. In the case where the first task is a translation task for a plurality of presentation documents, the subtasks to be processed may refer to a translation task for one presentation document, one presentation document may contain 1 page of data content, or one presentation document may also contain 3 pages of data content, or one presentation document may also contain 0.5 pages of data content (i.e., half of a full page of a presentation document), and so on. In the case where the first task is a translation task for a plurality of documents in a portable document format, the subtask to be processed may refer to a translation task for one document in a portable document format, one document in a portable document format may contain 2 pages of data content, or one document in a portable document format may also contain 5 pages of data content, or the like. The above values are examples only and are not exclusive and do not constitute a limitation of the subtasks to be processed.
After each sub-task to be processed of the first task is obtained, the current priority corresponding to the sub-task to be processed is determined. The corresponding subtasks to be processed are associated with a current priority, and the current priority of the subtasks to be processed is determined according to the association relation. The current priority is a dynamic priority that is updated in real-time or periodically. Specifically, the current priority is generated based on the amount of data to be processed of the subtask to be processed and/or based on the time duration of consumption of the amount of data to be processed of the subtask to be processed.
And then, processing the subtasks to be processed according to the sequence of the current priorities of the subtasks to be processed. The processing refers to performing an output operation, a loading operation or an information conversion operation on the data content of the subtasks to be processed.
In the embodiment of the invention, the subtasks to be processed can be arranged in a queue form based on the current priority, and the subtasks to be processed are processed one by one according to the ordering of the subtasks to be processed in the queue. In addition, the subtasks to be processed can be acquired in the form of numbers based on the current priority, and the subtasks to be processed are correspondingly acquired according to the numbers and processed; after the processing is finished, the next sub-task to be processed corresponding to the next number is obtained continuously, the next sub-task to be processed is processed, and the processing is performed by analogy. The number is associated with the current priority, that is, the number is set to the current priority, and the number corresponding to the current priority can be determined by calling the current priority. Illustratively, the numbering may be numerals, letters, words, etc.
In this way, the processing sequence of the subtasks to be processed can be updated and optimized according to the current priority of the subtasks to be processed which are updated in real time or periodically. The basis for adjusting the processing sequence of the subtasks to be processed may be to set the current priority of the subtasks to be processed to be higher than the current priority of the subtasks to be processed whose data volume to be processed is small (for example, the data volume to be processed of less than 1 ten thousand characters is determined to belong to the small data volume, and the data volume to be processed of greater than or equal to 1 ten thousand characters is determined to belong to the large number). The current high-priority subtasks to be processed are processed first, namely, after the subtasks to be processed with the current high-priority subtasks are processed, the subtasks to be processed with other current priorities lower than the high current priorities are processed continuously.
In addition, the basis for adjusting the processing sequence of the subtasks to be processed may be that the current priority of the subtasks to be processed, which have small data volume to be processed and consume a long time, is set to be higher than the current priority of the subtasks to be processed, which have large data volume to be processed and consume a long time. The time consumption time length refers to the use time length from when the data volume to be processed of the subtask to be processed is added to the queue to be processed to when the data volume to be processed of the subtask to be processed is processed, or the time consumption time length refers to the time period from when the data volume to be processed of the subtask to be processed is called to when the data volume to be processed of the subtask to be processed is processed. The time immediately before the data amount to be processed of the subtask to be processed is processed, for example, the data amount to be processed of the subtask to be processed is expected to be processed at 10:05, and the time immediately before the data amount to be processed of the subtask to be processed is expected to be 10:04; the amount of data to be processed of the subtask to be processed is expected to be processed at 15 th second, and the amount of data to be processed of the subtask to be processed may be 14 th second immediately before being processed. The time-consuming period refers to a period of time in which the amount of data to be processed of the sub-task to be processed is long (e.g., a period of time in which the use period of time is less than 3 seconds is determined as a sub-task to be processed with a small time-consuming period; a period of time in which the use period of time is greater than or equal to 3 seconds is determined as a sub-task to be processed with a large time-consuming period). I.e. after the processing of the subtasks to be processed with small data volume and long time consumption is completed, the subtasks to be processed with large data volume to be processed and long time consumption are processed again. The priorities of the subtasks to be processed, which have large data volume to be processed and consume more time, small data volume to be processed and consume less time, can be set according to the demands of users.
The amount of data to be processed of the subtask to be processed is up to the amount of data to be waiting/preparing/expecting to be executed such as the translation task, and the amount of data to be processed of the subtask to be processed is not subjected to the processing such as the translation.
It should be noted that, the first task may refer to a plurality of objects, for example, the first task may refer to a plurality of text documents.
In this way, concurrent processing of multiple objects can be achieved. I.e. each sub-task to be processed is processed alternately. Illustratively, one of the subtasks to be processed includes 5-page data content and the other subtask to be processed includes 3-page data content, and after the processing (e.g., translation processing) of the 2 nd page data content of one of the subtasks to be processed is completed, the 1 st page data content, the 2 nd page data content, the 3 rd page data content of the other subtask to be processed may be processed again, and then the 3 rd page data content, the 4 th page data content, and the 5 th page data content of the one of the subtasks to be processed may be processed again.
In another exemplary embodiment, a subtask to be processed contains 5 pages of data contents, and in processing the 1 st page of data contents of a subtask to be processed, a subtask to be processed is newly added, and the subtask to be newly added contains 3 pages of data contents, in this case, since the total amount of data contents of the subtask to be newly added is smaller than that of the subtask to be processed, the priority of the data contents of the subtask to be newly added is set to be higher than that of the data contents of the subtask to be processed, and after the 1 st page of data contents of the subtask to be processed is processed, the 1 st page of data contents of the subtask to be newly added is processed. In the process of processing the 1 st page of data content of the newly added subtask to be processed, a further subtask to be processed is newly added, the newly added subtask to be processed contains 1 page of data content, in this case, the total data content of the subtask to be processed is smaller than the total data content of one subtask to be processed and is also smaller than the total data content of the subtask to be processed, so that the priority of the data content of the subtask to be processed is set to be higher than the priority of the data content of the subtask to be processed and is also higher than the priority of the data content of the subtask to be processed, then the processing priority of the remaining 4 pages of data content of the subtask to be processed and the processing priority of the remaining 2 pages of data content of the subtask to be processed are adjusted in real time/periodically, and the corresponding data content is processed page by page according to the priority sequence.
According to the embodiment of the invention, each subtask to be processed of the first task is obtained; determining the current priority corresponding to the subtasks to be processed; the current priority is generated based on the amount of data to be processed of the subtask to be processed and/or based on the time duration of consumption of the amount of data to be processed of the subtask to be processed; and processing the subtasks to be processed according to the sequence of the current priorities of the subtasks to be processed. In this way, the corresponding current priority can be determined for the subtasks to be processed in real time according to the data amount to be processed of the subtasks to be processed and/or the consumption time length of the data amount to be processed of the subtasks to be processed, and the processing can be sequentially performed according to the sequence of the current priorities of the subtasks to be processed. Under the condition of updating the current priority, adaptively updating the processing sequence of the subtasks to be processed, so as to adjust the processing sequence of the subtasks to be processed. And in the process of processing the plurality of subtasks to be processed, different subtasks to be processed exist in the processing queue, the current priorities of the subtasks to be processed are updated in real time, when the subtasks to be processed are processed according to the sequence of the current priorities, instead of waiting for the other subtask to be processed after all the subtasks to be processed are processed, so that the processing time of the subtasks to be processed is reasonably distributed, the processing progress of the subtasks to be processed is not required to be manually followed by a user, and the convenience and experience of the user are improved.
In an application scenario where multiple subtasks to be processed are concurrently processed, for example, processing is performed to translate data contents of multiple text documents, a server is required to perform translation processing on the data contents of the multiple text documents. In the embodiment of the invention, aiming at the subtask to be processed, the server can divide the subtask to be processed into a plurality of data volume blocks, then determine the corresponding current priority for the data volume blocks, and send the plurality of data volume blocks to a queue to be processed one by one for waiting to be processed. And refreshing the current priority of the subtasks to be processed in the queue to be processed in real time or periodically while processing the subtasks to be processed, and scheduling and processing the subtasks to be processed in the queue to be processed according to the sequence of the current priority.
It should be noted that the current priority of the subtask to be processed is generated based on the amount of data to be processed of the subtask to be processed and/or based on the time-consuming duration of the amount of data to be processed of the subtask to be processed. It will be understood that in the embodiment of the present invention, the smaller the amount of data to be processed of the subtasks to be processed, the faster the priority thereof increases, that is, the greater the priority, the faster the invoked process can be. Or, the longer the consumption time of the data volume to be processed of the subtask to be processed, the faster the priority thereof increases, that is, the greater the priority, the faster the invoked process can be. Alternatively, the smaller the amount of data to be processed and the longer the time spent in the queue to be processed, the faster its priority increases, i.e., the greater the priority, the faster it can be scheduled. Instead of waiting for the completion of all processing of one sub-task to be processed, the other sub-task to be processed is processed, so that the processing time of a plurality of sub-tasks to be processed is reasonably distributed, the user does not need to manually follow up the processing progress of the sub-tasks to be processed, and the convenience of use experience of the user is improved. And the processing efficiency of subtasks to be processed of the server is improved. Meanwhile, the problem that subtasks to be processed with smaller initial priority are blocked for a long time and the processing time is extremely long can be effectively solved.
Specifically, in one possible implementation manner, obtaining each sub-task to be processed of the first task includes: the electronic device 1000 or the server may divide the subtask to be processed into at least one data size block according to the first data size, and obtain the divided data size block as the data size block to be processed.
Illustratively, assume that the total amount of data input for one of the subtasks to be processed is V t Dividing the subtasks to be processed according to a first data volume v to obtain n data volume blocks T to be processed 1 ,...,T n . Specifically, the formula may be as follows: n=match t V) dividing the subtasks to be processed. After obtaining n blocks of the data amount to be processed, the electronic device 1000 or the server may divide the n blocks of the data amount to be processed into a plurality of blocks of the data amount to be processed. Specifically, taking N as an example of the preset number of to-be-processed data volume chunks included in the to-be-processed data volume chunk group, in the case of dividing N to-be-processed data volume chunks into a plurality of to-be-processed data volume chunk groups, the grouping may be specifically performed by the formula m=math.ceil (N/N). Wherein the function math.ceil represents a rounding up operation.
For example, assume that the total data volume of one subtask to be processed is V t The subtasks to be processed are divided by taking the data volume v=1ten thousand data volumes as a unit to obtain n=45 data volume blocks to be processed, and then the 45 data volume blocks to be processed are divided according to a group of 8 (n=8) data volume blocks to be processed to obtain 6 data volume block groups to be processed. In this way, the partitioned sub-tasks to be processed are divided into 6 blocks of data to be processed, and the blocks of data to be processed include 8 blocks of data to be processed.
For example, in the case where the subtasks to be processed are first grouped and then the data size blocks to be processed in the data size block group to be processed are divided, the electronic device 1000 or the server may divide the subtasks to be processed into a plurality of data size block groups to be processed; and dividing the processed data volume blocks in the to-be-processed data volume block group into a plurality of to-be-processed data volume blocks.
For example, assume that the total data amount of the input subtasks to be processed is V t First, willThe input subtask to be processed is divided into blocks according to the data volume of the data volume to be processed into V b The data are divided into m data size block groups to be processed, specifically, the data can be divided into m data size block groups according to a formula of m=math.ceil (V t /V b ) The first task is determined to be divided into m data volume chunks to be processed. Further dividing the task in the data volume block group to be processed into N data volume blocks T to be processed 1 ,...,T N Specifically, the information can be expressed by the formula n=math b V) dividing the processing data volume in the subtask to be processed into N data volume segments to be processed, wherein v represents the data volume in one data volume segment to be processed. Wherein the function math.ceil is used to represent a rounding up operation.
For example, assume that the total data size of the subtasks to be processed is V t =45 ten thousand, the block group contains 8 ten thousand (V b ) The data volume divides the subtasks to be processed into 6 (m) data volume blocks to be processed, and then the tasks in each data volume block to be processed are divided into 8 data volume blocks to be processed by taking 1 ten thousand (v) data volume as a unit. In this way, the partitioned sub-tasks to be processed are divided into 6 blocks of data to be processed, and the blocks of data to be processed include 8 blocks of data to be processed.
It can be seen that the electronic device 1000 or the server divides the subtasks to be processed first and then groups the subtasks; the sub-tasks to be processed are grouped, then the tasks in the sub-task block group to be processed are divided, the number of the obtained sub-task block group to be processed is identical to that of the obtained sub-task block group to be processed, the achieved effects are identical, and the sequence of the division and grouping is not particularly limited in the embodiment.
In one example, the current priority is generated based on the amount of data to be processed for the subtask to be processed and/or based on the time duration of consumption of the amount of data to be processed for the subtask to be processed. In this step, the electronic device 1000 or the server may calculate, for the subtask to be processed, a current priority of the subtask to be processed according to the data amount to be processed of the subtask to be processed and/or according to the duration of consumption of the data amount to be processed of the subtask to be processed.
In practical applications, the electronic device 1000 maintains a queue to be processed, divides the subtask to be processed into a plurality of data volume blocks to be processed, serially transmits the data volume blocks to be processed to the queue to be processed one by one, and sets an initial priority for each data volume block to be processed. The priority of the block group of the data quantity to be processed in the queue to be processed is calculated and refreshed in real time until the block group of the data quantity to be processed is scheduled by the processing engine for processing.
In one possible implementation, determining the current priority corresponding to the subtask to be processed includes: generating a first priority identifier of the data volume to be processed of the subtask to be processed according to the first time consumption duration, the second time consumption duration and the initial priority identifier of the data volume to be processed of the subtask to be processed; and determining the current priority identification of the data quantity to be processed of the subtask to be processed through the first priority identification. The first consumed time length refers to the waiting time length of the data volume to be processed of the subtasks to be processed in the queue to be processed. The second consumed time period refers to a processing time period of the data amount to be processed of the subtask to be processed. The initial priority identifier refers to an original priority identifier of the subtask to be processed, and the original priority identifier determines the processing sequence of each data volume block to be processed in each subtask to be processed.
The method for determining the current priority identification of the data quantity to be processed of the subtask to be processed through the first priority identification comprises the following steps: acquiring a priority identification threshold; comparing the first priority identification with a priority identification threshold; under the condition that the first priority identifier is smaller than a priority identifier threshold, the first priority identifier is used as a current priority identifier; and taking the priority identification threshold value as the current priority identification when the first priority identification is larger than the priority identification threshold value.
In an embodiment of the present invention, further comprising: generating an initial priority identification of the data volume to be processed of the subtask to be processed according to the serial number identification of the data volume to be processed of the subtask to be processed in the subtask to be processed; and under the condition that the first condition is met, the data volume blocks to be processed of the subtasks to be processed can be processed according to the ordering of the initial priority identifiers of the data volume blocks to be processed of the subtasks to be processed. The first condition means that only one sub-task to be processed is included in the first task, that is, in the case that the first task includes one sub-task to be processed, the data volume blocks to be processed of the sub-tasks to be processed are processed one by one only according to the sorting of the initial priority identifiers.
In practical application, the server side may specifically set an initial priority identifier for the data volume to be processed of the subtask to be processed according to the sequence number of the data volume to be processed of the subtask to be processed in the subtask group.
For example, the server may set the initial priority identifier P for the data amount to be processed of the subtask to be processed according to the following formula ij 0
Figure BDA0003374216630000141
Wherein i represents the data quantity to be processed of the subtask to be processed belongs to the ith subtask group, j represents the serial number of the data quantity to be processed of the subtask to be processed in the ith subtask group, and alpha E [0,1 ]]The attenuation factor is used to decrement the initial priority of the amount of data to be processed of the subtasks to be processed in the subtask group, K being a constant, K being settable by a user or acquired from the electronic device 1000.
It should be noted that, in the same subtask group, the larger the sequence number j is, the initial priority P of the data amount to be processed of the subtask to be processed ij 0 The smaller the initial priority of the data amount to be processed of the subtasks to be processed in the same subtask group is, the characteristic is that the data amount to be processed is firstly decreased and then tends to be stable at a fixed value.
The electronic device 1000 determines a second time consumption period, and may determine the second time consumption period of the data amount to be processed of the subtask to be processed according to the data amount to be processed of the subtask to be processed; or determining the second time consumption of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed and the total data volume of the subtask to be processed. The data amount to be processed refers to the data content or the number of pages of a document or the number of frames of video clips to be processed of the subtasks to be processed, and the like. The total data amount refers to the total data content of one subtask to be processed or the total number of pages of all documents or the total number of frames of all videos, etc.
In this embodiment, after the initial priority identifier is set for the subtask to be processed, the current priority identifier of the subtask to be processed is updated in real time. For example, the electronic device 1000 or the server may update the current priority of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed and the first consumption duration of the data volume to be processed of the subtask to be processed; or updating the current priority of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed, the total data volume of the subtask to be processed and the first consumption time length of the data volume to be processed of the subtask to be processed. So that the current priority of the data volume to be processed of the subtask to be processed is increased along with the increase of the time consumption in the queue to be processed, namely, the longer the waiting time of the data volume to be processed of the subtask to be processed in the queue to be processed is, the faster the current priority of the data volume to be processed of the subtask to be processed is increased to be the frequency of the higher priority level, namely, the faster the data volume to be processed of the subtask to be processed is discharged to the processing operation. Specifically, the data amount to be processed of the subtasks to be processed can be processed in descending order according to the initial priority identification from large to small; the data amount to be processed of the subtasks to be processed can be processed in ascending order according to the initial priority identification from small to large.
The second time consumption is related to the total data quantity of the subtasks to be processed, the data quantity to be processed of the subtasks to be processed and the processing capacity of the processing engine. The first consumed time period refers to a period from a time when the data amount to be processed of the subtask to be processed is put into the queue to a time immediately before processing.
For example, the electronic device 1000 determines the second time period of consumption T proc Can be according to formula T proc =∝*L ij +β*L doc Calculated, wherein, the oc represents the proportional factor of the data volume of the subtask to be processed, and the beta represents the positive data volume of the first taskRatio factor, L ij Representing the amount of data to be processed for the subtask to be processed, L doc Representing the total amount of subtasks to be processed. The total data volume proportional factor of the subtasks to be processed and the data volume proportional factor of the subtasks to be processed can be preset according to experimental data.
The electronic device 1000 may calculate the current priority identification P of the subtask to be processed according to the following formula ij
Figure BDA0003374216630000151
Wherein P is max Representing a priority identification threshold, T wait A first time consumption duration T of the data quantity to be processed of the subtask to be processed in the queue to be processed proc Representing a second time period of consumption, P ij 0 Representing an initial priority identification. f is a constant, and f may be set by a user or obtained from the electronic device 1000. And if the calculated first priority identification of the subtask to be processed is larger than the priority identification threshold, taking the priority identification threshold as the current priority identification of the subtask to be processed.
From the above formula, it can be seen that the longer the consumption time of the data volume to be processed of the subtask to be processed in the processing queue, the larger the current priority of the data volume to be processed of the subtask to be processed, so that the problem that the consumption time is extra long caused by long-time blocking of the subtask to be processed with smaller initial priority can be effectively solved. Meanwhile, the second consumed time length is generally proportional to the total data amount of the subtasks to be processed and the data amount of the subtasks to be processed, so that according to the formula, the smaller the data amount of the subtasks to be processed is, the smaller the total data amount of the subtasks to be processed is, the faster the priority of the subtasks to be processed increases, i.e. the subtasks to be processed with small data amount can be scheduled to be scheduled more quickly.
After determining the current priority identifier of the subtask to be processed, the electronic device 1000 or the server may process the subtask to be processed according to the order of the current priority identifier.
Specifically, the processing of the subtasks to be processed according to the order of the current priorities of the subtasks to be processed includes: the electronic device 1000 may obtain a current priority identification of a subtask to be processed; sequencing the current priority identifiers of the subtasks to be processed according to the identification values, and setting the processing order of the data quantity to be processed of the subtasks to be processed, which corresponds to the current priority identifiers sequenced in the relative first position, as a first order; setting the processing order of the data quantity to be processed of the subtasks to be processed corresponding to the current priority identification of the relative secondary bit as a second order; and after the processing of the data quantity to be processed of the subtasks to be processed set in the first order is finished, processing the data quantity to be processed of the subtasks to be processed set in the second order.
That is, after the update of the current priority identification, for example, after the scheduling process is performed on the amount of data to be processed of the subtask to be processed, which is originally processed in the first order, the processing order of the amount of data to be processed of the subtask to be processed, which is originally processed in the second order, is changed to the first order accordingly, that is, the processing order of the amount of data to be processed of the subtask to be processed is changed with the update of the current priority identification. The current priority identifiers of the data quantity to be processed of the subtasks to be processed are ordered according to the identification values, the data quantity to be processed of the subtasks to be processed can be ordered in the order of the current priority identifiers from small to large, and then the data quantity to be processed of the subtasks to be processed are processed one by one according to ascending order. The data amount to be processed of the subtasks to be processed can be arranged in the order of the current priority identification value from large to small, and then the data amount to be processed of the subtasks to be processed is processed one by one in the descending order. The relative first bit refers to the amount of data to be processed of the subtask to be processed corresponding to the current priority identifier arranged in the first bit according to the ordering of the values of the current priority identifiers. The first order refers to processing first. The relative secondary bit refers to the data quantity to be processed of the subtask to be processed corresponding to the next current priority identifier located in the relative primary bit. The second order refers to that after the data amount to be processed of the subtask to be processed of the first order is processed, the data amount to be processed of another subtask to be processed is processed.
In the task processing method of the embodiment, each subtask to be processed of the first task is obtained; determining a current priority identifier corresponding to a subtask to be processed; the current priority identification (the current priority is the current priority identification, and both technical characteristics refer to the current priority) is generated according to the data volume to be processed of the subtask to be processed and/or according to the consumption time length of the data volume to be processed of the subtask to be processed; and processing the subtasks to be processed according to the sequence of the values of the current priority identifiers of the subtasks to be processed. In this way, the corresponding current priority can be determined in real time for the data amount to be processed of the subtask to be processed according to the data amount to be processed of the subtask to be processed and/or the consumption time of the data amount to be processed of the subtask to be processed, and the processing can be sequentially performed according to the sequence of the values of the current priority identifiers of the subtask to be processed. Under the condition of updating the current priority, adaptively updating the processing sequence of the data quantity to be processed of the subtask to be processed, so as to adjust the processing sequence of the data quantity to be processed of the subtask to be processed. And in the process of processing the plurality of subtasks to be processed, the data amounts to be processed of different subtasks exist in the processing queue, the current priorities of the data amounts to be processed of the subtasks to be processed are updated in real time, when the data amounts to be processed of the subtasks to be processed are processed according to the sequence of the current priorities, instead of waiting for the other subtask to be processed after all the subtasks to be processed are processed, so that the processing time of the subtasks to be processed is reasonably distributed, the processing progress of the subtasks to be processed is not required to be followed manually by a user, and the convenience of use experience of the user is improved.
< example >
In the task processing method of the present embodiment, a task to be processed is taken as an example of a document to be processed. Specifically, the electronic device 1000 receives a plurality of documents to be processed, and needs to perform concurrent processing on the plurality of documents to be processed.
First, as shown in fig. 3, the electronic device 1000 divides each document input as follows:
step 3100: acquisition ofThe text content of each document is used as a text to be processed, and the text to be processed is divided to obtain n sub-texts T 1 ,T 2 ,...,T n
Step 3200: grouping n sub-texts T 1 ,T 2 ,...,T n Grouping to obtain text group B 1 ,...,B m
Step 3300: and serially transmitting different text groups of the same document to a queue to be processed.
In step 3100, the electronic device 1000 may first obtain text content of each document as text to be processed. After obtaining the text to be processed, in step 3200, the electronic device 1000 may follow the formula: n=match t Dividing the text to be processed to obtain n sub-texts T) 1 ,T 2 ,...,T n
Again, in step 3300, different text groups of the same document are serially sent to the pending queue. The electronic device 1000 pairs n sub-texts T 1 ,T 2 ,...,T n Grouping is performed. Specifically, the electronic device 1000 may determine the N sub-texts T through the formula m=math.ceil (N/N) 1 ,T 2 ,...,T n Grouping to obtain text group B 1 ,...,B m Wherein, text group B 1 Includes the sub-text T 1 ,...,T n Text group B m Includes the sub-text T j ,...,T j+N-1
The electronic device 1000 sets an initial priority identifier for the sub-text to be processed according to the above algorithm, and serially sends different text groups of the same document to the queue to be processed, which can be understood that the text groups of different documents to be processed will exist in the queue to be processed concurrently.
Specifically, the electronic device 1000 may be according to the formula
Figure BDA0003374216630000181
Setting an initial priority identification for the sub-text; wherein i represents that the sub-text belongs to the ith text group, j represents that the sub-text is the jth sub-text in the ith text group, and alpha E [0,1 ]]For initial optimizationA first-order attenuation factor.
After sending the text groups to the priority queue, the electronic device 1000 will follow the formula
Figure BDA0003374216630000182
Current priority P of real-time operator text ij The method comprises the steps of carrying out a first treatment on the surface of the Wherein P is max Representing a priority identification threshold, T wait Representing the first time spent by the sub-text in the priority queue, T proc Representing a second time duration of consumption. f is a constant, and f may be set by a user or obtained from the electronic device 1000. />
Due to the consumed time length T of the sub-text wait The longer the sub-text is, the larger the current priority of the sub-text is, so that the hunger problem caused by long-time blocking of the sub-text with small initial priority can be effectively solved. At the same time, a second time period T of consumption of the sub-text proc In general, the data size of the sub-text and the data size of the task to be processed to which the sub-text belongs are smaller as the data size of the sub-text is smaller, which is generally proportional to the text length, i.e. the text with smaller data size can be scheduled faster, thereby improving the throughput rate of the system.
In practical applications, when the electronic device 1000 processes the sub-texts, the processing is performed according to the order of the current priorities of the sub-texts in the queue to be processed. The processing of text therefore takes time in a characteristic that is proportional to the length of the text.
In this embodiment, in the case where the sub-texts are sequentially processed according to the current priority, the data content of the sub-texts may be acquired and processed. The process may be, for example, a translation process.
According to the task processing method of the embodiment, the corresponding current priority can be determined for the sub-text in real time according to the data volume and/or the consumed time length of the sub-text, and the processing can be sequentially performed according to the sequence of the current priorities of the sub-text. In the case of current priority updating, the processing sequence of the sub-text is adapted to be updated, thereby adjusting the processing sequence of the sub-text. In the process of processing a plurality of documents to be processed, the sub-texts corresponding to different documents to be processed exist in the processing queue, the current priority identifiers of the sub-texts are updated in real time, when the sub-texts are processed, the sub-texts are processed according to the sequence of the values of the current priority identifiers, instead of waiting for one document to be processed, and then processing the other document to be processed, so that the processing time of the sub-texts is reasonably distributed, the user does not need to manually follow the processing progress of the document to be processed, and the convenience in use experience of the user is improved.
< device >
The present embodiment provides a task processing device, as shown in fig. 4, the task processing device 5000 may include: an acquisition module 5100, a determination module 5200 and a processing module 5300.
The acquiring module 5100 is configured to acquire each sub-task to be processed of the first task.
A determining module 5200, configured to determine, for each subtask to be processed, a current priority corresponding to the subtask to be processed; the current priority is generated based on the amount of data to be processed for the subtask to be processed and/or the length of time spent for the amount of data to be processed for the subtask to be processed.
The processing module 5300 is configured to process the subtasks to be processed according to the order of the current priorities of the subtasks to be processed.
In one embodiment, the determining module 5200 is specifically configured to: generating a first priority identifier of the data volume to be processed of the subtask to be processed according to the first time consumption duration, the second time consumption duration and the initial priority identifier of the data volume to be processed of the subtask to be processed; and determining the current priority identification of the data quantity to be processed of the subtask to be processed through the first priority identification.
In one embodiment, the determining module 5200 is specifically configured to: acquiring a priority identification threshold; comparing the first priority identification with a priority identification threshold; under the condition that the first priority identifier is smaller than a priority identifier threshold, the first priority identifier is used as a current priority identifier; and taking the priority identification threshold value as the current priority identification when the first priority identification is larger than the priority identification threshold value.
In one embodiment, the task processing device 5000 further includes: the time consumption determining module is used for: determining a second consumption time length of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed; or determining the second time consumption of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed and the total data volume of the subtask to be processed.
In one embodiment, the task processing device 5000 further includes: the initial priority determining module is used for: generating an initial priority identification of the data volume to be processed of the subtask to be processed according to the serial number identification of the data volume to be processed of the subtask to be processed in the subtask to be processed; and under the condition that the first condition is met, processing the to-be-processed data volume blocks of the to-be-processed subtasks according to the ordering of the initial priority identifiers of the to-be-processed data volume blocks of the to-be-processed subtasks.
In one embodiment, the processing module 5300 is further configured to: updating the current priority of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed and the first consumption time length of the data volume to be processed of the subtask to be processed; or updating the current priority of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed, the total data volume of the subtask to be processed and the first consumption time length of the data volume to be processed of the subtask to be processed. Updating refers to resetting the current priority of the amount of data to be processed of the subtasks to be processed in real time or periodically.
In one embodiment, the acquiring module 5100 is specifically configured to: dividing the subtask to be processed into at least one data volume block according to the first data volume, and obtaining the divided data volume block as the data volume block to be processed.
In one embodiment, the processing module 5300 is specifically configured to: acquiring a current priority identification of a subtask to be processed; sequencing the current priority identifiers of the subtasks to be processed according to the identification values, and setting the processing order of the data quantity to be processed of the subtasks to be processed, which corresponds to the current priority identifiers sequenced in the relative first position, as a first order; setting the processing order of the data quantity to be processed of the subtasks to be processed corresponding to the current priority identification of the relative secondary bit as a second order; and after the processing of the data quantity to be processed of the subtasks to be processed set in the first order is finished, processing the data quantity to be processed of the subtasks to be processed set in the second order.
The task processing device of the present embodiment may be used to execute the technical solution of the foregoing method embodiment, and its implementation principle and technical effects are similar, and are not described herein again.
< Medium >
In this embodiment, there is also provided a computer-readable storage medium storing a computer program readable and executable by a computer, the computer program for executing the task processing method as in any of the above method embodiments of the present invention when the computer program is read and executed by the computer.
The present invention may be a system, method, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for carrying out operations of the present invention may be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information for computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
The foregoing description of embodiments of the invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvements in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (11)

1. A method of task processing, comprising:
acquiring each subtask to be processed of a first task;
for each subtask to be processed, determining a current priority corresponding to the subtask to be processed, wherein the current priority is generated based on the data quantity to be processed of the subtask to be processed and/or the time consumption duration of the data quantity to be processed of the subtask to be processed;
and processing the subtasks to be processed according to the sequence of the current priorities of the subtasks to be processed.
2. The method of claim 1, wherein the determining the current priority corresponding to the subtask to be processed comprises:
Generating a first priority identifier of the data volume to be processed of the subtask to be processed according to the first time consumption duration, the second time consumption duration and the initial priority identifier of the data volume to be processed of the subtask to be processed;
and determining the current priority identification of the data quantity to be processed of the subtask to be processed through the first priority identification.
3. The method according to claim 2, wherein said determining, by said first priority identification, a current priority identification of an amount of data to be processed of said subtask to be processed, comprises:
acquiring a priority identification threshold;
comparing the first priority identification with the priority identification threshold;
taking the first priority identifier as a current priority identifier under the condition that the first priority identifier is smaller than the priority identifier threshold value;
and taking the priority identification threshold value as the current priority identification under the condition that the first priority identification is larger than the priority identification threshold value.
4. A method according to claim 2 or 3, characterized in that the method further comprises:
determining a second consumption duration of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed; or alternatively, the process may be performed,
And determining a second time consumption of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed and the total data volume of the subtask to be processed.
5. A method according to claim 2 or 3, characterized in that the method further comprises:
generating an initial priority identification of the data volume to be processed of the subtask to be processed according to the serial number identification of the data volume to be processed of the subtask to be processed in the subtask to be processed;
and under the condition that the first condition is met, processing the to-be-processed data volume blocks of the to-be-processed subtask according to the ordering of the initial priority identifiers of the to-be-processed data volume blocks of the to-be-processed subtask.
6. The method according to claim 4, wherein the method further comprises:
updating the current priority of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed and the first consumption time length of the data volume to be processed of the subtask to be processed; or alternatively, the process may be performed,
and updating the current priority of the data volume to be processed of the subtask to be processed according to the data volume to be processed of the subtask to be processed, the total data volume of the subtask to be processed and the first consumption duration of the data volume to be processed of the subtask to be processed.
7. The method of claim 1, wherein the obtaining each sub-task to be processed of the first task comprises:
dividing the subtask to be processed into at least one data volume block according to the first data volume, and obtaining the divided data volume block as the data volume block to be processed.
8. The method of claim 1, wherein said processing said sub-tasks to be processed in accordance with a current priority ordering of said sub-tasks to be processed comprises:
acquiring a current priority identification of the subtask to be processed;
sorting the current priority identifiers of the subtasks to be processed according to the identifier values, and setting the processing order of the data quantity to be processed of the subtasks to be processed, which corresponds to the current priority identifier which is sorted in the relative first position, as a first order; setting the processing order of the data quantity to be processed of the subtasks to be processed, which corresponds to the current priority identification of the relative secondary bit, as a second order;
and after the processing of the data quantity to be processed of the subtasks to be processed, which is set to the first order, is finished, processing the data quantity to be processed of the subtasks to be processed, which is set to the second order.
9. A task processing device, comprising:
the acquisition module is used for acquiring each subtask to be processed of the first task;
the determining module is used for determining the current priority corresponding to each sub-task to be processed, wherein the current priority is generated based on the data quantity to be processed of the sub-task to be processed and/or the time consumption duration of the data quantity to be processed of the sub-task to be processed;
and the processing module is used for processing the subtasks to be processed according to the sequence of the current priorities of the subtasks to be processed.
10. An electronic device comprising a memory and a processor, the memory for storing a computer program; the processor is configured to execute the computer program to implement the task processing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program readable by a computer for executing the task processing method according to any one of claims 1-8 when the computer program is read by the computer.
CN202111412864.0A 2021-11-25 2021-11-25 Task processing method and device, electronic equipment and storage medium Pending CN116166408A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111412864.0A CN116166408A (en) 2021-11-25 2021-11-25 Task processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111412864.0A CN116166408A (en) 2021-11-25 2021-11-25 Task processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116166408A true CN116166408A (en) 2023-05-26

Family

ID=86416931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111412864.0A Pending CN116166408A (en) 2021-11-25 2021-11-25 Task processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116166408A (en)

Similar Documents

Publication Publication Date Title
CN108885571B (en) Input of batch processing machine learning model
CN110889492B (en) Method and apparatus for training deep learning models
CN107680144B (en) WebP file conversion method and device
US20230176903A1 (en) Dynamic batching for inference system for transformer-based generation tasks
US11403017B2 (en) Data compression method, electronic device and computer program product
CN109597810B (en) Task segmentation method, device, medium and electronic equipment
CN113792240A (en) Page loading method and device and electronic equipment
CN111984414B (en) Data processing method, system, equipment and readable storage medium
WO2014093599A2 (en) Identifying and displaying a set of high priority contacts on a display device
Pratas et al. GeCo2: An optimized tool for lossless compression and analysis of DNA sequences
CN112035266A (en) Resource allocation method, device, equipment and storage medium
CN112150023A (en) Task allocation method, device and storage medium
CN105229608A (en) Based on the database processing towards array of coprocessor
CN113918356B (en) Method and device for quickly synchronizing data based on CUDA (compute unified device architecture), computer equipment and storage medium
CN111914987A (en) Data processing method and device based on neural network, equipment and readable medium
CN104144212A (en) Virtual desktop image transmission method, device and system
CN112667368B (en) Task data processing method and device
CN114817845B (en) Data processing method, device, electronic equipment and storage medium
CN116166408A (en) Task processing method and device, electronic equipment and storage medium
CN115659443A (en) Geometric shape stream data processing method and device, computing device and storage medium
CN110610450A (en) Data processing method, electronic device, and computer-readable storage medium
US11586475B2 (en) Application aware resource allocation for deep learning job scheduling
CN114386577A (en) Method, apparatus, and storage medium for executing deep learning model
US11093281B2 (en) Information processing apparatus, control method, and program to control allocation of computer resources for different types of tasks
CN113905040A (en) File transmission method, device, system, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination