CN108701030B - Data processing method and device based on processor - Google Patents

Data processing method and device based on processor Download PDF

Info

Publication number
CN108701030B
CN108701030B CN201780011703.6A CN201780011703A CN108701030B CN 108701030 B CN108701030 B CN 108701030B CN 201780011703 A CN201780011703 A CN 201780011703A CN 108701030 B CN108701030 B CN 108701030B
Authority
CN
China
Prior art keywords
periodic function
function
target
periodic
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201780011703.6A
Other languages
Chinese (zh)
Other versions
CN108701030A (en
Inventor
邓向钖
刘鹏飞
唐疑军
刘晓红
吴壬华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Shinry Technologies Co Ltd
Original Assignee
Shenzhen Shinry Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Shinry Technologies Co Ltd filed Critical Shenzhen Shinry Technologies Co Ltd
Publication of CN108701030A publication Critical patent/CN108701030A/en
Application granted granted Critical
Publication of CN108701030B publication Critical patent/CN108701030B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

A method and apparatus for processor-based data processing, the method comprising: setting a plurality of periodic function sets, respectively setting corresponding execution periods for the periodic function sets, and setting at least one periodic function in each periodic function set; acquiring the current operation time length of a processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set; updating set parameters respectively corresponding to each target periodic function set, and acquiring periodic function identifiers which are the same as the updated set parameters from each target periodic function set as target periodic function identifiers; and synchronously executing a plurality of function functions contained in the periodic functions respectively corresponding to the target periodic function identifications. By adopting the method, the utilization rate of the processor can be improved, so that the power consumption of the processor is reduced.

Description

Data processing method and device based on processor
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data processing method and apparatus based on a processor.
Background
With the rapid development of mobile internet technology, an embedded real-time operating system (RTOS) is widely applied to emerging computing devices and embedded markets with networks as centers, and particularly in the fields of Digital Signal Processing (DSP), wireless application and the like, an embedded assembly language can be adopted to help a corresponding single-chip microcomputer operating system to realize product intellectualization.
In a conventional embedded software execution mode, each function is sequentially executed according to an editing sequence, and when the number of the function functions corresponding to a processor is increased and the function functions are more complex, the execution time of each function needs to be increased, so that the time sequence cannot be correspondingly guaranteed.
In addition, in practical application, most of the function functions are executed according to a certain period, and if the function functions are executed according to the cycle period, each function in the cycle period may be called once, that is, the power consumption of the processor is increased during serial operation, and thus the limited memory resources of the processor are wasted.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present invention is to provide a data processing method and apparatus based on a processor, which can reduce power consumption of the processor, so as to avoid resource waste of the processor and improve utilization rate of the processor.
In order to solve the above technical problem, a first aspect of an embodiment of the present invention provides a data processing method based on a processor, including:
setting a plurality of periodic function sets, respectively setting corresponding execution periods for the periodic function sets, and setting at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function identifier; the execution cycles are different from each other;
acquiring the current operation time length of a processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set;
updating set parameters respectively corresponding to each target periodic function set, and acquiring periodic function identifiers which are the same as the updated set parameters from each target periodic function set as target periodic function identifiers;
and synchronously executing a plurality of function functions contained in the periodic functions respectively corresponding to the target periodic function identifications.
Setting a plurality of periodic function sets, respectively setting corresponding execution periods for the periodic function sets, and setting at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function identifier; the execution cycles are different from each other;
acquiring the current operation time length of a processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set;
updating set parameters respectively corresponding to each target periodic function set, and acquiring periodic function identifiers which are the same as the updated set parameters from each target periodic function set as target periodic function identifiers;
and synchronously executing a plurality of function functions contained in the periodic functions respectively corresponding to the target periodic function identifications.
The setting of a plurality of periodic function sets, the setting of corresponding execution cycles for each periodic function set, and the setting of at least one periodic function in each periodic function set includes:
setting a plurality of periodic function sets, and respectively setting corresponding execution cycles for each periodic function set;
acquiring preset operation periods corresponding to the function functions respectively, determining the operation priority of the function functions in the processor according to the operation periods, and establishing a mapping relation table between the operation priority and the execution periods;
determining the execution period corresponding to each function in the mapping relation table according to the operation priority corresponding to each function;
adding the function functions with the same execution period into the periodic function sets with the corresponding execution periods, setting at least one periodic function in each periodic function set, and distributing the function functions in each periodic function set to the corresponding periodic functions.
The acquiring the current operation time length of the processor, comparing the current operation time length with each execution cycle, and determining a periodic function set with a comparison result meeting a preset time condition as a target periodic function set, includes:
acquiring the current running time of the processor, and reading the execution period of each periodic function set;
comparing the current operation duration with each execution cycle, and generating comparison results respectively corresponding to each execution cycle;
determining a comparison result of which the current operation time length is integral multiple of the execution period as a target comparison result meeting a preset time condition;
and determining a periodic function set corresponding to the execution period contained in the target comparison result as a target periodic function set.
Optionally, after the comparing the current operation duration with each execution cycle and generating a comparison result corresponding to the current operation duration, the method further includes:
and when detecting that the current operation time length does not reach the integral multiple of each execution period, determining that each comparison result does not meet a preset time condition, and releasing the memory resources corresponding to each periodic function set.
Wherein, the updating the set parameters respectively corresponding to each target periodic function set, and acquiring periodic function identifiers in each target periodic function set, which are the same as the updated set parameters, as the target periodic function identifiers, includes:
acquiring set parameters respectively corresponding to each target periodic function set and periodic function identifications respectively corresponding to each periodic function in each target periodic function set;
acquiring a parameter updating mode;
if the parameter updating mode is a parameter increasing mode, increasing the set parameters respectively corresponding to each target periodic function set in an increasing mode according to the parameter increasing mode, and acquiring periodic function identifiers which are the same as the set parameters after increasing in each target periodic function set as target periodic function identifiers;
if the parameter updating mode is a parameter decreasing mode, decreasing the set parameters respectively corresponding to each target periodic function set according to the parameter decreasing mode, and acquiring periodic function identifiers which are the same as the decreased set parameters in each target periodic function set as target periodic function identifiers.
A second aspect of the embodiments of the present invention provides a data processing apparatus based on a processor, including:
the data setting module is used for setting a plurality of periodic function sets, respectively setting corresponding execution cycles for the periodic function sets, and setting at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function identifier; the execution cycles are different from each other;
the time length comparison module is used for acquiring the current operation time length of the processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set;
the parameter updating module is used for updating set parameters corresponding to each target periodic function set respectively, and acquiring periodic function identifiers which are the same as the updated set parameters in each target periodic function set as target periodic function identifiers;
and the function execution module is used for synchronously executing a plurality of function functions contained in the periodic functions respectively corresponding to the target periodic function identifications.
Wherein, the data setting module comprises:
the function set setting unit is used for setting a plurality of periodic function sets and respectively setting corresponding execution cycles for the periodic function sets;
the mapping relation establishing unit is used for acquiring preset operation periods corresponding to the function functions respectively, determining the operation priority of the function functions in the processor according to the operation periods, and establishing a mapping relation table between the operation priority and the execution periods;
an execution cycle determining unit, configured to determine, according to the operation priorities corresponding to the functional functions, execution cycles corresponding to the functional functions in the mapping relationship table;
the function distribution unit is used for adding the function functions with the same execution period into the periodic function sets with the corresponding execution periods, setting at least one periodic function in each periodic function set, and distributing the function functions in each periodic function set to the corresponding periodic functions.
Wherein, the duration comparison module comprises:
the time length obtaining unit is used for obtaining the current running time length of the processor and reading the execution period of each periodic function set;
the time length comparison unit is used for comparing the current operation time length with each execution cycle and generating comparison results respectively corresponding to each execution cycle;
a condition satisfying unit, configured to determine a comparison result that the current operation duration is an integral multiple of the execution period as a target comparison result that satisfies a preset time condition;
and the target set determining unit is used for determining a periodic function set corresponding to the execution period contained in the target comparison result as a target periodic function set.
Optionally, the duration comparing module further includes:
and the memory release unit is used for determining that each comparison result does not meet the preset time condition and releasing the memory resources corresponding to each periodic function set when detecting that the current operation duration does not reach the integral multiple of each execution period.
Wherein the parameter updating module comprises:
a set parameter obtaining unit, configured to obtain set parameters corresponding to each target periodic function set and periodic function identifiers corresponding to each periodic function in each target periodic function set;
the updating mode acquiring unit is used for acquiring a parameter updating mode;
an incremental updating unit, configured to, if the parameter updating manner is a parameter incremental manner, increment set parameters respectively corresponding to each target periodic function set according to the parameter incremental manner, and acquire a periodic function identifier that is the same as the set parameter after the increment in each target periodic function set, as a target periodic function identifier;
and the decreasing updating unit is used for decreasing the set parameters respectively corresponding to the target periodic function sets according to the parameter decreasing mode if the parameter updating mode is the parameter decreasing mode, and acquiring periodic function identifiers which are the same as the decreased set parameters from the target periodic function sets as the target periodic function identifiers.
The embodiment of the invention sets a plurality of periodic function sets, respectively sets corresponding execution periods for the periodic function sets, and sets at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function identifier; the execution cycles are different from each other; acquiring the current operation time length of a processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set; updating set parameters respectively corresponding to each target periodic function set, and acquiring periodic function identifiers which are the same as the updated set parameters from each target periodic function set as target periodic function identifiers; and synchronously executing a plurality of function functions contained in the periodic functions respectively corresponding to the target periodic function identifications. Therefore, the processor-based data processing apparatus may determine, when the comparison result corresponding to the current operation duration and each execution cycle satisfies the time condition, the periodic function set satisfying the time condition as the target periodic function set, and when it is detected in each target periodic function set that the target periodic function identifier is equal to the updated set parameter, synchronously execute a plurality of function functions included in the periodic function corresponding to each target periodic function identifier, thereby improving the utilization rate of the processor, and reducing the power consumption of the processor, so as to avoid resource waste of the processor.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart illustrating a method for processing data based on a processor according to an embodiment of the present invention;
FIG. 2 is a block diagram of a processor-based data processing apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a data setting module according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a duration comparison module according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a parameter update module according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another processor-based data processing apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "including" and "having," and any variations thereof, in the description and claims of this invention and the above-described drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
The execution of the processor-based data processing method mentioned in the embodiments of the present invention relies on a computer program that can run on a computer system of the von-karman system. The computer program may be integrated into the application or may run as a separate tool-like application. The computer system can be terminal equipment such as a personal computer, a tablet computer, a notebook computer, a smart phone and the like.
The following are detailed below.
Fig. 1 is a schematic flowchart of a data processing method based on a processor according to an embodiment of the present invention. As shown in fig. 1, the processor-based data processing method at least includes:
step S101, setting a plurality of periodic function sets, respectively setting corresponding execution cycles for each periodic function set, and setting at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function identifier; the execution cycles are different from each other;
specifically, the processor-based data processing apparatus may set a plurality of periodic function sets, and set a corresponding execution cycle for each periodic function set, and acquiring preset operation periods corresponding to the function functions respectively, determining the operation priority of the function functions in the processor according to the operation periods, establishing a mapping relation table between each operation priority and each execution period, and according to the operation priority corresponding to each function, determining the execution period corresponding to each function in the mapping relation table, and adding the function with the same execution period to the periodic function set with the corresponding execution period, at least one periodic function is set in each periodic function set, and the functional functions in each periodic function set are distributed to the corresponding periodic functions;
the processor-based data processing device can be applied to a smart phone, a personal tablet, a personal computer, a mobile internet device, a wearable device (such as a smart watch (like iwatch and the like), a smart bracelet) or other terminal equipment which can be installed with application software;
the execution cycles corresponding to the periodic function sets can meet a certain multiple relation so as to ensure that the periodic function sets obtain the minimum execution cycle under the same operation duration, and the minimum execution cycle is taken as a timing unit so as to ensure that the periodic functions in the periodic function sets can operate in a time-sharing manner and further ensure the time sequence operation of the periodic functions;
for example, the data processing apparatus may receive a plurality of periodic function sets (e.g., 3) set by a back-office administrator, and set corresponding execution periods (100 microseconds, 1 millisecond, 10 milliseconds) for each periodic function set. For example, the execution period corresponding to the first periodic function set is 100 microseconds (i.e., 0.1 milliseconds, and 1ms is 1000us according to a conversion formula between microseconds (us) and milliseconds (ms) in a timing unit); the execution cycle corresponding to the second periodic function set is 1ms, and the execution cycle corresponding to the third periodic function set is 10 ms. It can be seen that the minimum execution period is 100us, and according to the inverse relationship between the execution period and the frequency, the smaller the available execution period is, the more times the execution is performed in a unit time is. In view of this, further taking the example of synchronously running three sets of periodic functions as an example, in order to ensure the time sequence of each function, 100us with the minimum execution cycle may be used as a timing unit, and when 10 periodic functions in the first set of periodic functions are executed once (time consumption, 10 × 100us ═ 1ms), 10 periodic functions in the second set of periodic functions are executed once (execution cycle is 1 ms); similarly, when the 10 periodic functions in the second set of periodic functions are executed for one time, the third set of periodic functions just completes one of the periodic functions (the execution period is 10 ms).
For another example, in the set 3 periodic function sets (periodic function set a, periodic function set B, and periodic function set C), the operation priority of each functional function in the processor may be determined according to the time consumption situation of each functional function in the processor and/or the operation period required by each functional function, and the description of the priority distribution is performed by taking 10 functional functions of 100 functional functions as an example, and further, please refer to the distribution table of the corresponding operation priorities of the 10 functional functions in the processor given in table 1;
Figure BDA0001766978670000081
TABLE 1
As can be seen from the distribution table of the corresponding operating priorities of the 10 function functions in the processor given in table 1, since the operating time consumption of the function a and the function B in the processor is the minimum, the priority of the 2 function functions can be determined as the first priority, that is, the two function functions are the function with the highest operating priority; the running time of the function C, the function D, the function E and the function F in the processor is longer, so that the priority of the 4 function functions can be determined as a second priority; the running time of the function G, the function H, the function I and the function J in the processor is the longest, and the priority of the 4 functions can be determined as the third priority. Or, since the operation cycle of the function a and the function B in the processor is shortest, the function a and the function B correspond to the first operation priority; in addition, the function C, the function D, the function E and the function F have longer running periods in the processor, so the function C, the function D, the function E and the function F correspond to a second priority; in addition, since the operation cycle of the function G, the function H, the function I, and the function J in the processor is longest, the function G, the function H, the function I, and the function J all correspond to the third priority.
Similarly, the determination of the priority of the other 90 function functions in the 100 function functions may also be determined according to the time consumption of each function when running in the processor and/or the running period required by each function, which is not listed here.
For another example, still taking the above 10 function functions as an example, after obtaining the operation priorities corresponding to the 10 function functions respectively, a mapping relationship table between each operation priority and each execution cycle may be established, and the execution cycle corresponding to each function may be further determined according to the priority corresponding to each function respectively; specifically, please refer to the mapping relationship table between each operation priority and each execution cycle given in table 2;
set of periodic functions Set of periodic functions A Set of periodic functions B Set of periodic functions C
Each execution cycle 100us 1ms 10ms
Priority of operation First operation priority Second operational priority Third operational priority
TABLE 2
As can be seen from the mapping relationship table between the operation priorities and the execution periods given in table 2, the execution period corresponding to the function with the operation priority being the first operation priority is 100us, that is, the function a and the function B correspond to a periodic function with an execution period of 100 us; in addition, the execution cycle corresponding to the function with the second operation priority is 1ms, that is, the function C, the function D, the function E and the function F all correspond to a periodic function with the execution cycle of 1 ms; in addition, the execution period corresponding to the function with the third operation priority is 10ms, that is, the function G, the function H, the function I and the function J all correspond to a periodic function with the execution period of 10 ms;
similarly, the other 90 function functions with the same operation priority (or execution cycle) may be added to the set of periodic functions with the same execution cycle, and the function functions in each set of periodic functions may be further distributed to the corresponding periodic functions, for example, periodic function 1 in periodic function set a may include two function functions (function a and function B); the periodic function 3 in the periodic function set B may include four functional functions (functional function C, functional function D, functional function E, and functional function F); the periodic functions 10 in the periodic function set C may include four functional functions (functional function G, functional function H, functional function I, and functional function J).
Step S102, acquiring the current operation time length of the processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set;
specifically, the current operation time length of the processor is obtained, the execution cycles of the periodic function sets are read, the current operation time length is compared with the execution cycles, comparison results corresponding to the execution cycles are generated, the comparison result of which the current operation time length is integral multiple of the execution cycles is determined as a target comparison result meeting a preset time condition, and the periodic function set corresponding to the execution cycles included in the target comparison result is determined as a target periodic function set.
Optionally, when it is detected that the current operation duration does not reach the integral multiple of each execution cycle, it is determined that each comparison result does not meet a preset time condition, and the memory resource corresponding to each periodic function set is released.
For example, there are 100 function functions to be run in the processor, and the running time consumption of each function in the processor is tf, so as to ensure that each function can be run reasonably according to the time sequence; the processor can put 20 function functions with an operation period of 1ms into 10 periodic functions with an execution period of 100us in the first periodic function set respectively (since the 20 function functions are just 10 × 100us to 1ms after one round of operation, the operation period of each function can be 1ms), that is, each periodic function has 2 function functions; in addition, the function functions with 40 operating cycles of 10ms may be respectively placed in the 10 periodic functions with execution cycles of 1ms in the second periodic function set (since the 40 function functions are just 10 × 1ms to 10ms after one round of operation, the operating cycle of each function can be 10ms), that is, each periodic function has 4 function functions; in addition, the remaining 40 function functions with an operation period of 100ms are respectively placed into 10 periodic functions with an execution period of 10ms in the third periodic function set (since the 40 function functions are all operated for one round, just 10 × 10ms is 100ms, the operation period of each function can be 100ms), that is, 4 function functions can be included in each periodic function. Further, please refer to the comparison between each current operation duration and the corresponding execution period given in table 3;
first set of periodic functions Set of second periodic functions Set of third periodic functions
Each execution cycle 100us 1ms 10ms
Length of operation A 50ms 50ms 50ms
Length of operation B 73ms 73ms 73ms
Length of operation C 930us 930us 930us
TABLE 3
As can be seen from the comparison between each current operating duration and the corresponding execution period of the corresponding periodic function set given in table 3 above: when the current operation duration is the operation duration A (50ms), the current operation duration is an integral multiple of an execution cycle (100us, 1ms and 10ms) corresponding to the three periodic function sets; in other words, 50ms of the comparison results is 500 times of 100us, 50ms is 50 times of 1ms, and 50ms is 5 times of 10ms, which both satisfy the preset time condition, so that when the current operation duration is the operation duration a, synchronous operation of the periodic function sets with the execution cycles of 100us, 1ms, and 10ms may be triggered.
In addition, optionally, when the current operation duration is an operation duration B (73ms), the current operation duration is an integral multiple of the execution periods (100us and 1ms) corresponding to the two periodic function sets; that is, 73ms in the comparison result is 730 times of 100us, 73 times of 1ms and 7.3 times of 10ms, so that the two periodic function sets with the execution periods of 100us and 1ms satisfy the preset time condition; when the current operation duration is the operation duration B, the first periodic function set and the second periodic function set can be determined as a target periodic function set satisfying a preset time condition; in view of this, the comparison result whose current operation duration is an integer multiple of the execution period (73ms is 730 times of 100us and 73 times of 1ms) may be determined as the target comparison result satisfying the preset time condition, and the periodic function sets (the first periodic function set and the second periodic function set) corresponding to the execution periods included in the target comparison result may be further determined as the target periodic function set.
Furthermore, optionally, when the current operation duration is the operation duration C (930us), it may be detected that none of the current operation durations reaches an integral multiple of the execution periods (100us, 1ms, 10 ms); 930us is 9.3 times of 100us, 930us is 0.93 times of 1ms, 930us is 0.093 times of 10ms, and therefore, when the current operation duration is the operation duration C, each comparison result corresponding to each execution cycle (100us, 1ms, 10ms) in each periodic function set does not satisfy the preset time condition; in view of this, the memory resources corresponding to the three-cycle function sets can be released.
Step S103, updating set parameters respectively corresponding to each target periodic function set, and acquiring periodic function identifiers which are the same as the updated set parameters in each target periodic function set as target periodic function identifiers;
specifically, acquiring set parameters respectively corresponding to each target periodic function set and periodic function identifications respectively corresponding to each periodic function in each target periodic function set, and acquiring a parameter updating mode; if the parameter updating mode is a parameter increasing mode, increasing the set parameters respectively corresponding to each target periodic function set in an increasing mode according to the parameter increasing mode, and acquiring periodic function identifiers which are the same as the set parameters after increasing in each target periodic function set as target periodic function identifiers;
optionally, if the parameter updating manner is a parameter decreasing manner, decreasing the set parameters respectively corresponding to each target periodic function set according to the parameter decreasing manner, and acquiring a periodic function identifier, which is the same as the decreased set parameter, in each target periodic function set as the target periodic function identifier.
The set parameters can be used for representing the execution sequence corresponding to each periodic function in the target periodic function set;
the periodic function identifier has uniqueness in a corresponding single target periodic function set, and the maximum value of the periodic function identifier can be used for representing the number of periodic functions in the single target periodic function set.
For example, three target periodic function sets (an a periodic function set, a B periodic function set, and a C periodic function set) in synchronous operation are taken as an example, where an execution cycle corresponding to the a periodic function set is smaller than an execution cycle corresponding to the B periodic function set, and an execution cycle corresponding to the B periodic function set is smaller than an execution cycle corresponding to the C periodic function set; in addition, the set parameters corresponding to the three target periodic function sets are X, Y, and Z, and the value of each set parameter may be any one of values 1 to N (N is a positive integer greater than 1, for example, N is 10); in addition, a periodic function identifier corresponding to each periodic function in each target periodic function set and a corresponding parameter updating manner (for example, a parameter increasing manner) can be further obtained, specifically, please refer to the set parameter distribution condition corresponding to each target periodic function set when two operation durations (for example, the duration a and the duration B are provided, and the duration a is smaller than the duration B) are provided in table 4;
set of objective periodic functions Set of A periodic functions Set of B periodic functions Set of C periodic functions
Aggregate parameters X Y Z
Periodic function identification A 8 4 1
Periodic function identification B 16 8 2
TABLE 4
As can be seen from the set parameter distribution situation corresponding to each target periodic function set given in table 4, since the execution cycle corresponding to the a periodic function set is smaller than the execution cycle corresponding to the B periodic function set, and the execution cycle corresponding to the B periodic function set is smaller than the execution cycle corresponding to the C periodic function set, when the current operation duration is a duration, the set parameter X after the increment corresponding to the a periodic function set is read to be 8, the set parameter Y after the increment corresponding to the B periodic function set is read to be 4, and the set parameter Z corresponding to the C periodic function set is read to be 1, at this time, the a periodic function set, the B periodic function set, and the C periodic function set can be synchronously executed when the a duration reaches each periodic function corresponding to each periodic function identifier in the current operation duration. In addition, because the parameter updating modes corresponding to the cycle function set A, the cycle function set B and the cycle function set C are parameter increasing modes, the set parameters X, the set parameters Y and the set parameters C can be updated incrementally according to the parameter increasing modes corresponding to the three target cycle function sets. When the current operation duration is B duration, it may be detected that an incremental set parameter X corresponding to the a-period function set is 16, an incremental set parameter Y corresponding to the B-period function set is 8, and an incremental set parameter Z corresponding to the C-period function set is 2, that is, when the B duration is B duration, the period function identifiers 16, 8, and 2 corresponding to each period function in the a-period function set, the B-period function set, and the C-period function set are target period function identifiers, that is, each period function in 3 sets corresponding to each target period function identifier may be synchronously executed in the current operation duration (B duration).
Step S104, synchronously executing a plurality of function functions contained in the periodic function corresponding to each target periodic function identification.
For example, taking an example that each of the periodic functions (periodic function 1 and periodic function 3) corresponding to each target periodic function identifier includes 4 functional functions, when it is detected that each target periodic function identifier is equal to the updated set parameter (Y is 10, Z is 2), where periodic function 1 corresponds to a decreasing parameter manner and periodic function 3 corresponds to an increasing parameter manner, at this time, each functional function in periodic function 1 and periodic function 3 is executed synchronously, specifically, please refer to each functional function table carried in each periodic function listed in table 5;
Figure BDA0001766978670000131
TABLE 5
As can be seen from the distribution of each function in each periodic function given in table 5, there are 4 functions, namely, function a, function B, function C and function D, in periodic function 1, and these 4 functions can be executed in a serial manner (for example, function a is executed first, function B is executed second, function C is executed second, and function D is executed last) in periodic function 1; similarly, the periodic function 3 also includes 4 function functions, which are respectively a function E, a function F, a function G and a function H, and the 4 function functions are executed one by one in the periodic function 3 according to the set sequence;
optionally, after the function 4 in each periodic function 1 is executed, the set parameter Y corresponding to the periodic function 1 is decremented according to the parameter decrementing manner, so as to form a set parameter (e.g., Y ═ 9) corresponding to the next periodic function (e.g., the periodic function 2). Similarly, after the function H in the periodic function 3 is executed, the set parameter Z corresponding to the periodic function 3 is incremented according to the parameter increment manner to form the set parameter (e.g., Z ═ 3) corresponding to the next periodic function (e.g., the periodic function 4).
Therefore, the data processing device based on the processor firstly sets a plurality of periodic function sets, respectively sets corresponding execution cycles for the periodic function sets, and sets at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function mark; the execution cycles are different from each other; secondly, acquiring the current operation time length of the processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set; then, updating set parameters corresponding to each target periodic function set, and acquiring periodic function identifiers which are the same as the updated set parameters in each target periodic function set as target periodic function identifiers; and finally, synchronously executing a plurality of function functions contained in the periodic functions respectively corresponding to the target periodic function identifications. It can be seen that, the comparable result of the processor-based data processing apparatus satisfies that the periodic function set when the current operation duration is an integer multiple of each execution period is taken as a target periodic function set, and when the periodic function identifier is equal to the updated set parameter, the periodic function identifier is taken as a target periodic function identifier, and a plurality of function functions in the periodic function corresponding to each target periodic function identifier are executed synchronously, so as to implement time-sharing operation of the plurality of function functions, further improve the utilization rate of the processor, and further reduce the power consumption of the processor.
Further, please refer to fig. 2, which is a schematic structural diagram of another data processing apparatus based on a processor according to an embodiment of the present invention. As shown in fig. 2, the processor-based data processing apparatus 1 comprises at least: the device comprises a data setting module 10, a duration comparison module 20, a parameter updating module 30 and a function execution module 40;
the data setting module 10 is configured to set a plurality of periodic function sets, set corresponding execution cycles for each periodic function set, and set at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function identifier; the execution cycles are different from each other;
in particular, said data setting module 10 in the processor-based data processing device 1, may be adapted to set a plurality of sets of periodic functions, respectively setting corresponding execution cycles for each periodic function set, and acquiring preset operation cycles corresponding to each functional function, determining the operation priority of each function in the processor according to each operation period, establishing a mapping relation table between each operation priority and each execution period, and according to the operation priority corresponding to each function, determining the execution period corresponding to each function in the mapping relation table, and adding the function with the same execution period to the periodic function set with the corresponding execution period, at least one periodic function is set in each periodic function set, and the functional functions in each periodic function set are distributed to the corresponding periodic functions;
the processor-based data processing apparatus 1 may be applied to a smart phone, a personal tablet, a personal computer, a mobile internet device, a wearable device (e.g., a smart watch (such as iwatch), a smart bracelet), or other terminal device capable of installing application software;
the execution cycles corresponding to the periodic function sets can meet a certain multiple relation so as to ensure that the periodic function sets obtain the minimum execution cycle under the same operation duration, and the minimum execution cycle is taken as a timing unit so as to ensure that the periodic functions in the periodic function sets can operate in a time-sharing manner and further ensure the time sequence operation of the periodic functions;
further, please refer to the description of step S101 in the embodiment corresponding to fig. 1 for a specific implementation of the data setting module 10, which is not described herein again.
Further, please refer to fig. 3, which is a schematic structural diagram of a data processing module according to an embodiment of the present invention. As shown in fig. 3, the data processing module 10 includes: a function set setting unit 101, a mapping relation establishing unit 102, an execution period determining unit 103 and a function distributing unit 104;
the function set setting unit 101 is configured to set a plurality of periodic function sets, and set corresponding execution cycles for each periodic function set;
the mapping relationship establishing unit 102 is configured to obtain preset operation periods corresponding to the function functions, determine operation priorities of the function functions in the processor according to the operation periods, and establish a mapping relationship table between the operation priorities and the execution periods;
the execution cycle determining unit 103 is configured to determine, according to the operation priorities corresponding to the functional functions, execution cycles corresponding to the functional functions in the mapping relationship table;
the function allocating unit 104 is configured to add function functions with the same execution cycle to a set of periodic functions with corresponding execution cycles, set at least one periodic function in each set of periodic functions, and allocate the function functions in each set of periodic functions to the corresponding periodic functions.
For example, the function set setting unit 101 may receive a plurality of periodic function sets (for example, 5 periodic function sets are, respectively, a periodic function set a, a periodic function set B, a periodic function set C, a periodic function set D, and a periodic function set E) set by a background manager, and set corresponding execution periods (for example, 100us, 500us, 2.5ms, 12.5ms, and 72.5ms) for the 5 periodic function sets, respectively; wherein, the minimum execution period is 100us, and according to the inverse relation between the execution period and the frequency, the smaller the available execution period is, the more the execution times in the unit time is.
For another example, taking 10 function functions as an example, the function set setting unit 101 may obtain 3 set periodic function sets, and the mapping relationship establishing unit 102 may determine the operation priorities corresponding to the function functions according to the time consumption of the function functions when running in the processor and/or the operation cycles required by the function functions. For example, a corresponding operation cycle may be set according to the time consumption of the 10 function functions in the processor during operation, the operation priorities corresponding to the function functions are determined according to the operation cycles, and a mapping relationship table between each operation priority and each execution cycle is established, so that the static variables (each operation cycle) associated with each function in the target periodic function can perform a timing function, specifically, please refer to the operation cycle statistical condition table corresponding to each function given in table 4;
function of each function Function 1 Function 2 Function 3 Function 4 Function 5
Period of operation <500us <800us <10ms <15ms <20ms
Function of each function Function 6 Function 7 Function 8 Function 9 Function 10
Period of operation <500us <800us <10ms <15ms <20ms
TABLE 6
As can be seen from the operation period statistics table corresponding to each function given in table 6, the mapping relationship establishing unit 102 may determine the operation priority of each function in the processor according to the time consumption of each function in the processor and/or the operation period required by each function; the description of the time consumption of each function when running in the processor may refer to the description of step S101 in the embodiment corresponding to fig. 1, that is, the running period corresponding to each function may be determined according to the time consumption of the running, so as to determine the running priority of each function in the processor; optionally, in the above 10 function functions, the operation priority of each function in the processor may also be determined according to the operation cycle of each function in the processor, that is, a function having a certain operation cycle range may be regarded as a function having an equivalent operation priority. For example, 3 periodic function sets may be set for the 10 function functions given in table 6, where the three periodic function sets are an a periodic function set, a B periodic function set, and a C periodic function set, respectively, and an execution period corresponding to the a periodic function set is 100us, an execution period corresponding to the B periodic function set is 2ms, and an execution period corresponding to the C periodic function set is 10 ms. In view of this, 3 levels of priorities may be sequentially set for the 3 sets of periodic functions corresponding to the above 10 functional functions, for example, the functional function 1 and the functional function 6 with an operating period less than 500us, and the functional function 2 and the functional function 7 with an operating period less than 800us may be set as the first operating priority; secondly, the function 3 and the function 8 with the operation period less than 10ms, and the function 4 and the function 9 with the operation period less than 15ms can be set as a second operation priority; then, the function 5 and the function 10 having the operation periods less than 20ms may be set as the third operation priority; further, refer to table 1 in the embodiment corresponding to fig. 1 to describe the corresponding operation priorities of the listed 10 function functions in the processor, which is not described herein again.
In addition, the execution cycle determining unit 103 may determine, according to the mapping relationship between the operation priorities and the execution cycles, the execution cycles corresponding to the 10 function functions in the 3 periodic function sets respectively; further, please refer to the execution cycle distribution table corresponding to each function in each periodic function shown in table 7;
function of each function Function 1 Function 2 Function 3 Function 4 Function 5
Execution cycle 100us 100us 2ms 2ms 10ms
Function of each function Function 6 Function 7 Function 8 Function 9 Function 10
Execution cycle 100us 100us 2ms 2ms 10ms
TABLE 7
As can be seen from the distribution table of each execution cycle given in table 7 above, and the statistical table of the operation cycles given in table 6, in the 10 function functions, the function 1 and the function 6 may be added to the periodic function 1, the function 2 and the function 7 may be added to the periodic function 2, and the execution cycles corresponding to the periodic function 1 and the periodic function 2 are both 100 us; in addition, the function 3 and the function 8 can be added into the periodic function 3, the function 4 and the function 9 can be added into the periodic function 4, and the execution periods corresponding to the periodic function 3 and the periodic function 4 are both 2 ms; in addition, the function 5 and the function 10 may be added to the periodic function 5 so that the execution period corresponding to the periodic function 5 is 10 ms. Thus, the function assigning unit 104 may assign function functions having the same execution cycle; for example, function 1 and function 6, and function 2 and function 7 may be added to a set of periodic functions (e.g., a set of periodic functions) having corresponding execution cycles, and accordingly, function 3 and function 8, and function 4 and function 9 may be added to a set of B periodic functions; the two function functions, i.e., function 5 and function 10, may be added to the periodic function set C, so that each periodic function set (periodic function 1 to periodic function 5) includes at least one periodic function, i.e., the periodic function set a includes 2 periodic functions and each periodic function includes 2 function functions, the periodic function set B includes 2 periodic functions and each periodic function includes 2 function functions, the periodic function set C includes 1 periodic function and the 1 periodic function includes 2 function functions.
The time length comparison module 20 is configured to obtain a current operation time length of the processor, compare the current operation time length with each execution cycle, and determine a periodic function set of which a comparison result meets a preset time condition as a target periodic function set;
specifically, the duration comparison module 20 may be configured to obtain a current operation duration of the processor, read an execution cycle of each periodic function set, compare the current operation duration with each execution cycle, generate comparison results corresponding to each execution cycle, determine that a comparison result of the current operation duration that is an integral multiple of the execution cycle is a target comparison result that meets a preset time condition, and determine a periodic function set corresponding to the execution cycle included in the target comparison result as a target periodic function set.
Optionally, when it is detected that the current operation duration does not reach the integral multiple of each execution cycle, it is determined that each comparison result does not meet a preset time condition, and the memory resource corresponding to each periodic function set is released.
For a specific implementation of the duration comparison module 20, please refer to the description between each operation duration and each execution cycle in table 1 in the embodiment corresponding to fig. 1, which is not described herein any more.
Further, please refer to fig. 4, which is a schematic structural diagram of a duration comparison module according to an embodiment of the present invention. As shown in fig. 4, the duration comparison module 20 includes: a duration obtaining unit 201, a duration comparing unit 202, a condition satisfying unit 203, a target set determining unit 204 and a memory releasing unit 205;
the duration obtaining unit 201 is configured to obtain a current operation duration of the processor, and read an execution period of each periodic function set;
the duration comparison unit 202 is configured to compare the current operation duration with each execution cycle, and generate comparison results corresponding to each execution cycle;
the condition satisfying unit 203 is configured to determine a comparison result that the current operation duration is an integral multiple of the execution period as a target comparison result that satisfies a preset time condition;
the target set determining unit 204 is configured to determine a periodic function set corresponding to an execution cycle included in the target comparison result as a target periodic function set;
the memory releasing unit 205 is configured to, when it is detected that the current operation duration does not reach the integral multiple of each execution cycle, determine that each comparison result does not meet a preset time condition, and release the memory resource corresponding to each periodic function set.
For example, when the duration obtaining unit 201 obtains the current operation duration as 670us and the obtained execution periods are 100us, 500us and 1000us respectively, the duration comparing unit 202 may compare the current operation duration with the execution periods respectively and generate comparison results corresponding to the three execution periods respectively, that is; that is, 670us is 6.7 times of 100us, 670us is 1.34 times of 500us, and 670us is 0.67 times of 1000us, so that the memory releasing unit 205 may be configured to determine that the current operation duration 670us is not an integral multiple of each execution cycle, that is, each comparison result corresponding to each execution cycle (100us, 500us, and 1000us) in each periodic function set does not satisfy the preset time condition; in view of this, the processor-based data processing apparatus 1 may control the memory releasing unit 205 to perform the step of releasing the memory resources corresponding to the three periodic function sets.
The parameter updating module 30 is configured to update set parameters corresponding to each target periodic function set, and acquire a periodic function identifier, which is the same as the updated set parameter, in each target periodic function set as a target periodic function identifier;
specifically, the parameter updating module 30 may be configured to obtain set parameters respectively corresponding to each target periodic function set and periodic function identifiers respectively corresponding to each periodic function in each target periodic function set, and obtain a parameter updating manner; if the parameter updating mode is a parameter increasing mode, increasing the set parameters respectively corresponding to each target periodic function set in an increasing mode according to the parameter increasing mode, and acquiring periodic function identifiers which are the same as the set parameters after increasing in each target periodic function set as target periodic function identifiers;
optionally, if the parameter updating manner is a parameter decreasing manner, decreasing the set parameters respectively corresponding to each target periodic function set according to the parameter decreasing manner, and acquiring a periodic function identifier identical to the decreased set parameter in each target periodic function set as the target periodic function identifier.
The set parameters can be used for representing the execution sequence corresponding to each periodic function in the target periodic function set;
the periodic function identifier has uniqueness in a corresponding single target periodic function set, and the maximum value of the periodic function identifier can be used for representing the number of periodic functions in the single target periodic function set.
Specifically, the specific implementation of the parameter updating module 30 may refer to the description of step S103 in the embodiment corresponding to fig. 1, and details are not repeated here.
Further, please refer to fig. 5, which is a schematic structural diagram of a parameter updating module according to an embodiment of the present invention. As shown in fig. 5, the parameter updating module 30 includes: a set parameter acquisition unit 301, an update mode acquisition unit 302, an incremental update unit 303, and a decremental update unit 304;
the set parameter obtaining unit 301 is configured to obtain set parameters respectively corresponding to each target periodic function set and periodic function identifiers respectively corresponding to each periodic function in each target periodic function set;
the update mode obtaining unit 302 is configured to obtain a parameter update mode;
the incremental updating unit 303 is configured to, if the parameter updating manner is a parameter incremental manner, increment set parameters respectively corresponding to the target periodic function sets according to the parameter incremental manner, and acquire periodic function identifiers, which are the same as the set parameters after the increment, in the target periodic function sets as target periodic function identifiers;
the decreasing updating unit 304 is configured to decrease the set parameters respectively corresponding to the target periodic function sets according to the parameter decreasing manner if the parameter updating manner is the parameter decreasing manner, and obtain a periodic function identifier, which is the same as the decreased set parameter, in each target periodic function set as the target periodic function identifier.
The function executing module 40 is configured to synchronously execute a plurality of function functions included in the periodic function corresponding to each target periodic function identifier.
For example, taking the example that the periodic function 5 corresponding to each target periodic function identifier (5 and 4) includes 3 functional functions and the periodic function 4 includes 4 functional functions, when it is detected that each target periodic function identifier is equal to the updated set parameter (i.e., the decremented set parameter X is 5 and the decremented set parameter Y is 4), the plurality of functional functions included in the periodic functions (periodic function 5 and periodic function 4) corresponding to each target periodic function identifier can be synchronously executed. Specifically, please refer to the distribution of each function in each periodic function given in table 8;
Figure BDA0001766978670000201
TABLE 8
As can be seen from the distribution of the function functions in the periodic function 5 and the periodic function 4 given in table 8, there are 3 function functions in the periodic function 5, which are function 1, function 2 and function 3, respectively, and these three function functions can be sequentially executed in the periodic function 5 according to the importance of the preset function; meanwhile, the periodic function 4 in another periodic function set executed synchronously with the periodic function 5 includes 4 functional functions, which are respectively a functional function a, a functional function B, a functional function C and a functional function D, and the execution sequence of the 4 functional functions in the periodic function 4 is still the preset importance for sequential execution.
Therefore, the processor-based data processing device firstly sets a plurality of periodic function sets, respectively sets corresponding execution cycles for the periodic function sets, and sets at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function identifier; the execution cycles are different from each other; secondly, acquiring the current operation time length of the processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set; then, updating set parameters corresponding to each target periodic function set, and acquiring periodic function identifiers which are the same as the updated set parameters in each target periodic function set as target periodic function identifiers; and finally, synchronously executing a plurality of function functions contained in the periodic function respectively corresponding to each target periodic function identification. It can be seen that, the comparable result of the processor-based data processing apparatus satisfies that the periodic function set when the current operation duration is an integral multiple of each execution cycle is taken as a target periodic function set, and when the periodic function identifier is equal to the updated set parameter, the periodic function identifier is taken as a target periodic function identifier, and a plurality of function functions in the periodic function respectively corresponding to each target periodic function identifier are synchronously executed, so as to implement time-sharing operation of the plurality of function functions, further improve the utilization rate of the processor, and further reduce the power consumption of the processor.
Further, referring to fig. 6, which is a schematic structural diagram of another processor-based data processing apparatus according to an embodiment of the present invention, as shown in fig. 6, the processor-based data processing apparatus 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, memory 1005, at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 6, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program;
the processor-based data processing apparatus 1000 may be applied to a smart phone, a personal tablet, a personal computer, a mobile internet device, a wearable device (e.g., a smart watch (such as iwatch), a smart band), or other terminal devices capable of installing application software.
In the processor-based data processing apparatus 1000 shown in fig. 6, the user interface 1003 is mainly used as an interface for providing input for a user, and acquiring data output by the user; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
setting a plurality of periodic function sets, respectively setting corresponding execution periods for the periodic function sets, and setting at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function identifier; the execution cycles are different from each other;
acquiring the current operation time length of a processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set;
updating set parameters respectively corresponding to each target periodic function set, and acquiring periodic function identifiers which are the same as the updated set parameters from each target periodic function set as target periodic function identifiers;
and synchronously executing a plurality of function functions contained in the periodic functions respectively corresponding to the target periodic function identifications.
In an embodiment, when the processor 1001 executes the setting of the plurality of periodic function sets, sets corresponding execution cycles for each periodic function set, and sets at least one periodic function in each periodic function set, the following steps are specifically executed:
setting a plurality of periodic function sets, and respectively setting corresponding execution cycles for each periodic function set;
acquiring preset operation periods corresponding to the function functions respectively, determining the operation priority of the function functions in the processor according to the operation periods, and establishing a mapping relation table between the operation priority and the execution periods;
determining the execution period corresponding to each function in the mapping relation table according to the operation priority corresponding to each function;
adding the function functions with the same execution period into the periodic function sets with the corresponding execution periods, setting at least one periodic function in each periodic function set, and distributing the function functions in each periodic function set to the corresponding periodic functions.
In an embodiment, when the processor 1001 executes the obtaining of the current operating time length of the processor, compares the current operating time length with each execution cycle, and determines a periodic function set of which a comparison result meets a preset time condition as a target periodic function set, the following steps are specifically executed:
acquiring the current running time of the processor, and reading the execution period of each periodic function set;
comparing the current operation duration with each execution cycle, and generating comparison results respectively corresponding to each execution cycle;
determining a comparison result of which the current operation time length is integral multiple of the execution period as a target comparison result meeting a preset time condition;
and determining a periodic function set corresponding to the execution period contained in the target comparison result as a target periodic function set.
In one embodiment, after the comparing the current operation time length with each execution cycle and generating the comparison result corresponding to the current operation time length, the processor 1001 further performs the following steps:
and when detecting that the current operation time length does not reach the integral multiple of each execution period, determining that each comparison result does not meet a preset time condition, and releasing the memory resources corresponding to each periodic function set.
In an embodiment, when the processor 1001 updates the set parameters respectively corresponding to the target periodic function sets, and obtains a periodic function identifier, which is the same as the updated set parameter, in each target periodic function set, as the target periodic function identifier, specifically performs the following steps:
acquiring set parameters respectively corresponding to each target periodic function set and periodic function identifications respectively corresponding to each periodic function in each target periodic function set;
acquiring a parameter updating mode;
if the parameter updating mode is a parameter increasing mode, increasing the set parameters respectively corresponding to each target periodic function set in an increasing mode according to the parameter increasing mode, and acquiring periodic function identifiers which are the same as the set parameters after increasing in each target periodic function set as target periodic function identifiers;
if the parameter updating mode is a parameter decreasing mode, decreasing the set parameters respectively corresponding to each target periodic function set according to the parameter decreasing mode, and acquiring periodic function identifiers which are the same as the decreased set parameters in each target periodic function set as target periodic function identifiers.
It can be seen that the processor-based data processing apparatus 1000 first sets a plurality of periodic function sets, and sets a corresponding execution cycle for each periodic function set, and sets at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function identifier; the execution cycles are different from each other; secondly, acquiring the current operation time length of the processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set; then, updating set parameters respectively corresponding to each target periodic function set, and acquiring periodic function identifiers which are the same as the updated set parameters in each target periodic function set as target periodic function identifiers; and finally, synchronously executing a plurality of function functions contained in the periodic function respectively corresponding to each target periodic function identification. Therefore, the processor-based data processing apparatus may determine, when the comparison result corresponding to the current operation duration and each execution cycle satisfies the time condition, the periodic function set satisfying the time condition as the target periodic function set, and when it is detected in each target periodic function set that the target periodic function identifier is equal to the updated set parameter, synchronously execute a plurality of function functions included in the periodic function corresponding to each target periodic function identifier, thereby improving the utilization rate of the processor, and reducing the power consumption of the processor, so as to avoid resource waste of the processor.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by a computer program, which may be stored in a computer readable storage medium and executed by a computer to implement the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (8)

1. A method for processor-based data processing, comprising:
setting a plurality of periodic function sets, respectively setting corresponding execution periods for the periodic function sets, and setting at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function identifier; the execution cycles are different from each other;
acquiring the current operation time length of a processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set;
updating set parameters respectively corresponding to each target periodic function set, and acquiring periodic function identifiers which are the same as the updated set parameters from each target periodic function set as target periodic function identifiers; the set parameters respectively corresponding to each target periodic function set are used for representing the execution sequence corresponding to each periodic function in the corresponding target periodic function set;
synchronously executing a plurality of function functions contained in the periodic functions respectively corresponding to the target periodic function identifications;
the setting of a plurality of periodic function sets, the setting of corresponding execution cycles for each periodic function set, and the setting of at least one periodic function in each periodic function set includes:
setting a plurality of periodic function sets, and respectively setting corresponding execution cycles for each periodic function set;
acquiring preset operation periods corresponding to the function functions respectively, determining the operation priority of the function functions in the processor according to the operation periods, and establishing a mapping relation table between the operation priority and the execution periods;
determining the execution period corresponding to each function in the mapping relation table according to the operation priority corresponding to each function;
adding the function functions with the same execution period into the periodic function sets with the corresponding execution periods, setting at least one periodic function in each periodic function set, and distributing the function functions in each periodic function set to the corresponding periodic functions.
2. The method according to claim 1, wherein the obtaining a current operation duration of the processor, comparing the current operation duration with each execution cycle, and determining a periodic function set with a comparison result satisfying a preset time condition as a target periodic function set comprises:
acquiring the current running time of the processor, and reading the execution period of each periodic function set;
comparing the current operation duration with each execution cycle, and generating comparison results respectively corresponding to each execution cycle;
determining a comparison result of which the current operation time length is integral multiple of the execution period as a target comparison result meeting a preset time condition;
and determining a periodic function set corresponding to the execution period contained in the target comparison result as a target periodic function set.
3. The method of claim 2, after comparing the current operating time duration with each execution cycle and generating a comparison corresponding to the current operating time duration, further comprising:
and when detecting that the current operation time length does not reach the integral multiple of each execution period, determining that each comparison result does not meet a preset time condition, and releasing the memory resources corresponding to each periodic function set.
4. The method according to claim 1, wherein the updating set parameters respectively corresponding to each target periodic function set, and acquiring a periodic function identifier in each target periodic function set, which is the same as the updated set parameter, as the target periodic function identifier, includes:
acquiring set parameters respectively corresponding to each target periodic function set and periodic function identifications respectively corresponding to each periodic function in each target periodic function set;
acquiring a parameter updating mode;
if the parameter updating mode is a parameter increasing mode, increasing the set parameters respectively corresponding to each target periodic function set in an increasing mode according to the parameter increasing mode, and acquiring periodic function identifiers which are the same as the set parameters after increasing in each target periodic function set as target periodic function identifiers;
if the parameter updating mode is a parameter decreasing mode, decreasing the set parameters respectively corresponding to each target periodic function set according to the parameter decreasing mode, and acquiring periodic function identifiers which are the same as the decreased set parameters in each target periodic function set as target periodic function identifiers.
5. A processor-based data processing apparatus, comprising:
the data setting module is used for setting a plurality of periodic function sets, respectively setting corresponding execution cycles for the periodic function sets, and setting at least one periodic function in each periodic function set; each periodic function corresponds to a periodic function identifier; the execution cycles are different from each other;
the time length comparison module is used for acquiring the current operation time length of the processor, comparing the current operation time length with each execution cycle, and determining a periodic function set of which the comparison result meets a preset time condition as a target periodic function set;
the parameter updating module is used for updating set parameters corresponding to each target periodic function set respectively, and acquiring periodic function identifiers which are the same as the updated set parameters in each target periodic function set as target periodic function identifiers; the set parameters respectively corresponding to each target periodic function set are used for representing the execution sequence corresponding to each periodic function in the corresponding target periodic function set;
the function execution module is used for synchronously executing a plurality of function functions contained in the periodic functions respectively corresponding to the target periodic function identifications;
wherein, the data setting module includes:
the function set setting unit is used for setting a plurality of periodic function sets and respectively setting corresponding execution cycles for the periodic function sets;
the mapping relation establishing unit is used for acquiring preset operation periods corresponding to the function functions respectively, determining the operation priority of the function functions in the processor according to the operation periods, and establishing a mapping relation table between the operation priority and the execution periods;
an execution cycle determining unit, configured to determine, according to the operation priorities corresponding to the functional functions, execution cycles corresponding to the functional functions in the mapping relationship table;
the function distribution unit is used for adding the function functions with the same execution period into the periodic function sets with the corresponding execution periods, setting at least one periodic function in each periodic function set, and distributing the function functions in each periodic function set to the corresponding periodic functions.
6. The apparatus of claim 5, wherein the duration comparison module comprises:
the time length obtaining unit is used for obtaining the current running time length of the processor and reading the execution period of each periodic function set;
the time length comparison unit is used for comparing the current operation time length with each execution cycle and generating comparison results respectively corresponding to each execution cycle;
a condition satisfying unit, configured to determine a comparison result that the current operation duration is an integral multiple of the execution period as a target comparison result that satisfies a preset time condition;
and the target set determining unit is used for determining a periodic function set corresponding to the execution period contained in the target comparison result as a target periodic function set.
7. The apparatus of claim 6, wherein the duration comparison module further comprises:
and the memory release unit is used for determining that each comparison result does not meet a preset time condition and releasing the memory resources corresponding to each periodic function set when detecting that the current operation time length does not reach the integral multiple of each execution period.
8. The apparatus of claim 5, wherein the parameter update module comprises:
a set parameter obtaining unit, configured to obtain set parameters corresponding to each target periodic function set and periodic function identifiers corresponding to each periodic function in each target periodic function set;
an update mode acquisition unit for acquiring a parameter update mode;
an incremental updating unit, configured to, if the parameter updating manner is a parameter incremental manner, increment set parameters respectively corresponding to the target periodic function sets according to the parameter incremental manner, and acquire a periodic function identifier, which is the same as the incremented set parameter, in each target periodic function set as a target periodic function identifier;
and the decreasing updating unit is used for decreasing the set parameters respectively corresponding to the target periodic function sets according to the parameter decreasing mode if the parameter updating mode is the parameter decreasing mode, and acquiring periodic function identifiers which are the same as the decreased set parameters from the target periodic function sets as the target periodic function identifiers.
CN201780011703.6A 2017-09-05 2017-09-05 Data processing method and device based on processor Active CN108701030B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/100503 WO2019047009A1 (en) 2017-09-05 2017-09-05 Processor-based data processing method and device

Publications (2)

Publication Number Publication Date
CN108701030A CN108701030A (en) 2018-10-23
CN108701030B true CN108701030B (en) 2022-05-27

Family

ID=63844158

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201780011703.6A Active CN108701030B (en) 2017-09-05 2017-09-05 Data processing method and device based on processor

Country Status (2)

Country Link
CN (1) CN108701030B (en)
WO (1) WO2019047009A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012027831A (en) * 2010-07-27 2012-02-09 Yokogawa Electric Corp Sequence controller
CN103927180A (en) * 2014-04-21 2014-07-16 广州市久邦数码科技有限公司 Implementation method for functional plug-ins based on Android system and system of functional plug-ins based on Android system
CN104521276A (en) * 2012-08-08 2015-04-15 Sk电信有限公司 Adaptive non-real-time traffic control method and terminal for same
CN105701004A (en) * 2014-11-28 2016-06-22 深圳市腾讯计算机系统有限公司 Application test method and apparatus
CN106055075A (en) * 2016-05-31 2016-10-26 广东欧珀移动通信有限公司 Method and device for closing sensors
CN106911587A (en) * 2017-03-16 2017-06-30 恒生电子股份有限公司 Trading volume control method and device
CN106970835A (en) * 2017-03-20 2017-07-21 华侨大学 Fixed priority resource limited system level energy consumption optimization method
CN107124458A (en) * 2017-04-27 2017-09-01 大连云动力科技有限公司 Intellisense equipment and sensory perceptual system

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080282246A1 (en) * 2007-05-07 2008-11-13 Danny Dolev Compiler aided ticket scheduling of tasks in a computing system
CN101201594A (en) * 2007-11-21 2008-06-18 天津理工大学 Control method for electric actuating mechanism based on CMX-RTOS built-in real-time operating system
CN101266556A (en) * 2008-05-09 2008-09-17 北京泰得思达科技发展有限公司 Multitask scheduling system
US8004679B2 (en) * 2008-05-09 2011-08-23 Kla-Tencor Corporation Target design and methods for scatterometry overlay determination
US9459890B2 (en) * 2008-07-10 2016-10-04 Mentor Graphics Corporation Controlling real time during embedded system development
NL2009508A (en) * 2011-10-24 2013-04-25 Asml Netherlands Bv Metrology method and apparatus, and device manufacturing method.
FR3033427B1 (en) * 2015-03-03 2018-05-18 Zodiac Aerotechnics SEQUENCING METHOD OF EXECUTION COMMANDS, METHOD OF EXECUTION, COMPUTER PROGRAM, AND INTEGRATED CIRCUIT
CN105204933A (en) * 2015-09-18 2015-12-30 上海斐讯数据通信技术有限公司 Multitask switching execution method based on single process, multitask switching execution system based on single process and processor

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012027831A (en) * 2010-07-27 2012-02-09 Yokogawa Electric Corp Sequence controller
CN104521276A (en) * 2012-08-08 2015-04-15 Sk电信有限公司 Adaptive non-real-time traffic control method and terminal for same
CN103927180A (en) * 2014-04-21 2014-07-16 广州市久邦数码科技有限公司 Implementation method for functional plug-ins based on Android system and system of functional plug-ins based on Android system
CN105701004A (en) * 2014-11-28 2016-06-22 深圳市腾讯计算机系统有限公司 Application test method and apparatus
CN106055075A (en) * 2016-05-31 2016-10-26 广东欧珀移动通信有限公司 Method and device for closing sensors
CN106911587A (en) * 2017-03-16 2017-06-30 恒生电子股份有限公司 Trading volume control method and device
CN106970835A (en) * 2017-03-20 2017-07-21 华侨大学 Fixed priority resource limited system level energy consumption optimization method
CN107124458A (en) * 2017-04-27 2017-09-01 大连云动力科技有限公司 Intellisense equipment and sensory perceptual system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于中断的实时任务调度策略;吴荣华等;《计算机应用与软件》;20070130;全文 *

Also Published As

Publication number Publication date
CN108701030A (en) 2018-10-23
WO2019047009A1 (en) 2019-03-14

Similar Documents

Publication Publication Date Title
US9883506B2 (en) Apparatus and methods for a bandwidth efficient scheduler
CN106791212B (en) A kind of control method, device and the mobile terminal of mobile terminal refresh rate
CN106936995B (en) A kind of control method, device and the mobile terminal of mobile terminal frame per second
CN112988362B (en) Task processing method and device, electronic equipment and storage medium
CN109257219A (en) Update method, device, storage medium and server
US20200012507A1 (en) Control system for microkernel architecture of industrial server and industrial server comprising the same
CN107944259A (en) Using the management-control method of startup, device and storage medium and mobile terminal
JP4452710B2 (en) Method for sequence control of sequential object-oriented system simulation
CN109597687B (en) Resource allocation method and device for data synchronization, storage medium and electronic equipment
CN106776259A (en) A kind of mobile terminal frame rate detection method, device and mobile terminal
US8930965B1 (en) Event-driven state-machine sequencer
CN107870792B (en) Starting method of mobile terminal, mobile terminal and medium product
CN111459676A (en) Node resource management method, device and storage medium
CN112799793A (en) Scheduling method and device, electronic equipment and storage medium
CN108701030B (en) Data processing method and device based on processor
CN112994911B (en) Calculation unloading method and device and computer readable storage medium
US20210191701A1 (en) Method and system for profile based deployments
CN113064677A (en) Application running method and device, storage medium and electronic device
CN112202650A (en) Method and system for controlling intelligent equipment by WeChat small program
CN113170391B (en) Application processing method and device, storage medium, server and electronic equipment
CN112364001A (en) Cleaning method and device for multidimensional space big data, computer equipment and medium
CN111427525A (en) Synchronous control method and device for cluster equipment, computer equipment and storage medium
CN110058941A (en) Task scheduling and managing method, device, equipment and storage medium
CN109726009A (en) Big data calculation method, device, equipment and computer readable storage medium
CN106604301B (en) Wireless hotspot service starting method and device

Legal Events

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