Process execution method and device, electronic equipment and readable storage medium

By obtaining the priority of the process chain and determining the execution order based on preset information, the problem of inaccurate process priority setting is solved, and more efficient and timely process execution is achieved.

CN115168010BActive Publication Date: 2026-01-16GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210878208.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-25
Publication Date
2026-01-16
Estimated Expiration
2042-07-25

AI Technical Summary

Technical Problem

In existing technologies, process priority settings are not accurate enough, resulting in insufficient timeliness and efficiency in process scheduling.

Method used

By obtaining the priority of the process chain, which is generated by at least two processes and their interaction relationship, and pre-set information including user operation information and interaction relationship strength, the execution order of each process chain is determined and executed directly.

Benefits of technology

It improves the accuracy and timeliness of process execution, reduces user waiting time, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115168010B_ABST
    Figure CN115168010B_ABST
Patent Text Reader

Abstract

The application discloses a process execution method and device, electronic equipment and a readable storage medium, comprising: obtaining the priority of each process link, wherein each process link is generated by at least two processes corresponding to the process link and the interaction relationship between the processes, the priority of the process link is set based on preset information corresponding to the process link, wherein the preset information includes at least one of user operation information of each process and the interaction relationship strength between two processes with the interaction relationship; determining the execution order of each process link based on the priority of each process link; and executing each process link based on the execution order of each process link. The accuracy of obtaining the priority of the process link can be improved, the efficiency of executing multiple process links can be improved, and the user experience can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of information technology, and more particularly, to a process execution method and device, an electronic device, and a readable storage medium. BACKGROUND

[0002] At present, with the rapid development of electronic information technology, electronic devices can execute more and more processes. Although different priorities can be set for different processes, and the processes are scheduled based on the priorities. However, the current method for setting process priorities is not accurate enough. SUMMARY

[0003] The present application provides a process execution method and device, an electronic device, and a readable storage medium to improve the above-mentioned defects.

[0004] In a first aspect, the present application provides a process execution method, comprising: obtaining a priority of each process link, wherein each process link is generated by at least two processes corresponding to the process link and an interaction relationship between the processes, and the priority of the process link is set based on preset information corresponding to the process link, wherein the preset information includes at least one of user operation information of each process and an interaction relationship strength between two processes having an interaction relationship; determining an execution order of each process link based on the priority of each process link; and executing each process link based on the execution order of each process link.

[0005] In a second aspect, the present application also provides a process execution device, comprising: an obtaining unit configured to obtain a priority of each process link, wherein each process link is generated by at least two processes corresponding to the process link and an interaction relationship between the processes, and the priority of the process link is set based on preset information corresponding to the process link, wherein the preset information includes at least one of user operation information of each process and an interaction relationship strength between two processes having an interaction relationship; a determining unit configured to determine an execution order of each process link based on the priority of each process link; and an executing unit configured to execute each process link based on the execution order of each process link.

[0006] In a third aspect, the present application also provides an electronic device, comprising: one or more processors; a memory; and one or more application programs stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to execute the method of the first aspect.

[0007] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, in which a program code is stored, and the program code can be invoked by a processor to execute the method in the first aspect.

[0008] In a fifth aspect, the embodiments of the present application further provide a computer program product, comprising computer programs / instructions, which, when executed by a processor, implement the method described above.

[0009] The process execution method and device, the electronic device, and the readable storage medium provided by the present application first acquire the priority of each process link, then determine the execution order of each process link based on the priority of each process link, and finally execute each process link based on the execution order of each process link. When setting the priority of the process link, the wider the information associated with the process link, the more accurate the acquired priority will be. In the present application, the priority of the process link is set based on the preset information corresponding to the process link, and the preset information includes at least one of the user operation information of each process and the interaction strength between two processes having an interaction relationship, that is, the preset information is wide, and it can be known that the priority of the process link acquired has high accuracy. Furthermore, based on the execution order of the process link acquired based on the priority with high accuracy, each process link is executed, which can improve the efficiency when multiple process links are executed, thereby reducing the user waiting time and improving the user experience. Furthermore, in the traditional method of determining the priority of multiple processes, after the priority of the process is determined, the process corresponding to the priority needs to be executed again after the next scheduling period, which is not timely. The present application executes at least two processes in the process link, and after the priority is determined, each process in the process link can be executed in sequence, without waiting for the next scheduling period, and therefore has good timeliness. Other features and advantages of the embodiments of the present application will be described in the following description, and some of them will become apparent from the description, or will be understood by those skilled in the art through implementation of the embodiments of the present application. The purpose and other advantages of the embodiments of the present application can be achieved and obtained through the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0011] Figure 1 A structural diagram of an electronic device provided by the embodiments of the present application is shown;

[0012] Figure 2 A method flow chart of a process execution method provided by an embodiment of the present application is shown;

[0013] Figure 3 A schematic diagram of a process link provided by an embodiment of the present application is shown;

[0014] Figure 4 A schematic diagram of a process link provided by another embodiment of the present application is shown;

[0015] Figure 5 A schematic diagram of a graph structure provided by an embodiment of the present application is shown;

[0016] Figure 6 A method flow chart of a process execution method provided by another embodiment of the present application is shown;

[0017] Figure 7 An implementation diagram of step S220 is shown;

[0018] Figure 8 An implementation diagram of step S221 is shown;

[0019] Figure 9 A schematic diagram of a display interface provided by an embodiment of the present application is shown;

[0020] Figure 10 Another implementation diagram of step S220 is shown;

[0021] Figure 11 Still another implementation diagram of step S220 is shown;

[0022] Figure 12 A schematic diagram of a process execution method provided by an embodiment of the present application is shown;

[0023] Figure 13 A structural block diagram of a process execution apparatus provided by an embodiment of the present application is shown;

[0024] Figure 14 A structural block diagram of a computer readable storage medium provided by an embodiment of the present application is shown;

[0025] Figure 15 A structural block diagram of a computer program product provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] In order to better understand the present application by those skilled in the art, the following will be combined with the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only part of the embodiments of the present application, not all. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0027] It should be noted that: similar signs and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of the present application, the terms "first", "second" and the like are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

[0028] At present, with the rapid development of electronic information technology, electronic devices can perform more and more processes. Although different priorities can be set for different processes, and the processes can be scheduled based on the priorities. However, the current method of setting process priority is not accurate enough. How to set the priority of the process more accurately is a problem to be solved.

[0029] At present, the system program running on the electronic device generally sets different priorities for different types of processes, and then preferentially selects the processes with high priority for scheduling and execution. An exemplary, the system program allocates a higher priority to the process currently in the foreground, and a lower priority to the process not currently in the foreground. Another exemplary, the system program can also pre-set some key types, for example, set the interface refresh type process and the audio type process as key types, when the type of the process belongs to the key type, a higher priority can be allocated, when the type of the process does not belong to the key type, a lower priority can be allocated. Another exemplary, the process can also obtain a higher priority through a priority request.

[0030] However, the inventors have found in research that the above-mentioned priority setting method has low accuracy. For example, if there are processes A, B and C, process A calls a remote procedure call (RPC) service to process B, and process B is waiting for process C to release a lock, and process C is waiting to be scheduled by a CPU for execution. At this time, there is a complex chain relationship between processes A, B and C, and the above-mentioned method cannot obtain an accurate priority. Further, the inventors have found that the above-mentioned priority setting method has low timeliness in obtaining the priority. For example, if there are processes A and B, when process A depends on the response of process B to execute, the priority needs to be set and the next scheduling period needs to arrive to respond to the scheduling request.

[0031] Therefore, in order to overcome the above-mentioned defects, the present application provides a process execution method and device, an electronic device and a readable storage medium.

[0032] Please refer to Figure 1 , Figure 1 A structural diagram of an electronic device 100 provided by an embodiment of the present application is shown, wherein the electronic device 100 comprises a processor 110 and a memory 120.

[0033] For some embodiments, the memory 120 can store a system program corresponding to the electronic device 100, for example, if the electronic device 100 is a smartphone, the memory 120 can store a phone system program; if the electronic device 100 is a notebook computer or a desktop computer, the memory 120 can store a computer system program. The electronic device 100 can run the system program stored in the memory 120. The memory 120 can also store different application programs, wherein the application programs can run in the system program running on the electronic device 100. The application programs can include at least one process. Further, the processes can have different types, and different types of processes can correspond to different functions, for example, a display refresh type process can be used to refresh a display interface; a data request type process can be used to request data.

[0034] The memory 120 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM.

[0035] Further, the processor 110 can be configured to execute the system programs stored in the memory 120, so that the electronic device 100 can run the system programs; the processor 110 can also execute the application programs stored in the memory 120. When the processor 110 executes a plurality of application programs, the plurality of application programs can correspond to a plurality of processes, and the processes can have an interaction relationship. At least two processes can constitute a process link, and thus for a plurality of processes, there can be a plurality of process links. Therefore, when the processor 110 executes a plurality of process links, the processor 110 can obtain the priority of each process link, and determine the execution order of each process link based on the priority of each process link. For the specific method, please refer to the introduction of the subsequent embodiments.

[0036] The processor 110 can include one or more processing cores. The processor 110 can connect various parts in the entire electronic device 100 by using various interfaces and lines, obtain the priority of the process link, determine the execution order of the process link, and then execute each process link according to the execution order. Alternatively, the processor 110 can be implemented in at least one hardware form of a microcontroller unit (MCU), a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA).

[0037] Please refer to Figure 2 , Figure 2 A process execution method provided by an embodiment of the present application is shown, which can be applied to the electronic device 100 in the foregoing embodiments, and specifically, the processor 110 in the electronic device 100 can be the main body for executing the process execution method. Specifically, the method includes steps S110 to S130.

[0038] Step S110: obtaining the priority of each process link, wherein each process link is generated by at least two processes corresponding to the process link and the interaction relationship between the processes, and the priority of the process link is set based on preset information corresponding to the process link, wherein the preset information includes at least one of user operation information of each process and interaction relationship strength between two processes having an interaction relationship.

[0039] As described above, when an electronic device is running, multiple processes may be running simultaneously. These processes may interact with each other. For example, there may be processes A, B, and C. Process A calls a Remote Procedure Call (RPC) service to process B, while process B waits for process C to release a lock, and process C waits to be scheduled and executed by the CPU. In this case, there is an interaction between processes A, B, and C.

[0040] Furthermore, at least two processes can form a process chain, where each process can be considered a node, and nodes with interactive relationships can have edge relationships. This process chain can include at least two processes and the interactive relationships between each process within the chain. The interactive relationships between processes can manifest as a calling relationship; for example, if process A and process B have an interactive relationship, it could mean that process A needs to call process B, process B needs to call process A, or process A and process B can call each other. Specifically, the edges between nodes can be directional, representing the calling relationship between the processes corresponding to the nodes. Specifically, the direction of the edge between two nodes is from the caller to the receiver. For example, if there is an edge between the first node and the second node pointing from the first node to the second node, it can represent that the process corresponding to the first node has a calling relationship with the process corresponding to the second node. For example, if node A initiates a data request to node B, then node A is the caller and node B is the receiver; therefore, the edge between node A and node B can be from node A to node B. Optionally, a node can act as both a caller and a call receiver. For example, nodes A and B can call each other, meaning that both nodes A and B are both callers and receivers. In this case, the edge between nodes A and B can point from node A to node B, and vice versa.

[0041] For an example, please refer to Figure 3 , Figure 3 A schematic diagram of a process chain is shown. Figure 3 The network includes nodes A, B, and C. If node A needs to call node B, and node B needs to call node C, then in the node link formed by nodes A, B, and C, there can be an edge between node A and node B pointing from node A to node B, and there can be an edge between node B and node C pointing from node B to node C.

[0042] Another example, see Figure 4 , Figure 4 A schematic diagram of another node link is shown. Figure 4The node link includes the node A, the node B and the node C. If the node A and the node B call each other, the node A and the node C call each other, and the node B needs to call the node C, in the node link composed of the node A, the node B and the node C, the node A and the node B can exist an edge from the node A to the node B and an edge from the node B to the node A, the node A and the node C can exist an edge from the node A to the node C and an edge from the node C to the node A, and the node C and the node B can exist an edge from the node B to the node C.

[0043] Further, the node link can also be multiple, and multiple node links can be built into a graph structure, and each node in the graph structure can correspond to a process. An example is shown in Figure 5 , Figure 5 A schematic diagram of a graph structure composed of multiple node links is shown. Specifically, Figure 5 The node link includes the node A, the node B, the node C, the node D and the node E. Among them, the node A needs to call the node B, the node B and the node C call each other, the node B also calls the node D, and the node B also needs to call the node E. Therefore, it can be known that Figure 5 The node link includes the node A, the node B and the node C. If the node A and the node B call each other, the node A and the node C call each other, and the node B needs to call the node C, in the node link composed of the node A, the node B and the node C, the node A and the node B can exist an edge from the node A to the node B and an edge from the node B to the node A, the node A and the node C can exist an edge from the node A to the node C and an edge from the node C to the node A, and the node C and the node B can exist an edge from the node B to the node C.

[0044] For some embodiments, the priority of the process link can be used to represent the importance of the process link, and the process link with higher importance generally needs to be executed first, that is, the priority of the process link is proportional to the importance of the process link. Further, for multiple process links, the priority of each process link can be obtained, and the corresponding process link is executed from high to low according to the priority, that is, the process in the process link with the highest importance can be executed first in multiple process links.

[0045] Specifically, the priority of the process link can be set based on the preset information corresponding to the process link. The preset information can include specific information of multiple processes corresponding to the process link. It is easy to understand that the process link can include at least two processes, and therefore the priority of the process link can be determined by synthesizing each process included in the process link.

[0046] Since the priority of the process link can be used to represent the importance of the process link, the weight value corresponding to each process can be determined by determining the importance of each process in the process link, that is, the priority of the process link can be determined. The weight value is positively correlated with the priority.

[0047] For some embodiments, the weight value of each process in the process chain can be related to the interaction strength between the processes. The interaction strength can be used to represent the strength of the interaction between the processes. The stronger the interaction between the processes, the greater the interaction strength. The weaker the interaction between the processes, the smaller the interaction strength. The interaction strength is related to the weight value of the process, so the stronger the interaction strength between the processes, the greater the weight value of the process. The weaker the interaction strength between the processes, the smaller the weight value of the process, i.e., the interaction strength and the weight value are positively correlated.

[0048] Further, the above-mentioned interaction strength can be determined by the interaction information between different processes. Since the communication types between processes with different interaction strengths are different, and the importance of processes corresponding to different communication types is different, i.e., the weight value of the process can be set based on the communication type. Therefore, the interaction information can include the communication type. The communication type can be used to represent the way of communication between different processes. For example, process A and process B can communicate through data acquisition instructions, such as process A sending data acquisition instructions to process B, and process B sending corresponding data to process A after receiving the data acquisition instructions. For another example, process A and process B can also communicate through shared memory, i.e., there is a shared memory X, and process A and process B can read or write data in the shared memory X. It is not difficult to conclude that the importance of the above-mentioned communication between process A and process B through data acquisition instructions is lower than that of the communication through shared memory. Therefore, a higher weight value can be set for the process that communicates through shared memory, and a lower weight value can be set for the process that communicates through data acquisition instructions.

[0049] Optionally, there is interaction between processes, and the interaction frequency between different processes can be different, where the interaction frequency can be used to represent the number of interactions within a specified time period. For example, some processes can only have a small number of interactions within a specified time period, such as 1, while other processes can have a large number of interactions within a specified time period, such as 10. It is not difficult to understand that the process with a large number of interactions within a specified time period is relatively important. Therefore, for other embodiments, the interaction information can also include the interaction frequency. A higher weight value can be set for the process with a higher interaction frequency, and a lower weight value can be set for the process with a lower interaction frequency.

[0050] Optionally, the interaction strength between the processes can also be determined by the degree of interdependence between the processes. The degree of interdependence can be used to represent the degree of interdependence between at least two processes. The higher the degree of interdependence, the more important the process is, and a larger weight value can be set for the process. The lower the degree of interdependence, the less important the process is, and a smaller weight value can be set for the process.

[0051] From the above analysis, it can be seen that the interaction information includes at least one of the communication type, the interaction frequency, and the degree of interdependence, and the priority of the process link can be determined by the interaction information.

[0052] For other embodiments, the weight value of each process in the process link can also be related to the user operation information corresponding to the process. In an exemplary embodiment, the user operation information can include focus information, which can represent whether the application corresponding to the process is the application on which the user focuses. For example, the process link includes process A and process B, and the application A corresponds to process A, and the application B corresponds to process B. At this time, the user focus is on the application A, and the application A can be included in the focus information, and a higher weight value can be set for the process A corresponding to the application A. The application B is not included in the focus information, and a lower weight value can be set for the process B corresponding to the application B.

[0053] In another exemplary embodiment, the user operation information can also include interaction frequency information, which is used to represent the frequency of interaction between the user and the application corresponding to a process. It is easy to understand that the higher the frequency of interaction between the user and the application, the more important the process corresponding to the application is, i.e., a higher weight value can be set for the process, and the priority is higher. Therefore, the interaction frequency information is positively correlated with the priority of the process. For example, the process link includes process A and process B, and the application A corresponds to process A, and the application B corresponds to process B. The number of times of interaction between the user and the application A and the application B within a specified time period can be obtained, for example, the specified time period is 1 min, the user interacts with the application A for 5 times and with the application B for 1 time within 1 min, and the importance of process A is greater than that of process B, so the weight value corresponding to process A can be set to be higher than that of process B.

[0054] In another exemplary embodiment, the user operation information can also include window information, which is used to represent whether the application corresponding to a process is presented in the display module of the electronic device, such as the display screen. It is easy to understand that if the application is presented in the display module of the electronic device, the process corresponding to the application is more important, and a higher weight value can be set for the process. If the application is not presented in the display module of the electronic device, a lower weight value can be set for the process.

[0055] Furthermore, as the above analysis shows, user operation information can include focus information, interaction frequency information, and window information. The priority of the process chain can be determined through each type of user operation information. Specific methods can be found in subsequent embodiments.

[0056] Step S120: Determine the execution order of each process link based on the priority of each process link.

[0057] In some implementations, the graph structure formed by the various process links can be traversed to obtain each process link corresponding to the graph structure, as well as the processes included in each process link.

[0058] Specifically, the graph structure can be represented by two-dimensional vectors, where each node in the graph corresponds to a process that can be uniquely identified by the two-dimensional vector. By traversing the graph structure, each process link in the graph structure can be obtained. Storing each traversed process link as a one-dimensional vector yields a one-dimensional vector group composed of multiple one-dimensional vectors. Optionally, the one-dimensional vector can also include the priority of each process link, which can be used to determine the execution order of the process links. For example, the execution order of the process links can be determined by sorting them in descending order of priority.

[0059] One example, please continue reading Figure 5 ,by Figure 5 For example, we can Figure 5 Starting with process A, the process visits process A, then visits the node connected to A, i.e., process B. Further, it visits one of the nodes connected to process B, i.e., one from processes C, D, and E. And... Figure 5 In the graph structure shown, processes C, D, and E can be considered to have a sequential order, so process C can be visited first. At this point, process C is not connected to the next node, so the process chain from process A through process B to process C has been determined. We can then return to process A as the starting point and visit the node connected to process A, i.e., process B. Among the multiple nodes connected to process B, processes D and E are unvisited, so process D can be visited first. At this point, process D is not connected to the next node, so the process chain from process A through process B to process C has been determined. We can then return to process A as the starting point and, using a similar method, determine the process chain from process A through process B to process E. Therefore, based on... Figure 5The shown graph structure example can be traversed to obtain a first one-dimensional vector including a process link composed of process A, process B, and process C; a second one-dimensional vector including a process link composed of process A, process B, and process D; and a third one-dimensional vector including a process link composed of process A, process B, and process D.

[0060] Further, the priority of each process link obtained in the foregoing step can be merged into a one-dimensional vector corresponding to each process link as a feature vector, for example, as the first vector of the one-dimensional vector corresponding to each process link. The feature vector corresponding to the priority can be represented by a natural number. The higher the priority, the larger the corresponding natural number, that is, the priority and the natural number can be positively correlated. Then, the sorting of each one-dimensional vector can be determined by sorting the first vectors in the plurality of one-dimensional vectors from large to small, that is, the sorting of each process link is determined, which is the execution order of the plurality of process links.

[0061] Step S130: executing each process link based on the execution order of each process link.

[0062] Through the above steps, the execution order of each process link can be determined, and the corresponding process link can be directly executed based on the execution order.

[0063] Further, the plurality of processes in the above one-dimensional vector can also include a weight value corresponding to each node, that is, a weight value representing the process corresponding to each node, which can be used to represent the importance of the process. Therefore, when executing a process link, the process corresponding to the node with a high weight value can be preferentially executed according to the weight value corresponding to each node in the process link. For example, for the first one-dimensional vector obtained in the example, if the weight value of process A is 90, the weight value of process B is 40, and the weight value of process C is 60, the sorting according to the weight value can be process A first, process C second, and process B last. Therefore, when executing the process link corresponding to the first one-dimensional vector, process A can be executed first, process C can be executed second, and process B can be executed last, and each process in the process link can be executed in turn without waiting for the next scheduling period, thus having good timeliness. Figure 5

[0064] Further, after the execution of a process link is completed, the next process link can be executed, and each process link obtained by traversal can be executed.

[0065] ​The process execution method and device, the electronic device, and the readable storage medium provided in the application first acquire the priority of each process link, then determine the execution order of each process link based on the priority of each process link, and then execute each process link based on the execution order of each process link. When the priority of a process link is set, the more information associated with the process link is considered, and the more accurate the acquired priority is. In the application, the priority of a process link is set based on preset information corresponding to the process link, and the preset information includes at least one of user operation information of each process and interaction strength between two processes having an interaction relationship, that is, the preset information is wide, and it can be known that the acquired priority of the process link has high accuracy. Furthermore, the execution order of the process link acquired based on the priority with high accuracy is used to execute each process link, which can improve the efficiency when multiple process links are executed, thereby reducing the user waiting time and improving the user experience. Furthermore, in the traditional method for determining the priority of multiple processes, after the priority of a process is determined, the process corresponding to the priority needs to be executed again after the next scheduling period, which is not timely. The application executes at least two processes in a process link, and after the priority is determined, each process in the process link can be executed in sequence without waiting for the next scheduling period, and therefore has good timeliness.

[0066] Please refer to Figure 6 , Figure 6 A process execution method provided in an embodiment of the application is shown, which can be applied to the electronic device 100 in the foregoing embodiments, and specifically, the processor 110 in the electronic device 100 can be the main body for executing the process execution method. Specifically, the method includes steps S210 to S250.

[0067] Step S210: multiple process links are constructed into a graph structure, where each node in the graph structure corresponds to a process, and the edge between any two nodes is used to represent the interaction relationship between the processes corresponding to the two nodes.

[0068] Step S220: the weight value of at least part of the nodes in the graph structure is set based on the preset information.

[0069] For some embodiments, multiple process links can be constructed into a graph structure, where each node in the graph structure corresponds to a process, and the edge between any two nodes is used to represent the interaction relationship between the processes corresponding to the two nodes. Specifically, the nodes in the process link and the edges between the nodes are similar to those described in the foregoing embodiments, and will not be described here.

[0070] Further, the method of constructing the process link into a graph structure can be to combine multiple process links to construct a graph structure, or to extract the nodes in each process link of the process and then regenerate a graph structure including multiple nodes and the interaction relationship between the nodes. The embodiment is not limited.

[0071] Further, the nodes in the graph structure can have weight values, and the priority of the process link can be obtained by setting the weight values of the nodes. The weight values and the priority are in a positive correlation.

[0072] For some embodiments, the preset information can include user operation information of each process. Optionally, refer to Figure 7 , Figure 7 An embodiment of step S220 is shown, specifically including step S221 and step S222.

[0073] Step S221: determining the user interaction degree of each node based on the user operation information of the process corresponding to each node in the graph structure.

[0074] Step S222: setting the weight value of the node based on the user interaction degree of the node, wherein the user interaction degree and the weight value are in a positive correlation.

[0075] Since the process corresponds to the application program, and the object of the user operation is generally the application program, the user operation information of the process includes the user operation information of the application program corresponding to the process.

[0076] The user operation information of the process can be determined based on the relationship between the user and the application program corresponding to the process. Specifically, refer to Figure 8 , Figure 8 An embodiment of step S221 is shown, including step S2211 and step S2212.

[0077] Step S2211: searching for a first type application, a second type application and a third type application in the application programs corresponding to each node in the graph structure based on the user operation information of the process corresponding to each node, wherein the first type application is an application where the user focus is located, the second type application is an application where the user focus is not located but there is interaction with the user, and the third type application is an application where there is no interaction with the user.

[0078] Step S2212: setting the user interaction degree of the nodes corresponding to the first type application, the second type application and the third type application, respectively, wherein the user interaction degrees of the first type application, the second type application and the third type application decrease in turn.

[0079] It is easy to understand that there can be multiple processes corresponding to the application programs interacting with the user, among which, part of the application programs can be the objects of the user's current operation, such as inputting instructions to the application program, or gazing at the content displayed by the application program, and so on; another part of the application programs can be the application programs associated with the application program of the user's current operation; and still another part of the application programs can neither be operated by the user nor be associated with the application program operated by the user. At this time, for the nodes corresponding to the above-mentioned application programs, different user interaction procedures can be set.

[0080] Specifically, through the above analysis, it can be known that the application programs can include first type application programs, second type application programs and third type application programs, the first type application programs are the application programs where the user's focus is located, the second type application programs are the application programs where the user's focus is not located but there is interaction with the user, and the third type application programs are the application programs which are not interacted with the user, wherein the application program where the user's focus is located can be the application program operated by the user.

[0081] An example is shown in Figure 9 , Figure 9 A display interface 130 of an electronic device 100 is shown, wherein the first application program 131, the second application program 132 and the third application program 133 are displayed in the display interface 130. Among them, the first application program 131 is not interacted with the user, the second application program 132 is the application program where the user's focus is not located but there is interaction with the user, and the third application program 133 is the application program where the user's focus is located. Therefore, it can be known that the first application program 131 belongs to the third type application program, the second application program 132 belongs to the second type application program, and the third application program 133 belongs to the first type application program.

[0082] Further, the type of the application program of each node in the graph structure can be determined, and then the user interaction degree of each node is set based on the type, wherein the user interaction degrees of the first type application programs, the second type application programs and the third type application programs decrease in turn, and the user interaction degree is positively correlated with the weight value of the node. Therefore, after determining the type of the application program of each node, the weight value of the node can also be set. For example, a higher weight value can be set for the node corresponding to the first type application program, a median weight value can be set for the node corresponding to the second type application program, and a smaller weight value can be set for the node corresponding to the third type application program.

[0083] For other embodiments, the starting point included in the graph structure can also be determined, and the starting point is also a node. Generally, the importance of the starting point in the graph structure is higher, and the weight value corresponding to the starting point should also be higher. Therefore, when determining the user interaction degree of each node in the graph structure, the starting point can also be excluded, and the user interaction degree of each node is determined based on the user operation information corresponding to the process of each node except the starting point in the graph structure.

[0084] For some embodiments, the preset information can include the interaction strength between two processes with interaction relationship, please refer to Figure 10 , Figure 10 An embodiment of step S220 is shown, which specifically includes step S223.

[0085] Step S223: setting the weight value between two nodes based on the interaction strength between the two nodes on each edge in the graph structure, wherein the interaction strength is positively correlated with the weight value.

[0086] For some embodiments, the interaction strength between node processes can also affect the importance of the processes, so the weight value between corresponding nodes can be set based on the interaction strength between processes. Since the interaction strength is also related to the weight value of the process, the stronger the interaction strength between processes, the greater the weight value of the process; the weaker the interaction strength between processes, the smaller the weight value of the process, that is, the interaction strength is positively correlated with the weight value.

[0087] Optionally, the interaction strength between processes can be determined in advance based on the interaction information between the two processes, and as known from the foregoing embodiments, the interaction information includes at least one of the communication type, the interaction frequency, and the mutual dependence degree. Therefore, an initial weight value, for example, 0, can be set for each node. Then the interaction information of each node is obtained, and the weight value of each node is adjusted based on the interaction information.

[0088] An exemplary, if the interaction information includes the communication type, the weight value of the node is adjusted based on the communication type corresponding to the node. Specifically, the processes A and B shown in the foregoing embodiments, the process A and the process B communicate through data acquisition instructions, which is less important than the communication through shared memory. Therefore, the process that communicates through shared memory can be increased by a larger weight value, for example, 20, to obtain the updated weight value through the communication type. And the process that communicates through data acquisition instructions is increased by a smaller weight value, for example, 3, to obtain the updated weight value through the communication type.

[0089] Another example, the interaction information can also include interaction frequency, and the weight value of the node can be adjusted based on the interaction frequency corresponding to the node. Specifically, if process A has a higher interaction frequency, i.e., a higher number of interactions occurs within a specified time period, a larger weight value, e.g., 20, can be added to the weight value of the node corresponding to process A to obtain the weight value updated by the interaction frequency. If process A has a lower interaction frequency, i.e., a lower number of interactions occurs within a specified time period, a smaller weight value, e.g., 3, can be added to the weight value of the node corresponding to process A to obtain the weight value updated by the interaction frequency.

[0090] Another example, the interaction information can also include interaction frequency, and the weight value of the node can be adjusted based on the interaction frequency corresponding to the node. Specifically, if process A has a higher interaction frequency, i.e., a higher number of interactions occurs within a specified time period, a larger weight value, e.g., 20, can be added to the weight value of the node corresponding to process A to obtain the weight value updated by the interaction frequency. If process A has a lower interaction frequency, i.e., a lower number of interactions occurs within a specified time period, a smaller weight value, e.g., 3, can be added to the weight value of the node corresponding to process A to obtain the weight value updated by the interaction frequency.

[0091] It should be noted that some processes can only include one or two types of interaction information, and the weight value of the process can be updated only by the interaction information included in the process.

[0092] For some embodiments, the preset information can also include the type of the starting process, please refer to Figure 11 , Figure 11 An embodiment of step S220 is shown, which specifically includes step S224 and step S225.

[0093] Step S224: determining the service type of the system critical service process corresponding to each starting point in the graph structure.

[0094] Step S225: setting the weight value of the starting point based on the service type of the starting point.

[0095] It is easy to understand that the process corresponding to the starting point in the process link is relatively important in the process link. Therefore, the priority of the process corresponding to the starting point in the process link can have a great influence on the priority of the process link. Therefore, the preset information can include the type of the starting point in the process link, i.e., the service type of the critical service process corresponding to the starting point, so that the weight value of the starting point can be set by the service type.

[0096] For some embodiments, the at least two processes constituting a link can include a starting point, and the system critical service process can be used as the starting point in the process link, since the process corresponding to the starting point is a more important process among the multiple processes in the process link. Further, as known from the foregoing analysis, different processes can have different types, and thus it is known that the system critical service process can also include multiple service types, such as a system critical service process of service type A and a system critical service process of service type B.

[0097] Further, the system critical service processes of different service types can have different importance levels. Therefore, different weight values can be assigned to the system critical service processes of different service types to represent the different importance levels of the system critical service processes of different service types. For example, the system critical service process of service type A can be assigned a weight value A1, and the system critical service process of service type B can be assigned a weight value B1. If the system critical service process of service type A is more important than the system critical service process of service type B, A1 can be greater than B1.

[0098] Specifically, the service type can include a display type and a multimedia type. For example, if the application program is a video playing application program or a music playing application program, the corresponding process can be a system critical service process of the multimedia type. If the application program is a display application program, the corresponding process can be a system critical service process of the display type. For some embodiments, the weight value corresponding to the system critical service process of the display type is greater than the weight value corresponding to the system critical service process of the multimedia type. For example, the process corresponding to starting point A is a system critical service process of the display type, and the process corresponding to starting point B is a system critical service process of the multimedia type. A greater weight value, such as 50, can be set for the process corresponding to starting point A, and a smaller weight value, such as 30, can be set for the process corresponding to starting point B.

[0099] Step S230: traversing the graph structure based on the node traversal method to obtain a priority of each process link, wherein the weight value is positively correlated with the priority.

[0100] For some embodiments, the weight values of at least some nodes in the graph structure are obtained through the foregoing steps. Then, the priority of each process link can be obtained through a traversal method of the graph structure. In an example, each node in the graph structure is obtained through the traversal method, and at least some nodes in the node correspond to weight values. Then, the weight values of each node in the process link are averaged to obtain the priority of the process link. Optionally, a higher adjustment coefficient can be assigned to the weight value of a node in the process link that is closer to the start node, and a lower adjustment coefficient can be assigned to the weight value of a node in the process link that is farther from the start node. For example, the process link includes a node A, a node B, and a node C, the node A is the start node, the node B is a call receiver of the node A, and the node C is a call receiver of the node B. A higher adjustment coefficient, for example, 2.0, can be assigned to the weight value of the node A, a lower adjustment coefficient, for example, 1.2, can be assigned to the weight value of the node B, and a lower adjustment coefficient, for example, 0.8, can be assigned to the weight value of the node C. Then, the priority of the process link is obtained based on the weight values of the nodes in the process link that are adjusted by the adjustment coefficients.

[0101] Step S240: determining the execution order of each process link based on the priority of each process link.

[0102] Step S250: executing each process link based on the execution order of each process link.

[0103] The steps S240 and S250 have been described in detail in the foregoing embodiments, and will not be described here again.

[0104] The process execution method, the process execution apparatus, the electronic device, and the readable storage medium provided in the present application first construct a plurality of process links into a graph structure, then set the weight values of at least some nodes in the graph structure based on the preset information, set the weight values of at least some nodes in the graph structure based on the preset information, set the weight values of at least some nodes in the graph structure based on the preset information, and finally execute each process link. By setting the weight values of the processes in the process link, and then comprehensively determining the priority of the process link based on the weight values of the processes, the accuracy is high. When executing, the processes in the process link are executed, so it is not necessary to determine the priority of the next process to be executed each time, and the overall execution efficiency of the system is improved.

[0105] Please refer to Figure 12 , Figure 12 FIG. 12 shows a schematic diagram of a process execution method provided in an embodiment of the present application. The method can be applied to the electronic device 100 in the foregoing embodiments, and specifically, the processor 110 in the electronic device 100 can be the main body for executing the process execution method.

[0106] The schematic diagram 1200 includes a producer 1210, a presentation layer 1220, and a consumer 1230. The producer 1210 can collect processes by using a system call (User Aware Tracepoint API) when an electronic device runs each application, and preset information for setting a weight value of a process introduced in the foregoing embodiments, and transmit to the weight calculator in the presentation layer 1220. The weight calculator receives data transmitted by the producer, and generates a graph structure by using a user aware graph, sets a weight value of at least part of nodes according to the data, and sets a priority of a process link in the graph structure according to the weight value. Finally, the process link is executed by a central processor scheduler in the consumer 1230. The weight calculator can obtain a service type of a system critical service process, such as a system critical service process of a display type or a system critical service process of a multimedia type, by using a system call. The weight calculator can also determine a process from a first language process or a second language process by using a system call. The first language process can be a process written by a C++ language, and the second language process can be a process written by a Java language. The weight calculator can also directly obtain an application type of an application, including a first type application, a second type application, or a third type application.

[0107] When the graph structure is generated by using the user aware graph, a processor can be called to perform calculation. However, because the amount of data calculation is large, a hardware acceleration unit can also be configured to perform acceleration, such as Single Instruction Multiple Data (SIMD).

[0108] Optionally, when the data obtained by the system call changes, the weight calculator can be triggered to update, and then the graph structure and the weight value of at least part of nodes are updated. When the weight calculator obtains that the service type of the system critical service process changes, the weight value of part of nodes can also be updated.

[0109] It should be noted that the consumer 1230 can also include a blocker scheduler, a page cache evictor, and a page allocator, and the process link can be executed by using the blocker scheduler, the page cache evictor, and the page allocator.

[0110] Please refer to Figure 13It shows a structural block diagram of a process execution apparatus 1300 provided by an embodiment of the application. The apparatus comprises an acquisition unit 1310, a determination unit 1320 and an execution unit 1330.

[0111] The acquisition unit 1310 is configured to acquire a priority of each process link, wherein each process link is generated by at least two processes corresponding to the process link and an interaction relationship between the processes, and the priority of the process link is set based on preset information corresponding to the process link, wherein the preset information comprises at least one of user operation information of each process and an interaction relationship strength between two processes having the interaction relationship.

[0112] Further, the acquisition unit 1310 is further configured to construct a plurality of process links into a graph structure, wherein each node in the graph structure corresponds to a process, an edge between any two nodes is used to represent an interaction relationship between processes corresponding to the two nodes, a weight value of at least part of nodes in the graph structure is set based on the preset information, and each process link is obtained by traversing the graph structure based on a node traversal method, wherein the weight value is positively correlated with the priority. The direction of the edge between the two nodes is from a calling sender to a calling receiver.

[0113] Further, the acquisition unit 1310 is further configured to determine a user interaction degree of each node based on user operation information corresponding to a process of each node in the graph structure, and set a weight value of the node based on the user interaction degree of the node, wherein the user interaction degree is positively correlated with the weight value.

[0114] Further, the acquisition unit 1310 is further configured to find a first type application, a second type application and a third type application in application programs corresponding to each node based on user operation information corresponding to a process of each node in the graph structure, wherein the first type application is an application where a user focus is located, the second type application is an application where a user focus is not located but there is an interaction with the user, and the third type application is an application where there is no interaction with the user, and the user interaction degree of nodes corresponding to the first type application, the second type application and the third type application is set respectively, wherein the user interaction degrees of the first type application, the second type application and the third type application decrease in turn.

[0115] Further, the acquisition unit 1310 is further configured to determine a user interaction degree of each node based on user operation information corresponding to a process of each node in the graph structure.

[0116] Further, the obtaining unit 1310 is further configured to set a weight value between two nodes on each edge in the graph structure based on an interaction relationship strength between the two nodes, wherein the interaction relationship strength is positively correlated with the weight value. The interaction relationship strength between two processes having an interaction relationship is determined in advance based on interaction information between the two processes, wherein the interaction information includes at least one of a communication type, an interaction frequency, and a mutual dependence degree.

[0117] Further, the obtaining unit 1310 is further configured to determine a service type of a system critical service process corresponding to each starting point in the graph structure, and set a weight value of the starting point based on the service type of the starting point. The service type includes a display type and a multimedia type, and a weight value corresponding to a system critical service process of the display type is greater than a weight value corresponding to a system critical service process of the multimedia type.

[0118] The determining unit 1320 is configured to determine an execution order of each process link based on the priority of each process link.

[0119] The execution unit 1330 is configured to execute each process link based on the execution order of each process link.

[0120] Those skilled in the art can clearly understand the specific working process of the described device and unit for the convenience and brevity of the description, which can refer to the corresponding process in the foregoing method embodiments, and will not be described here.

[0121] In several embodiments provided in the present application, the coupling between units can be electrical, mechanical or other forms of coupling.

[0122] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0123] Please refer to Figure 1 which shows a structural block diagram of an electronic device provided by an embodiment of the present application. The electronic device 100 can be a smart phone, a tablet computer, or the like, which can run an application program. The electronic device 100 in the present application can include one or more of the following components: a processor 110 and a memory 120, wherein the application program can be stored in the memory 120 and configured to be executed by one or more processors 110, and the application program is configured to execute the method as described in the foregoing method embodiments.

[0124] The processor 110 can include one or more processing cores. The processor 110 connects various parts within the entire electronic device 100 with various interfaces and lines, performs various functions of the electronic device 100 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Alternatively, the processor 110 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), a programmable logic array (PLA). The processor 110 can integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes an operating system, a user interface, and an application program, etc.; the GPU is responsible for rendering and drawing display content; and the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 110, but be implemented by a separate communication chip.

[0125] The memory 120 can include a random access memory (RAM) and can also include a read-only memory (ROM). The memory 120 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing each of the methods described below, etc. The data storage area can also store data created by the electronic device 100 in use.

[0126] Please refer to Figure 14 which shows a structural block diagram of a computer readable storage medium provided by the embodiments of the present application. The computer readable medium 1500 stores program codes therein, and the program codes can be called and executed by a processor to perform the methods described in the above method embodiments.

[0127] The computer-readable storage medium 1500 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. Optionally, the computer-readable storage medium 1500 comprises a non-transitory computer-readable medium. The computer-readable storage medium 1500 has storage space for program codes 1510 for carrying out any of the method steps described above. These program codes can be read from or written to one or more computer program products. The program codes 1510 can be compressed, for example, in a suitable form.

[0128] Reference is made to Figure 15 Fig. 16 shows a structural block diagram of a computer program product 1600 according to an embodiment of the application. The computer program product 1600 comprises computer programs / instructions 1610 which, when executed by a processor, implement the steps of the methods described above. Finally, it should be noted that the above-mentioned embodiments are merely intended to illustrate the application and are not intended to limit it; even though the application has been described in detail with reference to the preceding embodiments, a person of ordinary skill in the art will understand that they can modify the technical solutions recorded in the preceding embodiments, or make equivalent replacements to some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the application.

Claims

1. A process execution method characterized by, The method comprises: obtaining a priority of each process link, wherein each process link is generated by at least two processes corresponding to the process link and an interaction relationship between the processes, each process is regarded as a node, and there is an edge between nodes with an interaction relationship to represent a calling relationship, and the priority of the process link is set based on preset information corresponding to the process link, wherein the preset information comprises at least one of user operation information of each process and an interaction relationship strength between two processes with an interaction relationship; determining an execution order of each process link based on the priority of each process link; executing each process link based on the execution order of each process link.

2. The method of claim 1, wherein, The method comprises: constructing a plurality of process links into a graph structure, wherein each node in the graph structure corresponds to a process, and an edge between any two nodes is used to represent an interaction relationship between the processes corresponding to the two nodes; setting a weight value of at least part of the nodes in the graph structure based on the preset information; traversing the graph structure based on a node traversal method to obtain the priority of each process link, wherein the weight value is positively correlated with the priority.

3. The method of claim 2, wherein, The preset information comprises user operation information of each process, and the user operation information of the process comprises user operation information of an application program corresponding to the process, and the method comprises: determining a user interaction degree of each node based on the user operation information of the process corresponding to each node in the graph structure; setting a weight value of the node based on the user interaction degree of the node, wherein the user interaction degree is positively correlated with the weight value.

4. The method of claim 3, wherein, The method comprises: based on the user operation information of the process corresponding to each node in the graph structure, searching for a first type application, a second type application and a third type application in the application programs corresponding to the nodes, wherein the first type application is an application on which a user focuses, the second type application is an application on which a user does not focus but interacts with the user, and the third type application is an application that does not interact with the user; respectively setting user interaction degrees of the nodes corresponding to the first type application, the second type application and the third type application, wherein the user interaction degrees of the first type application, the second type application and the third type application decrease in turn.

5. The method of claim 3, wherein, The method comprises: based on the user operation information of the process corresponding to each node in the graph structure, determining a user interaction degree of each node.

6. The method of claim 2, wherein, The preset information comprises an interaction relationship strength between two processes with an interaction relationship, and the method comprises: based on the interaction relationship strength between two nodes on each edge in the graph structure, setting a weight value between the two nodes, wherein the interaction relationship strength is positively correlated with the weight value.

7. The method of claim 6, wherein, The interaction strength between two processes having an interaction relationship is determined in advance based on interaction information between the two processes, wherein the interaction information comprises at least one of a communication type, an interaction frequency, and a mutual dependence degree.

8. The method of claim 2, wherein, The at least two processes include a starting point, the starting point is a system critical service process, the preset information further comprises a type of the starting point process, and the weight of at least part of nodes in the graph structure is set based on the preset information, including: Determining a service type of a system critical service process corresponding to each starting point in the graph structure; Setting a weight value of each starting point based on the service type of the starting point.

9. The method of claim 8, wherein, The service type comprises a display type and a multimedia type, and a weight value corresponding to a system critical service process of the display type is greater than a weight value corresponding to a system critical service process of the multimedia type.

10. The method of claim 2, wherein, The direction of the edge between the two nodes is from a calling sender to a calling receiver.

11. A process execution device, characterized by comprising: Comprising: An acquisition unit configured to acquire a priority of each process link, wherein each process link is generated by at least two processes corresponding to the process link and an interaction relationship between the processes, each process is regarded as a node, there is an edge representing a calling relationship between nodes having an interaction relationship, and the priority of the process link is set based on preset information corresponding to the process link, wherein the preset information comprises at least one of user operation information of each process and an interaction strength between two processes having an interaction relationship; A determination unit configured to determine an execution order of each process link based on the priority of each process link; An execution unit configured to execute each process link based on the execution order of each process link.

12. An electronic device, comprising: Comprising: One or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method of any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer readable storage medium stores program code, and the program code can be called and executed by the processor to execute the method of any one of claims 1-10.

14. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the first processor to implement the method of any one of claims 1-10.

Citation Information

Patent Citations

  • Task scheduling method, device and system

    CN107102894A

  • Method for sharing load

    CN1585402A