Method, equipment and product for improving fluency of desktop system starting application program

By establishing the memory data files required for application operation and automatically closing the process that consumes the largest memory according to the current memory situation, the lag caused by insufficient memory when the application is started in the existing technology is solved, and the stable and smooth startup of the desktop system is achieved.

CN120066612APending Publication Date: 2025-05-30KYLIN CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510153442.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, when opening an application that consumes a large amount of memory, insufficient system memory leads to a long wait time, the desktop system is prone to lag, and when the system is low, the system may accidentally close necessary processes, resulting in desktop logout.

Method used

By establishing a data file that records the memory space required for the application to run, query the data file to obtain the memory requirements for starting the application, obtain the current available remaining memory. If the required memory is less than the available memory, start the application directly. If the required memory is greater than the available memory, close the process with the largest memory space currently occupied, and then start the application.

Benefits of technology

It realizes that while ensuring the normal operation of the desktop system, automatically terminates the process of high memory occupancy, frees memory in advance, and improves the smoothness of starting the application. It has the characteristics of rapid startup, strong stability and small calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066612A_ABST
    Figure CN120066612A_ABST
Patent Text Reader

Abstract

The invention discloses a method, equipment and a product for improving the fluency of starting an application program by a desktop system. The method comprises the following steps: establishing a data file for recording a memory space occupied by the running of the application program; querying the data file, and obtaining a memory space occupied by running of an application program needing to be started on the desktop system; obtaining the current available remaining memory of the desktop system; if the memory space occupied by running of the application program needing to be started is larger than the current available remaining memory, starting the application program needing to be started after closing the process, occupying the maximum memory space currently, of the desktop system; the method can ensure the normal operation of the desktop system, does not need human intervention, actively closes part of processes in advance, releases the memory in advance, improves the fluency of starting the application program, and has the characteristics of rapid starting, strong stability and small calculation amount.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of desktop system data processing, and in particular, relates to a method, device and product for improving the fluency of starting application programs in a desktop system. Background Art

[0002] Under the existing technical conditions, when opening an application program that occupies a large amount of memory, if the system memory does not meet the requirements of the application program, it is necessary to wait for the system to release memory, resulting in a too long waiting time, and the desktop system is prone to jamming during this period; at the same time, in order to ensure the stable operation of the system when the memory is low, the desktop system usually uses the Out Of Memory (OOM) mechanism to manage all processes, and it is easy to accidentally close some necessary processes, resulting in desktop logout and inability to continue using. Summary of the Invention

[0003] In view of this, the present invention aims to overcome the defects in the prior art and proposes a method, device and product for improving the fluency of starting application programs in a desktop system.

[0004] To achieve the above object, the technical solution of the present invention is realized as follows:

[0005] In a first aspect, the present invention discloses a method for improving the fluency of starting application programs in a desktop system, including:

[0006] Establish a data file recording the memory space required for the operation of the application program;

[0007] Query the data file to obtain the memory space required for the operation of the application program to be started on the desktop system;

[0008] Obtain the current available remaining memory of the desktop system;

[0009] If the memory space required for the operation of the application program to be started is less than the current available remaining memory, start the application program to be started;

[0010] If the memory space required for the operation of the application program to be started is greater than the current available remaining memory, after closing the process with the largest memory space occupied on the desktop system, start the application program to be started.

[0011] In an embodiment of the present invention, the method further includes: establishing a process blacklist file for recording the names of processes prohibited from being closed;

[0012] If the memory space required for the application to be launched is greater than the current available free memory, then after closing the process that occupies the largest memory space in the desktop system, launch the application to be launched, including: closing the process that occupies the largest memory space in the desktop system and is not recorded in the process blacklist file.

[0013] In an embodiment of the present invention, according to the process blacklist file, set the current processes of the desktop system recorded in the process blacklist file as processes not to be processed by the out-of-memory (OOM) mechanism.

[0014] In an embodiment of the present invention, establish a data file recording the memory space required for the application to run, including: after the desktop system installs a new application, update the data file correspondingly.

[0015] In an embodiment of the present invention, use a real-time file event monitoring tool to determine the application to be launched on the desktop system.

[0016] In an embodiment of the present invention, closing the process that occupies the largest memory space in the desktop system includes: closing the process that occupies the largest memory space in the desktop system by sending a process termination signal.

[0017] In an embodiment of the present invention, after the desktop system installs a new application, updating the data file correspondingly includes: if the desktop system installs a new application, pop up a window to prompt for corresponding update of the data file.

[0018] In a second aspect, the present invention discloses a device for improving the fluency of launching applications on a desktop system. The device includes:

[0019] A data module for establishing a data file recording the memory space required for the application to run;

[0020] A query module for querying the data file to obtain the memory space required for the application to be launched on the desktop system to run;

[0021] An acquisition module for acquiring the current available free memory of the desktop system;

[0022] A first startup module for launching the application to be launched if the memory space required for the application to be launched is less than the current available free memory;

[0023] A second startup module for launching the application to be launched after closing the process that occupies the largest memory space in the desktop system if the memory space required for the application to be launched is greater than the current available free memory.

[0024] In a third aspect, the present invention discloses an electronic device, including: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the above method.

[0025] In a fourth aspect, the present invention discloses a computer program product, including a computer program which, when executed by a processor, implements the above method.

[0026] Compared with the prior art, the present invention has the following advantages:

[0027] The present invention discloses a method, device and product for improving the fluency of starting application programs in a desktop system, including: establishing a data file recording the memory space required for running application programs; querying the data file to obtain the memory space required for running the application programs to be started on the desktop system; obtaining the current available remaining memory of the desktop system; if the memory space required for running the application programs to be started is less than the current available remaining memory, starting the application programs to be started; if the memory space required for running the application programs to be started is greater than the current available remaining memory, after closing the process that occupies the largest memory space in the current desktop system, starting the application programs to be started; the method, device and product for improving the fluency of starting application programs in a desktop system disclosed by the present invention can, while ensuring the normal operation of the desktop system, actively and proactively close some processes in advance without manual intervention, release memory in advance, and improve the fluency of starting application programs, and has the characteristics of rapid startup, strong stability and small computational amount. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention.

[0029] In the drawings:

[0030] Figure 1 is a schematic diagram of an application scenario of a method for improving the fluency of starting application programs in a desktop system according to an embodiment of the present invention;

[0031] Figure 2 is a schematic diagram of a method for improving the fluency of starting application programs in a desktop system according to an embodiment of the present invention;

[0032] Figure 3 is a schematic diagram of the thread closing order of a method for improving the fluency of starting application programs in a desktop system according to an embodiment of the present invention;

[0033] Figure 4 is a schematic diagram of a device for improving the fluency of starting application programs in a desktop system according to an embodiment of the present invention;

[0034] Figure 5 Schematic diagram of an electronic device for improving the fluency of starting application programs in an embodiment of the present invention. Detailed implementation manners

[0035] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other.

[0036] In the description of the present invention, it should be further noted that the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise specified, the meaning of "a plurality of" is two or more.

[0037] The present invention discloses a method, device and product for improving the fluency of starting application programs in a desktop system. The application scenario is as Figure 1 shown. Under the existing technical conditions, when opening an application program that occupies a large amount of memory, if the system memory does not meet the requirements of the application program, it is necessary to wait for the system to release the memory, resulting in too long waiting time, and the desktop system is prone to freeze during this period. The present invention discloses a method, device and product for improving the fluency of starting application programs in a desktop system. By establishing a data file recording the memory space required for the operation of the application program, and according to the current available remaining memory situation of the desktop system, the process occupying the largest memory space is closed in advance, which can automatically terminate the process with high memory occupancy while ensuring the normal operation of the desktop system, improve the fluency of starting application programs, and has the characteristics of rapid startup, strong stability and small calculation amount.

[0038] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

[0039] In an embodiment disclosed by the present invention, as Figure 2 shown, a method for improving the fluency of starting application programs in a desktop system includes:

[0040] Step 201, establish a data file recording the memory space required for the operation of the application program;

[0041] In this embodiment, after a new application program is installed in the desktop system, the data file is updated correspondingly. If a new application program is installed in the desktop system, a pop-up window prompts to update the data file correspondingly.

[0042] The function of updating the data file can facilitate the maintenance by system maintainers.

[0043] In this embodiment, the desktop system is a Linux desktop system.

[0044] In this embodiment, for the memory space required for an application to run, the memory occupancy data file is generated by the massif component of the memory checking tool valgrind. By analyzing the collected data of "heap_tree = peak" in the memory occupancy data file, the mem_heap_B parameter and the mem_heap_extra_B parameter are obtained. The sum of the two is the memory space required for this application to run. Exemplarily, in the memory occupancy data file of the WPS office application, the sum of mem_heap_B and mem_heap_extra_B is 25M, which is the memory required for the application to run normally when opened.

[0045] mem_heap_B represents the number of bytes of available heap memory, that is, the specified quantity when the program applies for memory.

[0046] mem_heap_extra_B represents the number of bytes of extra heap memory, including the bytes added for memory management and the extra bytes for alignment.

[0047] Similarly, calculate the memory space occupied by all applications, such as WPS, WeChat, Todesk remote desktop, etc., and record it in the data file of the memory space required for the application to run.

[0048] Step 202: Query the data file to obtain the memory space required for the application to run that needs to be started on the desktop system.

[0049] In this embodiment, a real-time file event listening tool is used to determine the applications that need to be started on the desktop system.

[0050] Exemplarily, use the IN_CREATE event of the real-time file event listening tool inotify to monitor the / proc directory to determine whether there is an application to be started. For example, when opening the WeChat application, two process folders named 36946 and 36952 with the process PID are newly created under the / proc directory. Obtain the name of the newly started application through the process PID, query the data file, and determine that the memory space required for this application to run is 25M.

[0051] Step 203: Obtain the current available remaining memory of the desktop system.

[0052] Step 204: If the memory space required for the application to run that needs to be started is less than the current available remaining memory, start the application that needs to be started.

[0053] Exemplarily, for example, when starting the WeChat application, it is determined that the memory space required for running is 25M, while the current available remaining memory is less than 25M.

[0054] Step 205, if the memory space required for running the application to be started is greater than the current available remaining memory, then after closing the process that currently occupies the largest memory space in the desktop system, start the application to be started.

[0055] Exemplarily, the process that closes the process that currently occupies the largest memory space in the desktop system is the process corresponding to the mpv player.

[0056] In this embodiment, by sending a process termination signal, the process that currently occupies the largest memory space in the desktop system is closed.

[0057] Exemplarily, the process termination signal is the SIGTERM signal.

[0058] In this embodiment, by establishing a data file for recording the memory space required for running the application; querying the data file to obtain the memory space required for running the application to be started on the desktop system; if the memory space required for running the application to be started is greater than the current available remaining memory, then after closing the process that currently occupies the largest memory space in the desktop system, start the application to be started; it is possible to actively and proactively close some processes in advance, release memory in advance, improve the fluency of starting the application, and has the characteristics of rapid startup, strong stability, and small computational load while ensuring the normal operation of the desktop system without manual intervention.

[0059] Based on the previous embodiment, in another embodiment of the present invention, the method further includes: establishing a process blacklist file, and the process blacklist file is used to record the names of processes prohibited from being closed;

[0060] In another embodiment of the present invention, it further includes: according to the process blacklist file, setting the current processes of the desktop system recorded in the process blacklist file as processes not to be processed by the out-of-memory OOM mechanism.

[0061] Exemplarily, read the process blacklist file, obtain the PID numbers of the processes recorded in the blacklist, write them into the system's / etc / process.txt file, and then set the corresponding oom-adj parameter of the process PID number in / etc / process.txt to -17, then the process is set as OOM disable to protect the corresponding thread from being closed by OOM.

[0062] Exemplarily, the processes recorded in the process blacklist include lightdm, Xorg, and ukui-session. If these are closed, it will cause the desktop to log off and cannot be used continuously.

[0063] Exemplarily, if the PID of the xorg process is 9280, then the oom_adj of / proc / 9280 is set to -17.

[0064] The technical solution disclosed in this embodiment can prevent important processes of the desktop system from being accidentally terminated by the out-of-memory OOM mechanism due to insufficient memory, ensuring the stable operation of the desktop system and preventing it from accidentally logging out and returning to the login interface.

[0065] Step S205: If the memory space required for the application to be launched is greater than the current available remaining memory, then after closing the process that currently occupies the largest memory space in the desktop system, launch the application to be launched, including: closing the process that currently occupies the largest memory space in the desktop system and is not recorded in the process blacklist file.

[0066] Exemplarily, as Figure 3 shown, if the process corresponding to the mpv player, which occupies the largest memory space, is on the process blacklist, then do not close this process, but close the next process that occupies the largest memory space and is not on the process blacklist, sorted in descending order of memory occupancy.

[0067] In this embodiment, by closing the process that currently occupies the largest memory space in the desktop system and is not recorded in the process blacklist file, the fluency of application opening can be improved, and the phenomenon of application lag when waiting for the system to release memory due to insufficient memory during application opening can be reduced.

[0068] As Figure 4 shown, the present invention also discloses a device for improving the fluency of launching application programs on a desktop system, including:

[0069] A data module 401 for establishing a data file recording the memory space required for the application program to run;

[0070] A query module 402 for querying the data file to obtain the memory space required for the application program to be launched on the desktop system;

[0071] An acquisition module 403 for acquiring the current available remaining memory of the desktop system;

[0072] A first launch module 404 for launching the application program to be launched if the memory space required for the application program to be launched is less than the current available remaining memory;

[0073] A second launch module 405 for launching the application program to be launched after closing the process that currently occupies the largest memory space in the desktop system if the memory space required for the application program to be launched is greater than the current available remaining memory.

[0074] The present invention also discloses an electronic device, such as Figure 5 shown, which discloses an embodiment, a block diagram of an electronic device applicable to the method for improving the fluency of starting an application program in the desktop system described above.

[0075] The electronic device 50 in this embodiment includes a processor 501, which can perform various appropriate actions and processes according to the program stored in the ROM 502 or the program loaded from the storage section 508 into the RAM 503. The processor 501 may include, for example, a general microprocessor, an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor, etc. The processor 501 may also include on-board memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiments of the present invention.

[0076] In the RAM 503, various programs and data required for the operation of the electronic device 50 are stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504, and the processor 501 performs various operations of the method flow according to the embodiments of the present invention by executing the programs in the ROM 502 and / or the RAM 503. It should be noted that the program may also be stored in one or more memories other than the ROM 502 and the RAM 503, and the processor 501 may also perform various operations of the method flow according to the embodiments of the present invention by executing the programs stored in one or more memories.

[0077] According to an embodiment of the present invention, the electronic device 50 may further include an I / O interface 505, and the I / O interface 505 is also connected to the bus 504. The electronic device 50 may further include one or more of the following components connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube, a liquid crystal display, a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 5010 is also connected to the I / O interface 505 as needed. A removable medium 5011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 5010 as needed, so that a computer program read from it can be installed into the storage section 508 as needed.

[0078] The present invention also provides a computer-readable storage medium.

[0079] The computer-readable storage medium may be included in the electronic device / device system described in the above embodiments; or it may exist alone without being assembled into the electronic device / device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiments of the present invention is implemented.

[0080] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include but is not limited to: portable computer disks, hard disks, random access memory RAM, read-only memory ROM, erasable programmable read-only memory EPROM or flash memory, portable compact disk read-only memory CD-ROM, optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or component.

[0081] An embodiment of the present invention also includes a computer program product.

[0082] The computer program product includes a computer program, and the computer program contains program code for executing the method provided by the embodiments of the present invention. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the method provided by the embodiments of the present invention.

[0083] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium. The program code included in the computer program can be transmitted by any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0084] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiments of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedures and / or object-oriented programming languages. Programming languages include but are not limited to, for example, Java, C++, Python, C language, or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network or a wide area network, or can be connected to an external computing device.

[0085] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as combinations of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features described in various embodiments and / or claims of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in various embodiments and / or claims of the present invention can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present invention.

[0086] The embodiments of the present invention have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention. Although the embodiments have been described separately above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present invention is defined by the appended claims and their equivalents, and without departing from the scope of the present invention, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present invention.

Claims

1. A method for improving the fluency of launching an application program on a desktop system, characterized in that: include: Create a data file to record the memory space occupied by the application program; Query the data file to obtain the memory space occupied by the application program to be started on the desktop system; Obtaining the currently available remaining memory of the desktop system; If the memory space occupied by the application to be started is less than the currently available remaining memory, start the application to be started; If the memory space required for the application to be started is greater than the currently available remaining memory, the application to be started is started after closing the process that currently occupies the largest memory space of the desktop system.

2. A method for improving the fluency of launching application programs in a desktop system according to claim 1, characterized in that: Also includes: Establish a process blacklist file, wherein the process blacklist file is used to record the names of processes that are prohibited from being closed; If the memory space required for the application to be started is greater than the currently available remaining memory, the process that currently occupies the largest memory space of the desktop system is closed, and then the application to be started is started, including: closing the process that occupies the largest current memory space of the desktop system and is not recorded in the process blacklist file.

3. A method for improving the fluency of launching application programs in a desktop system according to claim 2, characterized in that: According to the process blacklist file, the current process of the desktop system recorded in the process blacklist file is set as a process not processed by the memory overflow OOM mechanism.

4. A method for improving the fluency of launching application programs in a desktop system according to claim 1, characterized in that: The step of establishing a data file that records the memory space occupied by the running of the application program includes: after the desktop system installs the new application program, the data file is updated accordingly.

5. The method for improving the fluency of launching application programs in a desktop system according to claim 1, characterized in that: A real-time file event monitoring tool is used to determine the application program that needs to be started on the desktop system.

6. A method for improving the fluency of launching application programs in a desktop system according to claim 1, characterized in that: The closing of the process that currently occupies the largest memory space of the desktop system includes: closing the process that currently occupies the largest memory space of the desktop system by sending a process termination signal.

7. A method for improving the fluency of launching application programs in a desktop system according to claim 4, characterized in that: After the desktop system installs the new application, the data file is updated accordingly, including: if the desktop system installs the new application, a pop-up window prompts to update the data file accordingly.

8. A device for improving the fluency of launching an application program on a desktop system, characterized in that: The device comprises: The data module is used to create a data file that records the memory space occupied by the application program. A query module, used to query the data file to obtain the memory space occupied by the application program to be started on the desktop system; An acquisition module, used for acquiring the currently available remaining memory of the desktop system; A first starting module, configured to start the application to be started if the memory space occupied by the application to be started is less than the currently available remaining memory; The second startup module is used to start the application to be started after closing the process that currently occupies the largest memory space of the desktop system if the memory space required for the application to be started to run is greater than the currently available remaining memory.

9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.