System resource calling method and device
By creating an application sandbox for each application and recording the system resource address information it depends on, the problem of resource version confusion in a multi-application environment is solved, and accurate calling and stable operation are achieved.
Patent Information
- Application Number
- CN202310313277.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-24
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2043-03-24
AI Technical Summary
When running multiple applications on the same computer, existing technologies cannot accurately find and call the specific versions of system resources that each application depends on, resulting in abnormal operation or failure to start the application.
Create an independent application sandbox for each application, record the address information of the system resources it depends on, and search and call the target system resources through the resource information set in the sandbox.
Ensure that applications accurately call the required version of system resources, avoid version confusion, and improve application operation stability and computer resource utilization.
Smart Images

Figure CN116382795B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the field of computers, and more particularly, to a method and apparatus for calling system resources. Background Art
[0002] The operating systems of computers, such as local physical machines and virtual machines (VMs), control the execution of applications (also known as apps). These applications often rely on system resources such as the SDK (Software Development Kit) provided by the operating system. Multiple applications can typically run simultaneously on the same computer, and these applications may rely on different versions of the same system resource—that is, resources with the same name but different versions.
[0003] In related technologies, for a specific version of a system resource that any application depends on, when a computer searches for the resource according to the resource name of the system resource, it may find and call other versions of the system resource that other applications depend on, which may cause any of the applications to run abnormally or even fail to start. Summary of the Invention
[0004] In view of this, one or more embodiments of this specification provide a method for calling system resources.
[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:
[0006] According to a first aspect of one or more embodiments of this specification, a method for calling system resources is provided, including:
[0007] In response to a resource call request initiated by a first application for a target system resource, determining a first application sandbox corresponding to the first application; wherein different applications correspond to different application sandboxes, the resource information set contained in the application sandbox records address information of system resources that the corresponding application depends on, and the target system resource has multiple versions, and different versions of the target system resource are respectively depended on by different applications;
[0008] According to the resource name of the target system resource, the target address information corresponding to the resource name is searched in the first resource information set included in the first application sandbox, and the resource is called according to the target address information.
[0009] According to a second aspect of one or more embodiments of this specification, a system resource calling device is provided, including:
[0010] a sandbox determining unit, configured to determine, in response to a resource call request initiated by a first application for a target system resource, a first application sandbox corresponding to the first application; wherein different applications correspond to different application sandboxes, the resource information set included in the application sandbox records address information of system resources that the corresponding application depends on, and the target system resource has multiple versions, and different versions of the target system resource are respectively depended on by different applications;
[0011] The resource calling unit is configured to query the first resource information set included in the first application sandbox for target address information corresponding to the resource name of the target system resource according to the resource name of the target system resource, and perform resource calling according to the target address information.
[0012] According to a third aspect of one or more embodiments of this specification, an electronic device is provided, including:
[0013] processor;
[0014] a memory for storing processor-executable instructions;
[0015] The processor implements the method as described in any one of the first aspects by running the executable instructions.
[0016] According to a fourth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0017] In this solution, the computer's operating system creates a corresponding application sandbox for each application running on the computer. The resource information set contained in the application sandbox corresponding to any application records the address information of the system resources that the application depends on, thereby isolating the corresponding versions of the system resources required for the application to run in the application sandbox. Based on this, in response to a resource call request initiated by a first application for a target system resource (needed for its own operation), the operating system can first determine the first application sandbox corresponding to the first application, and then query the first resource information set contained in the sandbox for the corresponding target address information based on the resource name of the target system resource. This address is the call address of the target system resource required by the first application, so that the target system resource can be called according to this address.
[0018] It is understandable that the resource information set contained in the application sandbox corresponding to any application is used to record the address information of each specific version of the system resources required (i.e., relied upon) during the operation of the application. Therefore, the system resources represented by each address information recorded in the first resource information set are the specific version of the system resources that the first application relies on. Therefore, according to the resource name of the target system resource, the target system resource found in the set must be the specific version required by the first application, and not other versions of the system resources. Since the first application is any application among multiple applications running simultaneously in the computer, this solution can accurately find and call the corresponding version of the system resources that any application relies on, ensuring the smooth operation of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is a schematic diagram of the architecture of a cloud desktop system provided by an exemplary embodiment.
[0020] Figure 2 This is a schematic diagram of a method for calling system resources provided by an exemplary embodiment.
[0021] Figure 3 It is a schematic diagram of the internal structure of a computer provided by an exemplary embodiment.
[0022] Figure 4 It is a structural diagram of a device provided by an exemplary embodiment.
[0023] Figure 5 It is a block diagram of a system resource calling device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0024] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments are not intended to represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of one or more embodiments of this specification, as detailed in the appended claims.
[0025] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments, and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0026] As mentioned above, multiple applications can typically run simultaneously on the same computer, and these applications may rely on different versions of the same system resource—that is, they may rely on system resources with the same name but different versions. If an application needs to access a system resource during operation, it can initiate a request for that resource to the operating system, which then responds to the request and makes the resource call. The information related to the resources required for application operation can constitute a resource information set for the application, allowing the operating system to search for the resource required by the application within this set based on the resource information of any resource.
[0027] In related technologies, if multiple applications are running simultaneously in a computer, the resource information sets corresponding to these applications will be loaded into the operating system in sequence according to a fixed query order. The loaded resource information sets form a one-way data structure (such as a linked list, etc.) corresponding to the query order, so that the operating system can only query any system resource requested by any application in each resource information set according to the query order.
[0028] Since the loaded resource information set usually records each resource in the form of resource name and address information, for any application requesting a certain resource name and version of a system resource, when the operating system queries according to the resource name in the above query order, it will usually call the first resource with a matching name as the query result. However, the actual version of the resource may not be the version requested by the application, but another version that other applications depend on. That is, the query result is wrong, which may cause the application to run abnormally or even fail to start.
[0029] To address the aforementioned issues in related technologies, this specification proposes a method for accessing system resources. By setting up an application sandbox for each application, the system resources that each application relies on are pre-isolated. This allows the operating system to search for system resources that any application relies on, simply searching within the resources recorded in the application sandbox corresponding to that application, thus avoiding the situation where the incorrect version is retrieved. This method is described in detail below with reference to the accompanying figures.
[0030] The system resource calling methods described in the embodiments of this specification can be applied to a computer, specifically, to a computer operating system. The computer can be a local computer or a virtual machine. This disclosure does not limit the specific functions that can be implemented by the applications running on the computer. For example, the first application can be an office application, a shopping application, a payment application, an instant messaging application, a music application, etc., which will not be further described.
[0031] For example, if the computer is a local computer, the multiple applications running locally on the computer may be managed by the operating system of the local computer. A user of the local computer may interact with the computer through an input device connected to the computer to interact with the various applications running therein, so that the applications can provide corresponding preset functions to the user through output devices.
[0032] For another example, if the computer is a virtual machine, the multiple applications running in the virtual machine can be managed by the operating system of the virtual machine. The user of the virtual machine can interact with the computer through input devices connected to the hardware device where the virtual machine is located, or input devices connected to the network device to which the virtual machine is connected, to achieve interaction with the various applications running therein, so that these applications can provide corresponding preset functions to the user through corresponding output devices.
[0033] Taking virtual machines as an example, any virtual machine can run independently on a terminal device, or it can be clustered with other virtual machines on a server. For example, a server can run multiple virtual machines simultaneously, each controlled by its own operating system, allowing the server's hardware and software resources to be properly allocated to each virtual machine. One or more applications can be deployed and run on these computers, and the operating system can run in either user mode or kernel mode at any given time.
[0034] Figure 1 The following is a schematic diagram of the architecture of a cloud desktop system provided by an exemplary embodiment. The system may include a server 11, a storage device 12, and several electronic devices, such as mobile phones 13, 14, and 15. The application server 11 may be deployed with at least one virtual machine (not shown). Each virtual machine can function as an application server by running applications locally and provide corresponding application services to application clients.
[0035] Cloud desktop, also known as desktop virtualization, cloud computer, etc., is a computing model that replaces traditional local computers: users do not need to purchase a computer host, and the CPU, memory, hard disk and other components required for the host to run can be implemented and provided by the resources of the cloud desktop server through virtualization technology. Users can use any form of terminal device as a cloud desktop client, connect to the cloud desktop server through the network, and the two work together to form a complete computer in the cloud desktop scenario. When a cloud desktop instance is deployed in any virtual machine, based on the application running in the instance, the virtual machine can provide cloud desktop services for electronic devices such as mobile phones 13 to 15. In this scenario, any virtual machine is implemented as a cloud desktop server, and the mobile phone used by the user is equivalent to a cloud desktop client. It can be understood that the electronic device used as an application client may include hardware such as a control module, a communication module, a display, a keyboard, a mouse, etc., so that the user can interact with the application server through the above hardware.
[0036] For any application running in any virtual machine, the data required for its operation (programs, codes, etc.) or the data generated during the operation (intermediate data, data processing results, operation records, etc.) can be stored locally in the virtual machine or in the storage device 12. The virtual machine can use virtual hard disk (VHD) technology to mount the data stored in the storage device 12 locally as a VHD, so that remote read and write operations can be performed on the VHD data during the application operation, thereby eliminating the need to install the application locally in the virtual machine, simplifying the application maintenance operations of the virtual machine and saving the local storage space of the virtual machine.
[0037] In addition, any of the mobile phones 13 to 15 can be running a client program, thereby realizing the mobile phone as a cloud desktop client in the cloud desktop system. The cloud desktop client can essentially be an application program that can be pre-installed on the mobile phone so that the client can be started and run on the terminal device; of course, when using an online "client" such as HTML5 technology, there is no need to install the corresponding application program on the mobile phone to obtain and run the client. Accordingly, the cloud desktop instance running in the server 11 can serve as a server program, and any virtual machine can realize itself as a server in the cloud desktop system by running the program.
[0038] Any of the above-mentioned mobile phones can correspond to a corresponding user, such as any user can use his or her own user account to log in to the client running in the mobile phone 13. After the login is completed, the user can be regarded as the user corresponding to the mobile phone 13. Among them, the mobile phone 13 can interact with the server 11 during the login process to enable the user to log in to any virtual machine in the server 11. In addition, mobile phones 13 to 15 are just one type of electronic device that users can use. Users can also use electronic devices such as tablet devices, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), VR (Virtual Reality) devices, AR (Augmented Reality) devices, etc. By running the client program of the cloud desktop on these devices, these devices can be implemented as cloud desktop clients. Of course, to implement any of the above-mentioned electronic devices as a cloud desktop client, it may be necessary to install the client program in the device or access the client program in online form. In fact, users can also use cloud desktop dedicated devices, such as devices that can be pre-installed with a cloud desktop client. Users only need to connect the corresponding input / output devices to the device, and then they can use the cloud desktop client to access the applications running in the corresponding cloud desktop server by performing corresponding operations and enjoy the cloud desktop services provided by the device.
[0039] In addition, the server 11 may be a physical server including an independent host, or a virtual server hosted by a host cluster, a cloud server, etc. The storage device 12 may be in any form, such as a structured or unstructured database, or a network attached storage (NAS) device, and one or more embodiments of this specification are not limited thereto.
[0040] See Figure 2 , Figure 2 This is a flowchart of a method for calling a system resource provided by an exemplary embodiment. Figure 2 As shown, the method is applied to the operating system of a computer and includes the following steps 202-204.
[0041] Step 202: In response to a resource call request initiated by a first application for a target system resource, determine a first application sandbox corresponding to the first application; wherein different applications correspond to different application sandboxes, and the resource information set contained in the application sandbox records the address information of the system resources that the corresponding application depends on, and there are multiple versions of the target system resources, and different versions of the target system resources are respectively relied upon by different applications.
[0042] The operating system of the computer described in this solution can be Windows, or it can also be iOS, Linux, Unix, etc., and Windows is used as an example below. The first application can be any application running on the above-mentioned computer. The operation of this application requires system resources provided by the operating system, such as hardware resources such as memory and CPU, and / or software resources such as SDK and file management.
[0043] In addition, the application sandbox corresponding to any application described in this specification is a program, rule, or environment used to isolate / manage the permissions of the application's related data or resources. It can be used to record the various resources that the application depends on (i.e., the resources needed during the operation of the application). Specifically, the resource names of these resources and their address information in the computer can be recorded so that the operating system can subsequently query the address information of any resource based on its resource name and call the resource according to the queried address information.
[0044] In one embodiment, a first application sandbox corresponding to the first application can be pre-created, for example, when the first application is installed. The application can then be started and run in the application sandbox, and data generated during operation is also stored in the application sandbox, fully isolating the operation and data of the first application from other applications and preventing interference between the applications.
[0045] In another embodiment, the first application sandbox corresponding to the first application can also be temporarily created by the operating system when the first application is launched. For example, the operating system can create the first application sandbox for the first application in response to a launch instruction for the first application; then, the operating system executes the first application's executable file in the memory space corresponding to the first application sandbox to launch the application. The launch instruction can be initiated by the user of the first application. Upon receiving the launch instruction, the operating system can create the first application sandbox in the computer's memory space to accelerate data processing associated with the first application. The executable file is the main program used to launch the first application; that is, after the file is executed, it can launch the first application in the computer's memory space. The embodiments of this specification do not limit the format of the executable file. For example, the executable file can be a .exe file, a .sys file, a .com file, a .dll file, etc., which will not be further described. After the launch is complete, when the first application needs to access a target system resource, it can initiate a resource call request for the resource to the operating system, triggering the operating system to call the resource in response to the request.
[0046] Among them, the executable file of the first application belongs to the source file of the first application (used to record the main program, code and other basic data required for the operation of the application). The source file can be pre-stored in the NAS device. At this time, the operating system can mount the executable file locally in the form of VHD through virtual disk technology, and then add the VHD to the first application sandbox so that the file can be read later by remote access. When the first application sandbox is created, the operating system can record the address information of the source file in the application sandbox, and then read the executable file by remotely accessing the source file. Alternatively, the address information of the executable file can be determined from the source file first, and then the address information can be recorded in the first application sandbox, and then the executable file can be obtained from the address information of the NAS by remote access.
[0047] The address information of any resource described in this specification is used to indicate the access address of the resource, and the resource can be accessed (i.e., called) according to the address information. The address information can be an index corresponding to the storage address of the data, or it can also be a calling interface or parameter of software and hardware resources, etc. This specification does not limit its specific form. For example, for the SDK provided by the operating system, its address information can be the path specified by the operating system for the SDK (the SDK can be called through this path). Of course, the address information of the resource can also include a secondary address that can be jumped, or other indication information that can be used to access the resource, which will not be repeated one by one.
[0048] Of course, since the source files of the first application may be generated based on a preset index, the operating system can redirect the source files to ensure that they can run normally after being mounted. If the source files are generated based on the "C:\Program Files" folder, when the source files are mounted to any folder under any drive letter on the computer, the operating system can redirect the folder's address information to "C:\Program Files" to ensure that each file in the source file can be accessed and run normally according to the redirected index.
[0049] In this way, the operating system is allowed to mount the source files of the first application locally through virtual disk technology and then add them to the first application sandbox. It is understandable that the source files can be generated by the publisher or manager of the application through pre-execution. At this time, the operating system only needs to remotely access the above source files to start and run the first application, without the need to "install" the first application locally on the computer. This allows the first application to achieve the operating effect of a cloud application, greatly simplifying the user's deployment and maintenance workload for the first application; and helps save the local storage space of the computer, allowing the computer to run more applications simultaneously, thereby improving the overall resource utilization of the computer.
[0050] In another embodiment, a corresponding first application sandbox can also be created for the first application during its operation after the first application is launched. For example, the operation of the first application may involve resource calls and data operations. The operating system can examine each request issued by the application to identify sensitive requests. If the data processed by a request is sensitive data or the resource it requests is a sensitive resource, the request can be determined to be a sensitive request. The sensitive data can be resources occupied or potentially occupied by other applications, and the sensitive resources can be resources called or potentially called by other applications. In this case, the first application sandbox can be created directly for the first application, or a prompt instruction can be returned to the first application so that the first application displays a prompt information regarding the sensitive data and / or sensitive resources to the current user, who can then decide whether to create a first application sandbox for the first application. After the first application sandbox is created, relevant data generated during the first application's startup can be transferred to the sandbox, and the sandbox can then respond to the sensitive requests and complete the processing of sensitive data or the call of sensitive resources. In this way, a corresponding first application sandbox can be created for the first application when necessary, and not created when it is not needed. Although the response time of the first sensitive request is prolonged, the stricter application sandbox creation threshold can save more resources for the computer (because the creation and maintenance of the application sandbox also requires computing, storage and other resources). In particular, when the running process of the first application does not involve sensitive data or sensitive resources, the resource saving effect is more significant.
[0051] Continuing from the above embodiment, the method for calling system resources can be applied to a virtual machine deployed with a cloud desktop instance. In this case, the first application can run in the cloud desktop instance, and the first application can be published to the cloud application platform. It can be understood that the first application sandbox also belongs to the cloud desktop instance. In this scenario, the virtual machine is equivalent to the cloud desktop server, and the terminal device used by the user (which may include a control module, a communication module, a display, a keyboard, a mouse, etc.) constitutes a cloud desktop client. In this scenario, the virtual machine can provide the cloud desktop client with an application browsing page of the cloud application platform, which can include a display of the first application, such as the startup control, introduction content, detailed information, operation guide, user rating, etc. of the first application. In this regard, the user can perform a trigger operation on the above display of the first application, and the cloud desktop client can initiate the startup instruction for the first application in response to the trigger operation, so as to trigger the virtual machine to start the first application. In this way, the first application can be provided to the user in the form of a cloud application without actually installing the first application in the virtual machine, which not only helps to simplify the user's deployment and maintenance of the first application, but also helps to save the local storage space of the computer and improve the overall resource utilization of the computer.
[0052] In addition, given that multiple applications may be running simultaneously in a computer, and each application may have a corresponding application sandbox created, the operating system can also create (or set, allocate) a corresponding application sandbox identifier for each application sandbox, and maintain a first-type mapping relationship between the application identifier of each application and the application sandbox identifier of the corresponding application sandbox; or, when each application runs in a different process, a second-type mapping relationship between the process identifier (PID, Process ID) of each application process and the application sandbox identifier of the corresponding application sandbox can also be maintained to facilitate the subsequent determination of the first application sandbox.
[0053] Regardless of whether the first application sandbox is pre-created when the first application is installed or temporarily created when the first application is started, the first resource information set of the first application needs to be recorded in the created first application sandbox. The set contains the address information of each system resource that the first application depends on. Before the system resource is started (such as before executing the executable file), the operating system can obtain the resource name and version of each system resource that it depends on from the source file of the first application. Then, based on the resource name and version, the operating system can query the corresponding address information in its own resource storage space (such as the local storage space of the computer), and then associate the resource name and the corresponding address information and record it in the first resource information set. In this way, it can be ensured that the system resources represented by each address information recorded in the first resource information set are all system resources that the first application depends on. If any system resource has multiple versions (that is, there are multiple system resources with the same name but different versions) and any two versions are relied upon by different applications, the corresponding address information is also recorded in the application sandbox corresponding to each application, that is, the address information of any version of any system resource is recorded in the application sandbox corresponding to any system resource that depends on that version.
[0054] The first application started in the aforementioned manner can start running normally in the computer (such as the aforementioned virtual machine). Figure 2 As shown in the figure, three applications are running on the computer: APP1, APP2, and APP3. Each application has a corresponding application sandbox: APP1 corresponds to Appbox1, APP2 corresponds to Appbox2, and APP3 corresponds to Appbox3. Each application sandbox contains the source files (App Layer 1, App Layer 2, and App Layer 3) and resource information collections (Collection 1, Collection 2, and Collection 3) of the corresponding application. The source file can be mounted to the operating system through VHD technology and added to the application sandbox; the resource information collection records the system resources that the corresponding application depends on, such as Collection1 records SDK1 (v1.0) (the resource name is "SDK1", the version is 1.0, the same below), SDK2 (v1.0) and SDK3 (v1.0) that APP1 depends on; Collection2 records SDK2 (v2.0) and SDK2 (v1.0) that APP2 depends on; Collection3 records SDK1 (v3.0) and SDK2 (v3.0) that APP3 depends on. It should be noted that although Figure 2The corresponding version is marked for each SDK, but since the resource query process does not require the SDK version information, in order to minimize the data volume of the resource information set and save the available storage space of the application sandbox, the resource information may not record the version, but only record its resource name and address information.
[0055] Any of the aforementioned SDKs can be system resources or non-system resources. For example, for the SDKs that APP1 depends on: SDK1 (v1.0) and SDK2 (v1.0) can be system resources, while SDK3 (v1.0) can be a non-system resource. Any version of a system resource that an application depends on may have other applications depend on the corresponding version of that system resource. For example, for SDK1, APP1 depends on version 1.0, APP2 depends on version 2.0, and APP3 depends on version 3.0. Of course, any version of a system resource that an application depends on may also be depended on by other applications. For example, for SDK2, both APP1 and APP2 depend on version 1.0. However, it should be noted that, with respect to SDK2, neither APP1 nor APP2 can be considered the first application. Furthermore, any non-system resource that an application depends on is typically provided by the publisher or administrator of the application (not by the computer's operating system) and is exclusively used by that application. Therefore, such resources are only depended on by that application. For example, SDK3 only has version 1.0 and is only depended on by APP1. In fact, non-system resources may not be included in the application sandbox to minimize the permission management burden of the application sandbox; and system resources that are not occupied by multiple users may not be recorded in the corresponding application sandbox.
[0056] In addition, although Figure 3 The OS Layer in the figure is drawn separately, but it is only used to indicate that each application can share all the system resources provided by the computer (such as evenly sharing memory resources, occupying CPU resources according to load status, calling the required version of SDK according to the record of resource information set, etc.), and should not be understood as system resources existing independently of the application sandbox. In fact, for the corresponding versions of system resources that the three apps rely on: SDK1 and SDK2, both can be part of OSLayer.
[0057] During the execution of the first application, if a target system resource (which can be any resource that the application depends on) needs to be called, a resource call request for the resource can be initiated to the operating system. In response to the request, the operating system can first determine the first application sandbox corresponding to the first application.
[0058] As previously described, the operating system may maintain a first type of mapping relationship between an application's application identifier and the sandbox identifier of the application sandbox, or a second type of mapping relationship between the process identifier of the application's process and the sandbox identifier of the application sandbox. In one embodiment, the operating system may determine the first application sandbox in different ways depending on the mapping relationship maintained. For example, if the operating system maintains the first mapping relationship, the operating system may determine the sandbox identifier corresponding to the application identifier of the first application based on the mapping relationship, and determine the application sandbox represented by the sandbox identifier as the first application sandbox. For another example, if the operating system maintains the second mapping relationship, the operating system may determine the sandbox identifier corresponding to the first process identifier of the process of the first application based on the mapping relationship, and determine the application sandbox represented by the sandbox identifier as the first application sandbox. In this case, different applications run in different processes, which can minimize interference that may occur during the operation of different applications and improve the operational stability of each application. The application identifier of the first application or the first process identifier of the process of the first application can be determined by the first application itself and included in the resource call request it initiates, thereby improving the response speed of the operating system.
[0059] Step 204 : According to the resource name of the target system resource, query the target address information corresponding to the resource name in the first resource information set included in the first application sandbox, and call the resource according to the target address information.
[0060] As previously mentioned, the first resource information set records the resource names and address information of each system resource that the first application relies on. Therefore, after determining the resource name of the target system resource, the operating system can query the first resource information set contained in the first application sandbox for the target address information corresponding to that resource name, and then call the resource based on that information. It can be understood that calling a resource based on the target address information means calling the corresponding target system resource based on that information, that is, calling the target system resource pointed to by the target access address represented by the target address information.
[0061] In this solution, the computer's operating system creates a corresponding application sandbox for each application running on the computer. The resource information set contained in the application sandbox corresponding to any application records the address information of the system resources that the application depends on, thereby isolating the corresponding versions of the system resources required for the application to run in the application sandbox. Based on this, in response to a resource call request initiated by a first application for a target system resource (needed for its own operation), the operating system can first determine the first application sandbox corresponding to the first application, and then query the first resource information set contained in the sandbox for the corresponding target address information based on the resource name of the target system resource. This address is the call address of the target system resource required by the first application, so that the target system resource can be called according to this address.
[0062] It is understandable that the resource information set contained in the application sandbox corresponding to any application is used to record the address information of each specific version of the system resources required by (i.e., the system resources it relies on) during the operation of the application. Therefore, the system resources represented by each address information recorded in the first resource information set are the specific version of the system resources that the first application relies on. Therefore, according to the resource name of the target system resource, the target system resource found in the set must be the specific version required by the first application, and not other versions of the system resources. Since the first application is any application among multiple applications running simultaneously in the computer, this solution can accurately find and call the corresponding version of the system resources that any application relies on, ensuring the smooth operation of the application.
[0063] like Figure 3 As shown, let's assume that the first application is APP1 and the target system resource is SDK1 (v1.0). At this time, the operating system can determine that SDK1 is the target system resource (or the process identifier of the process where the target system resource is located) based on the resource name "SDK1" contained in the resource call request - but it does not know and does not need to know which version of SDK1 APP1 specifically requested. Then, the target address information corresponding to the name can be queried in Collection1 based on the resource name - the SDK pointed to by the address is the corresponding version of the SDK requested by APP1. In addition, there can be a fixed query order between the above three resource information sets (that is, the query order described in the relevant technology) - at this time, the changes to this solution based on the relevant technology are relatively small, which is conducive to the efficient promotion and efficient application of this solution; of course, the above query order may not exist.
[0064] In one embodiment, a variety of methods can be used to call the target system resources from the target address information. For example, the data to be processed specified by the resource call request can be obtained first, and then the data to be processed can be processed by the target system resources read from the target address information. Among them, the above-mentioned data to be processed can be local data of the computer, or data stored at the aforementioned storage device, or intermediate data or operation results provided by other applications, etc., which will not be repeated here. In this way, APP can call the target system resources to process the data to be processed specified by it. Of course, after the processing is completed, the processing results can also be provided to the corresponding demand party, such as returning to APP1 for display to the user; or submitting to the storage device to update the stored data to be updated; or submitting across the application sandbox to other applications that provide the data to be processed, as the call result of the other application to the first application, etc., which will not be repeated here.
[0065] At this point, the process of the first application calling the target system resource is introduced. As mentioned above, when the first application relies on non-system resources in addition to system resources, the first resource information set contained in the first application sandbox may also record the resource name and address information of the non-system resources, so these resources can also be called during the operation of the first application. For example, the operating system can receive a resource call request issued by the first application for any non-system resource; then, the address information of any non-system resource can be queried in the first resource information set, and resource calls can be made according to the address information, that is, calling any non-system resource pointed to by the access address represented by the address information. The specific process of querying and calling non-system resources is similar to the corresponding process of the aforementioned system resources and will not be repeated here.
[0066] Alternatively, each non-system resource (i.e., the resource itself) may also be directly recorded in the first resource information set. In this case, after receiving a resource call request from the first application for any non-system resource, the operating system may directly query the first resource information set for any non-system resource and call the non-system resource found. If any of the non-system resources is an SDK, and the executable code of the SDK is recorded in the first resource information set, the SDK may be directly searched for according to the resource identification information (such as resource identification, resource name and / or version, etc.) carried in the above resource call request, and the executable code of the SDK found may be copied to the memory space corresponding to the first application sandbox for execution, which will not be repeated. In the above manner, the first application can successfully call any non-system resource to ensure the normal operation of the first application.
[0067] In one embodiment, after the first application completes execution, the operating system may close the first application in response to a close instruction issued to the first application. The close instruction may be initiated by the first user, in which case the first application may be closed according to the user's will; or the close instruction may be initiated by the operating system according to a preset plan, in which case the application may be closed according to the preset plan. The specific closing process can be found in related art and will not be described in detail here.
[0068] In addition to closing the first application, the results of the first application's execution can also be stored on the aforementioned NAS device for reuse in subsequent executions of the first application. For example, during the first startup process, the local execution results can be read from the NAS device, allowing the user to view the previous execution results after relaunching the first application, facilitating the user's work in a timely manner and avoiding the inconvenience of data loss. Furthermore, the first application sandbox can be deleted after the first application is closed to reclaim the resources occupied by the first application, thereby improving resource utilization.
[0069] Figure 4 This is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 4 At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410. Of course, it may also include hardware required for other functions. One or more embodiments of this specification can be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0070] Please refer to Figure 5 In one software implementation, the system resource calling means may include:
[0071] A sandbox determination unit 501 is configured to determine, in response to a resource call request initiated by a first application for a target system resource, a first application sandbox corresponding to the first application; wherein different applications correspond to different application sandboxes, and the resource information set contained in the application sandbox records address information of system resources that the corresponding application depends on, and the target system resource has multiple versions, and different versions of the target system resource are respectively depended on by different applications;
[0072] The system resource calling unit 502 is configured to query the first resource information set included in the first application sandbox for target address information corresponding to the resource name of the target system resource according to the resource name of the target system resource, and perform resource calling according to the target address information.
[0073] Optionally, the sandbox determination unit 501 is specifically configured to:
[0074] Determine the sandbox identifier corresponding to the application identifier of the first application according to a first type of mapping relationship between the maintained application identifier and the sandbox identifier of the application sandbox, and determine the application sandbox represented by the sandbox identifier as the first application sandbox; or
[0075] When different applications run in different processes respectively, the sandbox identifier corresponding to the first process identifier of the process in which the maintained application is located is determined based on the second type of mapping relationship between the process identifier of the process in which the maintained application is located and the sandbox identifier of the application sandbox, and the application sandbox represented by the sandbox identifier is determined as the first application sandbox.
[0076] Optionally, the system resource calling unit 502 is specifically configured to:
[0077] Obtaining the data to be processed specified by the resource call request;
[0078] The data to be processed is processed by the target system resource read from the target address information.
[0079] Optionally, the method further includes:
[0080] a sandbox creating unit 503, configured to create the first application sandbox for the first application in response to a startup instruction for the first application;
[0081] The program starting unit 504 is configured to execute the executable file of the first application in the memory space corresponding to the first application sandbox to start the first application, wherein the resource call request is initiated by the first application after the startup is completed.
[0082] Optionally, the method is applied to a virtual machine deployed with a cloud desktop instance, the first application runs in the cloud desktop instance, and the first application is published to a cloud application platform, and the method further includes:
[0083] A page providing unit 505 is configured to provide the cloud desktop client with an application browsing page of the cloud application platform, wherein the application browsing page includes a display of the first application;
[0084] The start instruction is initiated by the cloud desktop client in response to a triggering operation for displaying the first application.
[0085] Optionally, also include:
[0086] a closing unit 506, configured to close the first application in response to a closing instruction for the first application;
[0087] a data storage unit 507 configured to store the operation results generated during the operation of the first application in a network attached storage device for reuse in subsequent operation processes of the first application; and / or
[0088] The sandbox deleting unit 508 is configured to delete the first application sandbox after the first application is closed.
[0089] Optionally, the first application further relies on non-system resources, and the method further includes:
[0090] a request receiving unit 509, configured to receive a resource call request issued by the first application for any non-system resource;
[0091] The address calling unit 510 is configured to query the address information of any non-system resource in the first resource information set and call the resource according to the address information; or
[0092] The non-system resource calling unit 511 is configured to query any non-system resource in the first resource information set and call any non-system resource found.
[0093] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email transceiver, game console, tablet computer, wearable device, or any combination of these devices.
[0094] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0095] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0096] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0097] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0098] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0099] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "an," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0100] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when..." or "when..." or "in response to determining."
[0101] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included in the scope of protection of one or more embodiments of this specification.
Claims
1. A method for calling system resources, comprising: In response to a resource call request initiated by a first application for a target system resource, determining a first application sandbox corresponding to the first application; wherein different applications correspond to different application sandboxes, the resource information set contained in the application sandbox records address information of system resources that the corresponding application depends on, and the target system resource has multiple versions, and different versions of the target system resource are respectively depended on by different applications; According to the resource name of the target system resource, query the first resource information set contained in the first application sandbox for target address information corresponding to the resource name, and perform resource call according to the target address information; The determining of the first application sandbox corresponding to the first application includes: Determine the sandbox identifier corresponding to the application identifier of the first application according to a first type of mapping relationship between the maintained application identifier and the sandbox identifier of the application sandbox, and determine the application sandbox represented by the sandbox identifier as the first application sandbox; or When different applications run in different processes respectively, the sandbox identifier corresponding to the first process identifier of the process in which the maintained application is located is determined based on the second type of mapping relationship between the process identifier of the process in which the maintained application is located and the sandbox identifier of the application sandbox, and the application sandbox represented by the sandbox identifier is determined as the first application sandbox.
2. The method according to claim 1, wherein calling resources according to the target address information comprises: Obtaining the data to be processed specified by the resource call request; The data to be processed is processed by the target system resource read from the target address information.
3. The method according to claim 1, further comprising: In response to a start instruction for the first application, creating the first application sandbox for the first application; The executable file of the first application is executed in the memory space corresponding to the first application sandbox to start the first application, wherein the resource call request is initiated by the first application after the startup is completed.
4. The method according to claim 3, wherein the method is applied to a virtual machine on which a cloud desktop instance is deployed, the first application is running in the cloud desktop instance, and the first application is published to a cloud application platform, the method further comprising: Providing a cloud desktop client with an application browsing page of the cloud application platform, wherein the application browsing page includes a display of the first application; The start instruction is initiated by the cloud desktop client in response to a triggering operation for displaying the first application.
5. The method according to claim 1, further comprising: In response to a closing instruction for the first application, closing the first application; storing the running results generated during the running of the first application in a network attached storage device for reuse in subsequent running processes of the first application; And / or, deleting the first application sandbox after the first application is closed.
6. The method according to claim 1, wherein the first application further relies on non-system resources, the method further comprising: receiving a resource call request issued by the first application for any non-system resource; querying the address information of any non-system resource in the first resource information set, and calling the resource according to the address information; or The first resource information set is searched for any non-system resource, and the searched non-system resource is called.
7. A system resource calling device, comprising: a sandbox determining unit, configured to determine, in response to a resource call request initiated by a first application for a target system resource, a first application sandbox corresponding to the first application; wherein different applications correspond to different application sandboxes, the resource information set included in the application sandbox records address information of system resources that the corresponding application depends on, and the target system resource has multiple versions, and different versions of the target system resource are respectively depended on by different applications; a resource calling unit, configured to query, according to the resource name of the target system resource, the target address information corresponding to the resource name in the first resource information set contained in the first application sandbox, and call the resource according to the target address information; The sandbox determination unit is configured to: Determine the sandbox identifier corresponding to the application identifier of the first application according to a first type of mapping relationship between the maintained application identifier and the sandbox identifier of the application sandbox, and determine the application sandbox represented by the sandbox identifier as the first application sandbox; or When different applications run in different processes respectively, the sandbox identifier corresponding to the first process identifier of the process in which the maintained application is located is determined based on the second type of mapping relationship between the process identifier of the process in which the maintained application is located and the sandbox identifier of the application sandbox, and the application sandbox represented by the sandbox identifier is determined as the first application sandbox.
8. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 6 by running the executable instructions.
9. A computer-readable storage medium having computer instructions stored thereon, wherein when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Resource based dynamic security authorization
CN101253487A
Application software cross-version compatible operation method, system and device and storage medium
CN114780950A