CN114443177A - Application running method and device, server and storage medium - Google Patents
Application running method and device, server and storage medium Download PDFInfo
- Publication number
- CN114443177A CN114443177A CN202011186489.8A CN202011186489A CN114443177A CN 114443177 A CN114443177 A CN 114443177A CN 202011186489 A CN202011186489 A CN 202011186489A CN 114443177 A CN114443177 A CN 114443177A
- Authority
- CN
- China
- Prior art keywords
- application
- terminal
- data
- application program
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4482—Procedural
- G06F9/4484—Executing subprograms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application provides an application running method, an application running device, a server and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: loading resource data and code data of an application program according to a parent process of the application program; responding to an application starting instruction of any terminal, and creating a child process of the application program according to the parent process, wherein the child process and the parent process share the resource data and the code data; and returning the running result of the application program to the terminal according to the subprocess. According to the technical scheme, the child process is established according to the parent process of the application program, the child process and the parent process share the loaded resource data and code data, so that the running result of the application program can be directly obtained without running the application program from the beginning, a user does not need to wait for resource loading, the man-machine interaction efficiency is improved, and the use experience of the user is improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to an application running method, an application running apparatus, a server, and a storage medium.
Background
With the development of computer technology, the size of an application program is larger and larger, for example, the size of a large game program reaches several GB (gigabytes), more than ten GB (gigabytes) or even larger, a large amount of storage resources of a terminal are occupied, and running such a large game program is a great test for the computing capability of the terminal, and a terminal with a medium-low configuration often does not have the above conditions. Therefore, an application running method that enables a user to play a large game program through a low-medium configured terminal is highly desirable.
At present, in order to realize playing of a large game program on a medium-low configured terminal upstream, the large game program is operated at a cloud end through a cloud technology, a user only needs to install a client with a small size on the terminal during playing, the terminal can obtain a video stream related to a game from the cloud end based on the client, and the playing of the large game program can be realized.
The technical scheme has the problems that before the terminal acquires the video stream related to the game from the cloud based on the client, the game server deployed at the cloud is required to load the game data from the disk for storing the game data after receiving the game starting instruction sent by the terminal, and for a large-scale game program, the recording time may reach the level of minutes, so that a user can play the game by waiting for several minutes, the man-machine interaction efficiency is low, and the game experience of the user is influenced.
Disclosure of Invention
The embodiment of the application running method and device, the server and the storage medium can directly obtain the running result of the application program without running the application program from the beginning, and a user does not need to wait for resource loading, so that the man-machine interaction efficiency is improved, and the use experience of the user is improved. The technical scheme is as follows:
in one aspect, an application running method is provided, and the method includes:
loading resource data and code data of an application program according to a parent process of the application program;
responding to an application starting instruction of any terminal, creating a child process of the application program according to the parent process, wherein the child process and the parent process share the resource data and the code data;
and returning the running result of the application program to the terminal according to the subprocess.
In another aspect, an application execution apparatus is provided, the apparatus including:
the data loading module is used for loading the resource data and the code data of the application program according to the parent process of the application program;
a child process creating module, configured to create, in response to an application start instruction of any terminal, a child process of the application program according to the parent process, where the child process and the parent process share the resource data and the code data;
and the running result returning module is used for returning the running result of the application program to the terminal according to the subprocess.
In an optional implementation manner, the child process creating module is configured to respond to an application start instruction of any terminal, and re-engrave the parent process to obtain a child process of the application program, where the child process and the parent process correspond to different virtual spaces and correspond to the same physical space.
In an optional implementation, the apparatus further includes:
and the state data modification module is used for responding to a user state modification instruction of the terminal, modifying the user state data of a target user account based on a copy-on-write mechanism and according to the sub-process, wherein the target user account is a user account logged in by the terminal.
In an optional implementation, the apparatus further includes:
and the address sending module is used for returning the network address of the content distribution server to the terminal, and the terminal acquires multimedia data from the content distribution server, wherein the multimedia data is used for displaying according to the user state of the user account logged in by the terminal.
In an optional implementation manner, the loading resource data and code data of the application program according to a parent process of the application program includes:
acquiring resource data and code data of the application program;
loading the resource data in the running process of the parent process so as to realize the synthesis of audio and video data;
and loading the code data in the running process of the parent process so as to realize the internal interaction of the application program.
In an optional implementation manner, the application is a game application deployed in a server in the cloud based on a cloud technology.
In an optional implementation manner, the sub-process creating module is configured to create a sandbox environment in response to an application start instruction of any terminal; and repeatedly carving the parent process in the sandbox environment to obtain the child process of the game application program.
In another aspect, a server is provided, where the server includes a processor and a memory, where the memory is used to store at least one segment of a computer program, and the at least one segment of the computer program is loaded by the processor and executed to implement the operations performed in the application execution method in the embodiment of the present application.
In another aspect, a computer-readable storage medium is provided, and at least one piece of computer program is stored in the computer-readable storage medium, and is loaded and executed by a processor to implement the operations performed in the application execution method in the embodiments of the present application.
In another aspect, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer program code, the computer program code being stored in a computer readable storage medium. The processor of the server reads the computer program code from the computer-readable storage medium, and executes the computer program code, so that the server executes the application execution method provided in the above-described aspects or various alternative implementations of the aspects.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
in the embodiment of the application, a child process is created according to a parent process of an application program, and the child process and the parent process share the loaded resource data and code data, so that the running result of the application program can be directly obtained without starting running the application program from the beginning, a user does not need to wait for resource loading, the human-computer interaction efficiency is improved, and the use experience of the user is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment of an application running method according to an embodiment of the present application;
FIG. 2 is a flowchart of an application running method according to an embodiment of the present application;
FIG. 3 is a flowchart of another application execution method provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of a copy-on-write mechanism according to an embodiment of the present application;
FIG. 5 is a flow chart of another application running method provided according to an embodiment of the application;
fig. 6 is a block diagram of an application execution apparatus according to an embodiment of the present application;
fig. 7 is a block diagram of a terminal according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a server provided according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, the following detailed description of the embodiments of the present application will be made with reference to the accompanying drawings.
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The following briefly describes possible techniques that may be used in embodiments of the present application.
Cloud technology refers to a hosting technology for unifying serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
Cloud technology (Cloud technology) is based on a general term of network technology, information technology, integration technology, management platform technology, application technology and the like applied in a Cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture-like websites and more web portals. With the high development and application of the internet industry, each article may have its own identification mark and needs to be transmitted to a background system for logic processing, data in different levels are processed separately, and various industrial data need strong system background support and can only be realized through cloud computing.
Cloud computing (Cloud computing) refers to a mode of delivery and use of IT (Internet Technology) infrastructure, and refers to obtaining required resources through a network in an on-demand, easily extensible manner; the generalized cloud computing refers to a delivery and use mode of a service, and refers to obtaining a required service in an on-demand and easily-extensible manner through a network. Such services may be IT and software, internet related, or other services. Cloud Computing is a product of development and fusion of traditional computers and Network Technologies, such as Grid Computing (Grid Computing), Distributed Computing (Distributed Computing), Parallel Computing (Parallel Computing), Utility Computing (Utility Computing), Network Storage (Network Storage Technologies), Virtualization (Virtualization), Load balancing (Load Balance), and the like.
With the development of diversification of internet, real-time data stream and connecting equipment and the promotion of demands of search service, social network, mobile commerce, open collaboration and the like, cloud computing is rapidly developed. Different from the prior parallel distributed computing, the generation of cloud computing can promote the revolutionary change of the whole internet mode and the enterprise management mode in concept.
Database (Database), which can be regarded as an electronic file cabinet in short, a place for storing electronic files, a user can add, query, update, delete, etc. to data in files. A "database" is a collection of data that is stored together in a manner that can be shared by multiple users, has as little redundancy as possible, and is independent of the application.
Cloud Gaming (Cloud Gaming) may also be called game On Demand (Gaming On Demand), which is an online game technology based On Cloud computing technology. Cloud gaming technology enables light-end devices (Thin clients) with relatively limited graphics processing and data computing capabilities to run high-quality games. In a cloud game scene, a game is not operated in a player game terminal but in a cloud server, and the cloud server renders the game scene into a video and audio stream which is transmitted to the player game terminal through a network. The player game terminal does not need to have strong graphic operation and data processing capacity, and only needs to have basic streaming media playing capacity and capacity of acquiring player input instructions and sending the instructions to the cloud server.
Copy-On-Write (COW) is an optimization strategy in the field of computer programming. The core idea is that if there are multiple callers (callers) requesting the same resource (e.g. memory or data store on disk) at the same time, they will get the same pointer to the same resource together, until a caller tries to modify the content of the resource, the system will not really copy a private copy (private copy) to the caller, but the original resource seen by other callers will remain unchanged.
The virtual address space corresponds to one virtual address space for each process, and for a 32-bit operating system (the maximum bit number of an instruction is 32 bits, so that the maximum bit number of an address code is 32 bits), the size of the virtual address space is B, namely 0-4 GB of virtual address space, wherein the kernel space is 1 GB.
A fork is a branching function in UNIX or UNIX-like, which divides a running program into 2 (almost) identical processes, each of which starts a thread that starts from the same location in the code. The threads in the two processes continue to execute as if two users started two copies of the application at the same time. fork is used to create a new process, called a child process, which runs concurrently with a process (called a system call fork process), called a parent process. After creating a new sub-process, both processes will execute the next instruction after fork (). The child process uses the same program counter, the same CPU register (Central Processing Unit), the same open file used in the parent process. fork () does not require a parameter but returns an integer value. The following are the different values returned by fork (). Negative values: creating the child process fails. Zero: returning to the newly created sub-process. Positive value: returning to the parent process or caller. This value contains the process ID (Identity Document) of the newly created child process.
ELF (Executable and Linkable Format), a Format file used for binary files, Executable files, object codes, shared libraries and core dump in computer science, is the main Executable file Format of Linux.
A sandbox (sandbox, also known as a sand table, sandbox) is a virtual system program that allows a browser or other program, such as a game program, to be run in the sandbox environment so that changes to the data generated by the run can be subsequently deleted. The method creates an independent operation environment similar to a sandbox, and programs running in the environment cannot permanently influence a hard disk. In network security, a sandbox refers to a tool used to test the behavior of untrusted files or applications, etc., in an isolated environment. In the embodiment of the application, the sandbox refers to providing game services for users of games in an isolated environment.
Hereinafter, an implementation environment of the application running method provided by the embodiment of the present application is described. Fig. 1 is a schematic diagram of an implementation environment of an application running method according to an embodiment of the present application. Referring to fig. 1, the implementation environment includes a terminal 101 and a server 102.
The terminal 101 and the server 102 can be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
Optionally, the terminal 101 is a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, or the like, but is not limited thereto. The terminal 101 installs and runs a client with an application. The application program may be any one of a First-Person Shooting Game (FPS), a third-Person Shooting Game, a Multiplayer Online Battle sports Game (MOBA), a Massively Multiplayer Online Role Playing Game (MMORPG), a military simulation program, or a Multiplayer gunfight type survival Game. Illustratively, the terminal 101 is a terminal used by a user, and a user account of the user is registered. The user uses the terminal 101 to operate virtual objects located in a virtual scene for activities including, but not limited to: adjusting at least one of body posture, crawling, walking, running, riding, jumping, driving, picking, shooting, attacking, throwing. Illustratively, the virtual object is a virtual character, such as a simulated character or an animated character.
Optionally, the server 102 is an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like. The server 102 is used for providing background services for the application programs supporting the virtual scenes. Optionally, the server 102 undertakes primary computational work and the terminal 101 undertakes secondary computational work; or, the server 102 undertakes the secondary computing work, and the terminal 101 undertakes the primary computing work; alternatively, the server 102 and the terminal 101 perform cooperative computing by using a distributed computing architecture.
Optionally, the virtual object controlled by the terminal 101 (hereinafter referred to as the controlled virtual object) and the virtual object controlled by the other terminal 101 (hereinafter referred to as the other virtual object) are in the same virtual scene, and at this time, the controlled virtual object can interact with the other virtual object in the virtual scene. In some embodiments, the controlled virtual object and the other virtual objects may be in a hostile relationship, for example, the controlled virtual object and the other virtual objects may belong to different teams and organizations, and the hostile virtual objects may interact antagonistically by releasing skills of each other.
Those skilled in the art will appreciate that the number of terminals described above may be greater or fewer. For example, the number of the terminals may be only one, or several tens or hundreds of the terminals, or more. The number of terminals and the type of the device are not limited in the embodiments of the present application.
Optionally, the wireless network or wired network described above uses standard communication techniques and/or protocols. The Network is typically the Internet, but can be any Network including, but not limited to, a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a mobile, wireline or wireless Network, a private Network, or any combination of virtual private networks. In some embodiments, data exchanged over a network is represented using techniques and/or formats including Hypertext Mark-up Language (HTML), Extensible Markup Language (XML), and the like. All or some of the links can also be encrypted using conventional encryption techniques such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec). In other embodiments, custom and/or dedicated data communication techniques can also be used in place of or in addition to the data communication techniques described above.
Fig. 2 is a flowchart of an application running method according to an embodiment of the present application, and as shown in fig. 2, a server applied to a cloud is taken as an example for description in the embodiment of the present application. The application running method comprises the following steps:
201. and the server loads the resource data and the code data of the application program according to the parent process of the application program.
In the embodiment of the application, the application is any application deployed on a cloud server based on a cloud technology, resource data, code data and user state data of the application are stored in a storage medium of the server, and the storage medium is one or more disks or a flash memory. For different user accounts, the corresponding resource data and code data are the same, and the user state data are different, so that the server can pre-load the resource data and the code data of the application program through the parent process of the application program, and the resident resource is realized.
202. And responding to an application starting instruction of any terminal, the server creates a child process of the application program according to the parent process, and the child process and the parent process share the resource data and the code data.
In the embodiment of the present application, the terminal is any terminal connected to the server 102, such as the terminal 101 shown in fig. 1. The method comprises the steps that a user can send an application starting instruction to a server by triggering a client of an application program installed on a terminal, when the server receives the application starting instruction, the parent process is repeatedly etched (fork), a child process sharing loaded resource data and code data with the parent process is obtained, the child process corresponds to the terminal and is used for providing services for the terminal, and therefore the terminal does not need to wait for the server to run the application program from the beginning, and the loaded resource data and the loaded code data can be used through the child process.
203. And the server returns the running result of the application program to the terminal according to the subprocess.
In the embodiment of the application, when the server runs the sub-process, the server can synthesize the resource data according to the code data to obtain the running result of the application program, and return the running result to the terminal corresponding to the sub-process.
In the embodiment of the application, a child process is created according to a parent process of an application program, and the child process and the parent process share the loaded resource data and code data, so that the running result of the application program can be directly obtained without starting running the application program from the beginning, a user does not need to wait for resource loading, the human-computer interaction efficiency is improved, and the use experience of the user is improved.
Fig. 2 is a main flow of an application running method provided in an embodiment of the present application. The following description is based on an application scenario. In the application scenario, the application is a large game deployed in a cloud, and the server is a server in the cloud, such as the server 102 shown in fig. 1, see fig. 3.
Fig. 3 is a flowchart of another application running method according to an embodiment of the present application, and as shown in fig. 3, in the embodiment of the present application, a server corresponding to a degree of application to a large game is taken as an example for description. The application running method comprises the following steps:
301. and the server loads the resource data and the code data of the application program according to the parent process of the application program.
In the embodiment of the application, the application is a large-scale game program deployed on a cloud server based on a cloud technology, and resource data, code data and user state data of the large-scale game program are stored in a storage medium of the server. The server firstly obtains the resource data and the code data of the application program, then loads the resource data in the running process of the parent process to realize the synthesis of audio and video data, and then loads the code data in the running process of the parent process to realize the internal interaction of the application program.
After the game program is compiled, the code data of the game is not changed, and the server loads the code data of the game to a read-only memory segment, namely the code data can only be read and cannot be modified. For example, the code data is in an ELF file format, an ELF file generally includes a code segment and a data segment, and an operating system marks a memory page corresponding to the code segment as read-only at a stage of loading the ELF file, thereby ensuring that the code data is not modified at will.
The resource data of the game is a raw material of audio/video data such as a synthetic picture or sound, such as video data, sound data, picture data, and various 3D (3-dimensional) model resources. The server allocates space for the resource data of the game in the heap memory of the process, and the game program only has read operation and no write operation on the resource data of the game.
The user state data corresponding to each user account are different, and the change of the user state data is different along with the game. The server isolates the user status data in such a way that a corresponding game subprocess is established for each user account, and each subprocess is allocated with an independent virtual address space, so as to implement mutual isolation, see step 302.
For example, for a large game with a volume of tens of GB, if the game is installed on a terminal, it needs to occupy a storage space of tens of GB, and this type of large game needs a large amount of data to be processed by the terminal in real time, which has a certain requirement on the computing power of the terminal. If only one client terminal of dozens of or hundreds of megabytes is installed on the terminal, and a game server of dozens of GB is deployed on the cloud game server, a user can play games through the terminal without occupying a large amount of storage space or higher computing capacity. The cloud game server can constantly run a parent process, and the parent process is loaded with code data and resource data required by running the game in advance to finish rendering of the game picture, so that a user can obtain the game picture after logging in through the game client.
Since the corresponding resource data and code data are the same for different user accounts and the corresponding user status data are different, the server can load the resource data and code data of the game program in advance from a storage medium such as a disk storing the resource data and code data of the game by the parent process of the application program, thereby realizing the resident resource.
302. And responding to an application starting instruction of any terminal, the server creates a child process of the application program according to the parent process, and the child process and the parent process share the resource data and the code data.
In the embodiment of the application, the client of the large game program is installed on the terminal used by the user, and the size of the client is small. The user logs in the user account of the user through the client, and then the terminal sends a game starting request to the server through the client, wherein the game starting request carries the terminal identification of the terminal, the account identification of the user account and an application starting instruction. The server analyzes the game starting request to obtain an application starting instruction, and then re-carves (fork) the parent process to obtain a child process of the application program. The child process and the parent process share the loaded resource data and code data, and the child process does not occupy much memory because the resource data and the code data do not need to be loaded again. In addition, the sub-process corresponds to the terminal for providing a service to the terminal. Because the resource data and the code data of the game program cannot be frequently changed, the corresponding child process is obtained by performing fork operation on the parent process, the resource data and the code data can be multiplexed among user accounts, the memory resource of the server is saved, the terminal can use the loaded resource data and the loaded code data through the child process without waiting for the server to run the application program from the beginning, and the time for the server to load the resource data and the code data is saved.
For example, for any user, when the user logs in a game through a game client, the cloud game server repeatedly carves a special child process for the user from a parent process, and the child process provides services for the user, so that the cloud game server does not need to run a game program for the user again, and the user does not need to wait for game loading and can directly obtain a game picture.
It should be noted that, in order to implement isolation between user accounts, in response to an application start instruction of any terminal, the server creates a sandbox environment, and then copies a parent process in the sandbox environment to obtain a child process of the game application. That is, the server goes out of the game child process according to the game parent process fork in the sandbox environment, and the resource data and the code data loaded by the game parent process and the game parent process exist outside the sandbox environment. In addition, as for the user state data, the user state data of the parent process also exists outside the sandbox environment, and when the user state changes, the server modifies the copy of the user state data in the sandbox environment based on the copy-on-write mechanism, see step 303.
303. And responding to the user state modification instruction of the terminal, and modifying the user state data of a target user account by the server based on a copy-on-write mechanism according to the sub-process, wherein the target user account is a user account logged in by the terminal.
In the embodiment of the application, a user can control a virtual object to move in a virtual scene through a client of a game program, correspondingly, the game state of a user account changes along with the user, and at this time, a terminal sends a user state modification request to a server through the client, wherein the user state modification request carries a terminal identifier, an account identifier of a target user account and a user state modification instruction. The server analyzes the user state modification request to obtain the child process corresponding to the terminal identification, then copies the copy of the user state data through a copy-on-write mechanism, modifies the copy of the user state data according to the user state modification instruction, and modifies the copy of the user state data without affecting the user state data corresponding to the parent process.
For example, a user issuing a game command through a client may cause a change in user state data, such as a change in the position of a virtual object, a change in the asset of a virtual object, a change in the rank of a virtual object, and a change in the appearance of a virtual object. At this time, the server assigns a value to a certain variable or copies data using a memcpy () function and the like, and based ON a COPY-ON-WRITE mechanism, after one memory page is marked as COPY-ON-WRITE, the server performs a WRITE operation ON the memory page of the type, at this time, the server applies for a new memory page (the size of the memory page is usually 4KB), then copies the original memory page to a new address, and performs the assignment or COPY operation, without affecting the data in the memory page before copying, so that isolation of user status data between user accounts can be achieved. Referring to fig. 4, fig. 4 is a schematic diagram of a copy-on-write mechanism according to an embodiment of the present disclosure. As shown in fig. 4, before the server modifies the user status data of the user account, the server obtains a child process from a parent process fork, and the resource data, code data and user status data of the parent process and the child process point to the same memory page. When the server modifies the user state data of the user account, the server copies the memory page C based on a copy-on-write mechanism to obtain a copy of the memory page C, and then modifies the copy of the memory page C in the sandbox environment. At this time, the resource data and the code data of the parent process and the child process still point to the same memory page, and the multiplexing of the resource data and the code data is realized.
304. And the server returns the running result of the application program to the terminal according to the subprocess.
In the embodiment of the application, when the server runs the sub-process, the resource data can be synthesized according to the code data to obtain the running result of the application program, and the running result is returned to the terminal corresponding to the sub-process, for example, the rendered real-time game picture is returned to the terminal and displayed by the terminal.
For example, the server transmits the rendered game screen to the terminal, and the game screen is displayed by the terminal.
It should be noted that, for a user account, the server may be only a sub-process for the user account fork, and after the server obtains a copy of the user state data, the server modifies the user state data in the copy of the user state data according to the user state modification instruction every time, instead of re-copying a copy of the user state data every time. In addition, when the user exits the game, the server will reclaim the game subprocess.
It should be noted that the large-scale game program further includes multimedia data such as CG (computer graphics) animation, and the volume of the CG animation is often large, so that loading the CG animation may cause the user to wait, which affects the game experience of the user. Optionally, the server stores the CG animation in each content delivery server (CDN server) based on a CDN technique, returns a network address of the content delivery server to the terminal in advance according to a game process of the user, obtains multimedia data such as the CG animation from the content delivery server by the terminal, and then displays the CG animation in response according to a user state of the user account.
It should be noted that, in order to make the application running method illustrated in the above step 301 to step 304 easier to understand, referring to fig. 5, fig. 5 is a flowchart of another application running method provided according to an embodiment of the present application. As shown in fig. 5, the server is a cloud game server deployed in the cloud. Resource data, code data, and user status data of the game are stored in a disk for storing game data. The cloud game server loads code data, resource data and user state data of a game into a memory of the cloud game server in advance through a game parent process (also called a parent process), wherein the code data can be called code memory data, the resource data can be called resource memory data, and the user state data can be called user state memory data. Then, when a new user starts a game, the cloud game server obtains a game child process from the parent process fork in the sandbox environment, and the game child process reuses the resource memory data and the user state memory data. Then, when the user state changes, the cloud game server copies the copy of the memory data in the user state in the sandbox environment based on a copy-on-write mechanism, and modifies the copy.
In the embodiment of the application, a child process is created according to a parent process of an application program, and the child process and the parent process share the loaded resource data and code data, so that the running result of the application program can be directly obtained without starting running the application program from the beginning, a user does not need to wait for resource loading, the human-computer interaction efficiency is improved, and the use experience of the user is improved.
Fig. 6 is a block diagram of an application execution device according to an embodiment of the present application. The apparatus is used for executing the steps executed by the application running method, and referring to fig. 6, the apparatus includes: a data loading module 601, a sub-process creating module 602 and a running result returning module 603.
The data loading module 601 is configured to load resource data and code data of an application program according to a parent process of the application program;
a child process creating module 602, configured to create, in response to an application start instruction of any terminal, a child process of the application program according to the parent process, where the child process and the parent process share the resource data and the code data;
and an operation result returning module 603, configured to return the operation result of the application program to the terminal according to the sub-process.
In an optional implementation manner, the child process creating module 602 is configured to respond to an application start instruction of any terminal, and re-engrave the parent process to obtain a child process of the application program, where the child process and the parent process correspond to different virtual spaces and correspond to the same physical space.
In an optional implementation, the apparatus further includes:
and a status data modification module 604, configured to modify, in response to the user status modification instruction of the terminal, user status data of a target user account according to the sub-process based on a copy-on-write mechanism, where the target user account is a user account logged in by the terminal.
In an optional implementation, the apparatus further includes:
an address sending module 605, configured to return a network address of the content distribution server to the terminal, and obtain, by the terminal, multimedia data from the content distribution server, where the multimedia data is used for displaying according to a user state of a user account logged in by the terminal.
In an alternative implementation, the loading the resource data and the code data of the application according to the parent process of the application includes:
acquiring resource data and code data of the application program;
loading the resource data in the running process of the parent process to realize the synthesis of audio and video data;
and loading the code data during the running process of the parent process so as to realize internal interaction of the application program.
In an optional implementation manner, the application is a game application deployed in a server in the cloud based on a cloud technology.
In an alternative implementation manner, the sub-process creating module 602 is configured to create a sandbox environment in response to an application start instruction of any terminal; and repeating the father process in the sandbox environment to obtain the child process of the game application program.
In the embodiment of the application, a child process is created according to a parent process of an application program, and the child process and the parent process share the loaded resource data and code data, so that the running result of the application program can be directly obtained without starting running the application program from the beginning, a user does not need to wait for resource loading, the human-computer interaction efficiency is improved, and the use experience of the user is improved.
It should be noted that: in practical applications, the above functions may be distributed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the application running device and the application running method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 7 is a block diagram of a terminal 700 according to an embodiment of the present application. The terminal 700 may be a portable mobile terminal such as: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. Terminal 700 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, and so on.
In general, the terminal 700 includes: a processor 701 and a memory 702.
The processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 701 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 701 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 701 may be integrated with a GPU (Graphics Processing Unit) which is responsible for rendering and drawing the content required to be displayed by the display screen. In some embodiments, the processor 701 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
In some embodiments, the terminal 700 may further optionally include: a peripheral interface 703 and at least one peripheral. The processor 701, the memory 702, and the peripheral interface 703 may be connected by buses or signal lines. Various peripheral devices may be connected to the peripheral interface 703 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 704, a display screen 705, a camera assembly 706, an audio circuit 707, a positioning component 708, and a power source 709.
The peripheral interface 703 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 701 and the memory 702. In some embodiments, processor 701, memory 702, and peripheral interface 703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 701, the memory 702, and the peripheral interface 703 may be implemented on separate chips or circuit boards, which is not limited by the present embodiment.
The Radio Frequency circuit 704 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 704 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 704 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 704 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 704 may also include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 705 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 705 is a touch display screen, the display screen 705 also has the ability to capture touch signals on or over the surface of the display screen 705. The touch signal may be input to the processor 701 as a control signal for processing. At this point, the display 705 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 705 may be one, disposed on a front panel of the terminal 700; in other embodiments, the display 705 can be at least two, respectively disposed on different surfaces of the terminal 700 or in a folded design; in other embodiments, the display 705 may be a flexible display disposed on a curved surface or on a folded surface of the terminal 700. Even more, the display 705 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The Display 705 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or the like.
The camera assembly 706 is used to capture images or video. Optionally, camera assembly 706 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 706 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp and can be used for light compensation under different color temperatures.
The audio circuitry 707 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 701 for processing or inputting the electric signals to the radio frequency circuit 704 to realize voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the terminal 700. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 701 or the radio frequency circuit 704 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, the audio circuitry 707 may also include a headphone jack.
The positioning component 708 is used to locate the current geographic Location of the terminal 700 for navigation or LBS (Location Based Service). The Positioning component 708 can be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
In some embodiments, terminal 700 also includes one or more sensors 710. The one or more sensors 710 include, but are not limited to: acceleration sensor 711, gyro sensor 712, pressure sensor 713, fingerprint sensor 714, optical sensor 715, and proximity sensor 716.
The acceleration sensor 711 can detect the magnitude of acceleration in three coordinate axes of a coordinate system established with the terminal 700. For example, the acceleration sensor 711 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 701 may control the display screen 705 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 711. The acceleration sensor 711 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 712 may detect a body direction and a rotation angle of the terminal 700, and the gyro sensor 712 may cooperate with the acceleration sensor 711 to acquire a 3D motion of the terminal 700 by the user. From the data collected by the gyro sensor 712, the processor 701 may implement the following functions: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
Pressure sensors 713 may be disposed on a side frame of terminal 700 and/or underneath display 705. When the pressure sensor 713 is disposed on a side frame of the terminal 700, a user's grip signal on the terminal 700 may be detected, and the processor 701 performs right-left hand recognition or shortcut operation according to the grip signal collected by the pressure sensor 713. When the pressure sensor 713 is disposed at a lower layer of the display screen 705, the processor 701 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 705. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 714 is used for collecting a fingerprint of a user, and the processor 701 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 714, or the fingerprint sensor 714 identifies the identity of the user according to the collected fingerprint. When the user identity is identified as a trusted identity, the processor 701 authorizes the user to perform relevant sensitive operations, including unlocking a screen, viewing encrypted information, downloading software, paying, changing settings, and the like. The fingerprint sensor 714 may be disposed on the front, back, or side of the terminal 700. When a physical button or a vendor Logo is provided on the terminal 700, the fingerprint sensor 714 may be integrated with the physical button or the vendor Logo.
The optical sensor 715 is used to collect the ambient light intensity. In one embodiment, the processor 701 may control the display brightness of the display screen 705 based on the ambient light intensity collected by the optical sensor 715. Specifically, when the ambient light intensity is high, the display brightness of the display screen 705 is increased; when the ambient light intensity is low, the display brightness of the display screen 705 is adjusted down. In another embodiment, processor 701 may also dynamically adjust the shooting parameters of camera assembly 706 based on the ambient light intensity collected by optical sensor 715.
A proximity sensor 716, also referred to as a distance sensor, is typically disposed on a front panel of the terminal 700. The proximity sensor 716 is used to collect the distance between the user and the front surface of the terminal 700. In one embodiment, when the proximity sensor 716 detects that the distance between the user and the front surface of the terminal 700 gradually decreases, the processor 701 controls the display 705 to switch from the bright screen state to the dark screen state; when the proximity sensor 716 detects that the distance between the user and the front surface of the terminal 700 is gradually increased, the processor 701 controls the display 705 to switch from the breath-screen state to the bright-screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 7 is not intended to be limiting of terminal 700 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
Fig. 8 is a schematic structural diagram of a server according to an embodiment of the present application, where the server 800 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 801 and one or more memories 802, where the memory 802 stores at least one computer program, and the at least one computer program is loaded and executed by the processors 801 to implement the application running method provided by the method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
The embodiment of the present application further provides a computer-readable storage medium, which is applied to a server, and at least one computer program is stored in the computer-readable storage medium, and is loaded and executed by a processor to implement the operations performed by the server in the application running method of the foregoing embodiment.
Embodiments of the present application also provide a computer program product or a computer program comprising computer program code stored in a computer readable storage medium. The processor of the server reads the computer program code from the computer readable storage medium, and the processor executes the computer program code, so that the server executes the application execution method provided in the above-described various alternative implementations.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (10)
1. An application running method, characterized in that the method comprises:
loading resource data and code data of an application program according to a parent process of the application program;
responding to an application starting instruction of any terminal, and creating a child process of the application program according to the parent process, wherein the child process and the parent process share the resource data and the code data;
and returning the running result of the application program to the terminal according to the subprocess.
2. The method according to claim 1, wherein the creating a child process of the application program according to the parent process in response to an application start instruction of any terminal comprises:
responding to an application starting instruction of any terminal, and repeatedly carving the parent process to obtain a child process of the application program, wherein the child process and the parent process correspond to different virtual spaces and the same physical space.
3. The method according to claim 1, wherein before returning the running result of the application program to the terminal according to the sub-process, the method further comprises:
and responding to the user state modification instruction of the terminal, and modifying the user state data of a target user account based on a copy-on-write mechanism according to the sub-process, wherein the target user account is a user account logged in by the terminal.
4. The method according to claim 1, wherein before returning the running result of the application program to the terminal according to the sub-process, the method further comprises:
and returning the network address of the content distribution server to the terminal, and acquiring multimedia data from the content distribution server by the terminal, wherein the multimedia data is used for displaying according to the user state of the user account logged in by the terminal.
5. The method of claim 1, wherein loading the resource data and the code data of the application according to the parent process of the application comprises:
acquiring resource data and code data of the application program;
loading the resource data in the running process of the parent process so as to realize the synthesis of audio and video data;
and loading the code data in the running process of the parent process so as to realize the internal interaction of the application program.
6. The method of claim 1, wherein the application is a game application deployed in a server in a cloud based on cloud technology.
7. The method according to claim 6, wherein the creating a child process of the application program according to the parent process in response to an application start instruction of any terminal comprises:
responding to an application starting instruction of any terminal, and creating a sandbox environment;
and repeatedly carving the parent process in the sandbox environment to obtain the child process of the game application program.
8. An application execution apparatus, comprising:
the data loading module is used for loading the resource data and the code data of the application program according to the parent process of the application program;
a child process creating module, configured to create, in response to an application start instruction of any terminal, a child process of the application program according to the parent process, where the child process and the parent process share the resource data and the code data;
and the running result returning module is used for returning the running result of the application program to the terminal according to the subprocess.
9. A server, characterized in that the server comprises a processor and a memory, the memory being used to store at least one piece of computer program, which is loaded by the processor and executes the application execution method according to any one of claims 1 to 7.
10. A storage medium for storing at least one computer program for executing the application execution method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011186489.8A CN114443177A (en) | 2020-10-30 | 2020-10-30 | Application running method and device, server and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011186489.8A CN114443177A (en) | 2020-10-30 | 2020-10-30 | Application running method and device, server and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114443177A true CN114443177A (en) | 2022-05-06 |
Family
ID=81358067
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011186489.8A Pending CN114443177A (en) | 2020-10-30 | 2020-10-30 | Application running method and device, server and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114443177A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024021524A1 (en) * | 2022-07-28 | 2024-02-01 | 深圳云天励飞技术股份有限公司 | Data processing method and apparatus, and electronic device and storage medium |
-
2020
- 2020-10-30 CN CN202011186489.8A patent/CN114443177A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024021524A1 (en) * | 2022-07-28 | 2024-02-01 | 深圳云天励飞技术股份有限公司 | Data processing method and apparatus, and electronic device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110585699B (en) | Control method, device and equipment of cloud game and storage medium | |
CN110674022B (en) | Behavior data acquisition method and device and storage medium | |
CN110841285B (en) | Interface element display method and device, computer equipment and storage medium | |
WO2020253655A1 (en) | Method for controlling multiple virtual characters, device, apparatus, and storage medium | |
CN108694073B (en) | Control method, device and equipment of virtual scene and storage medium | |
US11954200B2 (en) | Control information processing method and apparatus, electronic device, and storage medium | |
WO2021244267A1 (en) | Application program transplantation method and apparatus, device, and medium | |
CN108717365B (en) | Method and device for executing function in application program | |
CN110032384B (en) | Resource updating method, device, equipment and storage medium | |
CN111026318A (en) | Animation playing method, device and equipment based on virtual environment and storage medium | |
CN113867848A (en) | Method, device and equipment for calling graphic interface and readable storage medium | |
CN113051015A (en) | Page rendering method and device, electronic equipment and storage medium | |
CN112257006A (en) | Page information configuration method, device, equipment and computer readable storage medium | |
CN110889060A (en) | Webpage display method and device, computer equipment and storage medium | |
CN111125602A (en) | Page construction method, device, equipment and storage medium | |
CN112148499A (en) | Data reporting method and device, computer equipment and medium | |
CN110569064B (en) | Interface identifier generation method, device, equipment and storage medium | |
CN114443177A (en) | Application running method and device, server and storage medium | |
CN112023403A (en) | Battle process display method and device based on image-text information | |
CN110737454A (en) | Software project updating method and device, computer equipment and storage medium | |
CN112188268B (en) | Virtual scene display method, virtual scene introduction video generation method and device | |
CN113766043B (en) | Method, device, computer equipment and storage medium for configuring target container | |
CN114140105A (en) | Resource transfer method, device, equipment and computer readable storage medium | |
CN113641443A (en) | Interface element display method, device, equipment and readable storage medium | |
CN109618018B (en) | User head portrait display method, device, terminal, server and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |