CN111913707A - Running process multiplexing method and device - Google Patents

Running process multiplexing method and device Download PDF

Info

Publication number
CN111913707A
CN111913707A CN202010783885.2A CN202010783885A CN111913707A CN 111913707 A CN111913707 A CN 111913707A CN 202010783885 A CN202010783885 A CN 202010783885A CN 111913707 A CN111913707 A CN 111913707A
Authority
CN
China
Prior art keywords
applet
small program
running process
running
memory space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010783885.2A
Other languages
Chinese (zh)
Other versions
CN111913707B (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.)
Shanghai Lianshang Network Technology Co Ltd
Original Assignee
Shanghai Lianshang Network Technology 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 Shanghai Lianshang Network Technology Co Ltd filed Critical Shanghai Lianshang Network Technology Co Ltd
Priority to CN202010783885.2A priority Critical patent/CN111913707B/en
Publication of CN111913707A publication Critical patent/CN111913707A/en
Application granted granted Critical
Publication of CN111913707B publication Critical patent/CN111913707B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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 multiplexing method and a multiplexing device for running processes, and relates to the technical field of small program running. The specific implementation mode comprises the following steps: under the condition that the host application has the started first small program, in response to acquiring a starting instruction of a second small program of the host application, if the memory space occupied by the running of the second small program is within the remaining available space corresponding to the running process, the running process of the first small program is reused to run the second small program. According to the method and the device, under the condition that one applet is started, whether the started applet is influenced by the operation of another applet in the same process can be judged, and the processes of the applet are multiplexed under the condition that the influence is not influenced, so that the system operation cost can be saved, and the mutual influence on the operation between the applets possibly caused by multiplexing can be avoided.

Description

Running process multiplexing method and device
Technical Field
The application relates to the technical field of computers, in particular to the technical field of small program operation, and particularly relates to a method and a device for multiplexing an operation process.
Background
With the development of internet technology, more and more users begin to use applications installed on terminals such as mobile phones and use applets hosted by the applications. The small program can be hosted by the application commonly used by the user, so that the user can directly open the small program in the applications by simple operation while using the application.
In the prior art, multiple applets can be opened in the same application, and accordingly, each applet corresponds to one process, so that the running of the applet is realized.
Disclosure of Invention
Provided are a multiplexing method and device of running processes, an electronic device and a storage medium.
According to a first aspect, a method for multiplexing running processes is provided, which is applied to a terminal, and the terminal is provided with a host application, and the method includes: under the condition that the host application has a started first small program, in response to the fact that a starting instruction of a second small program of the host application is obtained, judging the relation between the memory space occupied by the operation of the second small program and the residual available space corresponding to the operation process of the first small program; and if the memory space occupied by the operation of the second small program is in the residual available space corresponding to the operation process, multiplexing the operation process of the first small program to operate the second small program.
According to a second aspect, there is provided a multiplexing apparatus for running a process, which is applied to a terminal, and the terminal is installed with a host application, the apparatus comprising: the judging unit is configured to respond to the obtained starting instruction of a second small program of the host application when the first small program started exists in the host application, and judge the relation between the memory space occupied by the operation of the second small program and the residual available space corresponding to the operation process of the first small program; and the multiplexing unit is configured to multiplex the running process of the first applet to run the second applet if the memory space occupied by the running of the second applet is within the residual available space corresponding to the running process.
According to a third aspect, there is provided an electronic device comprising: one or more processors; a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement a method as in any embodiment of a multiplexing method of running processes.
According to a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method as in any embodiment of a multiplexing method of running a process.
According to the scheme of the application, under the condition that one applet is started, whether the started applet is influenced by the operation of another applet in the same process can be judged, and the processes of the applet are multiplexed under the condition that the influence is not influenced, so that the system operation cost can be saved, and the mutual influence on the operation between the applets possibly caused by multiplexing can be avoided.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram to which some embodiments of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for multiplexing processes according to the present application;
FIG. 3 is a flow diagram of yet another embodiment of a method of multiplexing processes according to the present application;
FIG. 4a is a flow diagram of yet another embodiment of a method of multiplexing processes according to the present application;
FIG. 4b is a flow diagram of yet another embodiment of a reuse method for a run process according to the present application;
FIG. 5 is a schematic block diagram of one embodiment of a multiplexing apparatus according to the present application;
fig. 6 is a block diagram of an electronic device for implementing a multiplexing method of a running process according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which an embodiment of a multiplexing method of a running process or a multiplexing apparatus of a running process of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various communication client applications, such as video applications, live applications, instant messaging tools, mailbox clients, social platform software, and the like, may be installed on the terminal devices 101, 102, and 103.
Here, the terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, such as a background server providing support for the terminal devices 101, 102, 103. The background server may analyze and otherwise process data such as the running frame request of the terminal, and feed back a processing result (for example, running frame data of the applet to be started) to the terminal device.
It should be noted that the multiplexing method for running processes provided in the embodiment of the present application may be executed by the terminal devices 101, 102, and 103, and accordingly, the multiplexing apparatus for running processes may be disposed in the terminal devices 101, 102, and 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for multiplexing processes according to the present application is shown. The method is applied to a terminal, and the terminal is provided with host application. The multiplexing method of the running process comprises the following steps:
step 201, in a case that the first applet has been started in the host application, in response to acquiring a start instruction for a second applet of the host application, determining a relationship between a memory space required to be occupied by running the second applet and a remaining space that can be occupied by a running process of the first applet.
In this embodiment, an execution main body (for example, the terminal device shown in fig. 1) on which the multiplexing method for the running process runs may determine, in response to acquiring a start instruction for the second applet of the host application, a relationship between a memory space required to be occupied by running the second applet and a remaining available space corresponding to the running process of the first applet, that is, compare the two. The step is executed on the premise that the host application has the started first applet, that is, the first applet is in operation, for example, the user is using the first applet, that is, the first applet is executed in the foreground, or the first applet is executed in the background.
The obtaining manner of the start instruction may be various, for example, the start instruction may be generated by the execution subject in response to detecting a start operation of the user to the displayed second applet. The start instruction may be generated by another applet other than the second applet of the host application or another host application of the terminal.
In practice, each process (e.g. a process of an applet) in the operating system of the terminal may be configured with a limit value, e.g. 50Mb, of the memory space occupied by the running of the process, the space occupied by the running of the whole process must not exceed the limit value. If a running process of at least one applet is run in one process, the corresponding memory space is occupied, that is, the occupied memory space. The difference between the limit value and the occupied memory space is the remaining occupied space.
The execution main body may determine, in various ways, a relationship between a memory space occupied by the running of the second applet and a remaining available space corresponding to the running process of the first applet. For example, the execution main body may determine whether a memory space occupied by the operation of the second applet is within the remaining available space, or the execution main body may determine whether a memory space occupied by the operation of the second applet is outside the remaining available space.
The execution subject may determine the memory space occupied by the second applet in various ways. For example, the execution subject may determine the number of pages in the second applet, for example, 3 pages, and obtain a target value, for example, 5Mb, of the memory space to be occupied preset for each page. The execution body may determine that the memory space occupied by the second applet is 15Mb based on the number of pages and the target value.
Specifically, the execution subject may determine a size of a memory space occupied by the second applet, and determine whether the size is smaller than or equal to the value of the remaining available space.
In step 202, if the memory space occupied by the running of the second applet is within the remaining available space corresponding to the running process, the running process of the first applet is reused to run the second applet.
In this embodiment, if the determination result of the execution main body is that the memory space occupied by the operation of the second applet is within the remaining available space corresponding to the operation process of the first applet, or the memory space occupied by the operation of the second applet is not outside the remaining available space corresponding to the operation process of the first applet, the operation process of the first applet may be reused to operate the second applet.
In the method provided by the embodiment of the application, when one applet is started, whether the started applet is affected by the operation of another applet in the same process can be judged, and the processes of the applets are multiplexed under the condition that the processes are not affected, so that the system operation cost can be saved, and the mutual influence between the applets possibly caused by multiplexing can be avoided.
In some optional implementations of this embodiment, the method further includes: and if the memory space required to be occupied by the operation of the second applet is not in the residual available space corresponding to the operating process, loading another operating process except the operating process, and calling another operating process to operate the second applet.
In these optional implementation manners, the execution main body may load another running process other than the running process and call the other running process to run the second applet, if the determination result is negative. Thus, the first applet and the second applet each operate using different processes.
The implementation methods can respectively run different processes on the two applets under the condition that the process multiplexing between the process of the first applet and the second applet is determined to possibly influence the running of the two applets, so that the mutual influence between the two applets is avoided.
In some optional implementations of this embodiment, the method may further include: loading a preset running process in response to the obtained starting instruction of the host application; and calling a preset running process to run the first small program in response to acquiring a starting instruction of the first small program applied to the host.
In these optional implementation manners, the execution main body may preload a preset running process under the condition that the start instruction of the host application is acquired, so as to be called when the subsequent applet is started. If the execution main body obtains a start instruction of a first applet applied to a host, the execution main body may call the loaded running process to run the first applet.
The launch instruction for the host application may be generated by the execution subject in response to detecting a launch operation of the user for the displayed host application. In addition, the starting instruction can also be generated by other host applications of the terminal.
The launch instruction for the first applet of the host application may be generated by the execution subject in response to detecting a launch operation of the user's identification of the displayed first applet. In addition, the start instruction may be generated by other applets besides the first applet of the host application or other host applications in the terminal.
The implementation modes can pre-load the running process under the condition of starting the host application, so that preparation is made for the running of the follow-up small program, and the starting efficiency of the small program is improved.
In some optional application scenarios of these implementations, invoking a preset running process in these implementations to run the first applet may include: acquiring configuration information of a first small program, wherein the configuration information comprises an operation framework version and/or small program type information; and calling a preset running process to run the first applet based on the configuration information.
In these optional application scenarios, the execution subject may obtain configuration information of the first applet. And calling a preset running process to run the first applet based on the configuration information.
In practice, if the configuration information includes an operation frame on which the applet operates, the execution main body may acquire the operation frame from the server when acquiring the start instruction for the first applet. The running framework is also the basic running framework of the applet and is also called a basic library. Different versions of the runtime framework exist. The applet type information may refer to various preset types of applets, for example, a game type or other types other than games, such as a shopping type.
The application scenes can call the running process based on the configuration information of the first applet and run the first applet, so that the configuration matched with the first applet can be found, and the first applet can be smoothly run by using the configuration.
In some optional cases of these application scenarios, in response to acquiring a start instruction of a second applet applied to the host application, the determining, in step 201, a relationship between a memory space required to be occupied by running the second applet and a remaining available space corresponding to a running process of the first applet may include: responding to the acquired starting instruction of the second applet applied to the host, and judging whether the second applet is matched with the configuration information of the first applet or not; and if the second small program is matched with the configuration information of the first small program, judging the relation between the memory space occupied by the operation of the second small program and the residual available space corresponding to the operation process of the first small program.
In these optional cases, the execution main body may determine whether the configuration information of the second applet matches the configuration information of the first applet in response to acquiring a start instruction for the second applet. And under the condition that the judgment result is matched, judging the relation between the memory space occupied by the operation of the second applet and the residual occupied space. In practice, the scheme may be performed with the number of started first applets being one.
There may be no process multiplexing between different types of applets, for example, there may be no process multiplexing between game type applets and other types of applets. That is, if one of the types of the second applet and the first applet is a game type and the other is another type, the configuration information of the second applet and the first applet do not match. Furthermore, there is also a problem of mismatch between the running frameworks of different versions of the applet. Specifically, if the running framework version of the first applet is higher than the running framework version of the second applet, the configuration information of the second applet and the configuration information of the first applet are not matched, and if the running framework version of the second applet is higher than the running framework version of the first applet, the execution main body may also run the second applet by using the configuration information of the first applet, and the configuration information of the second applet and the configuration information of the first applet are matched.
The execution subject in these cases multiplexes the running process of the first applet to run the second applet, upon determining that the second applet can adopt the configuration information of the first applet. Therefore, the multiplexing operation process can further ensure that each small program, especially the second small program, can be smoothly operated.
Optionally, the method may further include: and if the second applet is not matched with the configuration information of the first applet, loading another running process except the running process, and calling the other running process to run the second applet.
Specifically, when the determination result is not matched, the execution main body may load another running process, and call the another running process to run the second applet.
The application scenes can call another running process to run the second applet under the condition that the configuration information of the first applet and the second applet are not matched, so that the problem of running failure of the second applet caused by multiplexing is avoided.
In some optional cases of these application scenarios, in response to acquiring a start instruction of a second applet applied to the host application, the determining, in step 201, a relationship between a memory space required to be occupied by running the second applet and a remaining available space corresponding to a running process of the first applet may include: under the condition that the number of the started first small programs is at least two, in response to the fact that a starting instruction of a second small program applied to a host is obtained, whether a target first small program with configuration information matched with the second small program exists in each first small program or not is judged; if so, judging whether the memory space occupied by the operation of the second small program is in the residual available space corresponding to the operation process of the first small program; and the running process of multiplexing the first applet in step 202 runs the second applet, which may include: and the running process of the multiplexing target first small program runs the second small program.
In these cases, the execution main body may determine, in each first applet, whether there is a first applet whose configuration information matches the second applet, that is, a target first applet, when the number of the currently started first applets is at least two. If the first applet with the configuration information matched with the second applet exists, the execution main body can execute and judge whether the memory space occupied by the operation of the second applet is in the residual available space or not, and the operation process of the target first applet is reused to operate the second applet. If there is no first applet whose configuration information matches the second applet, the execution main body may load another running process other than the running process, and call another running process to run the second applet.
In these cases, the execution main body may select, from among the respective running applets, the first applet whose configuration information is the configuration information that the second applet can utilize, when the number of the currently running applets is at least two, so that realization of multiplexing can be ensured.
In some optional application scenarios of these implementations, after loading the preset running process, the method further includes: loading the running environment of the running process; and after calling a preset running process to run the first applet, the method further comprises: associating an identification of the first applet with the execution environment; and after the running process of the first applet is reused to run the second applet, the method further comprises: an identification of the second applet is associated with the execution environment.
In these optional application scenarios, if the execution main body invokes (including multiplexes) a running process to run a certain applet, the execution main body associates the identifier of the applet with the running environment of the running process, that is, establishes an association relationship. Specifically, the operating environment herein may include various information such as service information of a service provided by the server to the terminal, connection information with the server, and the like.
These application scenarios allow all applets invoking the same running process to be associated with the running environment of the running process, thereby indicating the reuse of each running process.
With continued reference to fig. 3, fig. 3 is yet another flowchart of an application scenario of the multiplexing method of the running process according to the present embodiment.
With further reference to FIG. 4a, a flow 400 of yet another embodiment of a multiplexing method of a running process is shown. The process 400 includes the following steps:
step 401, in a case that the first applet has been started in the host application, in response to acquiring a start instruction for a second applet of the host application, determining a relationship between a memory space required to be occupied by running the second applet and a remaining space that can be occupied by a running process of the first applet.
In this embodiment, an execution main body (for example, the terminal device shown in fig. 1) on which the multiplexing method for the running process runs may determine, in response to acquiring a start instruction for the second applet of the host application, a relationship between a memory space required to be occupied by running the second applet and a remaining available space corresponding to the running process of the first applet, that is, compare the two.
In step 402, if the memory space occupied by the running of the second applet is within the remaining available space corresponding to the running process, the running process of the first applet is reused to run the second applet.
In this embodiment, if the determination result of the execution main body is that the memory space occupied by the operation of the second applet is within the remaining available space corresponding to the operation process of the first applet, or the memory space occupied by the operation of the second applet is not outside the remaining available space corresponding to the operation process of the first applet, the operation process of the first applet may be reused to operate the second applet.
In step 403, in response to acquiring an exit instruction for any applet started in the host application, it is determined whether the running process of the applet is a multiplexed running process.
In this embodiment, if the execution main body obtains an exit instruction for any applet that is running in the host application, it is determined whether the running process of the applet is a multiplexed running process.
In step 404, if the running process of the arbitrary applet is a multiplexed running process, releasing the memory space corresponding to the arbitrary applet from the memory space occupied by the running process of the arbitrary applet.
In this embodiment, if the result of the determination is yes, the execution main body may only release the memory space corresponding to the applet.
In the embodiment, under the condition of reusing the running process, if the applet exits, only the memory space occupied by running the applet can be released, so that the condition that other applets are mistakenly exited is avoided.
In some optional implementations of this embodiment, the method further includes: and if the running process of the any small program is not the multiplexed running process, releasing the memory space occupied by the running process of the any small program.
In these optional implementation manners, if the running process of the arbitrary applet is not a multiplexed running process, the execution main body may release all the memory space occupied by the running process of the applet and recycle the running process, and may further recycle the running environment of the running process.
The implementation methods can release all the memory space occupied by the running process and recycle the running process under the condition that the running process is not the multiplexed running process, thereby realizing the release of the memory space and avoiding the invalid occupation of the memory.
In some optional implementations of this embodiment, the identifier of the arbitrary applet is associated with a running environment of a running process of the arbitrary applet; and the method further comprises: and if the running process of the arbitrary applet is a multiplexed running process, releasing the association relationship between the identifier of the arbitrary applet and the running environment of the running process of the arbitrary applet.
In these optional implementations, in response to acquiring the exit instruction for the arbitrary applet, the execution main body may release the association relationship between the identifier of the applet and the execution environment of the running process of the applet, if the running process of the applet is a multiplexed running process.
The implementation modes can remove the association relation between the identification of the quitted small program and the running environment, thereby ensuring the accuracy of the association relation between the identification of the running small program and the running environment.
With continued reference to fig. 4b, fig. 4b is yet another flowchart of an application scenario of the multiplexing method of the running process according to the present embodiment.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present application provides an embodiment of a multiplexing apparatus for running processes, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and besides the features described below, the embodiment of the apparatus may further include the same or corresponding features or effects as the embodiment of the method shown in fig. 2. The device can be applied to various electronic equipment.
As shown in fig. 5, the multiplexing apparatus 500 for running processes of the present embodiment includes: a judging unit 501 and a multiplexing unit 502. Wherein, be applied to the terminal, the terminal installation has the host to use, and the device includes: a determining unit 501, configured to, in a case that the first applet has been started in the host application, in response to acquiring a start instruction for a second applet of the host application, determine a relationship between a memory space required to be occupied by running of the second applet and a remaining available space corresponding to a running process of the first applet; the multiplexing unit 502 is configured to multiplex the running process of the first applet to run the second applet if the memory space occupied by the running of the second applet is within the remaining available space corresponding to the running process.
In this embodiment, specific processing of the determining unit 501 and the multiplexing unit 502 of the multiplexing apparatus 500 running the process and the technical effects thereof can refer to the related descriptions of step 201 and step 202 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the apparatus further includes: and the first additional adjusting unit is configured to load another running process except the running process and call another running process to run the second applet if the memory space occupied by the running of the second applet is not in the residual available space corresponding to the running process.
In some optional implementations of this embodiment, the apparatus further includes: the process loading unit is configured to respond to the acquisition of a starting instruction of the host application and load a preset running process; and the calling unit is configured to call a preset running process to run the first applet in response to acquiring the starting instruction of the first applet of the host application.
In some optional implementations of the embodiment, the invoking unit is further configured to execute invoking a preset running process to run the first applet according to the following manner: acquiring configuration information of a first small program, wherein the configuration information comprises an operation framework version and/or small program type information; and calling a preset running process to run the first applet based on the configuration information.
In some optional implementations of this embodiment, the determining unit is further configured to, in response to acquiring a start instruction of a second applet applied to the host application, determine a relationship between a memory space occupied by the running of the second applet and a remaining available space corresponding to a running process of the first applet, as follows: responding to the acquired starting instruction of the second applet applied to the host, and judging whether the second applet is matched with the configuration information of the first applet or not; and if the second small program is matched with the configuration information of the first small program, judging the relation between the memory space occupied by the operation of the second small program and the residual available space corresponding to the operation process of the first small program.
In some optional implementations of this embodiment, the apparatus further includes: and the second calling unit is configured to load another running process except the running process and call another running process to run the second applet if the second applet does not match the configuration information of the first applet.
In some optional implementations of this embodiment, the determining unit is further configured to, in response to acquiring a start instruction of a second applet applied to the host application, determine a relationship between a memory space occupied by the running of the second applet and a remaining available space corresponding to a running process of the first applet, as follows: under the condition that the number of the started first small programs is at least two, in response to the fact that a starting instruction of a second small program applied to a host is obtained, whether a target first small program with configuration information matched with the second small program exists in each first small program or not is judged; if so, judging whether the memory space occupied by the operation of the second small program is in the residual available space corresponding to the operation process of the first small program; and the multiplexing unit is further configured to execute the operation process of multiplexing the first small program to operate the second small program according to the following modes: and the running process of the multiplexing target first small program runs the second small program.
In some optional implementations of this embodiment, the apparatus further includes: an environment loading unit configured to load an execution environment of the execution process after loading a preset execution process; and the apparatus further comprises: the first association unit is configured to associate the identifier of the first small program with the running environment after the preset running process is called to run the first small program; and the apparatus further comprises: and the second association unit is configured to associate the identification of the second small program with the running environment after the second small program is run by the running process multiplexing the first small program.
In some optional implementations of this embodiment, the apparatus further includes: the quitting unit is configured to respond to the obtained quitting instruction of any started small program in the host application and judge whether the running process of the small program is a multiplexed running process; the first releasing unit is configured to release the memory space corresponding to the arbitrary applet from the memory space occupied by the running process of the arbitrary applet if the running process of the arbitrary applet is a multiplexed running process.
In some optional implementations of this embodiment, the apparatus further includes: and the second releasing unit is configured to release the memory space occupied by the running process of the arbitrary applet if the running process of the arbitrary applet is not the multiplexed running process.
In some optional implementations of this embodiment, the identifier of the arbitrary applet is associated with a running environment of a running process of the arbitrary applet; and the apparatus further comprises: and an association releasing unit configured to release an association relationship between the identifier of the arbitrary applet and the execution environment of the execution process of the arbitrary applet, if the execution process of the arbitrary applet is a multiplexed execution process.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 6 is a block diagram of an electronic device that executes a process multiplexing method according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 6, the electronic apparatus includes: one or more processors 601, memory 602, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 6, one processor 601 is taken as an example.
The memory 602 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method for multiplexing the running processes provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the multiplexing method of running processes provided by the present application.
The memory 602, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the multiplexing method of the running process in the embodiment of the present application (for example, the determining unit 501 and the multiplexing unit 502 shown in fig. 5). The processor 601 executes various functional applications of the server and data processing by executing non-transitory software programs, instructions, and modules stored in the memory 602, that is, implements a multiplexing method of the running processes in the above-described method embodiments.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the multiplex electronic device running the process, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 602 optionally includes memory located remotely from processor 601, and these remote memories may be connected over a network to the multiplexed electronics running the process. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device running the process multiplexing method may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected by a bus or other means, and fig. 6 illustrates the connection by a bus as an example.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the multiplexed electronic device running the process, such as a touch screen, keypad, mouse, track pad, touch pad, pointer stick, one or more mouse buttons, track ball, joystick, or other input device. The output devices 604 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor comprises a decision unit 501 and a multiplexing unit 502. For example, the multiplexing unit may also be described as a unit that multiplexes the running process of the first applet to run the second applet if the memory space occupied by the running of the second applet is within the remaining available space corresponding to the running process.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: under the condition that the host application has a started first small program, in response to the fact that a starting instruction of a second small program of the host application is obtained, judging the relation between the memory space occupied by the operation of the second small program and the residual available space corresponding to the operation process of the first small program; and if the memory space occupied by the operation of the second small program is in the residual available space corresponding to the operation process, multiplexing the operation process of the first small program to operate the second small program.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (13)

1. A multiplexing method of running processes is applied to a terminal, the terminal is provided with a host application, and the method comprises the following steps:
under the condition that the host application has a started first small program, in response to acquiring a starting instruction of a second small program of the host application, judging the relation between the memory space occupied by the operation of the second small program and the residual available space corresponding to the operation process of the first small program;
and if the memory space occupied by the operation of the second small program is in the residual available space corresponding to the operation process, multiplexing the operation process of the first small program to operate the second small program.
2. The method of claim 1, wherein the method further comprises:
and if the memory space required to be occupied by the operation of the second applet is not in the residual available space corresponding to the operation process, loading another operation process except the operation process, and calling the other operation process to operate the second applet.
3. The method of claim 1, wherein the method further comprises:
loading a preset running process in response to the obtained starting instruction of the host application;
and calling the preset running process to run the first small program in response to acquiring a starting instruction of the first small program of the host application.
4. The method of claim 3, wherein the invoking the pre-set running process to run the first applet comprises:
acquiring configuration information of the first small program, wherein the configuration information comprises an operation framework version and/or small program type information;
and calling the preset running process to run the first applet based on the configuration information.
5. The method according to claim 4, wherein, in response to acquiring a start instruction for a second applet applied to the host application, determining a relationship between a memory space required to be occupied by running the second applet and a remaining available space corresponding to a running process of the first applet, includes:
responding to the acquired starting instruction of a second applet applied to the host, and judging whether the second applet is matched with the configuration information of the first applet or not;
and if the second small program is matched with the configuration information of the first small program, judging the relation between the memory space required to be occupied by the operation of the second small program and the residual available space corresponding to the operation process of the first small program.
6. The method of claim 5, wherein the method further comprises:
and if the second applet is not matched with the configuration information of the first applet, loading another running process except the running process, and calling the other running process to run the second applet.
7. The method according to claim 4, wherein, in response to acquiring a start instruction for a second applet applied to the host application, determining a relationship between a memory space required to be occupied by running the second applet and a remaining available space corresponding to a running process of the first applet, includes:
under the condition that the number of the started first small programs is at least two, in response to the fact that a starting instruction of a second small program applied to the host is obtained, judging whether a target first small program with configuration information matched with the second small program exists in each first small program;
if so, judging whether the memory space occupied by the operation of the second small program is in the residual available space corresponding to the operation process of the first small program; and
the running process multiplexing the first applet runs the second applet, and the running process multiplexing the first applet comprises the following steps:
and multiplexing the running process of the target first small program to run the second small program.
8. The method of claim 3, wherein after the loading a preset running process, the method further comprises: loading the running environment of the running process; and
after the calling the preset running process to run the first applet, the method further includes:
associating an identification of the first applet with the runtime environment; and
after the running process that multiplexes the first applet runs the second applet, the method further comprises:
associating an identification of the second applet with the runtime environment.
9. The method of claim 1, wherein the method further comprises:
in response to the obtained exit instruction of any started applet in the host application, judging whether the running process of the applet is a multiplexed running process;
and if the running process of the any small program is a multiplexed running process, releasing the memory space corresponding to the any small program in the memory space occupied by the running process of the any small program.
10. The method of claim 9, wherein the method further comprises:
and if the running process of the any small program is not the multiplexed running process, releasing the memory space occupied by the running process of the any small program.
11. The method of claim 9, wherein the identification of the arbitrary applet is associated with a runtime environment of a running process of the arbitrary applet; and
the method further comprises the following steps:
and if the running process of the any applet is a multiplexed running process, removing the association relationship between the identifier of the any applet and the running environment of the running process of the any applet.
12. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-11.
13. A computer-readable storage medium having stored thereon a computer program, wherein,
the program when executed by a processor implementing the method as claimed in any one of claims 1-11.
CN202010783885.2A 2020-08-06 2020-08-06 Multiplexing method and device for running process Active CN111913707B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010783885.2A CN111913707B (en) 2020-08-06 2020-08-06 Multiplexing method and device for running process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010783885.2A CN111913707B (en) 2020-08-06 2020-08-06 Multiplexing method and device for running process

Publications (2)

Publication Number Publication Date
CN111913707A true CN111913707A (en) 2020-11-10
CN111913707B CN111913707B (en) 2024-02-20

Family

ID=73286552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010783885.2A Active CN111913707B (en) 2020-08-06 2020-08-06 Multiplexing method and device for running process

Country Status (1)

Country Link
CN (1) CN111913707B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113495889A (en) * 2021-07-07 2021-10-12 浙江大华技术股份有限公司 Distributed object storage method and device, electronic equipment and storage medium
WO2023109310A1 (en) * 2021-12-13 2023-06-22 北京有竹居网络技术有限公司 Process management method and apparatus, and storage medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6513158B1 (en) * 1999-11-15 2003-01-28 Espial Group Inc. Method and apparatus for running multiple java applications simultaneously
WO2015120708A1 (en) * 2014-02-14 2015-08-20 贝壳网际(北京)安全技术有限公司 Application management method and apparatus
CN110083399A (en) * 2019-03-04 2019-08-02 上海连尚网络科技有限公司 Small routine operation method, computer equipment and storage medium
CN110865855A (en) * 2019-11-18 2020-03-06 百度在线网络技术(北京)有限公司 Applet processing method and related device
CN111078376A (en) * 2019-11-05 2020-04-28 华为技术有限公司 Process management method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6513158B1 (en) * 1999-11-15 2003-01-28 Espial Group Inc. Method and apparatus for running multiple java applications simultaneously
WO2015120708A1 (en) * 2014-02-14 2015-08-20 贝壳网际(北京)安全技术有限公司 Application management method and apparatus
CN110083399A (en) * 2019-03-04 2019-08-02 上海连尚网络科技有限公司 Small routine operation method, computer equipment and storage medium
CN111078376A (en) * 2019-11-05 2020-04-28 华为技术有限公司 Process management method and device
CN110865855A (en) * 2019-11-18 2020-03-06 百度在线网络技术(北京)有限公司 Applet processing method and related device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
无敌;: "查看UAC虚拟进程 实时监控Windows 7运行程序", 网络与信息, no. 12 *
虎治勤;: "操作系统中的进程、线程与Java的多线程", 数字技术与应用, no. 10 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113495889A (en) * 2021-07-07 2021-10-12 浙江大华技术股份有限公司 Distributed object storage method and device, electronic equipment and storage medium
CN113495889B (en) * 2021-07-07 2024-03-15 浙江大华技术股份有限公司 Distributed object storage method and device, electronic equipment and storage medium
WO2023109310A1 (en) * 2021-12-13 2023-06-22 北京有竹居网络技术有限公司 Process management method and apparatus, and storage medium and electronic device

Also Published As

Publication number Publication date
CN111913707B (en) 2024-02-20

Similar Documents

Publication Publication Date Title
CN111666546B (en) Application login method and device
CN111913794A (en) Method and device for sharing GPU, electronic equipment and readable storage medium
CN111586128A (en) Method, device and equipment for acquiring applet data and storage medium
CN111767090A (en) Method and device for starting small program, electronic equipment and storage medium
CN111475259B (en) Applet loading method and device and electronic equipment
CN110659246B (en) Container-based file mounting method and device and electronic equipment
CN110007936B (en) Data processing method and device
CN111400000A (en) Network request processing method, device, equipment and storage medium
CN111913707B (en) Multiplexing method and device for running process
CN114138439A (en) Task scheduling method and device, electronic equipment and storage medium
CN113971277A (en) Multi-user login method and device
CN111615171B (en) Access method and device of wireless local area network
CN107959845B (en) Image data transmission method and device, client device and head-mounted display equipment
CN113329087A (en) Method and device for acquiring information
CN111884847A (en) Method and apparatus for handling faults
CN111597027A (en) Application program starting method, device, equipment and storage medium
CN108241510A (en) A kind of switching method of video card
CN111832070A (en) Data mask method and device, electronic equipment and storage medium
CN114661274A (en) Method and device for generating intelligent contract
CN111522599B (en) Method and device for transmitting information
CN113515299A (en) Software development kit SDK hot upgrading method, device, equipment and storage medium
CN110262813B (en) Method and apparatus for installing applications
CN112770415A (en) Information processing method and device about wireless hotspot
JP2021140781A (en) Method, device, equipment, program and computer memory medium for source channel determination
JP2022008782A (en) Method and apparatus for constructing device debug environment

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