CN116055443B - Method for identifying social scene, electronic equipment and computer readable storage medium - Google Patents

Method for identifying social scene, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116055443B
CN116055443B CN202210529466.5A CN202210529466A CN116055443B CN 116055443 B CN116055443 B CN 116055443B CN 202210529466 A CN202210529466 A CN 202210529466A CN 116055443 B CN116055443 B CN 116055443B
Authority
CN
China
Prior art keywords
application
window
state
probe
audio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210529466.5A
Other languages
Chinese (zh)
Other versions
CN116055443A (en
Inventor
姜传标
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210529466.5A priority Critical patent/CN116055443B/en
Publication of CN116055443A publication Critical patent/CN116055443A/en
Application granted granted Critical
Publication of CN116055443B publication Critical patent/CN116055443B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes
    • 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

Abstract

The application discloses a method for identifying social scenes, electronic equipment and a computer-readable storage medium, and belongs to the technical field of terminals. The method comprises the following steps: responding to a first operation of a user, and displaying a first window, wherein the first window is a focus window; determining an application type of a first application to which the first window belongs; if the application type of the first application is social application, determining an application running state of the first application, wherein the application running state is determined according to process running states of all processes of the first application, and the process running states comprise a window state, an audio using state and a video using state; and determining the social scene where the electronic equipment is located according to the application running state of the first application. According to the method and the device for identifying the social scene, the application running state is determined according to the process running states of all the processes of the focus application, and the social scene where the application running state is located is determined according to the application running state, so that the accuracy of determining the application running state is improved, and the accuracy of identifying the social scene is further improved.

Description

Method for identifying social scene, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a method for identifying social scenes, an electronic device, and a computer readable storage medium.
Background
With the development of terminal technology, the types of applications that can be supported by a terminal are increasing, such as social applications, office applications, game applications, video applications, and the like. When a user uses a social application of a terminal, the user scene in which the terminal is located is typically a social scene. However, when a user uses a social application, the social scene in which the terminal is located is different in different use modes. For example, according to different usage modes of the social application, the social scene where the terminal is located may be a text chat scene, a voice chat scene, or a video chat scene, respectively. In some cases, it is desirable to accurately identify the specific social scenario in which the terminal is located.
The traditional social scene recognition scheme is that after the social application is started, the social scene where the terminal is located is recognized according to the window type of the application window of the currently displayed social application. However, the window type of the application window of the currently displayed social application may not necessarily accurately represent the overall running state of the social application, so that the accuracy of the social scene identified according to the window type of the currently displayed application window of the social application is low, and the method has a certain limitation.
Disclosure of Invention
The application provides a method for identifying social scenes, electronic equipment and a computer-readable storage medium device, which can improve the accuracy and the flexibility of identifying social scenes. The technical scheme is as follows:
in a first aspect, a method of identifying a social context is provided, the method comprising: responding to a first operation of a user, and displaying a first window, wherein the first window is a focus window; determining an application type of a first application to which the first window belongs; if the application type of the first application is social application, determining an application running state of the first application, wherein the application running state is determined according to process running states of all processes of the first application, and the process running states comprise a window state, an audio using state and a video using state; and determining the social scene where the electronic equipment is located according to the application running state of the first application.
According to the method provided by the embodiment of the application, when the application type of the focus application to which the focus window belongs is the social application, the electronic equipment is determined to be in the social scene, then the application running state of the focus application is further determined according to the process running states of all the processes of the focus application, and the social sub-scene in which the electronic equipment is determined according to the application running state of the focus application. By determining the application running state of the focus application according to the process running states of all the processes of the focus application, the accuracy of determining the application running state can be improved, the accuracy of identifying social scenes where the electronic equipment is located is further improved, and the flexibility is high.
The first application is a focus application, and all processes of the focus application refer to all processes running by the focus application, namely all processes which are started and not closed. The process running state of each process may include a window state, an audio use state, and a video use state. The window status may include whether the corresponding window is an in-focus window, whether the corresponding window switches to a maximized state or a minimized state, etc., and an audio usage status is used to indicate whether audio is used, such as whether an audio output event exists. The video usage status is used to indicate whether video is used, such as whether there is a GPU decoding event.
As an example, the process running states of all the processes of the first application are the process running states of all the processes of the first application having the visible window, and the application running states may be further determined according to the process running states of all the processes of the first application having the visible window.
As one example, it may be determined whether the application type of the first application to which the first window belongs is a social application according to a white list of social applications. The whitelist includes application identifications of a plurality of applications whose application types are social applications. And if the application identifier of the first application is positioned in the white list, determining that the application type of the first application is a social application. If the application identifier of the first application is not in the white list, determining that the application type of the first application is not a social application.
Of course, it may also be determined in other ways whether the application type of the first application is a social application. For example, whether the application type of the first application is a social application may be determined according to whether the type identifier of the application type of the first application is a type identifier of the social application.
In one possible design manner of the first aspect, determining an application running state of the first application includes: and acquiring the process running states of all the processes of the first application, and determining the application running state of the first application according to the process running states of all the processes of the first application.
In one possible design manner of the first aspect, determining an application running state of the first application includes: and acquiring the application running state of the first application from a first state record item of the first application according to the application identifier of the first application, wherein the first state record item stores the application identifier and the application running state of the first application, and the first state record item is created after the first application is started.
That is, the electronic device may maintain the first state record of the first application according to the process running states of all the processes of the first application. The first state record item is used for storing the application identifier and the application running state of the first application, so that the application running state of the first application can be quickly queried from the first state record item according to the application identifier of the first application.
For example, the electronic device includes a system probe module including an application status probe that maintains a first status record of a first application.
Additionally, the application status probe may also maintain a first status record of the plurality of applications. For example, a first state record item of a specified application that satisfies a condition is maintained. For example, the specified application is an application of a specified application type, such as a social application, an office application, a game application, or a video application, or the like. For another example, the application state probe may maintain a first state record of a focused application, a first state record of a non-focused application, and a first state record of a background application. Thus, the electronic device can quickly inquire the application running state of the focus application from the first state record items of the plurality of applications maintained by the application state probe when needed.
In one possible design manner of the first aspect, the electronic device includes a system probe module, where the system probe module includes a focus window probe, an audio probe, and a video probe, the focus window probe is used to detect a window state change of any process, the audio probe is used to detect an audio usage state change of any process, and the video probe is used to detect a video usage state change of any process. The application state probe may maintain a first state record of a plurality of applications based on probe states of the focus window probe, the audio probe, and the video probe.
In one possible design manner of the first aspect, before acquiring the application running state of the first application from the first state record item of the first application according to the application identifier of the first application, the method further includes: acquiring process running states of all processes of the first application; determining the application running state of the first application according to the process running states of all the processes of the first application; and correspondingly storing the application identifier and the application running state of the first application, wherein the correspondingly stored application identifier and application running state of the first application are the first state record items.
In one possible design manner of the first aspect, the electronic device includes a system probe module, where the system probe module includes a focus window probe, an audio probe, and a video probe; acquiring process running states of all processes of the first application, including: determining the window state of each process in all processes of the first application according to the probe state of the focus window probe; according to the probe state of the audio probe, determining the audio use state of each process in all processes of the first application; and determining the video use state of each process in all processes of the first application according to the probe state of the video probe.
As an example, the focus window probe may also maintain a window state record of the first application according to the probe state of the focus window probe, the window state record of the first application including an application identifier of the first application and a window state of each of all processes of the first application. The audio probe may also maintain an audio usage status record for the first application based on the probe status of the audio probe, the audio usage status record for the first application including an application identification for the first application and an audio usage status for each of all processes of the first application. The video probe may also maintain a video usage status record of the first application according to the probe status of the audio probe, the video usage status record of the first application including an application identification of the first application and a video usage status of each of all processes of the first application.
Thus, the status record items maintained by the focus window probe, the audio probe and the video probe can form a second status record item of the first application. The second state record of the first application includes an application identifier of the first application and a process running state of each process of all processes of the first application.
As another example, a second state record of the first application may also be maintained by the application state probe based on probe states of the focus window probe, the audio probe, and the video probe.
In one possible design manner of the first aspect, obtaining process running states of all processes of the first application includes:
and acquiring the process running states of all the processes of the first application from a second state record item of the first application according to the application identifier of the first application, wherein the second state record item stores the application identifier of the first application and the process running states of all the processes running by the first application.
In one possible design manner of the first aspect, before acquiring the process running states of all the processes of the first application from the second state record item of the first application according to the application identifier of the first application, the method further includes: after a first process of the first application is started, if the first process is the first process started by the first application, creating a second state record item for the first application, adding a process running state of the first process in the second state record item, wherein the first process is any process of the first application; if the first process is not the first process started by the first application, determining a created second state record item according to the application identifier of the first application, and adding the process running state of the first process in the second state record item.
In one possible design manner of the first aspect, the electronic device includes a system probe module, where the system probe module includes a focus window probe, an audio probe, and a video probe, and before adding the process running state of the first process in the second state record, the method further includes: determining a window state of the first process according to the probe state of the focus window probe; determining an audio use state of the first process according to the probe state of the audio probe; and determining the video use state of the first process according to the probe state of the video probe.
In one possible design manner of the first aspect, the second state record item stores an application identifier of the first application and a process running state of a first process of the first application, where the first process is any process of the first application; the method further comprises the steps of: if a focus window change event of the first process is detected, updating a window state of the first process according to the focus window change event, wherein the window state comprises whether a corresponding window is a focus window or not; if an audio use state change event of the first process is detected, updating the audio use state of the first process according to the audio use state change event; if the video use state change event of the first process is detected, the video use state of the first process is updated according to the video use state change event.
In one possible design manner of the first aspect, after storing the application identifier of the first application and the application running state correspondingly, the method further includes:
after the first application exits, the first state record item is deleted.
That is, the first state record item can be created for the first application after the first application is started, and the first state record item of the first application is deleted when the first application exits, so that the memory leakage can be prevented, and the memory space can be saved.
In one possible design manner of the first aspect, after the first application exits, before deleting the first state record item, the method further includes: after a second process of the first application is closed, if the second process has a corresponding second window, deleting a window identifier of the second window from a window set of the first application, wherein the window set stores window identifiers of windows created by the first application, and the second process is any process of the first application; after deleting the window identifier of the second window, if the window set of the first application is empty, determining that the first application exits.
That is, the electronic device may also maintain a set of windows for the first application that store window identifications of windows that have been created by the first application. For example, when a first window of a first application is created, a corresponding window set is created for the first application, and a window identifier of the first window is added in the window set. Subsequently, as each window of the first application is created, a window identification of the created window may be added to the window set. In addition, when any process of the first application is closed, the window identifier of the window corresponding to the process can be deleted from the window set of the first application, so that the window set of the first application is used for storing the window identifiers of the windows which are created and not closed.
In addition, after deleting the window identifier from the window set of the first application, if the window set is empty, it may also be determined that the first application has been exited, and the first state record item of the first application is deleted. That is, for a social application, when each process of the social application does not have a corresponding window, it may be determined that the social application has been exited, so that the determination of the application running state of the social application is more consistent with the social scenario.
In one possible design manner of the first aspect, the method further includes: after deleting the window identifier of the second window, if the window set of the first application is not empty, determining that the first application is not exited.
In one possible design manner of the first aspect, determining, according to an application running state of the first application, a social scene in which the electronic device is located includes: if the application running state of the first application is that a focus window exists and audio and video are not used, determining that a social scene where the electronic equipment is located is a first social sub-scene; if the application running state of the first application is that a focus window exists, audio is used, but video is not used, determining that a social scene where the electronic equipment is located is a second social sub-scene; if the application running state of the first application is that a focus window exists and the video is used and the audio is not used, determining that the social scene where the electronic equipment is located is a third social sub-scene; and if the application running state of the first application is that the focus window exists and the audio and video are used, determining that the social scene where the electronic equipment is located is a fourth social sub-scene.
In one possible design manner of the first aspect, after determining, according to an application running state of the first application, a social scene in which the electronic device is located, the method further includes: determining a scheduling strategy matched with a social scene in which the electronic equipment is located; and adjusting the resources of the electronic equipment according to the scheduling strategy. For example, the scheduling policy includes an operating system OS scheduling policy and a central processing unit CPU power consumption scheduling policy; adjusting the process priority and the input/output (I/O) priority of a first process corresponding to the first window according to an OS scheduling strategy; and adjusting the power consumption of the CPU of the electronic equipment according to the CPU power consumption scheduling strategy. Thus, the power consumption of the electronic equipment can be reduced under the condition that the social scene requirement of the user is met.
In a second aspect, there is provided an apparatus for identifying a social scene, where the apparatus for identifying a social scene has a function of implementing the method behavior for identifying a social scene in the first aspect. The device for identifying the social scene comprises at least one module for realizing the method for identifying the social scene provided by the first aspect.
In a third aspect, an apparatus for identifying a social scene is provided, where the apparatus for identifying a social scene includes a processor and a memory, where the memory is configured to store a program for supporting the apparatus for identifying a social scene to execute the method for identifying a social scene provided in the first aspect, and store data related to implementing the method for identifying a social scene in the first aspect. The processor is configured to execute a program stored in the memory. The means for identifying social scenes may further comprise a communication bus for establishing a connection between the processor and the memory.
In a fourth aspect, there is provided a computer readable storage medium having instructions stored therein, which when run on a computer, cause the computer to perform the method of identifying social scenes of the first aspect described above.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of identifying a social scene as described in the first aspect above.
The technical effects obtained by the second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and are not described in detail herein.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present application;
fig. 2 is a software block diagram of an electronic device 100 according to an embodiment of the present application;
fig. 3 is a schematic workflow diagram of software and hardware for identifying a user scenario and scheduling resources according to the identified user scenario by the electronic device 100 according to an embodiment of the present application;
FIG. 4 is a flowchart of a method for identifying social scenes provided by an embodiment of the present application;
FIG. 5 is an interface schematic diagram of an electronic device according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an interface of another electronic device according to an embodiment of the present application;
FIG. 7 is a schematic diagram of an interface of another electronic device according to an embodiment of the present application;
FIG. 8 is a schematic flow chart of subscribing a focus window change event from an API module by a system probe module according to an embodiment of the present application;
FIG. 9 is a schematic flow chart of subscribing an audio usage event to an audio driver by a system probe module according to an embodiment of the present application;
FIG. 10 is a schematic flow chart of a system probe module decoding events to a video-driven subscription GPU according to an embodiment of the present application;
fig. 11 is a schematic diagram of a chip structure according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be understood that references to "a plurality" in this disclosure refer to two or more. In the description of the present application, "/" means or, unless otherwise indicated, for example, A/B may represent A or B; "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of the present application, the words "first", "second", etc. are used to distinguish the same item or similar items having substantially the same function and function. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
For clarity and conciseness in the description of the embodiments below, a brief introduction to related concepts or technologies is first given:
a focus window (focus window) refers to a window having focus. The focus window is the only window that can receive keyboard input. The manner in which the focus window is determined is associated with the focus mode (focus mode) of the system. The top level window of the focus window is called an active window (active window). Only one window at a time may be an active window. The focus window is a window which is needed to be used by the user at present with high probability. The application to which the focus window belongs is called a focus application.
The focus mode may be used to determine how the mouse brings a window into focus. In general, the focus modes may include three types, respectively:
(1) Click-to-focus (click-to-focus) in this mode, the window that the mouse clicks on gets focus. I.e. when the mouse clicks on any position of a window where focus is available, the window is activated, placed in front of all windows and receives keyboard input. When the mouse clicks on other windows, the window loses focus.
(2) The focus follows the mouse (focus-mouse), in which mode a window under the mouse can acquire focus. I.e. when the mouse is moved to a range of windows where focus is available, the user does not need to click somewhere on the window to activate the window, receive keyboard input, but the window is not necessarily placed at the forefront of all windows. When the mouse moves out of the range of this window, this window will also lose focus.
(3) Grass-focus (slope focus), which is similar to focus-mouse comparison: when the mouse is moved to a window where focus is available, the user may activate the window without clicking somewhere on the window, receiving keyboard input, but the window is not necessarily positioned at the forefront of all windows. Unlike focus-focus, focus does not change when the mouse moves out of this window, but only when the mouse moves into another window that can receive focus.
An application may launch one or more processes, each process including one or more threads, which may create windows. The focus process is the process to which the thread that created the focus window belongs.
The application provides a method for identifying social scenes, which can acquire the application type of a focus application to which a switched focus window belongs when a focus window switching event is detected, determine the process running states of all processes of the focus application under the condition that the application type of the focus application is a social application, determine the application running states of the focus application according to the process running states of all processes of the focus application, and determine the social scenes in which electronic equipment is located according to the application running states of the focus application.
In this way, when the application type of the focus application to which the focus window belongs is a social application, the electronic device is determined to be in a social scene, then the application running state of the focus application is further determined according to the process running states of all the processes of the focus application, and the social sub-scene in which the electronic device is determined according to the application running state of the focus application. By determining the application running state of the focus application according to the process running states of all the processes of the focus application, the accuracy of determining the application running state can be improved, and the accuracy of identifying social sub-scenes where the electronic equipment is located is further improved.
Wherein, all processes of the focus application refer to all processes that the focus application is running, i.e. all processes that have been started and not closed. The process running state of each process may include a window state, an audio use state, and a video use state. The window status may include whether the corresponding window is an in-focus window, whether the corresponding window switches to a maximized state or a minimized state, etc., and an audio usage status is used to indicate whether audio is used, such as whether an audio output event exists. The video usage status is used to indicate whether video is used, such as whether a graphics processor (graphics processing unit, GPU) decoding event is present.
Taking the application a as an example, the application a belongs to a social application, the process corresponding to the focus window of the application a is alive. Exe, the process of outputting audio is aplyer. Exe, the process of decoding by using the GPU is aplayerhd. Exe, the process running states of the 3 processes are required to be combined, and the whole application running state of the application a is determined according to the combined process using state. For example, the application running state of the application a is: there is a focus window, using audio and video.
For the multi-process application, the process running state of a single process of the application is insufficient to represent the overall running state of the application, and the embodiment of the application determines the application running state of the focus application according to the process running states of all processes of the focus application by determining the process running states of all processes of the focus application, so that the accuracy of determining the application running state of the focus application is improved, and the accuracy of identifying social sub-scenes where the electronic equipment is located can be further improved.
As one example, all processes of the focus application may also be all processes with visible windows. In this way, the application running state of the focus application can be determined from the process running states of all the processes having visible windows of the focus application. Because the user needs to interact with the application according to the visible window of the application in the social scene, the social scene where the electronic device is located can be accurately identified according to the application running state determined by the process running states of all the processes with the visible window of the focus application. In addition, the method can reduce the operation amount and improve the recognition efficiency of the social scene.
In addition, a resource scheduling method based on social scenes is provided, after the social scenes where the electronic equipment is located are identified, a scheduling policy matched with the social scenes can be determined, and resources are scheduled according to the scheduling policy. For example, according to the scheduling policy, operating System (OS) resources and power consumption of a CPU of the electronic device are adjusted, and the power consumption of the electronic device is reduced under the condition that social scene requirements of users are met.
The method for identifying the social scene and the resource scheduling method based on the social scene are applied to electronic equipment, wherein the electronic equipment can be terminal equipment such as mobile phones, tablet computers, notebooks, computers and wearable equipment, and can be other electronic equipment, and the method is not limited in this embodiment.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device 100 according to an embodiment of the application.
As shown in fig. 1, the electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, universal serial bus (universal serial bus, USB) interface 130, charge management module 140, power management module 141, battery 142, wireless communication module 150, display screen 160, etc.
It is to be understood that the structure illustrated in the present embodiment does not constitute a specific limitation on the electronic apparatus 100. In other embodiments, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an I2C interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a USB interface, among others.
It should be understood that the connection relationship between the modules illustrated in this embodiment is only illustrative, and does not limit the structure of the electronic device 100. In other embodiments, the electronic device 100 may also employ different interfaces in the above embodiments, or a combination of interfaces.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display screen 160, the wireless communication module 150, and the like. In some embodiments, the power management module 141 and the charge management module 140 may also be provided in the same device.
The wireless communication module 150 may provide solutions for wireless communication including WLAN (e.g., wi-Fi), bluetooth, global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., applied to the electronic device 100. For example, in the embodiment of the present application, the electronic device 100 may establish a bluetooth connection with a terminal device (such as the wireless headset 100) through the wireless communication module 150.
The wireless communication module 150 may be one or more devices that integrate at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via an antenna, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 150 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via an antenna.
The electronic device 100 implements display functions through a GPU, a display screen 160, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 160 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 160 is used to display images, videos, and the like. The display 160 includes a display panel.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may include a storage program area and a storage data area by executing instructions stored in the internal memory 121.
The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application exemplifies a Windows system of a layered architecture, and illustrates a software structure of the electronic device 100.
Fig. 2 is a block diagram of a software architecture of an electronic device 100 according to an embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, windows systems are classified into a user mode and a kernel mode. The user mode comprises an application layer and a subsystem dynamic link library. The kernel mode is divided into a firmware layer, a hardware abstraction layer (hardware abstraction layer, HAL), a kernel and a driving layer and an executing body from bottom to top.
The application layer includes social, music, video, game, office, etc. applications. The application layer also includes an environment subsystem, a scene recognition engine, a scheduling engine, and the like. Wherein only a part of application programs are shown in the figure, the application layer can also comprise other application programs, such as shopping application, browser and the like, and the application is not limited.
The environment subsystem may expose certain subsets of the basic executive services to the application in a particular modality, providing an execution environment for the application.
The scene recognition engine may recognize a user scene in which the electronic device 100 is located, such as recognizing a social scene in which the electronic device 100 is located. In addition, the scene recognition engine may also determine a scheduling policy that matches the identified user scene, such as determining a scheduling policy that matches the identified social scene.
The scheduling engine may schedule the resources according to a scheduling policy determined by the scenario recognition engine. For example, the scheduling engine may determine an actual scheduling policy according to the actual operation situation of the electronic device 100 according to the basic scheduling policy output by the scene recognition engine and combine other device information, and schedule the resource according to the actual scheduling policy according to the actual operation situation of the electronic device 100. For example, the scheduling engine may obtain the load situation of the electronic device 100, and determine an actual scheduling policy according to the actual operation situation of the electronic device 100 in combination with the load situation of the electronic device 100 and the basic scheduling policy. The specific contents of the scene recognition engine and the scheduling engine are described below, and are not described herein.
The subsystem dynamic link library comprises an API module comprising Windows API, windows native API, etc. The Windows APIs, which can provide system call entry and internal function support for the application program, are different in that they are Windows system native APIs. For example, windows APIs may include user. Dll, kernel. Dll, and Windows native APIs may include ntdll. The user. Dll is a Windows user interface, and can be used for performing operations such as creating a window, sending a message, and the like. kernel. Dll is used to provide an interface for applications to access the kernel. ntdll.dll is an important Windows NT kernel-level file that describes the interface of the Windows local NTAPI. When Windows is started, ntdll.dll resides in a particular write protect region of memory, which prevents other programs from occupying that memory region.
The executives include a system event driver (operating system event driver), a system and chip (operating system to system on chip, OS2 SOC) driver, an Operating System (OS) kernel driver, a process manager, an input/output (I/O) manager, a power manager, and the like.
The system event driver may interact with the kernel and the driver layer, such as the graphics card driver, and after determining that a GPU decoded event exists, report the GPU decoded event to the scene recognition engine. For example, the system event driver is a system and embedded controller (operating system to embedded controller, OS2 EC) driver.
The system and chip driver may be configured for the scheduler engine to send adjustment information to the hardware device, such as information to adjust CPU power consumption to a central processing unit (central processing unit, CPU).
The system kernel driver may be used by the scheduling engine to send adjustment information to the operating system, for example, to send information to adjust the priority of a process to the process manager, or to send information to adjust the priority of an I/O to the I/O manager, etc.
The process manager is used to create and suspend processes and threads.
The I/O manager performs device independent input/output and further processes call the appropriate device drivers.
The power manager may manage power state changes for all devices that support power state changes.
In addition, the executives may also include virtual memory manager, secure reference monitor, and Windows management Specification (Windows management instrumentation, WMI), among others. The virtual memory manager implements "virtual memory". The virtual memory manager also provides basic support for the cache manager. The security reference monitor may execute a security policy on the local computer that protects operating system resources, performs protection and monitoring of runtime objects.
The kernel and driver layer includes a kernel and a device driver.
The kernel is an abstraction of the processor architecture, separates the difference between the executable and the processor architecture, and ensures the portability of the system. The kernel may perform thread scheduling and scheduling, trap handling and exception scheduling, interrupt handling and scheduling, etc.
The device driver operates in kernel mode as an interface between the I/O system and the associated hardware. The device drivers may include a graphics card driver, a CPU driver, a mouse driver, an audio driver, a camera driver, a keyboard driver, and the like. For example, a graphics card driver may drive a GPU to run and a CPU driver may drive a CPU to run. For example, the CPU driver is an Intel DTT driver.
The HAL is a core state module, which can hide various details related to hardware, such as an I/O interface, an interrupt controller, a multiprocessor communication mechanism and the like, provide uniform service interfaces for different hardware platforms running Windows, and realize portability on various hardware platforms. It should be noted that, in order to maintain portability of Windows, the Windows internal components and the device driver written by the user do not directly access the hardware, but rather by calling the routine in the HAL.
The firmware layer may include a basic input output system (basic input output system, BIOS), which is a set of programs that are embedded in a Read Only Memory (ROM) chip on the motherboard of the computer, which holds the most important basic input output programs, post-boot self-test programs, and system self-start programs of the computer, and which reads and writes specific information of the system settings from and to the complementary metal oxide semiconductor (complementary metal oxide semiconductor, CMOS). Its main function is to provide the lowest, most direct hardware setup and control for the computer. The CPU driver may send instructions to the CPU through the BIOS.
It should be noted that, the embodiment of the present application is only illustrated by a Windows system, and in other operating systems (such as an android system, an IOS system, etc.), the scheme of the present application can be implemented as long as the functions implemented by the respective functional modules are similar to those implemented by the embodiment of the present application.
Fig. 3 is a schematic workflow diagram of software and hardware for identifying a user scenario and scheduling resources according to the identified user scenario by the electronic device 100 according to an embodiment of the present application.
As shown in fig. 3, the application layer scene recognition engine includes a system probe module, a scene recognition module, and a policy matching manager. The scene recognition module may interact with the system probe module and the policy matching manager, respectively. The scene recognition module may send a request to the system probe module to obtain the probe status. The system probe module may obtain an operating state of the electronic device 100, such as an application operating state of a social application running on the electronic device 100.
For example, the system probe modules may include a power state probe, a peripheral state probe, an audiovisual state probe, a system event probe, an application state probe, and an application behavior probe.
The power state probe may subscribe to a kernel state for a power state event, determine a power state according to a callback function fed back by the kernel state, where the power state includes a battery (remaining) amount, a power mode, and the like, and the power mode may include an alternating current (alternating current, AC) and a Direct Current (DC) power. For example, the power state probe may send a request to the oseeventdriver of the executive layer to subscribe to a power state event, which is forwarded by the oseeventdriver to the power manager of the executive layer. The power manager may feed back a callback function to the power state probe through the oseeventdriver.
The peripheral state probe can subscribe a peripheral event to the kernel state, and the peripheral event is determined according to a callback function fed back by the kernel state. Peripheral events include mouse wheel slide events, mouse click events, keyboard input events, microphone input events, camera input events, and the like.
The audio and video status probe may subscribe to the kernel mode for audio and video events, and determine the audio and video events currently existing in the electronic device 100 according to the callback function fed back by the kernel mode. The audio-video events may include audio usage events, video usage events, etc., the audio usage events may be audio output events, the video usage events may be GPU decoding events, etc. For example, the audiovisual state probe includes an audio probe and a video probe. The audio probe may send a request to the OsEventDriver of the executive layer to subscribe to an audio use event, which is forwarded by the OsEventDriver to the audio drivers of the kernel and driver layers. The audio driver can monitor the state of the audio device, and after an audio output event is monitored, a callback function is fed back to the audio probe through the OsEventDriver. The video status probe may send a request to the oseeventdriver of the executable layer to subscribe to the GPU decoding event, and the oseeventdriver forwards the request to the kernel and the graphics card driver of the driver layer. The display card driver can monitor the state of the GPU, and after the GPU is monitored to perform decoding operation, a callback function is fed back to the video probe through the OsEventDriver.
The system event probe can subscribe to the kernel state for system events, and the system events are determined according to a callback function fed back by the kernel state. The system events may include window change events, process creation events, thread creation events, and the like. For example, the system event probes include a focus window probe that can send a request to the API module to subscribe to a focus window change event, and the API module can monitor whether a focus window of the electronic device 100 has changed, a maximized or minimized state change of the focus window, etc., and feedback a callback function to the focus window probe when the focus window has changed or the maximized or minimized state change of the focus window is monitored. For example, the API module is a Window event hook tool WinEventHookUtil. For another example, the system event probe may further include a process creation probe that may send a request to the oseventpriver of the executable layer to subscribe to a process creation event, which may forward the request to the process manager. After the process is created, the process manager can feed back a callback function to the process creation probe through the OsEventDriver.
The application state probe may subscribe to the kernel state for application running state events, and determine an application running state of an application (e.g., a first application corresponding to the focus window) according to a callback function fed back by the kernel state. For example, the application state probe may send a request for subscribing to an application running state event to the oseeventdriver of the executing body layer, and the oseeventdriver may obtain the process running states of all the processes of the application through the audio and video state probe and the system event probe, determine the application running state of the application according to the process running states of all the processes of the application, and feed back a callback function to the application state probe. The process running state of each process in all the processes of the application comprises a window state, an audio use state and a video use state. The window state includes whether there is a focus window, that is, whether the corresponding window is a focus window, whether the corresponding window is switched to a maximized state or a minimized state, and the like. The audio usage status includes whether audio is used, such as whether an audio output event is present. The video usage status includes whether video is used, such as whether there is a GPU decoding event.
The application behavior probe can subscribe an application behavior event to the kernel state, and determine the application behavior of the application according to a callback function fed back by the kernel state.
It can be seen that the system probe module subscribes to various events of the electronic device 100 from the kernel mode, and then determines an application running state of an application running by the electronic device 100 according to a callback function fed back by the kernel mode, so as to obtain a probe state. After the system probe module obtains the probe state, the probe state can be fed back to the scene recognition module. After the scene recognition module receives the probe state, the scene recognition module can determine the user scene where the electronic device 100 is located according to the probe state. The user scene can reflect the current use requirement of the user and can comprise a video scene, a game scene, an office scene, a social scene and the like. The social scenes may include a variety of social sub-scenes, such as social sub-scene 1, social sub-scene 2, social sub-scene 3, and so on. For example, social sub-scene 1, social sub-scene 2, and social sub-scene 3 may be a text chat scene, a voice chat scene, and a video chat scene, respectively. It should be appreciated that the social scene may also include other social sub-scenes, which are not limited in this regard by embodiments of the present application.
For example, the system probe module subscribes to the kernel mode for various events of the electronic device 100, and then determines a probe state of the application state probe according to the callback function fed back by the kernel mode, where the probe state includes an application running state of the first application to which the focus window belongs. After the system probe module obtains the probe state, the probe state can be fed back to the scene recognition module. After the scene recognition module receives the probe state, the social scene in which the electronic device 100 is located can be determined according to the probe state.
For example, the scene recognition engine recognizes the focus window as WeChat TM When the electronic device 100 is determined to be in a social context. For example, the scene recognition engine may determine that the focus window is WeChat TM And is slightly informed of the chat window TM When the application is not using audio and video, it is determined that the electronic device 100 is in a text chat scenario. Alternatively, the scene recognition engine may recognize the focus window as a WeChat TM Chat window of (a)Oral and WeChat TM When the application uses audio and the video is not used, the electronic device 100 is determined to be in a voice chat scene. Alternatively, the scene recognition engine may recognize the focus window as a WeChat TM And is slightly informed of the chat window TM When the application uses video but not audio, it is determined that the electronic device 100 is in a video chat scenario.
As shown in fig. 3, the scheduling engine includes a load manager, a chip policy aggregator, and a scheduling executor. The load management controller can receive the scheduling strategy sent by the scene recognition module, and sends the scheduling strategy to the chip strategy fusion device or the scheduling executor for processing. The chip policy aggregator may determine an actual scheduling policy according to an actual operation condition of the electronic device 100 based on the chip platform type of the CPU and the scheduling policy sent by the load manager, and send the actual scheduling policy to the scheduling executor. The scheduling executor can receive the scheduling policy sent by the load controller or the chip policy fusion device, and schedule the resource according to the received scheduling policy.
In addition, the load management controller can also adjust the scheduling strategy sent by the scene recognition module, and then sends the adjusted scheduling strategy to the chip strategy fusion device or the scheduling executor. For example, the load manager may obtain a system load from the system probe module, and adjust the received scheduling policy according to the system load and the social scenario, to obtain an adjusted scheduling policy.
For example, the load manager may receive the scheduling policy sent by the scenario recognition module, where the scheduling policy 1 includes an OS scheduling policy and a CPU power consumption scheduling policy 1. The load manager may send the OS scheduling policy to a scheduling executor, which schedules based on the OS scheduling policy. The OS scheduling policy is used to adjust the process priority and I/O priority of the focal process. For example, the schedule executor may send an instruction to the process manager to adjust the process priority of the focal process, in response to which the process manager adjusts the process priority of the focal process. For another example, the scheduling executor may send an instruction to the I/O manager to adjust the I/O priority of the focal process, in response to which the I/O manager adjusts the I/O priority of the focal process.
The load management controller can also send the CPU power consumption scheduling policy 1 to the chip policy fusion device, the chip policy fusion device can obtain the CPU power consumption scheduling policy 2 based on the chip platform type of the CPU and the CPU power consumption scheduling policy 1, the CPU power consumption scheduling policy 2 is sent to the scheduling executor, and the scheduling executor performs scheduling according to the CPU power consumption scheduling policy 2.
The chip platform types of CPU are mainly divided into two types, namely super-Wired semiconductors CPU and +.about.of (Advanced Micro Devices, AMD)>These two types of CPUs are different in the adjustment manner of CPU power consumption, and therefore need to be distinguished. For example, if the type of the chip platform of the CPU is AMD (also referred to as the first type), the scheduling executor may send an instruction to the power manager to adjust EPP to adjust the energy efficiency ratio of the CPU (energy performance preference, EPP). In addition, the schedule executor may also send instructions to the OS2SOC driver to adjust PL1, PL2 to adjust the long-time-wise power consumption (PL 1) and the short-time-wise power consumption (PL 2) of the CPU. If the chip platform type of the CPU is +.>The scheduling executor can send the CPU power consumption scheduling policy 2 through an Intel DTT driver, wherein the CPU power consumption scheduling policy 2 can comprise a minimum value of PL1, a maximum value of PL1, durations of PL2 and EPP, and the CPU is driven by the Intel DTT driver to run based on the CPU power consumption scheduling policy 2.
The following takes the social application as a WeChat TM The application and the electronic device are exemplified by a notebook computer, and the interaction process of part of the modules in the electronic device shown in fig. 3 is described with reference to fig. 4. Referring to fig. 4, fig. 4 is a flowchart of a method for identifying a social scene according to an embodiment of the present application, where a flow for determining a social scene where an electronic device is located is as follows:
Step 401: the system probe module sends a request to the process manager to subscribe to a process creation event.
As shown in fig. 3, the scene recognition engine includes a system probe module that includes a system event probe that includes a process creation probe. In an embodiment of the present application, a request to subscribe to a process creation event may be sent by a process creation probe to a process manager.
For example, the process creation probe registers a callback with the process manager, and the function of registering the callback is that after the process manager creates the process, the process creation event can be returned to the oseeventdriver.
In an alternative embodiment, the request to subscribe to a process creation event may carry a process name. That is, the scene recognition engine may subscribe to only the creation events of the specified process, reducing interference of the creation events of irrelevant processes. For example, the specified process may be a process of a video application, a process of a game application, a process of an office application, a process of a social application, and so on. Of course, in other embodiments, the scenario recognition engine may not limit the subscribed process creation events.
In an alternative embodiment, the process creation probe may send a request to subscribe to a process creation event to the oseventpriver at the executable layer, which is forwarded to the process manager. For example, the oseeventdriver may register a callback with the process manager after receiving a request to subscribe to a process creation event, so that after the process manager creates a process, the process creation event is returned to the process creation probe.
Step 402: the system probe module sends a request to the API module to subscribe to a focus window change event.
As shown in fig. 3, the system probe module further includes a focus window probe that sends a request to the API module to subscribe to a focus window change event. For example, a request to subscribe to a focus window change event is sent by a focus window probe to a window event hooking tool (WinEventHookUtil).
The focus window change event may include whether the focus window changes, and may further include a state change of maximizing or minimizing the focus window, etc.
It should be noted that, a specific implementation process of subscribing the focus window change event from the API module by the system probe module will be described in detail in the following embodiment of fig. 8, and the embodiments of the present application are not described herein.
In an alternative embodiment, the system probe module may send a request to subscribe to a process creation event to the oseeventdriver located at the executable layer, which is forwarded to the API module.
The focus window is a window with focus, and the high probability is a window which is needed to be used by a user currently. Thus, by monitoring the focus window, it may be identified whether the current electronic device is in a social context. For example, if the application to which the focus window belongs is a social application, i.e., the focus window is a window of the social application, it indicates that it is currently in a social scene. Because the social scene generally comprises a plurality of social sub-scenes, when the application to which the focus window belongs is a social application, the social sub-scene in which the current electronic device is located can be further determined by combining the process running states of all the processes of the application to which the focus window belongs.
Step 403: the system probe module sends a request to the audio driver to subscribe to an audio usage event.
As shown in fig. 3, the system probe module further includes an audio-video status probe including an audio probe that sends a request to the audio driver to subscribe to an audio usage event. For example, a request to subscribe to a focus window change event is sent by an audio probe to an audio session manager (AudioSessionManager).
Wherein the audio usage event may include a default audio device change, an audio session state change of the default audio device, and the like.
It should be noted that, a specific implementation process of subscribing the audio usage event to the audio driver by the system probe module will be described in detail in the following embodiment of fig. 9, and the embodiments of the present application are not described herein.
In an alternative embodiment, the system probe module may send a request to subscribe to an audio usage event to the oseventpriver located at the executive layer, which is forwarded to the audio driver.
Step 404: the system probe module sends a request to the graphics card driver to subscribe to the video use event.
As shown in fig. 3, the system probe module further includes an audio/video status probe, which includes a video probe, which sends a request to the graphics card driver to subscribe to a video usage event.
Wherein the video use event may be a GPU decoded event. For example, a polling request is sent by the audio probe to the GPU performance counter to obtain GPU decoding events recorded by the CPU performance counter.
It should be noted that, a specific implementation process of subscribing the video use event to the video card driver by the system probe module will be described in detail in the following embodiment of fig. 10, and the embodiments of the present application are not described herein.
Step 405: responsive to user opening of WeChat TM Operation of applications, weChat TM The application sends a create process request to the process manager.
WeChat TM The application belongs to a social application, which is typically a multi-process application, so a process tree of the social application can be pre-built, the process tree including the application identification of the social application, and the process identifications of all the processes that the social application can initiate.
For example, weChat TM The process tree of an application may be as follows:
<!--WeChat-->
<Application.id=“7002”.name=“WeChat”.sceneType=“7”>
.....<process.num=“0”.name=“WeChat.exe”
.....<process.num=“1”.name=“WeChatAPP.exe”
.....<process.num=“2”.name=“WeChatBrowser.exe”
.....<process.num=“3”.name=“WeChatPlayer.exe”
.....<process.num=“4”.name=“WeChatPlayerHD.exe”
wherein application.id= "7002" represents WeChat TM The application ID of the application is "7002". The latter name= "WeChat" represents Wechat TM The application name of the application is "WeChat". sceneType= "7" means WeChat TM The type ID of the application type to which the application belongs is "7", and "7" represents a social application.
Where process.num is the process ID, and the latter name represents the process name. "WeChat.exe" is a chat window process, "WeChatAPP.exe" is an applet process, "WeChatProwser.exe" is a public number process, "WeChatPlayer.exe" is an audio chat process, "WeChatPlayerHD.exe" is a video chat process.
Step 406: process manager creates WeChat TM Process 1 of the application.
In the embodiment of the application, the electronic equipment runs WeChat TM Application, process manager needs to create the WeChat TM Process 1 of application, process 1 is used for creating WeChat TM The application main window comprises chat thumbnail information of a plurality of friends and a chat window of a certain friend.
Step 407: the process manager reports the process creation event to the system probe module.
As already described above, the system probe module sends a request to the process manager to subscribe to a process creation event, and registers a callback. Thus, the process manager is creating a WeChat TM After the process 1 is applied, a process creation event can be reported to the system probe module.
The process creation event may include, among other things, a process identification of the process created by the process manager, which may include one or more of a name and an ID of the process. In addition, the process creation event may also include an application identification of the application to which the created process belongs, which may include one or more of the name and ID of the application.
Step 408: in response to the call request of process 1, the API module creates window 1, with window 1 being the main window.
Process manager creates WeChat TM After process 1 is applied, process 1 includes thread 1, and thread 1 may actively call the windows user interface of the API module to create window 1. Illustratively, as shown in fig. 5 (a), the electronic device displays a window 0, where the window 0 is a desktop, which may also be referred to as a main interface. Window 0 includes WeChat TM An icon 101 of an application. The electronic device can receive the WeChat clicked by the user TM In response to the operation of the icon 101 of the application, as shown in (b) of fig. 5, the electronic device displays a window 1, the window 1 being a main window of the WeChat application. In the above procedure, the focus window is changed from the original window 0 to the window 1.
Step 409: the API module reports the focus window change event to the system probe module.
As shown in fig. 3, the system probe module includes a system event probe including a focus window probe to which the API module may report focus window change events.
The focus window change event may include a window identifier of a window 1 (a current focus window) that acquires focus and a process identifier of a process to which the window 1 belongs, and may also include a window identifier of a window 0 (a last focus window) that loses focus, a process identifier of a process to which the window 0 belongs, and a process identifier of a process to which the window 1 belongs.
After creating the window 1, the API module may obtain the process identifier of the process 1 corresponding to the window 1 (the current focus window) and the process identifier of the process 0 corresponding to the window 0 (the last focus window). Illustratively, process 1 is WeChat TM The process of the application is named WeChat. Exe. Process 0 is the process of the windows program manager, and the process name is explorer. Because the process names of the process 0 and the process 1 are inconsistent, the API module determines that the focus window changes, and reports a focus window change event to a system event probe of the system probe module.
The focus window probe may also maintain a correspondence between the focus window and the process. For example, the focus window probe may record the process identification of each focus window and corresponding process. After the focus window probe receives the focus window change event reported by the API module, the focus window probe can continuously record the changed focus window and the process identification of the process corresponding to the changed focus window.
For example, the correspondence between the focus window and the process maintained by the focus window probe may be as shown in table 1 below:
TABLE 1
In addition, the focus window probe can also maintain a window set of the application according to the corresponding relation between the maintained focus window and the process and the application to which the process belongs, wherein the window set of the application is used for recording window identifications of windows created by the application. In addition, after the process corresponding to a certain window in the window set of the application is closed, the focus window probe can also delete the window identifier of the window from the window set of the application.
For example, by WeChat TM Application ID of application is 001 as an example, weChat TM The window set for an application may be as shown in table 2 below:
TABLE 2
Application ID Window collection
001 1
Follow-up WeChat TM Other windows of the application may also be created at the WeChat TM The window identification of the created window continues to be added to the window set of the application.
As one example, the focus window probe may maintain a collection of windows for a particular application. The particular application may be a particular type of application, such as a social application, a video application, an office application, or a gaming application, among others. In addition, the window set of the application may be a visible window set, for recording window identifications of visible windows that have been created by the application.
It should be noted that, in the embodiment of the present application, only the window set of the application is maintained by the focal window probe as an example, it should be understood that the window set of the application may also be maintained by other probes of the system probe module, for example, by the application status probe, or the window set of the application may also be maintained by the scene recognition module, which is not limited in this embodiment of the present application.
Step 410: and the system probe module reports the focus window change event to the scene recognition module.
Step 411: system probe module for determining WeChat TM Application running state 1 of application, creating a first state record item, the first state record item comprising WeChat TM Application identification of the application and application running state 1.
The system probe module can determine the current focus window, namely the WeChat to which the window 1 belongs, according to the focus window change event TM The process running state of all processes of the application is according to WeChat TM WeChat determination for process running states of all processes of application TM The application running state 1 of the application is WeChat TM The application creates a first state record.
As shown in fig. 3, the system probe module includes an application state probe, which can determine WeChat according to probe states reported by the focus window probe, the audio probe and the video probe TM The process running state of all processes of the application.
Due to the current WeChat TM The application only starts the process 1, and the audio driver does not report the audio use event of the process 1, and the video driver does not report the video use event of the process 1, so that the process running state of the process 1 can be determined as follows: there is a focus window, unused audio and videoFrequency. WeChat can be determined according to the process running state of the process 1 TM The application running state 1 of the application is: there is a focus window, unused audio and video.
Step 412: the system probe module reports WeChat to the scene recognition module TM Application running state 1 of the application.
Step 413: the scene recognition module determines WeChat to which window 1 belongs TM The application type of the application is social application according to WeChat TM The application running state 1 of the application determines that the social scene where the electronic equipment is located is a text chat scene.
In addition, in response to the operation of opening other windows of the process 1 by the user, the API module may also create a window 2, where the window 2 is another window than the window 1, and both the window 1 and the window 2 belong to the process 1, that is, the window 1 and the window 2 belong to the same process.
In response to a user opening other windows, process 1 may create thread 2, thread 2 being used to create window 2. Thread 2 may actively call the windows user interface of the API module to create window 2.
After creating the window 2, the API module may obtain the process identifier of the process 1 corresponding to the window 2 (the current focus window) and the process identifier of the process 1 corresponding to the window 1 (the last focus window). Because the process identifiers of the processes corresponding to the window 2 and the window 1 are the same, for example, the process names of the processes 1 are WeChat. Exe, which indicates that the window 2 and the window 1 belong to the same process, and under the condition that the focus window before and after the change belongs to the same process, the API module can determine that the focus window is unchanged, and does not report a focus window change event to a system event probe of the system probe module.
In another embodiment, the API module may report a focus window change event to the system probe module if the focus windows before and after the change belong to the same process. And if the system probe module determines that the process identifiers corresponding to the focus windows before and after the change are the same according to the focus window change event, the system probe module does not send the focus window change event to the scene recognition module. Or if the system probe module determines that the process identifiers corresponding to the focus windows before and after the change are the same according to the focus window change event, sending the focus window change event to the scene recognition module, and if the scene recognition module determines that the process identifiers corresponding to the focus windows before and after the change are the same according to the focus window change event, not executing the application running state of the focus application to which the focus window belongs, and determining the social scene according to the application running state.
Step 414: responding to the operation of the user for starting the voice chat TM The application sends a create process request to the process manager.
Step 415: process manager creates WeChat TM Application process 2, process 2 is a voice chat process.
Step 416: the process manager reports the process creation event to the system probe module.
As already described above, the system probe module sends a request to the process manager to subscribe to a process creation event, and registers a callback. Thus, the process manager is creating a WeChat TM After process 2 of the application, a process creation event may be reported to the system probe module.
The process creation event may include an identifier of the process 2 created by the process manager, and may also include an application identifier of an application to which the process 2 belongs.
Step 417: in response to the call request of process 2, the API module creates window 3, window 3 being a voice chat window.
As shown in fig. 6 (a), the electronic device displays a window 1, the window 1 including a voice chat button 102. The user may click on the voice chat button 102, and in response to the click operation by the user, as shown in fig. 6 (b), the electronic device displays a window 3, the window 3 being a voice chat window. In the above procedure, the focus window is changed from the original window 1 to the window 3.
Step 418: the API module reports the focus window change event to the system probe module.
After creating window 3, the API module may obtain the process identifier of process 2 corresponding to window 3 (current focus window) and the process of process 1 corresponding to window 1 (last focus window) And (5) identification. Illustratively, process 2 is WeChat TM The application process is named WeChatPlayer. Exe, and process 1 is WeChatPlayer WeChat TM The process of the application is named WeChat. Exe. Because the process names of the process 2 and the process 1 are inconsistent, the API module determines that the focus window changes, and reports a focus window change event to a system event probe of the system probe module.
Step 419: and the system probe module reports the focus window change event to the scene recognition module.
Step 420: the audio driver reports the audio usage event of process 2 to the system probe module.
After creation of process 2, the audio driver can detect an audio usage event for process 2 because process 2 is a voice chat process. After detecting the audio usage event of process 2, the audio usage event of process 2 may be reported to the system probe module.
For example, the audio driver includes an audio session manager, the system probe module includes an audio probe, and the audio probe module includes an audio probe module TM After the application performs voice chat, the audio session manager may detect the audio usage event of the process 2, and report the audio usage event of the process 2 to the audio probe.
For example, the audio driver may detect an audio session state change event of the process 2, and report the audio session state change event of the process 2 to the system probe module, where the audio session state change event is used to indicate that the audio session state of the process 2 is changed from an inactive state to an active state.
Step 421: system probe module for determining WeChat TM Application running state 2 of application, updating WeChat according to application running state 2 TM A first state record of the application.
For example, after receiving the focus window change event, the system probe module may determine the current focus window, i.e., the WeChat to which window 1 belongs TM The process running state of all processes of the application is according to WeChat TM WeChat determination for process running states of all processes of application TM Application running state 2 of application, updating WeChat according to application running state 2 TM A first state record of the application.
Wherein the updated first state record item comprises WeChat TM Application identification of the application and application running state 2.
As shown in fig. 3, the system probe module includes an application state probe, which can determine WeChat according to probe states reported by the focus window probe, the audio probe and the video probe TM The process running state of all processes of the application.
Due to the current WeChat TM The application starts the process 1 and the process 2, and the audio driver reports the audio use event of the process 2, and the video driver does not report the video use event of the process 1 and the process 2 yet, so that the process running state of the process 1 can be determined as follows: the focus window does not exist, audio and video are not used, and the process running state of the process 2 is as follows: there is a focus window, using audio but not video. WeChat can be determined according to the process running states of the process 1 and the process 2 TM The application running state 2 of the application is: there is a focus window, using audio but not video.
For example, by WeChat TM Application ID of application is 001 as an example, weChat TM The correspondence between the process running states of all the processes of the application and the application running states can be shown in the following table 3:
TABLE 3 Table 3
Step 422: the system probe module reports WeChat to the scene recognition module TM Application running state 2 of the application.
Step 423: the scene recognition module determines the WeChat to which the window 3 belongs TM The application type of the application is social application according to WeChat TM Application running state 2 of application determines social contact in which electronic device is locatedThe scene is a voice chat scene.
After receiving the focus window change event, the scene recognition module can determine the current focus window, namely window 3, according to the focus window change event, and then determine the WeChat to which window 3 belongs TM The application type of the application, if the application type is a social application, according to WeChat TM The application running state 2 of the application determines that the social scene in which the electronic device is located is a voice chat scene.
Step 424: wechat responding to user switching video chat operation TM The application sends a create process request to the process manager.
Step 425: process manager closes WeChat TM Process 2 of application, creation of WeChat TM Application process 3, process 3 is a video chat process.
Step 426: the process manager reports the process creation event to the system probe module.
As already described above, the system probe module sends a request to the process manager to subscribe to a process creation event, and registers a callback. Thus, the process manager is creating a WeChat TM After process 3 of the application, a process creation event may be reported to the system probe module.
Step 427: in response to the closing request of the process 2 and the calling request of the process 3, the API module closes the window 3, creates the window 4, and the window 4 is a video chat window.
Process manager creates WeChat TM After the process 3 of the application, the process 3 may actively call the windows user interface of the API module to create the window 3. Illustratively, as shown in fig. 7 (a), the electronic device displays a window 1 and a window 3, the window 1 including a video chat button 103, the window 3 being a voice chat window. The electronic device can receive an operation in which the user clicks the video chat button 103 in the window 1, and in response to the operation, as shown in (b) of fig. 7, the electronic device closes the window 3, displaying the window 4. In the above procedure, the focus window is changed from the original window 3 to the window 4.
Step 428: the API module reports the focus window change event to the system probe module.
As shown in fig. 3, the system probe module includes a system event probe including a focus window probe to which the API module may report focus window change events.
The focus window change event may include, among other things, a window identification of the window 3 that lost focus (the last focus window) and a window identification of the window 4 that acquired focus (the current focus window). In addition, the focus window change event may further include a process identifier of a process to which the window 3 belongs and a process identifier of a process to which the window 4 belongs.
After the API module creates the window 4, the process identifier of the process 3 corresponding to the window 4 (the current focus window) and the process identifier of the process 2 corresponding to the window 3 (the last focus window) may be obtained. Illustratively, process 3 is WeChat TM The application process is named WeChatPlayer. Exe, and process 2 is WeChatPlayer WeChat TM The process of the application is named WeChatPlayerHD. Exe. Because the process names of the process 3 and the process 2 are inconsistent, the API module determines that the focus window changes, and reports a focus window change event to a system event probe of the system probe module.
Step 429: and the system probe module reports the focus window change event to the scene recognition module.
Step 430: the video driver reports the video usage event of process 3 to the system probe module.
For example, the system probe module includes a video probe, and after process 3 is created, since process 3 is a video chat process, the video driver can detect a video usage event of process 3. Upon detecting a video usage event for process 3, the video driver may report an audio usage event for process 3 to the video probe.
Wherein the video use event may be a GPU decoded event. For example, the video driver detects that process 3 is decoding using the GPU and reports the GPU decoded event of process 2 to the video probe.
Step 431: the system probe module determines the WeChat to which the window 4 belongs according to the focus window change event TM The process running state of all processes of the application is according to WeChat TM WeChat determination for process running states of all processes of application TM Application running state 3 of the application, updating WeChat according to the application running state 3 TM A first state record of the application.
Wherein the updated first state record item comprises WeChat TM Application identification of the application and application running state 2.
As shown in fig. 3, the system probe module includes an application state probe, which can determine WeChat according to probe states reported by the focus window probe, the audio probe and the video probe TM The process running state of all processes of the application.
Due to the current WeChat TM The application starts the process 1 and the process 3, closes the process 2, and the video driver reports the video use event of the process 3, so that the process running state of the process 1 is as follows: the focus window exists, audio and video are not used, and the process running state of the process 3 is as follows: there is a focus window, using video but not audio. WeChat can be determined according to the process running states of the process 1 and the process 3 TM The application running state 3 of the application is: there is a focus window, using video but not audio.
For example, by WeChat TM Application ID of application is 001 as an example, weChat TM The correspondence between the process running states of all the processes of the application and the application running states can be shown in the following table 4:
TABLE 4 Table 4
That is, the application state probe may maintain a first state record of the application, that is, maintain a correspondence between the application identifier and the application running state, so that the scene recognition module queries the application running state of the application according to the application identifier. In addition, the application state probe can also maintain a second state record item of the application, namely, maintain the application identifier and the process running states of all the processes of the application through the focus window probe, the audio probe and the video probe, so as to query the process running states of all the processes of the application according to the application identifier.
When the application state probe determines that the process running state of any process of the application is changed through the probe states of one or more probes of the focus window probe, the audio probe and the video probe, the process running state of the process in the second state record item can be updated according to the changed process running state. If it is determined that the application running state of the application is changed according to the updated process running states of all the processes, the application running state of the application in the first state record item can be updated according to the changed application running state.
Step 432: the system probe module reports WeChat to the scene recognition module TM Application running state 3 of the application.
Step 433: the scene recognition module determines the WeChat to which the window 4 belongs according to the focus window change event TM The application type of the application is social application according to WeChat TM The application running state 3 of the application determines that the social scene where the electronic device is located is a video chat scene.
In addition, after the scene recognition module recognizes the social scene where the electronic device is located, the recognized social scene can be sent to the policy matching manager, the policy matching manager determines a scheduling policy for matching the social scene, the scheduling policy is issued to the kernel mode, and the kernel mode schedules the resource according to the scheduling policy.
Next, taking the example that the system probe module includes a focus window probe (focus window probe), the API module includes a window event hook tool (wineventhookuitil), a procedure in which the focus window probe subscribes to a focus window change event from the window event hook tool is illustrated.
Referring to fig. 8, fig. 8 is a flowchart illustrating a system probe module subscribing to an API module for a focus window change event according to an embodiment of the present application, and as shown in fig. 8, the method includes the following steps:
step 801: an Observer (browser) registers a probe callback with a probe manager (ProbeManager).
The observer is a reporting object of the probe state of the focus window probe. For example, the observer may be another probe in the system probe module, a scene recognition module, or oseeventdriver, etc.
Step 802: the probe manager registers a probe callback of the focus window probe with the focus window probe.
The probe callback of the focus window probe is registered so that after the probe callback is registered, the focus window probe can report the probe state to an observer through a callback function.
Step 803: the focus window probe sends an install system event hook request to the window event hook tool.
The install system event hook request requests that the window event hook tool, upon detecting a window change event, report the window change event to the focus window probe.
Step 804: the window event hooking tool sends a window change event of any process to the focus window probe when detecting the window change event of the window of the process.
The window change event may include, among other things, a focus window change, a window size change, a window position change, and the like. Window size changes may include maximizing or minimizing state change events, and the like. Focal window changes include losing focus or acquiring focus, etc.
Step 805: the focus window probe filters out focus window change events from window change events, and maximizes or minimizes state change events, etc.
Step 806: when it is determined that the focus window is changed based on the filtered window change event, the focus window probe may send a focus window change event to the observer.
Thus, the focus window probe can detect the focus window change of the window corresponding to any process, and the window state change such as the maximization or minimization of the state change and the like.
Next, a process in which the system probe module includes an audio probe (AudioProbe), and the audio driver includes an audio session manager (audiosession manager) is exemplified as an audio probe subscribing to an audio usage event from the windowed audio session manager.
Referring to fig. 9, fig. 9 is a schematic flow chart of subscribing an audio usage event to an audio driver by a system probe module according to an embodiment of the present application, and as shown in fig. 9, the method includes the following steps:
step 901: the observer registers a probe callback with the probe manager.
The observer is a report object of the probe state of the audio probe. For example, the observer may be another probe in the system probe module, a scene recognition module, or oseeventdriver, etc.
Step 902: the probe manager registers probe callbacks with the audio probes.
Step 903: the audio probe registers a default audio device change notification with the audio session manager.
Step 904: the audio session manager sends a default audio device change notification to the audio probe upon detecting a change in the default audio device.
The default audio device change notification may include a device identifier of the default audio device after the change, or may include a device identifier of the default audio device before the change.
The default audio device may be a speaker, a sound device, a headset, or the like. For example, the audio session manager may send a default audio device change notification to the audio session manager upon detecting that the default audio device is changed from sound to headphones, or vice versa.
Step 905: the audio probe registers an audio session state change notification with the audio session manager.
For example, the audio probe may enumerate audio sessions using a default audio device, registering for state change notifications for those audio sessions. The state change notification of the audio session may include a state after the audio session is changed or may include a state before the audio session is changed. For example, the state change state may include a change from an activated state to an inactivated state, a change from an inactivated state to an activated state, and the like. The active state is used to indicate that a corresponding audio session is ongoing.
Step 906: if the audio session manager detects the audio session state change of any process, the audio session manager sends an audio session state change notification of the process to the audio probe.
Step 907: the audio probe sends an audio session state change notification for the process to the observer.
Next, taking the example that the system probe module includes a video probe (AudioProbe), the video driver includes a GPU performance counter, a process of subscribing the GPU decoding event to the GPU performance counter by the video probe is illustrated.
Referring to fig. 10, fig. 10 is a flowchart illustrating a system probe module decoding events from a GPU to a video driver subscription, and as shown in fig. 10, the method includes the following steps:
Step 1001: the observer registers a probe callback with the probe manager.
The observer is a report object of the probe state of the audio probe. For example, the observer may be another probe in the system probe module, a scene recognition module, or oseeventdriver, etc.
Step 1002: the probe manager registers probe callbacks with the video probes.
Step 1003: the video probe sends a poll request to the GPU performance counter.
The GPU performance counter may record a process identification of a process that is using the GPU for audio-video decoding. The poll request is used to request data that is periodically acquired from the GPU performance counter.
The polling period may be preset, for example, the polling period may be 10 seconds, and the polling request is used to request that the data recorded by the GPU performance counter be acquired every 10 seconds.
Step 1004: the GPU performance counter periodically sends a process identification to the video probe that audio and video decoding is being performed using the GPU.
The GPU performance counter may periodically obtain, according to a polling period, a recorded process identifier of the GPU that is being used for audio/video decoding, and send the obtained data to the video probe. For example, the GPU performance counter obtains the recorded data every 10 seconds, and sends the recorded data to the video probe.
It should be appreciated that the video probe may also periodically send a data acquisition request to the video probe requesting acquisition of the data recorded by the GPU performance counter, so that the data recorded by the GPU performance counter may be periodically acquired.
Step 1005: the video probe receives the process identification which is sent by the GPU performance counter and is used for audio and video decoding by using the GPU, and compares the currently received process identification which is used for audio and video decoding by using the GPU with the process identification which is recorded in the history and is used for audio and video decoding by using the GPU.
Step 1006: and if the previously received process identifier of the GPU in audio and video decoding is not matched with the history record process identifier of the GPU in audio and video decoding, sending a GPU decoding event change notification to an observer.
The GPU decoding event change notification may include a process identifier of a process that uses the GPU to perform the use state change of the audio/video decoding and a corresponding use state change. The change in the use state includes a change from audio/video decoding using the GPU to audio/video decoding without using the GPU, or a change from audio/video decoding without using the GPU to audio/video decoding with the GPU.
The embodiment of the application also provides electronic equipment, which comprises a memory and one or more processors;
wherein the memory is for storing computer program code, the computer program code comprising computer instructions; the computer instructions, when executed by the processor, cause the electronic device to perform the functions or steps of the method embodiments described above. The structure of the electronic device may refer to the structure of the electronic device 100 shown in fig. 1.
The present application also provides a chip system including at least one processor 1101 and at least one interface circuit 1102, as shown in FIG. 11. The processor 1101 and interface circuit 1102 may be interconnected by wires. For example, interface circuit 1102 may be used to receive signals from other devices (e.g., a memory of an electronic apparatus). For another example, the interface circuit 1102 may be used to send signals to other devices (e.g., the processor 1101). The interface circuit 1102 may, for example, read instructions stored in a memory and send the instructions to the processor 1101. The instructions, when executed by the processor 1101, may cause the electronic device to perform the various steps of the embodiments described above. Of course, the system-on-chip may also include other discrete devices, which are not particularly limited in accordance with embodiments of the present application.
The embodiment of the application also provides a computer storage medium, which comprises computer instructions, when the computer instructions are run on the electronic device, the electronic device is caused to execute the functions or steps executed by the electronic device in the embodiment of the method.
The embodiment of the application also provides a computer program product which, when run on a computer, causes the computer to execute the functions or steps executed by the mobile phone in the above method embodiment.
It may be understood that, in order to implement the above-mentioned functions, the electronic device provided in the embodiment of the present application includes corresponding hardware structures and/or software modules for executing each function. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
The embodiment of the application can divide the functional modules of the electronic device according to the method example, for example, each functional module can be divided corresponding to each function, or two or more functions can be integrated in one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
It will be apparent to those skilled in the art from this description that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of specific embodiments of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (16)

1. A method of identifying a social context, for application to an electronic device, the method comprising:
responding to a first operation of a user, and displaying a first window, wherein the first window is a focus window;
determining an application type of a first application to which the first window belongs;
if the application type of the first application is social application, determining an application running state of the first application, wherein the application running state is determined according to process running states of all processes of the first application, the process running states comprise a window state, an audio using state and a video using state, and all processes of the first application refer to all processes which are running of the first application and have visible windows;
and determining the social scene of the electronic equipment according to the application running state of the first application.
2. The method of claim 1, wherein the determining the application running state of the first application comprises:
acquiring process running states of all processes of the first application, and determining the application running state of the first application according to the process running states of all processes of the first application;
or,
and acquiring the application running state of the first application from a first state record item of the first application according to the application identifier of the first application, wherein the first state record item stores the application identifier and the application running state of the first application, and the first state record item is created after the first application is started.
3. The method of claim 2, wherein before the acquiring the application running state of the first application from the first state record of the first application according to the application identifier of the first application, further comprises:
acquiring process running states of all processes of the first application;
determining an application running state of the first application according to the process running states of all the processes of the first application;
and correspondingly storing the application identifier and the application running state of the first application, wherein the correspondingly stored application identifier and application running state of the first application are the first state record items.
4. The method of claim 2, wherein the electronic device comprises a system probe module comprising a focus window probe for detecting window state changes of any process, an audio probe for detecting audio use state changes of any process, and a video probe for detecting video use state changes of any process;
the obtaining the process running states of all the processes of the first application includes:
determining the window state of each process in all processes of the first application according to the probe state of the focus window probe;
according to the probe state of the audio probe, determining the audio use state of each process in all processes of the first application;
and determining the video use state of each process in all processes of the first application according to the probe state of the video probe.
5. The method of claim 2, wherein the obtaining process running states of all processes of the first application comprises:
and acquiring the process running states of all the processes of the first application from a second state record item of the first application according to the application identifier of the first application, wherein the second state record item stores the application identifier of the first application and the process running states of all the processes running by the first application.
6. The method of claim 5, wherein before the process running states of all the processes of the first application are obtained from the second state record of the first application according to the application identifier of the first application, further comprising:
after a first process of the first application is started, if the first process is a first process started by the first application, creating a second state record item for the first application, adding a process running state of the first process in the second state record item, wherein the first process is any process of the first application;
and if the first process is not the first process started by the first application, determining the created second state record item according to the application identifier of the first application, and adding the process running state of the first process in the second state record item.
7. The method of claim 6, wherein the electronic device comprises a system probe module comprising a focus window probe for detecting window state changes of any process, an audio probe for detecting audio use state changes of any process, and a video probe for detecting video use state changes of any process;
Before the process running state of the first process is added in the second state record item, the method further comprises:
determining the window state of the first process according to the probe state of the focus window probe;
determining an audio use state of the first process according to the probe state of the audio probe;
and determining the video use state of the first process according to the probe state of the video probe.
8. The method of claim 5, wherein the second state record stores an application identifier of the first application and a process running state of a first process of the first application, the first process being any process of the first application; the method further comprises the steps of:
if a focus window change event of the first process is detected, updating a window state of the first process according to the focus window change event, wherein the window state comprises whether a corresponding window is a focus window or not;
if an audio use state change event of the first process is detected, updating the audio use state of the first process according to the audio use state change event;
and if the video use state change event of the first process is detected, updating the video use state of the first process according to the video use state change event.
9. The method of claim 3, wherein after storing the application identification of the first application and the application running state correspondence, further comprising:
and deleting the first state record item after the first application exits.
10. The method of claim 9, wherein after the first application exits, before deleting the first state record, further comprising:
after a second process of the first application is closed, if the second process has a corresponding second window, deleting a window identifier of the second window from a window set of the first application, wherein the window set stores window identifiers of windows created by the first application, and the second process is any process of the first application;
and after deleting the window identifier of the second window, if the window set of the first application is empty, determining that the first application exits.
11. The method of claim 10, wherein the method further comprises:
and after deleting the window identifier of the second window, if the window set of the first application is not empty, determining that the first application is not exited.
12. The method of any one of claims 1-11, wherein determining, according to an application running state of the first application, a social scenario in which the electronic device is located includes:
if the application running state of the first application is that a focus window exists and audio and video are not used, determining that a social scene where the electronic equipment is located is a first social sub-scene;
if the application running state of the first application is that a focus window exists, audio is used, but video is not used, determining that a social scene where the electronic equipment is located is a second social sub-scene;
if the application running state of the first application is that a focus window exists and the video is used when audio is not used, determining that the social scene where the electronic equipment is located is a third social sub-scene;
and if the application running state of the first application is that a focus window exists and audio and video are used, determining that the social scene where the electronic equipment is located is a fourth social sub-scene.
13. The method of any one of claims 1-11, wherein after determining, according to the application running state of the first application, a social scenario in which the electronic device is located, further includes:
Determining a scheduling policy matched with a social scene in which the electronic equipment is located;
and adjusting the resources of the electronic equipment according to the scheduling strategy.
14. The method of claim 13, wherein the scheduling policies include an operating system OS scheduling policy and a central processing unit CPU power consumption scheduling policy;
the adjusting the resources of the electronic device according to the scheduling policy includes:
adjusting the process priority and the input/output (I/O) priority of a first process corresponding to the first window according to the OS scheduling strategy;
and adjusting the power consumption of the CPU of the electronic equipment according to the CPU power consumption scheduling strategy.
15. An electronic device, the electronic device comprising: a memory and one or more processors;
wherein the memory is for storing computer program code, the computer program code comprising computer instructions; the computer instructions, when executed by the processor, cause the electronic device to perform the method of any of claims 1-14.
16. A computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of any of claims 1-14.
CN202210529466.5A 2022-05-16 2022-05-16 Method for identifying social scene, electronic equipment and computer readable storage medium Active CN116055443B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210529466.5A CN116055443B (en) 2022-05-16 2022-05-16 Method for identifying social scene, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210529466.5A CN116055443B (en) 2022-05-16 2022-05-16 Method for identifying social scene, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN116055443A CN116055443A (en) 2023-05-02
CN116055443B true CN116055443B (en) 2023-11-14

Family

ID=86112058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210529466.5A Active CN116055443B (en) 2022-05-16 2022-05-16 Method for identifying social scene, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116055443B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107450988A (en) * 2017-07-31 2017-12-08 广东欧珀移动通信有限公司 Resource allocation method and Related product
CN107517306A (en) * 2017-07-31 2017-12-26 广东欧珀移动通信有限公司 Resource allocation method and Related product
CN107861814A (en) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 Resource allocation method and equipment
CN109992400A (en) * 2017-12-29 2019-07-09 广东欧珀移动通信有限公司 Resource allocation methods, device, mobile terminal and computer readable storage medium
CN114443256A (en) * 2022-04-07 2022-05-06 荣耀终端有限公司 Resource scheduling method and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8954980B2 (en) * 2011-11-11 2015-02-10 Qualcomm Incorporated Conserving power through work load estimation for a portable computing device using scheduled resource set transitions
US10503233B2 (en) * 2017-04-14 2019-12-10 Intel Corporation Usage scenario based monitoring and adjustment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107450988A (en) * 2017-07-31 2017-12-08 广东欧珀移动通信有限公司 Resource allocation method and Related product
CN107517306A (en) * 2017-07-31 2017-12-26 广东欧珀移动通信有限公司 Resource allocation method and Related product
CN107861814A (en) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 Resource allocation method and equipment
CN109992400A (en) * 2017-12-29 2019-07-09 广东欧珀移动通信有限公司 Resource allocation methods, device, mobile terminal and computer readable storage medium
CN114443256A (en) * 2022-04-07 2022-05-06 荣耀终端有限公司 Resource scheduling method and electronic equipment

Also Published As

Publication number Publication date
CN116055443A (en) 2023-05-02

Similar Documents

Publication Publication Date Title
CN115599513B (en) Resource scheduling method and electronic equipment
WO2020108356A1 (en) Application display method and electronic device
KR102148948B1 (en) Multi tasking method of electronic apparatus and electronic apparatus thereof
US20210389973A1 (en) Electronic device and method for operating the same
US20150130705A1 (en) Method for determining location of content and an electronic device
WO2020037611A1 (en) Method and electronic device for processing notification message
WO2021052415A1 (en) Resource scheduling method and electronic device
US10432926B2 (en) Method for transmitting contents and electronic device thereof
CN116028205B (en) Resource scheduling method and electronic equipment
WO2022078105A1 (en) Memory management method, electronic device, and computer-readable storage medium
CN111381996B (en) Memory exception handling method and device
CN116025580B (en) Method for adjusting rotation speed of fan and electronic equipment
CN116028210B (en) Resource scheduling method, electronic equipment and storage medium
CN116069209A (en) Focus window processing method, device, equipment and storage medium
CN116027879B (en) Method for determining parameters, electronic device and computer readable storage medium
CN116055443B (en) Method for identifying social scene, electronic equipment and computer readable storage medium
CN116028211A (en) Display card scheduling method, electronic equipment and computer readable storage medium
WO2021052489A1 (en) Method for determining fault computing core in multi-core processor and electronic device
CN116028005B (en) Audio session acquisition method, device, equipment and storage medium
CN116027880B (en) Resource scheduling method and electronic equipment
CN116028208B (en) System load determining method, device, equipment and storage medium
CN116028209B (en) Resource scheduling method, electronic equipment and storage medium
CN116089055B (en) Resource scheduling method and device
CN116028207B (en) Scheduling policy determination method, device, equipment and storage medium
CN116027878B (en) Power consumption adjustment method and electronic equipment

Legal Events

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