Image processing prompting method and device, electronic equipment, storage medium and program product
By dynamically determining the number of pixels currently supported processing of the target application and performing image processing pre-prompt, the problem of delayed timing of image processing prompts in the prior art is solved, and the accuracy of pre-prompt and resource utilization efficiency are improved.
Patent Information
- Application Number
- CN202411845677.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-18
AI Technical Summary
In the prior art, the timing of image processing prompts is relatively lagging, resulting in insufficient resources or waste of resources in the image processing process.
By acquiring the number of pixels supported by the free resource of the target application, the number of pixels currently supported by the current supported by the processing is dynamically determined, and an image processing pre-prompt is performed based on this.
Pre-prompt the processing before image processing is realized, improving the accuracy of pre-prompt, avoiding waste or insufficient resources, and reducing abnormalities in the image processing process.
Smart Images

Figure CN119645685A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to an image processing prompting method, device, electronic device, storage medium, and program product. Background Art
[0002] Currently, some applications support users to process images and provide prompts when image processing is abnormal. However, in related technologies, the timing of image processing prompts is relatively delayed. Summary of the Invention
[0003] The embodiments of the present disclosure provide a method, device, electronic device, storage medium, and program product for prompting image processing, so as to provide a pre-prompt for image processing before image processing, thereby reducing anomalies occurring during the image processing process.
[0004] In a first aspect, an embodiment of the present disclosure provides a prompting method for image processing, comprising:
[0005] Obtaining a first number of pixels supported for processing by at least one idle resource of a target application;
[0006] Determining, based on the first number of pixels, a second number of pixels currently supported for processing by the target application;
[0007] Performing image processing pre-prompt on the image to be processed based on the second number of pixels.
[0008] In a second aspect, the present disclosure further provides an image processing prompting device, comprising:
[0009] a quantity acquisition module, configured to acquire a first number of pixels supported for processing by at least one idle resource of a target application;
[0010] a quantity determining module, configured to determine a second number of pixels currently supported for processing by the target application based on the first number of pixels;
[0011] A pre-prompt module is used to perform image processing pre-prompt on the image to be processed based on the second number of pixels.
[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:
[0013] one or more processors;
[0014] a memory for storing one or more programs,
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing prompting method as described in the embodiment of the present disclosure.
[0016] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the image processing prompting method as described in the embodiment of the present disclosure is implemented.
[0017] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which, when executed by a computer, enables the computer to implement the image processing prompting method as described in the embodiment of the present disclosure.
[0018] The image processing prompt method, device, electronic device, storage medium and program product provided by the embodiments of the present disclosure can dynamically determine the number of pixels currently supported for processing by the application before image processing, and perform image processing pre-prompts based on this. Compared with the technical solution of providing prompts after insufficient resources occur during the image processing process or providing image processing pre-prompts based on a pre-set default number of pixels, it can not only achieve pre-prompts for image processing before image processing, but also improve the accuracy of image processing pre-prompts, avoid waste or insufficient resources for image processing resources, and reduce anomalies during the image processing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 A flowchart of an image processing prompting method provided by an embodiment of the present disclosure;
[0021] Figure 2 A flowchart of another image processing prompting method provided by an embodiment of the present disclosure;
[0022] Figure 3 A structural block diagram of an image processing prompting device provided by an embodiment of the present disclosure;
[0023] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0025] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0026] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0027] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0028] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0029] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0030] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.
[0031] Figure 1 This is a flowchart of an image processing prompting method provided by an embodiment of the present disclosure. The method can be executed by an image processing prompting device, wherein the device can be implemented by software and / or hardware and can be configured in an electronic device, typically, a computer, a mobile phone or a tablet computer. The image processing prompting method provided by an embodiment of the present disclosure is suitable for scenarios where pre-prompting image processing is performed before image processing is performed. Figure 1As shown, the image processing prompt method provided in this embodiment may include:
[0032] S101: Obtain a first number of pixels supported for processing by at least one idle resource of a target application.
[0033] Among them, the target application can be understood as an application for performing image processing on the current image to be processed, such as an image processing application and / or a media content application that supports image processing, etc. The idle resources can be understood as image processing resources that are currently in an idle state. For example, the above-mentioned at least one idle resource can be the remaining available resources of each type of image processing resources in at least one type of image processing resources. This at least one idle resource is not limited. Optionally, the at least one idle resource includes idle native memory and / or idle virtual machine memory. This idle native memory can be understood as native memory that is currently in an idle state, such as the currently remaining available native memory of the target application. This idle virtual machine memory can be understood as virtual machine memory that is currently in an idle state, such as the currently remaining available Java Virtual Machine (JVM) memory of the target application. The first number of pixels supported for processing by a certain idle resource can be understood as the number of pixels that such idle resource can be used for processing, such as the maximum number of pixels that can be processed simultaneously.
[0034] Specifically, before performing image processing on the current image to be processed, such as when receiving an image processing pre-prompt operation, the maximum number of pixels currently supported for processing by each type of idle resource of at least one idle resource of the target application can be obtained as the first number of pixels of the corresponding idle resource. For example, the maximum number of pixels currently supported for processing by the first type of idle resources of the target application can be obtained as the first number of pixels of the first type of idle resources, and / or the maximum number of pixels currently supported for processing by the second type of idle resources of the target application can be obtained as the second number of pixels of the second type of idle resources. The methods for obtaining the first number of pixels supported for processing by different types of idle resources can be the same or different, and can be specifically set as needed.
[0035] In this embodiment, when obtaining the first pixel number, the system version information of the target application may or may not be considered. For example, the first pixel number of at least one pre-set candidate resource may be obtained, or the first pixel number of at least one candidate resource corresponding to the system version information of the target application may be obtained. This embodiment does not limit this.
[0036] S102: Determine, based on the first number of pixels, the second number of pixels that the target application currently supports processing.
[0037] The second number of pixels may be understood as the number of pixels that the target application currently supports processing, such as the maximum number of pixels that the target application currently supports processing simultaneously.
[0038] Specifically, after determining the first number of pixels supported for processing by each of the at least one idle resource mentioned above, the second number of pixels currently supported for processing by the target application can be determined based on the first number of pixels supported for processing by various idle resources. For example, based on the different types of idle resources required for image processing, different determination methods can be used to determine the second number of pixels currently supported for processing by the target application based on the first number of pixels.
[0039] For example, when each of the at least one idle resource mentioned above supports independent image processing, that is, when one of the at least one idle resource mentioned above can be used for image processing, the sum of the first number of pixels supported for processing by each of the at least one idle resource mentioned above can be calculated as the second number of pixels currently supported for processing by the target application.
[0040] For example, when various idle resources among the at least one idle resource mentioned above need to work together to perform image processing, that is, when various idle resources among the at least one idle resource mentioned above need to be used simultaneously to complete image processing, the maximum value, minimum value, mean and / or median value of the first number of pixels supported for processing by various idle resources among the at least one idle resource mentioned above can be obtained as the second number of pixels currently supported for processing by the target application.
[0041] In order to further improve the accuracy of image processing pre-prompts and reduce anomalies that occur during image processing, optionally, the second number of pixels currently supported for processing by the target application is determined based on the first number of pixels, including: obtaining the minimum value of each of the first numbers of pixels as the second number of pixels currently supported for processing by the target application. For example, the minimum value of the first number of pixels supported for processing by various idle resources in the at least one idle resource mentioned above can be obtained as the second number of pixels currently supported for processing by the target application. Exemplarily, in the case where only the first number of pixels supported for processing by one idle resource of the target application is obtained, this first number of pixels supported for processing by such idle resource can be used as the second number of pixels currently supported for processing by the target application; in the case where the first number of pixels supported for processing by multiple idle resources of the target application is obtained, the first number of pixels with the smallest value among the first numbers of pixels can be obtained as the first number of pixels currently supported for processing by the target application.
[0042] S103: Pre-prompt image processing on the image to be processed based on the second number of pixels.
[0043] For example, after obtaining the second number of pixels that the target application currently supports for processing, a preliminary prompt for image processing can be performed on the image to be processed based on this second number of pixels, such as prompting the maximum number of pixels of the image to be processed that the target application currently supports for processing (i.e., the second number of pixels), and / or, based on this second number of images, prompting whether insufficient resources will occur when processing the current image to be processed, etc.
[0044] In some embodiments, the pre-prompt for image processing of the image to be processed based on the second number of pixels includes: displaying first pre-prompt information for the second number of pixels; and / or, performing image processing prediction based on the second number of pixels and a third number of pixels of the image to be processed, generating a prediction result, and displaying second pre-prompt information for the prediction result, wherein the prediction result indicates whether insufficient resources will occur when processing the image to be processed.
[0045] Among them, the image to be processed can be understood as the image to be processed currently. The third number of pixels can be understood as the total number of pixels of the image to be processed, which can be determined based on the user's input or based on the image to be processed, and this embodiment does not limit this. The prediction result generated by performing image processing prediction can be used to indicate whether the current use of the target application to perform image processing on the image to be processed is a case of insufficient resources. There is no limit to the way of performing image processing on the image to be processed. For example, the image processing on the image to be processed may include but is not limited to encoding processing, decoding processing or format conversion processing on the image to be processed, etc.
[0046] The first pre-prompt information may be pre-prompt information for the second number of pixels currently supported for processing by the target application, such as the first pre-prompt information may be used to indicate the second number of pixels. The second pre-prompt information may be pre-prompt information for the generated prediction result, such as the second pre-prompt information may be used to indicate the generated prediction result.
[0047] In some examples, after determining the second number of pixels that the target application currently supports processing, a first preset prompt message can be displayed, and the second number of pixels can be prompted through the first pre-prompt message, such as prompting through the first pre-prompt message that the maximum number of pixels that the target application currently supports processing is this second number of pixels and / or prompting the user that the image to be processed preferably does not exceed this second number of pixels, etc.
[0048] In some examples, after determining the second number of pixels that the target application currently supports for processing, it is possible to predict whether insufficient resources will result when the target application is currently used to process the image to be processed based on this second number of pixels and the acquired third number of pixels of the image to be processed, generate a prediction result, and display a second pre-prompt message. The prediction result is prompted by the second pre-prompt message, such as prompting by the second pre-prompt message whether insufficient resources will result when the target application is currently used to process the image to be processed, and so on.
[0049] There is no limit to the method for obtaining the third number of pixels of the image to be processed. For example, the total number of pixels of the image to be processed input by the user can be obtained as the third number of pixels; the number of row pixels and the number of column pixels of the image to be processed can also be obtained from the image information of the image to be processed, and the total number of pixels of the image to be processed can be calculated based on this, or image detection can be performed on the image to be processed to obtain the total number of pixels of the image to be processed, etc. This embodiment does not limit this.
[0050] In the above embodiment, whether the first pre-prompt information or the second pre-prompt information is used for image processing pre-prompt can be flexibly set as needed. In some examples, for example, when the third number of pixels of the image to be processed cannot be obtained, such as when the user has not input the total number of pixels of the image to be processed and has not selected or imported the image to be processed, the first pre-prompt information can be used for image processing pre-prompt; when the third number of pixels of the image to be processed can be obtained, the second pre-prompt information can be used for image processing pre-prompt.
[0051] The image processing prompt method provided in this embodiment obtains the first number of pixels that can be processed by at least one idle resource of the target application; determines the second number of pixels that the target application currently supports processing based on this first number of pixels; and performs image processing pre-prompts on the image to be processed based on this second number of pixels. This embodiment utilizes the above technical solution to dynamically determine the number of pixels that the application currently supports processing before image processing, and performs image processing pre-prompts based on this. Compared with the technical solution of providing prompts after insufficient resources occur during the image processing process or providing image processing pre-prompts based on a preset default number of pixels, this method can not only provide pre-prompts for image processing before image processing, but also improve the accuracy of image processing pre-prompts, avoid waste or insufficient resources for image processing resources, and reduce anomalies that occur during the image processing process.
[0052] Figure 2A flowchart of another image processing prompting method provided by an embodiment of the present disclosure. The solution in this embodiment can be combined with one or more optional solutions in the above embodiments. Optionally, obtaining the first number of pixels supported by at least one idle resource of the target application includes: obtaining the first number of pixels supported by at least one idle resource of the target application based on the system version information corresponding to the target application.
[0053] Correspondingly, such as Figure 2 As shown, the image processing prompt method provided in this embodiment may include:
[0054] S201: Obtain, based on system version information corresponding to a target application, a first number of pixels supported for processing by at least one idle resource of the target application.
[0055] The system version information corresponding to the target application can be understood as information about the operating system version of the electronic device on which the target application is installed, such as the operating system version number of the electronic device on which the target application is installed. When the system version information of the target applications is different, the type of idle resources for obtaining the first number of pixels and / or the method for obtaining the first number of pixels can be the same or different.
[0056] Specifically, based on the system version information corresponding to the target application, the first number of pixels supported for processing by at least one idle resource of the target application can be obtained, such as obtaining the first number of pixels supported for processing by at least one idle resource corresponding to the system version information of the target application, and / or, using the acquisition method corresponding to the system version information of the target application, obtaining the first number of pixels supported for processing by at least one idle resource, so as to subsequently determine the second number of pixels currently supported for processing by the target application based on the obtained first number of pixels supported for processing by this at least one idle resource.
[0057] In some embodiments, the first pixel number supported by different types of idle resources of the target application can be obtained based on whether the system version information corresponding to the target application meets preset conditions, or the first pixel number supported by at least one idle resource of the target application can be obtained using different acquisition methods.
[0058] This preset condition can be set based on the different image processing resources occupied by different versions of operating systems when performing image processing. Exemplarily, this preset condition can be that the system version number corresponding to the target application is greater than or equal to the preset system version number. This preset system version number can be set based on the actual image processing situation of different versions of operating systems. Taking the encoding processing of the image to be processed as an example, assuming that the operating system with a version number greater than or equal to a certain version number uses the first type of image processing resources to store the bitmaps (Bitmap), arrays (Array) and encoding libraries required in the encoding process, and the operating system with a version number less than a certain version number uses the first type of image processing resources to store the arrays and encoding libraries required in the encoding process and uses the second type of image processing resources to store the bitmaps required in the encoding process, then this version number can be used as the preset system version number. The following is explained using this case as an example.
[0059] In some embodiments, obtaining the first number of pixels supported for processing by at least one idle resource of the target application based on the system version information corresponding to the target application includes: in response to the system version information corresponding to the target application satisfying a preset condition, calculating the first number of pixels supported for processing by the first type of idle resources according to the first idle resource information of the first type of idle resources of the target application; or, in response to the system version information corresponding to the target application satisfying the preset condition, calculating the first number of pixels supported for processing by the first type of idle resources according to the first idle resource information of the first type of idle resources of the target application; and obtaining a preset number of pixels corresponding to the second type of idle resources of the target application as the first number of pixels supported for processing by the second type of idle resources.
[0060] Among them, the first type of idle resources can be understood as the idle resources that target applications with different system version information occupy a large amount of when performing image processing, such as idle resources that target applications with different system version information may encounter insufficient resources when performing image processing. The second type of idle resources can be understood as the idle resources that target applications with system version information that meets preset conditions only need to occupy a small amount of resources when performing image processing. In other words, idle resources that target applications with system version information that meets preset conditions generally do not encounter insufficient resources when performing image processing. The specific types of the first type of idle resources and the second type of idle resources are not limited, and can be determined based on the current image processing and the occupation of each type of image processing resources by the target application when performing image processing. Exemplarily, the first type of idle resources may include but are not limited to idle native memory, and the second type of idle resources may include but are not limited to idle virtual machine memory.
[0061] The first idle resource information can be understood as resource information of the first type of idle resources, such as the resource value of the first type of idle resources. The preset number of pixels can be set as needed. For example, the preset number of pixels can be set to a value greater than the maximum number of pixels that the first type of image processing resources (such as native memory) of the target application can process. For example, the preset number of pixels can be set to the maximum number of pixels supported by the second type of image processing resources when all are idle, or to infinity.
[0062] Exemplarily, considering that when the system version information corresponding to the target application meets the preset conditions, such as when the system version number corresponding to the target application is greater than or equal to the preset system version number, the target application only needs to occupy a small amount of the second type of image processing resources when performing image processing (such as image encoding, etc.), and the second type of image processing resources generally will not be insufficient. Therefore, when determining the second number of pixels currently supported for processing by the target application, the first number of pixels supported for processing by the second type of idle resources of the target application can be ignored. For example, the first number of pixels supported for processing by the first type of idle resources is calculated based on the current first idle resource information of the first type of idle resources of the target application, and the second number of pixels currently supported for processing by the target application is determined based on this first number of pixels; the preset number of pixels supported for processing by the second type of image processing resources of the target application can also be pre-set, and this preset number of pixels can be used as the first number of pixels supported for processing by the second type of idle resources of the target application. There is no need to dynamically calculate the number of pixels supported for processing by the second type of idle resources at the current moment based on the second idle resource information of the second type of idle resources, so as to further improve the speed of image processing pre-prompt.
[0063] In some embodiments, obtaining the first number of pixels supported for processing by at least one idle resource of the target application based on the system version information corresponding to the target application includes: in response to the system version information corresponding to the target application not satisfying a preset condition, calculating the first number of pixels supported for processing by the first type of idle resources of the target application based on the first idle resource information of the first type of idle resources; and calculating the first number of pixels supported for processing by the second type of idle resources of the target application based on the second idle resource information of the second type of idle resources.
[0064] The second idle resource information may be understood as resource information of the second type of idle resources, such as resource values of the second type of idle resources.
[0065] Exemplarily, considering that when the system version information corresponding to the target application does not meet the preset conditions, such as when the system version number corresponding to the target application is less than the preset system version number, when the target application performs image processing (such as image encoding processing, etc.), both the first type of image processing resources and the second type of image processing resources may be insufficient, so when determining the second number of pixels currently supported for processing by the target application, the first number of pixels currently supported for processing by the first type of idle resources of the target application and the first number of pixels currently supported for processing by the second type of idle resources of the target application can be considered, such as determining the first number of pixels currently supported for processing by the first type of idle resources based on the current first idle resource information of the first type of idle resources, and determining the first number of pixels currently supported for processing by the second type of idle resources based on the current second idle resource information of the second type of idle resources; and determining the second number of pixels currently supported for processing by the target application based on the first number of pixels currently supported for processing by the first type of idle resources and the first number of pixels currently supported for processing by the second type of idle resources.
[0066] In this embodiment, the method for determining the number of first pixels currently supported for processing by the first type of idle resources and / or the second type of idle resources is not limited. For example, the number of first pixels currently supported for processing by the first type of idle resources can be calculated based on the current resource information of the first type of idle resources and the resource information of the first type of idle resources required to process a single pixel, and / or the number of first pixels currently supported for processing by the second type of idle resources can be calculated based on the current resource information of the second type of idle resources and the resource information of the second type of idle resources required to process a single pixel, and so on.
[0067] In some embodiments, calculating the first number of pixels supported for processing by the first type of idle resources based on the first idle resource information of the target application includes: calling a preset resource management object to obtain the first idle resource information of the first type of idle resources of the target application through the preset resource management object; determining the first pixel resource information of the first type of idle resources occupied by processing a single pixel using a determination method corresponding to the system version information; and calculating the first number of pixels supported for processing by the first type of idle resources based on the first idle resource information and the first pixel resource information.
[0068] The preset resource management object may be an object that performs resource management. The preset resource management object is not limited, and only needs to be able to obtain the current first idle resource information of the first type of idle resources. Exemplarily, the preset resource management object may be an activity manager object. The first pixel resource information may be understood as resource information of the first type of idle resources required to process a single pixel, such as the resource value of the first type of idle resources required to process a single pixel.
[0069] Exemplarily, a preset resource management object may be called to obtain first idle resource information of a first type of idle resource of a target application through the preset resource management object; and first pixel resource information of the first type of idle resource required to process a single pixel may be determined using a determination method corresponding to the system version information of the target application. Furthermore, based on this first idle resource information and this first pixel resource information, the first number of pixels supported for processing by the first type of idle resource may be calculated, such as by calculating the ratio between the resource value of the first type of idle resource (i.e., the first idle resource information) and the resource value of the first type of idle resource required to process a single pixel (i.e., the first pixel resource information), and taking the integer portion of this ratio as the first number of pixels supported for processing by the first type of idle resource.
[0070] Taking the first type of idle resource as idle native memory as an example, when obtaining the first idle resource information of the first type of idle resource, for example, the Activity Manager object can be called to obtain the memory value of the current idle native memory of the target application through the Activity Manager object as the first idle resource information of the first type of idle resource.
[0071] Taking the first type of idle resources as idle native memory, the second type of idle resources as idle virtual machine memory, and the High Efficiency Image Format (HEIC) image encoding processing of the image to be processed as an example, considering that different versions of target applications may occupy different first type of image processing resources when performing HEIC image encoding processing, the determination method corresponding to the system version information of the target application can be used to determine the first pixel resource information of the first type of idle resources required to process a single pixel.
[0072] For example, when a target application that meets preset conditions (such as a system version number greater than or equal to a preset system version number) performs HEIC image encoding processing, the bitmap, array, and underlying encoding library used in the image processing process are generally stored in native memory. Therefore, the total resource value of the memory resources occupied by the bitmap, array, and underlying encoding library when processing a single pixel can be calculated as the first pixel resource information.
[0073] For example, when a target application that does not meet the preset conditions (such as the system version number is less than the preset system version number) performs HEIC image encoding processing, it generally stores the array and underlying encoding library in the image processing process in the native memory, and stores the bitmap in the image processing process in the idle virtual machine memory. Therefore, the total resource value of the memory resources occupied by the array and the underlying encoding library when processing a single pixel can be calculated as the first pixel resource information.
[0074] In some embodiments, the calculating the first number of pixels supported for processing by the second type of idle resources based on the second idle resource information of the target application includes: obtaining the total resource information that can be applied for, the applied resource information, and the unoccupied resource information corresponding to the second type of idle resources, the unoccupied resource information being the resource information of the second type of idle resources that have been applied for and not occupied; determining the second idle resource information of the second type of idle resources based on the total resource information that can be applied for, the applied resource information, and the unoccupied resource information; and calculating the second number of pixels supported for processing by the second type of idle resources based on the second idle resource information and the second pixel resource information of the second type of idle resources occupied by processing a single pixel.
[0075] Among them, the total resource information that can be applied for corresponding to the second type of idle resources can be understood as the resource information of the second type of image processing resources that the target application can apply for. The applied resource information corresponding to the second type of idle resources can be understood as the resource information of the second type of image processing resources currently applied for by the target application. The unoccupied resource information corresponding to the second type of idle resources can be understood as the resource information of the unoccupied portion of the second type of image processing resources currently applied for by the target application. Taking the second type of idle resources as idle virtual machine resources as an example, the total resource information that can be applied for corresponding to the second type of idle resources can be the maximum memory value of the virtual machine memory that the target application can apply for from the electronic device on which it is installed; the applied resource information corresponding to the second type of idle resources can be the memory value of the virtual machine memory that the target application has currently applied for from the electronic device on which it is installed, etc.; the unoccupied resource information corresponding to the second type of idle resources can be the memory value corresponding to the unoccupied portion of the virtual machine memory applied for by the target application. The second pixel resource information can be understood as the resource information of the second type of idle resources required to process a single pixel, such as the resource value of the second type of idle resources required to process a single pixel, etc.
[0076] Exemplarily, the total resource information available for application, the applied resource information, and the unoccupied resource information of the unoccupied portion of the applied second-type image processing resources corresponding to the first-type idle resources may be obtained.
[0077] Based on the available resource information, the applied resource information, and the unoccupied resource information, the second idle resource information of the second type of idle resource is determined. Taking the available resource information as the available resource value, the applied resource information as the applied resource value, and the unoccupied resource information as the unoccupied resource value as an example, the occupied resource value of the second type of image processing resource can be calculated based on the applied resource value and the unoccupied resource value, such as calculating the difference between the applied resource value and the unoccupied resource value as the occupied resource value of the second type of image processing resource; and further based on the above-mentioned available resource value and the occupied resource value, the resource value of the second type of idle resource is calculated, such as calculating the difference between the above-mentioned available resource value and the occupied resource value as the resource value of the second type of idle resource, and the resource value of the second type of idle resource is used as the second idle resource information of the second type of idle resource.
[0078] After obtaining the second idle resource information of the second type of idle resources, the number of second pixels supported by the second type of idle resources for processing can be calculated based on this second idle resource information and the second pixel resource information of the second type of idle resources occupied for processing a single pixel. For example, the ratio between the resource value of the second type of idle resources (i.e., the second idle resource information) and the resource value of the second type of idle resources required to process a single pixel (i.e., the second pixel resource information) is calculated, and the integer part of this ratio is taken as the first number of pixels supported by the second type of idle resources for processing.
[0079] In the above-mentioned embodiment, the method for determining the second pixel resource information of the second type of idle resources occupied by processing a single pixel is not limited. Taking the case where the first type of idle resources is idle native memory, the second type of idle resources is idle virtual machine memory, and HEIC image encoding processing is performed on the image to be processed as an example, considering that the target application whose system version information does not meet the preset conditions (such as the system version number is less than the preset system version number) generally stores the array and underlying encoding library in the image processing process in the native memory, and stores the bitmap in the image processing process in the idle virtual machine memory, the resource value of the virtual machine resources occupied by the bitmap when processing a single pixel can be obtained as the second pixel resource information.
[0080] S202: Determine, based on the first number of pixels, the second number of pixels that the target application currently supports processing.
[0081] S203: Pre-prompt image processing on the image to be processed based on the second number of pixels.
[0082] The image processing prompt method provided in this embodiment can determine the second number of pixels currently supported by the target application for processing based on the first number of pixels supported by at least one idle resource corresponding to the system version information of the target application, and perform image processing pre-prompts on the image to be processed based on this second number of pixels, thereby realizing image processing pre-prompts for target applications with different operating system version information, and reducing anomalies that occur during the image processing process of the target application.
[0083] Taking the first type of free resources as free native memory, the second type of free resources as free JVM memory, and the target application as an Android application, as an example, when performing HEIC image encoding on an image to be processed, in related technologies, the encoding application (i.e., the target application) generally does not indicate the supported image sizes or only indicates a preset size (such as 5k). However, users may have a variety of usage scenarios and often encounter or need to process applications encoding very large images (such as images with a resolution of 1w×1w or above).
[0084] In application encoding scenarios, when the image to be encoded has too many pixels, it is very easy to encounter an OutOfMemory (OOM) problem. For example, the target application may occupy too much memory for other tasks, resulting in insufficient memory for encoding. Even when encoding relatively small images, OOM may occur. And / or, the target application may encounter a scenario where it needs to encode an extremely large image. Since encoding requires basically restoring all the pixel information of the original image, the memory overhead of this part of encoding is necessary. However, since the image is extremely large, the memory space allocated to the application by the Android system itself is limited. In this scenario, a very large image may directly cause the target application to experience OOM.
[0085] To address this issue, there are limited scenarios for using HEIC images, with only a small number of users needing to encode and upload HEIC images on their apps. The available memory for user processes is constantly changing, making it difficult to provide a universal standard for user reference. Furthermore, Android apps use different memory spaces for Bitmap storage depending on their system versions, making it difficult to provide a unified standard. Currently, there is no good Application Programming Interface (API) or open source solution.
[0086] In view of this, the embodiment of the present disclosure provides an image processing prompt method to adapt to different versions of Android systems, and through dynamic calculation, informs the user in advance before the user encodes whether the existing memory situation can support secure encoding for the image to be processed next.
[0087] Specifically, the present embodiment can basically avoid OOM caused by encoding large images by dynamically calculating the memory required for encoding and comparing whether the target application currently supports encoding the image to be processed. It can also reasonably utilize the existing memory and avoid wasting memory while achieving secure encoding.
[0088] Furthermore, this embodiment's precalculation of encoding memory usage and comparison with the target application's available memory fully considers compatibility issues across different Android systems. Therefore, it can run on various Android devices with system versions greater than Android 4.0 (according to statistics, nearly all Android devices currently have versions greater than Android 4.0), thus having a wide range of applicability. Furthermore, in addition to avoiding the OOM issue when encoding very large images, this embodiment can also effectively avoid the OOM issue introduced by encoding small images when the application runs out of memory due to other reasons.
[0089] The specific implementation process of the image processing prompt method proposed in this embodiment is described as follows:
[0090] Obtain the system version number (ie, system version information) of the electronic device where the target application is currently installed.
[0091] If the system version number is greater than or equal to Android 8.0, the Activity Manager object is called to obtain the current memory value of the target application's free native memory (i.e., the first free resource information) through the Activity Manager object; and the ratio between the memory value of the free native memory and the memory value of the native memory consumed by the bitmap, array, and underlying encoding library during the HEIC image encoding process for a single pixel is calculated as the first number of pixels currently supported by the free native memory. In addition, the preset number of pixels of the free JVM memory is obtained as the first number of pixels currently supported by the free JVM memory. The minimum value between the first number of pixels currently supported by the free native memory and the first number of pixels currently supported by the free JVM memory is obtained as the second number of pixels currently supported by the target application, and image encoding prompts are performed based on this second number of pixels.
[0092] If the system version number is earlier than Android 8.0, the Activity Manager object is called to obtain the target application's current free native memory value (i.e., the first free resource information) through the Activity Manager object. The ratio between the free native memory value and the native memory value consumed by the array and the underlying encoding library during HEIC image encoding of a single pixel is calculated as the first number of pixels currently supported by the free native memory.
[0093] Obtain the memory value of the maximum JVM memory that can be applied for by the target application (i.e., the total resource information that can be applied for), the memory value of the JVM memory currently applied for by the target application (i.e., the applied resource information), and the memory value of the unoccupied JVM memory in the JVM memory currently applied for by the target application (i.e., the unoccupied resource information); calculate the difference between the memory value of the currently applied JVM memory and the memory value of the unoccupied JVM memory as the memory value of the JVM memory occupied by the target application; calculate the difference between the memory value of the above-mentioned applied JVM memory and the memory value of the occupied JVM memory as the memory value of the current free JVM memory of the target application (i.e., the second free resource information); and calculate the ratio between the memory value of the free JVM memory and the memory value of the JVM memory consumed by the bitmap in the HEIC image encoding process of a single pixel as the first number of pixels currently supported for processing by the free JVM memory.
[0094] The minimum value of the first number of pixels currently supported by the free native memory and the first number of pixels currently supported by the free JVM memory is obtained as the second number of pixels currently supported by the target application, and image encoding hints are performed based on the second number of pixels.
[0095] This embodiment utilizes the above technical solution to improve the OOM protection capability of the coding application and fully utilize the resources of the coding application to avoid resource waste.
[0096] Figure 3 This is a structural block diagram of an image processing prompting device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can be configured in an electronic device, typically a computer, a mobile phone or a tablet computer, and can perform a pre-prompt for image processing before performing image processing by executing an image processing prompting method. Figure 3 As shown, the image processing prompting device provided in this embodiment may include: a quantity acquisition module 301, a quantity determination module 302 and a pre-prompt module 303, wherein:
[0097] A quantity acquisition module 301 is configured to acquire a first number of pixels supported for processing by at least one idle resource of a target application;
[0098] A quantity determining module 302 is configured to determine a second number of pixels currently supported for processing by the target application based on the first number of pixels;
[0099] The pre-prompt module 303 is configured to perform image processing pre-prompt on the image to be processed based on the second number of pixels.
[0100] The image processing prompt device provided by this embodiment obtains the first number of pixels that can be processed by at least one idle resource of the target application through a number acquisition module; determines the second number of pixels that the target application currently supports processing based on this first number of pixels through a number determination module; and performs image processing pre-prompts for the image to be processed based on this second number of pixels through a pre-prompt module. This embodiment utilizes the above technical solution to dynamically determine the number of pixels that the application currently supports processing before image processing, and performs image processing pre-prompts based on this. Compared with the technical solution of providing prompts after insufficient resources occur during the image processing process or providing image processing pre-prompts based on a preset default number of pixels, this solution can not only provide pre-prompts for image processing before image processing, but also improve the accuracy of image processing pre-prompts, avoid waste or insufficient resources for image processing resources, and reduce abnormalities during the image processing process.
[0101] Optionally, the quantity acquisition module 301 may be specifically configured to: acquire, according to system version information corresponding to the target application, the first quantity of pixels supported for processing by at least one idle resource of the target application.
[0102] Optionally, the quantity acquisition module 301 can be specifically used to: in response to the system version information corresponding to the target application meeting a preset condition, calculate the first number of pixels supported for processing by the first type of idle resources based on the first idle resource information of the first type of idle resources of the target application; or, in response to the system version information corresponding to the target application meeting a preset condition, calculate the first number of pixels supported for processing by the first type of idle resources based on the first idle resource information of the first type of idle resources of the target application; and obtain a preset number of pixels corresponding to the second type of idle resources of the target application as the first number of pixels supported for processing by the second type of idle resources.
[0103] Optionally, the quantity acquisition module 301 can be specifically used to: in response to the system version information corresponding to the target application not meeting the preset conditions, calculate the first number of pixels supported for processing by the first type of idle resources based on the first idle resource information of the first type of idle resources of the target application; and calculate the first number of pixels supported for processing by the second type of idle resources based on the second idle resource information of the second type of idle resources of the target application.
[0104] Optionally, the quantity acquisition module 301 may include: a first information acquisition unit, used to call a preset resource management object, and obtain the first idle resource information of the first type of idle resources of the target application through the preset resource management object; a first information determination unit, used to adopt a determination method corresponding to the system version information to determine the first pixel resource information of the first type of idle resources occupied by processing a single pixel; a first quantity calculation unit, used to calculate the first number of pixels supported for processing by the first type of idle resources based on the first idle resource information and the first pixel resource information.
[0105] Optionally, the quantity acquisition module 301 may include: a second information acquisition unit, used to obtain the total resource information that can be applied for, the applied resource information and the unoccupied resource information corresponding to the second type of idle resources, the unoccupied resource information being the resource information of the second type of idle resources that have been applied for and not occupied; a second information determination unit, used to determine the second idle resource information of the second type of idle resources based on the total resource information that can be applied for, the applied resource information and the unoccupied resource information; a second quantity calculation unit, used to calculate the number of second pixels supported for processing by the second type of idle resources based on the second idle resource information and the second pixel resource information of the second type of idle resources occupied by processing a single pixel.
[0106] Optionally, the quantity determining module 302 may be specifically configured to: obtain a minimum value among the first pixel quantities as the second pixel quantity currently supported for processing by the target application.
[0107] Optionally, the pre-prompt module 303 can be specifically used to: display a first pre-prompt information for the second number of pixels; and / or, perform image processing prediction based on the second number of pixels and the third number of pixels of the image to be processed, generate a prediction result, and display a second pre-prompt information for the prediction result, wherein the prediction result indicates whether there will be insufficient resources for processing the image to be processed.
[0108] Optionally, the at least one idle resource includes idle native memory and / or idle virtual machine memory.
[0109] The image processing prompting device provided in the embodiments of the present disclosure can execute the image processing prompting method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of executing the image processing prompting method. For technical details not fully described in this embodiment, please refer to the image processing prompting method provided in any embodiment of the present disclosure.
[0110] Reference below Figure 4 , which shows a schematic structural diagram of an electronic device (e.g., terminal device) 400 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0111] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. Various programs and data required for the operation of the electronic device 400 are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0112] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0113] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0114] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0115] In some embodiments, the applications and servers may communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
[0116] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0117] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains the first number of pixels supported for processing by at least one idle resource of the target application; determines the second number of pixels currently supported for processing by the target application based on the first number of pixels; and performs image processing pre-prompts on the image to be processed based on the second number of pixels.
[0118] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0120] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a module does not, in some cases, limit the unit itself.
[0121] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0122] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0123] According to one or more embodiments of the present disclosure, Example 1 provides a prompting method for image processing, including:
[0124] Obtaining a first number of pixels supported for processing by at least one idle resource of a target application;
[0125] Determining, based on the first number of pixels, a second number of pixels currently supported for processing by the target application;
[0126] Performing image processing pre-prompt on the image to be processed based on the second number of pixels.
[0127] According to one or more embodiments of the present disclosure, Example 2 is the method according to Example 1, wherein obtaining a first number of pixels supported for processing by at least one idle resource of the target application includes:
[0128] According to the system version information corresponding to the target application, a first number of pixels supported for processing by at least one idle resource of the target application is obtained.
[0129] According to one or more embodiments of the present disclosure, Example 3 is the method according to Example 2, wherein obtaining, based on system version information corresponding to the target application, a first number of pixels supported for processing by at least one idle resource of the target application includes:
[0130] In response to the system version information corresponding to the target application meeting a preset condition, calculating a first number of pixels supported for processing by the first type of idle resources according to the first type of idle resource information of the target application; or
[0131] In response to the system version information corresponding to the target application meeting a preset condition, the first number of pixels supported for processing by the first type of idle resources is calculated based on the first idle resource information of the target application; and the preset number of pixels corresponding to the second type of idle resources of the target application is obtained as the first number of pixels supported for processing by the second type of idle resources.
[0132] According to one or more embodiments of the present disclosure, Example 4 is the method according to Example 2, wherein obtaining, based on system version information corresponding to the target application, a first number of pixels supported for processing by at least one idle resource of the target application includes:
[0133] In response to the system version information corresponding to the target application not meeting the preset conditions, the first number of pixels supported for processing by the first type of idle resources is calculated based on the first idle resource information of the first type of idle resources of the target application; and the first number of pixels supported for processing by the second type of idle resources is calculated based on the second idle resource information of the second type of idle resources of the target application.
[0134] According to one or more embodiments of the present disclosure, Example 5 is the method according to Example 3 or 4, wherein calculating, based on first idle resource information of the first type of idle resources of the target application, a first number of pixels supported for processing by the first type of idle resources includes:
[0135] Calling a preset resource management object, and obtaining first idle resource information of a first type of idle resource of the target application through the preset resource management object;
[0136] Determine, using a determination method corresponding to the system version information, first pixel resource information of the first type of idle resources occupied by a single pixel;
[0137] A first number of pixels supported for processing by the first-type idle resources is calculated according to the first idle resource information and the first pixel resource information.
[0138] According to one or more embodiments of the present disclosure, Example 6, according to the method of Example 4, calculating, based on second idle resource information of the second type of idle resources of the target application, the first number of pixels supported for processing by the second type of idle resources, includes:
[0139] Acquire total resource information that can be applied for, information about applied resources, and unoccupied resource information corresponding to the second type of idle resources, wherein the unoccupied resource information is resource information about the second type of idle resources that have been applied for and are not occupied;
[0140] Determining second idle resource information of the second type of idle resources according to the total resource information that can be applied, the applied resource information, and the unoccupied resource information;
[0141] The number of second pixels supported for processing by the second-type idle resources is calculated based on the second idle resource information and the second pixel resource information of the second-type idle resources occupied by processing a single pixel.
[0142] According to one or more embodiments of the present disclosure, Example 7, according to the method of any one of Examples 1-4, determining the second number of pixels currently supported for processing by the target application based on the first number of pixels, includes:
[0143] A minimum value among the first pixel quantities is obtained as the second pixel quantity currently supported for processing by the target application.
[0144] According to one or more embodiments of the present disclosure, Example 8, according to the method of any one of Examples 1-4, wherein the pre-prompting image processing of the image to be processed based on the second number of pixels includes:
[0145] Displaying first pre-prompt information for the second number of pixels; and / or
[0146] Image processing prediction is performed based on the second number of pixels and the third number of pixels of the image to be processed, a prediction result is generated, and second pre-prompt information for the prediction result is displayed, wherein the prediction result indicates whether insufficient resources will occur when processing the image to be processed.
[0147] According to one or more embodiments of the present disclosure, Example 9 is a method according to any one of Examples 1-4, wherein the at least one idle resource includes idle native memory and / or idle virtual machine memory.
[0148] According to one or more embodiments of the present disclosure, Example 10 provides a prompting device for image processing, including:
[0149] a quantity acquisition module, configured to acquire a first number of pixels supported for processing by at least one idle resource of a target application;
[0150] a quantity determining module, configured to determine a second number of pixels currently supported for processing by the target application based on the first number of pixels;
[0151] A pre-prompt module is used to perform image processing pre-prompt on the image to be processed based on the second number of pixels.
[0152] According to one or more embodiments of the present disclosure, Example 11 provides an electronic device, including:
[0153] one or more processors;
[0154] a memory for storing one or more programs,
[0155] When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing hint method as described in any one of Examples 1-9.
[0156] According to one or more embodiments of the present disclosure, Example 12 provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image processing prompting method as described in any one of Examples 1-9.
[0157] According to one or more embodiments of the present disclosure, Example 13 provides a computer program product, which, when executed by a computer, enables the computer to implement the image processing prompting method as described in any one of Examples 1-9.
[0158] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0159] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0160] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A prompting method for image processing, characterized in that: include: Acquire a first number of pixels supported for processing by at least one idle resource of the target application; Determining, according to the first number of pixels, a second number of pixels currently supported for processing by the target application; Performing image processing pre-prompt on the image to be processed based on the second number of pixels.
2. The method according to claim 1, characterized in that The obtaining of a first number of pixels supported for processing by at least one idle resource of the target application includes: According to the system version information corresponding to the target application, a first number of pixels supported for processing by at least one idle resource of the target application is obtained.
3. The method according to claim 2, characterized in that The obtaining, according to the system version information corresponding to the target application, a first number of pixels supported for processing by at least one idle resource of the target application includes: In response to the system version information corresponding to the target application satisfying a preset condition, calculating, according to the first idle resource information of the first type of idle resources of the target application, a first number of pixels supported for processing by the first type of idle resources; or In response to the system version information corresponding to the target application satisfying a preset condition, the first number of pixels supported for processing by the first type of idle resources is calculated based on the first idle resource information of the target application; and the preset number of pixels corresponding to the second type of idle resources of the target application is obtained as the first number of pixels supported for processing by the second type of idle resources.
4. The method according to claim 2, characterized in that: The obtaining, according to the system version information corresponding to the target application, a first number of pixels supported for processing by at least one idle resource of the target application includes: In response to the system version information corresponding to the target application not satisfying a preset condition, the first number of pixels supported for processing by the first type of idle resources is calculated based on the first idle resource information of the first type of idle resources of the target application; and the first number of pixels supported for processing by the second type of idle resources of the target application is calculated based on the second idle resource information of the second type of idle resources.
5. The method according to claim 3 or 4, characterized in that: The calculating, according to the first idle resource information of the first type of idle resources of the target application, a first number of pixels supported for processing by the first type of idle resources includes: Calling a preset resource management object, and obtaining first idle resource information of a first type of idle resource of the target application through the preset resource management object; Determine, using a determination method corresponding to the system version information, first pixel resource information of the first type of idle resources occupied by a single pixel for processing; A first number of pixels supported for processing by the first-type idle resources is calculated according to the first idle resource information and the first pixel resource information.
6. The method according to claim 4, characterized in that The calculating, according to the second idle resource information of the second type of idle resources of the target application, the first number of pixels supported for processing by the second type of idle resources comprises: Acquire total resource information that can be applied, applied resource information, and unoccupied resource information corresponding to the second type of idle resources, wherein the unoccupied resource information is resource information of the applied and unoccupied second type of idle resources; Determine second idle resource information of the second type of idle resources according to the total resource information that can be applied, the applied resource information, and the unoccupied resource information; The number of second pixels supported for processing by the second type of idle resources is calculated based on the second idle resource information and the second pixel resource information of the second type of idle resources occupied by processing a single pixel.
7. The method according to any one of claims 1 to 4, characterized in that: The determining, according to the first number of pixels, the second number of pixels currently supported for processing by the target application includes: The minimum value of each of the first pixel quantities is obtained as the second pixel quantity currently supported for processing by the target application.
8. The method according to any one of claims 1 to 4, characterized in that: The pre-prompting of performing image processing on the image to be processed based on the second number of pixels includes: Displaying first pre-prompt information for the second number of pixels; and / or Image processing prediction is performed based on the second number of pixels and the third number of pixels of the image to be processed, a prediction result is generated, and second pre-prompt information for the prediction result is displayed, wherein the prediction result indicates whether insufficient resources will occur in processing the image to be processed.
9. The method according to any one of claims 1 to 4, characterized in that: The at least one idle resource includes idle native memory and / or idle virtual machine memory.
10. An image processing prompting device, characterized in that: include: A quantity acquisition module, used to acquire the first pixel quantity supported for processing by at least one idle resource of the target application; a quantity determination module, configured to determine, according to the first number of pixels, a second number of pixels currently supported for processing by the target application; A pre-prompt module is used to perform image processing pre-prompt on the image to be processed based on the second number of pixels.
11. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the image processing prompting method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image processing prompt method according to any one of claims 1 to 9 when executed.
13. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the image processing prompting method according to any one of claims 1 to 9.