Task Scheduling Method, Handheld Financial Terminal and Readable Storage Medium

By scheduling unrunning tasks to external memory in a handheld financial terminal, the problem of insufficient hardware resources is solved, and the efficiency of memory space utilization and user experience is improved.

CN114564287BActive Publication Date: 2025-07-25深圳开鸿数字产业发展有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210103326.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-27
Publication Date
2025-07-25
Estimated Expiration
2042-01-27

AI Technical Summary

Technical Problem

Handheld financial terminals such as POS machines have limited hardware resources, resulting in insufficient memory and affecting task processing speed and user experience.

Method used

By obtaining the load memory of the internal memory, according to the warning memory threshold and task arrangement order, the task is scheduled to be run to the external memory, and the memory space is reasonably utilized.

Benefits of technology

Improves the efficiency of memory space utilization, improves the user experience, and ensures that there is enough memory space for running tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114564287B_ABST
    Figure CN114564287B_ABST
Patent Text Reader

Abstract

This application relates to the field of memory management, and provides a task scheduling method, a handheld financial terminal, and a readable storage medium. The method includes: obtaining the load memory of the internal memory in the handheld financial terminal; when the load memory is greater than or equal to the warning memory threshold, determining the tasks that have not been run in the task queue as the first target tasks; when the load memory is less than the warning memory threshold, sequentially obtaining the task memory occupied by each task in the current task queue according to the preset task arrangement order, and calculating the task cumulative memory according to the task memory; when the task cumulative memory is within the preset memory occupancy range, determining the tasks that have not been accumulated in the current task queue as the first target tasks; scheduling the first target tasks to the external memory. This application can flexibly and reasonably utilize the memory space of the handheld financial terminal, provide sufficient memory space for the tasks in the running state, improve the memory space utilization efficiency, and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of memory management, and particularly to a task scheduling method, a handheld financial terminal, and a readable storage medium. Background Art

[0002] With the popularization of online payment, handheld financial terminals such as POS (Point of sales) machines, as important tools for online payment, are used more and more widely. However, compared with electronic devices such as mobile phones and computers, the hardware resources of POS machines are relatively limited. The increasingly diverse usage requirements of users pose a huge challenge to the hardware resource configuration of POS machines. The POS machine is prone to memory shortage, resulting in slow task processing, and even requires users to frequently manually clean the memory, seriously affecting the user experience. Therefore, there is an urgent need for a method to reasonably allocate internal tasks of the handheld financial terminal to solve the above problems. Summary of the Invention

[0003] The main purpose of the present application is to provide a task scheduling method, a handheld financial terminal, and a readable storage medium, aiming to solve the technical problem of insufficient hardware resources of the handheld financial terminal.

[0004] In a first aspect, the present application provides a task scheduling method, which is applied to a handheld financial terminal. The task scheduling method includes the following steps:

[0005] Obtain the load memory of the internal memory in the handheld financial terminal;

[0006] When the load memory is greater than or equal to the warning memory threshold, determine the unrun tasks in the task queue as the first target tasks;

[0007] When the load memory is less than the warning memory threshold, sequentially obtain the task memory occupied by each task in the current task queue according to the preset task arrangement order, and calculate the task cumulative memory according to the task memory;

[0008] When the task cumulative memory is within the preset memory occupancy range, determine the tasks that have not been accumulated in the current task queue as the first target tasks;

[0009] Schedule the first target tasks to the external memory.

[0010] In a second aspect, the present application further provides a handheld financial terminal. The handheld financial terminal includes a processor, a memory, and a computer program stored on the memory and executable by the processor. When the computer program is executed by the processor, the above-mentioned task scheduling method is implemented.

[0011] In a third aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the task scheduling method described above is implemented.

[0012] The present application provides a task scheduling method, a handheld financial terminal, and a readable storage medium. The present application obtains the load memory of the internal memory in the handheld financial terminal; when the load memory is greater than or equal to the warning memory threshold, determines the tasks that have not been run in the task queue as the first target tasks; when the load memory is less than the warning memory threshold, sequentially obtains the task memory occupied by each task in the current task queue according to the preset task arrangement order, and calculates the cumulative task memory based on the task memory; when the cumulative task memory is within the preset memory occupancy range, determines the tasks that have not been accumulated in the current task queue as the first target tasks; and schedules the first target tasks to the external memory. According to the sizes of the preset warning memory threshold and the memory occupancy range, the present application determines at least some of the tasks in the internal memory as the first target tasks and schedules them to the external memory, providing sufficient memory space for the tasks in the running state, being able to flexibly and reasonably utilize the memory space of the handheld financial terminal, improving the utilization efficiency of the memory space, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0014] Figure 1 It is a schematic flowchart of a task scheduling method provided by an embodiment of the present application;

[0015] Figure 2 It is a schematic flowchart of a task scheduling method provided by another embodiment of the present application;

[0016] Figure 3 It is a schematic flowchart of a task scheduling method provided by another embodiment of the present application;

[0017] Figure 4a It is a schematic diagram of a task queue scenario provided by an embodiment of the present application;

[0018] Figure 4b It is a schematic diagram of a task queue scenario provided by another embodiment of the present application;

[0019] Figure 4cA schematic diagram of the scenario of a task scheduling method provided by an embodiment of the present application;

[0020] Figure 5 A schematic flow chart of a task scheduling method provided by another embodiment of the present application;

[0021] Figure 6 A schematic block diagram of the structure of a handheld financial terminal related to an embodiment of the present application. Detailed implementation manners

[0022] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0023] The flow chart shown in the accompanying drawings is only an example illustration, and does not necessarily include all the contents and operations / steps, nor does it necessarily execute in the described order. For example, some operations / steps can also be decomposed, combined, or partially merged. Therefore, the actual execution order may be changed according to the actual situation.

[0024] The embodiments of the present application provide a task scheduling method, a handheld financial terminal, and a readable storage medium.

[0025] Next, some embodiments of the present application will be described in detail in conjunction with the accompanying drawings. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.

[0026] Please refer to Figure 1 , Figure 1 A schematic flow chart of a task scheduling method provided by an embodiment of the present application. This task scheduling method is applied to a handheld financial terminal, such as a personal digital assistant (PDA) with limited hardware resources like a POS machine, to achieve scheduling of tasks in the internal memory of the handheld financial terminal. It can be understood that this task scheduling method can also be applied to other terminal devices with limited hardware resources, which is not limited herein.

[0027] As Figure 1 shown, in some embodiments, this task scheduling method includes: step S101 - step S105.

[0028] Step S101, obtain the load memory of the internal memory in the handheld financial terminal.

[0029] Exemplarily, the linked list includes at least one node, and the node includes a data field and a pointer field. Wherein, the data field of the node is used to store data members, and the pointer field of the node is used to point to the address of the next node.

[0030] In some embodiments, the step S101 of obtaining the load memory of the internal memory in the handheld financial terminal includes: determining the load memory according to the linked list for recording the memory occupied by the tasks with the task status of running status in the internal memory.

[0031] Exemplarily, the load memory in the internal memory is managed through a linked list. For example, it can be that at the head of each running task in the memory space, a node of the linked list is stored. The size of the memory space occupied by the current task is recorded through the data field of the node, and the pointer field of the node points to the next running task to determine the size of the load memory.

[0032] Exemplarily, when a task is in a state of interacting with the processor, the task is said to be in a running state.

[0033] Exemplarily, obtaining the load memory through a linked list can timely reflect the dynamic changes in the storage space in the internal memory and accurately determine the size of the memory space occupied by the tasks with the task status of running status in the internal memory.

[0034] Step S102: When the load memory is greater than or equal to the warning memory threshold, determine the tasks that have not been run in the task queue as the first target tasks.

[0035] Exemplarily, the task queue is stored in the internal memory and includes running tasks and tasks that have not been run. The running tasks refer to the tasks in the running state, and the tasks that have not been run refer to the tasks that are temporarily not running or cannot run.

[0036] Exemplarily, the tasks that have not been run include tasks in the ready state and tasks in the blocked state, and of course, it is not limited to this. Specifically, when a task is in a state of waiting to interact with the processor, the task is said to be in the ready state; when a task is performing a time-consuming operation such as input or output, or is in a state of waiting for a certain condition to be triggered, the task is said to be in the blocked state.

[0037] In some embodiments, the step S102 of, when the load memory is greater than or equal to the warning memory threshold, determining the tasks that have not been run in the task queue as the first target tasks includes: when the load memory is greater than or equal to the warning memory threshold, determining the tasks with the task status of ready state and the tasks with the task status of blocked state in the task queue as the first target tasks.

[0038] Exemplarily, when the memory occupied by a task with a running task status is greater than or equal to the warning memory threshold, that is, when the load memory is greater than or equal to the warning memory threshold, the tasks with a ready status and a blocked status in the task queue are determined as the first target tasks and scheduled to an external memory, so as to provide sufficient memory space for the tasks in the running state.

[0039] Exemplarily, since the tasks with a ready status and a blocked status in the task queue are not running, when the load memory is greater than or equal to the warning memory threshold, the tasks with a ready status and a blocked status in the task queue are determined as the first target tasks and scheduled to the external memory, so as to provide sufficient memory space for the tasks in the running state.

[0040] Exemplarily, the warning memory threshold can be set according to actual needs. For example, the warning memory threshold can be set to 90% of the storage space size of the internal memory. When the memory occupied by a task with a running task status is greater than or equal to 90% of the storage space size of the internal memory, all the unrun tasks in the task queue are scheduled to the external memory, that is, all the tasks with a ready status and a blocked status in the task queue are scheduled to the external memory. Of course, it is not limited to this. The warning memory threshold can also be other values, which are not defined here.

[0041] Exemplarily, when the memory occupied by a task with a running task status in the task queue is large, more space in the internal memory is required to store the data generated by the processor when executing the task. At the same time, in order to reduce the frequent calculation and frequent scheduling of tasks in the prior art, when the memory occupied by a task with a running task status is greater than or equal to the warning memory threshold, that is, when the load memory is greater than or equal to the warning memory threshold, the unrun tasks in the task queue are determined as the first target tasks, so that there is sufficient space in the internal memory to store the tasks with a running task status and the data generated by the tasks with a running task status, reasonably utilizing the storage space of the internal memory and improving the user experience.

[0042] Step S103, when the load memory is less than the warning memory threshold, sequentially obtain the task memory occupied by each task in the current task queue according to the preset task arrangement order, and calculate the task cumulative memory according to the task memory.

[0043] Exemplarily, when the load memory is less than the warning memory threshold, the memory occupied by the tasks with a running task status in the task queue is small, and the data generated by the processor when executing the tasks is also small. At least some of the unrun tasks can be stored in the internal memory.

[0044] Exemplarily, in order to more reasonably determine the unexecuted tasks retained in the internal memory and the unexecuted tasks that need to be removed from the internal memory, each task in the task queue is sorted.

[0045] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a task scheduling method provided by another embodiment of the present application. In some embodiments, as Figure 2 shown, before the step S103 of sequentially obtaining the task memory occupied by each task in the current task queue according to the preset task arrangement order and calculating the cumulative task memory based on the task memory, it further includes: step S106 of determining the arrangement priority of each task in the task queue according to the task status priority and / or the running priority of each task in the task queue; step S107 of determining the preset task arrangement order according to the arrangement priority corresponding to each task in the task queue, and further determining the arrangement order of each task in the sorted current task queue.

[0046] Exemplarily, the tasks in the task queue are set with their respective running priorities according to actual needs, and the running priority is used to indicate the importance of the task. By determining the arrangement priority of each task in the task queue according to the task status priority and / or the running priority of each task in the task queue, the tasks with lower arrangement priority are determined as the first target tasks, which improves the rationality of task scheduling.

[0047] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of a task scheduling method provided by another embodiment of the present application. In some embodiments, as Figure 3 shown, the step S106 of determining the arrangement priority of each task in the task queue according to the task status priority and / or the running priority of each task in the task queue includes: step S1061 of performing task status priority sorting on each task in the task queue according to the task status of each task; wherein, in the task queue, the task status priority corresponding to the task with the ready status is higher than the task status priority corresponding to the task with the blocked status; step S1062 of performing running priority sorting on the tasks with the same task status according to the importance of each task, and further determining the arrangement priority of each task in the task queue; wherein, when there are tasks with the same task status in the task queue, the arrangement priority corresponding to the task with a higher running priority is higher than the arrangement priority corresponding to the task with a lower running priority.

[0048] Exemplarily, since a task in a blocked state needs to wait for a period of time to enter the ready state and wait to run, the task in the blocked state corresponds to a lower task state priority. When there is insufficient space in the internal memory, the task in the blocked state in the internal memory can be preferentially determined as the first target task and scheduled to the external memory, so that the internal memory has enough memory space to store tasks in the running state and the ready state.

[0049] Exemplarily, when the processor executes tasks, when there are tasks with the same task state in the task queue, for example, when there are two or more tasks with the ready state in the task queue, the processor will preferentially execute the task with a higher running priority. Therefore, when there are tasks with the same task state in the task queue, the task with a higher running priority corresponds to a higher arrangement priority. For example, when there are two tasks with the blocked state in the task queue, the task with a higher running priority among the two tasks corresponds to a higher arrangement priority, so as to schedule the task with a lower running priority to the external memory, so that there is enough space in the internal memory to store the task with a higher running priority.

[0050] Please refer to Figure 4a , Figure 4a which is a schematic diagram of a scenario of a task queue provided by an embodiment of the present application. As Figure 4a shown, the internal memory includes task 1 and task 2 in the running state, task 3 and task 5 in the ready state, and task 4 and task 6 in the blocked state; Figure 4a The corresponding running priorities of the tasks in Figure 4a are as shown by the priority values in the parentheses. Exemplarily, the smaller the priority value, the higher the corresponding running priority. Taking the ready tasks 3 and 5 in

[0051] as an example, the priority value of task 3 is 2, and the priority value of task 5 is 4, then the running priority of task 3 is higher than that of task 5. Figure 4a When the load memory in the internal memory is less than the warning memory threshold, according to the task state priority and / or running priority of each task in the task queue, determine the arrangement priority of each task in the task queue, and then determine the preset task arrangement order according to the arrangement priority corresponding to each task in the task queue. Exemplarily, the task state priority corresponding to a task in the ready state is higher than the task state priority corresponding to a task in the blocked state. For example, in Figure 4aIn [the scenario], since the running priority corresponding to Task 3 is higher than that corresponding to Task 5 in Task 3 and Task 5, the arrangement priority corresponding to Task 3 is also higher than that corresponding to Task 5.

[0052] Exemplarily, the preset task arrangement order is determined according to the arrangement priorities corresponding to the tasks in the task queue. For example, the tasks in the task queue are arranged in descending order of the arrangement priority, and the current task queue is confirmed. Please refer to Figure 4b , Figure 4b which is a schematic diagram of a task queue scenario provided by another embodiment of the present application. Figure 4a The tasks in the task queue in [the scenario] are arranged in descending order of the arrangement priority, and the current task queue after sorting as shown in Figure 4b is obtained.

[0053] Exemplarily, according to the task status priority and / or running priority of the tasks in the task queue, the arrangement priority of each task in the task queue is determined, and the tasks in the task queue are arranged according to the arrangement priority, so that when accumulating the task memory, the unrun tasks with a higher priority during execution are preferentially calculated, and the unrun tasks with a higher priority during execution are retained in the internal memory.

[0054] In some embodiments, when the load memory is less than the warning memory threshold, the method further includes: sequentially obtaining the task memory occupied by each task in the current task queue according to the preset task arrangement order, and adding the obtained task memory to the current task cumulative memory; when the task cumulative memory is within the preset memory occupancy range, stop calculating the task cumulative memory; and determining the tasks in the current task queue that have not been accumulated as the first target tasks.

[0055] Exemplarily, the task memory occupied by each task is sequentially obtained according to the arrangement order of the tasks in the task queue. The value of the task cumulative memory can be preset. For example, the task cumulative memory is set to 0, and then the task memory corresponding to each obtained task is sequentially added to the task cumulative memory. Figure 4bFor example, first, obtain the task memory A corresponding to task 1, add A to the current task accumulation memory (e.g., 0) to obtain the current task accumulation memory A at this time; second, obtain the task memory B corresponding to task 2, add B to the current task accumulation memory (e.g., A) to obtain the current task accumulation memory A + B at this time; and so on until the value of the task accumulation memory is within the preset memory occupancy range or the accumulation of the task memories of all tasks in the current task queue is completed. When the task accumulation memory is within the preset memory occupancy range, stop calculating the task accumulation memory, and determine the tasks in the current task queue that have not been accumulated as the first target tasks, so that after scheduling the first target tasks to the external memory, the total memory occupied by each task in the current task queue remains within the preset memory occupancy range.

[0056] Step S104, when the task accumulation memory is within the preset memory occupancy range, determine the tasks in the current task queue that have not been accumulated as the first target tasks.

[0057] Exemplarily, in order to control the total memory occupied by each task in the internal memory task queue within the preset memory occupancy range to ensure that while the handheld financial terminal maximally uses the storage space of the internal memory, the tasks in operation can run smoothly. When the task accumulation memory is within the preset memory occupancy range, determine the tasks in the current task queue that have not been accumulated as the first target tasks, so as to schedule the tasks exceeding the preset memory occupancy range to the external memory.

[0058] Take Figure 4b as an example. According to Figure 4b the order in, accumulate the task memories of each task to obtain the task accumulation memory. If the value of the task accumulation memory is within the preset memory occupancy range after including the task memory corresponding to task 5 in the task accumulation memory, stop calculating the task accumulation memory, and determine tasks 4 and 6 that have not been accumulated as the first target tasks.

[0059] Specifically, the preset memory occupancy range can be set according to actual needs. For example, the memory occupancy range can be set to 95% - 98% of the storage space of the internal memory. When the calculated task accumulation memory is within 95% - 98% of the storage space of the internal memory, stop calculating the task accumulation memory, and determine the tasks that have not been accumulated as the first target tasks, so as to control the total memory occupied by each task in the task queue within 95% - 98% of the storage space of the internal memory. Of course, it is not limited to this, and the memory occupancy range can also be other preset ranges, which are not limited here.

[0060] Step S105: Schedule the first target task to an external memory.

[0061] Exemplarily, scheduling the first target task to an external memory may be to schedule all the address spaces of the first target task to the external memory, or to schedule some of the address spaces of the first target task to the external memory according to the actual situation, which is not limited herein.

[0062] Exemplarily, the external memory may be a hard disk, a floppy disk, an optical disc, a USB flash drive, etc., which is not limited herein.

[0063] Please refer to Figure 4c , Figure 4c which is a schematic diagram of a scenario of a task scheduling method provided by an embodiment of the present application. As Figure 4c shown, if the task memory corresponding to Task 5 is included in the task cumulative memory and the value of the task cumulative memory is within the preset memory occupancy range, then calculate the task cumulative memory is stopped, and Tasks 4 and 6 that have not been accumulated are determined as the first target tasks and scheduled to the external memory.

[0064] Please refer to Figure 5 , Figure 5 which is a flowchart of a task scheduling method provided by another embodiment of the present application. As Figure 5 shown, in some embodiments, Step S105 includes: Step S1051: Determine a target external memory for storing the first target task according to the memory space occupied by the first target task; Step S1052: Schedule at least some of the address spaces of the target task from the internal memory to the target external memory.

[0065] Exemplarily, if there are multiple external memories in the present application, before scheduling the first target task to the external memory, first determine a target external memory for storing the first target task according to the memory space occupied by the first target task, and schedule at least some of the address spaces of the target task from the internal memory to the target external memory. For example, if the space occupied by the first target task is large, then determine the external memory with a larger available space as the target external memory. It can be understood that the target external memory may be one or multiple, that is, the first target task may be scheduled to the same external memory or to different external memories, which is not limited herein.

[0066] Determining a target external memory for storing the first target task according to the memory space occupied by the first target task improves the flexibility of scheduling the first target task to the external memory and can make more reasonable use of the storage space of the external memory.

[0067] In some embodiments, according to the arrangement priority corresponding to the first target task, determine the arrangement order of the first target task in the external memory. For Figure 4c example, schedule task 4 and task 6 to the external memory, and determine the arrangement order of the first target task in the external memory according to the arrangement priorities corresponding to task 4 and task 6. For example, arrange the first target tasks in the external memory in descending order of arrangement priority, that is, arrange task 4 and task 6 in the external memory in descending order of arrangement priority.

[0068] In some embodiments, the task scheduling method further includes: when the total memory occupied by each task in the internal memory is less than the minimum value of the memory occupation range, determine at least one task in the external memory as the second target task according to the arrangement order of the first target task in the external memory; schedule the second target task to the internal memory.

[0069] Exemplarily, when the total memory occupied by each task in the internal memory task queue is less than the minimum value of the memory occupation range, for example, the memory occupation range is 95%-98% of the internal memory storage space, when the total memory occupied by each task in the internal memory task queue is less than 95% of the internal memory storage space, schedule the second target task in the external memory to the internal memory to ensure that the memory size occupied by the tasks in the internal memory is within the memory occupation range and make full use of the storage space of the internal memory.

[0070] Exemplarily, when scheduling the second target task in the external memory to the internal memory, schedule the second target task with a higher priority in the external memory to the internal memory, that is, schedule the second target task with a higher arrangement priority in the external memory to the internal memory.

[0071] In some embodiments, determine the arrangement order of the second target task according to the arrangement priority corresponding to the second target task in the external memory, so that when the total memory occupied by each task in the internal memory task queue is less than the minimum value of the memory occupation range, schedule the second target task with a higher arrangement priority to the internal memory, improving the rationality of task scheduling.

[0072] Exemplarily, after the available memory in the internal memory increases, determine the second target task and schedule the second target task back to the internal memory to ensure that the processor can directly execute the tasks waiting to be executed in the internal memory after executing the tasks in the running state, improving the task execution efficiency.

[0073] The task scheduling method provided by this application obtains the load memory of the internal memory in the handheld financial terminal; when the load memory is greater than or equal to the warning memory threshold, the unrun tasks in the task queue are determined as the first target tasks; when the load memory is less than the warning memory threshold, according to the preset task arrangement order, the task memory occupied by each task in the current task queue is obtained in sequence, and the task cumulative memory is calculated based on the task memory; when the task cumulative memory is within the preset memory occupancy range, the tasks in the current task queue that have not been accumulated are determined as the first target tasks; and the first target tasks are scheduled to the external memory. Transferring at least some of the unrun tasks to the external memory can flexibly and reasonably utilize the memory space of the handheld financial terminal, improve the utilization efficiency of the memory space, and improve the user experience.

[0074] Exemplarily, the above task scheduling method can be implemented in the form of a computer program, and this computer program can run on a handheld financial terminal as shown in Figure 6 Figure.

[0075] Please refer to Figure 6 , Figure 6 which is a schematic block diagram of the structure of a handheld financial terminal provided by an embodiment of this application.

[0076] As shown in Figure 6 Figure, this handheld financial terminal includes a processor, a memory, and a network interface connected through a system bus. Among them, the memory can include a storage medium and an internal memory.

[0077] The storage medium can store an operating system and a computer program. This computer program includes program instructions, and when these program instructions are executed, the processor can execute any task scheduling method.

[0078] The processor is used to provide computing and control capabilities to support the operation of the entire handheld financial terminal.

[0079] The internal memory provides an environment for the operation of the computer program in the storage medium. When this computer program is executed by the processor, the processor can execute any task scheduling method.

[0080] This network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that the structure shown in Figure 6 Figure is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the handheld financial terminal to which the solution of this application is applied. The specific handheld financial terminal may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0081] It should be understood that the processor can be a Central Processing Unit (CPU), and the processor can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor, or the processor can also be any conventional processor, etc.

[0082] Among them, in one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0083] Obtain the load memory of the internal memory in the handheld financial terminal;

[0084] When the load memory is greater than or equal to the warning memory threshold, determine the tasks that have not been run in the task queue as the first target tasks;

[0085] When the load memory is less than the warning memory threshold, sequentially obtain the task memory occupied by each task in the current task queue according to the preset task arrangement order, and calculate the task cumulative memory according to the task memory;

[0086] When the task cumulative memory is within the preset memory occupancy range, determine the tasks that have not been accumulated in the current task queue as the first target tasks;

[0087] Schedule the first target tasks to the external memory.

[0088] In one embodiment, when the processor implements the step of when the load memory is less than the warning memory threshold, sequentially obtain the task memory occupied by each task in the current task queue according to the preset task arrangement order, and calculate the task cumulative memory according to the task memory, it is used to implement:

[0089] Sequentially obtain the task memory occupied by each task in the current task queue according to the preset task arrangement order, and add the obtained task memory to the current task cumulative memory;

[0090] When the task cumulative memory is within the preset memory occupancy range, stop calculating the task cumulative memory;

[0091] Determine the tasks in the current task queue that have not been accumulated as the first target tasks.

[0092] In one embodiment, before the processor implements obtaining the task memory occupied by each task in the current task queue in sequence according to the preset task arrangement order and calculating the task accumulation memory based on the task memory, it is used to implement:

[0093] Determine the arrangement priority of each task in the task queue according to the task status priority and / or running priority of each task in the task queue;

[0094] Determine the preset task arrangement order according to the arrangement priority corresponding to each task in the task queue.

[0095] In one embodiment, when the processor implements determining the arrangement priority of each task in the task queue according to the task status priority and / or running priority of each task in the task queue, it is used to implement:

[0096] Sort the task status priorities of each task in the task queue according to the task status of each task; wherein, in the task queue, the task status priority corresponding to a task with a ready task status is higher than the task status priority corresponding to a task with a blocked task status;

[0097] Sort the running priorities of tasks with the same task status according to the importance degree of each task, and then determine the arrangement priority of each task; wherein, when there are tasks with the same task status in the task queue, the arrangement priority corresponding to a task with a higher running priority is higher than the arrangement priority corresponding to a task with a lower running priority.

[0098] In one embodiment, when the processor implements scheduling the first target task to an external memory, it is used to implement:

[0099] Determine the target external memory for storing the first target task according to the memory space occupied by the first target task;

[0100] Schedule at least part of the address space of the target task from the internal memory to the target external memory.

[0101] In one embodiment, after the processor implements scheduling the first target task to an external memory, it is used to implement:

[0102] Determine the arrangement order of the first target task in the external memory according to the arrangement priority corresponding to the first target task.

[0103] In one embodiment, when implementing the task scheduling method, the processor is further configured to implement:

[0104] When the total memory occupied by each task in the internal memory is less than the minimum value of the memory occupation range, at least one task in the external memory is determined as a second target task according to the arrangement order of the first target task in the external memory;

[0105] Schedule the second target task to the internal memory.

[0106] In one embodiment, when implementing the acquisition of the load memory of the internal memory in the handheld financial terminal, the processor is configured to implement:

[0107] Determine the load memory according to the linked list for recording the memory occupied by the tasks with the running state in the internal memory.

[0108] It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described task scheduling can refer to the corresponding process in the foregoing embodiment of the task scheduling control method, and will not be elaborated herein.

[0109] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions, and the method implemented when the program instructions are executed can refer to each embodiment of the task scheduling method of the present application.

[0110] It should be understood that the terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of the present application and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.

[0111] It should also be understood that the term "and / or" used in the specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations. It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or system including the element.

[0112] The serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments. The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A task scheduling method, applied to a handheld financial terminal, characterized in that, The method includes: Obtaining the loaded memory of the internal memory in the handheld financial terminal, where the loaded memory is the memory occupied by tasks with a running task status; When the loaded memory is greater than or equal to the warning memory threshold, determining the tasks that have not been run in the task queue as the first target tasks, where the task queue is stored in the internal memory and includes running tasks and tasks that have not been run. A running task refers to a task in a running state, and a task that has not been run refers to a task that has not been run temporarily or cannot be run; When the loaded memory is less than the warning memory threshold, sequentially obtaining the task memory occupied by each task in the current task queue according to the preset task arrangement order, and calculating the cumulative task memory based on the task memory; When the cumulative task memory is within the preset memory occupancy range, determining the tasks that have not been accumulated in the current task queue as the first target tasks; Scheduling the first target tasks to an external memory; Before sequentially obtaining the task memory occupied by each task in the current task queue according to the preset task arrangement order and calculating the cumulative task memory based on the task memory, it further includes: Determining the arrangement priority of each task in the task queue according to the task status priority and / or running priority of each task in the task queue; Determining the preset task arrangement order according to the arrangement priority corresponding to each task in the task queue; Determining the arrangement priority of each task in the task queue according to the task status priority and / or running priority of each task in the task queue includes: Performing a task status priority sorting on each task in the task queue according to the task status of each task; Performing a running priority sorting on tasks with the same task status according to the importance of each task, thereby determining the arrangement priority of each task in the task queue; When the loaded memory is less than the warning memory threshold, the method further includes: Pre-setting the value of the cumulative task memory to 0, sequentially obtaining the task memory occupied by each task in the current task queue according to the preset task arrangement order, and adding the obtained task memory to the current cumulative task memory; When the cumulative task memory is within the preset memory occupancy range, stopping the calculation of the cumulative task memory; Determining the tasks that have not been accumulated in the current task queue as the first target tasks.

2. The task scheduling method according to claim 1, wherein There are multiple external memories, and scheduling the first target tasks to the external memories includes: Determining the target external memory for storing the first target tasks according to the memory space occupied by the first target tasks; Scheduling at least part of the address space of the target task from the internal memory to the target external memory.

3. The task scheduling method according to claim 1, wherein After scheduling the first target tasks to the external memory, it further includes: Determining the arrangement order of the first target tasks in the external memory according to the arrangement priority corresponding to the first target tasks.

4. The task scheduling method according to claim 3, wherein The method further includes: When the total memory occupied by each task in the internal memory is less than the minimum value of the memory occupancy range, at least one task in the external memory is determined as the second target task according to the arrangement order of the first target task in the external memory; Schedule the second target task to the internal memory.

5. The task scheduling method according to claim 1, wherein The obtaining the load memory of the internal memory in the handheld financial terminal includes: Determine the load memory according to the linked list for recording the memory occupied by the tasks with the running state in the internal memory.

6. A handheld financial terminal, characterized in that, The handheld financial terminal includes a processor, a memory, and a computer program stored on the memory and executable by the processor. When the computer program is executed by the processor, the steps of the task scheduling method according to any one of claims 1 to 5 are implemented.

7. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, the steps of the task scheduling method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Cloud control method and device, computer equipment and storage medium

    CN109597681A

  • Memory management method and device

    CN110865884A