Cloud mobile phone process control method, computer device and storage medium
Technical Field
The invention relates to the technical field of cloud mobile phones, in particular to a cloud mobile phone process control method, a computer device and a storage medium.
Background
The cloud mobile phone service provider provides cloud mobile phone services for users, the users use the clients to access the service terminals of the cloud mobile phone service provider, the service terminals run cloud mobile phone processes, and the cloud mobile phone processes execute tasks of receiving instructions and data sent by the clients, processing the data, generating pictures, feeding back the data to the clients and the like. Hardware and software resources of the server are limited, and a user occupies a plurality of cloud mobile phone processes, so that users who can be served by a cloud mobile phone service provider are limited. However, in reality, the user client occupies the cloud mobile phone process, but the user does not actually operate the client, does not run an application program that needs to be hung up, and the like, so that the user does not actually enjoy the service provided by the cloud mobile phone service provider, but occupies the resource of the service end of the cloud mobile phone service provider. For example, some users use the cloud mobile phone service to run the online game application program for online game on-hook, the online game executes scripts such as automatic odd-shaped upgrade, the users do not actually watch and operate the client, and in the case of online game disconnection or top number, the online game application program will log out but still run, and at this time, the online game on-hook is terminated and the online game application program still occupies the cloud mobile phone process. The cloud handset process that meets the above conditions does not actually provide service to the user, i.e., is in an idle state. From the perspective of management, a cloud mobile phone service provider should close an idle process to release resources, and then can provide the released resources for other user services, but from the perspective of technology, because a cloud mobile phone process and an application program run by the cloud mobile phone process are usually encrypted, it is difficult in the prior art to determine whether the cloud mobile phone process is in an idle state by detecting a running state of the cloud mobile phone process and the application program run by the cloud mobile phone process.
Disclosure of Invention
In view of at least one of the above technical problems, an object of the present invention is to provide a cloud mobile phone process control method, a computer apparatus, and a storage medium.
In one aspect, an embodiment of the present invention includes a method for controlling a cloud mobile phone process, including:
acquiring a first picture and a second picture; the first picture is a picture corresponding to the cloud mobile phone process at a first moment, and the second picture is a picture corresponding to the cloud mobile phone process at a second moment;
carrying out difference comparison on the second picture and the first picture;
and when the difference between the second picture and the first picture is lower than a preset standard, determining the cloud mobile phone process as an idle process.
Further, the cloud mobile phone process control method further comprises at least one of the following steps:
sending prompt information to a client using the idle process;
changing the use right of the idle process;
backing up data generated by the idle process off the idle process.
Further, the cloud mobile phone process control method further comprises the following steps:
the time difference between the first time and the second time is a preset fixed value.
Further, the cloud mobile phone process control method further comprises the following steps:
and determining the time difference between the first time and the second time according to the application program operated by the cloud mobile phone process.
Further, the step of determining a time difference between the first time and the second time according to the application program run by the cloud mobile phone process specifically includes:
determining that the cloud mobile phone process runs a first application program at the first moment;
if the cloud mobile phone process keeps running the first application program within a first time period after the first time, determining the first time period as a time difference between the first time and a second time; the first time period corresponds to the first application program;
if the cloud mobile phone process is switched from running the first application program to running a second application program within a first time period after the first time, overlapping part or all of the second time period in the first time period, and determining an overlapping result as a time difference between the first time and the second time; the second time period corresponds to the second application.
Further, the step of superimposing a part or all of the second time period on the first time period specifically includes:
determining the proportion of the time difference between the first time and the time when the second application program starts to run in the first time period;
taking the product of the second time period and the ratio as an overlap value;
superimposing the superimposed value over the first time period.
Further, the step of acquiring the first picture and the second picture specifically includes:
the method comprises the steps that screen capture is conducted on an operation interface of the cloud mobile phone process at a first moment, so that a first picture is obtained;
and capturing a screen of the running interface of the cloud mobile phone process at a second moment so as to obtain a second picture.
Further, the step of performing difference comparison between the second picture and the first picture specifically includes:
determining a dynamic area of a picture corresponding to the cloud mobile phone process according to an application program operated by the cloud mobile phone process; the dynamic area is an area which changes along with the running of the application program in the picture;
acquiring a first pixel parameter from the dynamic region in the first picture;
acquiring a second pixel parameter from the dynamic region in the second picture;
determining a difference value between the second pixel parameter and the first pixel parameter.
In another aspect, an embodiment of the present invention further includes a computer apparatus, including a memory and a processor, where the memory is used to store at least one program, and the processor is used to load the at least one program to execute the cloud mobile phone process control method.
In another aspect, embodiments of the present invention also include a storage medium having stored therein processor-executable instructions, which when executed by a processor, are configured to perform a cloud phone process control method.
The invention has the beneficial effects that: according to the cloud mobile phone process control method in the embodiment, whether the cloud mobile phone process is in an idle state can be judged by obtaining two pictures, the idle process can be conveniently processed subsequently, bottom data generated by the cloud mobile phone process does not need to be identified or accessed in the execution process, the method can be technically and conveniently realized, the data processing amount is small, and the conditions that a cloud mobile phone service provider runs the cloud mobile phone process in a large scale and the like can be effectively met.
Drawings
Fig. 1 is a schematic diagram of a hardware architecture used in an embodiment to implement a cloud mobile phone process control method;
fig. 2 is a flowchart of a cloud mobile phone process control method in an embodiment.
Detailed Description
In the embodiment of the invention, the used hardware architecture is shown in fig. 1 and comprises a server and a client, wherein the server is owned by a cloud mobile phone service provider and performs operation management, the client is held by a user, and the server and the client are connected through the internet.
The server side runs a cloud mobile phone process, wherein the cloud mobile phone process comprises a program for realizing basic functions of the cloud mobile phone, such as a cloud mobile phone operating system, and an application program for realizing specific functions of photography, multimedia editing or games. And the server runs the cloud mobile phone process to generate a picture and sends the picture to the client for display. In the embodiment of the invention, the server executes the cloud mobile phone process control method.
Example 1
Referring to fig. 2, the method for controlling the cloud mobile phone process in the embodiment includes the following steps:
s1, acquiring a first picture and a second picture; in this embodiment, the first picture is a picture generated by the cloud mobile phone process when running the self program or the application program at the first time, and the first picture is a picture generated by the cloud mobile phone process when running the self program or the application program at the first time;
s2, carrying out difference comparison on the second picture and the first picture;
and S3, when the difference between the second picture and the first picture is lower than a preset standard, determining the cloud mobile phone process as an idle process.
In step S1, the server end is at a first time t1The method comprises the steps of capturing a screen of an operation interface of the cloud mobile phone process to obtain a first picture, wherein the first picture shows that the cloud mobile phone process is at a first moment t1Interface content generated by itself and/or by the application program running on it; at a second time t2The operation interface of the cloud mobile phone process is subjected to screen capture, a second picture can be obtained, and the second picture shows that the cloud mobile phone process is at a second moment t2The interface content generated by itself and/or by the application program it is running.
In the present embodiment, the second time t is the first time t in the process of executing the steps S1-S3 once2At a first time t1Thereafter, they are separated by a time difference Δ t, i.e., t2=t1+ Δ t, i.e. the second picture is acquired after the first picture has been acquired by a time difference Δ t. In this embodiment, the time difference Δ t may be a fixed value, that is, whichever specific time is set as the first time t1At a first time t1And the time difference delta t is kept as a preset value according to the running condition of the cloud mobile phone process.
In some embodiments, after the steps S1-S3 are executed once, the next steps S1-S3 can be executed continuously, so that the second time t in the current steps S1-S32At the first time t in the next steps S1-S31Before this, the second time t in this step S1-S3 may be2At the first time t in the next steps S1-S31The time difference therebetween is also determined as Δt, as such, in the case where the steps S1-S3 are performed a plurality of times, the first timing t is formed1A second time t2First time t1A second time t2… …, the time difference between adjacent moments is Δ t, that is, the server captures the cloud mobile phone process regularly to acquire the first picture and the second picture.
By setting the first time t1And a second time t2The time difference between the first and second images is set as a fixed value, so that the server can automatically acquire the first and second images at fixed time.
In some embodiments, the time difference Δ t may be indeterminate, and the time difference between the first time and the second time is determined according to an application program run by the cloud handset process. In this case, the server performs the steps S1-S3 at different times, the first time t1The corresponding specific time is different, the application programs operated by the cloud mobile phone process may be different, the determined time difference delta t is different, and accordingly the time difference delta t is different according to t2=t1Second time t determined by + Δ t2And is different.
In the present embodiment, when the steps S1-S3 are performed once, the first time t1After the first picture is obtained by capturing the image of the cloud mobile phone process, the application program operated by the cloud mobile phone process is detected. In this embodiment, the cloud mobile phone process is performed at the first time t1The running application is called a first application, and when a plurality of applications are simultaneously run by the cloud mobile phone process, one application can be preferentially selected as the first application according to the importance or the use frequency of the applications.
At a first time t1A first time period deltaT thereafter1In the method, the server side continuously detects the application program operated by the cloud mobile phone process, and if the application program is operated in the whole first time period delta T1The inner cloud mobile phone process keeps running the first application program, and then the first time period delta T is set1Is determined as a first time t1And a second time t2The time difference between them, i.e. t2=t1+ΔT1. This implementationIn an example, the first period Δ T1Is determined according to the first application, i.e. a different application is used as the first application, which corresponds to the first time period deltat1The specific values of (c) may vary.
If at a first time period Δ T1At a certain moment, the cloud mobile phone process exits the first application program and switches to operate the second application program, and then a second time period delta T determined according to the second application program is obtained2Then according to a second time period Δ T2For a first time period DeltaT1And (6) adjusting. In this embodiment, a scaling factor λ (0 < λ ≦ 1) is used to multiply the second time period Δ T2Then the result is superimposed to the first time period DeltaT1As a first time t1And a second time t2The time difference between them, i.e. t2=t1+ΔT1+λΔT2。
In this embodiment, the determination method of the proportionality coefficient λ is as follows: determining the moment t when the cloud mobile phone process exits the first application program and switches to operate the second application program
xTo thereby determine the time t from the first time t
1To t
xTime difference t of
x-t
1Calculating the time difference t
x-t
1Occupying a first time period DeltaT
1As a scaling factor λ, i.e.
By setting the first time t1And a second time t2The time difference between the cloud mobile phone process and the cloud mobile phone process is set to be at the first time t1The running application programs are related, and different application programs can be effectively adapted. For example, for an application program with infrequent screen changes, such as office software, the first time t may be set1And a second time t2The time difference between the first and second images is set to be shorter, so that the frequency of acquiring the first and second images by the server is higher, and the first and second images which are different are easier to identify, which is beneficial to obtaining effective results when steps S2 and S3 are executed; for application programs with frequent picture changes, such as online games, the first time can be setMoment t1And a second time t2The time difference between the first and second images is set to be longer, so that the work of the server side for acquiring the first and second images can be reduced on the basis of easily identifying the different first and second images, and resources are saved.
In this embodiment, in the case that the application program is switched in the middle of the cloud mobile phone process, the server further considers the application programs running before and after the switching of the cloud mobile phone process to determine the first time t1And a second time t2The time difference between them. According to the formula in the embodiment, the earlier the cloud mobile phone process is switched from the first application program to the second application program, and the second time t is2The earlier the second picture is obtained, namely the earlier the server obtains the second picture, so that the fact that the cloud mobile phone process is switched to run the second application program is effectively coped with, the server can more easily identify the first picture and the second picture which are different, and the steps S2 and S3 are favorably performed to obtain an effective result.
In this embodiment, when step S2 is executed, a dynamic region of a picture generated by an application program run by the cloud mobile phone process may be determined first. In this embodiment, the dynamic region of the first screen and the dynamic region of the second screen are determined separately. The dynamic area in this embodiment may refer to an area in the screen that changes as the application program runs. For example, in a chat-type application, the content displayed in a chat frame or other part of the generated screen changes with the use of the user, and thus the dynamic area includes an area where the chat frame or other part is located; for an application program executing a download task, the content displayed by a download progress frame or other parts in a generated screen changes with the progress of downloading, so that the dynamic area includes an area where the download progress frame or other parts are located.
In this embodiment, a first pixel parameter is obtained from a dynamic region of a first picture, and the first pixel parameter is used to represent information such as pixel brightness and color in the dynamic region of the first picture; and obtaining a second pixel parameter from the dynamic area of the second picture, wherein the second pixel parameter is used for representing information such as pixel brightness, color and the like in the dynamic area of the second picture. Comparing the second pixel parameter with the first pixel parameter, if the second pixel parameter and the first pixel parameter are the same type of information, such as color information, the difference value between the second pixel parameter and the first pixel parameter can be determined directly through subtraction operation, and the difference value between the second pixel parameter and the first pixel parameter is used as the difference between the second picture and the first picture.
In this embodiment, a threshold is determined as a preset standard, the difference between the second picture and the first picture is compared with the preset standard, and if the difference between the second picture and the first picture is smaller than the preset standard, it indicates that the difference between the second picture and the first picture is not large, it can be reliably inferred that the second picture is unchanged compared with the first picture, that is, the cloud mobile phone process does not actually run the application program to provide the service to the user, so that the cloud mobile phone process can be determined as an idle process, that is, the cloud mobile phone process is determined to be in an idle state.
Since the idle process does not actually provide the service but occupies the resource of the server, in this embodiment, for the idle process, any one or more of the following steps S401 to S403 may be performed:
s401, sending prompt information to a client using the idle process;
s402, changing the use right of the idle process;
and S403, backing up the data generated by the idle process out of the idle process.
When step S401 is executed, a prompt message may be sent through a contact means such as a mobile phone number reserved by the user, so that the user can be aware that the process used by the user before the cloud mobile phone becomes an idle process, and the process should be performed as soon as possible.
When step S402 is executed, the use right of the idle process by the current user may be cancelled, the resource occupied by the idle process is released, and when other users apply to use the idle process, the other users are authorized to use the idle process.
When step S403 is executed, the data generated by the idle process may be backed up to the background of the server, and then the idle process is exited, and when the user of the idle process subsequently performs processing, the backed-up data is sent to the user.
In summary, the steps S1 to S3 can determine whether the cloud mobile phone process is in an idle state by obtaining two pictures, so as to facilitate subsequent processing of the idle process, and the execution processes of the steps S1 to S3 do not need to identify or access underlying data generated by the cloud mobile phone process, so that technically, the implementation is convenient, the data processing amount is small, and the situations that the cloud mobile phone service provider runs the cloud mobile phone process on a large scale can be effectively handled.
Example 2
In this embodiment, a computer apparatus includes a memory and a processor, where the memory is used to store at least one program, and the processor is used to load the at least one program to execute the cloud mobile phone process control method in embodiment 1.
In this embodiment, a storage medium stores processor-executable instructions, and when the processor-executable instructions are executed by a processor, the processor-executable instructions are configured to execute the cloud mobile phone process control method in embodiment 1, so that the same technical effects as those described in embodiment 1 are achieved.
It should be noted that, unless otherwise specified, when a feature is referred to as being "fixed" or "connected" to another feature, it may be directly fixed or connected to the other feature or indirectly fixed or connected to the other feature. Furthermore, the descriptions of upper, lower, left, right, etc. used in the present disclosure are only relative to the mutual positional relationship of the constituent parts of the present disclosure in the drawings. As used in this disclosure, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. In addition, unless defined otherwise, all technical and scientific terms used in this example have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the description of the embodiments herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this embodiment, the term "and/or" includes any combination of one or more of the associated listed items.
It will be understood that, although the terms first, second, third, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element of the same type from another. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of the present disclosure. The use of any and all examples, or exemplary language ("e.g.," such as "or the like") provided with this embodiment is intended merely to better illuminate embodiments of the invention and does not pose a limitation on the scope of the invention unless otherwise claimed.
It should be recognized that embodiments of the present invention can be realized and implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer readable memory. The methods may be implemented in a computer program using standard programming techniques, including a non-transitory computer-readable storage medium configured with the computer program, where the storage medium so configured causes a computer to operate in a specific and predefined manner, according to the methods and figures described in the detailed description. Each program may be implemented in a high level procedural or object terminal oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose.
Further, operations of processes described in this embodiment can be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described in this embodiment (or variations and/or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) collectively executed on one or more processors, by hardware, or combinations thereof. The computer program includes a plurality of instructions executable by one or more processors.
Further, the method may be implemented in any type of computing platform operatively connected to a suitable interface, including but not limited to a personal computer, mini computer, mainframe, workstation, networked or distributed computing environment, separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and the like. Aspects of the invention may be embodied in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optically read and/or write storage medium, RAM, ROM, or the like, such that it may be read by a programmable computer, which when read by the storage medium or device, is operative to configure and operate the computer to perform the procedures described herein. Further, the machine-readable code, or portions thereof, may be transmitted over a wired or wireless network. The invention described in this embodiment includes these and other different types of non-transitory computer-readable storage media when such media include instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The invention also includes the computer itself when programmed according to the methods and techniques described herein.
A computer program can be applied to input data to perform the functions described in the present embodiment to convert the input data to generate output data that is stored to a non-volatile memory. The output information may also be applied to one or more output devices, such as a display. In a preferred embodiment of the present invention, the transformed data represents a physical and tangible target terminal, including a particular visual depiction of the physical and tangible target terminal produced on a display.
The above description is only a preferred embodiment of the present invention, and the present invention is not limited to the above embodiment, and any modifications, equivalent substitutions, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention as long as the technical effects of the present invention are achieved by the same means. The invention is capable of other modifications and variations in its technical solution and/or its implementation, within the scope of protection of the invention.