CN105468710A - Picture processing method and system applied in high concurrency scene - Google Patents
Picture processing method and system applied in high concurrency scene Download PDFInfo
- Publication number
- CN105468710A CN105468710A CN201510802144.3A CN201510802144A CN105468710A CN 105468710 A CN105468710 A CN 105468710A CN 201510802144 A CN201510802144 A CN 201510802144A CN 105468710 A CN105468710 A CN 105468710A
- Authority
- CN
- China
- Prior art keywords
- picture
- message body
- message
- picture processing
- message queue
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a picture processing method and system applied in a high concurrency scene. The method comprises: storing pictures uploaded by a user to a preset folder; packaging the path information of the pictures into a message body, adding the message body to a message queue; extracting the message body from the message queue, loading corresponding picture from the preset folder to the memory for picture processing according to the path information in the extracted message body. The invention can prevents high concurrency picture uploading request (for example, a picture processing system) from generating great pressure, for example, the invention prevents the great pressure of peak traffic from causing the system to crash or respond overtime; the stability of the system is effectively ensured; high concurrency access is ensured and the user experience is improved.
Description
Technical field
The present invention relates to picture processing field, specifically, relate to a kind of image processing method and the system that are applied to high concurrent scene.
Background technology
For existing e-commerce system, wherein there are a large amount of needs and uploaded and the scene sharing picture by user.Service end needs to carry out some process after receiving picture, such as, preserve after compression.But the relevant treatment such as picture compression need to expend a large amount of calculation resources of server, in the peak traffic operating period, a large number of users uploading pictures also triggers background picture process, can produce obvious pressure to system cloud gray model.
Current picture uploading and treatment scheme are roughly as follows: be saved in internal memory by picture after user's uploading pictures, then carry out picture compression or other operations, return response message completing all process rear lines.This processing mode cannot effectively control Concurrency Access amount, need to expend more calculation resources, and the response time is spun out, and thread holding time is too much, under the scene of high concurrency, also can cause serious load to thread pool.
In the prior art, stablizing in order to ensure system cloud gray model, often increases server in the peak traffic phase and carries out extending transversely, after exceeding system loading, even refuse the upload request of certain customers.These solutions add the hardware cost of system on the one hand, also affect customer experience on the other hand.
Summary of the invention
In view of the above-mentioned defect of prior art, embodiment of the present invention provides a kind of image processing method and the system that are applied to high concurrent scene, it can reduce system pressure under the concurrent scene of height, while guaranteeing system stability, ensures high Concurrency Access and improves Consumer's Experience.
Particularly, embodiment of the present invention provides a kind of image processing method being applied to high concurrent scene, and it comprises:
Picture user uploaded is saved to default file folder;
The routing information of described picture is packaged in message body, and this message body is added into message queue;
From described message queue, extract message body, according to the routing information in the message body of extracting, corresponding picture is loaded on internal memory from described default file folder and carries out picture processing.
Correspondingly, embodiment of the present invention additionally provides a kind of picture processing system being applied to high concurrent scene, and it comprises:
Memory module, the picture for user being uploaded is saved to default file folder;
Encapsulation and interpolation module, for being packaged in message body by the path fresh information of described picture, and be added into message queue by this message body;
Picture processing module, for extracting message body from described message queue, being loaded on internal memory by corresponding picture from described default file folder according to the routing information in the message body of extracting and carrying out picture processing.
Various embodiments of the invention are adopted to have following beneficial effect:
Be saved to default file folder by picture user uploaded and the message body of the routing information encapsulating picture is added into message queue, then the picture processing based on asynchronous communication is realized by message queue, picture upload request concurrent in a large number can be converted to serial processing, thus high concurrent picture upload request can be avoided to system (such as, picture processing system) produce immense pressure, such as, the immense pressure avoiding peak flow to bring causes system to delay the risk of machine or response timeout, effectively ensure that the stability of system, Consumer's Experience is improved while the high Concurrency Access of guarantee.In addition, the present invention can also shorten response path greatly, reduces the stand-by period of user's uploading pictures.
Accompanying drawing explanation
Figure 1A is a kind of schematic flow sheet being applied to the image processing method of high concurrent scene according to embodiment of the present invention;
Figure 1B is the schematic flow sheet carrying out picture processing according to a kind of Effect-based operation queue of embodiment of the present invention;
Fig. 2 A is a kind of block diagram being applied to the picture processing system of high concurrent scene according to the embodiment of the present invention;
Fig. 2 B is the block diagram of the picture processing system being applied to high concurrent scene according to the another kind of the embodiment of the present invention;
Fig. 2 C is an example of the block diagram of the picture processing module 23 of picture processing system shown in Fig. 2 A.
Embodiment
For the ease of understanding the various aspects of technical solution of the present invention, feature and advantage, below in conjunction with accompanying drawing, the present invention is specifically described.Should be appreciated that following various embodiments are only for illustrating, but not for limiting the scope of the invention.
First the term that may relate in this instructions is made an explanation.
Asynchronous communication: refer to that the cross-thread of server end realizes by bufferings such as socket (two programs on network to realize the exchange of data by a two-way communication connection, this one end connected is called a socket), message queues the mechanism that unblock formula calls mutually.
Figure 1A is a kind of schematic flow sheet being applied to the image processing method of high concurrent scene according to embodiment of the present invention.With reference to Figure 1A, described method comprises:
10: picture user uploaded is saved to default file folder.Such as, after receiving the picture upload request of user, picture user uploaded is saved to default file folder.
In the present embodiment, default file folder refers to the file for preserving the picture that user uploads pre-set.And preferably, default file folder comprises temporary folder.
12: the routing information of described picture is packaged in message body, and this message body is added into message queue.Wherein, the routing information of picture refers to that picture is stored in the routing information of default file folder.
14: from described message queue, extract message body, according to the routing information in the message body of extracting, corresponding picture is loaded on internal memory from described default file folder and carries out picture processing.
Adopt the method that the embodiment of the present invention provides, be saved to default file folder by picture user uploaded and the message body of the routing information encapsulating picture is added into message queue, then the picture processing based on asynchronous communication is realized by message queue, picture upload request concurrent in a large number can be converted to serial processing, thus can avoid to system (such as, picture processing system) produce immense pressure, such as, the immense pressure avoiding peak flow to bring causes system to delay the risk of machine or response timeout, effectively ensure that the stability of system, Consumer's Experience is improved while the high Concurrency Access of guarantee.
Alternatively, in a kind of implementation of the present embodiment, after picture user uploaded is saved to described default file folder, return response message to described user.Or, after message body is added into message queue, to the user of message body returning response message.Described response message is used for finishing receiving to subscriber's meter diagram sheet.This implementation can shorten response path relative to existing greatly returning for the mode of response message to user again after completing picture processing, reduces the stand-by period of user's uploading pictures, improves Consumer's Experience.
Alternatively, in a kind of implementation of the present embodiment, as shown in Figure 1B, the picture processing that 14 can realize Effect-based operation queue is in the following manner processed:
140: from described message queue, extract message body by the order of message body in described message queue.Such as, by single thread, poll is carried out to message queue, from message queue, extract message body successively to carry out subsequent treatment when poll each time.
142: according to the routing information in the message body of extracting, corresponding picture is loaded on internal memory from described default file folder and carries out picture processing.
144: after picture processing completes, from described message queue, extract next message body by the order of message body in described message queue.
After process 144, carry out the process identical with process 142 for the message body of extracting, circulate successively, until the message body in message queue is empty.
Adopt this implementation, can complete the process with concurrent picture upload request in the mode of serial processing.
Alternatively, in a kind of implementation of the present embodiment, after process 14, or after process 142, the picture after picture processing is saved to picture servers.
Below by reference to the accompanying drawings a kind of image processing method being applied to high concurrent scene according to the embodiment of the present invention is illustrated.Below in conjunction with accompanying drawing, a kind of picture processing system being applied to high concurrent scene according to the embodiment of the present invention is described.
Fig. 2 A is a kind of block diagram being applied to the picture processing system of high concurrent scene according to the embodiment of the present invention, and with reference to Fig. 2 A, picture processing system comprises memory module 21, encapsulation and adds module 22 and picture processing module 23.Be described respectively below.
In the present embodiment, memory module 21 is saved to default file folder for picture user uploaded.This default file folder is preferably temporary folder.This message body for being packaged in message body by the path fresh information of described picture, and is added into message queue by encapsulation and interpolation module 22.Corresponding picture, for extracting message body from described message queue, is loaded on internal memory from described default file folder according to the routing information in the message body of extracting and carries out picture processing by picture processing module 23.
Adopt the picture processing system that the present embodiment provides, picture upload request concurrent in a large number can be converted to serial processing, thus can avoid to system (such as, picture processing system) produce immense pressure, such as, the immense pressure avoiding peak flow to bring causes system to delay the risk of machine or response timeout, effectively ensure that the stability of system, while the high Concurrency Access of guarantee, improves Consumer's Experience.
Alternatively, in a kind of implementation of the present embodiment, as shown in Figure 2 B, picture processing system is except comprising memory module 21, encapsulation and adding except module 22 and picture processing module 23, also comprise respond module 24, after it is saved to default file folder for picture user uploaded in memory module 21, or, for encapsulation with add after message body is added into described message queue by module 22, return response message to user.
This implementation can shorten response path relative to existing greatly returning for the mode of response message to user again after completing picture processing, reduces the stand-by period of user's uploading pictures, improves Consumer's Experience.
Alternatively, in a kind of implementation of the present embodiment, as shown in Figure 2 C, picture processing module 23 comprises: extract submodule 231, for extracting message body by the order of message body in described message queue from described message queue; Picture processing submodule 232, carries out picture processing for corresponding picture being loaded on internal memory from described default file folder according to the routing information in the message body of extracting.Wherein, extract submodule 231 also for after completing picture processing at described picture processing submodule 232, from described message queue, extract next message body to carry out next picture processing by the order of message body in described message queue.
Adopt this implementation, can complete the process with concurrent picture upload request in the mode of serial processing.
Alternatively, in a kind of implementation of the present embodiment, picture processing system, except comprising memory module 21, encapsulation and adding except module 22, picture processing module 23 and optional respond module 24, can also comprise picture servers, for preserving the picture after picture processing.
In system embodiment of the present invention, about the explanation of related names, term, and process the detailed description that maybe can perform process performed by modules/submodule, refer to the respective description in embodiment of the method, repeat no more herein.
In addition, those skilled in the art also should be appreciated that picture processing system can be server in a kind of instantiation of the present embodiment, also can be installed in server the particular system being exclusively used in and realizing the object of the invention.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode of software combined with hardware platform.Based on such understanding, what technical scheme of the present invention contributed to background technology can embody with the form of software product in whole or in part, this computer software product can be stored in storage medium, as ROM/RAM, magnetic disc, CD etc., comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform the method described in some part of each embodiment of the present invention or embodiment.
Skilled person should be appreciated that and disclosed is only embodiments of the present invention above, and certainly can not limit the interest field of the present invention with this, the equivalent variations done according to embodiment of the present invention, still belongs to the scope that the claims in the present invention contain.
Claims (10)
1. be applied to an image processing method for high concurrent scene, it is characterized in that, described method comprises:
Picture user uploaded is saved to default file folder;
The routing information of described picture is packaged in message body, and this message body is added into message queue;
From described message queue, extract message body, according to the routing information in the message body of extracting, corresponding picture is loaded on internal memory from described default file folder and carries out picture processing.
2. the method for claim 1, is characterized in that, described default file folder comprises: temporary folder.
3. the method for claim 1, is characterized in that, described method also comprises:
After described picture user uploaded is saved to described default file folder, return response message to described user; Or,
Described this message body is added into message queue after, return response message to described user.
4. the method for claim 1, is characterized in that, from described message queue, extract message body, according to the routing information in the message body of extracting, corresponding picture is loaded on internal memory from described default file folder and carries out picture processing and comprise:
From described message queue, message body is extracted by the order of message body in described message queue;
According to the routing information in the message body of extracting, corresponding picture is loaded on internal memory from described default file folder and carries out picture processing;
After picture processing completes, from described message queue, extract next message body by the order of message body in described message queue.
5. the method for claim 1, is characterized in that, described method also comprises:
Picture after picture processing is saved to picture servers.
6. be applied to a picture processing system for high concurrent scene, it is characterized in that, described picture processing system comprises:
Memory module, the picture for user being uploaded is saved to default file folder;
Encapsulation and interpolation module, for being packaged in message body by the path fresh information of described picture, and be added into message queue by this message body;
Picture processing module, for extracting message body from described message queue, being loaded on internal memory by corresponding picture from described default file folder according to the routing information in the message body of extracting and carrying out picture processing.
7. system as claimed in claim 6, is characterized in that, described default file folder comprises: temporary folder.
8. system as claimed in claim 6, it is characterized in that, described system also comprises:
Respond module, after in described memory module the picture that described user uploads being saved to described default file folder, or, described encapsulation with add after this message body described is added into described message queue by module, return response message to described user.
9. system as claimed in claim 6, it is characterized in that, described picture processing module comprises:
Extract submodule, for extracting message body by the order of message body in described message queue from described message queue;
Picture processing submodule, carries out picture processing for corresponding picture being loaded on internal memory from described default file folder according to the routing information in the message body of extracting;
Described extraction submodule also for after completing picture processing at described picture processing submodule, extracts next message body by the order of message body in described message queue from described message queue.
10. system as claimed in claim 6, it is characterized in that, described system also comprises:
Picture servers, for preserving the picture after picture processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510802144.3A CN105468710A (en) | 2015-11-19 | 2015-11-19 | Picture processing method and system applied in high concurrency scene |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510802144.3A CN105468710A (en) | 2015-11-19 | 2015-11-19 | Picture processing method and system applied in high concurrency scene |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105468710A true CN105468710A (en) | 2016-04-06 |
Family
ID=55606411
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510802144.3A Pending CN105468710A (en) | 2015-11-19 | 2015-11-19 | Picture processing method and system applied in high concurrency scene |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105468710A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107124475A (en) * | 2017-06-30 | 2017-09-01 | 江西博瑞彤芸科技有限公司 | A kind of sharing method of view data |
CN111355777A (en) * | 2020-02-14 | 2020-06-30 | 西安奥卡云数据科技有限公司 | Management method and device of distributed file system and server |
CN112434235A (en) * | 2020-11-06 | 2021-03-02 | 金蝶云科技有限公司 | Webpage picture loading method and device, computer equipment and storage medium |
CN112565464A (en) * | 2021-01-22 | 2021-03-26 | 杭州米络星科技(集团)有限公司 | Method for uploading file custom bit sequence |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103533073A (en) * | 2013-10-23 | 2014-01-22 | 北京网秦天下科技有限公司 | File management system and method for mobile equipment |
CN104092767A (en) * | 2014-07-21 | 2014-10-08 | 北京邮电大学 | Posting/subscribing system for adding message queue models and working method thereof |
CN104408088A (en) * | 2014-11-11 | 2015-03-11 | 北京奇虎科技有限公司 | Control method and device for concurrent requests |
CN104598563A (en) * | 2015-01-08 | 2015-05-06 | 北京京东尚科信息技术有限公司 | High concurrency data storage method and device |
CN104731899A (en) * | 2015-03-19 | 2015-06-24 | 浪潮通用软件有限公司 | Data high-concurrency processing method based on asynchronous processing |
CN104932932A (en) * | 2014-03-20 | 2015-09-23 | 腾讯科技(深圳)有限公司 | Asynchronous business processing method, device and system |
-
2015
- 2015-11-19 CN CN201510802144.3A patent/CN105468710A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103533073A (en) * | 2013-10-23 | 2014-01-22 | 北京网秦天下科技有限公司 | File management system and method for mobile equipment |
CN104932932A (en) * | 2014-03-20 | 2015-09-23 | 腾讯科技(深圳)有限公司 | Asynchronous business processing method, device and system |
CN104092767A (en) * | 2014-07-21 | 2014-10-08 | 北京邮电大学 | Posting/subscribing system for adding message queue models and working method thereof |
CN104408088A (en) * | 2014-11-11 | 2015-03-11 | 北京奇虎科技有限公司 | Control method and device for concurrent requests |
CN104598563A (en) * | 2015-01-08 | 2015-05-06 | 北京京东尚科信息技术有限公司 | High concurrency data storage method and device |
CN104731899A (en) * | 2015-03-19 | 2015-06-24 | 浪潮通用软件有限公司 | Data high-concurrency processing method based on asynchronous processing |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107124475A (en) * | 2017-06-30 | 2017-09-01 | 江西博瑞彤芸科技有限公司 | A kind of sharing method of view data |
CN111355777A (en) * | 2020-02-14 | 2020-06-30 | 西安奥卡云数据科技有限公司 | Management method and device of distributed file system and server |
CN112434235A (en) * | 2020-11-06 | 2021-03-02 | 金蝶云科技有限公司 | Webpage picture loading method and device, computer equipment and storage medium |
CN112434235B (en) * | 2020-11-06 | 2024-06-04 | 金蝶云科技有限公司 | Webpage picture loading method and device, computer equipment and storage medium |
CN112565464A (en) * | 2021-01-22 | 2021-03-26 | 杭州米络星科技(集团)有限公司 | Method for uploading file custom bit sequence |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105468710A (en) | Picture processing method and system applied in high concurrency scene | |
CN107197015A (en) | A kind of message treatment method and device based on Message Queuing system | |
CN102413150B (en) | Server and virtual desktop control method and virtual desktop control system | |
CN103902486B (en) | System, device and method for implementation of remote direct memory access | |
CN114968478A (en) | Data processing method, device, server and system | |
CN111314741B (en) | Video super-resolution processing method and device, electronic equipment and storage medium | |
WO2014056292A1 (en) | Image compression method and system | |
CN109408243A (en) | A kind of data processing method based on RDMA, device and medium | |
CN111490963A (en) | Data processing method, system, equipment and storage medium based on QUIC protocol stack | |
EP2884398A1 (en) | Data forwarding device, data forwarding method, and program | |
CN102137138A (en) | Method, device and system for cache collaboration | |
CN108230487A (en) | The method and apparatus of shared camera resource | |
US20210392391A1 (en) | Data transmission method and apparatus | |
CN113271336B (en) | DPDK-based robot middleware DDS data transmission method, electronic equipment and computer-readable storage medium | |
CN113596325B (en) | Method and device for capturing images, electronic equipment and storage medium | |
CN109446200A (en) | A kind of method and device of data processing | |
CN108829340A (en) | storage processing method, device, storage medium and processor | |
CN111191612B (en) | Video image matching method, device, terminal equipment and readable storage medium | |
CN111064673B (en) | User plane data integrity protection method and device, electronic equipment and medium | |
CN106210028B (en) | A kind of server prevents method, server and the system of overload | |
CN117641066A (en) | Live broadcast source returning method and system | |
CN115955437B (en) | Data transmission method, device, equipment and medium | |
CN111467796B (en) | Distributed physical settlement method and device | |
CN116719652B (en) | Message-based multi-sub-job dynamic distribution method, device and system | |
CN108196956A (en) | A kind of NAS service nodes realize the method and system of NAS services |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160406 |