Application program management method and device, electronic equipment, terminal, medium and product

By activating applications in designated logical channels and managing temporary data spaces based on application module states, the solution addresses the challenge of efficient application management in embedded systems, enhancing resource utilization and reducing memory fragmentation.

CN119127496APending Publication Date: 2024-12-13BEIJING CEC HUADA ELECTRONIC DESIGN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411201894.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Existing embedded operating systems face challenges in efficiently managing application operation control and memory space allocation for multiple applications running simultaneously, particularly in resource-constrained devices like smart cards and secure elements.

Method used

The solution involves controlling applications to activate and run in designated logical channels, allocating temporary dynamic variable data spaces, and managing these spaces based on the state of other applications in the same module, ensuring efficient and convenient application management.

Benefits of technology

This approach allows for efficient and convenient management of multiple applications by ensuring correct data usage across logical channels, reducing memory fragmentation, and optimizing resource utilization in embedded systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127496A_ABST
    Figure CN119127496A_ABST
Patent Text Reader

Abstract

The invention discloses an application program management method and device, electronic equipment, a terminal, a medium and a product. The method comprises the steps that in response to the fact that a specified logical channel is opened, a selected application program is controlled to be activated and run in the specified logical channel; allocating a temporary dynamic variable data space for the selected application program; detecting whether other application programs belonging to a target application module to which the selected application program belongs run in each logic channel which is currently in the open state in response to the fact that the specified logic channel is closed; if yes, continuing to retain the temporary dynamic variable data space; and otherwise, releasing the temporary dynamic variable data space allocated for the selected application program. According to the technical scheme provided by the embodiment of the invention, the logic channel is taken as a main body for running management, the temporary dynamic variable data space is distributed and released for the currently running application program based on the logic channel, and the application programs running in the operating system at the same time can be efficiently and conveniently managed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an application management method, device, electronic equipment, terminal, medium and product. Background Art

[0002] With the continuous development of embedded operating system technology, multiple applications can be installed and run simultaneously in embedded devices. In addition to providing runtime environment and data access capabilities for applications, the operating system also needs to provide operation control, memory space allocation and recycling for each application running in the operating system.

[0003] Therefore, how to conveniently and efficiently implement application operation control and memory space management in embedded operating systems to cope with the growing application management needs in embedded environments is an important research direction at present. Summary of the invention

[0004] The embodiments of the present invention provide an application management method, device, electronic device, terminal, medium and product to achieve efficient and convenient management of selected applications on a specified logical channel.

[0005] According to one aspect of an embodiment of the present invention, there is provided an application management method, which is executed by a runtime environment in an operating system, and the operating system is installed in an electronic device, and the method includes:

[0006] In response to the designated logical channel being opened, controlling the selected application to activate and run in the designated logical channel;

[0007] Allocating a temporary dynamic variable data space for the selected application;

[0008] The temporary dynamic variable data space is used to store temporary dynamic variable data used during the running of the application program;

[0009] In response to the designated logical channel being closed, detecting whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in an open state;

[0010] If so, continue to reserve the temporary dynamic variable data space; otherwise, release the temporary dynamic variable data space allocated for the selected application.

[0011] According to another aspect of an embodiment of the present invention, there is also provided an application management device, which is configured in a runtime environment in an operating system, and the operating system is installed in an electronic device, and the device includes:

[0012] A control operation module, used for controlling the selected application to activate and operate in the specified logical channel in response to the specified logical channel being opened;

[0013] A data space allocation module, used for allocating temporary dynamic variable data space for the selected application;

[0014] A data space release module is used to detect, in response to the closing of a designated logical channel, whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel that is currently in an open state; if so, continue to retain the temporary dynamic variable data space; otherwise, release the temporary dynamic variable data space allocated for the selected application.

[0015] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, on which an operating system is installed, in which a runtime environment is executed, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application management method as described in any one of the embodiments of the present invention.

[0019] According to another aspect of the embodiments of the present invention, a terminal is provided, comprising the electronic device as described in any one of the embodiments of the present invention.

[0020] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application management method as described in any one of the embodiments of the present invention when executed.

[0021] According to another aspect of an embodiment of the present invention, a computer program product is further provided. The computer program product includes a computer program. When the computer program is executed by a processor, the application management method as described in any one of the embodiments of the present invention is implemented.

[0022] The technical solution of the embodiment of the present invention controls the selected application to activate and run in the specified logical channel in response to the specified logical channel being opened through the runtime environment; allocates a temporary dynamic variable data space for the selected application; in response to the specified logical channel being closed, detects whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in an open state; if so, continues to reserve the temporary dynamic variable data space; otherwise, releases the implementation method of the temporary dynamic variable data space allocated for the selected application, with the logical channel as the main body, to manage the operation of the application running in the operating system, in addition, based on the logical channel, allocates and releases the temporary dynamic variable data space for the currently running application, so that when different logical channels are selected, the application can correctly use the data in the temporary dynamic variable data space adapted to it, and thus can efficiently and conveniently manage multiple applications running simultaneously in the operating system.

[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0025] Figure 1 is a flow chart of an application management method provided according to an embodiment of the present invention;

[0026] Figure 2 is a flow chart of another application management method provided according to an embodiment of the present invention;

[0027] Figure 3 is a flow chart of another application management method provided according to an embodiment of the present invention;

[0028] Figure 4 is a flow chart of another application management method provided according to an embodiment of the present invention;

[0029] Figure 5 is a structural diagram of an application management device provided according to an embodiment of the present invention;

[0030] Figure 6It is a structural schematic diagram of an electronic device for implementing an application management method according to an embodiment of the present invention;

[0031] Figure 7 It is a schematic diagram of the structure of a terminal provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] Figure 1 This is a flowchart of an application management method provided in the first embodiment of the present invention. This embodiment is applicable to the case where the runtime environment in the operating system manages the application selected in the specified logical channel. The method can be executed by an application management device, which can be implemented in the form of hardware and / or software and can generally be configured in an electronic device installed with the operating system. Among them, the operating system can generally be an embedded operating system, and the electronic device can generally be a resource-constrained device such as various security elements or smart cards.

[0035] The method in this embodiment is executed by the runtime environment in the operating system. The runtime environment (RTE) is a secure runtime environment for executing virtual machines on restricted resources such as smart cards or secure elements, and can be regarded as an ultra-lightweight container. The application runs in the runtime environment and can be completely isolated from the native functions of the embedded operating system.

[0036] Correspondingly, such as Figure 1As shown, the method includes:

[0037] S110 . In response to a designated logical channel being opened, controlling a selected application to activate and run in the designated logical channel.

[0038] Logical channel can be understood as a concept used to establish a communication connection between a host and an electronic device (typically, a restricted device). The operating system allows multiple independent communication channels to be established between the host and the restricted device at the same time, each channel has its own command and response flow, and is isolated from each other.

[0039] In an optional implementation of this embodiment, the runtime environment supports multiple logical channels, the application can use the multiple logical channel function, different applications can be selected on different logical channels at the same time, and an application that supports multiple selections can be selected multiple times on different logical channels at the same time.

[0040] That is, the operating system allows multiple logical channels to be run simultaneously, and multiple logical channels allow the same selected application to be run simultaneously.

[0041] The purpose of opening the logical channel can be achieved by selecting an application to be opened in a specified logical channel, or by directly opening a specified logical channel. Generally speaking, a new logical channel can be opened in a logical channel.

[0042] When the designated logical channel is opened, an application program designated to run on the logical channel will be run in the designated logical channel, and the application program is the selected application program. That is, when the designated logical channel is opened, the selected application program matching the logical channel needs to be activated and run in the designated logical channel.

[0043] S120. Allocate a temporary dynamic variable data space for the selected application.

[0044] The application program is obtained by installing the application module downloaded to the operating system. The application module can be understood as a module containing an entry function, and further, the application module can create one or more application programs.

[0045] An application module can be understood as an independent module that implements specific application functions or services and has an application entry function. It is usually divided according to functions or business logic. Applications can be created in application modules. In other words, applications are obtained by installing application modules downloaded to the operating system. An application module can be understood as a module that contains an entry function. In turn, an application module can create (or install) one or more applications.

[0046] Temporary dynamic variable data is a type of data used during the running of an application. It will be cleared or reset when a specific event occurs to ensure security and protect sensitive data. Temporary dynamic variable data is usually used to share temporary data between applications, such as temporary counters or caches. During the running of an application, memory space for storing temporary dynamic variable data needs to be allocated from the indirect access variable stack, that is, the temporary dynamic variable data space.

[0047] In an optional implementation of this embodiment, while allocating a temporary dynamic variable data space for the selected application, a module global data space may also be allocated for the selected application.

[0048] Module global data refers to global data that is visible to the entire module and can be modified by applications within the module, such as the application's global data or the application's global variable stack. During the running of the application, it is necessary to allocate memory space for storing module global data from the module's global variable memory area, which is the module global data space.

[0049] It should be noted that before allocating temporary dynamic variable data space (or the sum of temporary dynamic variable data space and module global data space) for the selected application, the virtual machine running domain corresponding to the specified logical channel needs to be updated to the virtual machine running domain of the selected application.

[0050] The virtual machine running domain refers to the virtual memory space built by RTE for the accessible data range of application running. It records information such as application identification and logical channels. Corresponding to the logical channel, there is only one running application on each logical channel that is bound to the virtual machine running domain on the logical channel.

[0051] S130. In response to the designated logical channel being closed, detect whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in the open state: if so, execute S140; otherwise, execute S150.

[0052] S140. Continue to reserve the temporary dynamic variable data space.

[0053] S150: Release the temporary dynamic variable data space allocated for the selected application.

[0054] The technical solution of the embodiment of the present invention controls the selected application to activate and run in the specified logical channel in response to the specified logical channel being opened through the runtime environment; allocates a temporary dynamic variable data space for the selected application; in response to the specified logical channel being closed, detects whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in an open state; if so, continues to reserve the temporary dynamic variable data space; otherwise, releases the implementation method of the temporary dynamic variable data space allocated to the selected application, with the logical channel as the main body, to manage the operation of the application running in the operating system, in addition, based on the logical channel, allocates the temporary dynamic variable data space to the currently running application, so that when different logical channels are selected, the application can correctly use the data in the temporary dynamic variable data space adapted to it, and thus can efficiently and conveniently manage multiple applications running simultaneously in the operating system.

[0055] Figure 2 A flowchart of another application management method provided by an embodiment of the present invention, this embodiment. This embodiment is optimized based on the above embodiments. In this embodiment, an implementation method of the operation of "in response to the opening of a designated logical channel, controlling the selected application to activate and run in the designated logical channel" and the operation of "allocating module global data space for the selected application" are concretized.

[0056] Correspondingly, such as Figure 2 As shown, the method includes:

[0057] S210: Calling an application selection interface corresponding to the selected application program.

[0058] The application selection interface may be understood as an interface for selecting an application to run in a logical channel. The application selection interface is implemented in advance by the application and provided to the runtime environment for calling when needed.

[0059] Optionally, when receiving a preset selection command (SELECT command), the runtime environment may determine that the application needs to be explicitly selected in the specified logical channel based on the application identifier (AID) of the set application contained in the selection instruction. Then, the selected application is selected by calling the application selection interface corresponding to the selected application.

[0060] In an optional implementation of this embodiment, calling the application selection interface corresponding to the selected application may include:

[0061] Get the target application module to which the selected application belongs;

[0062] Detecting whether other application programs belonging to the target application module are running in each logical channel currently in an open state;

[0063] If not, calling the application single-selection interface corresponding to the selected application; if yes, calling the application multi-selection interface corresponding to the selected application when it is determined that the selected application pre-registers the application multi-selection interface.

[0064] The target application module is an application module used to instantiate or install the selected application program. The target application module can obtain one or more application programs during the instantiation process.

[0065] When an application is already in an activated state, or when another application in the same application module is in an activated state, the virtual machine running domain of the application is in an activated state. At this time, attempting to select the application on other logical channels is called a multi-selection attempt. If the execution is successful, RTE will perform multiple selections, and the application will be multi-selected. The so-called multi-selection means that the application can run simultaneously in multiple logical channels at the same time.

[0066] That is, different applications can be selected on different logical channels at the same time, and an application program that supports multiple selections can be selected multiple times on different logical channels at the same time.

[0067] In this embodiment, an application program may be allowed to be multiple selected or may not be allowed to be multiple selected. Generally speaking, all application programs in an application module are either multiple selectable or non-multiple selectable.

[0068] If an application is multi-selectable, two types of application selection interfaces may be pre-built for the application, an application single-selection interface and an application multi-selection interface.

[0069] Among them, when the currently inactivated selected application is the first selected and activated application of the target application module to which the selected application belongs, the application single-selection interface is called to select its application; when the currently inactivated selected application is not the first selected and activated application of the application module to which the selected application belongs (that is, the selected application is currently running in other logical channels in the operating system or other applications in the target application module are running), the application multi-selection interface is called to select its application.

[0070] In this embodiment, an application that allows multiple selections needs to register an application multiple selection interface in the runtime environment in advance to notify the runtime environment that the application can respond to the application multiple selection interface. Furthermore, before the runtime environment needs to call the application multiple selection interface corresponding to the selected application, if it detects that the application multiple selection interface is not registered by the selected application, the runtime environment can directly refuse to execute the operation of activating the running of the selected application in the specified logical channel.

[0071] S220: upon receiving a selection acceptance response fed back by the application selection interface, determining that a designated logical channel is opened, and controlling the selected application to activate and run in the designated logical channel.

[0072] By calling the application selection interface, it is equivalent to applying to the selected application for the selection requirement of the selected application, and the selected application can accept or reject the application. If the selected application accepts the application, it can directly feedback the acceptance response through the application selection interface. At this time, it is determined that the specified logical channel is opened, and the selected application is controlled to activate and run in the specified logical channel.

[0073] S230. Search for a free global data space segment in a plurality of pre-established module global data space segments, and allocate the module global data space required by the selected application from the free global data space segment.

[0074] In this embodiment, the operating system can pre-divide the entire module global data space, and divide the entire module global data space into several segments according to the number of logical channels supported by the operating system, that is, obtain multiple module global data space segments. After the operating system is started, these resources are in a valid state, waiting for the opened logical channel to apply for resources.

[0075] Among them, the module global data is data exclusive to the logical channel. Therefore, every time a logical channel is opened, a free global data space segment needs to be independently allocated to the logical channel for real-time storage of the module global data of the selected application in the logical channel.

[0076] That is, when the same application or other applications in the same application module are selected on other logical channels, the module global data space will be allocated and initialized for the application in the same way as when the first application in the application module is selected.

[0077] When an application in a different application module is selected on another logical channel, the module global data space is allocated and initialized for the application in the same manner as when the first application in the application module is selected.

[0078] S240: If it is determined that the target application module to which the selected application belongs has imported other application modules, a local data space is divided from the module global data space allocated for the selected application.

[0079] S250: Allocate the local data space as the module global data space of other imported application modules.

[0080] As mentioned above, when an application is selected, the module global data space needs to be allocated and initialized, and each application module has its own module data set global data. Furthermore, when an application module (for example, application module A) imports other modules, when the application in the application module A is selected, the module global data space needs to be allocated not only for the module data set global data of the application module A, but also for the module data set global data of all other modules imported by the application module A.

[0081] Specifically, a portion of the module global data space allocated for the selected application program may be divided out as the module global data space for all other application modules imported by the target application module.

[0082] S260: Allocate a temporary dynamic variable data space for the selected application.

[0083] In a specific example, a free module global data space segment can be searched first, and if found, the index of the free module global data space segment is returned, and the module global data space required by the target application module to which the selected application belongs is allocated from the free module global data space segment.

[0084] The technical solution of the embodiment of the present invention provides a selection and multiple selection method for applications, so that the same application or different applications in the same application module can be selected on different logical channels. In addition, this solution provides an allocation method for module global data space based on logical channels, so that when applications are selected on different logical channels, they can correctly use the data in the module global data space adapted to them.

[0085] On the basis of the above embodiments, the following may also be included:

[0086] When it is determined that the runtime environment or the operating system performs a reset operation, a space arrangement operation is performed on the pre-established plurality of module global data space segments.

[0087] In this embodiment, when the runtime environment or operating system performs a reset operation (for example, restarting after a power failure), all applications within the operating system will be deselected (or, it can be understood as the application being closed). At this time, all data stored in the pre-established multiple module global data space segments are in an invalid state. At this time, a space cleanup operation can be directly performed on the multiple module global data space segments to clear various memory space fragments generated by the closure of logical channels.

[0088] Figure 3 A flowchart of another application management method provided by an embodiment of the present invention, this embodiment. This embodiment is optimized based on the above embodiments. In this embodiment, an implementation method of the operation of "in response to the opening of a designated logical channel, controlling the selected application to activate and run in the designated logical channel" and the operation of "allocating a temporary dynamic variable data space for the selected application" are concretized.

[0089] Correspondingly, such as Figure 3 As shown, the method includes:

[0090] S310. In response to a logical channel opening instruction, open a specified logical channel.

[0091] S320: Obtain a default selected application in the designated logical channel as a selected application, and control the selected application to activate and run in the designated logical channel.

[0092] In this embodiment, when RTE receives a logical channel opening instruction to open a specified logical channel, in addition to performing necessary logical channel management, RTE should also check whether there is a default selected application (also called an implicitly selected application) on the logical channel. If so, the default selected application should be activated by default.

[0093] Specifically, some applications may be implicitly selected by default after a reset or after a certain logical channel is successfully opened. The process of implicitly selecting such an application is called a default selected application.

[0094] Optionally, RTE may allow a default selected application to be set on each logical channel. When a designated logical channel with a default selected application set is triggered to be opened by a logical channel open instruction, the default application on the designated logical channel will be implicitly selected as the selected application.

[0095] S330. Allocate module global data space for the selected application.

[0096] S340, detecting whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in the open state: if so, executing S350; otherwise, executing S360.

[0097] When an application is selected, a temporary dynamic variable (dynamic transient resource, ADR) data space needs to be allocated and initialized. Each application can have its own temporary dynamic variable data space. The temporary dynamic variable data space is applied for when the application is created, but is not actually allocated. It is actually allocated when the application is selected.

[0098] All application programs in the same application module share the same temporary dynamic variable data space. When an application program in a different application module is selected on another logical channel, a new temporary dynamic variable data space is allocated and initialized for the application program.

[0099] In other words, temporary dynamic variable data is used to share temporary data between applications in the same application module. Therefore, before allocating temporary dynamic variable data space for the selected application in the specified logical channel, the runtime environment needs to first detect whether other applications belonging to the target application module are running in each logical channel currently in the open state. If other applications are running, the temporary dynamic variable data space will no longer be reallocated for the selected application, and the target temporary dynamic variable data space allocated for other applications in the target application module can be directly used.

[0100] Among them, other application programs belonging to the target application module can be understood as application programs that are the same as or different from the selected application program.

[0101] S350, obtaining the target temporary dynamic variable data space allocated for the other application programs, and executing S370.

[0102] S360 . Query a free dynamic variable space segment in a plurality of pre-established temporary dynamic variable data space segments, and execute S380 .

[0103] Similarly, the temporary dynamic variable data space resources in the operating system can be divided into several segments according to the number of logical channels supported by the operating system. After the operating system is started, these resources are in a valid state, waiting for the opened logical channels to apply for resources.

[0104] S370. Synchronously allocate the target temporary dynamic variable data space to the selected application.

[0105] S380. Allocate temporary dynamic variable data space required by the selected application from the free dynamic variable space segment.

[0106] In a specific example, if the selected application is not the first application selected in the target application module to which it belongs, the state of the specified logical channel is recorded as application multiple selection, and the dynamic variable data space is no longer reallocated for the selected application. Instead, the dynamic variable data space already applied for by other applications in the target application module to which the application belongs is used; if the selected application is the first application selected in the target application module to which it belongs, the state of the specified logical channel is recorded as application selection, and a free dynamic variable space segment is searched; if found, the index identifier of the found free dynamic variable space segment is returned, and the temporary dynamic variable data space applied for by the selected application is allocated from the found free dynamic variable space segment.

[0107] The technical solution of the embodiment of the present invention provides a method for allocating temporary dynamic variable data space based on logical channels, so that when an application is selected on different logical channels, it can correctly use the data in the temporary dynamic variable data space adapted thereto.

[0108] In addition to the above-mentioned embodiments, the following may also be included:

[0109] When it is determined that the runtime environment or the operating system performs a reset operation, a space arrangement operation is performed on the pre-established plurality of temporary dynamic variable data space segments.

[0110] In this embodiment, when the runtime environment or operating system performs a reset operation (for example, restarting after a power failure), all applications within the operating system will be deselected (or, it can be understood as the application being closed). At this time, all data stored in the pre-established multiple temporary dynamic variable data space segments are in an invalid state. At this time, a space cleanup operation can be directly performed on the multiple temporary dynamic variable data space segments to clear various memory space fragments generated by the closure of the logical channel.

[0111] Figure 4 A flowchart of another application management method provided by an embodiment of the present invention, this embodiment. This embodiment is optimized based on the above embodiments, and in this embodiment, after the designated logical channel is closed, the release operation of the allocated module global data space temporary dynamic variable data space is further refined.

[0112] Correspondingly, such as Figure 4 As shown, the method may specifically include:

[0113] S410: In response to a designated logical channel being opened, controlling a selected application to activate and run in the designated logical channel.

[0114] S420: Allocate module global data space and temporary dynamic variable data space for the selected application.

[0115] S430: In response to the designated logical channel being closed, releasing the module global data space allocated to the selected application.

[0116] When the specified logical channel is closed, it is equivalent to deselecting the selected application in the specified logical channel, that is, the selected application on the specified logical channel is abandoned. Since the module global data is data exclusively used by the logical channel, the module global data space resources occupied by the selected application will also be directly released.

[0117] Furthermore, when the designated logical channel is closed, the current virtual machine running domain information corresponding to the designated logical channel needs to be synchronously updated to an invalid value.

[0118] S440, detecting whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in the open state: if so, executing S450; otherwise, executing S460.

[0119] S450. Continue to reserve the temporary dynamic variable data space, and execute S470.

[0120] S460 . Release the temporary dynamic variable data space allocated for the selected application, and execute S470 .

[0121] Correspondingly, if the selected application is not the last application to be deselected in the target application module to which it belongs, the temporary dynamic variable data space resources will not be reclaimed; if the selected application is the last application to be deselected in the target application module to which it belongs, the temporary dynamic variable data space resources need to be reclaimed.

[0122] S470: Execute a deselection operation on the selected application in the designated logical channel, and after completing the deselection of the selected application, close the designated logical channel.

[0123] In an optional implementation of this embodiment, performing a deselection operation on a selected application in a specified logical channel may include:

[0124] The application selection interface corresponding to the selected application is called to select the selected application in the specified logical channel.

[0125] Further, calling the application selection interface corresponding to the selected application may include:

[0126] Get the target application module to which the selected application belongs;

[0127] Detecting whether other application programs belonging to the target application module are running in each logical channel currently in an open state;

[0128] If not, then call the application corresponding to the selected application to go to the single selection interface; if so, then call the application corresponding to the selected application to go to the multiple selection interface.

[0129] Similar to multi-select applications, when a multi-select application is deselected from a specified logical channel, an application de-multi-select interface (or, the interface may also be referred to as a method) will be called. The application de-single-select interface will only be called when the multi-select application is the last activated application belonging to the target application module.

[0130] The technical solution of the embodiment of the present invention provides a method for multiple selection and deselection of applications, so that the same application or different applications in the same application module can be selected on different logical channels; the solution provides a method for allocating and reclaiming module global data space based on logical channels, so that when an application is selected on different logical channels, it can correctly use the data in the module global data space to which it is adapted. In addition, the solution provides a method for allocating and reclaiming temporary dynamic variable data space based on logical channels, so that when an application is selected on different logical channels, it can correctly use the temporary dynamic variable data space applied for when it is created.

[0131] On the basis of the above embodiments, after releasing the module global data space allocated for the selected application, the method may further include:

[0132] Detecting whether the module global data space belongs to the last space segment among a plurality of pre-established module global data space segments;

[0133] If not, a space arrangement operation is performed on the global data space segments of the multiple modules.

[0134] In this embodiment, in order to avoid excessive memory space fragmentation to the greatest extent, after each module global data space is released, it can be detected whether the currently released module global data space belongs to the last space segment of the multiple module global data space segments established in advance. If so, it means that no large memory fragmentation will be generated, and no memory space arrangement operation can be performed; if not, it means that the currently released module global data space is in the middle of all module global data space segments. If the memory space arrangement is not performed, memory fragmentation will be generated in this middle position. At this time, it is necessary to perform a space arrangement operation on the multiple module global data space segments.

[0135] In a specific example, when performing space arrangement, the size of the currently released module global data space may be obtained, and the data in the module global data space on other subsequent logical channels may be sequentially moved forward by the size.

[0136] Based on the above embodiments, after releasing the temporary dynamic variable data space allocated for the selected application, the method may further include:

[0137] Detecting whether the temporary dynamic variable data space belongs to the last space segment among a plurality of pre-established temporary dynamic variable data space segments;

[0138] If not, a space arrangement operation is performed on the multiple temporary dynamic variable data space segments.

[0139] In this embodiment, in order to avoid excessive memory space fragmentation to the greatest extent, after each release of the temporary dynamic variable data space, it can be detected whether the currently released temporary dynamic variable data space belongs to the last space segment among the multiple pre-established temporary dynamic variable data space segments. If so, it means that no large memory fragmentation will be generated, and the memory space arrangement operation can be omitted; if not, it means that the currently released temporary dynamic variable data space is in the middle of all temporary dynamic variable data space segments. If the memory space arrangement is not performed, memory fragmentation will be generated in this middle position. At this time, it is necessary to perform space arrangement operations on the multiple temporary dynamic variable data space segments.

[0140] In a specific example, when performing space arrangement, the size of the currently released temporary dynamic variable data space may be obtained, and the data in the subsequent temporary dynamic variable data spaces on other logical channels may be sequentially moved forward by the size.

[0141] In another optional implementation of this embodiment, when a designated logical channel is closed, if the operating system is in a situation where performance requirements are relatively high, at this time, memory space defragmentation may not be performed first, but memory space defragmentation may be performed uniformly when the operating system or runtime environment is reset.

[0142] Figure 5 The schematic diagram of the structure of an application management device provided by an embodiment of the present invention is shown in FIG. The device is configured in a runtime environment in an operating system, and the operating system is installed in an electronic device, such as Figure 5 As shown, the device includes: a control operation module 510, a data space allocation module 520 and a data space release module 530, wherein:

[0143] A control operation module 510, configured to control the selected application to activate and operate in the designated logical channel in response to the designated logical channel being opened;

[0144] A data space allocation module 520, configured to allocate a temporary dynamic variable data space to the selected application;

[0145] The temporary dynamic variable data space is used to store temporary dynamic variable data used during the running of the application program;

[0146] The data space release module 530 is used to detect, in response to the closing of the designated logical channel, whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel that is currently in an open state; if so, continue to retain the temporary dynamic variable data space; otherwise, release the temporary dynamic variable data space allocated for the selected application.

[0147] The technical solution of the embodiment of the present invention controls the selected application to activate and run in the specified logical channel in response to the specified logical channel being opened through the runtime environment; allocates a temporary dynamic variable data space for the selected application; in response to the specified logical channel being closed, detects whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in an open state; if so, continues to reserve the temporary dynamic variable data space; otherwise, releases the implementation method of the temporary dynamic variable data space allocated for the selected application, with the logical channel as the main body, to manage the operation of the application running in the operating system, in addition, based on the logical channel, allocates and releases the temporary dynamic variable data space for the currently running application, so that when different logical channels are selected, the application can correctly use the data in the temporary dynamic variable data space adapted to it, and thus can efficiently and conveniently manage multiple applications running simultaneously in the operating system.

[0148] Based on the above embodiments, the control operation module 510 specifically includes:

[0149] A selection interface calling unit, used to call an application selection interface corresponding to the selected application program;

[0150] The channel opening unit is used to determine that the specified logical channel is opened when receiving the acceptance selection response fed back by the application selection interface, and control the selected application to activate and run in the specified logical channel.

[0151] Based on the above embodiments, the control operation module 510 is specifically used for:

[0152] In response to a logical channel opening instruction, opening a specified logical channel;

[0153] The default selected application in the designated logical channel is obtained as the selected application, and the selected application is controlled to be activated and run in the designated logical channel.

[0154] Based on the above embodiments, the interface calling unit is selected to be specifically used for:

[0155] Get the target application module to which the selected application belongs;

[0156] Detect whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in the open state;

[0157] If not, calling the application single-selection interface corresponding to the selected application; if yes, calling the application multi-selection interface corresponding to the selected application when it is determined that the selected application pre-registers the application multi-selection interface.

[0158] Based on the above embodiments, the data space allocation module 520 can be specifically used for:

[0159] When other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in the open state, obtaining the target temporary dynamic variable data space allocated for the other applications;

[0160] The target temporary dynamic variable data space is synchronously allocated to the selected application.

[0161] Based on the above embodiments, the data space allocation module 520 can be specifically used for:

[0162] When no other application program belonging to the target application module to which the selected application program belongs is running in each logical channel currently in the open state, querying a free dynamic variable space segment in a plurality of pre-established temporary dynamic variable data space segments;

[0163] The temporary dynamic variable data space required by the selected application is allocated from the free dynamic variable space segment.

[0164] On the basis of the above embodiments, the present invention may further include: a temporary dynamic variable data space release module, which is used to:

[0165] After allocating a temporary dynamic variable data space for the selected application, in response to the designated logical channel being closed, detecting whether other applications belonging to the target application module are running in each logical channel currently in an open state;

[0166] If so, continue to reserve the temporary dynamic variable data space; otherwise, release the temporary dynamic variable data space allocated for the selected application.

[0167] On the basis of the above embodiments, an application selection module may be further included, for:

[0168] In response to the designated logical channel closing instruction, a deselection operation is performed on the selected application in the designated logical channel, and after the deselection of the selected application is completed, the designated logical channel is closed.

[0169] Based on the above embodiments, the application selection module can be specifically used for:

[0170] The application selection interface corresponding to the selected application is called to select the selected application in the specified logical channel.

[0171] Based on the above embodiments, the application selection module can be further used to:

[0172] Get the target application module to which the selected application belongs;

[0173] Detecting whether other application programs belonging to the target application module are running in each logical channel currently in an open state;

[0174] If not, then call the application corresponding to the selected application to go to the single selection interface; if so, then call the application corresponding to the selected application to go to the multiple selection interface.

[0175] On the basis of the above embodiments, a temporary dynamic variable data space arrangement module may also be included, which is used to:

[0176] Detecting whether the temporary dynamic variable data space belongs to the last space segment among a plurality of pre-established temporary dynamic variable data space segments;

[0177] If not, a space arrangement operation is performed on the multiple temporary dynamic variable data space segments.

[0178] On the basis of the above embodiments, a reset and finishing module may be further included, which is used for:

[0179] When it is determined that the runtime environment or the operating system performs a reset operation, a space arrangement operation is performed on the pre-established plurality of temporary dynamic variable data space segments.

[0180] The application management device provided in the embodiment of the present invention can execute the application management method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0181] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0182] Figure 6 A schematic structural diagram of an electronic device 10 that can be used to implement an embodiment of the present invention is shown.

[0183] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0184] The electronic device may be a resource-constrained device. A resource-constrained device may be understood as an electronic device with limited storage capacity, and its RAM resources are limited, generally a few KB to tens of KB, and its NVM (non-volatile memory) resources are limited. Figure 6 Taking ROM as an example) it is tens of KB to hundreds of KB, and the maximum is MB level.

[0185] The resource-constrained device may generally be: a smart card, a USBKEY, an ESAM (Embedded Secure Access Module), an IoT device or a SE (Secure Element), etc. The smart card may generally be a multi-application smart card.

[0186] The I / O interface 15 in the electronic device 10 may include: eSPI (Enhanced Serial Peripheral Interface) and SPI (Serial Peripheral Interface), etc.

[0187] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, for example, executes an application management method as described in various embodiments of the present invention, which is executed by a runtime environment in an operating system, and the operating system is installed in an electronic device, and the method includes:

[0188] In response to the designated logical channel being opened, controlling the selected application to activate and run in the designated logical channel;

[0189] Allocating a temporary dynamic variable data space for the selected application; wherein the temporary dynamic variable data space is used to store temporary dynamic variable data used during the running of the application;

[0190] In response to the designated logical channel being closed, detecting whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in an open state;

[0191] If so, continue to reserve the temporary dynamic variable data space; otherwise, release the temporary dynamic variable data space allocated for the selected application.

[0192] In some embodiments, an application management method as described in various embodiments of the present invention may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 16. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of an application management method as described in various embodiments of the present invention described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute an application management method as described in various embodiments of the present invention in any other appropriate manner (e.g., by means of firmware).

[0193] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0194] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0195] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0196] Figure 7 is a structural diagram of a terminal provided according to an embodiment of the present invention. Figure 7 Said terminal comprises the electronic device 710 as described in any embodiment of the present invention.

[0197] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

Claims

1. An application management method, characterized in that: The method is executed by a runtime environment in an operating system installed in an electronic device, and includes: In response to the designated logical channel being opened, controlling the selected application to activate and run in the designated logical channel; Allocating a temporary dynamic variable data space for the selected application; The temporary dynamic variable data space is used to store temporary dynamic variable data used during the running of the application program; In response to the designated logical channel being closed, detecting whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in an open state; If so, continue to reserve the temporary dynamic variable data space; otherwise, release the temporary dynamic variable data space allocated for the selected application.

2. The method according to claim 1, characterized in that In response to the designated logical channel being opened, controlling the selected application to activate and run in the designated logical channel includes: Calling the application selection interface corresponding to the selected application; When receiving the selection acceptance response fed back by the application selection interface, it is determined that the designated logical channel is opened, and the selected application is controlled to activate and run in the designated logical channel.

3. The method according to claim 1, characterized in that In response to the designated logical channel being opened, controlling the selected application to activate and run in the designated logical channel includes: In response to a logical channel opening instruction, opening a specified logical channel; The default selected application in the designated logical channel is obtained as the selected application, and the selected application is controlled to be activated and run in the designated logical channel.

4. The method according to claim 2, characterized in that: Calling the application selection interface corresponding to the selected application program includes: Get the target application module to which the selected application belongs; Detecting whether other application programs belonging to the target application module are running in each logical channel currently in an open state; If not, calling the application single-selection interface corresponding to the selected application; if yes, calling the application multi-selection interface corresponding to the selected application when it is determined that the selected application pre-registers the application multi-selection interface.

5. The method according to claim 1, characterized in that Allocating a temporary dynamic variable data space for the selected application comprises: When other applications belonging to the target application module to which the selected application belongs are running in each logical channel currently in the open state, obtaining the target temporary dynamic variable data space allocated for the other applications; The target temporary dynamic variable data space is synchronously allocated to the selected application.

6. The method according to claim 1, characterized in that Allocating a temporary dynamic variable data space for the selected application comprises: When no other application program belonging to the target application module to which the selected application program belongs is running in each logical channel currently in the open state, querying a free dynamic variable space segment in a plurality of pre-established temporary dynamic variable data space segments; The temporary dynamic variable data space required by the selected application is allocated from the free dynamic variable space segment.

7. The method according to claim 1, characterized in that Also includes: In response to the designated logical channel closing instruction, a deselection operation is performed on the selected application in the designated logical channel, and after the deselection of the selected application is completed, the designated logical channel is closed.

8. The method according to claim 7, characterized in that Execute the deselection operation on the selected application in the specified logical channel, including: The application selection interface corresponding to the selected application is called to select the selected application in the specified logical channel.

9. The method according to claim 8, characterized in that Calling the application corresponding to the selected application to select the interface, including: Get the target application module to which the selected application belongs; Detecting whether other application programs belonging to the target application module are running in each logical channel currently in an open state; If not, then call the application corresponding to the selected application to go to the single selection interface; if so, then call the application corresponding to the selected application to go to the multiple selection interface.

10. The method according to claim 1, characterized in that After releasing the temporary dynamic variable data space allocated for the selected application, the method further comprises: Detecting whether the temporary dynamic variable data space belongs to the last space segment among a plurality of pre-established temporary dynamic variable data space segments; If not, a space arrangement operation is performed on the multiple temporary dynamic variable data space segments.

11. The method according to claim 6, characterized in that Also includes: When it is determined that the runtime environment or the operating system performs a reset operation, a space arrangement operation is performed on the pre-established plurality of temporary dynamic variable data space segments.

12. An application management device, characterized in that: A runtime environment configured in an operating system, the operating system being installed in an electronic device, the device comprising: A control operation module, used for controlling the selected application to activate and operate in the specified logical channel in response to the specified logical channel being opened; A data space allocation module, used for allocating temporary dynamic variable data space for the selected application; The temporary dynamic variable data space is used to store temporary dynamic variable data used during the running of the application program; A data space release module is used to detect, in response to the closing of a designated logical channel, whether other applications belonging to the target application module to which the selected application belongs are running in each logical channel that is currently in an open state; if so, continue to retain the temporary dynamic variable data space; otherwise, release the temporary dynamic variable data space allocated for the selected application.

13. An electronic device, characterized in that: The electronic device has an operating system installed thereon, a runtime environment is executed in the operating system, and the electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application management method according to any one of claims 1 to 11.

14. The electronic device according to claim 13, characterized in that: The electronic device is a resource-constrained device.

15. The electronic device according to claim 14, characterized in that: The resource-constrained device includes: a smart card, a USBKEY, an embedded security control module and a security element.

16. A terminal, characterized in that: Comprising the electronic device as described in any one of claims 13-15.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application management method according to any one of claims 1 to 11 when executed.

18. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the application management method according to any one of claims 1 to 11.