CN117492958A - Thread information adjustment method and device and electronic equipment - Google Patents
Thread information adjustment method and device and electronic equipment Download PDFInfo
- Publication number
- CN117492958A CN117492958A CN202311516258.2A CN202311516258A CN117492958A CN 117492958 A CN117492958 A CN 117492958A CN 202311516258 A CN202311516258 A CN 202311516258A CN 117492958 A CN117492958 A CN 117492958A
- Authority
- CN
- China
- Prior art keywords
- thread
- priority
- application program
- value
- original
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 238000009434 installation Methods 0.000 claims description 29
- 238000012795 verification Methods 0.000 claims description 26
- 230000007246 mechanism Effects 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 5
- 238000010276 construction Methods 0.000 claims description 4
- 230000007547 defect Effects 0.000 abstract description 8
- 238000004422 calculation algorithm Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 9
- 230000004048 modification Effects 0.000 description 7
- 238000012986 modification Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 101100217298 Mus musculus Aspm gene Proteins 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/48—Indexing scheme relating to G06F9/48
- G06F2209/484—Precedence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5021—Priority
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a thread information adjustment method and device and electronic equipment, and belongs to the technical field of computers. The thread information adjustment method comprises the following steps: receiving an application program installation file sent by a second terminal; the application program installation file comprises an application program downloading file and adding information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set by a thread of an application program corresponding to the application program downloading file; adjusting the priorities of all threads of the application program based on the priority reference value and the priority dynamic range value; the time slices for all threads of the application are adjusted based on the time slice reference value and the time slice dynamic range value. By setting the information adding mode for the application program downloading file, the priority and time slice information of all threads in the application program corresponding to the application program downloading file can be managed, and the defect of disordered execution of the application program is avoided.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a thread information adjustment method, a thread information adjustment device, and an electronic device.
Background
The operating system generally includes two parts: kernel space running in privileged mode and user space running in non-privileged mode. Since the kernel is the core of the operating system, it manages all the resources in the system and serves upper applications, and therefore needs to run in kernel space. The cores can be divided into different architectures according to the difference of functions realized by the cores, and in different core architectures, the providing mode of system services and the realization mode of hardware driving are different, so that the overall performance and development difficulty of the system are affected. Currently, common Kernel architectures include three types, macro Kernel (Monolithic Kernel), micro Kernel (Microkernel), and Hybrid Kernel (Hybrid Kernel).
Under the micro-kernel architecture, some components such as a driver, application management, a file system and the like are divided into user mode, and some modules can be developed by different manufacturers and downloaded or version-up after being released in an operating system supporting the downloading of the modules. These modules are typically run as kernel mode programs in macro kernel or hybrid kernel architectures, with higher rights and running priorities. After being downloaded as a user mode program, the user mode program becomes a process or thread combination of the user mode, and execution confusion can occur on the scheduling priority and the time slices if the user mode program is only set by a developer and is not managed.
Disclosure of Invention
The embodiment of the invention aims to provide a thread information adjusting method, a thread information adjusting device and electronic equipment, which are used for solving the defects that after a user-state program is downloaded, a user-state process or thread combination is formed, and execution confusion occurs when a scheduling priority and a time slice are set by a developer only and are not managed.
In order to achieve the above object, an embodiment of the present invention provides a thread information adjustment method, applied to a first terminal, including:
receiving an application program installation file sent by a second terminal; the application program installation file comprises an application program downloading file and adding information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs;
adjusting the priority of all threads of the application program based on the priority reference value and the priority dynamic range value;
the time slices of all threads of the application are adjusted based on the time slice reference value and the time slice dynamic range value.
Optionally, the adjusting the priority of all threads of the application program based on the priority reference value and the priority dynamic range value includes:
determining the priority range value of the original thread;
and adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value.
Optionally, the determining the original thread priority range value includes:
the priority ordering is carried out on all threads of the application program so as to determine the maximum value of the priority of the original thread and the minimum value of the priority of the original thread;
and determining an original thread priority range value based on the difference value between the original thread priority maximum value and the original thread priority minimum value.
Optionally, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value includes:
determining the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value under the condition that the original thread priority range value is smaller than or equal to the priority dynamic range value; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value is implemented by the following formula:
NewPrio m =OldPrio m +NewPrioBase-OldPrioMin;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, wherein newPrioBase represents the priority reference value, and OldPrioMin represents the original thread priorityFirst order minimum.
Optionally, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value includes:
determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value, and the priority dynamic range value, if the original thread priority range value is greater than the priority dynamic range value, and if the priority dynamic range value is greater than or equal to the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value and the priority dynamic range value is implemented by the following formula:
NewPrio m =NewPrioBase+(OldPrio m -OldPrioBase)*NewPrioRng/OldPrioRng;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m And representing the original priority of the first thread of the application program, wherein newprioBase represents the priority reference value, oldproBase represents the original thread priority minimum value, newprioRng represents the priority dynamic range value, and oldproRng represents the original thread priority range value.
Optionally, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value includes:
determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program, and the original thread priority range value, when the original thread priority range value is greater than the priority dynamic range value, and the priority dynamic range value is less than the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program, and the original thread priority range value is implemented by the following formula:
NewPrio m =NewPrioBase+(OldPrio m -OldPrioBase)*n/OldPrioRng;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, wherein NewPrioBase represents the priority reference value, oldPrioBase represents the original thread priority minimum value, n represents the total number of all threads of the application program, and OldPrioRng represents the original thread priority range value.
Optionally, in the case that the priority after the first thread adjustment of the application program is greater than the sum of the priority reference value and the priority dynamic range value, determining that the priority after the first thread adjustment of the application program is the sum of the priority reference value and the priority dynamic range value.
Optionally, the adjusting the time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value includes:
Calculating a time slice maximum based on the sum of the time slice reference value and the time slice dynamic range value;
determining a time slice after the first thread of the application program is adjusted based on the magnitude relation between the original time slice of the first thread of the application program and the maximum value of the time slice; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the time slice after the first thread adjustment of the application program based on the magnitude relation between the original time slice of the first thread of the application program and the maximum time slice value includes:
and determining that the maximum time slice is the time slice after the first thread of the application program is adjusted under the condition that the original time slice of the first thread of the application program is greater than or equal to the maximum time slice.
Optionally, after the step of adjusting the time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value, the method further includes:
performing thread scheduling based on all threads of the adjusted application program;
determining the running state of the target thread based on the CPU occupation time after the target thread is started and/or based on the keep-alive mechanism of the target thread;
The target thread is any one of all threads of the application program.
Optionally, the determining the running state of the target thread based on the CPU occupation time after the target thread is started includes:
and under the condition that the CPU occupation time after the target thread is started is within the set threshold value range, determining that the target thread runs normally.
Optionally, the determining the running state of the target thread based on the keep-alive mechanism of the target thread includes:
and under the condition that the heartbeat signal sent by the target thread is received, determining that the target thread runs normally.
Optionally, after the step of determining the running state of the target thread based on the CPU occupation time after the target thread is started and/or based on the keep-alive mechanism of the target thread, the method further includes:
storing the priority of all threads of the adjusted application program and the time slices of all threads into an application registry;
performing integrity protection on the application registry to generate an integrity check value;
and under the condition that the integrity check value passes verification, storing the application registry so as to enable the application program to run threads directly by utilizing the priority levels of all threads of the application program after adjustment and the time slices of all threads when the application program runs next time.
Optionally, the application installation file further includes a signature value, where the signature value is obtained based on integrity protection and/or source legitimacy protection of the second terminal;
after the step of receiving the application installation file sent by the second terminal, the method further includes:
and carrying out integrity verification on the signature value and/or carrying out source validity verification.
On the other hand, the embodiment of the invention also provides a thread information adjustment method, which is applied to a second terminal, and comprises the following steps:
constructing an application program installation file based on the application program download file and the addition information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs;
and sending the application program installation file to a first terminal so that the first terminal can adjust thread information based on the application program installation file.
Optionally, the constructing the application installation file based on the application download file and the added information includes:
constructing an application program installation file based on the application program downloading file, the added information and the signature value;
Wherein the signature value is obtained based on the integrity protection and/or the source legitimacy protection of the second terminal.
On the other hand, an embodiment of the present invention further provides a thread information adjustment device, which is applied to a first terminal, where the device includes:
the data acquisition module is used for receiving an application program installation file sent by the second terminal; the application program installation file comprises an application program downloading file and adding information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs;
the thread priority adjustment module is used for adjusting the priorities of all threads of the application program based on the priority reference value and the priority dynamic range value;
and the thread time slice adjusting module is used for adjusting the time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value.
Optionally, the adjusting the priority of all threads of the application program based on the priority reference value and the priority dynamic range value includes:
Determining the priority range value of the original thread;
and adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value.
Optionally, the determining the original thread priority range value includes:
the priority ordering is carried out on all threads of the application program so as to determine the maximum value of the priority of the original thread and the minimum value of the priority of the original thread;
and determining an original thread priority range value based on the difference value between the original thread priority maximum value and the original thread priority minimum value.
Optionally, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value includes:
determining the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value under the condition that the original thread priority range value is smaller than or equal to the priority dynamic range value; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value is implemented by the following formula:
NewPrio m =OldPrio m +NewPrioBase-OldPrioMin;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, newPrioBase representing the priority reference value, olpriomin representing the original thread priority minimum.
Optionally, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value includes:
determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value, and the priority dynamic range value, if the original thread priority range value is greater than the priority dynamic range value, and if the priority dynamic range value is greater than or equal to the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value and the priority dynamic range value is implemented by the following formula:
NewPrio m =NewPrioBase+(OldPrio m -OldPrioBase)*NewPrioRng/OldPrioRng;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m And representing the original priority of the first thread of the application program, wherein newprioBase represents the priority reference value, oldproBase represents the original thread priority minimum value, newprioRng represents the priority dynamic range value, and oldproRng represents the original thread priority range value.
Optionally, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value includes:
determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program, and the original thread priority range value, when the original thread priority range value is greater than the priority dynamic range value, and the priority dynamic range value is less than the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program, and the original thread priority range value is implemented by the following formula:
NewPrio m =NewPrioBase+(OldPrio m -OldPrioBase)*n/OldPrioRng;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m New Pri representing the original priority of the first thread of an applicationoBase represents the priority reference value, oldPrioBase represents the original thread priority minimum value, n represents the total number of all threads of the application program, and OldPrioRng represents the original thread priority range value.
Optionally, in the case that the priority after the first thread adjustment of the application program is greater than the sum of the priority reference value and the priority dynamic range value, determining that the priority after the first thread adjustment of the application program is the sum of the priority reference value and the priority dynamic range value.
Optionally, the adjusting the time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value includes:
Calculating a time slice maximum based on the sum of the time slice reference value and the time slice dynamic range value;
determining a time slice after the first thread of the application program is adjusted based on the magnitude relation between the original time slice of the first thread of the application program and the maximum value of the time slice; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the time slice after the first thread adjustment of the application program based on the magnitude relation between the original time slice of the first thread of the application program and the maximum time slice value includes:
and determining that the maximum time slice is the time slice after the first thread of the application program is adjusted under the condition that the original time slice of the first thread of the application program is greater than or equal to the maximum time slice.
Optionally, the apparatus further includes:
the thread scheduling module is used for performing thread scheduling based on all threads of the adjusted application program;
the running state determining module is used for determining the running state of the target thread based on the CPU occupation time after the target thread is started and/or based on the keep-alive mechanism of the target thread;
The target thread is any one of all threads of the application program.
Optionally, the determining the running state of the target thread based on the CPU occupation time after the target thread is started includes:
and under the condition that the CPU occupation time after the target thread is started is within the set threshold value range, determining that the target thread runs normally.
Optionally, the determining the running state of the target thread based on the keep-alive mechanism of the target thread includes:
and under the condition that the heartbeat signal sent by the target thread is received, determining that the target thread runs normally.
Optionally, the apparatus further includes:
the first storage module is used for storing the priority levels of all threads of the adjusted application program and the time slices of all threads to the application registry;
the protection module is used for carrying out integrity protection on the application registry and generating an integrity check value;
and the second storage module is used for storing the application registry under the condition that the integrity check value passes verification, so that the application program runs next time, and the priority of all threads of the application program after adjustment and the time slices of all threads are directly utilized to run the threads.
Optionally, the application installation file further includes a signature value, where the signature value is obtained based on integrity protection and/or source legitimacy protection of the second terminal;
The apparatus further comprises:
and the verification module is used for carrying out integrity verification on the signature value and/or source validity verification.
On the other hand, an embodiment of the present invention further provides a thread information adjustment device, which is applied to a second terminal, where the device includes:
the construction module is used for constructing an application program installation file based on the application program download file and the addition information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs;
and the sending module is used for sending the application program installation file to the first terminal so that the first terminal can adjust the thread information based on the application program installation file.
Optionally, the constructing the application installation file based on the application download file and the added information includes:
constructing an application program installation file based on the application program downloading file, the added information and the signature value;
wherein the signature value is obtained based on the integrity protection and/or the source legitimacy protection of the second terminal.
In another aspect, the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the thread information adjustment method described above when executing the program.
In another aspect, the present invention also provides a machine-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the thread information adjustment method described above.
According to the technical scheme, the embodiment of the invention adjusts the priority of all threads of the application program based on the priority reference value and the priority dynamic range value included in the application program installation file by receiving the application program installation file sent by the second terminal; the time slices of all threads of the application are adjusted based on the time slice reference values and the time slice dynamic range values included in the application installation file. By setting the information adding mode for the application program downloading file, the priority and time slice information of all threads in the application program corresponding to the application program downloading file can be adjusted or managed so as to meet the actual requirement of the application program operation and avoid the defect of disordered execution of the application program.
Additional features and advantages of embodiments of the invention will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain, without limitation, the embodiments of the invention. In the drawings:
FIG. 1 is a flow chart of a thread information adjustment method according to the present invention;
FIG. 2 is a schematic diagram of the present invention for mounting all threads of an application to a thread wait area;
FIG. 3 is a schematic diagram of placing all threads of an application into a two-dimensional collection provided by the present invention;
FIG. 4 is a schematic diagram of a thread priority adjustment method according to the present invention;
FIG. 5 is a second embodiment of a thread priority adjustment method according to the present invention;
FIG. 6 is a third diagram illustrating a thread priority adjustment method according to the present invention;
FIG. 7 is a second flowchart of a thread information adjustment method according to the present invention;
FIG. 8 is a schematic diagram of thread scheduling for all threads based on an adjusted application provided by the present invention;
FIG. 9 is a third flow chart of the thread information adjustment method according to the present invention;
FIG. 10 is a flowchart illustrating a thread information adjustment method according to the present invention;
FIG. 11 is a flowchart illustrating a thread information adjustment method according to the present invention;
FIG. 12 is a flowchart illustrating a thread information adjustment method according to the present invention;
FIG. 13 is a schematic diagram of a thread information adjusting apparatus according to the present invention;
FIG. 14 is a second schematic diagram of a thread information adjusting apparatus according to the present invention;
fig. 15 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
The following describes the detailed implementation of the embodiments of the present invention with reference to the drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the invention, are not intended to limit the invention.
Method embodiment
The embodiment of the invention provides a thread information adjustment method which is applied to a first terminal. The first terminal can be a personal computer, a desktop computer, a tablet personal computer, a smart phone or other devices. Referring to fig. 1, a thread information adjustment method according to an embodiment of the present invention includes:
and step 101, receiving an application program installation file sent by the second terminal.
The first terminal may receive the application installation file sent by the second terminal through a wired (data line) or wireless (WI-FI, bluetooth, operator network, etc.) mode. The application installation file comprises an application download file and adding information.
The adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set by the second terminal for the application program which is correspondingly operated by the application program downloading file. The second terminal may be various terminals that can add information to the application download file, for example, the second terminal may be a server.
The priority reference value is a thread priority minimum value set or specified by the second terminal for the application program corresponding to the application program downloading file. The priority dynamic range value is a maximum range value that increases on the basis of the priority reference value. Wherein, different application programs can be classified and graded, and the thread priority reference value and the priority dynamic range of each application program are set. For example, when the importance level of the application 1 is higher than that of the application 2, and the importance level is higher as the priority is lower, the priority reference value of the thread of the application 1 is set to 10, and the priority dynamic range value is set to 10; the priority reference value of the thread of the application 2 is 20 and the priority dynamic range value is 10.
The time slice reference value is a minimum time slice value set or specified by the second terminal for the thread of the application program corresponding to the running application program downloading file. The time slice dynamic range value is a maximum range value that increases on the basis of the time slice reference value.
And step 103, adjusting the priorities of all threads of the application program based on the priority reference value and the priority dynamic range value.
The first terminal analyzes the application program installation file through the application executor to obtain an application program downloading file and adding information, and stores the application program downloading file into a nonvolatile memory in an embedded operating system of the first terminal. Referring to fig. 2, when the application executor parses and executes the application, all threads of the application are mounted in a thread waiting area, and the first terminal adjusts the priorities of all threads of the application program based on the priority reference value NewPrioBase and the priority dynamic range value NewPrioRng, so that the priorities of all threads of the application program are in a range from the priority reference value to a value range where the priority reference value and the priority dynamic range value are added. For example, the application 1 has 5 threads with priorities of 1, 5, 3, 7, and 9, and the first terminal adjusts the priority reference value to 10 in the added information part and the priority dynamic range value to 10, and then all the threads of the application 1 after adjustment are adjusted to 10, 14, 12, 16, and 18.
And step 104, adjusting the time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value.
And the first terminal adjusts the time slices of all threads of the application program based on the time slice reference value NewSliceBase and the time slice dynamic range value NewSliceRng so that the time slices of all threads of the application program are in a numerical range from the time slice reference value to the sum of the time slice reference value and the time slice dynamic range value. For example, the application 1 has 1 thread, the time slice is 700ms, the first terminal adjusts the time slice reference value to 100ms and the time slice dynamic range value to 600ms in the addition information part, and the time slice of the adjusted thread is adjusted to 100+600=700 ms. For another example, the application 1 has 1 thread, the time slice is 800ms, the first terminal adjusts the time slice reference value to 300ms in the addition information part, and the time slice dynamic range is 200ms, and the time slice of the adjusted thread is 300+200=500 ms.
According to the embodiment of the invention, the priority of all threads of the application program is adjusted based on the priority reference value and the priority dynamic range value included in the application program installation file by receiving the application program installation file sent by the second terminal; the time slices of all threads of the application are adjusted based on the time slice reference values and the time slice dynamic range values included in the application installation file. By setting the information adding mode for the application program downloading file, the priority and time slice information of all threads in the application program corresponding to the application program downloading file can be adjusted or managed so as to meet the actual requirement of the application program operation and avoid the defect of disordered execution of the application program.
In other aspects of the embodiments of the present invention, step 103, adjusting the priority of all threads of the application program based on the priority reference value and the priority dynamic range value includes:
step 1031, determining the original thread priority range value.
The first terminal determines an original thread priority range value. In one embodiment, the original thread priority range value may be stored in a non-volatile memory of the first terminal, and the first terminal may obtain the original thread priority range value from the non-volatile memory, thereby determining the original thread priority range value.
Step 1032, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value.
The first terminal adjusts the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value, so that the priorities of all threads of the application program are in a range from the priority reference value to the value range where the priority reference value and the priority dynamic range value are added.
Further, step 1031, determining an original thread priority range value, includes:
step 10311, prioritizing all threads of the application to determine an original thread priority maximum and an original thread priority minimum.
Referring to fig. 3, the first terminal may put all threads of the application into a two-dimensional set, including a thread name and a thread priority, where the thread name Tn corresponds to the thread priority TPn one by one, and may form an array or a linked list data structure. The number of the bus threads is n; { T1, T2, …, tn; TP1, TP2, …, TPn }. Wherein, T1 is a thread name, TP1 is a thread priority corresponding to the thread name T1, and the correspondence between the remaining thread names and the thread priorities is similar.
The first terminal ranks the priorities of all threads of the application program according to the priority order from high to low or from low to high, and determines the maximum value and the minimum value of the priority of the original threads. It should be noted that, in some embodiments, the smaller the priority value set by the embedded operating system, the higher the thread execution priority; the greater the priority value set by some embedded operating systems, the higher the thread execution priority. In this embodiment, the priority values may be sorted in order from large to small or from small to large, and the embodiment of the present invention only selects the maximum value and the minimum value of the original thread priority.
Step 10312, determining an original thread priority range value based on the difference between the original thread priority maximum value and the original thread priority minimum value.
And the first terminal determines an original thread priority range value based on the difference value between the original thread priority maximum value and the original thread priority minimum value. For example, the priorities of the original 5 threads of the application program 1 are 1, 5, 3, 7 and 9, respectively, and then the original thread priority range value=the original thread priority maximum value-the original thread priority minimum value=9-1=8.
In other aspects of the embodiments of the present invention, step 1032, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value, and the priority dynamic range value includes:
determining the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value under the condition that the original thread priority range value is smaller than or equal to the priority dynamic range value; wherein the first thread is any one thread of all threads of the application program.
Referring to fig. 4, in the case where the original thread priority range value OldPrioRng is less than or equal to the priority dynamic range value NewPrioRng, it is explained that the priority dynamic range value is sufficient for the thread of the application program to adjust according to the absolute value of the original priority, and then the adjustment can be performed using a linear adjustment method. The first terminal determines the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value.
Further, based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value, determining the adjusted priority of the first thread of the application program is realized by the following formula:
NewPrio m =OldPrio m +NewPrioBase-OldPrioMin;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, newPrioBase representing the priority reference value, olpriomin representing the original thread priority minimum.
For example, if the application program 1 has 5 threads, the priorities are 1, 5, 3, 7 and 9, the priority reference value is 10, and the priority dynamic range value is 10, the priority after the priority of the original thread 1 is adjusted=1+10-1=10; priority after the original thread priority 5 is adjusted=5+10-1=14; priority after the original thread priority 3 is adjusted=3+10-1=12; priority after the original thread priority 7 is adjusted=7+10-1=16; the priority after the original thread priority 9 is adjusted=9+10-1=18. I.e. the application 1 has 5 threads with adjusted priorities of 10, 14, 12, 16, 18, respectively.
The invention determines the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value, thereby adjusting or managing the priority of all threads in the application program corresponding to the application program downloading file so as to meet the actual requirement of the application program operation and avoid the defect of disordered execution of the application program.
In other aspects of the embodiments of the present invention, step 1022, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value, and the priority dynamic range value includes:
determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value, and the priority dynamic range value, if the original thread priority range value is greater than the priority dynamic range value, and if the priority dynamic range value is greater than or equal to the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
If the original thread priority range value OldPrioRng is greater than the priority dynamic range value newprioorng, that is, the priority dynamic range value is insufficient to provide the threads of the application with adjustment according to the original priority absolute value, then a relationship between the priority dynamic range value newprioorng and the total number of all threads of the application program needs to be further determined. If the priority dynamic range value NewPrioRng is greater than or equal to the total number n of all threads of the application program, and the priority dynamic range value NewPrioRng is enough to provide the application with the priority relative value for adjustment, the first terminal determines the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value and the priority dynamic range value.
Further, the determining the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value and the priority dynamic range value is implemented by the following formula:
NewPrio m =NewPrioBase+(OldPrio m -OldPrioBase)*NewPrioRng/OldPrioRng;
Wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m And representing the original priority of the first thread of the application program, wherein newprioBase represents the priority reference value, oldproBase represents the original thread priority minimum value, newprioRng represents the priority dynamic range value, and oldproRng represents the original thread priority range value. It should be noted that the calculation result of the formula may be rounded up or down. The present embodiment may round down the calculation of the formula.
Referring to FIG. 5, (NewPrio) m -NewPrioBase)/(OldPrio m -OldPrioBase)=cosα=NewPrioRng/OldPrioRng。
For example, if the application 2 has 5 threads, the priorities are 1, 5, 3, 7 and 9, the priority reference value is 20, and the priority dynamic range value is 5, the priority after the adjustment of the original thread priority 1=20+ (1-1) ×5/(9-1) =20; priority after the original thread priority 5 is adjusted=20+ (5-1) 5/(9-1) =22; priority after the original thread priority 3 is adjusted=20+ (3-1) 5/(9-1) =21; priority after the original thread priority 7 is adjusted=20+ (7-1) 5/(9-1) =23; the priority of the original thread after 9 adjustment=20+ (9-1) ×5/(9-1) =25. I.e. the adjusted 5 thread priorities of the application 2 are respectively 20, 22, 21, 23, 25.
The invention determines the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value and the priority dynamic range value, thereby adjusting or managing the priority of all threads in the application program corresponding to the application program downloading file so as to meet the actual requirement of application program operation and avoid the defect of disordered application program execution.
In other aspects of the embodiments of the present invention, step 1032, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value, and the priority dynamic range value includes:
determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program, and the original thread priority range value, when the original thread priority range value is greater than the priority dynamic range value, and the priority dynamic range value is less than the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
If the original thread priority range value OldPrioRng is greater than the priority dynamic range value newprioorng, that is, the priority dynamic range value is insufficient to provide the threads of the application with adjustment according to the original priority absolute value, then a relationship between the priority dynamic range value newprioorng and the total number of all threads of the application program needs to be further determined. If the priority dynamic range value NewPrioRng is smaller than the total number n of all threads of the application program, and the priority dynamic range value is insufficient to provide the priority relative value for the application program to adjust, the first terminal determines the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program and the original thread priority range value.
Further, referring to fig. 6, determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program, and the original thread priority range value is implemented by the following formula:
NewPrio m =NewPrioBase+(OldPrio m -OldPrioBase)*n/OldPrioRng;
Wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, wherein NewPrioBase represents the priority reference value, oldPrioBase represents the original thread priority minimum value, n represents the total number of all threads of the application program, and OldPrioRng represents the original thread priority range value.
It should be noted that, when the priority after the first thread adjustment of the application program is greater than the sum of the priority reference value and the priority dynamic range value, the priority after the first thread adjustment of the application program is determined to be the sum of the priority reference value and the priority dynamic range value. The calculation of the formula may be rounded up or down. The present embodiment may round down the calculation of the formula.
For example, the application program 3 has 5 threads with priorities of 1, 5, 3, 7 and 9, and the manager adjusts the thread reference value to 30 in the process signature modification information part and the dynamic range to 3, so that the priority of the original thread 1 is adjusted to be priority=30+ (1-1) 5/(9-1) =30; the original thread priority 5 is adjusted to be priority=30+ (5-1) 5/(9-1) =32; the original thread priority 3 is adjusted to be priority=30+ (3-1) 5/(9-1) =31; the original thread priority 7 is adjusted to be priority=30+ (7-1) 5/(9-1) =33; the priority level of the original thread priority 9 is adjusted to be=30+ (9-1) ×5/(9-1) =35, and 35 > 30+3=33, so the priority level of the original thread priority 9 is adjusted to be 33. I.e. 30, 32, 31, 33 after the adjustment of the 5 thread priorities of the adjusted application 3.
The invention determines the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program and the original thread priority range value, thereby adjusting or managing the priority of all threads in the application program corresponding to the application program downloading file, meeting the actual requirement of the application program operation and avoiding the defect of disordered execution of the application program.
In other aspects of the embodiments of the present invention, step 104, adjusting the time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value includes:
step 1041, calculating a time slice maximum value based on the sum of the time slice reference value and the time slice dynamic range value.
Step 1042, determining a time slice after the first thread of the application program is adjusted based on the magnitude relation between the original time slice of the first thread of the application program and the maximum time slice; wherein the first thread is any one thread of all threads of the application program.
For example, if the slice reference value is 100ms and the slice dynamic range value is 600ms, the slice maximum value is 100+600=700 ms. And the first terminal determines the time slice after the first thread of the application program is adjusted based on the size relation between the original time slice of the first thread of the application program and the maximum time slice.
Further, the determining the time slice after the first thread adjustment of the application program based on the magnitude relation between the original time slice of the first thread of the application program and the maximum time slice value includes:
and determining that the maximum time slice is the time slice after the first thread of the application program is adjusted under the condition that the original time slice of the first thread of the application program is greater than or equal to the maximum time slice.
Because the influence of the time slice on the call of the thread is smaller, a simpler setting method can be selected in the embodiment of the invention, namely, when the original time slice of the first thread of the application program is larger than or equal to the maximum time slice, the maximum time slice is determined to be the time slice after the first thread of the application program is adjusted. For example, comparing the sizes of the original time slice NewSlicem and the time slice maximum value NewSliceMax of the first thread m in the process, if the original time slice NewSlicem of the first thread is greater than the time slice maximum value NewSliceMax, newslicem=newslicemax.
In other embodiments, the time slices of all threads of the application program may be optionally adjusted by the same method as the thread priority adjustment.
In other aspects of the embodiments of the present invention, referring to fig. 7, after the step of adjusting the time slices of all the threads of the application program based on the time slice reference value and the time slice dynamic range value, step 104 further includes:
step 105, performing thread scheduling based on all threads of the adjusted application program.
And step 106, determining the running state of the target thread based on the CPU occupation time after the target thread is started and/or based on the keep-alive mechanism of the target thread. The target thread is any one of all threads of the application program.
Referring to fig. 8, the first terminal mounts all threads of the adjusted application program to the thread waiting area, and performs thread scheduling based on all threads of the adjusted application program. The first terminal determines the running state of the target thread based on the CPU occupation time after the target thread is started and/or based on the keep-alive mechanism of the target thread, so that the thread of the application program can be correctly executed after modification. That is, in one embodiment, the first terminal determines the running state of the target thread based on the CPU occupation time after the target thread is started, so as to determine that the thread of the application program can be correctly executed after modification. In another embodiment, the first terminal determines the running state of the target thread based on the keep-alive mechanism of the target thread, so as to determine that the thread of the application program can be correctly executed after modification. In another embodiment, the first terminal determines the running state of the target thread based on the CPU occupation time after the target thread is started and based on the keep-alive mechanism of the target thread, so as to determine that the thread of the application program can be correctly executed after modification.
Further, determining the running state of the target thread based on the CPU occupation time after the target thread is started includes: and under the condition that the CPU occupation time after the target thread is started is within the set threshold value range, determining that the target thread runs normally.
For example, the first terminal may analyze the CPU occupation time of a certain thread for a period of time, such as 5 minutes after the thread starts. If the CPU occupation time of the thread is between [ α1, α2], for example, α1=5%, and α2=65%, within 5 minutes, the thread is considered to be running normally, and the application is executed correctly.
Further, determining the operating state of the target thread based on the keep-alive mechanism of the target thread includes: and under the condition that the heartbeat signal sent by the target thread is received, determining that the target thread runs normally.
For example, if the thread needs to feed the dog at intervals, the embedded operating system of the first terminal judges that the thread sends a heartbeat signal (or called dog feeding information), the thread is considered to run normally, and the application program is executed correctly.
The first terminal determines the running state of the target thread based on the CPU occupation time after the target thread is started and/or based on the keep-alive mechanism of the target thread, so that the thread of the application program can be correctly executed after modification.
In other aspects of the embodiments of the present invention, referring to fig. 9, step 106, after the step of determining the running state of the target thread based on the CPU occupation time after the target thread is started and/or based on the keep-alive mechanism of the target thread, further includes:
step 107, the priorities of all threads and the time slices of all threads of the adjusted application program are stored in the application registry.
And 108, performing integrity protection on the application registry to generate an integrity check value.
And step 109, storing the application registry under the condition that the integrity check value passes verification, so that the application program runs the threads directly by using the priorities of all threads of the application program after adjustment and the time slices of all threads when running next time.
The first terminal rewrites the priority levels of all threads and the time slices of all threads of the adjusted application program into an application registry, performs integrity protection on the application registry, and generates an integrity check value. Wherein the application registry information includes thread information of the application program, the thread information including thread name, thread priority, thread entry function, thread time slice, and the like. The integrity check value generation method may use a HASH algorithm, such as SHA1, SHA256, SM3 algorithm, etc. After the embedded operating system of the first terminal verifies the check value, the application registry information is stored in the nonvolatile memory. When the first terminal is restarted or powered down, and the embedded operating system of the first terminal runs again, the thread is directly run by using the new thread priority and the thread time slice in the application registry, so that the thread analysis running time is saved.
In other aspects of embodiments of the present invention, the application installation file further includes a signature value, the signature value being derived based on the integrity protection and/or the source legitimacy protection of the second terminal. Wherein the integrity protection may use HASH algorithms such as SHA1, SHA256, SM3 algorithms, etc.; the source validity protection can use signature methods, such as asymmetric algorithm signature, such as RSA, ECC, SM and the like, or symmetric algorithm signature, such as AES, DES, SM and the like.
Referring to fig. 10, after step 101, the step of receiving the application installation file sent by the second terminal further includes:
step 102, performing integrity verification on the signature value and/or performing source validity verification.
Specifically, referring to fig. 11, after receiving the application installation file, the first terminal analyzes the application code by an application installer in the embedded system of the first terminal, and analyzes whether the application installation file has a signature value. If the signature value exists, the integrity and source legitimacy of the signature value is verified by using a security module prior to writing the verification signature and integrity verification key value by an administrator; if the problem is not found, the analysis is continued, and if the problem is found, the application installation is exited. The security module may be in the form of a security chip or a security module, or may be in the form of software of a security APP on an embedded operating system.
The embodiment of the invention realizes the security verification of the application program installation file by carrying out the integrity verification on the signature value and/or carrying out the source validity verification.
On the other hand, the embodiment of the invention also provides a thread information adjusting method which is applied to the second terminal. The second terminal may be various terminals that can add information to the application download file, for example, the second terminal may be a server.
Referring to fig. 12, a thread information adjustment method according to an embodiment of the present invention includes:
step 201, constructing an application program installation file based on the application program download file and the addition information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloading file runs correspondingly.
The second terminal constructs an application installation file based on the application download file and the addition information. The priority reference value is a thread priority minimum value set or specified by the second terminal for the application program corresponding to the application program downloading file. The priority dynamic range value is a maximum range value that increases on the basis of the priority reference value. Wherein, different application programs can be classified and graded, and the thread priority reference value and the priority dynamic range of each application program are set. For example, when the importance level of the application 1 is higher than that of the application 2, and the importance level is higher as the priority is lower, the priority reference value of the thread of the application 1 is set to 10, and the priority dynamic range value is set to 10; the priority reference value of the thread of the application 2 is 20 and the priority dynamic range value is 10.
The time slice reference value is a minimum time slice value set or specified by the second terminal for the thread of the application program corresponding to the running application program downloading file. The time slice dynamic range value is a maximum range value that increases on the basis of the time slice reference value.
Step 202, sending the application program installation file to a first terminal, so that the first terminal can adjust thread information based on the application program installation file.
And the second terminal sends the application program installation file to the first terminal so that the first terminal can adjust thread information based on the application program installation file. The specific process of thread information adjustment may refer to the related embodiment of the first terminal, which is not described herein.
Further, 201, constructing an application installation file based on the application download file and the addition information, including: and constructing an application program installation file based on the application program download file, the added information and the signature value.
Wherein the signature value is obtained based on the integrity protection and/or the source legitimacy protection of the second terminal. Specifically, the second terminal may be obtained by performing integrity protection and/or source validity protection on the signature value through the encryptor. Wherein the integrity protection may use HASH algorithms such as SHA1, SHA256, SM3 algorithms, etc.; the source validity protection can use signature methods, such as asymmetric algorithm signature, such as RSA, ECC, SM and the like, or symmetric algorithm signature, such as AES, DES, SM and the like.
The embodiment of the invention realizes the encryption of the application program installation file by carrying out the integrity protection and/or the source legitimacy protection on the signature value, and improves the installation safety of the application program installation file.
Device embodiment
Referring to fig. 13, in another aspect, an embodiment of the present invention further provides a thread information adjustment device, which is applied to a first terminal, and the device includes:
the data acquisition module 1301 is configured to receive an application installation file sent by the second terminal; the application program installation file comprises an application program downloading file and adding information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs;
a thread priority adjustment module 1302, configured to adjust priorities of all threads of the application program based on the priority reference value and the priority dynamic range value;
the thread time slice adjustment module 1303 is configured to adjust time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value.
According to the embodiment of the invention, the priority of all threads of the application program is adjusted based on the priority reference value and the priority dynamic range value included in the application program installation file by receiving the application program installation file sent by the second terminal; the time slices of all threads of the application are adjusted based on the time slice reference values and the time slice dynamic range values included in the application installation file. By setting the information adding mode for the application program downloading file, the priority and time slice information of all threads in the application program corresponding to the application program downloading file can be adjusted or managed so as to meet the actual requirement of the application program operation and avoid the defect of disordered execution of the application program.
Optionally, the adjusting the priority of all threads of the application program based on the priority reference value and the priority dynamic range value includes:
determining the priority range value of the original thread;
and adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value.
Optionally, the determining the original thread priority range value includes:
The priority ordering is carried out on all threads of the application program so as to determine the maximum value of the priority of the original thread and the minimum value of the priority of the original thread;
and determining an original thread priority range value based on the difference value between the original thread priority maximum value and the original thread priority minimum value.
Optionally, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value includes:
determining the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value under the condition that the original thread priority range value is smaller than or equal to the priority dynamic range value; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value is implemented by the following formula:
NewPrio m =OldPrio m +NewPrioBase-OldPrioMin;
Wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, newPrioBase representing the priority reference value, olpriomin representing the original thread priority minimum.
Optionally, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value includes:
determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value, and the priority dynamic range value, if the original thread priority range value is greater than the priority dynamic range value, and if the priority dynamic range value is greater than or equal to the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value and the priority dynamic range value is implemented by the following formula:
NewPriom=NewPrioBase+(OldPriom-OldPrioBase)*NewPrioRng/OldPrioRng;
Wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m And representing the original priority of the first thread of the application program, wherein newprioBase represents the priority reference value, oldproBase represents the original thread priority minimum value, newprioRng represents the priority dynamic range value, and oldproRng represents the original thread priority range value.
Optionally, adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value includes:
determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program, and the original thread priority range value, when the original thread priority range value is greater than the priority dynamic range value, and the priority dynamic range value is less than the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program, and the original thread priority range value is implemented by the following formula:
NewPrio m =NewPrioBase+(OldPrio m -OldPrioBase)*n/OldPrioRng;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, wherein NewPrioBase represents the priority reference value, oldPrioBase represents the original thread priority minimum value, n represents the total number of all threads of the application program, and OldPrioRng represents the original thread priority range value.
Optionally, in the case that the priority after the first thread adjustment of the application program is greater than the sum of the priority reference value and the priority dynamic range value, determining that the priority after the first thread adjustment of the application program is the sum of the priority reference value and the priority dynamic range value.
Optionally, the adjusting the time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value includes:
Calculating a time slice maximum based on the sum of the time slice reference value and the time slice dynamic range value;
determining a time slice after the first thread of the application program is adjusted based on the magnitude relation between the original time slice of the first thread of the application program and the maximum value of the time slice; wherein the first thread is any one thread of all threads of the application program.
Optionally, the determining the time slice after the first thread adjustment of the application program based on the magnitude relation between the original time slice of the first thread of the application program and the maximum time slice value includes:
and determining that the maximum time slice is the time slice after the first thread of the application program is adjusted under the condition that the original time slice of the first thread of the application program is greater than or equal to the maximum time slice.
Optionally, the apparatus further includes:
the thread scheduling module is used for performing thread scheduling based on all threads of the adjusted application program;
the running state determining module is used for determining the running state of the target thread based on the CPU occupation time after the target thread is started and/or based on the keep-alive mechanism of the target thread;
The target thread is any one of all threads of the application program.
Optionally, the determining the running state of the target thread based on the CPU occupation time after the target thread is started includes:
and under the condition that the CPU occupation time after the target thread is started is within the set threshold value range, determining that the target thread runs normally.
Optionally, the determining the running state of the target thread based on the keep-alive mechanism of the target thread includes:
and under the condition that the heartbeat signal sent by the target thread is received, determining that the target thread runs normally.
Optionally, the apparatus further includes:
the first storage module is used for storing the priority levels of all threads of the adjusted application program and the time slices of all threads to the application registry;
the protection module is used for carrying out integrity protection on the application registry and generating an integrity check value;
and the second storage module is used for storing the application registry under the condition that the integrity check value passes verification, so that the application program runs next time, and the priority of all threads of the application program after adjustment and the time slices of all threads are directly utilized to run the threads.
Optionally, the application installation file further includes a signature value, where the signature value is obtained based on integrity protection and/or source legitimacy protection of the second terminal;
The apparatus further comprises:
and the verification module is used for carrying out integrity verification on the signature value and/or source validity verification.
The thread information adjusting device includes a processor and a memory, where the data acquiring module 1301, the thread priority adjusting module 1302, the thread time slice adjusting module 1303, and the like are stored as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel may be provided with one or more.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
Referring to fig. 14, in another aspect, an embodiment of the present invention further provides a thread information adjustment device, applied to a second terminal, where the device includes:
a construction module 1401 for constructing an application installation file based on the application download file and the addition information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs;
And a sending module 1402, configured to send the application installation file to a first terminal, so that the first terminal performs thread information adjustment based on the application installation file.
Optionally, the constructing the application installation file based on the application download file and the added information includes:
constructing an application program installation file based on the application program downloading file, the added information and the signature value;
wherein the signature value is obtained based on the integrity protection and/or the source legitimacy protection of the second terminal.
The thread information adjusting apparatus includes a processor and a memory, the above-mentioned construction module 1401, the transmission module 1402, and the like are stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel may be provided with one or more.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
Fig. 15 illustrates a physical structure diagram of an electronic device, as shown in fig. 15, which may include: a processor 1510, a communication interface (Communications Interface) 1520, a memory 1530, and a communication bus 1540, wherein the processor 1510, the communication interface 1520, and the memory 1530 communicate with each other via the communication bus 1540. The processor 1510 may invoke logic instructions in the memory 1530 to perform a thread information adjustment method comprising: receiving an application program installation file sent by a second terminal; the application program installation file comprises an application program downloading file and adding information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs; adjusting the priority of all threads of the application program based on the priority reference value and the priority dynamic range value; the time slices of all threads of the application are adjusted based on the time slice reference value and the time slice dynamic range value. Or,
Constructing an application program installation file based on the application program download file and the addition information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs; and sending the application program installation file to a first terminal so that the first terminal can adjust thread information based on the application program installation file.
Further, the logic instructions in the memory 1530 described above may be implemented in the form of software functional units and may be stored on a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In yet another aspect, the present invention provides a machine-readable storage medium having stored thereon a computer program which when executed by a processor is implemented to perform a thread information adjustment method, the method comprising: receiving an application program installation file sent by a second terminal; the application program installation file comprises an application program downloading file and adding information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs; adjusting the priority of all threads of the application program based on the priority reference value and the priority dynamic range value; the time slices of all threads of the application are adjusted based on the time slice reference value and the time slice dynamic range value. Or,
constructing an application program installation file based on the application program download file and the addition information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs; and sending the application program installation file to a first terminal so that the first terminal can adjust thread information based on the application program installation file.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (40)
1. A method for adjusting thread information, applied to a first terminal, the method comprising:
receiving an application program installation file sent by a second terminal; the application program installation file comprises an application program downloading file and adding information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs;
adjusting the priority of all threads of the application program based on the priority reference value and the priority dynamic range value;
The time slices of all threads of the application are adjusted based on the time slice reference value and the time slice dynamic range value.
2. The thread information adjustment method according to claim 1, wherein the adjusting the priorities of all threads of the application program based on the priority reference value and the priority dynamic range value includes:
determining the priority range value of the original thread;
and adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value.
3. The thread information adjustment method according to claim 2, wherein determining the original thread priority range value comprises:
the priority ordering is carried out on all threads of the application program so as to determine the maximum value of the priority of the original thread and the minimum value of the priority of the original thread;
and determining an original thread priority range value based on the difference value between the original thread priority maximum value and the original thread priority minimum value.
4. The thread information adjustment method according to claim 3, wherein adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value, and the priority dynamic range value includes:
Determining the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value under the condition that the original thread priority range value is smaller than or equal to the priority dynamic range value; wherein the first thread is any one thread of all threads of the application program.
5. The thread information adjustment method according to claim 4, wherein the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value, and the original thread priority minimum value is implemented by the following formula:
NewPrio m =OldPrio m +NewPrioBase-OldPrioMin;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, newPrioBase representing the priority reference value, olpriomin representing the original thread priority minimum.
6. The thread information adjustment method according to claim 3, wherein adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value, and the priority dynamic range value includes:
Determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value, and the priority dynamic range value, if the original thread priority range value is greater than the priority dynamic range value, and if the priority dynamic range value is greater than or equal to the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
7. The thread information adjustment method according to claim 6, wherein the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value, and the priority dynamic range value is implemented by the following formula:
NewPrio m =NewPrioBase+(OldPrio m -OldPrioBase)*NewPrioRng/OldPrioRng;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m And representing the original priority of the first thread of the application program, wherein newprioBase represents the priority reference value, oldproBase represents the original thread priority minimum value, newprioRng represents the priority dynamic range value, and oldproRng represents the original thread priority range value.
8. The thread information adjustment method according to claim 3, wherein adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value, and the priority dynamic range value includes:
determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program, and the original thread priority range value, when the original thread priority range value is greater than the priority dynamic range value, and the priority dynamic range value is less than the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
9. The thread information adjustment method according to claim 8, wherein the determining the adjusted priority of the first thread of the application program based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program, and the original thread priority range value is implemented by the following formula:
NewPrio m =NewPrioBase+(OldPrio m -OldPrioBase)*n/OldPrioRng;
Wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, wherein NewPrioBase represents the priority reference value, oldPrioBase represents the original thread priority minimum value, n represents the total number of all threads of the application program, and OldPrioRng represents the original thread priority range value.
10. The thread information adjustment method according to claim 9, wherein in the case where the priority after the first thread adjustment of the application program is greater than the sum of the priority reference value and the priority dynamic range value, the priority after the first thread adjustment of the application program is determined as the sum of the priority reference value and the priority dynamic range value.
11. The thread information adjustment method according to claim 1, wherein the adjusting the time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value includes:
calculating a time slice maximum based on the sum of the time slice reference value and the time slice dynamic range value;
determining a time slice after the first thread of the application program is adjusted based on the magnitude relation between the original time slice of the first thread of the application program and the maximum value of the time slice; wherein the first thread is any one thread of all threads of the application program.
12. The thread information adjustment method according to claim 11, wherein the determining the adjusted time slice of the first thread of the application program based on the magnitude relation between the original time slice of the first thread of the application program and the maximum time slice value comprises:
and determining that the maximum time slice is the time slice after the first thread of the application program is adjusted under the condition that the original time slice of the first thread of the application program is greater than or equal to the maximum time slice.
13. The thread information adjustment method according to claim 1, wherein after the step of adjusting the time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value, further comprising:
performing thread scheduling based on all threads of the adjusted application program;
determining the running state of the target thread based on the CPU occupation time after the target thread is started and/or based on the keep-alive mechanism of the target thread;
the target thread is any one of all threads of the application program.
14. The thread information adjustment method according to claim 13, wherein determining the running state of the target thread based on the CPU occupation time after the start of the target thread includes:
And under the condition that the CPU occupation time after the target thread is started is within the set threshold value range, determining that the target thread runs normally.
15. The thread information adjustment method of claim 13, wherein the determining the operating state of the target thread based on the keep-alive mechanism of the target thread comprises:
and under the condition that the heartbeat signal sent by the target thread is received, determining that the target thread runs normally.
16. The thread information adjustment method according to claim 13, wherein after the step of determining the running state of the target thread based on the CPU occupation time after the start of the target thread and/or based on the keep-alive mechanism of the target thread, further comprises:
storing the priority of all threads of the adjusted application program and the time slices of all threads into an application registry;
performing integrity protection on the application registry to generate an integrity check value;
and under the condition that the integrity check value passes verification, storing the application registry so as to enable the application program to run threads directly by utilizing the priority levels of all threads of the application program after adjustment and the time slices of all threads when the application program runs next time.
17. The thread information adjustment method according to any one of claims 1 to 16, wherein the application installation file further comprises a signature value, the signature value being obtained based on integrity protection and/or source legitimacy protection of the second terminal;
After the step of receiving the application installation file sent by the second terminal, the method further includes:
and carrying out integrity verification on the signature value and/or carrying out source validity verification.
18. A method for adjusting thread information, applied to a second terminal, the method comprising:
constructing an application program installation file based on the application program download file and the addition information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs;
and sending the application program installation file to a first terminal so that the first terminal can adjust thread information based on the application program installation file.
19. The thread information adjustment method according to claim 18, wherein the constructing an application installation file based on the application download file and the addition information includes:
constructing an application program installation file based on the application program downloading file, the added information and the signature value;
wherein the signature value is obtained based on the integrity protection and/or the source legitimacy protection of the second terminal.
20. A thread information adjustment device, applied to a first terminal, comprising:
the data acquisition module is used for receiving an application program installation file sent by the second terminal; the application program installation file comprises an application program downloading file and adding information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs;
the thread priority adjustment module is used for adjusting the priorities of all threads of the application program based on the priority reference value and the priority dynamic range value;
and the thread time slice adjusting module is used for adjusting the time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value.
21. The thread information adjustment apparatus according to claim 20, wherein the adjusting the priorities of all threads of the application program based on the priority reference value and the priority dynamic range value includes:
determining the priority range value of the original thread;
And adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value and the priority dynamic range value.
22. The thread information adjustment apparatus of claim 21, wherein the determining the original thread priority range value comprises:
the priority ordering is carried out on all threads of the application program so as to determine the maximum value of the priority of the original thread and the minimum value of the priority of the original thread;
and determining an original thread priority range value based on the difference value between the original thread priority maximum value and the original thread priority minimum value.
23. The thread information adjustment apparatus according to claim 21, wherein adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value, and the priority dynamic range value, comprises:
determining the priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value and the original thread priority minimum value under the condition that the original thread priority range value is smaller than or equal to the priority dynamic range value; wherein the first thread is any one thread of all threads of the application program.
24. The thread information adjustment apparatus of claim 23, wherein the determining the adjusted priority of the first thread of the application based on the original priority of the first thread of the application, the priority reference value, and the original thread priority minimum value is implemented by the following formula:
NewPrio m =OldPrio m +NewPrioBase-OldPrioMin;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, newPrioBase representing the priority reference value, olpriomin representing the original thread priority minimum.
25. The thread information adjustment apparatus according to claim 21, wherein adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value, and the priority dynamic range value, comprises:
determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the original thread priority range value, and the priority dynamic range value, if the original thread priority range value is greater than the priority dynamic range value, and if the priority dynamic range value is greater than or equal to the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
26. The thread information adjustment apparatus of claim 25, wherein the determining the adjusted priority of the first thread of the application based on the original priority of the first thread of the application, the priority reference value, the original thread priority minimum value, the original thread priority range value, and the priority dynamic range value is implemented by:
NewPrio m =NewPrioBase+(OldPrio m -OldPrioBase)*NewPrioRng/OldPrioRng;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, and NewPrioBase representing the priority baseAnd (3) a standard value, oldPrioBase represents the minimum priority value of the original thread, newPrioRng represents the priority dynamic range value, and OldPrioRng represents the priority range value of the original thread.
27. The thread information adjustment apparatus according to claim 21, wherein adjusting the priorities of all threads of the application program based on the original thread priority range value, the priority reference value, and the priority dynamic range value, comprises:
determining a priority of the first thread of the application program after adjustment based on the original priority of the first thread of the application program, the priority reference value, the original thread priority minimum value, the total number of all threads of the application program, and the original thread priority range value, when the original thread priority range value is greater than the priority dynamic range value, and the priority dynamic range value is less than the total number of all threads of the application program; wherein the first thread is any one thread of all threads of the application program.
28. The thread information adjustment apparatus of claim 27, wherein the determining the adjusted priority of the first thread of the application based on the original priority of the first thread of the application, the priority reference value, the original thread priority minimum value, the total number of all threads of the application, and the original thread priority range value is implemented by the following formula:
NewPrio m =NewPrioBase+(OldPrio m -OldPrioBase)*n/OldPrioRng;
wherein, newPrio m Indicating the first thread adjusted priority of an application, oldPrio m Representing the original priority of the first thread of the application program, wherein newPrioBase represents the priority reference value, oldPrioBase represents the original thread priority minimum value, n represents the total number of all threads of the application program, oldPrioRng represents the original thread priorityRange values.
29. The thread information adjustment apparatus according to claim 28, wherein the priority after the first thread adjustment of the application program is determined to be the sum of the priority reference value and the priority dynamic range value in the case where the priority after the first thread adjustment of the application program is greater than the sum of the priority reference value and the priority dynamic range value.
30. The thread information adjustment apparatus of claim 20, wherein the adjusting the time slices of all threads of the application program based on the time slice reference value and the time slice dynamic range value comprises:
calculating a time slice maximum based on the sum of the time slice reference value and the time slice dynamic range value;
determining a time slice after the first thread of the application program is adjusted based on the magnitude relation between the original time slice of the first thread of the application program and the maximum value of the time slice; wherein the first thread is any one thread of all threads of the application program.
31. The thread information adjustment apparatus as recited in claim 30, wherein the determining the adjusted time slice of the first thread of the application based on the magnitude relation between the original time slice of the first thread of the application and the maximum time slice value comprises:
and determining that the maximum time slice is the time slice after the first thread of the application program is adjusted under the condition that the original time slice of the first thread of the application program is greater than or equal to the maximum time slice.
32. The thread information adjustment device of claim 20, wherein the device further comprises:
the thread scheduling module is used for performing thread scheduling based on all threads of the adjusted application program;
the running state determining module is used for determining the running state of the target thread based on the CPU occupation time after the target thread is started and/or based on the keep-alive mechanism of the target thread;
the target thread is any one of all threads of the application program.
33. The thread information adjustment apparatus as recited in claim 32, wherein determining the running state of the target thread based on the CPU occupation time after the start of the target thread comprises:
and under the condition that the CPU occupation time after the target thread is started is within the set threshold value range, determining that the target thread runs normally.
34. The thread information adjustment apparatus of claim 32, wherein the determining the operating state of the target thread based on the keep-alive mechanism of the target thread comprises:
and under the condition that the heartbeat signal sent by the target thread is received, determining that the target thread runs normally.
35. The thread information adjustment device of claim 20, wherein the device further comprises:
The first storage module is used for storing the priority levels of all threads of the adjusted application program and the time slices of all threads to the application registry;
the protection module is used for carrying out integrity protection on the application registry and generating an integrity check value;
and the second storage module is used for storing the application registry under the condition that the integrity check value passes verification, so that the application program runs next time, and the priority of all threads of the application program after adjustment and the time slices of all threads are directly utilized to run the threads.
36. The thread information adjustment device according to any one of claims 20 to 35, wherein the application installation file further comprises a signature value, the signature value being derived based on an integrity protection and/or a source legitimacy protection of the second terminal;
the apparatus further comprises:
and the verification module is used for carrying out integrity verification on the signature value and/or source validity verification.
37. A thread information adjustment device, applied to a second terminal, comprising:
the construction module is used for constructing an application program installation file based on the application program download file and the addition information; the adding information comprises a priority reference value, a priority dynamic range value, a time slice reference value and a time slice dynamic range value which are set for the thread of the application program of which the application program downloads the file and correspondingly runs;
And the sending module is used for sending the application program installation file to the first terminal so that the first terminal can adjust the thread information based on the application program installation file.
38. The thread information adjustment apparatus as recited in claim 37, wherein the constructing an application installation file based on the application download file and the addition information comprises:
constructing an application program installation file based on the application program downloading file, the added information and the signature value;
wherein the signature value is obtained based on the integrity protection and/or the source legitimacy protection of the second terminal.
39. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the thread information adjustment method of any one of claims 1 to 17 when executing the program; or to implement the thread information adjustment method of any one of claims 18 to 19 when executing the program.
40. A machine readable storage medium having stored thereon a computer program, which when executed by a processor implements the thread information adjustment method of any one of claims 1 to 17; or to implement the thread information adjustment method of any one of claims 18 to 19 when executing the program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311516258.2A CN117492958B (en) | 2023-11-14 | 2023-11-14 | Thread information adjustment method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311516258.2A CN117492958B (en) | 2023-11-14 | 2023-11-14 | Thread information adjustment method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117492958A true CN117492958A (en) | 2024-02-02 |
CN117492958B CN117492958B (en) | 2024-07-19 |
Family
ID=89681092
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311516258.2A Active CN117492958B (en) | 2023-11-14 | 2023-11-14 | Thread information adjustment method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117492958B (en) |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2150090A1 (en) * | 2008-07-30 | 2010-02-03 | Societé Française du Radiotéléphone | Multimode terminal with optimized connections |
US20110225590A1 (en) * | 2010-03-15 | 2011-09-15 | Thomson Steven S | System and method of executing threads at a processor |
US20120005457A1 (en) * | 2010-07-01 | 2012-01-05 | International Business Machines Corporation | Using software-controlled smt priority to optimize data prefetch with assist thread |
CN104899050A (en) * | 2014-03-04 | 2015-09-09 | 广州金山网络科技有限公司 | Method, device and electronic equipment for installing application in mobile terminal |
CN108028768A (en) * | 2015-06-29 | 2018-05-11 | 脸谱公司 | The method and system of application version is installed by short-range communication |
CN108563494A (en) * | 2018-04-04 | 2018-09-21 | 吉林省星途科技有限公司 | A kind of thread scheduling system and method for adaptive dynamic adjustment |
KR20190085800A (en) * | 2018-01-11 | 2019-07-19 | 한림대학교 산학협력단 | Method and system for user priority decision in wireless body sensor network |
CN111596936A (en) * | 2020-05-12 | 2020-08-28 | 腾讯科技(深圳)有限公司 | Application program updating method and device |
US11314436B1 (en) * | 2021-04-22 | 2022-04-26 | Dell Products, L.P. | Method and apparatus for dynamically adjusting differentiated share prioritization in a storage system |
WO2023051233A1 (en) * | 2021-09-30 | 2023-04-06 | 华为技术有限公司 | Task scheduling method, device, apparatus and medium |
CN115934276A (en) * | 2022-11-30 | 2023-04-07 | 维沃移动通信有限公司 | Memory management method and device and electronic equipment |
CN116089098A (en) * | 2021-11-05 | 2023-05-09 | 大唐移动通信设备有限公司 | Thread endless loop detection method, device and apparatus |
US20230156778A1 (en) * | 2021-11-12 | 2023-05-18 | Qualcomm Incorporated | Logical channel prioritization enhancements for jitter sensitive traffic |
CN117873658A (en) * | 2023-12-11 | 2024-04-12 | 上海睿赛德电子科技有限公司 | Method for adjusting APP thread priority in embedded system |
-
2023
- 2023-11-14 CN CN202311516258.2A patent/CN117492958B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2150090A1 (en) * | 2008-07-30 | 2010-02-03 | Societé Française du Radiotéléphone | Multimode terminal with optimized connections |
US20110225590A1 (en) * | 2010-03-15 | 2011-09-15 | Thomson Steven S | System and method of executing threads at a processor |
US20120005457A1 (en) * | 2010-07-01 | 2012-01-05 | International Business Machines Corporation | Using software-controlled smt priority to optimize data prefetch with assist thread |
CN104899050A (en) * | 2014-03-04 | 2015-09-09 | 广州金山网络科技有限公司 | Method, device and electronic equipment for installing application in mobile terminal |
CN108028768A (en) * | 2015-06-29 | 2018-05-11 | 脸谱公司 | The method and system of application version is installed by short-range communication |
KR20190085800A (en) * | 2018-01-11 | 2019-07-19 | 한림대학교 산학협력단 | Method and system for user priority decision in wireless body sensor network |
CN108563494A (en) * | 2018-04-04 | 2018-09-21 | 吉林省星途科技有限公司 | A kind of thread scheduling system and method for adaptive dynamic adjustment |
CN111596936A (en) * | 2020-05-12 | 2020-08-28 | 腾讯科技(深圳)有限公司 | Application program updating method and device |
US11314436B1 (en) * | 2021-04-22 | 2022-04-26 | Dell Products, L.P. | Method and apparatus for dynamically adjusting differentiated share prioritization in a storage system |
WO2023051233A1 (en) * | 2021-09-30 | 2023-04-06 | 华为技术有限公司 | Task scheduling method, device, apparatus and medium |
CN116089098A (en) * | 2021-11-05 | 2023-05-09 | 大唐移动通信设备有限公司 | Thread endless loop detection method, device and apparatus |
US20230156778A1 (en) * | 2021-11-12 | 2023-05-18 | Qualcomm Incorporated | Logical channel prioritization enhancements for jitter sensitive traffic |
CN115934276A (en) * | 2022-11-30 | 2023-04-07 | 维沃移动通信有限公司 | Memory management method and device and electronic equipment |
CN117873658A (en) * | 2023-12-11 | 2024-04-12 | 上海睿赛德电子科技有限公司 | Method for adjusting APP thread priority in embedded system |
Non-Patent Citations (3)
Title |
---|
张登银;许扬扬;蒋娟;: "基于时延的动态优先级调度算法", 计算机技术与发展, no. 02, 10 February 2011 (2011-02-10) * |
王德文;刘庭辉;: "电力全业务统一数据中心突发性数据处理任务调度方法", 电力系统自动化, no. 08, 15 March 2018 (2018-03-15) * |
马明礼;李华;裴朝;王延君;丁志盛;: "OSEK实时操作系统任务调度的优化", 单片机与嵌入式系统应用, no. 10, 1 October 2007 (2007-10-01) * |
Also Published As
Publication number | Publication date |
---|---|
CN117492958B (en) | 2024-07-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10871953B2 (en) | Application update method and apparatus | |
JP6363796B2 (en) | Dynamic code deployment and versioning | |
CN110597531B (en) | Distributed module upgrading method and device and storage medium | |
JP6441404B2 (en) | Methods and devices for updating clients | |
US10452440B1 (en) | Systems and methods of optimized tuning of resources | |
KR101571880B1 (en) | Virtualized electronic apparatus virtual machine store and method for using virtual machine service | |
CN107896162B (en) | Deployment method and device of monitoring system, computer equipment and storage medium | |
JP6316978B2 (en) | Broadcast management information using fountain codes | |
US20060156129A1 (en) | System for maintaining data | |
CN108021400B (en) | Data processing method and device, computer storage medium and equipment | |
US8640150B2 (en) | Information processing terminal, information processing method, and program product | |
US20160188868A1 (en) | Technologies for providing hardware subscription models using pre-boot update mechanism | |
US11861357B2 (en) | Selecting and sending subset of components to computing device prior to operating system install | |
CN114257551A (en) | Distributed current limiting method and system and storage medium | |
TW202044022A (en) | Update signals | |
JP2012514791A (en) | Parallel task application framework | |
CN113330419A (en) | Equipment application installation method and device | |
CN110493644B (en) | Television application upgrading method, television terminal and server | |
CN105786636A (en) | System repairing method and device | |
CN114006815B (en) | Automatic deployment method and device for cloud platform nodes, nodes and storage medium | |
CN117492958B (en) | Thread information adjustment method and device and electronic equipment | |
CN116017403A (en) | LPA automatic compiling method, system and medium for eSIM equipment | |
US11698994B2 (en) | Method for a first start-up operation of a secure element which is not fully customized | |
CN112882733B (en) | Application updating method and device, electronic equipment and storage medium | |
CN111125771B (en) | Method and device for protecting equipment privacy, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |