Method for processing tasks in parallel by using registers and corresponding device
By using register-based parallel task processing, the challenge of circuit-level multitasking parallel processing is solved, enabling efficient concurrent and synchronous processing of multiple tasks, ensuring priority for critical tasks, preventing resource preemption, and improving the processor's task distribution efficiency.
Patent Information
- Application Number
- CN202410927002.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-12
AI Technical Summary
In circuit-level scenarios, how to effectively handle the problem of parallel processing of highly correlated multi-tasks, especially when existing multi-core or related hardware is insufficient, how to achieve parallel processing of multi-tasks to improve hardware processing performance.
The method of parallel processing of tasks using registers generates counting data through a first counter, generates flag counts through a second counter, and generates a task sequence through a master control register. By combining the control of flag counts and task sequences, parallel processing and synchronization masking of tasks are achieved, preventing task contention, and data width expansion and synchronization masking are performed when a new task is inserted.
It improves the response speed and task distribution efficiency of multi-task processing, ensures that critical tasks are executed first, prevents non-critical tasks from preempting resources, and realizes efficient concurrent processing and synchronous coupling or decoupling in multi-task scenarios, avoiding abrupt changes when switching tasks.
Smart Images

Figure CN118939318A_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the technical field of electronic circuit design, and more specifically, to a method and device for using registers to parallelly process tasks in data processing or multi-task carrying. Background Art
[0002] In many cases, it is necessary to process multiple target tasks in parallel. For example, multiple target tasks do not exist in isolation but are related to each other. This correlation is reflected in the fact that the overall effect caused by the joint action of multiple target tasks can achieve an expected result. Typically, many current hardware such as processors or programmable logic devices need to execute more than one thread of tasks in roughly the same time period, thereby improving hardware processing performance; and even adapting to some parallel processing functions of current mainstream programming software. For example, replacing a single core with a multi-core is the most common and direct means to achieve parallel processing capabilities, but in finer-grained or smaller-level scenarios such as the circuit description level, there is no multi-core or related multi-core hardware for scheduling. Similar scenarios have great difficulties in solving multi-tasks. How to implement parallel processing for multiple tasks with strong correlation in circuit-level scenarios is one of the problems that need to be solved urgently. Summary of the invention
[0003] The present application relates to a method for processing tasks in parallel using registers, characterized in that it includes:
[0004] Using a first counter to generate count data;
[0005] A second counter is used to generate a flag count, and the flag count is accumulated once each time the count data of the first counter reaches a predetermined value;
[0006] A task sequence is generated by using a master control register, whose data width is equal to the total task amount of multiple tasks to be processed in parallel, and the first type of code element in the task sequence of the master control register is used to indicate the execution of a task (such as a main task) and the second type of code element opposite to the first type of code element represents that the task (such as the main task) is temporarily suspended and not executed;
[0007] The master control register determines the next task sequence in response to the flag count and the previous task sequence. When the flag count reaches a preset cumulative value:
[0008] If the previous task sequence is equal to the end value of the sequence, the next task sequence jumps to the first value of the sequence. If the previous task sequence is not equal to the end value of the sequence, the next task sequence shifts the current value once, and the shift amount is a certain value.
[0009] The above-mentioned method of register parallel processing tasks, wherein: when the counting data of the first counter counts to a maximum value, the counting data of the first counter jumps to a zero value and starts counting upward again, and the size of the maximum value is adjustable.
[0010] In the above-mentioned method for register parallel processing tasks, the predetermined value is equal to the maximum value minus a specified scale, and the scale measurement of the specified scale is flexibly adjustable.
[0011] The above-mentioned method of register parallel processing tasks, wherein: the enable state of the flag count is a single pulse signal and each time the count data of the first counter reaches the predetermined value, the flag count is accumulated to the enable state once, and when the count data is not equal to the predetermined value, the flag count returns to zero and is disabled; so that the number of times the flag count appears in the enable state is the same as the data width of the task sequence, that is, the tasks represented by each task sequence (such as the main task) are executed at least in one enable state of the flag count.
[0012] The above-mentioned method for parallel processing of tasks by registers, wherein: the enable state of the flag count is a specified increment value and each time the count data of the first counter reaches a predetermined value, the flag count is continuously accumulated, a part of the accumulated value of the flag count is set to a specified increment value, and the flag count is disabled when the accumulated value is a non-specified increment value; thereby, the number of times the flag count appears in the enable state is lower than the data width of the task sequence, that is, the tasks represented by a part of the task sequence (such as the main task) are executed in the corresponding enable state of the flag count, and the tasks represented by the remaining task sequence (such as the main task) are suspended.
[0013] The above-mentioned method of register parallel processing tasks, wherein: all parallel tasks represented by the task sequence are synchronously shielded in a manner that, based on the situation where the flag count reaches a preset cumulative value, when the previous task sequence is equal to the end value of the sequence, the next task sequence is prohibited from jumping to the beginning value of the sequence, and the task sequence is guided to shift once from the current value, and the shift amount is a determined value, until the task sequence completely overflows.
[0014] The above-mentioned method of register parallel processing tasks, wherein: the binary number of the task sequence is inverted bit by bit to obtain an inverted sequence, the inverted sequence is used as an external task control signal and the second type of code element in the inverted sequence is used to indicate the execution of the task (such as the main task), and the first type of code element represents that the task (such as the main task) is not executed, thereby preventing multiple tasks (such as the main task) from competing in a single cycle of the same flag count.
[0015] The above-mentioned method for parallel processing of tasks by registers, wherein: before a new task is inserted into the initial task sequence, all parallel tasks represented by each initial task sequence must be synchronously shielded, and the data width of the initial task sequence must be expanded to the total task amount of the current task; the weight of the extended bit of any task sequence after the data width expansion is set to be higher than the weight of the original sequence value of any task sequence before the expansion, and any task sequence after the data width expansion retains its original sequence value and also fills its extended bit with zeros; and the low weight bit of a sequence end value in each initial task sequence is filled with zeros until its data width is equal to the total task amount of the current task, and the new sequence formed is regarded as the sequence end value of each task sequence after the data width expansion.
[0016] In the above method for parallel processing of tasks by registers, the task sequence corresponding to the cycle in which the value in a series of accumulated values of the flag count exceeds the specified increment value is forcibly set to the end value of the sequence.
[0017] The above-mentioned method of register parallel processing tasks, wherein: the first type of code element in the task sequence of the master control register is used to indicate the execution of the main task (or the first type of task), the second type of code element opposite to the first type of code element represents that the main task (or the first type of task) is not executed, and the second type of code element is used to indicate the execution of the slave task (the slave task opposite to the main task can be called the second type of task).
[0018] The present application also relates to a device for processing tasks in parallel using registers (also referred to as a register-based multi-tasking device), characterized in that it includes:
[0019] A first counter, used to generate counting data;
[0020] A second counter is used to generate a flag count, and the flag count is accumulated once each time the count data of the first counter reaches a predetermined value;
[0021] A master control register, whose data width is equal to the total amount of multiple tasks to be processed in parallel. The first type of code element in the task sequence of the master control register is used to indicate the execution of a task (such as a main task), while the second type of code element opposite to the first type of code element indicates that the task (such as the main task) is not executed;
[0022] The master control register determines the next task sequence in response to the flag count and the previous task sequence. When the flag count reaches a preset cumulative value:
[0023] If the previous task sequence is equal to the end value of the sequence, the next task sequence jumps to the first value of the sequence. If the previous task sequence is not equal to the end value of the sequence, the next task sequence shifts the current value once, and the shift amount is a certain value.
[0024] The above-mentioned device, wherein: when the counting data of the first counter counts to a maximum value, the counting data of the first counter jumps to a zero value and starts counting upward again, and the size of the maximum value is adjustable.
[0025] The above-mentioned device, wherein: the predetermined value is equal to the maximum value minus a specified scale, and the scale measurement of the specified scale is elastically adjustable.
[0026] The above device, wherein: the enable state of the flag count is a single pulse signal, each time the count data of the first counter reaches the predetermined value, the flag count is accumulated to the enable state once, and when the count data is not equal to the predetermined value, the flag count returns to zero and is disabled;
[0027] The number of times the flag count appears in the enabled state is made the same as the data width of the task sequence, that is, the tasks (such as the main task) represented by each task sequence are executed at least in one enabled state of the flag count.
[0028] The above device, wherein: the enable state of the flag count is a specified increment value, each time the count data of the first counter reaches the predetermined value, the flag count is continuously accumulated, a portion of the accumulated value of the flag count is set to the specified increment value, and the flag count is disabled when the accumulated value is not the specified increment value;
[0029] The number of times the flag count appears in the enabled state is lower than the data width of the task sequence, that is, tasks represented by a part of the task sequence (such as the main task) are executed in the corresponding enabled state of the flag count, and tasks represented by the remaining task sequence (such as the main task) are suspended.
[0030] The above-mentioned device, wherein: all parallel tasks represented by each task sequence are synchronously shielded in a manner: based on the situation where the flag count reaches a preset cumulative value, and when the previous task sequence is equal to the end value of the sequence, the next task sequence is prohibited from jumping to the first value of the sequence, thereby guiding the task sequence to shift once from the current value, and the shift amount is a determined value, until the task sequence completely overflows.
[0031] The above-mentioned device, wherein: the binary number of the task sequence is inverted bit by bit to obtain an inverted sequence, the inverted sequence is used as an external task control signal and the second type of code element in the inverted sequence is used to indicate the execution of the task (such as the main task) and the first type of code element represents the non-execution of the task (such as the main task), so as to prevent multiple tasks (such as the main task) from competing in a single cycle of the same flag count.
[0032] The above-mentioned device, wherein: before a new task is inserted into an initial task sequence, all parallel tasks represented by each initial task sequence are first synchronously shielded, and the data width of the initial task sequence is expanded to the total task amount of the current task; the weight of the extended bit of any task sequence after the data width is expanded is set to be higher than the weight of the original sequence value of any task sequence before the expansion, and any task sequence after the data width expansion retains its original sequence value and also fills its extended bit with zero; the low weight bit of the sequence end value in each initial task sequence is filled with zero until its data width is equal to the total task amount of the current task, and the formed new sequence is regarded as the sequence end value of each task sequence after the data width expansion.
[0033] In the above device, the task sequence corresponding to the cycle in which the value in a series of accumulated values of the flag count exceeds the specified increment value is forcibly set to the end value of the sequence.
[0034] The above-mentioned device, wherein: the first type of code element in the task sequence of the master control register is used to indicate the execution of the main task (or called the first type of task), and the second type of code element opposite to the first type of code element represents that the main task (or called the first type of task) is not executed, but the second type of code element is used to indicate the execution of the slave task (or called the second type of task).
[0035] The above-mentioned device, wherein: the device is any one of processors such as a programmable logic device, a dedicated integrated chip, a microprocessor or a digital signal processor or a graphics processor (in this case, a single processor is allowed to be filled with a large number of repeated master control registers and their corresponding counters, etc., and the processor is almost equivalent to a dedicated multi-tasking distributor).
[0036] The above-mentioned device, wherein: the device is a submodule or subcircuit of any one of the processors such as a programmable logic device, a dedicated integrated chip, a microprocessor or a digital signal processor or a graphics processor (in this case, a single processor is allowed to contain a small number of master control registers and their corresponding counters, etc., and some submodules or subcircuits of the processor present the function of task distribution but the processor still maintains its original function, such as maintaining the original functions of CPU / GPU / DSP / FPGA, etc.).
[0037] One of the advantages of the present application. Implementing parallel processing for cross-tasks with strong correlation not only improves the response speed of these multiple cross-tasks and realizes efficient and fast task distribution. Moreover, under the condition of synchronous execution between multiple concurrent tasks, the inherent correlation between any two tasks in the multiple tasks is synchronously coupled or decoupled. In other words, the correlation between any two concurrent tasks does not have any lag time during their coupling or decoupling, which will greatly improve the data concurrency and task processing capabilities in the multiple task scenario. For example, the processing result of a single event is the result of the execution of these multiple tasks separately, and there is also an inherent internal interaction between the multiple tasks. Then the advantage of the present application is that the cross-tasks can be logically coupled or decoupled and synchronously implemented in parallel. Thereby, efficient task execution and multi-task concurrent processing results are achieved with extremely low interaction bandwidth between multiple tasks.
[0038] The second advantage of this application. Allowing non-critical tasks or non-critical businesses among multiple tasks to be executed by jumping local cycles or jumping optional cycles is intended to ensure that critical tasks or businesses are executed first and prevent non-critical tasks or non-critical businesses from occupying too much limited resources. Excessive occupation of limited resources such as computing power resources or bandwidth resources by non-critical tasks or non-critical businesses will drag down the timeliness of critical tasks or businesses, which is a manifestation of unreasonable task allocation. This application allows non-critical tasks or non-critical businesses to be suspended in local cycles or optional cycles, and allows critical tasks or critical businesses to use computing power resources or bandwidth resources and other hardware support conditions required to implement tasks, thereby achieving reasonable task allocation.
[0039] The third advantage of the present application. In terms of queuing new tasks or inserting new tasks, the mode of synchronous shielding of the original tasks is based on shifting until the task sequence is completely overflowed, and the queuing of new tasks or inserting new tasks is based on the synchronous shielding of the original tasks and expanding the data width of the task sequence of the original tasks to the total task volume of the current task. It can be seen from this that the insertion of new tasks into the original tasks will not appear abrupt, and the new tasks (such as the amount of new data to be processed) can be blended into the original tasks (such as the amount of original data to be processed) without any sense of disobedience. During the period when the new tasks are switched to the queue of the original tasks, there will be no sense of jumping or abrupt step changes in the switching of tasks or services. This is because the task sequence of the original tasks changes synchronously during this period and the new sequence values of the task sequence are based on the old sequence values, and the sequence values corresponding to the new tasks are also coupled with the old sequence values, so the state of the original tasks can smoothly transition to the state of inserting the new tasks.
[0040] According to the practice of this industry or field, the register can be prepared in a semiconductor chip (the typical application of the device mentioned in the context is a semiconductor chip), so the subject of this article can also be replaced by "a semiconductor chip supporting parallel processing tasks and a method for implementing parallel processing tasks". Semiconductor chips usually include various types of processors such as microprocessors, programmable logic devices, digital signal processors, or graphics processors. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to make the above purposes, features and advantages more understandable, the following text will explain the specific implementation methods in detail in conjunction with the drawings. After reading the following description and referring to the following drawings, the features and advantages of the present application will become apparent.
[0042] Figure 1 It is an example of registers distributing tasks to different controlled units such as processors in parallel.
[0043] Figure 2 This is an embodiment in which a master control register cooperates with a first counter and a second counter.
[0044] Figure 3 It is an embodiment of inverting the binary number of the task sequence bit by bit to obtain an inverted sequence.
[0045] Figure 4 Registers distribute tasks in parallel to controlled units such as hardware other than processors.
[0046] Figure 5 A portion of the accumulated value of the flag count is set to the specified increment value.
[0047] Figure 6 The tasks represented by the task sequence are executed or suspended in the enabled state. DETAILED DESCRIPTION
[0048] The technical solutions disclosed in the present application are clearly and completely described below in conjunction with various specific embodiments. However, the described embodiments are only embodiments used for narrative explanation in the present application rather than all embodiments. Based on these embodiments, technicians in this field should realize that any solution obtained without creative work falls within the scope of protection of the present application.
[0049] See also Figure 1, register is a common circuit unit of a controller (processor) such as a microprocessor or programmable logic device or digital signal processor or graphics processor. In a circuit system, especially a large system, it is difficult to process all the data to be processed at one time in a timely manner. During the processing, the data or code to be processed needs to be stored in advance so that it can be easily accessed at any time when necessary. The device TD0 shown in the figure includes a register, which can also be replaced by a circuit or module or unit in the context. It is one of the cores of parallel distribution of multi-tasks. Under current technical conditions, multi-task dispatching mainly uses a multi-core solution, but it is based on the level of the processor rather than in a finer granularity or smaller level scenario such as the circuit description level to achieve parallel processing capabilities. In many industrial control occasions, multi-core processors that are expensive, require a large printed circuit board area, and have harsh conditions such as air cooling or water cooling are not used. Instead, logic devices with relatively few transistors and relatively cheap are used. At this time, it is necessary to equip similar logic devices with devices that can use registers to process tasks in parallel as mentioned in this article. If the multi-core processor is also equipped with a device that can use registers to process tasks in parallel, this device can be used as a dedicated function, such as manipulating multiple pixels at the same time and giving grayscale data in parallel for multiple pixels to achieve parallel image processing or graphics rendering, and does not occupy and schedule the multiple cores of the existing processor. How to implement parallel processing for multiple tasks with strong correlation at the circuit level, especially at the register level, is one of the core issues that this article needs to solve. The so-called strong correlation is typically that one of the tasks among the multiple tasks (such as giving or assigning grayscale values) is not given instructions in parallel, then the remaining tasks cannot achieve the best overall effect. It is also worth noting that the opposite correlation is weak, which is typically that one of the tasks among the multiple tasks (such as multiple tasks belonging to different events) is not given instructions in parallel, then the effects of the remaining tasks will not be affected.
[0050] See also Figure 1 The figure shows that multiple processors prsor1-prsor4 receive concurrent instructions or control signals from device TD0. The process of parallel task processing or parallel data processing will be described below between multiple processors prsor1-prsor4 and device TD0, but the concurrent instructions or control signals from device TD0 are not limited to being distributed to the processors, but can also be distributed to other types of hardware.
[0051] See also Figure 2, assuming that device TD0 is a submodule or subcircuit of processor prsor1, the processor is allowed to maintain its original functions such as CPU / GPU / DSP / FPGA / MCU, and some submodules or subcircuits of the processor present the function of task distribution, but the processor still maintains its original function. The intersection of processors prsor1-prsor3 in the figure indicates that device TD0 can belong to both prsor1 and prsor3. The intersection of processors prsor1-prsor3 in the figure also indicates that device TD0 can manipulate both prsor1 and prsor3. At this time, processor prsor1 is only designed with a small number of submodules or subcircuits with distribution tasks, namely device TD0.
[0052] See also Figure 2 If the device TD0 is a multiple sub-module or sub-circuit of the processor prsor1, that is, a single processor is filled with a large number of repeated devices TD0, and its proportion occupies the vast majority of the processor, then the processor is equivalent to a dedicated multi-task distributor (task distribution). Semiconductor chips with multiple sub-modules or sub-circuits are usually considered to be a type of application-specific integrated circuit (ASIC). At this time, the processor prsor1 is designed with a large number of sub-modules or sub-circuits with distributed tasks, namely, device TD0.
[0053] See also Figure 2 In an optional embodiment, taking processor prsor1 as an example, using its registers to parallel process tasks involves the first counter CNT1, the second counter CNT2 and the master register REG1. The register has been explained in the previous text. The counter is also one of the commonly used logic circuits in digital circuits. Counting is a basic operation and the counter is a logic circuit that implements this operation. The counter in the digital system mainly counts the number of pulses and can realize the functions of measurement, counting and control, and also has the functions of frequency division.
[0054] See also Figure 2 In an optional embodiment, the first counter CNT1 is used to generate counting data and for the convenience of explanation, cnt (or cnt_1) is used to represent the counting data generated by the first counter CNT1.
[0055] See also Figure 2In an optional embodiment, the clock signal CLK1 provided by the processor prsor1 is used as an example to trigger the so-called first counter CNT1 to count. Of course, the clock signal CLK3 provided by the processor prsor3 can also trigger the so-called first counter CNT1 to count. Therefore, the system clock can be used to match the counting requirements of the first counter, such as a system clock of 50MHZ, 200MHZ, 800MHZ, 1GHZ or a higher frequency. Usually each clock signal can trigger the first counter CNT1 to count once. Of course, the clock signal can also be used to trigger the first counter CNT1 to count after being divided or multiplied. Generally speaking, the first counter is closely related to the relevant hardware resources. If the first counter is not adapted, the relevant cycle of task execution will be directly linked to the system clock and this is extremely lacking in task scheduling flexibility for tasks with different beat requirements. It is worth noting that the so-called first counter CNT1 can be triggered to count more than just clock signals CLK1, CLK3, etc. For example, a crystal oscillator or other processor or similar clock hardware (especially a clock chip) can provide the clock signal required for counting. Such clock signals can replace the clock signals CLK1, CLK3, etc. shown in the figure.
[0056] See also Figure 2 In an optional embodiment, the second counter CNT2 is used to generate the flag count and for the convenience of explanation, fg (or fg_c) is used as the flag count. It must be emphasized that there is a great difference between the flag count of the second counter and the count data of the first counter mentioned above. Considering that cnt is a natural count and basically it is the timing source of the flag count fg and the task sequence seq of the master register REG1, cnt is usually required to have strict timing constraints. However, the flag count fg is a regulating parameter directly involved in task allocation, so fg is required to have flexible elasticity and adjustability, so that the flag count fg has variable characteristics in the stage of allocating multiple tasks. In fact, the count data cnt of the first counter can be considered as one of the measures to isolate the flag count fg of the second counter from the system clock, and the main reason is that the flag count fg advocates decoupling from the system clock, which can meet the following special counting methods that are adapted to the requirements of multiple tasks, such as arbitrary stagnation or regression or sequential accumulation of the flag count fg.
[0057] See also Figure 2In an optional embodiment, each time the count data cnt of the first counter CBT1 reaches a predetermined value pre_v that has been designed in advance, the flag count fg is accumulated once. Note that the size of the predetermined value pre_v is not limited to a fixed value but can be adjusted in size. In a task-intensive environment, the size of the predetermined value pre_v is usually designed to be a smaller value, such as when there are many tasks per unit time. In a task-sparse environment, the size of the predetermined value pre_v is usually designed to be a larger value, such as when there are few tasks per unit time. This is the normal situation. If the flag count fg is used for task adaptation, the opposite setting scheme of the predetermined value is also allowed: in a task-intensive environment, the size of the predetermined value pre_v is usually designed to be a larger value if there are many tasks per unit time; in a task-sparse environment, the size of the predetermined value pre_v is usually designed to be a smaller value if there are few tasks per unit time. This is the reverse situation. It is assumed that the preset value pre_v needs to be set to 0x17d7 in a certain multi-tasking environment. If more tasks are performed in the same unit time, the preset value pre_v is subsequently set to 0x15d7 again in the environment where the tasks change. Other task changes and preset value changes will not be described in detail.
[0058] See also Figure 2In an optional embodiment, a master control register REG1 is used to generate a task sequence, and the task sequence is represented by seq in the figure. The output part of the master control register REG1 is the generated task sequence, and the data width of the task sequence seq is equal to the total task volume of multiple tasks that need to be processed in parallel. For example, assuming that the total task volume that needs to be processed in parallel is x, the data width of the task sequence seq is [x-1:0]. Note that the advantage of the data width being equal to the total task volume of multiple tasks is that it is convenient to control the tasks in all aspects in terms of multi-task sorting, multi-task queue processing, and multi-task anchoring, but the disadvantage and difficulty is that when a new task is inserted into a fixed task sequence, the established execution plan of the original task will be broken. For example, when a new task is inserted into the initial task sequence, it is easy to cause a temporary disorder in the initial task sequence, and the external appearance is that the entire system enters a short-term out-of-control state. In fact, it can also be explained from the data width of the task sequence seq. If [x-1:0] suddenly changes to [x+1:0], the sudden change in bit width will cause a disorder of multiple tasks with strong correlation. Take image rendering as an example. The task sequence seq manipulates a normal picture or video frame at the previous moment and inserts a new texture due to rendering requirements. Assuming that the original task involves [x-1:0] and the newly inserted task involves [x+1:0], the bit width is suddenly changed. This abrupt change will cause the image to produce abnormal disorder conditions such as local pixel loss or area pixel overlap at least during the task switching and task addition. A large part of the reason is the destruction of the correlation between multiple tasks: for example, each sequence value indicates a part of the pixels. When the task sequence changes abruptly, it is equivalent to breaking the old correlation of the original task and building a new correlation for subsequent multiple tasks. The subsequent multiple tasks cannot adapt to the best new correlation well before data integration and data conditioning. During this time gap or integration period, various unpredictable disorder conditions will occur.
[0059] See also Figure 2In an optional embodiment, the task sequence seq of the master control register REG1 contains a large number of code elements and the first type of code elements therein are used to indicate the execution of the task, while the second type of code elements, which are opposite to the first type of code elements, represent that the task is temporarily suspended (pending) and not executed. One of the reasons for linking code elements with tasks is that in many scenarios, a good mapping relationship can be generated between the features that are easy to fill and extract by code elements and the requirements of multiple tasks. The storage disks that typically build a disk array need to process their respective data operations concurrently and the code element stream can be mapped. For example, in image processing, the grayscale data processing of multiple pixel points of graphics needs to be processed concurrently and the code element stream can be mapped, such as the synchronization of multiple sub-display screens of multi-screen display needs to be processed concurrently and the code element stream can be mapped, such as the interaction between multiple nodes in a distributed network of multi-processor nodes needs to be processed concurrently and the code element stream can be mapped, such as the distributed photovoltaic components of photovoltaic power stations as the power supply part of the inverter need to be scheduled concurrently and the code element stream can be mapped. Like this and not limited to the limited examples mentioned here, the mapping of tasks and codeword streams will be explained below.
[0060] See also Figure 2 In an optional embodiment, the master control register REG1 determines the next task sequence (next sequence) in response to the flag count fg and the previous task sequence (previous sequence). Note that in the optional embodiment, the output portion of the master control register, i.e., the generated task sequence seq (sequence), preferably has a pre-designed or pre-defined sequence value, i.e., a preset sequence value (predetermined-sequence). As an example used for explanation but not constituting any limitation, the preset sequence value is expressed by a serialized numerical value such as ...0001..., ...0010..., ...0100..., etc., but is of course not limited to this. For another example, a preset sequence value is expressed by a similar serialized numerical value such as ...001..., ...010..., ...100..., etc., and the actual value of the preset sequence value is not limited to this. For the convenience of explanation, this article sets the previous task sequence and the next task sequence to be expressed by ps and ns respectively. The preset sequence values of the task sequence seq include a sequence first value, a sequence last value, and an intermediate sequence value between the sequence first value and the sequence last value. The first sequence value in the preset sequence values is called the sequence first value (seq_1st), the last sequence value in the preset sequence values is called the sequence last value (seq_end), and other sequence values other than the first and last are called intermediate sequence values, and the intermediate sequence value can be a single sequence value or a positive integer sequence value greater than 1.
[0061] See also Figure 2In an optional embodiment, when the flag count fg reaches the preset cumulative value CV, the following conditions must be met: if the previous task sequence ps is equal to the sequence end value (the last sequence value in the task sequence seq is called the sequence end value), the next task sequence ns jumps to the sequence head value; if the previous task sequence ps is not equal to the sequence end value, the next task sequence ns shifts once from the current value, and the shift amount is a certain value (shift_v). Note that this solution involves two core issues: the first aspect is the pipeline execution of a series of key tasks, and the second aspect is the synchronous execution of many secondary tasks around each key task and each key task.
[0062] See also Figure 2 In an optional embodiment, in order to facilitate understanding, the specific example mentioned above is selected to explain the execution mode of this task. In a scenario where multiple strings ST1-ST3 or more strings are connected in parallel to supply power to an inverter, various tasks need to be issued to each string in different environments: different environments are reflected in the differences in light radiation of different strings, whether there are shadows and the degree of shadowing of each string, whether there are hot spot effects in each string, and the severity of the hot spot of each string, the orientation differences of different photovoltaic modules in a single string, etc. Such environmental differences will require different tasks to be issued to different strings. The following will continue to explain it in detail. For the convenience of explanation, it is assumed that the photovoltaic module is currently an intelligent component with a processor and a power converter. Therefore, in this implementation example, the implementation of the parallel processing task PTP (parallel task processing) is based on the example of the string ST1-ST3.
[0063] See also Figure 2 In an optional embodiment, the string ST1 of the photovoltaic components PV1-PVK connected in series is assumed to allow the weak light PV1 among the photovoltaic components PV1-PVK to perform maximum power tracking under the difference in light radiation, while the remaining photovoltaic components operate at the normal power point, that is, PV1 of ST1 needs to perform MPPT. The task sequence seq[K-1:0] is the task sequence and output generated by the master control register. The first type of code element in the task sequence seq[K-1:0]=[…001], such as code element one, is used to indicate the execution of the power tracking task, and the second type of code element opposite to the first type of code element, such as code element zero, indicates that the power tracking task is not executed but is at the normal power point. The task sequence seq[K-1:0] is used to control the working status of each photovoltaic component in the series of PVK,…PV2, and PV1. The task sequence seq 1 It is the first sequence and controls the group string ST1: for example, seq[0] in the task sequence indicates the key task of PV1, and seq[K-1:1] indicates the secondary task of PV2-PVK.
[0064] See also Figure 2 In an optional embodiment, the string ST2 of the photovoltaic components PV1-PVK connected in series assumes that the obstructed PV2 in the photovoltaic components PV1-PVK should perform maximum power tracking under the shading difference, while the remaining photovoltaic components work at the normal power point, that is, PV2 of ST2 needs to perform MPPT. The task sequence seq[K-1:0] is the task sequence and output generated by the master control register. The first type of code element in the task sequence seq[K-1:0]=[…010], such as code element one, is used to indicate the execution of the power tracking task, and the second type of code element opposite to the first type of code element, such as code element zero, indicates that the power tracking task is not executed but is at the normal power point. The task sequence seq[K-1:0] is used to control the working status of each photovoltaic component in the series of PVK,…PV2, and PV1. The task sequence seq 2 It is the second sequence and controls the group string ST2: for example, seq[1] in the task sequence is used to indicate the key task of PV2, seq[K-1:2] indicates the secondary task of PV3-PVK, and seq[0] in the task sequence is used to indicate the secondary task of PV1.
[0065] See also Figure 2 In an optional embodiment, the string ST3 of the photovoltaic components PV1-PVK connected in series is assumed to perform maximum power tracking on the shaded side of the photovoltaic components PV1-PVK under different installation orientations, while the remaining photovoltaic components operate at normal power points, that is, PV3 of ST3 needs to perform MPPT. The task sequence seq[K-1:0] is the task sequence and output generated by the master control register. In the task sequence seq[K-1:0]=[…100], the first type of code element, such as code element one, is used to indicate the execution of the power tracking task, and the second type of code element, such as code element zero, which is opposite to the first type of code element, indicates that the power tracking task is not executed but is at normal power point. The task sequence seq[K-1:0] is used to control the working status of each photovoltaic component in a series of PVK,…PV2, and PV1. The task sequence seq 3 It is the third sequence and controls the group string ST3: for example, seq[2] in the task sequence is used to indicate the key task of PV3, seq[K-1:3] indicates the secondary task of PV4-PVK, and seq[1] in the task sequence is used to indicate the secondary task of PV2, and seq[0] indicates the secondary task of PV1.
[0066] See also Figure 2In an optional embodiment, the task sequence designed for each of the three photovoltaic components connected in series, ST1-ST3, changes from seq[…001] to seq[…010] and seq[…100]. If more strings are used, the number of task sequences here is not limited to the aforementioned three; if each string uses more than K photovoltaic components, the data width of each task sequence is not limited to K, that is, it is not limited to [K-1:0].
[0067] See also Figure 2, the master register REG1 responds to the flag count fg and the previous task sequence ps to determine the next task sequence ns. When the flag count fg reaches the preset cumulative value CV: if the previous task sequence ps is equal to the sequence end value seq_end, the next task sequence ns jumps to the sequence head value seq_1st. If the previous task sequence ps is not equal to the sequence end value seq_end, the next task sequence ns shifts once from the current value, and the shift amount is a certain value shift_v. Note that the shift here takes the left shift as an example. But it also includes left shift and right shift. As mentioned above, the inverter senses the environmental status of each photovoltaic module in each string through a sensor. Assuming that the multi-task processing device TD0 is attached to the inverter end, it is necessary to control the strings ST1-ST3 through concurrent instructions or control signals or commands. The intuitive form of the concurrent instructions or control signals or commands issued by the multi-task processing device can be represented by the task sequence seq. How to operate three strings and multiple PV modules in series under each string involves two core issues: the pipeline execution of key tasks such as the maximum power tracking category of MPPT in the three strings (seq[…001], seq[…010], seq[…100]), and the synchronous execution of many secondary tasks such as maintaining normal power and each key task such as MPPT around each key task such as MPPT under a single string. For example, it is necessary to synchronize the normal power point of PVK-PV2 in string ST1 and the maximum power point of PV1, because PVK-PV1 in string ST1 is a series connection relationship that shares the series current and the PV modules in series need to keep synchronization for their respective key tasks or secondary tasks. Obviously, the key tasks and secondary tasks at this time, as well as the secondary tasks, are all highly correlated multi-tasks, and the absence of any secondary task or any key task will lead to the failure of the overall effect. seq[…001] can be assumed as a sequence start value and seq[…100] can be assumed as a sequence end value, and seq[…010] can be assumed as an intermediate sequence value. However, it should be noted that the number of intermediate sequence values in actual applications is far more than the number listed above, and the sequence start value and sequence end value are often not the simplified sample values mentioned above. These specific values are only optional examples for explanation. Cross-critical tasks can be called primary tasks (or first-class tasks) and secondary tasks can also be called secondary tasks (or second-class tasks).
[0068] See also Figure 2, the pipeline mode of key tasks, for example: the master control register responds to the flag count fg and the previous task sequence ps to determine the next task sequence ns, when the flag count fg reaches the preset cumulative value CV: if the previous task sequence ps has been equal to the sequence end value seq_end after one or more shifts, the next task sequence ns jumps to the sequence first value seq_1st, at this time, the task sequence seq triggers the jump due to seq[K-1:0]=seq_end and the coincident synchronization condition is that the flag count fg is exactly equal to the cumulative value MX. The shift of the task sequence will experience the shift from the previous task sequence ps to the next task sequence ns, such as ps=seq[…001] shifting to seq[…010] will not cause the next task sequence ns to jump to the sequence first value seq_1st, but ps=seq[…010] shifting to seq[…100] may cause the next task sequence ns to jump to the sequence first value seq_1st. Even if fg reaches MX, it does not necessarily induce ns to jump to seq_1st. Both the previous task sequence and the next task sequence are selected from the preset sequence value. The above content is the first aspect, that is, the pipeline execution of a series of key tasks or main tasks or first-class tasks.
[0069] See also Figure 2, the pipeline mode of key tasks, for example: the master control register responds to the flag count fg and the previous task sequence ps to determine the next task sequence ns. When the flag count fg reaches the preset cumulative value CV: if the previous task sequence ps is not equal to the sequence end value seq_end, the next task sequence ns is shifted once from the current value and the shift amount is the determined value shift_v. The task sequence seq triggers the shift because seq[K-1:0] is not equal to seq_end and the synchronized flag count fg is equal to the cumulative value MX. The shift of the task sequence undergoes the change from the previous task sequence ps to the shift of the next task sequence. The current value ps=seq[…001] shifts to seq[…010], which is triggered by ps not being equal to seq_end and the flag count being the cumulative value. The current value ps=seq[…010] shifts to seq[…100], which is triggered by ps not being equal to seq_end and the flag count being the cumulative value. If the previous task sequence ps is not equal to the sequence end value seq_end, then the next task sequence ns is shifted once by the current value, and for example, the current value is the previous task sequence ps, and the shift amount of the current value is a predetermined value shift_v that has been defined. In the aforementioned embodiment, shift_v takes a shift amount of 1 as an example, but the shift amount can also be a determined value shift_v such as two or three optional items. In addition, it is noted that in fact, whether it is the previous task sequence or the next task sequence, they can be selected from the preset sequence value. The current value is often the previous task sequence ps, but there are special cases. For example, in the example of skipping cycle tasks or non-executed tasks, the current value may be the previous task sequence ps, but it may also be the previous adjacent task sequence of the previous task sequence ps or the previous task sequence, etc.
[0070] See also Figure 2 , the synchronization of secondary tasks and corresponding key tasks, such as: the first type of code element in the task sequence seq[K-1:0] is used to indicate the execution of the task (key task or main task), and the second type of code element in the task sequence seq[K-1:0], which is opposite to the first type of code element, indicates that the task (key task or main task) is not executed. All code elements in seq[K-1:0] clearly represent a type of business. Taking the string of the photovoltaic power station as an example, the first type of code element in seq[K-1:0] is used to indicate the execution of the task (such as maximum power point tracking), and the second type of code element in the task sequence seq[K-1:0], which is opposite to the first type of code element, indicates that the task (such as maximum power point tracking) is not executed. The second type of code element can indicate that the secondary task or the regular business (such as maintaining the normal power point), that is, the secondary task or the second type of task is executed. The above content is the second aspect, and many secondary tasks around each key task and each key task are executed synchronously. Other terms for a critical task are primary task or first category task, and other terms for a secondary task are secondary task or second category task.
[0071] See also Figure 2 , task sequence seq 1 [K-1:0] rotation seq 2 [K-1:0] rotate seq again 3 [K-1:0], the isolated task sequence corresponding to a single string represents the power optimization of a single string. The parallel strings are quickly and continuously scanned for power, which allows each single string to work at the optimal power point and the power scan allows all parallel strings to provide the optimal power. The actual task sequence is not limited to the aforementioned limited number. The aforementioned limited number of task sequences seq 1 to seq 3 Just as an example.
[0072] See also Figure 2 The second counter CNT2 is mainly used in conjunction with the main control register REG1, thereby forming a working mechanism that can flexibly dispatch tasks and realize full-task concurrent mode or partial-task concurrent mode. The second counter is no longer limited by the system clock. The second counter CNT2 can freely configure the rhythm of executing tasks according to the real-time beat requirements of different types of tasks. Generally speaking, the second counter CNT2 is closely related to the current task beat. Without the adjustment of the second counter, the implementation of the task is not only lacking in scheduling flexibility, but also almost difficult to reasonably switch and freely choose between the full-task mode or the partial-task mode.
[0073] See also Figure 2 , Multi-task scheduling of known technologies in this field: There are many priority-based dynamic scheduling algorithms currently used in actual systems, the most basic of which are shortest deadline priority, shortest processing time priority, minimum idle time priority and highest value priority. They all only take into account the characteristics of a task in one aspect, such as deadline, processing time, idle time, value, etc., while ignoring other characteristics and not fully considering the many complex factors required for task completion. In some improved algorithms, the dominant factors of value and deadline are combined. For example, the method of setting the preemption threshold combines the advantages of preemption and non-preemption, and the fuzzy control feedback scheduling method adds consideration of unpredictable real-time factors from the outside world.
[0074] See also Figure 2From the known task scheduling in this field, the execution of multiple tasks basically relies on the algorithms of the upper-level software to a large extent, rather than the improvement of the underlying hardware circuits. In fact, various algorithms at the upper-level software level need to rely on the support of hardware, or in other words, the algorithms at the software level need to have a physical support structure for implementation. At the circuit level, this application is allowed to serve as the implementation basis of the upper-level software, that is, the device (chip, circuit) mentioned in this application is allowed to be called by various upper-level task scheduling algorithms. Of course, the device itself can also run independently without having to rely on software.
[0075] See also Figure 2 In an alternative embodiment, the aforementioned example is again used to illustrate the mode of the task in this article to demonstrate its wide adaptability. In a scene where images PX1-PX3 or more images are rendered or combined into a dynamic video, it is necessary to specify various display tasks such as input grayscale for each pixel under different display requirements. Therefore, in this embodiment, the parallel processing task PTP (parallel task processing) is implemented based on images PX1-PX3.
[0076] See also Figure 2 In an optional embodiment, the image PX1 integrated with display pixels AR1-ARN assumes that the brightest AR1 among the display pixels AR1-ARN should run larger grayscale data under display requirements, and the remaining display pixels should run smaller grayscale data, that is, AR1 of PX1 needs to execute high grayscale values. The task sequence seq[N-1:0] is the task sequence and output generated by the master control register. The first type of code element in the task sequence seq[N-1:0]=[…001], such as code element one, is used to indicate the execution of high grayscale value tasks, and the second type of code element opposite to the first type of code element, such as code element zero, indicates that the high grayscale value task is not executed but low grayscale value. The task sequence seq[N-1:0] is used to control the working states of the display pixels ARN,…AR2, AR1. The task sequence seq is the first sequence and controls the image PX1: for example, seq[0] in the task sequence is used to indicate the key task of AR1, and seq[N-1:1] indicates the secondary tasks of AR2-ARN. At this time, for example, the main task is to run the larger grayscale data and the secondary task is to run the lower grayscale data. The larger grayscale data value is important because it is much more obvious than the lower grayscale data value, and the image is more obvious to the visual sense. The larger grayscale value can give the visual sense a rough outline of the image, while the lower grayscale value can further clarify and refine the outline. For example, binarization or Sobel algorithm in image processing can be used for this kind of grayscale differentiation display solution.
[0077] See also Figure 2In an optional embodiment, the image PX2 integrated with the display pixels AR1-ARN assumes that the brighter one AR2 among the display pixels AR1-ARN should run larger grayscale data under display requirements, and the remaining display pixels should run smaller grayscale data, that is, AR2 of PX2 needs to execute high grayscale value. The task sequence seq[N-1:0] is the task sequence and output generated by the master register. The first type of code element in the task sequence seq[N-1:0]=[…010], such as code element one, is used to indicate the execution of the high grayscale value task, and the second type of code element opposite to the first type of code element, such as code element zero, indicates that the high grayscale value task is not executed but a low grayscale value. The task sequence seq[N-1:0] is used to control the working status of each display pixel of a series of display pixels ARN,…AR2, and AR1. The task sequence seq is the second sequence and manipulates the image PX2: for example, seq[1] in the task sequence indicates the key task of AR2, seq[N-1:2] indicates the secondary tasks of AR3-ARN, and seq[0] in the task sequence indicates the secondary task of AR1, thereby obtaining a display effect in which the grayscale values of the image are differentiated.
[0078] See also Figure 2 In an optional embodiment, the image PX3 integrated with the display pixels AR1-ARN assumes that the brighter AR3 among the display pixels AR1-ARN should run larger grayscale data under display requirements, and the remaining display pixels should run smaller grayscale data, that is, AR3 of PX3 needs to execute high grayscale values. The task sequence seq[N-1:0] is the task sequence and output generated by the master control register. The first type of code element in the task sequence seq[N-1:0]=[…100], such as code element one, is used to indicate the execution of high grayscale value tasks, and the second type of code element opposite to the first type of code element, such as code element zero, indicates that the high grayscale value task is not executed but a low grayscale value. The task sequence seq[N-1:0] is used to control the working status of each display pixel series ARN,…AR2, AR1. The task sequence seq is the third sequence and manipulates the image PX3: for example, seq[2] in the task sequence is used to indicate the key task of AR3, seq[N-1:3] indicates the secondary tasks of AR4-ARN, and seq[1] in the task sequence is used to indicate the secondary tasks of AR2, and seq[0] indicates the secondary tasks of AR1.
[0079] See also Figure 2In an optional embodiment, the image processing design task sequence for each difference picture of PX1-PX3 changes from seq[…001] to seq[…010] and seq[…100]. If more images are used, the number of task sequences here is not limited to the aforementioned three. If each image uses more than N pixels, the data width of each task sequence is not limited to N, that is, not limited to [N-1:0]. Usually, such difference pictures of PX1-PX3 or a larger number of difference pictures can be combined into a coherent video or rendered into a dynamic frame result. It can be assumed that the task sequence seq with a preset sequence value 1 [N-1:0] and seq 2 [N-1:0] and seq 1 [N-1:0] and so on are static frames. These frames are displayed continuously at a high frequency to form a moving picture. The task sequence seq 1 [N-1:0] rotation seq 2 [N-1:0] rotate seq again 3 The jump of task sequence such as [N-1:0] or the shift of task sequence is the pipeline implementation of critical tasks (such as running high grayscale values). The secondary tasks should be implemented synchronously with the corresponding critical tasks, as described below.
[0080] See also Figure 2 , as mentioned above, let the task sequence seq corresponding to PX1 be 1 [N-1:0] is rotated to implement key tasks or main tasks during this time period, i.e. seq 1 [0] Run high grayscale values, secondary tasks, or from tasks, i.e., seq 1 [N-1:1] runs low grayscale values so that a complete picture can be formed based on the high grayscale of the main task and the low grayscale of the slave task.
[0081] See also Figure 2 , as mentioned above, let the task sequence seq corresponding to PX2 be 2 [N-1:0] is rotated to implement key tasks or main tasks during this time period, i.e. seq 2 [1] Run high gray value, secondary task or from task seq 2 [N-1:2] Run low grayscale values so that a complete picture can be formed based on the high grayscale of the main task and the low grayscale of the slave task. 2 [0] Running low grayscale values during this time period is also part of a secondary task or slave task.
[0082] See also Figure 2 , as mentioned above, let the task sequence seq corresponding to PX2 be 3 [N-1:0] is rotated to implement key tasks or main tasks during this time period, i.e. seq 3[2] Run high grayscale values, secondary tasks, or from tasks, i.e., seq 3 [N-1:3] Run low grayscale values so that a complete picture can be formed based on the high grayscale of the main task and the low grayscale of the slave task. 3 [1:0] Running low grayscale values during this time period is also part of the secondary task or slave task.
[0083] See also Figure 2 , task sequence seq 1 [N-1:0] rotation seq 2 [N-1:0] rotate seq again 3 [N-1:0], a single frame, such as each isolated task sequence, is a still image, and rapid succession of frames forms a moving video stream. In addition, a high frame rate can produce smoother and more realistic animations. The actual task sequence is not limited to the aforementioned finite number. The aforementioned finite number of task sequences seq 1 to seq 3 Just as an example.
[0084] See also Figure 2 , the master register REG1 responds to the flag count fg and the previous task sequence ps to determine the next task sequence ns. When the flag count fg reaches the preset cumulative value CV: if the previous task sequence ps is equal to the sequence end value seq_end, the next task sequence ns jumps to the sequence first value seq_1st. If the previous task sequence ps is not equal to the sequence end value seq_end, the next task sequence ns is shifted once from the current value, and the shift amount is a determined value shift_v. Note that the shift here takes the left shift as an example. But it also includes left shift and right shift. As mentioned above, the display runs the grayscale data of each frame of each image through pixels. Assuming that the multi-task processing device TD0 is attached to the display end, it is necessary to control the images PX1-PX3 through concurrent instructions or control signals or commands. The intuitive form of concurrent instructions or control signals or commands issued by the multi-task processing device can be represented by the task sequence seq. How to manipulate the three images and the multiple display pixels combined under each image involves two core issues: the pipeline execution of the key tasks of the grayscale data operation category such as high grayscale values in the three images (seq[…001], seq[…010], seq[…100]), and the synchronization of the multiple secondary tasks such as the operation of relatively low grayscale data values and each key task such as the operation of high grayscale under a single screen around each key task such as strong contours. For example, it is necessary for ARN-AR2 in image PX1 to maintain the synchronization of low grayscale data and AR1 to maintain high grayscale data, because ARN-AR1 in image PX1 uses the grayscale contrast between each other to form a grayscale image and combined display pixels. They need to keep synchronization for their respective key tasks or secondary tasks.
[0085] See also Figure 2 , from what has been said above, it is obvious that the key tasks and the secondary tasks at this time, as well as the secondary tasks themselves, are highly correlated multi-tasks. The absence of any secondary task or any key task will result in the failure of the overall effect. The absence of the grayscale of any pixel point cannot form a complete grayscale image. The cross-key tasks can be called the main tasks (or first-class tasks) and the secondary tasks can be called the slave tasks (or second-class tasks).
[0086] See also Figure 2 , the pipeline of pixel-critical tasks, for example: the master control register responds to the flag count fg and the previous task sequence ps to determine the next task sequence ns, under the condition that the flag count fg reaches the preset cumulative value CV: if the previous task sequence ps has been equal to the sequence end value seq_end after one or more shifts, the next task sequence ns jumps to the sequence first value seq_1st, at this time, the task sequence seq triggers the jump due to seq[N-1:0]=seq_end and the coincident synchronization condition is that the flag count fg is exactly equal to the cumulative value MX. The shift of the task sequence will experience the shift from the previous task sequence ps to the next task sequence ns, such as ps=seq[…001] shifting to seq[…010] will not cause the next task sequence ns to jump to the sequence first value seq_1st, but ps=seq[…010] shifting to seq[…100] may cause the next task sequence ns to jump to the sequence first value seq_1st. Even if fg reaches MX, it does not necessarily induce ns to jump to seq_1st. Both the previous task sequence and the next task sequence are selected from the preset sequence value. The above content is the first aspect, that is, the pipeline execution of a series of key tasks or main tasks or first-class tasks.
[0087] See also Figure 2, the pipeline of pixel-critical tasks, for example: the master control register responds to the flag count fg and the previous task sequence ps to determine the next task sequence ns, under the condition that the flag count fg reaches the preset cumulative value CV: if the previous task sequence ps is not equal to the sequence end value seq_end, the next task sequence ns is shifted once from the current value and the shift amount is the determined value shift_v. The task sequence seq triggers the shift because seq[N-1:0] is not equal to seq_end and the synchronized flag count fg is equal to the cumulative value MX. The shift of the task sequence undergoes the shift from the previous task sequence ps to the next task sequence. The current value ps=seq[…001] shifts to seq[…010] when ps is not equal to seq_end and the flag count is the cumulative value trigger, and the current value ps=seq[…010] shifts to seq[…100] when ps is not equal to seq_end and the flag count is the cumulative value trigger. If the previous task sequence ps is not equal to the sequence end value seq_end, the next task sequence ns is shifted once by the current value, and for example, the current value is the previous task sequence ps, and the shift amount of the current value is a pre-defined fixed value shift_v. In the above embodiment, shift_v is taken as an example of a 1-bit shift amount, but the shift amount can also be a fixed value shift_v such as two or three optional options. In addition, it is noted that in fact, whether it is the previous task sequence or the next task sequence, they can be selected from the preset sequence value.
[0088] See also Figure 2 , the synchronization of the slave task and the corresponding main task, such as: the first type of code element in the task sequence seq[N-1:0] is used to indicate the execution of the task (critical task or main task), and the second type of code element in the task sequence seq[N-1:0], which is opposite to the first type of code element, indicates that the task (critical task or main task) is not executed. All code elements in seq[N-1:0] clearly represent a type of business. Still taking the image on the display end as an example, the first type of code element in seq[N-1:0] is used to indicate the execution of the task (such as running high grayscale data), and the second type of code element in the task sequence seq[N-1:0], which is opposite to the first type of code element, indicates that the task (such as running high grayscale data) is not executed. The second type of code element can indicate that the secondary task or regular business (such as running low grayscale data), that is, the slave task or the second type of task is executed. The above content is the second aspect. Many secondary tasks around each critical task and each critical task are executed synchronously. Other terms for a critical task are primary task or first category task, and other terms for a secondary task are secondary task or second category task.
[0089] See also Figure 4, the figure shows that many processors prsor1-prsor4 etc. receive concurrent instructions or control signals etc. from device TD0. The process of parallel task processing or parallel data processing is described here between multiple processors prsor1-prsor4 and device TD0, but the concurrent instructions or control signals etc. from device TD0 are not limited to being distributed to processors, but can also be distributed to other types of hardware. Many processors are, for example, power control terminals distributed at different smart photovoltaic components and adjusting photovoltaic component parameters, which can control power converters or switching voltage converters to control the normal power point or maximum power point tracking of photovoltaic components. Many processors are, for example, display control terminals that control different display screens respectively, many processors are, for example, grayscale control terminals that control different pixel arrays respectively, and so on. Device TD0 originates from one of the processors prsor1-prsor4.
[0090] See also Figure 4 , the optional hardware HD-1, HD-2, HD-3, ... HD-k, etc. are, for example, Figure 2 The photovoltaic modules connected in series under the single string recorded are HD-1, HD-2, HD-3, ... HD-k connected in series, and they have the same string current, that is, the same string current flows through HD-1, HD-2, HD-3, ... HD-k. Under a single string, for those modules with weak light, it is necessary to adjust the voltage and current parameters to achieve the best power tracking. Under the same string, for those modules with strong light that are already running at their own maximum power point, it is only necessary to maintain the corresponding power.
[0091] See also Figure 4 , in the alternative example, the hardware HD-1, HD-2, HD-3, ... HD-k, etc. are, for example, Figure 2 The display pixels in the single image are combined into a matrix and HD-1, HD-2, HD-3, ... HD-k are arranged in an array. For the display pixels combined into a matrix, they use grayscale contrast or grayscale contrast (for example, based on high and low grayscale values) to form a grayscale image and display a complete image effect under combined conditions.
[0092] See also Figure 2In an optional embodiment, a register-based multi-task processing device: the data width of the master control register is equal to the total amount of multiple tasks that need to be processed in parallel, the first type of code element in the task sequence of the master control register is used to indicate the execution of a task (here, the task is, for example, the first type of task or the main task), and the second type of code element opposite to the first type of code element represents that the task (for example, the first type of task or the main task) is not executed, but the second type of code element is used to indicate the execution of other tasks (other tasks are, for example, the second type of task or the slave task); thereby, a series of first type tasks with cross-correlation in different task sequences are processed in parallel; and, when the first type of task of any task sequence is triggered to be executed, the second type of task corresponding to the second type of code element that coexists with the first type of code element of any task sequence is synchronously and concurrently executed. Thus, the integrity of each independent task sequence during execution is guaranteed, and different task sequences are completed in cross-parallel. Similarly, the master control register determines the next task sequence in response to the flag count and the previous task sequence. When the flag count reaches a preset cumulative value: if the previous task sequence is equal to the end value of the sequence, the next task sequence jumps to the first value of the sequence; if the previous task sequence is not equal to the end value of the sequence, the next task sequence is shifted once by the current value, and the shift amount is a determined value. It is worth noting that the above scheme is also applicable to the method of using registers to process tasks in parallel. The advantages achieved by the above scheme are as follows.
[0093] See also Figure 2In summary, parallel processing is implemented for cross-tasks with strong correlation, which can improve the response speed of these multiple cross-tasks and realize efficient and fast task distribution. The above example gives that the key tasks of different task sequences (such as high grayscale pixel points running high grayscale data values) are executed in a pipeline parallel manner, and this parallel manner allows the key tasks of any task sequence to be inserted in parallel between the key tasks of the remaining other task sequences. Typically, different task sequences are rotated in parallel in a cycle. The key tasks of different task sequences belong to cross-tasks with strong correlation. For example, if the key tasks of any task sequence are missing, the video frames obtained by the cross-correlation of different task sequences will have part of the display outline or the display target screen missing. In addition, under the condition of synchronous execution between concurrent master and slave tasks, the inherent correlation of any two tasks in the master and slave tasks including multi-master tasks and multi-slave tasks is synchronously coupled or decoupled. In other words, the correlation of any two concurrent tasks is not any lag time during the coupling or decoupling of concurrent tasks. Obviously, this will greatly improve the data concurrency and task processing capabilities in multi-task scenarios. For example, the complete display of any single image that constructs a video frame is the result of multi-task concurrent processing of the grayscale values of all pixels of the single image, and there is an inherent internal interactive correlation between the related multi-tasks that process the grayscale data. The grayscale value processing of any pixel affects the display effect of the same image. The advantage of the present application is that concurrent tasks can be logically coupled or logically decoupled, and concurrent processing can be implemented synchronously. For example, the grayscale value processing of all pixels of a single image is integrated into a single cycle of mark counting to perform a task coupling, and the grayscale value processing of all pixels of a single image is decoupled and updated to a new grayscale at the alternating time points of the previous and next cycles of the mark counting. The screen switching of the video frame will appear extremely smooth and without a sense of drag. There is no doubt that efficient task execution can be achieved between multiple tasks with extremely low interactive bandwidth and the desired multi-task processing results can be obtained.
[0094] See also Figure 2 In summary, examples of tasks include dispatched events, created or exchanged processes and threads, data operations such as reading and writing, communication between different devices or within a single device, and processing of data or information.
[0095] See also Figure 2In an optional embodiment, when the count data cnt of the first counter CNT1 reaches a predefined maximum value MX, the count data cnt of the first counter CNT1 jumps to zero (0) and restarts counting upward, i.e., counting from zero. The maximum value MX is adjustable and is a flexible variable value. For example, the maximum value can be 0x17d7+1 or 0x17d7+2, 0x15d7+1 or 0x15d7+2, etc.
[0096] See also Figure 2 In an optional embodiment, the predetermined value pre_v is equal to the maximum value MX minus a predefined specified scale L, such as pre_v=MX-L. The specified scale L is adjustable, and the scale of the specified scale L is elastically adjustable and belongs to an elastic variable value. For example, the predetermined value pre_v=MX-1 or pre_v=MX-2 is equal to the maximum value minus a predefined specified scale L.
[0097] See also Figure 2 In an optional embodiment, the enable state (enable) of the flag count fg is a single pulse signal. For example, the single pulse signal (pulse signal) used at this time does not need to be specifically digitally controlled. In an optional embodiment, when the count data cnt of the first counter CNT1 reaches the designed predetermined value pre_v each time, the flag count fg is accumulated to the enable state (enable) once, and as long as the count data cnt is not equal to the predetermined value pre_v, the flag count fg returns to zero and is disabled (disable). In this example, the flag count fg is almost a narrow pulse signal when cnt=pre_v appears, and then immediately returns to zero because cnt=pre_v no longer holds. The reason why cnt=pre_v no longer holds here is that the count data cnt is still counting and changing with the clock signal. Basically, the flag count fg shows a tendency to return to zero after almost every single accumulation to a value.
[0098] See also Figure 2 In an optional embodiment, the feature that the enable state (enable) of the flag count fg is a single pulse signal can be correspondingly limited to: the number of times the flag count fg appears in the enable state (enable) is the same as the data width of the task sequence seq. For example, the number of times the flag count fg is enabled is equal to the width of the task sequence seq[K-1:0], K times, or for another example, the number of times the flag count fg is enabled is equal to the width of the task sequence seq[N-1:0], N times. Thus, the tasks represented by each task sequence, such as critical tasks, are executed at least in one enable state of the flag count fg. For example, the task sequence seq mentioned above 1The key tasks represented are executed in the first enabled state of the flag count fg, such as the task sequence seq mentioned above 2 The key tasks represented are executed in the second enabling state of the flag count fg, such as the task sequence seq mentioned above 3 The key task represented is executed in the third enabled state of the flag count fg. If there are more task sequences, the number of times the flag count fg appears in the enabled state is also greater. For example, the task sequence seq K The key task represented is executed in the Kth enabled state of the flag count fg. N The key task represented is executed in the Nth enabled state of the flag count fg. In summary, the number of times the flag count fg appears in the enabled state can be set to be the same as the data width of the task sequence seq. 1 / seq 2 / seq 3 The tasks represented by each of the flags fg and fg are executed at least in an enable state of the flag count fg. This is one of the specific implementation measures for parallel processing of cross-tasks with strong correlation, especially critical tasks.
[0099] See also Figure 2 In an optional embodiment, when the flag count fg reaches the preset cumulative value CV, the following conditions must be met: if the previous task sequence is equal to the end value of the sequence, the next task sequence jumps to the first value of the sequence; if the previous task sequence is not equal to the end value of the sequence, the next task sequence is shifted once by the current value, and the shift amount is a certain value. When the enable state (enable) of the flag count is a single pulse signal: the preset cumulative value CV is allowed to be always 0x01 or some other suitable constant value. In this example, the flag count is accumulated once and then reset to zero, so the preset cumulative value reached by the flag count fg is explained using the appropriate 0x01 as an example. At this time, the preset cumulative value CV includes a set fixed value.
[0100] See also Figure 2 In an optional embodiment, not all tasks are executed unconditionally. Some tasks that can be postponed or even abandoned can be executed in a skipped cycle or not executed. For example, repeated tasks or contradictory tasks. Otherwise, the negative impact is to seize limited resources such as computing power or bandwidth of processors such as CPU, MCU, FPGA or GPU. To avoid delays in the most critical and core tasks or services. If the ability of a computer or computing device to process tasks or data is obviously inconsistent with its high-cost resource allocation, this is most likely due to unreasonable task allocation and needs to be optimized urgently.
[0101] See also Figure 2In an optional embodiment, the enable state (enable) of the flag count fg is a specified increment value but is no longer a single pulse signal, that is, a non-single pulse signal. The so-called specified increment value means that the enable state at this time is a selected digital value with incremental characteristics that increases gradually. This is a completely different design scheme from the aforementioned single pulse signal that only considers a high-level narrow pulse. Specific scheme: When the count data cnt of the first counter CNT1 reaches the predetermined value pre_v each time, the flag count fg is continuously accumulated. For example, the flag count fg accumulates once when cnt=pre_v and continues to accumulate accordingly. After the flag count fg is accumulated, some of the accumulated values of the flag count fg are selected and set to the specified increment value. Note that a part of the accumulated values is set to the specified increment value, which can be only a small part of the value is set to the specified increment value or all the values are set to the specified increment value, which is set according to actual needs. In an optional embodiment, when the enable state (enable) of the flag count fg is a specified increment value and the accumulated value of the flag count fg is a non-specified increment value, the flag count fg is in a disabled state (disable), that is, disabled.
[0102] See also Figure 2 In an optional embodiment, the feature that the enable state (enable) of the flag count fg is a specified increment value can be correspondingly limited to: the number of times the flag count fg appears in the enable state (enable) is lower than the so-called data width of the task sequence seq. For example, the number of times the flag count fg is enabled is less than the width of the task sequence seq[K-1:0], K times, or for another example, the number of times the flag count fg is enabled is less than the width of the task sequence seq[N-1:0], N times. As a result, tasks represented by a portion of the task sequence are executed in the corresponding enable state (enable) of the flag count fg, and tasks represented by the remaining task sequence are suspended (pending). For example, the task sequence seq 1 The key task of the representation is executed during the first accumulation of the flag count fg (the accumulated value of the flag count fg at this time is specified as a specified increment value). The flag count continues to accumulate and follows the same principle, such as the task sequence seq 2 The key task of the representation is executed during the second accumulation of the flag count fg (the accumulated value of the flag count fg at this time is designated as a specified increment value). The flag count continues to be accumulated and follows the same principle, such as the task sequence seq 3 The key task of the representation is executed during the third accumulation of the flag count fg (the accumulated value of the flag count fg at this time is designated as a specified increment value). The flag count continues to be accumulated and follows the same principle, such as the task sequence seq 4The key task represented is no longer executed during the fourth accumulation of the flag count fg (the accumulated value of the flag count fg at this time is not specified as a specified increment value), which is likely to be the task sequence seq at this time 4 With the task sequence seq 3 There is a duplication or conflict, that is, the accumulated value of the flag count fg is not the specified increment value at this time and the flag count fg is disabled at this time. Partial task sequence seq 1 -seq 3 The tasks represented by the flag are executed in the corresponding enabled state of the flag count, and the remaining task sequence seq 4 The tasks are suspended. According to the above, in the optional example, it can be summarized as follows: the number of times the flag count fg appears in the enable state is set to be lower than the so-called data width of the task sequence seq, that is, some tasks represented by the task sequence seq can be executed in the corresponding enable state (enable) of the flag count, and the tasks represented by the remaining task sequence seq are suspended. In the above example, not all task sequences are executed unconditionally, for example, the task sequence seq 4 Can be postponed or even abandoned. 4 Not suspended or abandoned due to skipping of local cycles, and re-listed in the executable tasks: task sequence seq 4 The key task of characterization is performed during the fourth accumulation of the flag count, where the accumulated value of the flag count needs to be set to the specified increment value.
[0103] See also Figure 2 According to the above, because non-critical tasks or non-critical businesses in multiple tasks are allowed to be executed by skipping local cycles or optional cycles, and thereby ensuring that critical tasks or businesses are executed first, non-critical tasks or non-critical businesses are prevented from occupying too much limited resources. Excessive occupation of limited resources such as computing power resources or bandwidth resources by non-critical tasks or non-critical businesses will drag down the timeliness of critical tasks or businesses, which is a manifestation of unreasonable task allocation. Non-critical tasks or non-critical businesses are suspended in local cycles or optional cycles, during which critical tasks or critical businesses can have priority in using computing power resources or bandwidth resources and other resource conditions required to implement tasks, thereby achieving reasonable arrangement of tasks.
[0104] See also Figure 2In an optional embodiment, when the flag count fg reaches the preset cumulative value CV, the following conditions need to be met: if the previous task sequence is equal to the end value of the sequence, the next task sequence jumps to the first value of the sequence; if the previous task sequence is not equal to the end value of the sequence, the next task sequence is shifted once for the current value, and the shift amount is a certain value. When the enable state (enable) of the flag count is a specified increment value: the preset cumulative value CV is allowed to be a plurality of different values or other suitable change values. In this example, the flag count fg is continuously accumulated, and part of the accumulated value of the flag count fg is set to the specified increment value: for example, a series of accumulated values 0x001, 0x010, 0x011, 0x100, 0x101, etc. are generated by the continuous accumulation of the flag count, and part of the values 0x001, 0x011, 0x101, etc. are set to the specified increment value. At this time, the preset cumulative value CV can include these specified increment values. Although it is the best solution that the preset cumulative value CV includes the specified increment value, the preset cumulative value CV can also include a small number of non-specified increment values in a series of accumulated values. In this example, the flag count reaches the preset cumulative value CV with multiple different values as an example for explanation.
[0105] See also Figure 2In an optional embodiment, the above text informs that in the optional embodiment, the output part of the master register, i.e., the generated task sequence seq (sequence), has a pre-designed or pre-defined sequence value, i.e., a preset sequence value (predetermined-sequence). The preset sequence value of the task sequence seq includes the sequence head value, the sequence end value, and the intermediate sequence value between the sequence head value and the sequence end value. Whenever the count data cnt reaches the predetermined value pre_v, the flag count fg is accumulated once, and the flag count fg will generate a series of accumulated values such as fg_1, fg_2, etc. Now, for the convenience of description, it is assumed that a series of accumulated values fg_1, fg_2, fg_3, fg_4, etc. are generated, and fg_2 and fg_3 belong to the accumulated values defined as the specified increment values, but the other accumulated values fg_1, fg_4, etc. belong to the non-specified increment values. Under the premise of using the specified increment value, it can be known that the number of times the flag count fg appears in the enabled state is lower than the data width of the task sequence seq. At this time, the accumulated values fg_1, fg_4, etc. corresponding to the non-specified increment values have no assigned tasks. However, the flag count fg still needs to execute the pre-defined rules within the cycle of the accumulated value corresponding to the non-specified increment value: when the flag count reaches the preset cumulative value: if the previous task sequence is equal to the end value of the sequence, the next task sequence jumps to the first value of the sequence; if the previous task sequence is not equal to the end value of the sequence, the next task sequence shifts the current value once, and the shift amount is a certain value. The doubt is that even if the flag count fg does not execute the task within the cycle of the accumulated value corresponding to the non-specified increment value, the task sequence still needs to be clearly defined, otherwise the assignment behavior such as the jump or shift of the task sequence will appear in a disordered state. At this time, the external appearance of the register-based multi-task processing device TD0 is similar to the problem of its driver program. It may send illogical and disorderly instructions or commands to the controlled hardware, and the task processing effect cannot be achieved. Note that this exception occurs when the number of times the flag count fg appears in the enabled state is less than the data width of the task sequence seq, only a portion of the accumulated value of the flag count is set to the specified increment value, and the flag count must comply with the above rules. On the other hand, the scheme where the flag count is enabled as a single pulse signal will not have this exception.
[0106] See also Figure 2In an optional embodiment, the solution is designed as follows: the task sequence corresponding to the period in which the value in a series of accumulated values of the flag count fg exceeds the specified increment value is forcibly set to the end value of the sequence. Still taking the accumulated values fg_1, fg_2, fg_3, and fg_4 of the flag count fg listed above as an example, fg_2 and fg_3 are accumulated values defined as specified increment values, but the accumulated values fg_1 and fg_4 are non-specified increment values. The value in a series of accumulated values of the flag count fg that exceeds the specified increment value is fg_4. If fg_4 is designed according to the above, the task sequence corresponding to the period in which fg_4 is located is, for example, seq 4 is forced to be set to the end value of the sequence (seq_end). At the same time, the task sequence corresponding to the cycle of fg_1, such as seq 1 Similarly, the task sequence corresponding to the period of fg_2 is seq 2 The task sequence corresponding to the period of fg_3 is still determined by the aforementioned rules specified in advance. 3 It is still determined by the aforementioned rules stipulated in advance. Note that the generation mechanism of the flag count fg is periodically captured and is determined each time the count data cnt reaches a predetermined value. Each accumulated value corresponding to the flag count fg is generated within a corresponding cycle of the flag count fg. At this time, even if the flag count fg is within the cycle of the accumulated value corresponding to the non-specified increment value, the task sequence does not execute any task. Because the task sequence is defined, the assignment behavior such as jump or shift of the task sequence no longer easily appears disordered and reduces the aforementioned anomalies.
[0107] See also Figure 6In an optional embodiment, the enable state of the flag count fg is a specified increment value. According to the count data cnt of the first counter CNT1 as shown in the figure, each time the flag count fg continuously accumulates and obtains a series of accumulated values, a part of the accumulated values of the flag count fg is set to a specified increment value. For example, the corresponding accumulated values of the flag count fg obtained in certain accumulated cycles T1 and T2 during the implementation of the flag count accumulation are set to the specified increment value. That is, the enable state of the flag count fg in T1 and T2 is the specified increment value. Similarly, for example, the corresponding accumulated values of the flag count fg obtained in certain accumulated cycles T3 and T4 during the implementation of the flag count accumulation are set to non-specified increment values. That is, the flag count fg has no specified increment value and is disabled in T3 and T4, which is equivalent to the flag count fg being disabled when the accumulated value of the flag count is a non-specified increment value. Make the number of times the flag count fg appears in the enable state lower than the data width of the task sequence. For example, the number of times the flag count fg is in the enable state in four cycles is only two. That is, the tasks represented by a part of the task sequence are executed in the corresponding enabled state of the flag count fg, such as T1-T2, while the tasks represented by the remaining task sequence are suspended, such as T3-T4. For example, the hardware HD-1 to HD-k execute the task sequences seq1-seq2 corresponding to the period T1-T2, but they do not execute the task sequence seq3-seq4 during T3-T4.
[0108] See also Figure 6 In an optional embodiment, the task sequence corresponding to the period in which the value in a series of accumulated values of the flag count fg exceeds the specified increment value is forcibly set to the sequence end value. For example, the value in a series of accumulated values of the flag count fg that exceeds the specified increment value (the accumulated value in the period T1-T2 is the specified increment value) is the accumulated value corresponding to the period T3-T4 in the optional embodiment in the figure. The task sequence seq3-seq4 corresponding to the period (T3-T4) in which the value in a series of accumulated values of the flag count fg exceeds the specified increment value is set to the sequence end value seq_end.
[0109] See also Figure 3In an optional embodiment, the binary number of the task sequence seq output by the main control register REG1 is bitwise inverted and an inverted sequence seqr is obtained. The auxiliary register REG2 is assumed to belong to the device TD0 and it is not significantly different from the main control register in terms of register structure physics, but the purpose or use of the main control register and the auxiliary register are not the same. The aforementioned inverted sequence seqr is stored in the auxiliary register REG2. The device TD0 can form an inverted sequence seqr according to the initial task sequence seq and pass it to the auxiliary register REG2. The device TD0 is based on an embodiment of forming an inverted sequence seqr from the task sequence seq described above: the initial is seq[K-1:0], and its binary number is bitwise inverted, such as seq[…001] is seqr[…110], seq[…010] is seqr[…101], seq[…100] is seqr[…011] and more unlisted examples of bitwise inversion of binary numbers.
[0110] See also Figure 3 , the inverted sequence seqr is used as the external task control signal Ctl-Sig. For example, in addition to controlling the aforementioned multi-pixel grayscale display or smart photovoltaic components or their deformed hardware, Ctl-Sig can also control the reading, writing, deleting and other routine operations of the disk array, control the display content of each multi-screen display, control the network status of many nodes in the distributed network storage, such as backup or snapshot, and so on.
[0111] See also Figure 3, the inverted sequence seqr is used as the external task control signal Ctl-Sig. The inverted sequence seqr and the initial task sequence seq are different in terms of task execution. The first type of code element in the task sequence seq of the master control register REG1 is used to indicate the execution of the task (main task or first type of task), but the second type of code element opposite to the first type of code element represents that the corresponding task (main task or first type of task) is not executed. However, the second type of code element in the inverted sequence seqr of REG2 is used to indicate the execution of the task (main task or first type of task), but the first type of code element opposite to the second type of code element represents that the corresponding task (main task or first type of task) is not executed. The main purpose is to prevent multiple tasks (multiple tasks such as main tasks or first type of tasks) from competing in a single cycle of the same flag count fg. This disadvantage caused by competition can be explained by example. As mentioned above, in the series of PV modules PV1-PVK, if the PV modules in a single string that have strong light radiation and only need to maintain normal power also compete for power tracking locally, the burden and work of the processor configured for the PV module to drive the PV module to perform maximum power tracking will increase significantly, and the PV modules in the same string that have weak light radiation and really need to perform power tracking will face resource competition locally and be delayed. The PV modules under strong light and the PV modules under weak light use a single cycle of the flag count fg as the basic time unit, and the PV modules under strong light and the PV modules under weak light will compete for resources once in any basic time unit. For example, in the previous basic time unit, the PV modules under strong light and the PV modules under weak light compete for resource allocation once, and in the next basic time unit, the PV modules under strong light and the PV modules under weak light will compete for resource allocation again.
[0112] See also Figure 3 , the inverted sequence seqr is used as the external task control signal Ctl-Sig. The inverted sequence seqr and the initial task sequence seq are different in design concept. The task sequence seq can quickly meet the operational requirements of shifting and other aspects in task iteration, and the inverted sequence seqr obviously cannot meet this. However, the inverted sequence seqr can effectively avoid competition between different tasks in the same sequence during the issuance of instructions or commands to indicate the execution of tasks. This is its dominant advantage. The cooperation between the inverted sequence seqr and the task sequence seq is a better option.
[0113] See also Figure 3In an optional embodiment, the second type of code element in the inversion sequence seqr[…110], such as a zero value, is used to indicate the execution of a task (such as a main task or a first type of task), and the first type of code element, such as a single value, indicates that the task (such as the main task or the first type of task) is not executed, thereby preventing multiple tasks (such as the main task or the first type of task) from competing in a single cycle of the same flag count fg. Similarly, for example, the second type of code element in the inversion sequence seqr[…101], seqr[…011] is used to indicate the execution of a task (such as a main task) and the first type of code element indicates that the task (such as the main task) is not executed, thereby preventing multiple tasks (such as the main task) from competing in a single cycle of the same flag count fg.
[0114] See also Figure 5 In an optional embodiment, in the previous cycle T1 of the flag count fg, the task sequence output by the main control register is uniquely determined. According to the above text, the binary number of the task sequence seq1 is bitwise inverted to obtain the inverted sequence seqr1. The inverted sequence seqr1 is used as a task control signal to the outside (for example, to hardware HD-1 to HD-k, etc.) and the second-class code element in the inverted sequence seqr1, such as the zero value, indicates the execution of the task (main task or first-class task) and the opposite first-class code element, such as the one-value, indicates that the task (main task or first-class task) is not executed. One of the purposes is to prevent multiple tasks from competing in a single cycle T1 of the same flag count fg. The same flag count fg: means that multiple tasks should be implemented and completed during a clear count value period (such as T1) of the same flag count fg.
[0115] See also Figure 5 In an optional embodiment, in the next cycle T2 of the flag count fg, the task sequence output by the master register is uniquely determined. According to the above text, the binary number of the task sequence seq2 is inverted bit by bit to obtain the inverted sequence seqr2. The inverted sequence seqr2 is used as a task control signal to the outside (for example, to the hardware HD-1 to HD-k, etc.) and the second type of code element in the inverted sequence seqr2, such as the zero value, indicates the execution of the task (main task or first type of task) and the opposite first type of code element, such as the one value, indicates that the task (main task or first type of task) is not executed. One of the purposes is to prevent multiple tasks from competing in a single cycle T2 of the same flag count fg. The same flag count fg: refers to that multiple tasks should be implemented and completed during another clear count value period (such as T2) of the same flag count fg. Note that if the preset cumulative value CV of the flag count includes a set fixed value, the count values of fg during T1 and T2 are the same, and if the preset cumulative value CV of the opposite flag count includes a floating different value, the count values of fg during T1 and T2 are different.
[0116] See also Figure 2In the optional embodiment, the above text gives the relevant embodiments of the data width of the task sequence seq[K-1:0] and seq[N-1:0]. The data width is equal to the total task volume of multiple tasks that need to be processed in parallel. If the specific number of multiple tasks changes, the total task volume and the data width need to be corrected together. When the device TD0 receives a newly assigned task, it cannot hastily judge the switching timing and the switching timing of the new task, because it is impossible to know what task the device TD0 is engaged in and it cannot hastily stop the device TD0 from a certain task it is engaged in. For example, the sudden stop of a task may cause related tasks to fail, such as power failure of the string or produce abrupt appearances such as picture distortion. How to insert a new task into the multi-task processing device TD0 that is running normally is a difficult problem.
[0117] See also Figure 2 In an optional embodiment, the goal to be achieved is to make all parallel tasks represented by each task sequence be synchronously shielded. 1 Characterized key tasks, task sequences seq 2 Characterized key tasks and task sequences seq 3 All parallel tasks, including the key tasks represented, are synchronously shielded. The essence of synchronous shielding in this article is to gradually exit the task sequence that is currently engaged in the current task, for example, through specific means, without affecting the overall working conditions, and ultimately achieve the overall shielding (screening) effect of the current task. In this way, even if it is impossible to know what task the device TD0 is currently engaged in, the task sequence is gradually exited to ensure that the device and the hardware or objects driven by the device will not be forced to stop from the overall effect of a task being engaged. It is worth noting that each task sequence, such as seq 1 to seq 3 All parallel tasks represented by the same are synchronously shielded, which means that the code elements of each task sequence are cleared to zero until the code elements of all task sequences are shielded as a whole. This shielding effect is different from the direct stop or sudden shutdown of the task, and the two concepts should not be confused. In other words, the code element stream contained in the task sequence is synchronously shielded, which does not mean that the task has stopped suddenly.
[0118] See also Figure 2 In an optional embodiment, each task sequence is as follows: 1 to seq 3The way in which all parallel tasks represented by the flag count fg are synchronously shielded is as follows: based on the situation that the flag count fg reaches the preset cumulative value, when the previous task sequence ps is equal to the sequence end value seq_end under the above conditions, it is necessary to prohibit the next task sequence ns from jumping to the so-called sequence first value seq_1st, and still guide the task sequence (such as the next task sequence ns, etc.) to shift once from the current value and the shift amount is still a certain value (shift_v), until each task sequence such as seq 1 to seq 3 The complete overflow of a single task sequence indicates that its code element has reached the zero-shielding effect. 1 to seq 3 The complete overflow indicates that the code elements of all task sequences have achieved the effect of overall shielding. The flag count fg reaches the preset cumulative value, for example, the cumulative value includes a set fixed value or includes multiple different values. So far, this article has designed a gradual exit of the task sequence by clearing to zero, which can ensure that the device TD0 and the hardware or objects driven by the device TD0 will not be forced to stop from the overall effect of a task being carried out. For example, the photovoltaic component-based string will not be powered off due to forced stop, and the multi-pixel points will not change the screen in vain due to forced stop.
[0119] See also Figure 2 As described in the previous embodiments, the data widths of task sequences seq[K-1:0] and seq[N-1:0] are given above. The data width is equal to the total amount of tasks that need to be processed in parallel. In a multi-task system, the amount of tasks often increases rapidly at any time as tasks are completed or about to be completed. The total amount of tasks and the data width need to be corrected immediately. The previous text has clearly stated that when device TD0 receives a newly assigned task, it cannot hastily judge the switching timing and switching timing of the new task, because it is impossible to know what task device TD0 is currently engaged in and it cannot hastily stop device TD0 from a task it is currently engaged in. The following will introduce how to insert a new task.
[0120] See also Figure 2 , assuming that when inserting a new task, the task sequence changes from seq[3:0] to seq[5:0] under the new task and it can be learned that the data width changes from the initial four bits to the subsequent six bits, and from seq[K-1:0] to seq[N-1:0] and it can be learned that the data width changes from the initial K bits to the subsequent N bits. These are some examples of new task insertion.
[0121] See also Figure 2As in the previous embodiment, before a new task is inserted into the initial task sequence, all parallel tasks represented by each initial task sequence are firstly shielded synchronously, and the data width of the initial task sequence is expanded to the total task amount of the current task. 1 [K-1:0], seq 2 [K-1:0], seq 3 All parallel tasks represented by [K-1:0] are synchronously shielded and the synchronous shielding method has been given in the previous article, that is, each task sequence seq 1 to seq 3 All overflow completely. And also expand the initial task sequence seq 1 [K-1:0], seq 2 [K-1:0], seq 3 The data width of [K-1:0] is K bits to the total task amount of the current task. For example, assuming N: the current task sequence is seq 1 [N-1:0], seq 2 [N-1:0], seq 3 [N-1:0]. It should be noted that because the data width of the initial task sequence is extended to the total task amount of the current task, the extended bits in the initial task sequence still need to execute the rules because their code elements are pending: when the flag count reaches the preset cumulative value, if the previous task sequence is equal to the end value of the sequence, the next task sequence jumps to the first value of the sequence; if the previous task sequence is not equal to the end value of the sequence, the next task sequence is shifted once for the current value, and the shift amount is a certain value. However, new problems will arise. Since the code elements of the extended bits are in a pending state, they still represent a certain type of task that needs to be executed but is not clear: so the assignment behaviors such as jumps or shifts of the task sequence will also appear in a disordered state. At this time, the external appearance of the register-based multi-task processing device TD0 is similar to the problem of its driver: the device TD0 may send illogical and disorderly instructions or commands to the controlled hardware, and the task processing effect cannot be achieved. Note that this exception occurs based on the expansion of the data width of the initial task sequence to the total task amount of the current task (for example, from K to N). For example, in the multi-pixel display scenario mentioned above, the extra extended bit of a certain pixel array is an unclear pending grayscale. During several consecutive cycles of the mark count, this grayscale pixel point inserted in vain will cause a very abrupt change in the original display image. How to control the controlled device of device TD0 during the transition switching stage between the new and old tasks is particularly important.
[0122] See also Figure 2, provided that it can still be adopted: before the new task is inserted into the initial task sequence, all parallel tasks represented by each initial task sequence are first synchronously shielded, and the data width of the initial task sequence is expanded to the total task amount of the current task. However, the solution to the aforementioned disordered state and driver program problems is: the weight of the extended bit of any task sequence after the data width is expanded is set to be higher than the weight of the original sequence value of any task sequence before the expansion, and any task sequence after the data width is expanded retains its original sequence value and fills the extended bit with zero; the low weight bit of the sequence end value in each initial task sequence is filled with zero until its data width is equal to the total task amount of the current task, and the new sequence formed is regarded as the sequence end value of each task sequence after the data width is expanded.
[0123] See also Figure 2 In an optional embodiment, the data width is expanded, for example, from K to N, and each initial task sequence, for example, seq 1 [K-1:0], seq 2 [K-1:0], seq 3 All parallel tasks represented by [K-1:0] are shielded. The data width K of the initial task sequence is extended to the total task amount N of the current task. In an optional embodiment, the task sequence has a pre-designed or pre-defined sequence value, namely a preset sequence value, and its sequence first value seq_1st is 1.
[0124] See also Figure 2 In an optional embodiment, the data width is expanded, for example, from K to N, and the task sequence after the data width is expanded is seq 1 [N-1:0], seq 2 [N-1:0], seq 3 [N-1:0] etc. (the original sequence value is, for example, seq 1 [K-1:0] or seq 2 [K-1:0] or seq 3 [K-1:0], etc.) as an example for explanation.
[0125] See also Figure 2 In an optional embodiment, the data width is expanded, for example, from K to N. At this time, any task sequence after the data width is expanded, such as seq 1 The weight or weight of the extension bit abc of [N-1:0] is set to be greater than that of any task sequence such as seq 1 [N-1:0] The original sequence value seq before extension 1 The weight of [K-1:0] should be high. Any task sequence after width expansion such as seq 1 [N-1:0] retains its original sequence value seq 1[K-1:0] and fills zeros at the extension position. 1 [K-1:0] is seq[…001] and the extended sequence seq 1 [N-1:0] is seq[abc…001], the task sequence seq after data width expansion 1 The weighted bit setting of the extension bit abc of [N-1:0] should be greater than the original sequence value seq of any task sequence before extension. 1 [K-1:0] means that the weight of seq[…001] is high. In binary, abc…001 has a higher weight and in the same binary…001 has a lower weight. After the data width is expanded, any task sequence retains its original sequence value and also fills zero at its extended position abc, such as the task sequence seq 1 [N-1:0] is seq[000…001].
[0126] See also Figure 2 In an optional embodiment, the data width is expanded, for example, from K to N. At this time, any task sequence after the data width is expanded, such as seq 2 The weight or weight of the extended bit efg of [N-1:0] is set to be greater than that of any task sequence such as seq 2 [N-1:0] The original sequence value seq before extension 2 The weight of [K-1:0] should be high. Any task sequence after width expansion such as seq 2 [N-1:0] retains its original sequence value seq 2 [K-1:0] and fill in zeros at the extension position. 2 [K-1:0] is seq[…010] and the extended sequence seq 2 [N-1:0] is seq[efg…010], the task sequence seq after data width expansion 2 The weighted bit setting of the extension bit efg of [N-1:0] must be greater than the original sequence value seq of any task sequence before extension. 2 [K-1:0], i.e., seq[…010], has a higher weight. In binary, efg…001 has a higher weight and in the same binary…010 has a lower weight. Any task sequence after data width expansion retains its original sequence value and also fills its extended bit efg with zeros, such as task sequence seq 2 [N-1:0] is seq[efg…010].
[0127] See also Figure 2 In an optional embodiment, the data width is expanded, for example, from K to N, and each initial task sequence, for example, seq1 [K-1:0] or seq 2 [K-1:0] or seq 3 [K-1:0], etc., fill the low-weight bits of the end value of a sequence with zeros until its data width is equal to the total task size of the current task. For example, assuming seq 3 [K-1:0] is seq[…100] and it is assumed to be the end value of a sequence in each initial task sequence. Now, seq 3 The low-weighted bits of the end value seq[…100] of the sequence [K-1:0] are filled with zeros, for example, the low-weighted bits hij are filled with zeros, and the low-weighted bits of the end value seq[…100] of the sequence are filled with zeros to become seq[…100hij], and after the zero filling, its data width is equal to the total task amount N of the current task, that is, the width of seq[…100hij] is N, hij=000. Each initial task sequence is such as seq 1 [K-1:0] or seq 2 [K-1:0] or seq 3 The low-weighted bits of the end values of the sequences in [K-1:0] etc. are padded with zeros until their data width is equal to the total task quantity N. hij is the result of padded with zeros at the low-weighted bits of seq[…100], and the data width of seq[…100] after padded with zeros is equal to the total task quantity N of the current task, forming a new sequence seq[…100hij]. The formed new sequence seq[…100hij] is regarded as the extended task sequence seq 1 [N-1:0], seq 2 [N-1:0], seq 3 [N-1:0] etc., so seq[…100hij] and seq 1 to seq 3 Their data widths are all N. It can also be considered that the least weighted bit (LSB) of the end value of a sequence in each initial task sequence is padded with zeros until the data width of the end value of the sequence is equal to the total task amount of the current task. The resulting new sequence seq[…100hij] is regarded as a sequence of end values of each task sequence after the data width is expanded. Note that abc or efg or hij, etc. are examples of three bits. In actual applications, their number of bits is only related to K and N. For example, abc or efg or hij, etc. are changed to abcd or efgr or hijk, etc. The three-bit or four-bit extension number is just an example and does not constitute any limitation.
[0128] See also Figure 2In summary, in terms of new task insertion, the original task is synchronously shielded based on the shift until the task sequence is completely overflowed, and the new task queue or insertion of the new task is based on the synchronous shielding of the original task and the expansion of the data width of the task sequence of the original task to the total task volume of the current task. It can be seen that the insertion of the new task into the original task will not be abrupt, the new task can be extremely smoothly penetrated into the original task, and the period when the new task is switched to the queue of the original task will not cause a sense of jump or abrupt step change in task switching or business switching. This is because the task sequence of the original task during this period is not directly cleared suddenly, but the new sequence values of the task sequence during the transition period are based on the old sequence values, and the sequence values corresponding to the new task are also coupled with the old sequence values, so the state of the original task can smoothly transition to the state of inserting the new task. Taking multi-pixel display as an example, the new grayscale display data can be blended into the old grayscale display data without any sense of disobedience and there will be no visual abruptness of the screen conversion.
[0129] See also Figure 2 In an optional embodiment, the register-based multi-task processing device includes a first counting module and the first counting module can be a module with a counting function such as an independent counting module in addition to the integrable counter CNT1 as mentioned above. In this case, the first counting module is often an isolated device without circuit integration and is used to generate counting data such as cnt. It can be generally believed that the preferred scenario of counters CNT1 and CNT2 is in the form of integrated circuits in a semiconductor chip; but in alternative solutions, other scenarios of counters CNT1 and CNT2 are isolated electronic components that are separated from each other and are not integrated in the same semiconductor chip.
[0130] See also Figure 2 In an optional embodiment, the register-based multi-task processing device includes a second counting module and in addition to the integrable counter CNT2 as mentioned above, the second counting module can also be a module with a counting function such as an independent counting module. In this case, the second counting module is often an isolated device without circuit integration and the second counting module is connected to the first counting module. The second counting module is connected to the first counting module to facilitate receiving the counting data such as cnt transmitted to the second counting module by the first counting module. The second counting module is also used to generate a flag count such as fg. Since the second counting module is connected to the first counting module, each time the counting data such as cnt of the first counter reaches a predetermined value pre_v, the flag count fg is triggered to accumulate once. The counting data generated by the first counting module is transmitted to the second counting module as the output signal of the first counting module. The flag count generated by the second counting module is transmitted to the register unit as the output signal of the second counting module.
[0131] See also Figure 2 In an optional embodiment, the register-based multi-task processing device includes a register unit and the register unit, in addition to the integrable master control register REG1 as mentioned above, can also be a module with a storage function, such as an independent register module. In this case, the register unit capable of storing various types of data or information is often an isolated device without circuit integration. The register unit is connected to a second counting module such as CNT2 and the register unit is used to generate a task sequence, and the task sequence seq has been explained in the previous text. The data width output by the register unit is still equal to the total task amount of multiple tasks that need to be processed in parallel. The first type of code element in the task sequence of the register unit is used to indicate the execution of the task, and the second type of code element opposite to the first type of code element indicates that the task is not executed, as explained in the previous text. The register unit is connected to the second counting module such as CNT2 to facilitate the reception of the flag count such as fg transmitted to the register unit by the second counting module such as CNT2. As mentioned above, the register unit determines the next task sequence in response to the flag count and the previous task sequence, and when the flag count reaches a preset cumulative value: if the previous task sequence is equal to the end value of the sequence, the next task sequence jumps to the first value of the sequence; if the previous task sequence is not equal to the end value of the sequence, the next task sequence is shifted once by the current value, and the shift amount is a determined value.
[0132] The above description and drawings provide typical embodiments of specific structures of specific embodiments. The above invention provides existing preferred embodiments, but these contents are not intended to be limiting. For those skilled in the art, various changes and modifications will undoubtedly be obvious after reading the above description. Therefore, the attached claims should be regarded as covering all changes and modifications of the true intent and scope of the present invention. Any and all equivalent scopes and contents within the scope of the claims should be considered to still be within the intent and scope of the present invention.
Claims
1. A register-based multitasking device, characterized in that: include: A first counter, used to generate counting data; A second counter is used to generate a flag count, and the flag count is accumulated once each time the count data of the first counter reaches a predetermined value; The master control register has a data width equal to the total amount of multiple tasks to be processed in parallel. The first type of code element in the task sequence of the master control register is used to indicate the execution of the task, while the second type of code element opposite to the first type of code element indicates that the task is not executed; The master control register determines the next task sequence in response to the flag count and the previous task sequence. When the flag count reaches a preset cumulative value: If the previous task sequence is equal to the end value of the sequence, the next task sequence jumps to the first value of the sequence. If the previous task sequence is not equal to the end value of the sequence, the next task sequence shifts the current value once, and the shift amount is a certain value.
2. The register-based multitasking device according to claim 1, characterized in that: When the count data of the first counter reaches a maximum value, the count data of the first counter jumps to a zero value and starts counting upward again, wherein the size of the maximum value is adjustable.
3. The register-based multitasking device according to claim 2, characterized in that: The predetermined value is equal to the maximum value minus a specified scale, wherein the scale measurement of the specified scale is elastically adjustable.
4. The register-based multitasking device according to claim 1, characterized in that: The enable state of the flag count is a single pulse signal. Each time the count data of the first counter reaches the predetermined value, the flag count is accumulated to the enable state. When the count data is not equal to the predetermined value, the flag count returns to zero and is disabled. The number of times the flag count appears in the enabled state is made equal to the data width of the task sequence, that is, the tasks represented by each task sequence are executed at least in one enabled state of the flag count.
5. The register-based multitasking device according to claim 1, characterized in that: The enable state of the flag count is a specified increment value. Each time the count data of the first counter reaches the predetermined value, the flag count is continuously accumulated, and a portion of the accumulated value of the flag count is set to the specified increment value. When the accumulated value of the flag count is a non-specified increment value, the flag count is disabled. The number of times the flag count appears in the enabled state is made lower than the data width of the task sequence, that is, tasks represented by a part of the task sequence are executed in the corresponding enabled state of the flag count, and tasks of the remaining task sequence are suspended.
6. The register-based multitasking device according to claim 1, characterized in that: All parallel tasks represented by each task sequence are synchronously shielded in the following way: Based on the situation where the flag count reaches the preset cumulative value, when the previous task sequence is equal to the end value of the sequence, the next task sequence is prohibited from jumping to the first value of the sequence, and the task sequence is guided to shift once from the current value, and the shift amount is a certain value until the task sequence completely overflows.
7. The register-based multitasking device according to claim 1, characterized in that: The binary number of the task sequence is inverted bit by bit to obtain an inverted sequence, which serves as an external task control signal. The second type of code element in the inverted sequence is used to indicate the execution of the task, and the first type of code element represents that the task is not executed, so as to prevent multiple tasks from competing in a single cycle of the same flag count.
8. The register-based multitasking device according to claim 6, characterized in that: Before inserting a new task into the initial task sequence, all parallel tasks represented by each initial task sequence are firstly synchronously shielded, and the data width of the initial task sequence is expanded to the total task amount of the current task; The weight of the extended bit of any task sequence after the data width is extended is set to be higher than the weight of the original sequence value of any task sequence before the extension, and any task sequence after the data width is extended retains its original sequence value and also fills zero at its extended bit; as well as The low-weighted bits of the end values of a sequence in each initial task sequence are padded with zeros until its data width is equal to the total task amount of the current task. The resulting new sequence is regarded as the end value of the sequence of each task sequence after the data width is expanded.
9. The register-based multitasking device according to claim 5, characterized in that: The task sequence corresponding to the cycle in which the value in a series of accumulated values of the flag count exceeds the specified increment value is forced to be set to the end value of the sequence.
10. A method for processing tasks in parallel using registers, characterized in that: include: Using a first counter to generate count data; A second counter is used to generate a flag count, and the flag count is accumulated once each time the count data of the first counter reaches a predetermined value; A task sequence is generated by using a master control register, whose data width is equal to the total task amount of multiple tasks to be processed in parallel. The first type of code element in the task sequence of the master control register is used to indicate the execution of the task, and the second type of code element opposite to the first type of code element represents that the task is temporarily suspended and not executed; The master control register determines the next task sequence in response to the flag count and the previous task sequence. When the flag count reaches a preset cumulative value: If the previous task sequence is equal to the end value of the sequence, the next task sequence jumps to the first value of the sequence. If the previous task sequence is not equal to the end value of the sequence, the next task sequence shifts the current value once, and the shift amount is a certain value.
