CN117950841A - Method, apparatus, system and computer readable storage medium for implementing date update and executing tasks at fixed execution time periods - Google Patents
Method, apparatus, system and computer readable storage medium for implementing date update and executing tasks at fixed execution time periods Download PDFInfo
- Publication number
- CN117950841A CN117950841A CN202410348081.8A CN202410348081A CN117950841A CN 117950841 A CN117950841 A CN 117950841A CN 202410348081 A CN202410348081 A CN 202410348081A CN 117950841 A CN117950841 A CN 117950841A
- Authority
- CN
- China
- Prior art keywords
- tasks
- executed
- task
- frame
- execution time
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000009825 accumulation Methods 0.000 claims description 20
- 238000012545 processing Methods 0.000 claims description 19
- 238000012216 screening Methods 0.000 claims description 11
- 230000005059 dormancy Effects 0.000 claims description 10
- 230000001960 triggered effect Effects 0.000 claims description 7
- 238000012163 sequencing technique Methods 0.000 claims description 4
- 230000015654 memory Effects 0.000 description 26
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 6
- 238000009432 framing Methods 0.000 description 3
- 238000004088 simulation Methods 0.000 description 3
- PCHJSUWPFVWCPO-UHFFFAOYSA-N gold Chemical compound [Au] PCHJSUWPFVWCPO-UHFFFAOYSA-N 0.000 description 2
- 239000010931 gold Substances 0.000 description 2
- 229910052737 gold Inorganic materials 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000001419 dependent effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000007958 sleep Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention relates to the technical field of computers, discloses a method, a device, a system and a computer readable storage medium for realizing date updating and executing tasks according to a fixed execution time period.
Description
Technical Field
The present invention relates to the field of computer technology, and in particular, to a method, apparatus, system, and computer readable storage medium for implementing date updating and executing tasks according to a fixed execution time period.
Background
In a conventional implementation, the time replacement is usually driven by the program bottom layer to execute daily updating every frame, such as updating every upgrade, and doing all the settlements, but because the order of executing tasks at each settling time point must be kept consistent, the program relies heavily on single-thread upgrade updating, so that the program performance is poor.
Disclosure of Invention
In view of this, the present invention provides a method, apparatus, system, and computer-readable storage medium for implementing date updates and executing tasks at fixed execution time periods to solve the problem that the order of executing tasks must be kept consistent at each settlement time point, and thus the program is extremely dependent on single-threaded upgrade updates, resulting in poor program performance.
In a first aspect, the present invention provides a method for implementing date update and executing tasks according to a fixed execution time period, applied to an entity component system, the method comprising: acquiring all tasks to be executed in the entity component system according to a preset time period, wherein the tasks to be executed have corresponding execution time periods; the query date component determines the current task execution time, and screens out the tasks to be executed, of which the execution time corresponding to the execution time period is consistent with the current task execution time, from all the tasks to be executed, and the tasks are used as executable tasks; and performing task execution processing on the executable tasks, and updating the time of the date component after all the executable tasks are executed.
The method for updating the realization date and executing the task according to the fixed execution time period is applied to an entity component system, namely an ECS system, all tasks to be executed in the system are acquired according to the fixed time period, the current task execution time is determined by a query date component, the executable task corresponding to the time period is screened out for executing the task, after the execution of all the executable tasks is completed, the time of the date component is updated, all the data are closely arranged in a memory in an array mode by utilizing the realization mode of the ECS system facing the data programming, and compared with the traditional single-thread upgrade logic based on the bottom layer, the efficiency is faster, and the program performance is better.
In an optional implementation manner, the selecting, from the all tasks to be executed, the task to be executed whose execution time corresponding to the execution time period is consistent with the current task execution time, as an executable task, includes: sorting all tasks to be executed based on the execution time period and a preset sorting order; and sequentially screening the tasks to be executed, of which the execution time corresponds to the execution time period and the execution time of the current task is consistent, from all the ordered tasks to be executed according to the ordering sequence, and taking the tasks to be executed as executable tasks.
After all the tasks to be executed are acquired, the tasks to be executed are ordered based on the execution time period of the tasks, and the executable tasks are screened out according to the ordering order, so that the efficiency of screening the tasks is improved, and the efficiency of overall logic performance is improved.
In an alternative embodiment, the task performing processing on the executable task includes: extracting a current task from the screened executable tasks based on a preset fixed frame number which can be consumed for each task processing and a preset time which can be consumed for each frame, and executing the current task in the current frame, wherein the executable tasks are sequentially executed according to the sequencing order; after the current task is executed, counting the accumulation time consumed by the current task and the historical task executed in the current frame, and judging whether the accumulation time exceeds the consumable time of the current frame; if the consumable time of the current frame is exceeded, entering a next frame, and executing a next task by using the next frame; and if the consumable time of the current frame is not exceeded, continuing to execute the next task by utilizing the current frame.
The invention divides the fixed frame number and the consumable time of each frame corresponding to each task processing into a plurality of frames to execute the tasks, and the time consuming time corresponding to each frame for completing the task updating is consistent, thereby improving the stability of the frame rate.
In an alternative embodiment, the method further comprises: after all the executable tasks are executed, judging whether residual consumable frames exist or not; and if the remaining consumable frames exist, executing frame dormancy based on the consumable time of each frame until the dormancy time reaches the consumable accumulation time corresponding to the remaining consumable frames.
After the executable tasks are all completed, if the residual consumable frames exist, the frame dormancy is executed until the dormancy time reaches the corresponding consumable accumulation time of the residual consumable frames, the time consuming time of each frame is ensured to be consistent, and then the result is that the actual daily elapsed time felt by the user is consistent when the program is automatically updated on a daily basis, so that the user experience is improved.
In an alternative embodiment, the method further comprises: and when the last frame is entered to execute the executable tasks, if the residual executable tasks are not executed, executing all the residual executable tasks in the last frame.
When the invention enters the last frame to execute the task, if the residual executable task is not executed, executing all the residual executable tasks in the last frame, and ensuring that all the executable tasks are executed.
In an alternative embodiment, when the last frame is entered to execute the executable task, if there are any remaining executable tasks not executed, the method further includes: and sending prompt information for adjusting the consumable fixed frame number and/or the consumable time of each frame to the client so that the user can adjust the consumable fixed frame number and/or the consumable time of each frame.
The invention sends the prompt information for adjusting the consumable fixed frame number and/or the consumable time of each frame to the client, so that the user can flexibly adjust the time for executing the task once, and the consistency of the time consumed for executing the task in each fixed time period is ensured.
In an alternative embodiment, after extracting the current task and performing the current task at the current frame, the method further comprises: judging whether the current task triggers the cooperative program, and if the current task triggers the cooperative program, executing the triggered cooperative program; after executing the cooperation of completing the trigger, executing the next task.
If the invention determines that the time consumed by executing one task consumes one frame of time, the cooperative distance can be actively started when the task is executed, and the task is divided into the common task and the cooperative distance, so that the time consumed by executing the common task is smaller than the time consumed by one frame, the cooperative distance can be executed by utilizing the next frame, and the time consumed by each frame is ensured to be consistent.
In a second aspect, the present invention provides an apparatus for implementing date updating and performing tasks at a fixed execution time period, applied to a physical component system, the apparatus comprising: the task acquisition module is used for acquiring all tasks to be executed in the entity component system according to a preset time period, wherein the tasks to be executed have corresponding execution time periods; the task screening module is used for inquiring the date component to determine the current task execution time, and screening the tasks to be executed, of which the execution time corresponds to the execution time period and is consistent with the current task execution time, from all the tasks to be executed, and taking the tasks to be executed as executable tasks; and the task execution module is used for carrying out task execution processing on the executable tasks and updating the time of the date component after all the executable tasks are executed.
In a third aspect, the present invention provides a system for implementing date update and executing tasks according to a fixed execution time period, where the system is an entity component system, and the system includes a frame update system and a date component, where the frame update system obtains all tasks to be executed in the entity component system according to a preset time period, where the tasks to be executed have corresponding execution time periods; the frame updating system inquires about the time of the current task to confirm the execution time of the date component, screen out the task to be executed that the execution time corresponding to said execution time period is consistent with said current task execution time from all said tasks to be executed, as the executable task; and the frame updating system performs task execution processing on the executable tasks, and updates the time of the date component after all the executable tasks are executed.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon computer instructions for causing a computer to perform the implementation date updating and task method according to the first aspect or any of its corresponding embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow diagram of a method for implementing date updates and executing tasks at fixed execution time periods according to an embodiment of the invention;
FIG. 2 is a flow diagram of another method for implementing date updates and executing tasks at fixed execution time periods according to an embodiment of the invention;
FIG. 3 is an exemplary diagram of a task to be performed with an execution time period according to an embodiment of the present invention;
FIG. 4 is an exemplary diagram of ordering enqueues for a task to be performed in accordance with an embodiment of the present invention;
FIG. 5 is a flowchart illustrating an example of executing a coroutine according to an embodiment of the present invention;
FIG. 6 is a flowchart illustration of a framing execution task according to an embodiment of the present invention;
FIG. 7 is a block diagram of a system for implementing date updates and executing tasks at fixed execution time periods in accordance with an embodiment of the invention;
FIG. 8 is a diagram of an exemplary architecture of a system for implementing date updates and executing tasks at fixed execution time periods in accordance with an embodiment of the invention;
FIG. 9 is a block diagram of an apparatus for implementing date updates and executing tasks at fixed execution time periods in accordance with an embodiment of the invention;
fig. 10 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In accordance with an embodiment of the present invention, there is provided a method embodiment for performing date updating and performing tasks at a fixed execution time period, it being noted that the steps illustrated in the flowchart of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order other than that illustrated herein.
In this embodiment, a method for implementing date update and executing tasks according to a fixed execution time period is provided, and the method is applied to an Entity Component System, where the Entity Component System is an ECS (Entity-Component-System) System, and is an implementation manner for data programming, and the ECS is divided into three parts of entities (Entity), components (Component), and a System (System), where the entities are marks of a Component set, the components store data, and are closely arranged in a memory in an array form, and the System executes tasks by querying required components, so as to solve the problem of low cpu cache hit rate of a computer caused by discrete memory distribution in an object-oriented, and fig. 1 is a flowchart of a method for implementing date update and executing tasks according to a fixed execution time period according to an embodiment of the present invention, and as shown in fig. 1, the flowchart includes the following steps:
Step S101, acquiring all tasks to be executed in the entity component system according to a preset time period, wherein the tasks to be executed have corresponding execution time periods.
The tasks to be executed in the embodiment of the invention can be set according to specific application scenarios, such as simulated company operation, the tasks to be executed can comprise staff work settlement, salary settlement and bonus settlement, the corresponding execution time period can comprise daily staff work settlement, monthly salary settlement and yearly bonus settlement for staff, such as simulated strategy games, the tasks to be executed can comprise daily main line task settlement, obtained gold coin settlement and the like, each main line task settlement, each day gold coin settlement and the like, and the like are just taken as examples. The preset time period of the embodiment of the invention can be set according to specific application scenes, the minimum time period in the execution time periods corresponding to the tasks to be executed can be selected as the time period for acquiring the tasks to be executed, for example, the operation of a simulation company can be performed, and daily can be set as the preset time period for acquiring all the tasks to be executed.
Step S102, a query date component determines the current task execution time, and screens out tasks to be executed, of which the execution time corresponds to the execution time period and the current task execution time are consistent, from all the tasks to be executed, and the tasks are used as executable tasks.
The task execution time in the embodiment of the present invention may be a specific time or a specific date, may be set based on an actual application scenario, for example, the task execution time in running of a simulation company may be a date, the execution time corresponding to the execution time period of each month is the last day of each month, the execution time corresponding to the execution period of each year is the last day of each year, which is only used as an example, the embodiment of the present invention may query the time of the date component to determine the current task execution time, and then may screen out tasks to be executed whose execution time corresponds to the current task execution time from all tasks to be executed, as executable tasks, for example, the query date component determines that the current task execution time is 1 month 31 days, and may screen out tasks requiring daily update and tasks requiring monthly update as executable tasks, which are only used as examples.
Step S103, performing task execution processing on the executable tasks, and updating the time of the date component after all the executable tasks are executed.
After the executable tasks are screened out, the task execution processing can be performed based on the frames, and the method for performing the task execution processing based on the frames is not limited, for example, all the executable tasks can be performed by using one frame, and only by way of example, when all the executable tasks are completed, the date component can be updated, and the time is shifted backward, for example, the time of the current date component is 1 month and 31 days, and the time of the updatable date component is 2 months and 1 day.
The method for updating the realization date and executing the task according to the fixed execution time period is applied to an entity component system, namely an ECS system, all tasks to be executed in the system are acquired according to the fixed time period, the current task execution time is determined by a query date component, the executable task corresponding to the time period is screened out for executing the task, after the execution of all the executable tasks is completed, the time of the date component is updated, all the data are closely arranged in a memory in an array mode by utilizing the realization mode of the ECS system facing the data programming, and compared with the traditional single-thread upgrade logic based on the bottom layer, the efficiency is faster, and the program performance is better.
In this embodiment, a method for implementing date update and performing tasks according to a fixed execution time period is provided, which may be used in the entity component system described above, and fig. 2 is a flowchart of a method for implementing date update and performing tasks according to a fixed execution time period according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
step S201, obtaining all tasks to be executed in the entity component system according to a preset time period, wherein the tasks to be executed have corresponding execution time periods. Please refer to step S101 in the embodiment shown in fig. 1 in detail, which is not described herein.
In step S202, the query date component determines the current task execution time, and screens out the tasks to be executed whose execution time corresponds to the execution time period and the current task execution time from all the tasks to be executed, as executable tasks.
Specifically, the step S202 includes:
in step S2021, all tasks to be executed are ordered based on the execution time period and the preset ordering order.
The process of acquiring all tasks to be executed in the entity component system may be that the ECS framework exposes an interface and returns to all systems, systems of which all systems are sub-types of date updating systems are acquired, and tasks to be executed of the systems are acquired, wherein the date updating system judges that a date source is a date component, belongs to a part of components in the ECS framework, a specific embodiment simulates company operation as an example, as shown in fig. 3, a relationship between a working system and a salary system and a date belongs to inheritance, the working system and the salary system are sub-types, the date updating system is a parent class, an rewriting method is that the sub-types rewrite the implementation process of a method of a parent class which allows access, three types of tasks (three functions) are declared in the date updating system, the specific working system and the salary system rewrite the three tasks to realize specific contents, the working system is a daily updating system, the tasks to be updated daily, the salary system is a month updating task and a year updating task, the month updating task can include issuing salary, and the year updating task can include issuing prize, only by way of example.
The embodiment of the invention does not limit the preset sorting order, for example, the sorting can be performed automatically according to the actual application scene and the project requirement, for example, based on the execution time period from small to large, or according to the sorting from large to small, the embodiment of the invention takes the sorting from small to large as an example, namely the sorting by day update, month update and year update, the system in the ECS can be a frame update system, the frame update system can be provided with a task queue, as shown in fig. 4, after the frame update system acquires all the tasks to be executed according to the preset time period, the sorting can be performed according to the project requirement based on the execution time period from small to large, the obtained day update task, month update task and year update task in the working system can be sequentially ordered, the obtained day update task, month update task and year update task in the salary system can be empty, and the embodiment of the invention can also perform sorting according to the system type, for example, after the frame update system acquires all the tasks to be executed according to the execution time period, for example, the simulation operation is performed, the tasks can be sequentially ordered by the corresponding to the task queue only after the working queue is ordered by the corresponding to the working queue, and the work queue can be sequentially entered into the working queue only after the working queue is in the working queue.
Step S2022 sequentially screens out the tasks to be executed whose execution time period corresponds to the current task execution time from all the ordered tasks to be executed according to the ordering order, and uses the tasks as executable tasks.
In the embodiment of the invention, if the query date component determines the current task execution time, executable tasks can be screened out in turn based on whether the current task execution time is consistent with the execution time corresponding to the execution time period, as shown in fig. 4, in a specific embodiment, if the current task execution time is determined to be 1 month 31, all tasks to be executed in a task queue can be screened out into daily update tasks and monthly update tasks in a working system, and daily update tasks and monthly update tasks in a salary system are screened out as executable tasks.
In step S203, task execution processing is performed on the executable tasks, and after all the executable tasks are executed, the time of the date component is updated.
Specifically, the step S203 includes:
Step S2031, extracting a current task from the screened executable tasks based on a preset fixed number of frames and a preset time which can be consumed for each task processing, and executing the current task in the current frame.
Wherein the executable tasks are sequentially executed in a sequencing order.
Step S2032, after the execution of the current task is completed, counts the accumulation time consumed by the current task and the historical task executed in the current frame, and determines whether the accumulation time exceeds the time that can be consumed in the current frame.
Step S2033, if the time spent by the current frame is exceeded, the next frame is entered and the next task is executed using the next frame.
In step S2034, if the time that the current frame is consumable is not exceeded, the next task is continued to be executed by using the current frame.
The order of executing executable tasks in the embodiment of the present invention may be sequentially executed according to the order of the foregoing embodiments, a fixed number of frames that may be consumed when executing the tasks each time and a time that may be consumed for each frame may be predefined, where the time that may be consumed for each frame may be a time that may be highest to be consumed for each frame, specifically set may be set according to actual task requirements and application scenarios, for example, the fixed number of frames that may be consumed for each time of executing the tasks may be 30 frames, and the time that may be consumed for each time may be 0.16 seconds, as shown in fig. 4, the filtered executable tasks are executed in frames, when executing the tasks each time, a current task is extracted from the filtered executable tasks and executed in a current frame, when executing the current task, a time when executing the current task may be recorded, an end time may be recorded after the task execution is completed, the available end time may be subtracted from the start time, and all the time consumed for executing the tasks in the current frame may be accumulated including the accumulation time of the current task and the historical accumulation time, and it may be determined whether the calculated accumulation time exceeds the predefined time that may be consumed for the current frame.
Specifically, after the current task is extracted and executed in the current frame, judging whether the current task triggers the cooperative program, and if the current task triggers the cooperative program, executing the triggered cooperative program; after executing the triggered coroutine, executing the next task.
In the embodiment of the invention, if the consumed time of the current task is larger, for example, the consumed time exceeds the consumable time of the current frame, the method StartCoroutine can be called to actively start the cooperative program when the task is executed, the cooperative program can be stored in a system where the current task is located, the current task is divided into a common task and a cooperative program by way of example only, the cooperative program is a special task which is divided into a plurality of sections to be executed, the common task must be executed and completed in one frame, the cooperative program and the common task can not be executed in the same frame, the divided into a plurality of sections to be executed in the cooperative program can be executed in the same frame or different frames, at the moment, the execution time of the common task can be smaller than the consumable time of the current frame, the divided common task is executed by using the current frame, after the common task is completed, the frame updating system can judge whether the current task triggers the cooperative program or not, after the current task triggers the cooperative procedure, the divided cooperative procedure and the common task are both in a system corresponding to the current task, when the frame updating system acquires the current task and system information of the system containing the current task, whether the currently executed task triggers the cooperative procedure or not can be judged from the system, if the current task triggers the cooperative procedure, whether the accumulation time of the common task and the historical task executed in the current frame exceeds the consumable time of the current frame or not is judged, if the consumable time of the current frame is exceeded, the next frame can be used for executing the cooperative procedure, if the consumable time of the current frame is not exceeded, the current frame can be used for executing the cooperative procedure, and the next task can be executed only after the cooperative procedure is executed, and the realization modes of different programming languages are inconsistent.
In a specific embodiment, as shown in fig. 5, when an executable task is executed in a framing manner, after the current task is executed, whether the current task triggers a cooperative program is determined, if the cooperative program is triggered, the cooperative program task is executed, and based on the determination of whether the accumulated time exceeds a single frame time, the framing execution is performed, when the accumulated time exceeds the single frame time, the execution is ended to enter the next frame, if the accumulated time does not exceed the single frame time, the task is executed based on the current frame, if the current task is determined not to have the cooperative program, the next task is acquired and executed, after the next task is executed, whether the cooperative program is judged to have the cooperative program, and if the cooperative program has the cooperative program, the cooperative program execution is acquired, which is merely by way of example.
In the embodiment of the present invention, if the calculated accumulation time exceeds the consumable time of the predefined current frame, the next frame is entered and utilized to execute the next task, and if the calculated accumulation time does not reach the consumable time of the predefined current frame, such as 0.4 frame is left, the next task can be executed by utilizing the 0.4 frame continuously, which is just taken as an example.
Specifically, after all executable tasks are executed, judging whether residual consumable frames exist or not; if the remaining consumable frame exists, performing frame dormancy based on the consumable time of each frame until the dormancy time reaches the consumable accumulation time corresponding to the remaining consumable frame.
As shown in fig. 6, whether the executable task is executed is determined, if not, the task is executed based on the frame continuously, if the executable task is completed completely, whether the executed frame corresponding to the last executed task reaches the last consumable time of the last frame is determined, if the executed frame is the last frame and reaches the last consumable time of the last frame, all tasks to be executed can be re-acquired based on the time period, if the executed frame is not the last frame, the executable frame is dormant until the dormant time reaches the consumable accumulation time corresponding to the remaining consumable frame, if the executed frame is the last frame but does not reach the last consumable time of the last frame, the executed frame can be dormant until the dormant time and the time consumed for executing the task reach the last consumable time of the last frame, generally, a Sleep (time) method is executed, after executing the program, any code is not executed in the dormant time, and the remaining consumable frame is not dormant, so that the running speed of the program may be worse, but the consistency experience of the user may be lowered.
Specifically, when the last frame is entered to execute the executable tasks, if there are any remaining executable tasks that are not executed, all remaining executable tasks are executed in the last frame.
Specifically, when the last frame is entered to execute the executable task, if the remaining executable tasks are not executed, a prompt message for adjusting the consumable fixed frame number and/or the consumable time of each frame is sent to the client, so that the user can adjust the consumable fixed frame number and/or the consumable time of each frame.
When the last frame is entered to execute the executable task, the embodiment of the invention determines that the remaining executable tasks are not executed, and then all the remaining executable tasks can be executed in the last frame, although the time consumed in daily is unstable, the computer configuration is insufficient to run the set number of execution frames for one day, and the setting needs to be modified, the prompting information for adjusting the number of the consumable fixed frames and/or the time consumed in each frame can be sent to the client, so that the user can adjust the number of the consumable fixed frames and/or the time consumed in each frame, or the situation that the user perceives that the frame rate is poor can be also indicated that the number of frames or the time consumed in each frame is not set. The embodiment of the invention can also send the resource saving consumed by modifying the consumable fixed frame number to the user under the condition that the available frames are still available after the executable tasks are all completed, and the like, and is only used as an example.
In this embodiment, a system for implementing date update and executing tasks according to a fixed execution time period is also provided, where the system is an entity component system, as shown in fig. 7, and the system includes a frame update system and a date component, where the frame update system acquires all tasks to be executed in the entity component system according to a preset time period, where the tasks to be executed have corresponding execution time periods; the frame updating system inquires about the time of the current task to confirm the execution time of the date component, screen out the execution time corresponding to execution time period from all tasks to be executed and the task to be executed which is consistent with the execution time of the current task, as the executable task; the frame updating system performs task execution processing on the executable tasks, and updates the time of the date component after all the executable tasks are executed. Please refer to the above embodiments for detailed description, which is not repeated herein.
In a specific embodiment, as shown in fig. 8, the date updating system determines that the source of the date is a date component, belongs to a part of a component in the ECS framework, the frame updating system only needs to update the component, and does not need to inform the date updating system, three types of tasks, namely a daily updated task, a monthly updated task and a year updated task, are declared in the date updating system, and the three tasks are rewritten in a specific working system and a salary system to realize specific contents, wherein the date attribute in the three types of tasks is a shape parameter (a parameter required to be transmitted by a calling function), the date component is transmitted by the frame updating system when the frame updating system calls the task, the frame updating system puts the acquired task to be executed into a task queue, wherein the task to be executed has an execution time period, the order put into the task queue can be ordered from small to large according to the execution time period, and the frame updating system queries the execution time of the task in order, and screens the task to be executed, corresponding to the execution time of the execution time period, from the task queue, as an executable task to be executed, and the task to be executed, can be executed in order, and the task to be executed.
The embodiment also provides a device for realizing date updating and executing tasks according to a fixed execution time period, which is used for realizing the above embodiment and the preferred implementation, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides a device for realizing date update and executing tasks according to a fixed execution time period, which is applied to an entity component system, as shown in fig. 9, and includes: the task obtaining module 901 is configured to obtain all tasks to be executed in the entity component system according to a preset time period, where the tasks to be executed have a corresponding execution time period; the task filtering module 902 is configured to query the date component to determine a current task execution time, and screen a task to be executed, where the execution time corresponding to the execution time period is consistent with the current task execution time, from all tasks to be executed, as an executable task; the task execution module 903 is configured to perform task execution processing on the executable tasks, and update the time of the date component after all the executable tasks are executed.
In some alternative embodiments, task screening module 902 includes:
The task ordering unit is used for ordering all tasks to be executed based on the execution time period and a preset ordering sequence;
The task screening unit is used for sequentially screening the tasks to be executed, of which the execution time period corresponds to the current task execution time, from all the ordered tasks to be executed according to the ordering order, and taking the tasks to be executed as executable tasks.
In some alternative embodiments, the task execution module 903 includes: the task extraction unit is used for extracting a current task from the screened executable tasks based on a preset fixed frame number which can be consumed for each task processing and a preset time which can be consumed for each frame, executing the current task in the current frame, and sequentially executing the executable tasks according to a sequencing order; the execution time counting unit is used for counting the accumulation time consumed by the current task and the historical task executed in the current frame after the execution of the current task is completed, and judging whether the accumulation time exceeds the consumable time of the current frame; a next frame entering unit, configured to enter a next frame if the time spent by the current frame is exceeded, and execute a next task using the next frame; and the task continuing execution unit is used for continuing to execute the next task by using the current frame if the consumable time of the current frame is not exceeded.
In some alternative embodiments, implementing date updates and executing task devices at fixed execution time periods further comprises: the frame remaining judging module is used for judging whether remaining consumable frames exist after all executable tasks are executed; and the frame dormancy module is used for executing frame dormancy based on the consumable time of each frame if the remaining consumable frame exists, and until the dormant time reaches the consumable accumulation time corresponding to the remaining consumable frame.
In some alternative embodiments, implementing date updates and executing task devices at fixed execution time periods further comprises: and the residual task execution module is used for executing all the residual executable tasks in the last frame if the residual executable tasks are not executed when the last frame is entered to execute the executable tasks.
In some alternative embodiments, implementing date updates and executing task devices at fixed execution time periods further comprises: and the information prompt module is used for sending prompt information for adjusting the consumable fixed frame number and/or the consumable time of each frame to the client so as to enable the user to adjust the consumable fixed frame number and/or the consumable time of each frame.
In some alternative embodiments, implementing date updates and executing task devices at fixed execution time periods further comprises: the cooperative distance judging module is used for judging whether the current task triggers the cooperative distance or not, and if the current task triggers the cooperative distance, executing the triggered cooperative distance; and the cooperative program execution module is used for executing the next task after the triggered cooperative program is executed.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The implementation date updating and task execution device in the fixed execution time period in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application SPECIFIC INTEGRATED Circuit) Circuit, a processor and a memory that execute one or more software or fixed programs, and/or other devices that can provide the above functions.
The embodiment of the invention also provides a computer device which is provided with the device for updating the realization date and executing the task according to the fixed execution time period shown in the figure 9.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a computer device according to an alternative embodiment of the present invention, as shown in fig. 10, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 10.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods shown in implementing the above embodiments.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The computer device further comprises input means 30 and output means 40. The processor 10, memory 20, input device 30, and output device 40 may be connected by a bus or other means, for example in fig. 10.
The input device 30 may receive input numeric or character information and generate signal inputs related to user settings and function control of the computer apparatus, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, and the like. The output means 40 may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. Such display devices include, but are not limited to, liquid crystal displays, light emitting diodes, displays and plasma displays. In some alternative implementations, the display device may be a touch screen.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.
Claims (10)
1. A method for implementing date updates and executing tasks at a fixed execution time period, applied to a physical component system, the method comprising:
Acquiring all tasks to be executed in the entity component system according to a preset time period, wherein the tasks to be executed have corresponding execution time periods;
the query date component determines the current task execution time, and screens out the tasks to be executed, of which the execution time corresponding to the execution time period is consistent with the current task execution time, from all the tasks to be executed, and the tasks are used as executable tasks;
and performing task execution processing on the executable tasks, and updating the time of the date component after all the executable tasks are executed.
2. The method according to claim 1, wherein the step of screening the tasks to be executed, whose execution times correspond to the execution time periods and to the current execution time of the tasks, from among the tasks to be executed, includes:
sorting all tasks to be executed based on the execution time period and a preset sorting order;
And sequentially screening the tasks to be executed, of which the execution time corresponds to the execution time period and the execution time of the current task is consistent, from all the ordered tasks to be executed according to the ordering sequence, and taking the tasks to be executed as executable tasks.
3. The method of claim 2, wherein performing task execution processing on the executable task comprises:
Extracting a current task from the screened executable tasks based on a preset fixed frame number which can be consumed for each task processing and a preset time which can be consumed for each frame, and executing the current task in the current frame, wherein the executable tasks are sequentially executed according to the sequencing order;
After the current task is executed, counting the accumulation time consumed by the current task and the historical task executed in the current frame, and judging whether the accumulation time exceeds the consumable time of the current frame;
if the consumable time of the current frame is exceeded, entering a next frame, and executing a next task by using the next frame;
And if the consumable time of the current frame is not exceeded, continuing to execute the next task by utilizing the current frame.
4. A method according to claim 3, characterized in that the method further comprises:
after all the executable tasks are executed, judging whether residual consumable frames exist or not;
And if the remaining consumable frames exist, executing frame dormancy based on the consumable time of each frame until the dormancy time reaches the consumable accumulation time corresponding to the remaining consumable frames.
5. A method according to claim 3, characterized in that the method further comprises:
and when the last frame is entered to execute the executable tasks, if the residual executable tasks are not executed, executing all the residual executable tasks in the last frame.
6. The method of claim 5, wherein upon entering a last frame to execute the executable task, if there are remaining executable tasks that are not executed, the method further comprises:
and sending prompt information for adjusting the consumable fixed frame number and/or the consumable time of each frame to the client so that the user can adjust the consumable fixed frame number and/or the consumable time of each frame.
7. A method according to claim 3, wherein after extracting the current task and performing the current task at the current frame, the method further comprises:
Judging whether the current task triggers the cooperative program, and if the current task triggers the cooperative program, executing the triggered cooperative program;
After executing the cooperation of completing the trigger, executing the next task.
8. An apparatus for performing date updates and tasks at a fixed execution time period, for application to a physical component system, the apparatus comprising:
the task acquisition module is used for acquiring all tasks to be executed in the entity component system according to a preset time period, wherein the tasks to be executed have corresponding execution time periods;
The task screening module is used for inquiring the date component to determine the current task execution time, and screening the tasks to be executed, of which the execution time corresponds to the execution time period and is consistent with the current task execution time, from all the tasks to be executed, and taking the tasks to be executed as executable tasks;
and the task execution module is used for carrying out task execution processing on the executable tasks and updating the time of the date component after all the executable tasks are executed.
9. A system for implementing date updates and executing tasks at a fixed execution time period, characterized in that the system is a system of physical components, the system comprising a frame update system and a date component, wherein,
The frame updating system acquires all tasks to be executed in the entity component system according to a preset time period, wherein the tasks to be executed have corresponding execution time periods;
The frame updating system inquires about the time of the current task to confirm the execution time of the date component, screen out the task to be executed that the execution time corresponding to said execution time period is consistent with said current task execution time from all said tasks to be executed, as the executable task;
and the frame updating system performs task execution processing on the executable tasks, and updates the time of the date component after all the executable tasks are executed.
10. A computer readable storage medium having stored thereon computer instructions for causing a computer to perform a method of performing a date update and tasks at fixed execution time periods as claimed in any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410348081.8A CN117950841B (en) | 2024-03-26 | 2024-03-26 | Method, apparatus, system and computer readable storage medium for implementing date update and executing tasks at fixed execution time periods |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410348081.8A CN117950841B (en) | 2024-03-26 | 2024-03-26 | Method, apparatus, system and computer readable storage medium for implementing date update and executing tasks at fixed execution time periods |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117950841A true CN117950841A (en) | 2024-04-30 |
CN117950841B CN117950841B (en) | 2024-07-02 |
Family
ID=90792333
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410348081.8A Active CN117950841B (en) | 2024-03-26 | 2024-03-26 | Method, apparatus, system and computer readable storage medium for implementing date update and executing tasks at fixed execution time periods |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117950841B (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080120129A1 (en) * | 2006-05-13 | 2008-05-22 | Michael Seubert | Consistent set of interfaces derived from a business object model |
US20190018915A1 (en) * | 2016-08-24 | 2019-01-17 | Improbable Worlds Ltd | Simulation Systems and Methods Using Query-Based Interest |
CN110675466A (en) * | 2019-09-27 | 2020-01-10 | 广州华多网络科技有限公司 | Rendering system, rendering method, rendering device, electronic equipment and storage medium |
CN111176448A (en) * | 2019-12-26 | 2020-05-19 | 腾讯科技(深圳)有限公司 | Method and device for realizing time setting in non-touch mode, electronic equipment and storage medium |
US20200366521A1 (en) * | 2018-01-18 | 2020-11-19 | Volkswagen Aktiengesellschaft | Methods and Computer Programs for a Monitoring Entity and a Communication Component, Monitoring Entity, Communication Component, System and Vehicle |
CN113722056A (en) * | 2020-12-23 | 2021-11-30 | 北京沃东天骏信息技术有限公司 | Task scheduling method and device, electronic equipment and computer readable medium |
CN114936077A (en) * | 2022-05-19 | 2022-08-23 | 京东方科技集团股份有限公司 | PYTHON-based task polling method and task management system |
CN114982318A (en) * | 2020-01-17 | 2022-08-30 | 高通股份有限公司 | Reference signal monitoring opportunity update for idle and inactive user equipment |
CN116701123A (en) * | 2023-07-05 | 2023-09-05 | 中国建设银行股份有限公司 | Task early warning method, device, equipment, medium and program product |
CN116932008A (en) * | 2023-09-12 | 2023-10-24 | 湖南速子文化科技有限公司 | Method, device, equipment and medium for updating component data of virtual society simulation |
US20240040660A1 (en) * | 2022-07-27 | 2024-02-01 | Qualcomm Incorporated | Monitoring for periodic signals during non-uniform discontinuous reception cycles |
-
2024
- 2024-03-26 CN CN202410348081.8A patent/CN117950841B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080120129A1 (en) * | 2006-05-13 | 2008-05-22 | Michael Seubert | Consistent set of interfaces derived from a business object model |
US20190018915A1 (en) * | 2016-08-24 | 2019-01-17 | Improbable Worlds Ltd | Simulation Systems and Methods Using Query-Based Interest |
US20200366521A1 (en) * | 2018-01-18 | 2020-11-19 | Volkswagen Aktiengesellschaft | Methods and Computer Programs for a Monitoring Entity and a Communication Component, Monitoring Entity, Communication Component, System and Vehicle |
CN110675466A (en) * | 2019-09-27 | 2020-01-10 | 广州华多网络科技有限公司 | Rendering system, rendering method, rendering device, electronic equipment and storage medium |
CN111176448A (en) * | 2019-12-26 | 2020-05-19 | 腾讯科技(深圳)有限公司 | Method and device for realizing time setting in non-touch mode, electronic equipment and storage medium |
CN114982318A (en) * | 2020-01-17 | 2022-08-30 | 高通股份有限公司 | Reference signal monitoring opportunity update for idle and inactive user equipment |
CN113722056A (en) * | 2020-12-23 | 2021-11-30 | 北京沃东天骏信息技术有限公司 | Task scheduling method and device, electronic equipment and computer readable medium |
CN114936077A (en) * | 2022-05-19 | 2022-08-23 | 京东方科技集团股份有限公司 | PYTHON-based task polling method and task management system |
US20240040660A1 (en) * | 2022-07-27 | 2024-02-01 | Qualcomm Incorporated | Monitoring for periodic signals during non-uniform discontinuous reception cycles |
CN116701123A (en) * | 2023-07-05 | 2023-09-05 | 中国建设银行股份有限公司 | Task early warning method, device, equipment, medium and program product |
CN116932008A (en) * | 2023-09-12 | 2023-10-24 | 湖南速子文化科技有限公司 | Method, device, equipment and medium for updating component data of virtual society simulation |
Non-Patent Citations (2)
Title |
---|
WALID FARYABI 等: "Data-oriented design for processor intensive games", NTNU, 31 December 2018 (2018-12-31), pages 1 - 179 * |
肖林朋: "基于Unity引擎的手机2D酷跑端游的设计与实现", 《中国优秀硕士学位论文全文数据库》, no. 07, 15 July 2016 (2016-07-15) * |
Also Published As
Publication number | Publication date |
---|---|
CN117950841B (en) | 2024-07-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106557363A (en) | A kind of system and method for big data task scheduling | |
EP3860043A2 (en) | Method and apparatus for implementing smart contract based on blockchain | |
CN110110306B (en) | Data display method and device, terminal and computer readable storage medium | |
CN111309251A (en) | Data storage method, system, electronic device and readable storage medium | |
CN113254043A (en) | Web front-end project processing method and device, electronic equipment and storage medium | |
CN112565356A (en) | Data storage method and device and electronic equipment | |
CN110377331B (en) | Monitoring method, device, equipment and storage medium for issuing application program | |
CN117950841B (en) | Method, apparatus, system and computer readable storage medium for implementing date update and executing tasks at fixed execution time periods | |
CN112925811A (en) | Data processing method, device, equipment, storage medium and program product | |
CN117319376A (en) | File downloading control method and device, electronic equipment and storage medium | |
CN115984022B (en) | Unified account checking method and device for distributed payment system | |
Zabolotnyi et al. | SPEEDL-a declarative event-based language to define the scaling behavior of cloud applications | |
CN115543423A (en) | Method, device and equipment for generating benchmarks and storage medium | |
JP4303828B2 (en) | Print management system and method | |
CN113256270B (en) | Data processing method, data processing device, data processing apparatus, and storage medium | |
CN109547563B (en) | Message push processing method and device, storage medium and server | |
US8554798B2 (en) | Asynchronous state engine with plug-ins for flexible application development | |
Zabolotnyi et al. | Speedl-a declarative event-based language for cloud scaling definition | |
CN108399031A (en) | The method and apparatus for determining interface layout mode | |
CN111159188A (en) | Quasi-real-time large data volume processing method based on DataWorks | |
CN117240711B (en) | Automatic updating method, device and equipment for cluster management tool configuration file | |
CN117950646B (en) | Software development method, device, computer equipment, storage medium and program product | |
CN113627144B (en) | Graph generation method and device based on artificial intelligence, electronic equipment and medium | |
CN112527368B (en) | Cluster kernel version updating method and device, electronic equipment and storage medium | |
US20240235939A1 (en) | Dynamic Installation of Mobile Application Modules |
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 | ||
GR01 | Patent grant |