CN116028179A - Process processing method and device - Google Patents

Process processing method and device Download PDF

Info

Publication number
CN116028179A
CN116028179A CN202211735219.7A CN202211735219A CN116028179A CN 116028179 A CN116028179 A CN 116028179A CN 202211735219 A CN202211735219 A CN 202211735219A CN 116028179 A CN116028179 A CN 116028179A
Authority
CN
China
Prior art keywords
priority
stage
scene
determining
weight
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.)
Pending
Application number
CN202211735219.7A
Other languages
Chinese (zh)
Inventor
陈东
陈永萍
吴桂津
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nsfocus Technologies Inc
Nsfocus Technologies Group Co Ltd
Original Assignee
Nsfocus Technologies Inc
Nsfocus Technologies Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nsfocus Technologies Inc, Nsfocus Technologies Group Co Ltd filed Critical Nsfocus Technologies Inc
Priority to CN202211735219.7A priority Critical patent/CN116028179A/en
Publication of CN116028179A publication Critical patent/CN116028179A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a process processing method and a device, which relate to the field of computers, and the method comprises the following steps: determining unique identifiers respectively corresponding to at least two processes running in the electronic equipment at the first moment; the unique identifier is used for screening a priority set corresponding to the process from the database; determining current scene phases corresponding to each process in at least two processes, wherein the current scene phases are any one of a starting phase, a business processing phase, a configuration phase, an idle phase and a closing phase; according to the determined unique identification and the current scene stage, respectively acquiring the current priorities corresponding to the processes from the priority sets corresponding to the database; and executing at least two processes according to the preset process management rule and the sequence from the high priority to the low priority.

Description

Process processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a process processing method and apparatus.
Background
At present, with the continuous development of technology and continuous improvement of technology, programs in electronic devices are more and more, and functions of each program are more and more complex, and resources of a central processing unit (central processing unit, CPU) required to be consumed by each function are more and more.
In general, tens or even hundreds of processes are running on one electronic device, and if one process is set to be high priority, the electronic device can preferentially guarantee the running of the process, and the running of the process may occupy a large part of CPU resources, so that other processes become slow, and the use experience of a user is reduced.
Therefore, how to realize better performance of each process by dynamically managing the priority of the process under the condition of limited hardware resources becomes a problem to be solved.
Disclosure of Invention
The embodiment of the invention provides a process processing method and a device, which are used for realizing better performance of each process through dynamic management of the priority of the process under the condition of limited hardware resources.
In a first aspect, a process processing method is provided, the method including:
determining unique identifiers respectively corresponding to at least two processes running in the electronic equipment at the first moment; the unique identifier is used for screening a priority set corresponding to the process from the database;
determining current scene phases corresponding to each process in the at least two processes respectively, wherein the current scene phases are any one of a starting phase, a service processing phase, a configuration phase, an idle phase and a closing phase;
According to the determined unique identification and the current scene stage, respectively acquiring the current priorities corresponding to the processes from the priority sets corresponding to the database;
and executing the at least two processes according to the preset process management rule and the sequence from the high priority to the low priority.
In a possible implementation manner, according to the determined unique identifier and the current scene stage, current priorities corresponding to the processes are respectively obtained from a corresponding priority set in the database, including:
for the unique identification and scene stage corresponding to each process, the following operations are respectively executed:
searching a target priority set matched with the unique identifier from the database according to the unique identifier of the process; the target priority set comprises priorities respectively corresponding to at least one scene stage corresponding to the process;
and searching the priority matched with the current scene stage in the target priority set, and taking the obtained matched priority as the current priority of the process.
In one possible implementation manner, before determining the unique identifiers respectively corresponding to the at least two processes running in the electronic device at the first moment, the method further includes:
Determining the corresponding relation between each scene stage corresponding to a first process and the stage weight, and determining the stage weight corresponding to each scene stage according to the corresponding relation; the first process is any process which can be operated by the electronic equipment;
determining a system weight corresponding to the first process, and determining a target weight corresponding to each scene stage corresponding to the first process according to the system weight and each stage weight; the system weight is used for representing the importance degree of the first process when the corresponding function in the electronic equipment runs; the target weight is used for representing the importance degree of the scene stage in the first process;
and respectively determining priorities corresponding to the scene stages corresponding to the first process according to the target weights corresponding to the scene stages and preset priority rules.
In one possible embodiment, the method further comprises:
and respectively storing the priorities corresponding to the first process in the at least one scene stage and the unique identifiers corresponding to the first process in a database in a correlated manner.
In a second aspect, there is provided a process processing apparatus, the apparatus comprising:
The first determining unit is used for determining unique identifiers corresponding to at least two processes running in the electronic equipment at the first moment respectively; the unique identifier is used for screening a priority set corresponding to the process from the database;
the second determining unit is used for determining current scene phases corresponding to each process in the at least two processes respectively, wherein the current scene phases are any one of a starting phase, a service processing phase, a configuration phase, an idle phase and a closing phase;
the obtaining unit is used for respectively obtaining the current priorities corresponding to the processes from the priority sets corresponding to the database according to the determined unique identifier and the current scene stage;
and the processing unit is used for executing the at least two processes according to the preset process management rule and the sequence from the high priority to the low priority.
In a possible embodiment, the acquiring unit is configured to:
for the unique identification and scene stage corresponding to each process, the following operations are respectively executed:
searching a target priority set matched with the unique identifier from the database according to the unique identifier of the process; the target priority set comprises priorities respectively corresponding to at least one scene stage corresponding to the process;
And searching the priority matched with the current scene stage in the target priority set, and taking the obtained matched priority as the current priority of the process.
In a possible embodiment, the apparatus further comprises a third determining unit for:
determining the corresponding relation between each scene stage corresponding to a first process and the stage weight, and determining the stage weight corresponding to each scene stage according to the corresponding relation; the first process is any process which can be operated by the electronic equipment;
determining a system weight corresponding to the first process, and determining a target weight corresponding to each scene stage corresponding to the first process according to the system weight and each stage weight; the system weight is used for representing the importance degree of the first process when the corresponding function in the electronic equipment runs; the target weight is used for representing the importance degree of the scene stage in the first process;
and respectively determining priorities corresponding to the scene stages corresponding to the first process according to the target weights corresponding to the scene stages and preset priority rules.
In a possible embodiment, the apparatus further comprises a storage unit for:
And respectively storing the priorities corresponding to the first process in the at least one scene stage and the unique identifiers corresponding to the first process in a database in a correlated manner.
In a third aspect, an electronic device is provided, the electronic device comprising:
a memory for storing program instructions;
and a processor for calling program instructions stored in the memory, and executing steps comprised in any one of the methods of the first aspect according to the obtained program instructions.
In a fourth aspect, there is provided a storage medium storing computer-executable instructions for causing an electronic device to perform steps comprised by any of the methods of the first aspect.
In a fifth aspect, there is provided a computer program product enabling an electronic device to carry out the steps comprised by any of the methods of the first aspect when said computer program product is run on the electronic device.
The technical scheme provided by the embodiment of the invention at least has the following beneficial effects:
in the embodiment of the invention, the electronic equipment can determine the unique identifiers respectively corresponding to at least two processes running in the electronic equipment at the first moment; the unique identifier is used for screening a priority set corresponding to the process from the database; and determining the current scene stage corresponding to each process in the at least two processes, wherein the current scene stage is any one of a starting stage, a business processing stage, a configuration stage, an idle stage and a closing stage. Then, the electronic equipment can respectively acquire the current priorities corresponding to the processes from the priority sets corresponding to the databases according to the determined unique identification and the current scene stage; that is, in the embodiment of the present invention, the electronic device obtains the current priority corresponding to the process, and the current priority corresponds to the current scene stage. The current priority may be updated according to the update of the current scene stage, that is, when the current priority is in different scene stages at different times, the current priority of the process is different, that is, the priority corresponding to the process is dynamic and not constant. Further, the electronic device may execute at least two processes according to a preset process management rule, in order from high to low according to the current priority.
Obviously, the process processing method provided by the embodiment of the invention correspondingly determines the execution sequence of at least two processes according to the current priority corresponding to the current scene stage of the process, so that the dynamic adjustment of the execution sequence can be realized according to the fact that the processes are in different scene stages, thereby ensuring that each process in the at least two processes realizes better performance and improving the use experience of users.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention and do not constitute a undue limitation on the invention.
Fig. 1 is a schematic diagram of an application scenario in an embodiment of the present invention;
FIG. 2 is a flowchart of a process processing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a process for determining a priority according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a stage weight assignment according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of obtaining a priority corresponding to a scene stage according to an embodiment of the present invention;
FIG. 6 is a block diagram illustrating a process processing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention. Embodiments of the invention and features of the embodiments may be combined with one another arbitrarily without conflict. Also, while a logical order is depicted in the flowchart, in some cases, the steps depicted or described may be performed in a different order than presented herein.
The terms "first" and "second" in the description and claims of the invention and in the above-described figures are used for descriptive purposes only and are not to be construed as either explicit or implicit relative importance or order. Furthermore, the term "include" and any variations thereof is intended to cover non-exclusive protection. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
At present, as described above, in the related art, when executing a plurality of processes, the execution sequence of each process is determined according to a total priority corresponding to the process, so that when a process with a higher priority is running, even if the process is in an idle state, a large amount of resources of a central processing unit (central processing unit, CPU) of the electronic device are preempted, so that other processes run slowly, and the use experience of a user is reduced.
In view of the above, the present invention provides a process processing method, by which an electronic device may determine unique identifiers corresponding to at least two processes running in the electronic device at a first time, respectively; the unique identifier is used for screening a priority set corresponding to the process from the database; and determining the current scene stage corresponding to each process in the at least two processes, wherein the current scene stage is any one of a starting stage, a business processing stage, a configuration stage, an idle stage and a closing stage. Then, the electronic equipment can respectively acquire the current priorities corresponding to the processes from the priority sets corresponding to the databases according to the determined unique identification and the current scene stage; that is, in the embodiment of the present invention, the electronic device obtains the current priority corresponding to the process, and the current priority corresponds to the current scene stage. The current priority may be updated according to the update of the current scene stage, that is, when the current priority is in different scene stages at different times, the current priority of the process is different, that is, the priority corresponding to the process is dynamic and not constant. Further, the electronic device may execute at least two processes according to a preset process management rule, in order from high to low according to the current priority.
Obviously, the process processing method provided by the embodiment of the invention correspondingly determines the execution sequence of at least two processes according to the current priority corresponding to the current scene stage of the process, so that the dynamic adjustment of the execution sequence can be realized according to the fact that the processes are in different scene stages, thereby ensuring that each process in the at least two processes realizes better performance and improving the use experience of users.
After the design concept of the embodiment of the present invention is introduced, some simple descriptions are provided for application scenarios suitable for the technical solution in the embodiment of the present invention, and it should be noted that, the application scenarios described in the embodiment of the present invention are for more clearly describing the technical solution of the embodiment of the present invention, and do not constitute a limitation on the technical solution provided by the embodiment of the present invention, and as a new application scenario appears, those skilled in the art can know that the technical solution provided by the embodiment of the present invention is equally suitable for similar technical problems.
Referring to fig. 1, a schematic view of a scenario that can be applied to an embodiment of the present invention is shown, where the scenario includes a normal process and a monitoring process, and in fig. 1, an example is shown in which 1 normal process interacts with one monitoring process. In practical implementation, the method may also be a plurality of ordinary processes, and the number of the ordinary processes may be 4, 16, etc., which is not limited in the embodiment of the present invention. Optionally, the common process is a process corresponding to all programs that can be run in the electronic device, such as a process corresponding to an instant messaging program, a process corresponding to a video interaction program, and the like, which is not limited in the embodiment of the present invention.
In the embodiment of the invention, the common process and the monitoring process can both run on the electronic equipment. The electronic device may be a portable electronic device such as a mobile phone, a tablet computer, a notebook computer, etc., for example, the portable electronic device may be mounted thereon
Figure BDA0004032486070000071
Or other operating system. In addition, the networking equipment can also be wearing equipment such as a watch, a bracelet and the like; or, the electronic equipment can also be intelligent household equipment such as a television, a refrigerator and the like, and in any case, the embodiment of the invention is not limited to the specific type of the electronic equipment. Alternatively, the electronic device may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a system for providing cloud services, cloud databases, cloud computing, and cloud functionsA cloud server or cluster of cloud servers for basic cloud computing services such as, but not limited to, digital, cloud storage, web services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
In a specific implementation process, the normal process may include a plurality of scene phases, for example, scene phase 1 and scene phase 2 shown in fig. 1, and the electronic device may determine priorities corresponding to the respective scene phases in the normal process, and write the unique identifier of the normal process, the plurality of scene phases included in the normal process, and the priorities corresponding to each scene phase in the database of the electronic device in an associated manner. In this way, the monitoring process can read the unique identifier (identity document, ID) of the normal process from the database, thereby determining the current priority corresponding to each normal process, and setting the current priority of the normal process, so that the electronic device can execute each process according to the priority order from high to low by combining the current priorities of the processes.
In order to further explain the scheme of the process treatment method provided by the embodiment of the invention, the following detailed description is given with reference to the accompanying drawings and the specific embodiments. Although embodiments of the present invention provide the method operational steps shown in the following embodiments or figures, more or fewer operational steps may be included in the method, either on a routine or non-inventive basis. In steps where there is logically no necessary causal relationship, the execution order of the steps is not limited to the execution order provided by the embodiments of the present invention. The methods may be performed sequentially or in parallel (e.g., parallel processor or multi-threaded processing application environments) as shown in the embodiments or figures when the methods are performed in the actual process or apparatus.
The following describes a process processing method in an embodiment of the present invention with reference to a flowchart of the method shown in fig. 2, and each step shown in fig. 2 may be executed by the electronic device shown in fig. 1.
Step 201: determining unique identifiers respectively corresponding to at least two processes running in the electronic equipment at the first moment; the unique identification is used for screening the priority set corresponding to the process from the database.
In an embodiment of the present invention, before executing step 201, the electronic device may determine priorities of various processes running in the electronic device when the processes are in different scene phases during the running process.
For example, referring to fig. 3, fig. 3 is a schematic diagram of determining a priority corresponding to a process according to an embodiment of the present invention. The electronic device may determine each process running in the electronic device, such as process1 (process 1), process2 (process 2), … …, and process x (process x) in fig. 3, where a specific value of x is determined according to a number of processes running in the electronic device, which is not limited in the embodiment of the present invention. Then, the electronic device may determine a stage Weight (pwight) corresponding to the scene stage included in each process and a system Weight (sWeight) corresponding to each process, so as to determine a corresponding target Weight (Weight) according to the stage Weight (pwight) and the corresponding system Weight (sWeight), and determine at least one Priority (Priority) corresponding to each process according to the target Weight (Weight) and a preset Priority rule.
In a specific implementation, the electronic device may perform the following operations for each process running in the electronic device:
Step A: determining the corresponding relation between each scene stage corresponding to the first process and the stage weight, and determining the stage weight corresponding to each scene stage according to the corresponding relation; the first process is any process that is operable by the electronic device.
In the embodiment of the invention, the electronic device can correspondingly determine the corresponding relation between each scene stage corresponding to the first process and the stage weight according to the importance degree of the scene stage. For example, a first process, while started, does not run to a critical business process, then its corresponding phase weight is relatively low, and if it runs to a critical business process, then its corresponding phase weight is relatively high.
In the implementation process, the scene stage corresponding to each process is different, and the importance degree of each scene stage in the corresponding process is different, so that the corresponding relationship between each scene stage corresponding to each process and the stage weight may be the same or different, and the method is not limited according to the implementation correspondence determination.
And (B) step (B): determining a system weight corresponding to the first process, and determining a target weight corresponding to each scene stage corresponding to the first process according to the system weight and each stage weight; the system weight is used for representing the importance degree of the first process in the electronic equipment when the corresponding function operates; the target weight is used to characterize the importance of the scene phase in the first process.
In the embodiment of the invention, each process is not only corresponding to a plurality of stage weights, but also corresponds to a system weight. Wherein the system weight refers to the weight of the process relative to other processes in the system. The system weight corresponding to each process is planned as a whole, and is not changed after the electronic equipment is started, and each process has unique system weight.
In the embodiment of the invention, after the electronic equipment obtains the multiple stage weights and the system weights corresponding to the processes, the target weights corresponding to the scene stages can be determined.
Alternatively, the range of values of the phase weights may be set to 1-100, and the phase weight addition of each scene phase in a single process needs to be equal to 100.
For example, referring to fig. 4, fig. 4 is a schematic diagram of assigning phase weights. The single process (process) includes 5 scene phases, the phase weight corresponding to the scene phase 1 is 10, the phase weight corresponding to the scene phase 2 is 10, the phase weight corresponding to the scene phase 3 is 50, the phase weight corresponding to the scene phase 4 is 20, and the phase weight corresponding to the scene phase 5 is 10.
Alternatively, the system weight range may be set to 1-100, and each process has an independent weight, which does not interfere with each other. For example, the system weight corresponding to process 1 is 90, the system weight corresponding to process 2 is 70, and the system weight corresponding to process 3 is 50.
Alternatively, the electronic device may determine the target weight based on the following formula:
Weight=sWeight*pWeight;
wherein Weight is used to characterize the target Weight, sWeight is used to characterize the system Weight, and pWeight is used to characterize the stage Weight.
Step C: and respectively determining the priorities corresponding to the scene stages corresponding to the first process according to the target weights corresponding to the scene stages and preset priority rules.
In the embodiment of the invention, a priority value range of-20 to 20 can be set and corresponds to the process priority level of the linux operating system, wherein-20 represents that the process scheduling priority is the lowest, and 20 represents that the process scheduling priority is the highest.
In the embodiment of the invention, the electronic device can respectively determine the priorities corresponding to the scene stages corresponding to the second process according to the target weights corresponding to the scene stages and the preset priority rules. Alternatively, the preset priority rule may be understood as: priority= -20+ (Weight/10000 x 40).
For example, referring to fig. 5, fig. 5 is a schematic diagram of obtaining priorities corresponding to a scene stage according to an embodiment of the present invention. In fig. 5, a process is shown as an example including 4 scene phases, where the 4 scene phases corresponding to the process are respectively stage1, stage2, stage3 and stage4, and the phase weight corresponding to stage1 is 10, the phase weight corresponding to stage2 is 30, the phase weight corresponding to stage3 is 40 and the phase weight corresponding to stage4 is 20, and the system weight (swight) corresponding to the process is determined to be 50. Then, the target weight corresponding to stage2 may be determined to be 1500, and further, the priority corresponding to stage2 may be determined to be-14. In addition, according to the method names, the target weights and priorities corresponding to the stage1, the stage3 and the stage4 can be respectively determined, so that the priorities corresponding to the 4 scene stages included in the process can be obtained.
In the embodiment of the invention, after the priorities corresponding to the first process in at least one scene stage are obtained, the electronic device can store the priorities corresponding to the first process in at least one scene stage and the unique identifiers corresponding to the first process in a database in an associated manner.
In the embodiment of the invention, the electronic equipment can determine the unique identifiers respectively corresponding to at least two processes running in the electronic equipment at the first moment; wherein the unique identifier is used for screening the priority set corresponding to the process from the database. The first time may be any time when the electronic device operates.
Step 202: and determining the current scene stage corresponding to each process in the at least two processes, wherein the current scene stage is any one of a starting stage, a business processing stage, a configuration stage, an idle stage and a closing stage.
In the embodiment of the invention, after the electronic device determines the unique identifier of the running at least two processes, the current scene stage corresponding to each process in the at least two processes can be determined, namely, the current scene stage of each process in the at least two processes is determined. For example, process a is in an idle phase and process B is in a traffic processing phase.
Step 203: and respectively acquiring the current priorities corresponding to the processes from the priority sets corresponding to the database according to the determined unique identification and the current scene stage.
In the embodiment of the invention, the electronic device can respectively execute the following operations aiming at the unique identifier and the scene stage corresponding to each process:
step a: searching a target priority set matched with the unique identifier from a database according to the unique identifier of the process; the target priority set comprises priorities respectively corresponding to at least one scene stage corresponding to the process.
Step b: and searching the priority matched with the current scene stage in the target priority set, and taking the obtained matched priority as the current priority of the process.
For example, the unique identification of the process is C1, and the target priority set matching C1 can be looked up from the database. Wherein, the target priority set comprises: the priority corresponding to the scene stage 1 is 10, the priority corresponding to the scene stage 2 is-10, and the priority corresponding to the scene stage 3 is 7. If the current scene stage of the process is scene stage 1, the priority level matched with scene stage 1, namely 10, can be found in the target priority set, and the current priority level of the process can be determined to be 10.
Step 204: and executing at least two processes according to the preset process management rule and the sequence from the high priority to the low priority.
For example, it is determined that two processes, namely, process 1 and process 2, are running in the electronic device at the first moment, the current priority corresponding to process 1 is 10, and the current priority corresponding to process 2 is 5, and then the electronic device determines to execute process 1 first and then execute process 2. Then, when the second moment is the moment, the electronic device still has the process 1 and the process 2 running, the current priorities corresponding to the process 1 and the process 2 respectively need to be re-determined, for example, when the second moment is the moment, the current priority corresponding to the process 1 is-10, and the current priority corresponding to the process 2 is 5, it is determined that the electronic device executes the process 2 first and then executes the process 1.
Therefore, the process processing method provided by the embodiment of the invention can realize the dynamic management of the priority of the process, thereby realizing the better performance of each process under the condition of limited hardware resources.
Based on the same inventive concept, the embodiment of the invention provides a process processing device, which can realize the functions corresponding to the process processing method. The process processing means may be a hardware structure, a software module, or a hardware structure plus a software module. The process processing device can be implemented by a chip system, which can be formed by a chip or can contain a chip and other discrete devices. Referring to fig. 6, the process processing apparatus includes:
A first determining unit 601, configured to determine unique identifiers corresponding to at least two processes running in the electronic device at a first moment; the unique identifier is used for screening a priority set corresponding to the process from the database;
a second determining unit 602, configured to determine a current scenario phase corresponding to each process of the at least two processes, where the current scenario phase is any one of a start phase, a service processing phase, a configuration phase, an idle phase, and a shutdown phase;
an obtaining unit 603, configured to obtain, according to the determined unique identifier and the current scene stage, current priorities corresponding to the respective processes from a corresponding priority set in the database;
and the processing unit 604 is configured to execute the at least two processes according to a preset process management rule and in a sequence from high to low according to a current priority.
In a possible implementation manner, the obtaining unit 603 is configured to:
for the unique identification and scene stage corresponding to each process, the following operations are respectively executed:
searching a target priority set matched with the unique identifier from the database according to the unique identifier of the process; the target priority set comprises priorities respectively corresponding to at least one scene stage corresponding to the process;
And searching the priority matched with the current scene stage in the target priority set, and taking the obtained matched priority as the current priority of the process.
In a possible embodiment, the apparatus further comprises a third determining unit for:
determining the corresponding relation between each scene stage corresponding to a first process and the stage weight, and determining the stage weight corresponding to each scene stage according to the corresponding relation; the first process is any process which can be operated by the electronic equipment;
determining a system weight corresponding to the first process, and determining a target weight corresponding to each scene stage corresponding to the first process according to the system weight and each stage weight; the system weight is used for representing the importance degree of the first process when the corresponding function in the electronic equipment runs; the target weight is used for representing the importance degree of the scene stage in the first process;
and respectively determining priorities corresponding to the scene stages corresponding to the first process according to the target weights corresponding to the scene stages and preset priority rules.
In a possible embodiment, the apparatus further comprises a storage unit for:
And respectively storing the priorities corresponding to the first process in the at least one scene stage and the unique identifiers corresponding to the first process in a database in a correlated manner.
All relevant contents of each step related to the foregoing embodiment of the process processing method may be cited in the functional description of the functional module corresponding to the process processing device in the embodiment of the present invention, which is not described herein.
The division of the modules in the embodiments of the present invention is schematically only one logic function division, and there may be another division manner in actual implementation, and in addition, each functional module in each embodiment of the present invention may be integrated in one controller, or may exist separately and physically, or two or more modules may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules.
Based on the same inventive concept, an embodiment of the present invention provides an electronic device, please refer to fig. 7, which includes at least one processor 701 and a memory 702 connected to the at least one processor, the embodiment of the present invention is not limited to a specific connection medium between the processor 701 and the memory 702, and in fig. 7, the connection between the processor 701 and the memory 702 is taken as an example, and in fig. 7, the connection manner between other components is shown by a thick line, which is merely illustrative and not limitative. The bus 700 may be divided into an address bus, a data bus, a control bus, etc., and is represented by only one thick line in fig. 7 for convenience of representation, but does not represent only one bus or one type of bus. The process processing means further comprise a communication interface 703 for receiving or transmitting data.
In the embodiment of the present invention, the memory 702 stores instructions executable by the at least one processor 701, and the at least one processor 701 can execute the steps included in the foregoing process processing method by executing the instructions stored in the memory 702.
The processor 701 is a control center of the electronic device, and may use various interfaces and lines to connect various parts of the entire electronic device, and by executing or executing instructions stored in the memory 702 and invoking data stored in the memory 702, various functions of the electronic device and process the data, thereby performing overall monitoring on the electronic device.
Alternatively, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, wherein the application processor primarily processes an operating system, a user interface, and application programs, etc., and the modem processor primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 701. In some embodiments, processor 701 and memory 702 may be implemented on the same chip, or they may be implemented separately on separate chips in some embodiments.
The processor 701 may be a general purpose processor such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, and may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the invention. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 702 may include at least one type of storage medium, and may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory), magnetic Memory, magnetic disk, optical disk, and the like. Memory 702 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 702 in embodiments of the present invention may also be circuitry or any other device capable of performing storage functions for storing program instructions and/or data.
The code corresponding to the process processing method described in the foregoing embodiment may be cured into the chip by programming the processor 701, so that the chip can execute the steps of the foregoing process processing method when running, and how to program the processor 701 into the design is a technology known to those skilled in the art will not be repeated here.
Based on the same inventive concept, embodiments of the present invention also provide a storage medium storing computer instructions that, when run on a computer, cause the computer to perform the steps of the process processing method as described above.
In some possible embodiments, aspects of the process-handling method provided by the invention may also be implemented in the form of a program product comprising program code for causing a control electronic device to carry out the steps of the process-handling method according to the various exemplary embodiments of the invention as described in the specification, when said program product is run on the control electronic device.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. A process handling method, the method comprising:
determining unique identifiers respectively corresponding to at least two processes running in the electronic equipment at the first moment; the unique identifier is used for screening a priority set corresponding to the process from the database;
determining current scene phases corresponding to each process in the at least two processes respectively, wherein the current scene phases are any one of a starting phase, a service processing phase, a configuration phase, an idle phase and a closing phase;
According to the determined unique identification and the current scene stage, respectively acquiring the current priorities corresponding to the processes from the priority sets corresponding to the database;
and executing the at least two processes according to the preset process management rule and the sequence from the high priority to the low priority.
2. The method of claim 1, wherein respectively obtaining the current priorities of the respective processes from the corresponding priority sets in the database according to the determined unique identifier and the current scene stage, comprises:
for the unique identification and scene stage corresponding to each process, the following operations are respectively executed:
searching a target priority set matched with the unique identifier from the database according to the unique identifier of the process; the target priority set comprises priorities respectively corresponding to at least one scene stage corresponding to the process;
and searching the priority matched with the current scene stage in the target priority set, and taking the obtained matched priority as the current priority of the process.
3. The method according to claim 1 or 2, wherein before determining the unique identifiers respectively corresponding to at least two processes running in the electronic device at the first moment, the method further comprises:
Determining the corresponding relation between each scene stage corresponding to a first process and the stage weight, and determining the stage weight corresponding to each scene stage according to the corresponding relation; the first process is any process which can be operated by the electronic equipment;
determining a system weight corresponding to the first process, and determining a target weight corresponding to each scene stage corresponding to the first process according to the system weight and each stage weight; the system weight is used for representing the importance degree of the first process when the corresponding function in the electronic equipment runs; the target weight is used for representing the importance degree of the scene stage in the first process;
and respectively determining priorities corresponding to the scene stages corresponding to the first process according to the target weights corresponding to the scene stages and preset priority rules.
4. A method as claimed in claim 3, wherein the method further comprises:
and respectively storing the priorities corresponding to the first process in the at least one scene stage and the unique identifiers corresponding to the first process in a database in a correlated manner.
5. A process-handling device, the device comprising:
The first determining unit is used for determining unique identifiers corresponding to at least two processes running in the electronic equipment at the first moment respectively; the unique identifier is used for screening a priority set corresponding to the process from the database;
the second determining unit is used for determining current scene phases corresponding to each process in the at least two processes respectively, wherein the current scene phases are any one of a starting phase, a service processing phase, a configuration phase, an idle phase and a closing phase;
the obtaining unit is used for respectively obtaining the current priorities corresponding to the processes from the priority sets corresponding to the database according to the determined unique identifier and the current scene stage;
and the processing unit is used for executing the at least two processes according to the preset process management rule and the sequence from the high priority to the low priority.
6. The apparatus of claim 5, wherein the acquisition unit is configured to
For the unique identification and scene stage corresponding to each process, the following operations are respectively executed:
searching a target priority set matched with the unique identifier from the database according to the unique identifier of the process; the target priority set comprises priorities respectively corresponding to at least one scene stage corresponding to the process;
And searching the priority matched with the current scene stage in the target priority set, and taking the obtained matched priority as the current priority of the process.
7. The apparatus according to claim 5 or 6, further comprising a third determining unit for:
determining the corresponding relation between each scene stage corresponding to a first process and the stage weight, and determining the stage weight corresponding to each scene stage according to the corresponding relation; the first process is any process which can be operated by the electronic equipment;
determining a system weight corresponding to the first process, and determining a target weight corresponding to each scene stage corresponding to the first process according to the system weight and each stage weight; the system weight is used for representing the importance degree of the first process when the corresponding function in the electronic equipment runs; the target weight is used for representing the importance degree of the scene stage in the first process;
and respectively determining priorities corresponding to the scene stages corresponding to the first process according to the target weights corresponding to the scene stages and preset priority rules.
8. The apparatus of claim 7, wherein the apparatus further comprises a storage unit to:
and respectively storing the priorities corresponding to the first process in the at least one scene stage and the unique identifiers corresponding to the first process in a database in a correlated manner.
9. An electronic device, the electronic device comprising: memory, a processor and a computer program stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the process processing method according to any one of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which when being executed by a processor implements the steps of the process-handling method according to any of claims 1 to 4.
CN202211735219.7A 2022-12-30 2022-12-30 Process processing method and device Pending CN116028179A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211735219.7A CN116028179A (en) 2022-12-30 2022-12-30 Process processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211735219.7A CN116028179A (en) 2022-12-30 2022-12-30 Process processing method and device

Publications (1)

Publication Number Publication Date
CN116028179A true CN116028179A (en) 2023-04-28

Family

ID=86075479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211735219.7A Pending CN116028179A (en) 2022-12-30 2022-12-30 Process processing method and device

Country Status (1)

Country Link
CN (1) CN116028179A (en)

Similar Documents

Publication Publication Date Title
CN108958796B (en) Service request processing method and device and service request processing system
US10949237B2 (en) Operating system customization in an on-demand network code execution system
US11146502B2 (en) Method and apparatus for allocating resource
CN109491801B (en) Micro-service access scheduling method, micro-service access scheduling device, medium and electronic equipment
US20240111549A1 (en) Method and apparatus for constructing android running environment
CN111126895A (en) Management warehouse and scheduling method for scheduling intelligent analysis algorithm in complex scene
CN110888658B (en) Method and device for dynamically changing function modules in application program and storage medium
CN104699537A (en) Program control method, activity module scheduling method and corresponding devices thereof
CN112463290A (en) Method, system, apparatus and storage medium for dynamically adjusting the number of computing containers
US11144359B1 (en) Managing sandbox reuse in an on-demand code execution system
CN113779060A (en) Data query method and device
CN108132807B (en) Parameter loading method and device
CN112529711B (en) Transaction processing method and device based on block chain virtual machine multiplexing
CN110688223B (en) Data processing method and related product
CN111400051A (en) Resource scheduling method, device and system
CN109614242B (en) Computing capacity sharing method, device, equipment and medium
CN108829516B (en) Resource virtualization scheduling method for graphic processor
CN116028179A (en) Process processing method and device
CN112328598B (en) ID generation method, ID generation device, electronic equipment and storage medium
CN116032614A (en) Container network micro-isolation method, device, equipment and medium
CN114756362A (en) Resource quota management method and system, intelligent terminal and storage medium
CN112114959B (en) Resource scheduling method, distributed system, computer device and storage medium
CN114584625B (en) Message processing method and device, electronic equipment and storage medium
US20230195527A1 (en) Workload distribution by utilizing unused central processing unit capacity in a distributed computing system
CN114826919B (en) SDN-based load balancing software nanotube method, device, equipment and 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