Application firewall implementation methods, storage media and devices for embedded devices
By creating an identifier object based on the unique identifier of the application package on the embedded device and registering information, object access is classified and controlled, which solves the problem of mismatch between object access and runtime environment after virtual machine package upgrade, and realizes effective inspection of application firewall.
Patent Information
- Application Number
- CN202310968179.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-02
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-08-02
AI Technical Summary
On embedded devices, after the virtual machine package is upgraded, there are problems with the firewall checks of the original objects, resulting in a mismatch between object access and the runtime environment.
Identifier objects are created based on the unique identifier of the application package, and the application package information is registered after downloading on the embedded device. All objects are classified according to the creation time and environment, and access control is implemented based on the object type, invocation method and runtime environment.
During application operation or package upgrade, the uniqueness of object access and runtime environment is ensured, which solves the problem of mismatch between object access and runtime environment and realizes effective firewall inspection.
Smart Images

Figure CN117134948B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically to a method, storage medium, and apparatus for implementing an application firewall in an embedded device. Background Technology
[0002] For virtual machines supported on embedded devices, such as the Java Virtual Machine (JVM), object access control typically uses the download order ID (encoding) of packages as its runtime environment, and all object access control permissions are determined based on this order ID. However, when the virtual machine supports package upgrades, the download order ID of the new upgrade package differs from the original package, and the original user data (objects) cannot be modified. This leads to problems with firewall checks of the original objects after the package upgrade. Therefore, a more robust object firewall implementation method is urgently needed. Summary of the Invention
[0003] To address the shortcomings of existing technologies, the present invention aims to provide an application firewall implementation method, storage medium, and device for embedded devices. By using the identification object of the application package as the environment value of the application object, uniqueness is guaranteed. The identification object can be used for firewall checks during application operation or application package upgrade, effectively solving the problem of possible mismatch between object access and runtime environment.
[0004] To achieve the above objectives, this invention provides a method for implementing an application firewall in an embedded device, specifically including the following steps:
[0005] An identifier object is created based on the unique identifier of the application package, and the application package information is registered based on the identifier object after the application package is downloaded to the embedded device;
[0006] All objects on the embedded device are categorized based on when they were created and their environment.
[0007] Access to an object is achieved based on its type, the method by which the object is invoked, and the runtime environment.
[0008] Based on the above technical solution, before creating the identifier object based on the unique identifier of the application package, the following is also included:
[0009] When an embedded device downloads an application package, its operating system checks whether the unique identifier of the application package to be downloaded has been registered on the embedded device.
[0010] If not, an identifier object is created based on the unique identifier of the application package, and the application package information is registered based on the identifier object after the application package is downloaded to the embedded device;
[0011] If so, no action will be taken.
[0012] Based on the above technical solution, the step of classifying all objects on the embedded device according to the creation time and environment includes the following specific steps:
[0013] For all objects on embedded devices, based on when the object is created and the environment in which it belongs, objects are divided into runtime environment objects and application objects.
[0014] Based on the above technical solutions, specifically regarding runtime environment objects:
[0015] Runtime environment objects are created using the runtime environment of the operating system of the embedded device, and any application within the operating system can access the runtime environment objects.
[0016] The object environment stored within the runtime environment object is represented by a set index value.
[0017] Based on the above technical solutions, specifically for the application objects:
[0018] Application objects are created through application packages or application instances of application packages, and package objects created during application package download and instance objects created during application installation or operation are not application objects;
[0019] The application package identifier object index represents the object environment stored within the application object;
[0020] When the application object is not a globally referenced object, access to the application object is allowed only if the currently executing runtime environment is the system runtime environment, or if the currently executing runtime environment is the same as the object environment of the application object.
[0021] Based on the above technical solution, the specific steps for accessing objects based on object type, object invocation method, and runtime environment include:
[0022] Based on the object's type, the way the object is invoked, and the runtime environment, object access types are divided into object-based method invocation and object read / write access, thus enabling access to the object.
[0023] Based on the above technical solutions, for object-based method calls, specifically:
[0024] When the embedded device supports shared interface methods and the object to be accessed is a shared interface object, determine whether the method called by the object to be accessed is a shared interface method.
[0025] If so, then access to the object to be accessed is permitted;
[0026] If not, access to the object to be accessed is allowed when the currently executing runtime environment is the system runtime environment, or when the currently executing runtime environment is the same as the object environment of the object to be accessed.
[0027] Based on the above technical solutions, for reading and writing access to objects, specifically:
[0028] Access to the object to be accessed is permitted if the object to be accessed is a runtime environment object, the currently executing runtime environment is the system runtime environment, or the currently executing runtime environment is the same as the object environment of the object to be accessed.
[0029] The present invention provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the application firewall implementation method of the embedded device described above.
[0030] This invention provides an application firewall implementation device for embedded devices, comprising:
[0031] The module is used to create an identifier object based on the unique identifier of the application package, and register the application package information based on the identifier object after the application package is downloaded to the embedded device;
[0032] The classification module is used to classify all objects on the embedded device according to the time of creation and the environment in which they belong;
[0033] The execution module is used to access objects based on their type, the way they are invoked, and the runtime environment.
[0034] Compared with existing technologies, the advantages of this invention are as follows: by creating an identification object based on the unique identifier of the application package, and registering the application package information based on the identification object after the application package is downloaded to the embedded device, all objects on the embedded device are classified according to the creation time and environment, and finally access to the object is realized based on the object type, the method of object invocation, and the runtime environment. The identification object of the application package is used as the environment value of the application object to ensure uniqueness. The identification object can be used for firewall checks during application operation or application package upgrade, effectively solving the problem of possible mismatch between object access and runtime environment. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a flowchart of an application firewall implementation method for an embedded device according to an embodiment of the present invention;
[0037] Figure 2 This is a schematic diagram of the structure of an application firewall implementation device for an embedded device according to the present invention. Detailed Implementation
[0038] This invention provides a method for implementing an application firewall on an embedded device. It creates an identifier object based on the unique identifier of an application package. After the application package is downloaded to the embedded device, the application package information is registered based on the identifier object. All objects on the embedded device are categorized according to the creation time and environment. Finally, access to the object is achieved based on the object type, the method of object invocation, and the runtime environment. The identifier object of the application package is used as the environment value of the application object to ensure uniqueness. Firewall checks can be performed on the identifier object during application execution or application package upgrades, effectively solving the problem of potential mismatch between object access and runtime environment. This invention also provides a non-transitory computer-readable storage medium and an application firewall implementation device for an embedded device.
[0039] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this application, but not all embodiments.
[0040] See Figure 1 As shown in the figure, an application firewall implementation method for an embedded device provided by an embodiment of the present invention specifically includes the following steps:
[0041] S1: Create an identifier object based on the unique identifier of the application package, and register the application package information based on the identifier object after the application package is downloaded to the embedded device;
[0042] In this invention, before creating the identifier object based on the unique identifier of the application package, the following steps are also included:
[0043] When an embedded device downloads an application package, its operating system checks whether the unique identifier of the application package to be downloaded has been registered on the embedded device.
[0044] If not, an identifier object is created based on the unique identifier of the application package, and the application package information is registered based on the identifier object after the application package is downloaded to the embedded device;
[0045] If so, no action will be taken.
[0046] Before the application package is downloaded to embedded devices such as smart cards and security modules, the operating system of the embedded device checks whether the unique identifier (i.e., application identifier, or AID) of the application package to be downloaded has been registered on the embedded device. If it has not been registered, an identifier object is created using the unique identifier of the application package, and the application package information is registered using the identifier object after the application package is successfully downloaded. S2: All objects on the embedded device are classified according to the creation time and the environment.
[0047] In this invention, all objects on an embedded device are classified according to the timing of their creation and the environment in which they belong. The specific steps include: for all objects on the embedded device, the objects are classified into runtime environment objects and application objects according to the timing of their creation and the environment in which they belong.
[0048] All objects on the embedded device will be divided into two types: runtime environment objects and application objects.
[0049] For runtime environment objects, specifically:
[0050] Runtime environment objects are created using the runtime environment of the operating system of the embedded device, and any application within the operating system can access the runtime environment objects.
[0051] The runtime environment object is represented by a specific index value (such as 0x0000). The identifier object created in step S1 belongs to the runtime environment object.
[0052] In this invention, the specific application objects are as follows:
[0053] Application objects are created through application packages or application instances of application packages, and package objects created during application package download and instance objects created during application installation or operation are not application objects;
[0054] The application package identifier object index represents the object environment stored within the application object;
[0055] When the application object is not a globally referenced object, access to the application object is allowed only if the currently executing runtime environment is the system runtime environment, or if the currently executing runtime environment is the same as the object environment of the application object.
[0056] In other words, for application objects, they are created from application packages or application instances of application packages. When an application object is not a globally referenced object, access is only permitted if the currently executing runtime environment is the system runtime environment, or if the currently executing runtime environment is the same as the object environment of the application object. Package objects created during application package download and instance objects created during application installation or runtime are all application objects. The object environment stored within an application object is the identifier object index of the package it belongs to.
[0057] S3: Enables access to objects based on their type, the method they are invoked in, and the runtime environment.
[0058] In this invention, access to an object is achieved based on the object's type, the method by which the object is invoked, and the runtime environment. Specific steps include:
[0059] Based on the object's type, the way the object is invoked, and the runtime environment, object access types are divided into object-based method invocation and object read / write access, thus enabling access to the object.
[0060] In this invention, for object-based method calls, specifically:
[0061] When the embedded device supports shared interface methods and the object to be accessed is a shared interface object, determine whether the method called by the object to be accessed is a shared interface method.
[0062] If so, then access to the object to be accessed is permitted;
[0063] If not, access to the object to be accessed is allowed when the currently executing runtime environment is the system runtime environment, or when the currently executing runtime environment is the same as the object environment of the object to be accessed.
[0064] In other words, when an embedded device supports shared interface methods, if the object to be accessed is a shared interface object and the method called is a shared interface method, then access to the object to be accessed is allowed. If the method called is not a shared interface method, then access to the object to be accessed is allowed only if the currently executing runtime environment is the system runtime environment, or if the currently executing runtime environment is the same as the object environment of the object to be accessed.
[0065] In this invention, the specific methods for reading and writing objects are as follows:
[0066] Access to the object to be accessed is permitted if the object to be accessed is a runtime environment object, the currently executing runtime environment is the system runtime environment, or the currently executing runtime environment is the same as the object environment of the object to be accessed.
[0067] In other words, if the object to be accessed is a runtime environment object, then access to the object to be accessed is allowed; if the currently executing runtime environment is the system runtime environment, then access to the object to be accessed is allowed; if the currently executing runtime environment is the same as the object environment of the object to be accessed, then access to the object to be accessed is allowed.
[0068] The application firewall implementation method for embedded devices in this invention creates an identifier object based on the unique identifier of the application package. After the application package is downloaded to the embedded device, the application package information is registered based on the identifier object. All objects on the embedded device are classified according to the creation time and the environment. Finally, access to the object is realized based on the object type, the method of object invocation, and the runtime environment. The identifier object of the application package is used as the environment value of the application object to ensure uniqueness. The identifier object can be used for firewall checks during application operation or application package upgrade, effectively solving the problem of possible mismatch between object access and runtime environment.
[0069] In one possible implementation, the present invention also provides a non-transitory computer-readable storage medium located in a PLC (Programmable Logic Controller) controller. The storage medium stores a computer program that, when executed by a processor, implements the steps of the following embedded device application firewall implementation method:
[0070] An identifier object is created based on the unique identifier of the application package, and the application package information is registered based on the identifier object after the application package is downloaded to the embedded device;
[0071] All objects on the embedded device are categorized based on when they were created and their environment.
[0072] Access to an object is achieved based on its type, the method by which the object is invoked, and the runtime environment.
[0073] Storage media may be any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. Computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0074] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.
[0075] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0076] See Figure 2As shown in the figure, an application firewall implementation device for an embedded device provided by an embodiment of the present invention includes a creation module, a classification module, and an execution module.
[0077] The creation module is used to create an identifier object based on the unique identifier of the application package, and register the application package information based on the identifier object after the application package is downloaded to the embedded device; the classification module is used to classify all objects on the embedded device according to the creation time and the environment; the execution module is used to access the object based on the object type, the method called by the object, and the runtime environment.
[0078] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
[0079] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
Claims
1. A method for implementing an application firewall for an embedded device, the method comprising: Specifically, the following steps are included: An identifier object is created based on the unique identifier of the application package, and the application package information is registered based on the identifier object after the application package is downloaded to the embedded device; All objects on the embedded device are categorized based on when they were created and their environment. Access to objects is achieved based on their type, the method in which they are invoked, and the runtime environment. The specific steps for classifying all objects on the embedded device based on their creation time and environment include: For all objects on embedded devices, based on when the object is created and the environment in which the object belongs, the objects are divided into runtime environment objects and application objects; Specifically, for runtime environment objects: Runtime environment objects are created using the runtime environment of the operating system of the embedded device, and any application within the operating system can access the runtime environment objects. The object environment stored within the runtime environment object is represented by a set index value; Specifically, regarding the application object: Application objects are created through application packages or application instances of application packages. Package objects created during application package download and instance objects created during application installation or operation are both application objects. The application package identifier object index represents the object environment stored within the application object; When the application object is not a globally referenced object, access to the application object is allowed only if the currently executing runtime environment is the system runtime environment, or if the currently executing runtime environment is the same as the object environment of the application object.
2. The method of claim 1, wherein the application firewall is implemented on the embedded device. Before creating the identifier object based on the application package's unique identifier, the following is also included: When an embedded device downloads an application package, its operating system checks whether the unique identifier of the application package to be downloaded has been registered on the embedded device. If not, an identifier object is created based on the unique identifier of the application package, and the application package information is registered based on the identifier object after the application package is downloaded to the embedded device; If so, no action will be taken.
3. The method for implementing an application firewall in an embedded device as described in claim 1, characterized in that, The method for accessing an object based on its type, the way it is invoked, and the runtime environment includes the following steps: Based on the object's type, the way the object is invoked, and the runtime environment, object access types are divided into object-based method invocation and object read / write access, thus enabling access to the object.
4. The method for implementing an application firewall in an embedded device as described in claim 1, characterized in that, For object-based method calls, specifically: When the embedded device supports shared interface methods and the object to be accessed is a shared interface object, determine whether the method called by the object to be accessed is a shared interface method. If so, then access to the object to be accessed is permitted; If not, access to the object to be accessed is allowed when the currently executing runtime environment is the system runtime environment, or when the currently executing runtime environment is the same as the object environment of the object to be accessed.
5. The method for implementing an application firewall in an embedded device as described in claim 1, characterized in that, For reading and writing access to objects, specifically: Access to the object to be accessed is permitted if the object to be accessed is a runtime environment object, the currently executing runtime environment is the system runtime environment, or the currently executing runtime environment is the same as the object environment of the object to be accessed.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the application firewall implementation method for the embedded device as described in any one of claims 1 to 5.
7. An application firewall implementation device for an embedded device, characterized in that, include: The module is used to create an identifier object based on the unique identifier of the application package, and register the application package information based on the identifier object after the application package is downloaded to the embedded device; The classification module is used to classify all objects on the embedded device according to the time of creation and the environment in which they belong; The execution module is used to access objects based on their type, the method the object is invoked, and the runtime environment. The specific steps for classifying all objects on the embedded device based on their creation time and environment include: For all objects on embedded devices, based on when the object is created and the environment in which the object belongs, the objects are divided into runtime environment objects and application objects; Specifically, for runtime environment objects: Runtime environment objects are created using the runtime environment of the operating system of the embedded device, and any application within the operating system can access the runtime environment objects. The object environment stored within the runtime environment object is represented by a set index value; Specifically, regarding the application object: Application objects are created through application packages or application instances of application packages. Package objects created during application package download and instance objects created during application installation or operation are both application objects. The application package identifier object index represents the object environment stored within the application object; When the application object is not a globally referenced object, access to the application object is allowed only if the currently executing runtime environment is the system runtime environment, or if the currently executing runtime environment is the same as the object environment of the application object.
Citation Information
Patent Citations
Method and device for applying patch program in Java Card
CN102033771A
Java card object access control method
CN103093142A
