CN113467906B - Picture processing method, device, equipment and storage medium - Google Patents
Picture processing method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN113467906B CN113467906B CN202110678523.1A CN202110678523A CN113467906B CN 113467906 B CN113467906 B CN 113467906B CN 202110678523 A CN202110678523 A CN 202110678523A CN 113467906 B CN113467906 B CN 113467906B
- Authority
- CN
- China
- Prior art keywords
- processing
- picture
- processed
- service processing
- pictures
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003860 storage Methods 0.000 title claims abstract description 19
- 238000003672 processing method Methods 0.000 title claims description 20
- 238000012545 processing Methods 0.000 claims abstract description 527
- 238000000034 method Methods 0.000 claims abstract description 63
- 230000000694 effects Effects 0.000 claims abstract description 10
- 230000002159 abnormal effect Effects 0.000 claims description 59
- 230000005856 abnormality Effects 0.000 claims description 37
- 238000005520 cutting process Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 11
- 238000012544 monitoring process Methods 0.000 claims description 8
- 230000002194 synthesizing effect Effects 0.000 claims description 3
- 230000015572 biosynthetic process Effects 0.000 claims 2
- 238000003786 synthesis reaction Methods 0.000 claims 2
- 230000000903 blocking effect Effects 0.000 abstract description 4
- 230000006870 function Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 5
- 238000001514 detection method Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 2
- 230000005484 gravity Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000005236 sound signal Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000012905 input function Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000000246 remedial effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000013515 script Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The present disclosure relates to a method, an apparatus, a device, and a storage medium for processing pictures, where the method uploads pictures to be processed to a queue to be processed according to an arrangement sequence of the pictures to be processed; under the condition that the preset service processing conditions are met is monitored, a preset number of pictures to be processed are read from a queue to be processed and are input into a service processing assembly, service processing is carried out through the service processing assembly, a corresponding picture processing result is obtained, and state information of the service processing assembly is updated after service processing; and outputting the picture processing result. Therefore, the whole picture processing process does not need to rely on a server, only needs to register a service processing component once, reduces the performance consumption of a browser, does not have the problem of page blocking during batch picture processing, and has high picture processing effect.
Description
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a method, a device, equipment and a storage medium for processing pictures.
Background
In web pages, picture processing requirements such as picture cropping, beautifying, special effects and the like often appear.
In the related art, on one hand, the picture processing logic runs in a background server, is heavily dependent on the server, and the picture processing is relatively costly and has a large stress on the server. In addition, the request of the picture processing interface is an asynchronous process, the transmission of the server and the browser has time difference, and a user needs longer waiting time between uploading the picture and acquiring the processed picture.
On the other hand, processing pictures is performed by JavaScript in a web page, however JavaScript runs in a single-thread mode in a browser, which cannot run multiple scripts at the same time, that is, processing of only a single picture is performed by JavaScript. Taking picture cropping as an example, when a user uses a picture cropping function on a web page, loading, cropping, exporting and the like of pictures can be carried out only one by one, and a cropping component needs to be registered every time when a single picture is cropped. In addition, since loading, clipping, etc. of pictures is an asynchronous process who generates and derives first, the order of outputting the picture results is uncertain, and it is difficult to capture the abnormal problems occurring in the clipping process.
Disclosure of Invention
The disclosure provides a method, a device, equipment and a storage medium for processing pictures, which at least solve at least one problem of low picture processing efficiency, delay, page blocking, uncertainty of picture processing sequence, difficulty in capturing and processing abnormality and the like in the related technology. The technical scheme of the present disclosure is as follows:
according to a first aspect of an embodiment of the present disclosure, there is provided a picture processing method, including:
Uploading the pictures to be processed to a queue to be processed according to the arrangement sequence of the pictures to be processed;
Under the condition that the state information of the to-be-processed queue and the service processing component meets the service processing condition is monitored, a preset number of to-be-processed pictures are read from the to-be-processed queue and are input into the service processing component, the service processing component is used for carrying out service processing on the input to-be-processed pictures to obtain corresponding picture processing results, and the state information of the service processing component is updated after the service processing;
and outputting the picture processing result.
As an optional implementation manner, the outputting the picture processing result includes:
Storing the picture processing result to a result queue according to the arrangement sequence of the pictures to be processed;
and outputting the picture processing result read from the result queue.
As an optional implementation manner, the reading a preset number of to-be-processed pictures from the to-be-processed queue and inputting the to-be-processed pictures to the service processing component includes:
Reading a preset number of pictures to be processed from the queue to be processed according to the sequence of the queue;
And inputting the read to-be-processed pictures into the service processing component, and removing the inputted to-be-processed pictures from the to-be-processed queue.
As an optional implementation manner, the performing, by the service processing component, service processing on the input to-be-processed picture, and obtaining a corresponding picture processing result includes:
Carrying out service processing on the input picture to be processed through the service processing component;
Capturing an abnormal picture to be processed corresponding to the abnormal business processing under the condition that the abnormal business processing is detected, and carrying out corresponding abnormal processing according to a preset abnormal processing strategy to obtain a corresponding picture processing result;
And under the condition that the service processing is detected to be normal, taking the picture after the service processing as the corresponding picture processing result.
As an optional implementation manner, in a case where the service processing includes cropping processing, the performing, by the service processing component, service processing on the input to-be-processed picture includes:
acquiring picture cutting parameter information of the picture to be processed, wherein the picture cutting parameter information comprises a target cutting size and a cutting starting point coordinate;
And drawing the picture to be processed to a canvas label according to the clipping starting point coordinates so as to carry out clipping processing, wherein the canvas size corresponding to the canvas label is the same as the target clipping size.
As an optional implementation manner, the performing the corresponding exception handling according to the preset exception handling policy, and obtaining the corresponding picture processing result includes:
Throwing out service processing abnormality information, wherein the service processing abnormality information comprises an abnormality identifier of an abnormality picture to be processed corresponding to the occurrence of service processing abnormality;
stopping the subsequent picture processing step, and sending prompt information carrying the abnormal identifier to a user; or generating an abnormal mark corresponding to the abnormal picture to be processed, and taking the abnormal mark as the corresponding picture processing result.
As an optional implementation manner, the preset service processing condition includes that a to-be-processed picture which is not input to the service processing component for service processing is stored in the to-be-processed queue, and state information of the service processing component is in an idle state;
The picture processing ending condition comprises at least one of executing service processing on the pictures to be processed in the queue to be processed, causing abnormality in the service processing process and interrupting the picture processing process.
According to a second aspect of the embodiments of the present disclosure, there is provided a picture processing apparatus including:
The uploading module is configured to execute uploading of the pictures to be processed to a queue to be processed according to the arrangement sequence of the pictures to be processed;
The processing module is configured to execute the steps of reading a preset number of pictures to be processed from the queues to be processed and inputting the pictures to be processed into the business processing assembly under the condition that the state information of the queues to be processed and the business processing assembly is monitored to meet business processing conditions; carrying out service processing on the input picture to be processed through the service processing component to obtain a corresponding picture processing result, and updating state information of the service processing component after service processing;
and the result output module is configured to output the picture processing result.
As an alternative embodiment, the result output module includes:
a storage unit configured to perform storing the picture processing result to a result queue according to the arrangement order of the pictures to be processed;
and the output unit is configured to execute output of the picture processing result read from the result queue.
As an alternative embodiment, the processing module includes:
the first processing submodule is configured to execute reading of a preset number of pictures to be processed from the queue to be processed according to the sequence of the queue;
And the second processing submodule is configured to input the read to-be-processed pictures to the service processing component and remove the already-input to-be-processed pictures from the to-be-processed queue.
As an alternative embodiment, the processing module includes:
the third processing sub-module is configured to execute business processing on the input picture to be processed through the business processing component;
The fourth processing sub-module is configured to capture an abnormal picture to be processed corresponding to the abnormal business processing under the condition that the abnormal business processing is detected, and perform corresponding abnormal processing according to a preset abnormal processing strategy to obtain a corresponding picture processing result;
And the fifth processing sub-module is configured to execute the picture after the business processing as the corresponding picture processing result under the condition that the business processing is detected to be normal.
As an alternative embodiment, in the case that the business process includes a clipping process, the third processing sub-module includes:
An acquisition unit configured to perform acquisition of picture cropping parameter information of the picture to be processed, the picture cropping parameter information including a target cropping size and cropping start point coordinates;
And the first processing unit is configured to draw the picture to be processed to a canvas tag according to the clipping start point coordinates so as to carry out clipping processing, and the canvas size corresponding to the canvas tag is the same as the target clipping size.
As an alternative embodiment, the root fourth processing sub-module includes:
the system comprises a throwing unit, a service processing unit and a processing unit, wherein the throwing unit is configured to execute throwing service processing exception information, and the service processing exception information comprises an exception identifier of an exception picture to be processed corresponding to the occurrence of service processing exception;
The second processing unit is configured to execute the step of stopping the subsequent picture processing and send the prompt information carrying the abnormal identifier to the user; or generating an abnormal mark corresponding to the abnormal picture to be processed, and taking the abnormal mark as the corresponding picture processing result.
As an optional implementation manner, the preset service processing condition includes that a to-be-processed picture which is not input to the service processing component for service processing is stored in the to-be-processed queue, and state information of the service processing component is in an idle state;
The picture processing ending condition comprises at least one of executing service processing on the pictures to be processed in the queue to be processed, causing abnormality in the service processing process and interrupting the picture processing process.
According to a third aspect of embodiments of the present disclosure, there is provided a computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the picture processing method as described in any one of the above embodiments.
According to a fourth aspect of embodiments of the present disclosure, there is provided an electronic device, comprising:
A processor;
A memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the picture processing method according to any of the above embodiments.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the picture processing method provided in any one of the embodiments described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
According to the embodiment of the disclosure, the pictures to be processed are uploaded to a queue to be processed according to the arrangement sequence of the pictures to be processed; under the condition that the state information of the to-be-processed queue and the service processing component meets the preset service processing condition is monitored, a preset number of to-be-processed pictures are read from the to-be-processed queue and are input into the service processing component, the service processing component is used for carrying out service processing on the input to-be-processed pictures to obtain corresponding picture processing results, and the state information of the service processing component is updated after the service processing; and outputting the picture processing result. Therefore, the whole picture processing process can be executed at the web end, the picture processing is not needed to be carried out by a server, the processing pressure of the server is reduced, the time difference of picture transmission of a server interface does not exist, and the delay is low. In addition, by setting the queue to be processed, and updating the state information of the business processing assembly after the business processing assembly executes business processing once, only one registration of the business processing assembly is needed in the whole image processing process, so that the browser performance consumption is reduced, the problem of page blocking does not exist during batch picture processing, and the picture processing effect is high.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this disclosure, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
Fig. 1 is a flowchart illustrating a picture processing method according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating steps of a business process according to an exemplary embodiment.
Fig. 3 is a flow chart illustrating a picture processing result output according to an exemplary embodiment.
Fig. 4 is an overall flowchart illustrating a picture processing method according to an exemplary embodiment.
Fig. 5 is a block diagram of a picture processing device according to an exemplary embodiment.
Fig. 6 is a block diagram of a picture processing device according to an exemplary embodiment.
Fig. 7 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
Fig. 1 is a flowchart illustrating a picture processing method according to an exemplary embodiment. The picture processing method can be applied to terminal equipment, and the terminal equipment can be, but is not limited to, one or more of entity equipment such as smart phones, tablet computers, notebook computers, desktop computers, intelligent sound boxes, intelligent wearable equipment, digital assistants, augmented reality equipment, virtual reality equipment and the like, or application programs and applets running in the entity equipment. As shown in fig. 1, the picture processing method includes the following steps.
In step S101, according to the arrangement sequence of the pictures to be processed, uploading the pictures to be processed to a queue to be processed.
The queue to be processed is used for storing the pictures to be processed. The queue to be processed is a data structure having a first-in first-out characteristic. The pictures to be processed in the queue to be processed are arranged according to the uploading sequence, that is, the queue to be processed is a queue in which the pictures to be processed are arranged according to the first-in first-out sequence.
In practical applications, the image data to be processed including a plurality of images to be processed (such as img1, img2, img3, etc.) may be acquired first, where the acquisition modes include, but are not limited to, shooting, scanning, downloading, recording, etc., and then the image data to be processed is uploaded through the web end, so that the web end acquires the image to be processed, and a subsequent image processing process is performed on the web end.
The picture data may specifically be a picture set, a picture stream, or the like. The picture set may be a plurality of pictures obtained by shooting, scanning, downloading, etc. The picture stream may be a continuous video frame picture obtained by shooting, recording, downloading, etc. The task type corresponding to the task processing can be expression package making, special effect processing and the like. Each task type may correspond to at least one business process, which may include, but is not limited to, at least one of cropping, beautifying, special effects, matting, and the like.
Each picture to be processed has its particular ordering order in the picture data. For example, for the image collection, the images may be sorted according to the sequence of the time stamps of the images, or may be sorted according to the names of the images, the sizes of the images, and the like. For the picture stream, the arrangement sequence of the pictures to be processed may be the time stamp sequence of the pictures of each frame. The picture types of the respective pictures to be processed may be the same or different, and this disclosure is not particularly limited.
Alternatively, after obtaining the pictures to be processed, the pictures to be processed may be uploaded to the queue to be processed through the uploading component according to the arrangement sequence of the pictures to be processed in the picture data first in response to the execution of the task of service processing, without directly executing the service processing of the pictures to be processed. In the queue to be processed, each picture to be processed has a corresponding arrangement position identifier, and the arrangement position identifiers can be in one-to-one correspondence with the picture identifiers of the pictures to be processed, that is, the corresponding pictures to be processed can be obtained through the arrangement position identifiers. The permutation location identifier may be an index value.
At least one pending queue may be set for different traffic types. Each of the pending queues may correspond to a different traffic type, respectively, and each of the pending queues may correspond to at least one traffic handling component. Taking the clipping service as an example, the corresponding queue to be processed is the queue to be clipped, and the corresponding service processing component is the clipping component. Of course, a plurality of different traffic types may also share a pending queue.
In step S103, when it is monitored that the state information of the queue to be processed and the service processing component meets the service processing condition, a preset number of pictures to be processed are read from the queue to be processed and input to the service processing component, the service processing component performs service processing on the input pictures to be processed to obtain a corresponding picture processing result, and the state information of the service processing component is updated after service processing.
Optionally, when at least one picture to be processed in the picture data is uploaded to the queue to be processed, a monitoring thread in the browser may be triggered to start working. The monitoring thread is used for executing general checking logic to monitor whether the state information of the queue to be processed and the registered business processing component meets the preset business processing condition.
By way of example only, the service processing condition may include that a to-be-processed picture that is not input to the service processing component for service processing is stored in the to-be-processed queue, and state information of the service processing component is in an idle state. At this time, the snoop thread may specifically perform: monitoring whether a to-be-processed picture which is not input to the service processing component for service processing is stored in a to-be-processed queue or not, and monitoring whether state information of the service processing component is in an idle state or not. Under the condition that the state information of the to-be-processed queue and the service processing component meets the service processing condition is monitored, a preset number of to-be-processed pictures can be read from the to-be-processed queue and input into the service processing component, so that the service processing component can conveniently process the input to-be-processed pictures. The preset number M may be at least a value smaller than 1/2 of the total number of all the pictures to be processed in the picture data, or may be even a lower value. And then, carrying out service processing on the input picture to be processed through the service processing component to obtain a corresponding picture processing result, and updating the state information of the service processing component after the service processing.
The service processing component may be a service processing component which has been registered in advance, or may be a service processing component which has been registered before the browser performs the first data exchange with the service processing component. The business process component may only need to register once throughout the picture processing.
In an optional embodiment, the reading a preset number of pictures to be processed from the queue to be processed and inputting the pictures to the service processing component includes: reading a preset number of pictures to be processed from the queue to be processed according to the sequence of the queue; and inputting the read to-be-processed pictures into the service processing component, and removing the inputted to-be-processed pictures from the to-be-processed queue.
The queue sequence is used for representing the arrangement sequence of the pictures to be processed in the queue to be processed. As shown in fig. 4, the queue order is img1, img2, img3. When the input step is executed, taking a preset number as an example, in accordance with the queue sequence, img1 in the queue to be processed is input into the service processing component to perform service processing on the img1 in the service processing component, after img1 is input into the service processing component, the input picture to be processed (such as img 1) can be removed from the queue to be processed, and at this time, the picture to be processed in the queue to be processed can be updated to img2 and img3.
Of course, in other embodiments, the queue to be processed may be notified to input a picture to be processed to the service processing component according to the queue order, the step of removing the picture to be processed that has been input from the queue to be processed may not be continuously performed, but the arrangement position number n of the picture to be processed that is currently input to the service processing component may be recorded, where n is a positive integer, or the picture to be processed that has been input to the service processing component may be marked, so that when a picture to be processed needs to be input next time, a picture to be processed corresponding to the arrangement position number n+1 may be input, or a first unmarked picture to be processed that is ordered earlier may be input.
Optionally, the service processing component determines according to a service type corresponding to the service processing. For example, if the service type is a clipping service, the corresponding service processing component is a clipping component.
Before the service processing component performs service processing, the service processing component is in an idle state, that is, the service processing component does not perform service processing on other pictures. When the service processing component receives the input picture to be processed, the working state can be started, and corresponding service processing (such as clipping processing) is performed on the input picture to be processed, so that a corresponding picture processing result is obtained. The picture processing result may include any one of a cut picture, cut abnormality information, and the like. After the service processing is performed on the input picture to be processed, the working state of the service processing component can be closed, that is, the state information of the service processing component is adjusted from the working state to the idle state.
In an alternative embodiment, as shown in fig. 2, the performing, by the service processing component, service processing on the input to-be-processed picture, to obtain a corresponding picture processing result may include:
In step S201, the service processing component performs service processing on the input picture to be processed.
Optionally, after the service processing component receives the picture to be processed, a corresponding service processing task is started, and a corresponding service processing task can be executed according to the acquired service processing parameter. The service processing parameters include service processing parameter information, service processing object information, and the like.
By way of example only, the business process parameter information is used to indicate the content of parameters that need to be performed on the object to be processed, which may include business process dimensions, business process location coordinates, and so forth. And carrying out corresponding service processing tasks on the picture to be processed according to the service processing parameter information.
The business process object information is used to indicate a target object that needs to be processed, which may be, for example, a whole body image of a person, a head image of a person, a body part of a person (e.g., hands, eyes, etc.), or the like. And identifying a target object in the picture to be processed through the service processing object information, and further executing a corresponding service processing task on the identified target object.
For example, in a case where the service processing includes cropping, the performing, by the service processing component, the service processing on the input to-be-processed picture may include: acquiring picture cutting parameter information of the picture to be processed, wherein the picture cutting parameter information comprises a target cutting size and a cutting starting point coordinate; and drawing the picture to be processed to a canvas label according to the clipping starting point coordinates so as to carry out clipping processing, wherein the canvas size corresponding to the canvas label is the same as the target clipping size.
The target clipping size comprises information such as width, height, shape, pixels and the like of the clipped picture. For different pictures to be processed, the corresponding target clipping sizes can be the same or different.
The clipping start point coordinate may be a position coordinate of a pixel point of the clipped picture, for example, but not limited to, a position coordinate corresponding to an upper left corner, a position coordinate corresponding to an upper right corner, a position coordinate corresponding to a lower left corner, a position coordinate corresponding to a lower right corner, a position coordinate corresponding to a center point of the picture, and the like of the clipped picture.
Canvas tags are used to crop the picture to be processed, which may be, but are not limited to, canvas tags, for example. Wherein the Canvas tag is a tag in the HTML5 standard, and a drawing Application Programming Interface (API) provided by the Canvas tag can directly call resources in the picture processing unit. The Canvas tag is a container for drawing an image, and can read the content of the image into the container, and can reach the requirements of operating the width, the height, the definition and the like of the image by operating each pixel point in the image, and finally, a new image is output.
In practical application, taking Canvas labels as examples, after obtaining the picture cutting parameter information of the picture to be processed, the picture cutting parameter information comprises target cutting size and cutting starting point coordinates; and drawing the picture to be processed to a Canvas label according to the clipping starting point coordinates (x, y), and drawing the picture to be processed to the Canvas label, namely executing clipping processing on the picture to be processed, because the Canvas size corresponding to the Canvas label is the same as the target clipping size.
In step S202, capturing an abnormal to-be-processed picture corresponding to the occurrence of the service processing abnormality under the condition that the service processing abnormality is detected, and performing corresponding abnormal processing according to a preset abnormal processing policy to obtain a corresponding picture processing result.
The exception handling policy may be a customized policy that the developer performs on the exception. Continuing to show in fig. 4, according to the difference of the exception handling policies, the performing corresponding exception handling according to the preset exception handling policy, and obtaining the corresponding picture handling result may include the following two handling methods:
The first processing manner, performing corresponding exception handling according to a preset exception handling policy, and obtaining a corresponding picture processing result may include:
In step S2021, service processing abnormality information is thrown out, where the service processing abnormality information includes an abnormality identifier of an abnormality to-be-processed picture corresponding to occurrence of service processing abnormality;
in step S2022, the subsequent picture processing steps are stopped, and the prompt message carrying the anomaly identification is sent to the user.
In practical application, under the condition that the abnormal business processing is detected, the abnormal business processing information can be thrown out, so that developers can intercept and capture the abnormal information. And then, executing a first exception handling strategy, namely stopping the subsequent picture handling step, and sending an exception identifier carrying an exception picture to be handled corresponding to the occurrence of the business handling exception to the user, wherein the exception identifier can correspond to the picture identifier of the picture to be handled, so that the user can quickly know which picture to be handled in the picture data is the exception picture to be handled according to the exception identifier, and further, the user can conveniently execute corresponding remedial measures, such as uploading the exception picture to be handled again, replacing the exception picture to be handled, and the like.
The second processing manner, performing corresponding exception processing according to a preset exception processing policy, and obtaining a corresponding picture processing result may include:
In step S2021', the service processing abnormality information is thrown out, where the service processing abnormality information includes an abnormality identifier of an abnormality to-be-processed picture corresponding to the occurrence of the service processing abnormality;
In step S2022', an anomaly flag corresponding to the image to be processed is generated, and the anomaly flag is used as the corresponding image processing result.
In practical application, under the condition that the abnormal business processing is detected, the abnormal business processing information can be thrown out, so that developers can intercept and capture the abnormal information. Then, a second exception handling policy may be executed, that is, an exception flag corresponding to the exception pending picture is generated, and the exception flag is used as the corresponding picture handling result. Illustratively, the anomaly flag may be a placeholder.
In step S203, when it is detected that the service processing is normal, the picture after the service processing is used as the corresponding picture processing result.
Optionally, under the condition that the service processing is detected to be normal, the picture after the service processing can be used as the corresponding picture processing result and output.
In practical application, the foregoing corresponding exception handling according to the preset exception handling policy may be implemented by a callback function, where a pseudo code of the callback function may be as follows:
According to the embodiment, the business processing assembly can process one piece of the pictures to be processed, the abnormality occurs in the business processing process, the abnormality corresponding to the picture to be processed can be captured in time, and the follow-up targeted abnormality solving can be conducted in time. In addition, under the condition that the service processing abnormality is detected, corresponding abnormality processing is carried out according to a preset abnormality processing strategy, customized abnormality processing can be realized, the picture processing process is flexible, and different application scene requirements can be met.
Reading a preset number of pictures to be processed from the queues to be processed after the execution of the pictures to be processed, inputting the pictures to be processed into the service processing assembly, carrying out service processing on the inputted pictures to be processed through the service processing assembly to obtain corresponding picture processing results, and continuing to monitor whether the state information of the queues to be processed and the service processing assembly meet service processing conditions or not after updating the state information of the service processing assembly after the service processing; and if the state information of the queue to be processed and the service processing component is monitored to meet the service processing condition, repeating the step of inputting the state information into the service processing component, and the step of obtaining the picture processing result and updating the state information of the service processing component until the picture processing ending condition is reached.
The picture processing ending condition comprises at least one of executing service processing on the pictures to be processed in the queue to be processed, causing abnormality in the service processing process and interrupting the picture processing process.
Optionally, in the case of obtaining the picture processing result, the listening thread may be triggered to start working. Under the condition that the monitoring thread monitors that the state information of the to-be-processed queue and the service processing component meets the preset service processing condition, continuing to inform the to-be-processed queue to input a preset number of to-be-processed pictures to the service processing component, carrying out service processing on the input to-be-processed pictures through the service processing component to obtain corresponding picture processing results, updating the state information of the service processing component after service processing, namely repeatedly executing the step of inputting to the service processing component, and the processing step of obtaining the picture processing results and updating the state information of the service processing component, and realizing the next round of picture processing process until the picture processing ending condition is reached.
In step S105, the picture processing result is output.
It should be noted that, the step of outputting the picture processing result may be to output after each round of the picture processing process in step S103 is executed, that is, the picture processing result corresponding to each round of the processed picture may be sequentially output, and it is not necessary to output all the picture processing results in a unified manner after the picture processing end condition is reached.
In an alternative embodiment, as shown in fig. 3, the outputting the picture processing result may include:
In step S301, the picture processing result is stored in a result queue according to the arrangement order of the pictures to be processed.
The result queue is used for storing picture processing results, namely, cut pictures, pictures after special effects, pictures after beautification and the like. The result queue is also a data structure that has a first-in first-out characteristic. The pictures to be processed in the result queue are arranged according to the sequence of the picture processing results output by the service processing component, that is, the result queue is a queue in which the picture processing results are arranged according to the first-in first-out sequence.
Optionally, if in the process of processing the picture, for the picture to be processed in which no abnormal service processing occurs, the picture processing result (for example imgDate (from img 1), imgDate (from img 2), imgDate (from img 3) shown in fig. 4) may be stored in the corresponding queue position in the result queue according to the arrangement order of the picture to be processed, that is, the output order of the picture processing result corresponding to the service processing component. For a picture to be processed with abnormal business processing, an abnormal mark (such as a placeholder) can be recorded at a queue position corresponding to the picture to be processed with abnormal business processing.
In step S302, the result of the picture processing read from the result queue is output.
Alternatively, the picture processing result may be read from the result queue through onSuccess () function and output.
According to the embodiment, the image processing results are stored in sequence by setting the result queue, and the images to be processed are stored in sequence by matching with the queue to be processed, so that the images can be ensured to be output in sequence, the subsequent processed images can be directly subjected to further processing steps according to the sequence, the re-ordering steps are reduced, and particularly, under the condition that the number of the images to be processed is large, the workload of the image processing process is greatly reduced, and the image processing efficiency is improved.
According to the embodiment of the disclosure, the picture data to be processed are obtained, and the picture data comprise a plurality of pictures to be processed; uploading the pictures to be processed to a queue to be processed according to the arrangement sequence of the pictures to be processed in the picture data; under the condition that the state information of the to-be-processed queue and the service processing component meets the preset service processing condition is monitored, the to-be-processed queue is informed to input a preset number of to-be-processed pictures to the service processing component; carrying out service processing on the input picture to be processed through the service processing component to obtain a corresponding picture processing result, and updating state information of the service processing component after service processing; repeatedly executing the input step and the business processing step until reaching the picture processing ending condition; and outputting a picture processing result corresponding to the picture data. Therefore, the whole picture processing process can be executed at the web end, the picture processing is not needed to be carried out by a server, the processing pressure of the server is reduced, the time difference of picture transmission of a server interface does not exist, and the delay is low. In addition, by setting the queue to be processed, and updating the state information of the business processing assembly after the business processing assembly executes business processing once, only one registration of the business processing assembly is needed in the whole image processing process, so that the browser performance consumption is reduced, the problem of page blocking does not exist during batch picture processing, and the picture processing effect is high.
In an alternative embodiment, the picture processing method may further include:
And synthesizing the output picture processing result according to the task type to obtain synthesized picture processing data.
The task types may include expression pack production, special effect processing, and the like, among others.
In practical application, taking expression package manufacturing as an example, after processing the picture data to be processed, which is uploaded to the web end by the user, a picture processing result is obtained. And then, synthesizing the picture processing results corresponding to the outputted pictures to be processed according to the attribute of the expression package, so as to obtain synthesized picture processing data, namely, the expression package after manufacture.
According to the embodiment, the picture processing results are sequentially output, and the output sequence is deterministic, so that the output picture processing results can be directly subjected to expression package one-key manufacturing, extra sorting is not needed, processing steps of expression package manufacturing are reduced, the use is convenient, and the overall picture processing efficiency is improved.
Fig. 5 is a block diagram of a picture processing device according to an exemplary embodiment. Referring to fig. 5, the apparatus is applied to an electronic device, including:
An uploading module 510 configured to execute uploading the pictures to be processed to a queue to be processed according to the arrangement order of the pictures to be processed;
A processing module 520 configured to perform reading a preset number of pictures to be processed from the queue to be processed and inputting the pictures to the service processing component when the state information of the queue to be processed and the service processing component is monitored to meet a service processing condition; carrying out service processing on the input picture to be processed through the service processing component to obtain a corresponding picture processing result, and updating state information of the service processing component after service processing;
and a result output module 530 configured to perform outputting the picture processing result.
As an alternative embodiment, as shown in fig. 6, the result output module 530 includes:
a storage unit 531 configured to perform storing the picture processing result to a result queue according to the arrangement order of the pictures to be processed;
an output unit 532 configured to perform output of the picture processing result read from the result queue.
As an alternative embodiment, the processing module 520 includes:
the first processing submodule is configured to execute reading of a preset number of pictures to be processed from the queue to be processed according to the sequence of the queue;
And the second processing submodule is configured to input the read to-be-processed pictures to the service processing component and remove the already-input to-be-processed pictures from the to-be-processed queue.
As an alternative embodiment, the processing module 520 includes:
the third processing sub-module is configured to execute business processing on the input picture to be processed through the business processing component;
The fourth processing sub-module is configured to capture an abnormal picture to be processed corresponding to the abnormal business processing under the condition that the abnormal business processing is detected, and perform corresponding abnormal processing according to a preset abnormal processing strategy to obtain a corresponding picture processing result;
And the fifth processing sub-module is configured to execute the picture after the business processing as the corresponding picture processing result under the condition that the business processing is detected to be normal.
As an alternative embodiment, in the case that the business process includes a clipping process, the third processing sub-module includes:
An acquisition unit configured to perform acquisition of picture cropping parameter information of the picture to be processed, the picture cropping parameter information including a target cropping size and cropping start point coordinates;
And the first processing unit is configured to draw the picture to be processed to a canvas tag according to the clipping start point coordinates so as to carry out clipping processing, and the canvas size corresponding to the canvas tag is the same as the target clipping size.
As an alternative embodiment, the root fourth processing sub-module includes:
the system comprises a throwing unit, a service processing unit and a processing unit, wherein the throwing unit is configured to execute throwing service processing exception information, and the service processing exception information comprises an exception identifier of an exception picture to be processed corresponding to the occurrence of service processing exception;
The second processing unit is configured to execute the step of stopping the subsequent picture processing and send the prompt information carrying the abnormal identifier to the user; or generating an abnormal mark corresponding to the abnormal picture to be processed, and taking the abnormal mark as the corresponding picture processing result.
As an optional implementation manner, the preset service processing condition includes that a to-be-processed picture which is not input to the service processing component for service processing is stored in the to-be-processed queue, and state information of the service processing component is in an idle state;
The picture processing ending condition comprises at least one of executing service processing on the pictures to be processed in the queue to be processed, causing abnormality in the service processing process and interrupting the picture processing process.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 7 is a block diagram of an electronic device, according to an example embodiment. Referring to fig. 7, the electronic device includes a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of any of the picture processing methods of the above embodiments when executing instructions stored on the memory.
The electronic device may be a terminal, a server or a similar computing device, taking the electronic device as an example of a terminal, fig. 7 is a block diagram of an electronic device for picture processing, specifically:
The terminal can include RF (Radio Frequency) circuitry 710, memory 720 including one or more computer-readable storage media, input unit 730, display unit 740, sensor 750, audio circuitry 760, wiFi (WIRELESS FIDELITY ) module 770, processor 780 including one or more processing cores, and power supply 790, among other components. It will be appreciated by those skilled in the art that the terminal structure shown in fig. 7 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
The RF circuit 710 may be used for receiving and transmitting signals during a message or a call, and in particular, after receiving downlink information of a base station, the downlink information is processed by one or more processors 780; in addition, data relating to uplink is transmitted to the base station. Typically, RF circuitry 710 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier ), a duplexer, and the like. In addition, the RF circuit 710 may also communicate with networks and other terminals through wireless communication. The wireless communication may use any communication standard or protocol including, but not limited to, GSM (Global System of Mobile communication, global system for mobile communications), GPRS (GENERAL PACKET Radio Service), CDMA (Code Division Multiple Access ), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), LTE (Long Term Evolution ), email, SMS (Short MESSAGING SERVICE, short message Service), etc.
The memory 720 may be used to store software programs and modules, and the processor 780 may perform various functional applications and data processing by executing the software programs and modules stored in the memory 720. The memory 720 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for functions, and the like; the storage data area may store data created according to the use of the terminal, etc. In addition, memory 720 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory 720 may also include a memory controller to provide access to memory 720 by processor 780 and input unit 730.
The input unit 730 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 730 may include a touch-sensitive surface 731 and other input devices 732. The touch-sensitive surface 731, also referred to as a touch display screen or touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on or thereabout the touch-sensitive surface 731 using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection device according to a pre-set program. Alternatively, touch-sensitive surface 731 may comprise two parts, a touch-detecting device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 780, and can receive commands from the processor 780 and execute them. In addition, the touch sensitive surface 731 may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 731, the input unit 730 may also include other input devices 732. In particular, the other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 740 may be used to display information input by a user or information provided to the user and various graphic user interfaces of the terminal, which may be composed of graphics, text, icons, video, and any combination thereof. The display unit 740 may include a display panel 741, and optionally, the display panel 741 may be configured in the form of an LCD (Liquid CRYSTAL DISPLAY), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 731 may overlay the display panel 741, and upon detection of a touch operation thereon or thereabout by the touch-sensitive surface 731, the touch-sensitive surface 731 is passed to the processor 780 for determining the type of touch event, and the processor 780 then provides a corresponding visual output on the display panel 741 based on the type of touch event. Wherein the touch-sensitive surface 731 and the display panel 741 may be two separate components for input and input functions, but in some embodiments the touch-sensitive surface 731 may be integrated with the display panel 741 for input and output functions.
The terminal may also include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. In particular, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 741 according to the brightness of ambient light and a proximity sensor that may turn off the display panel 741 and/or the backlight when the terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the device is stationary, and the device can be used for applications of recognizing the gesture of a terminal (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may be configured for the terminal are not described in detail herein.
Audio circuitry 760, speaker 761, microphone 762 may provide an audio interface between a user and the terminal. The audio circuit 760 may transmit the received electrical signal converted from audio data to the speaker 761, and the electrical signal is converted into a sound signal by the speaker 761 to be output; on the other hand, microphone 762 converts the collected sound signals into electrical signals, which are received by audio circuit 760 and converted into audio data, which are processed by audio data output processor 780 for transmission to, for example, another terminal via RF circuit 710, or which are output to memory 720 for further processing. Audio circuitry 760 may also include an ear bud jack to provide communication between a peripheral ear bud and the terminal.
WiFi belongs to a short-distance wireless transmission technology, and the terminal can help a user to send and receive e-mails, browse web pages, access streaming media and the like through the WiFi module 770, so that wireless broadband Internet access is provided for the user. Although fig. 7 shows a WiFi module 770, it is understood that it does not belong to the essential constitution of the terminal, and may be omitted entirely as needed within the scope of not changing the essence of the invention.
The processor 780 is a control center of the terminal, connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the terminal and processes data by running or executing software programs and/or modules stored in the memory 720 and calling data stored in the memory 720, thereby performing overall monitoring of the terminal. Optionally, the processor 780 may include one or more processing cores; preferably, the processor 780 may integrate an application processor that primarily processes operating systems, user interfaces, applications, etc., with a modem processor that primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 780.
The terminal also includes a power supply 790 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 780 through a power management system, such as to provide for the management of charge, discharge, and power consumption by the power management system. Power supply 790 may also include one or more of any components, such as a dc or ac power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal may further include a camera, a bluetooth module, etc., which will not be described herein. In particular, in this embodiment, the terminal further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors. The one or more programs include instructions for performing the virtual resource retrieval method provided by the method embodiments described above.
In an exemplary embodiment, a computer storage medium is also provided, which, when executed by a processor of an electronic device, enables the electronic device to perform the steps of the method provided in any one of the implementations described above.
In an exemplary embodiment, a computer program product is also provided, comprising a computer program/instruction which, when executed by a processor, implements the method provided in any of the above-mentioned implementations. Optionally, the computer program is stored in a computer readable storage medium. The processor of the electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program so that the electronic device performs the method provided in any one of the above embodiments.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SYNCHLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (15)
1. A picture processing method, applied to a terminal device, comprising:
Uploading the pictures to be processed to a queue to be processed according to the arrangement sequence of the pictures to be processed;
Under the condition that a monitoring thread of a browser monitors that state information of the to-be-processed queue and the service processing component meets service processing conditions, a preset number of to-be-processed pictures are read from the to-be-processed queue and input into the service processing component, the service processing component performs service processing on the input to-be-processed pictures to obtain corresponding picture processing results, and the state information of the service processing component is updated after each round of service processing; in each round of business processing, the business processing component registers once;
according to the arrangement sequence of the pictures to be processed, storing respective picture processing results in the multi-round business processing process into a result queue;
outputting a picture processing result read from the result queue;
According to the task type, carrying out one-key synthesis processing on the output picture processing result to obtain synthesized picture processing data; the task type comprises any one of expression package making and picture special effect processing, and the business processing component is matched with the task type.
2. The picture processing method according to claim 1, wherein the reading a preset number of pictures to be processed from the queue to be processed and inputting the pictures to the service processing component includes:
Reading a preset number of pictures to be processed from the queue to be processed according to the sequence of the queue;
And inputting the read to-be-processed pictures into the service processing component, and removing the inputted to-be-processed pictures from the to-be-processed queue.
3. The method for processing a picture according to any one of claims 1-2, wherein the performing, by the service processing component, service processing on the input picture to be processed, to obtain a corresponding picture processing result includes:
Carrying out service processing on the input picture to be processed through the service processing component;
Capturing an abnormal picture to be processed corresponding to the abnormal business processing under the condition that the abnormal business processing is detected, and carrying out corresponding abnormal processing according to a preset abnormal processing strategy to obtain a corresponding picture processing result;
And under the condition that the service processing is detected to be normal, taking the picture after the service processing as the corresponding picture processing result.
4. A picture processing method as claimed in claim 3, wherein, in the case where the service processing comprises cropping processing, the service processing of the input picture to be processed by the service processing component comprises:
acquiring picture cutting parameter information of the picture to be processed, wherein the picture cutting parameter information comprises a target cutting size and a cutting starting point coordinate;
And drawing the picture to be processed to a canvas label according to the clipping starting point coordinates so as to carry out clipping processing, wherein the canvas size corresponding to the canvas label is the same as the target clipping size.
5. The method for processing a picture according to claim 3, wherein the performing the corresponding exception processing according to the preset exception processing policy, and obtaining the corresponding picture processing result comprises:
Throwing out service processing abnormality information, wherein the service processing abnormality information comprises an abnormality identifier of an abnormality picture to be processed corresponding to the occurrence of service processing abnormality;
stopping the subsequent picture processing step, and sending prompt information carrying the abnormal identifier to a user; or generating an abnormal mark corresponding to the abnormal picture to be processed, and taking the abnormal mark as the corresponding picture processing result.
6. The picture processing method according to any one of claims 1 to 2, wherein the service processing condition includes that a to-be-processed picture which is not input to the service processing component for service processing is stored in the to-be-processed queue, and state information of the service processing component is in an idle state;
The picture processing ending condition comprises at least one of executing service processing on the pictures to be processed in the queue to be processed, causing abnormality in the service processing process and interrupting the picture processing process.
7. A picture processing apparatus, characterized by being applied to a terminal device, comprising:
The uploading module is configured to execute uploading of the pictures to be processed to a queue to be processed according to the arrangement sequence of the pictures to be processed;
The processing module is configured to execute the steps of reading a preset number of pictures to be processed from the queues to be processed and inputting the pictures to be processed into the service processing assembly when the monitoring thread of the browser monitors that the state information of the queues to be processed and the service processing assembly meets the service processing conditions; carrying out service processing on an input picture to be processed through the service processing assembly to obtain a corresponding picture processing result, and updating state information of the service processing assembly after each round of service processing; in each round of business processing, the business processing component registers once;
The result output module is configured to execute the steps of storing respective picture processing results in a plurality of rounds of business processing processes into a result queue according to the arrangement sequence of the pictures to be processed; outputting the picture processing result read from the result queue;
the synthesizing module is configured to execute one-key synthesis processing on the output picture processing result according to the task type to obtain synthesized picture processing data; the task type comprises any one of expression package making and picture special effect processing, and the business processing component is matched with the task type.
8. The picture processing device as claimed in claim 7, wherein the processing module comprises:
the first processing submodule is configured to execute reading of a preset number of pictures to be processed from the queue to be processed according to the sequence of the queue;
And the second processing submodule is configured to input the read to-be-processed pictures to the service processing component and remove the already-input to-be-processed pictures from the to-be-processed queue.
9. The picture processing apparatus according to any one of claims 7-8, wherein the processing module comprises:
the third processing sub-module is configured to execute business processing on the input picture to be processed through the business processing component;
The fourth processing sub-module is configured to capture an abnormal picture to be processed corresponding to the abnormal business processing under the condition that the abnormal business processing is detected, and perform corresponding abnormal processing according to a preset abnormal processing strategy to obtain a corresponding picture processing result;
And the fifth processing sub-module is configured to execute the picture after the business processing as the corresponding picture processing result under the condition that the business processing is detected to be normal.
10. The picture processing apparatus according to claim 9, wherein in a case where the business process includes a cropping process, the third processing sub-module includes:
An acquisition unit configured to perform acquisition of picture cropping parameter information of the picture to be processed, the picture cropping parameter information including a target cropping size and cropping start point coordinates;
And the first processing unit is configured to draw the picture to be processed to a canvas tag according to the clipping start point coordinates so as to carry out clipping processing, and the canvas size corresponding to the canvas tag is the same as the target clipping size.
11. The picture processing device of claim 9, wherein the fourth processing sub-module comprises:
the system comprises a throwing unit, a service processing unit and a processing unit, wherein the throwing unit is configured to execute throwing service processing exception information, and the service processing exception information comprises an exception identifier of an exception picture to be processed corresponding to the occurrence of service processing exception;
The second processing unit is configured to execute the step of stopping the subsequent picture processing and send the prompt information carrying the abnormal identifier to the user; or generating an abnormal mark corresponding to the abnormal picture to be processed, and taking the abnormal mark as the corresponding picture processing result.
12. The apparatus according to any one of claims 7 to 8, wherein the service processing condition includes that a to-be-processed picture which is not input to the service processing component for service processing is stored in the to-be-processed queue, and state information of the service processing component is in an idle state;
The picture processing ending condition comprises at least one of executing service processing on the pictures to be processed in the queue to be processed, causing abnormality in the service processing process and interrupting the picture processing process.
13. An electronic device, comprising:
A processor;
A memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the picture processing method of any one of claims 1 to 6.
14. A computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the picture processing method of any one of claims 1 to 6.
15. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the picture processing method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110678523.1A CN113467906B (en) | 2021-06-18 | 2021-06-18 | Picture processing method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110678523.1A CN113467906B (en) | 2021-06-18 | 2021-06-18 | Picture processing method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113467906A CN113467906A (en) | 2021-10-01 |
CN113467906B true CN113467906B (en) | 2024-05-17 |
Family
ID=77868615
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110678523.1A Active CN113467906B (en) | 2021-06-18 | 2021-06-18 | Picture processing method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113467906B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1271491A (en) * | 1997-04-15 | 2000-10-25 | Mci全球通讯公司 | System, method and article of manufacture for switched telephone communication |
CN110096344A (en) * | 2018-01-29 | 2019-08-06 | 北京京东尚科信息技术有限公司 | Task management method, system, server cluster and computer-readable medium |
-
2021
- 2021-06-18 CN CN202110678523.1A patent/CN113467906B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1271491A (en) * | 1997-04-15 | 2000-10-25 | Mci全球通讯公司 | System, method and article of manufacture for switched telephone communication |
CN110096344A (en) * | 2018-01-29 | 2019-08-06 | 北京京东尚科信息技术有限公司 | Task management method, system, server cluster and computer-readable medium |
Also Published As
Publication number | Publication date |
---|---|
CN113467906A (en) | 2021-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104869305B (en) | Method and apparatus for processing image data | |
EP3454255A1 (en) | Facial recognition method and related product | |
CN107729889B (en) | Image processing method and device, electronic equipment and computer readable storage medium | |
US10824901B2 (en) | Image processing of face sets utilizing an image recognition method | |
US20150163734A1 (en) | Access point connection method and electronic device thereof | |
CN107749046B (en) | Image processing method and mobile terminal | |
WO2019052355A1 (en) | Image processing method, computer device, and computer readable storage medium | |
KR102184308B1 (en) | Image synthesis method, apparatus and non-volatile computer-readable medium | |
US11314803B2 (en) | Method for image-processing and mobile terminal | |
CN111752688B (en) | Data acquisition method and device, electronic equipment and storage medium | |
CN113467906B (en) | Picture processing method, device, equipment and storage medium | |
CN113900560A (en) | Icon processing method, intelligent terminal and storage medium | |
WO2018233141A1 (en) | Data communication processing terminal and method and computer readable storage medium | |
CN110717486B (en) | Text detection method and device, electronic equipment and storage medium | |
CN116302807A (en) | System, method, electronic device and storage medium for monitoring device memory | |
US11327845B2 (en) | Image synchronization method and device, and server | |
KR102170520B1 (en) | Apparatas and method for improving a loading time in an electronic device | |
WO2019096207A1 (en) | Image processing method and computer device, and computer readable storage medium | |
CN111966271B (en) | Screen panorama screenshot method and device, terminal equipment and storage medium | |
CN110069723B (en) | Graphic code identification method, device and storage medium | |
CN116257348A (en) | Method and device for processing content interaction picture, electronic equipment and storage medium | |
CN117876391A (en) | Screen capture display method and device | |
CN117392934A (en) | Image processing method, device, storage medium and electronic equipment | |
CN116912146A (en) | Image restoration method and device, electronic equipment and storage medium | |
CN112711350A (en) | Touch screen point reporting method and device, storage medium and mobile terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |