WO2021056812A1 - Graphic adaptation system and graphic adaptation method based on same - Google Patents

Graphic adaptation system and graphic adaptation method based on same Download PDF

Info

Publication number
WO2021056812A1
WO2021056812A1 PCT/CN2019/122009 CN2019122009W WO2021056812A1 WO 2021056812 A1 WO2021056812 A1 WO 2021056812A1 CN 2019122009 W CN2019122009 W CN 2019122009W WO 2021056812 A1 WO2021056812 A1 WO 2021056812A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
information
cut
pictures
image
Prior art date
Application number
PCT/CN2019/122009
Other languages
French (fr)
Chinese (zh)
Inventor
刘树东
陆鹏
朱向升
李�赫
Original Assignee
同程网络科技股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 同程网络科技股份有限公司 filed Critical 同程网络科技股份有限公司
Publication of WO2021056812A1 publication Critical patent/WO2021056812A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/41Bandwidth or redundancy reduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Definitions

  • This application relates to the technical field of graphics adaptation, for example, to a graphics adaptation system and a graphics adaptation method based on the system.
  • the Chinese patent with publication number CN101699839A discloses a mobile terminal graphics adaptation method, which includes the following steps: the user terminal sends a data packet containing the mobile phone number, the type of the mobile terminal and the specified picture to the WEB or WAP server; WEB Or WAP server calculates the terminal screen aspect ratio according to the mobile terminal type, and then queries the picture database server for pictures matching the terminal screen aspect ratio and picture number; WEB or WAP server sends the adapted picture to the mobile with the number terminal.
  • the above-mentioned related technical solutions have the following defects: there are multiple storage of the same picture, which requires a lot of storage costs. Therefore, in order to adapt to different terminals, while reducing storage capacity and saving costs as much as possible, it is necessary to design a In the case of storing only one picture, the picture can be cut in real time according to the terminal type, and the solution for real-time feedback of pictures of different sizes to the business side.
  • This application provides a graphics adaptation system and a graphics adaptation method based on the system.
  • This application provides a graphics adaptation system, which can save a lot of storage costs
  • the present application provides a graphics adaptation method, which can reduce the pressure on the server while being able to feed back a picture of a corresponding size to the business party in real time.
  • a graphics adaptation system including:
  • the web server is set to query whether the pictures uploaded by the user are duplicated, upload the pictures that are not duplicated, and directly return the corresponding picture id for the duplicate pictures;
  • the writing server is configured to obtain and save the pictures uploaded by the Web server, and is also configured to manage and maintain meta-information of the saved pictures, the meta-information including the picture id;
  • the tag information reading module is set to receive and parse the transmitted picture URL corresponding to the user terminal type to obtain the corresponding picture id and picture cut style;
  • the meta-information reading module is configured to obtain the meta-information of the corresponding picture and the original image file information from the writing server according to the picture id obtained by the tag information reading module;
  • the image cutting module is configured to use the image cutting style acquired by the tag information reading module to cut the original image acquired by the meta information reading module and return it to the user terminal.
  • the picture can be cut in real time according to the user terminal type (APP, browser webpage, etc.), and different feedbacks are given to the business side in real time.
  • Pictures of different sizes can be adapted to the user terminal, saving a lot of storage costs, and avoiding the situation that multiple sizes of the same picture are stored due to different sizes.
  • the Web server includes:
  • the deduplication module is set to process the picture uploaded by the user into a picture in which all pixels are only black and white, and the processed picture is scaled down to form a contrast image, which is also set as the contrast image to be formed Compare with the comparison images corresponding to all the pictures in the writing server and judge whether they are duplicates;
  • the storage module is configured to store the comparison images of all the pictures in the writing server, and is also configured to store the comparison images obtained by the deduplication module when the deduplication module judges no.
  • deduplication is performed when users upload pictures, which saves the storage capacity of the system and avoids repeated pictures uploading.
  • it further includes a preprocessing module configured to preprocess the picture uploaded by the Web server into a picture with a set format and a set style specification and upload it to the writing server.
  • a preprocessing module configured to preprocess the picture uploaded by the Web server into a picture with a set format and a set style specification and upload it to the writing server.
  • the tag information reading module includes:
  • the parsing unit is set to parse the transmitted picture URL corresponding to the user terminal to obtain the tag information tag and picture id of the picture cut;
  • the judging unit is set to judge whether the image needs to be cut according to the tag information tag;
  • the reading unit is set to construct the original image tag of the picture and upload it to the meta-information reading module when the judgment unit judges no; it is also set to read when the judgment unit judges yes Uploading the cut-out style in the tag information tag to the meta-information reading module;
  • the tag information tag includes first feature information used to indicate whether the image is cut and second feature information including the image cut style.
  • the original image can be cropped using the crop style.
  • the cutting is flexible and configurable. By configuring the specifications and styles, the requirements of different sizes can be met. There is no need to traverse the pictures each time to generate pictures of different sizes, which reduces the pressure on the system. At the same time, various parameters such as whether to zoom or not can be configured during the cutting process to meet the requirements of different sizes and improve the adaptability of the system.
  • a graphic adaptation method which is based on the graphic adaptation system described in the above technical solution, and includes a picture upload method A and a picture cut method B;
  • the picture uploading method A includes the following steps:
  • Image verification and de-duplication De-duplication is performed when the user uploads the image, and the image id is directly returned to the duplicate image, and no repeated upload is required;
  • the picture cutting method B includes the following steps:
  • the picture system saves only one copy of the original picture, cooperates with the style rules, and according to the style needs of the user, each request dynamically cuts the picture, and returns pictures of different sizes, which can reduce the pressure on the server while being able to real-time Feedback the effect of the corresponding size picture for the business side.
  • step S100 includes the following sub-steps:
  • S103 Directly return the corresponding picture id for the repeated pictures, and do not repeatedly upload them;
  • step S104 Store the hash value generated in sub-step S101, and then go to step S200.
  • the user-uploaded picture can be quickly compared with the existing picture through the hash value, thereby achieving the purpose of deduplication and avoiding repeated uploading and repeated storage.
  • the picture uploaded by the user is slightly different from the picture stored in the system, it can be distinguished by the hash value when the picture cannot be clearly distinguished by the naked eye, so as to avoid repeated uploads.
  • the hash value generated by the processing is small, it is conducive to storage, thereby reducing the pressure on the system.
  • the picture uploading method A further includes the following steps:
  • Picture preprocessing preprocessing the pictures judged to be non-repetitive in step S100 into pictures with fixed rules
  • the step S600 includes the following sub-steps:
  • step S601 Acquire basic information of pictures that are determined to be non-repetitive in step S100, where the basic information includes format and style specifications;
  • S602. Determine the format of the picture obtained in sub-step S601; if the picture is not in jpg format, go to sub-step S603; if the picture is in jpg format, go to sub-step S604;
  • step S604 Crop the picture into a picture with a set style and specification, and go to step S200.
  • the storage size of the pictures is limited from the source, which not only saves storage resources, but also facilitates the dynamic cropping of the stored original pictures by the system, and improves the response efficiency of the system.
  • step S300 includes the following sub-steps:
  • S302 parse the picture URL generated in sub-step S301 and obtain the picture id and the tag information tag of the picture cut;
  • step S304 construct the original picture label of the picture, and enter step S400;
  • step S305 Read the cut pattern in the tag information tag, and enter step S400.
  • the picture URL is composed of a domain name, a tag information tag, and a picture id
  • the tag information tag includes first feature information indicating whether to cut a picture and second feature information including a cut picture style.
  • FIG. 1 is a schematic diagram of the overall structure of a graphics adaptation system shown in Embodiment 1 of the present invention
  • FIG. 2 is a schematic structural diagram of another graphics adaptation system shown in Embodiment 1 of the present invention.
  • FIG. 3 is a flowchart of a graphics adaptation method shown in Embodiment 2 of the present invention.
  • step S100 shown in the second embodiment of the present invention.
  • FIG. 5 is a flowchart of step S600 shown in the second embodiment of the present invention.
  • Fig. 6 is a flowchart of step S300 shown in the second embodiment of the present invention.
  • a graphics adaptation system disclosed in this application includes an uploading subsystem 7 and a picture cutting subsystem 8.
  • the uploading subsystem 7 includes a Web server 1, a writing server 2 and a preprocessing module 6, and a picture cutting subsystem 8 includes the tag information reading module 3, the meta information reading module 4 and the image cutting module 5.
  • the web server 1 is used for querying whether the pictures uploaded by the user are duplicated, uploading pictures that are not duplicated, and directly returning the corresponding picture id for the duplicated pictures, so as to bind the picture with the information input by the user.
  • the writing server 2 is used to obtain and save the pictures uploaded by the Web server 1, and it is also used to manage and maintain the meta-information of the saved pictures.
  • the meta-information of the pictures includes picture id, picture content information, picture classification information, etc. .
  • the tag information reading module 3 is used to receive and parse the transmitted picture URL corresponding to the user terminal type, and is used to obtain the corresponding picture id and picture cut style according to the parsed data.
  • the meta-information reading module 4 is used to obtain the meta-information of the corresponding picture and the original image file information from the writing server 2 according to the picture id obtained by the tag information reading module 3.
  • the image cutting module 5 is configured to use the image cutting style obtained by the tag information reading module 3 to crop the original image obtained by the meta-information reading module 4, and return the cropped image to the user terminal.
  • the preprocessing module 6 is used to preprocess the pictures uploaded by the Web server 1 into pictures with a set format and a set style specification, and then upload them to the writing server 2.
  • the preprocessing module 6 converts the picture into the jpg format; when the pixels of the picture uploaded by the Web server 1 are greater than the set value, such as 1500, the picture is processed as 1500*1500 style specifications.
  • the Web server 1 includes a deduplication module 11 and a storage module 12.
  • the deduplication module 11 is used for pixel processing of the picture uploaded by the user, so that all pixels of the picture have only two colors of black and white, that is, the color photo is processed into a black and white photo; the deduplication module 11 processes the color photo into a black and white photo and then restores it.
  • the black and white photos will be scaled down to form a contrast image.
  • the deduplication module 11 will scale down the processed black and white pictures to a quarter of the original; in addition, the deduplication module 11 is also used to reduce
  • the obtained comparison image is compared with the comparison images corresponding to all the pictures in the writing server 2, and it is judged whether it is a duplicate.
  • the storage module 12 is used to store the comparison images of all the pictures in the writing server 2, and is also used to store the comparison images obtained by the deduplication module 11 when the deduplication module 11 determines that the pictures are not repeated.
  • the tag information reading module 3 includes an analysis unit 31, a judgment unit 32, and a reading unit 33.
  • the parsing unit 31 is used to parse the image URL corresponding to the user terminal, so as to obtain the tag information tag and the image id of the image cut.
  • the image URL is derived from the request of the user terminal after the system parses the image. The domain name, the rules for cutting pictures, and the picture id composition.
  • the judging unit 32 is used for judging whether the image needs to be cut according to the tag information tag, and the reading unit 33 is used for constructing the original image tag of the picture and uploading it to the meta-information reading module 4 when the judging unit 32 judges no, and the judging unit 32 judges If yes, the reading unit 33 reads the cut pattern in the tag information tag and uploads it to the meta-information reading module 4.
  • the tag information tag includes first feature information used to indicate whether to cut the image and second feature information including the image cut style.
  • the Web server 1 When a user uploads a picture, in order to save storage capacity and avoid repeated uploading of the picture, the Web server 1 first checks the picture and removes duplicates. For repeated pictures, the corresponding picture id is directly returned and corresponds to the information requested by the user. Repeat upload. After uploading unique pictures, the preprocessing module 6 preprocesses the uploaded pictures, that is, by default, real-time cutting is performed on pictures with pixels larger than the set value in the original uploaded picture, for example, if the pixels of the uploaded original picture are larger than 1500 When cutting the pictures in real time, it will be uniformly processed to the style specification of 1500*1500 and the picture format will be adjusted to jpg, thus limiting the picture storage size and format. Finally, forwarding and backup are performed, that is, the preprocessing module 6 forwards the processed pictures to the writing server 2 and writes them into the file. At the same time, the writing server 2 can manage and maintain the meta-information of the pictures.
  • the system When cutting the picture, the system saves only one original picture, cooperates with the style rules, and according to the style requirements of the user, every time a dynamic picture cutting is requested, pictures of different sizes can be returned.
  • the tag information reading module 3 first parses the picture URL, and obtains the picture cut specifications according to the composition rule of the picture URL.
  • the meta-information reading module 4 obtains the original information of the image and the file information of the original image according to the image id.
  • the image cutting module 5 obtains the original image information and the image cutting style, it uses the image cutting style to cut the original image.
  • various parameters such as whether to zoom or not can be configured during the cutting process to meet the requirements of different sizes.
  • the system will return the corresponding size picture to the requester.
  • a graphics adaptation method based on the graphics adaptation system in the first embodiment disclosed in this application includes a picture upload method A and a picture cut method B.
  • Picture upload method A includes the following steps:
  • deduplication is performed when the user uploads the image, and the image id is directly returned to the duplicate image, and the upload is not repeated.
  • Picture preprocessing preprocess the pictures judged to be non-repetitive in step S100 as original pictures, and then enter S200.
  • Step S200 Forwarding and backup: forwarding the picture preprocessed in step S600 to the writing server 2 and writing the file, while managing and maintaining the meta-information of the picture.
  • the meta-information of each picture includes a picture id.
  • Picture cutting method B includes the following steps:
  • the picture cut specification parse the transmitted picture URL corresponding to the user terminal type and obtain the picture id and picture cut style.
  • the picture URL is composed of a domain name, a tag information tag, and a picture id.
  • the tag information tag includes first feature information indicating whether to cut the picture and second feature information including the cut picture style.
  • step S100 includes the following sub-steps:
  • S101 Process the picture uploaded by the user through the MD5 information digest algorithm and generate a hash value
  • S103 Directly return the corresponding picture id for the repeated pictures, and do not repeatedly upload them;
  • step S104 Store the hash value generated in sub-step S101, and then go to step S200.
  • step S600 includes the following sub-steps:
  • step S601 Acquire basic information of pictures that are determined to be non-repetitive in step S100, where the basic information includes the format of the picture and the style specification of the picture;
  • S602. Determine whether the format of the picture obtained in sub-step S601 is jpg; if the picture is not in jpg format, go to sub-step S603; if the picture is in jpg format, go to sub-step S604;
  • step S604 Crop the picture into an original picture with a set style and specification, and go to step S200.
  • step S300 includes the following sub-steps:
  • S301 The terminal application generates a picture URL according to the type of the terminal;
  • S302 parse the picture URL generated in sub-step S301 and obtain the picture id and the tag information tag of the picture cut;
  • step S304 construct the original picture label of the picture, and enter step S400;
  • step S305 Read the cut pattern in the tag information tag, and enter step S400.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed in the present application are a graphic adaptation system and a graphic adaptation method based on same. The system comprises: a Web server, configured to check whether a picture uploaded by a user is a duplicate, and only upload a picture that is not a duplicate; a write server, configured to obtain and store the picture uploaded by the Web server; a tag information reading module, configured to receive and analyze a transmitted picture URL to obtain a corresponding picture id and a picture cutting style; a meta-information reading module, configured to obtain meta-information of a corresponding picture and original picture file information according to the picture id; and a picture cutting module, configured to cut, by using the obtained picture cutting style, an original picture obtained by the meta-information reading module.

Description

图形适配系统及基于该系统的图形适配方法Graphic adaptation system and graphic adaptation method based on the system
本公开要求在2019年09月28日提交中国专利局、申请号为201910928402.0的中国专利申请的优先权,以上申请的全部内容通过引用结合在本公开中。This disclosure claims the priority of a Chinese patent application filed with the Chinese Patent Office with an application number of 201910928402.0 on September 28, 2019, and the entire content of the above application is incorporated into this disclosure by reference.
技术领域Technical field
本申请涉及图形适配技术领域,例如涉及一种图形适配系统及基于该系统的图形适配方法。This application relates to the technical field of graphics adaptation, for example, to a graphics adaptation system and a graphics adaptation method based on the system.
背景技术Background technique
随着互联网的发展,图片因其直观生动的优势,经常会大量出现在各大互联网公司的业务场景中,如APP端的点评图片、酒店预览图等。同时,由于图片需要适应web网站以及不同的手机终端,所以同一种图片需要存储很多份以适应不同的终端。With the development of the Internet, pictures often appear in large numbers in the business scenarios of major Internet companies due to their intuitive and vivid advantages, such as review pictures on APPs, hotel previews, etc. At the same time, since pictures need to be adapted to web sites and different mobile terminals, a lot of copies of the same picture need to be stored to adapt to different terminals.
例如,公开号为CN101699839A的中国专利就公开了一种移动终端图形适配方法,其包括以下步骤:用户终端向WEB或WAP服务器发送包含手机号码、移动终端类型以及指定的图片的数据包;WEB或WAP服务器根据移动终端类型算出其终端屏幕长宽比,然后从图片数据库服务器中查询与终端屏幕长宽比和图片编号相匹配的图片;WEB或WAP服务器把适配图片发送给具有号码的移动终端。For example, the Chinese patent with publication number CN101699839A discloses a mobile terminal graphics adaptation method, which includes the following steps: the user terminal sends a data packet containing the mobile phone number, the type of the mobile terminal and the specified picture to the WEB or WAP server; WEB Or WAP server calculates the terminal screen aspect ratio according to the mobile terminal type, and then queries the picture database server for pictures matching the terminal screen aspect ratio and picture number; WEB or WAP server sends the adapted picture to the mobile with the number terminal.
但是,上述中的相关技术方案存在以下缺陷:同一图片存储有多个,这需要大量的存储成本,因此,为了适应不同的终端,同时尽可能的减少存储容量,节省成本,需要设计一种在只存储一份图片的情况下,能够根据终端类型对图片进行实时切图,实时给业务方反馈不同尺寸的图片的方案。However, the above-mentioned related technical solutions have the following defects: there are multiple storage of the same picture, which requires a lot of storage costs. Therefore, in order to adapt to different terminals, while reducing storage capacity and saving costs as much as possible, it is necessary to design a In the case of storing only one picture, the picture can be cut in real time according to the terminal type, and the solution for real-time feedback of pictures of different sizes to the business side.
发明内容Summary of the invention
本申请提供一种图形适配系统及基于该系统的图形适配方法。This application provides a graphics adaptation system and a graphics adaptation method based on the system.
本申请提供了一种图形适配系统,其能够节省大量存储成本;This application provides a graphics adaptation system, which can save a lot of storage costs;
本申请提供了一种图形适配方法,其能够减轻服务器压力同时能够实时为业务方反馈相应尺寸的图片。The present application provides a graphics adaptation method, which can reduce the pressure on the server while being able to feed back a picture of a corresponding size to the business party in real time.
本申请的图形适配系统是通过以下技术方案得以实现的:The graphics adaptation system of this application is realized through the following technical solutions:
一种图形适配系统,包括:A graphics adaptation system, including:
Web服务器,被设置为查询用户上传的图片有无重复,并对不重复的图片进行上传,对重复的图片直接返回相应的图片id;The web server is set to query whether the pictures uploaded by the user are duplicated, upload the pictures that are not duplicated, and directly return the corresponding picture id for the duplicate pictures;
写服务器,被设置为获取所述Web服务器上传的图片并保存,其还被设置为管理维护所保存图片的元信息,所述元信息包括图片id;The writing server is configured to obtain and save the pictures uploaded by the Web server, and is also configured to manage and maintain meta-information of the saved pictures, the meta-information including the picture id;
tag信息读取模块,被设置为接收并解析传来的与用户终端类型相对应的图片URL,以获取对应的图片id和切图样式;The tag information reading module is set to receive and parse the transmitted picture URL corresponding to the user terminal type to obtain the corresponding picture id and picture cut style;
元信息读取模块,被设置为根据所述tag信息读取模块获取的图片id从写服务器中获取相应图片的元信息以及原图文件信息;The meta-information reading module is configured to obtain the meta-information of the corresponding picture and the original image file information from the writing server according to the picture id obtained by the tag information reading module;
切图模块,被设置为利用所述tag信息读取模块获取的切图样式对元信息读取模块获取的原图进行裁剪并返回至用户终端。The image cutting module is configured to use the image cutting style acquired by the tag information reading module to cut the original image acquired by the meta information reading module and return it to the user terminal.
通过采用上述技术方案,采用读写分离的架构设计,在只存储一份图片的情况下,能够根据用户终端类型(APP、浏览器网页等)对图片进行实时切图,实时给业务方反馈不同尺寸的图片以适配到用户终端,节约大量的存储成本,避免发生由于不同的尺寸导致同一图片存储多个的情况。By adopting the above technical solution and adopting the architecture design of separation of reading and writing, in the case of storing only one picture, the picture can be cut in real time according to the user terminal type (APP, browser webpage, etc.), and different feedbacks are given to the business side in real time. Pictures of different sizes can be adapted to the user terminal, saving a lot of storage costs, and avoiding the situation that multiple sizes of the same picture are stored due to different sizes.
可选地,所述Web服务器包括:Optionally, the Web server includes:
去重模块,被设置为将用户上传的图片处理为所有像素点均只有黑白两种颜色的图片并对处理后的图片进行等比例缩小以形成对比图像,其还被设置为将形成的对比图像与写服务器中所有图片对应的对比图像进行对比并判断是否重复;The deduplication module is set to process the picture uploaded by the user into a picture in which all pixels are only black and white, and the processed picture is scaled down to form a contrast image, which is also set as the contrast image to be formed Compare with the comparison images corresponding to all the pictures in the writing server and judge whether they are duplicates;
存储模块,被设置为存储所述写服务器中所有图片的对比图像,其还被设置为在所述去重模块判断为否时,将所述去重模块得到的对比图像进行存储。The storage module is configured to store the comparison images of all the pictures in the writing server, and is also configured to store the comparison images obtained by the deduplication module when the deduplication module judges no.
通过采用上述技术方案,在用户上传图片时进行去重,节省了系统的存储容量,避免图片重复上传。By adopting the above-mentioned technical solution, deduplication is performed when users upload pictures, which saves the storage capacity of the system and avoids repeated pictures uploading.
可选地,还包括预处理模块,所述预处理模块被设置为将Web服务器上传的图片预处理为设定格式和设定样式规格的图片后上传至所述写服务器。Optionally, it further includes a preprocessing module configured to preprocess the picture uploaded by the Web server into a picture with a set format and a set style specification and upload it to the writing server.
通过采用上述技术方案,默认情况下,对于上传原图像素大于设定值的图片进行实时切图,统一处理到设定的样式规格,从源头上限制了图片存储大小,从而节省了系统的存储容量,减小系统负载压力。By adopting the above technical solution, by default, real-time image cutting is performed for the uploaded original image with pixels larger than the set value, and the unified processing is performed to the set style specification, which limits the image storage size from the source, thereby saving system storage Capacity, reduce system load pressure.
可选地,所述tag信息读取模块包括:Optionally, the tag information reading module includes:
解析单元,被设置为对传来的与用户终端对应的图片URL进行解析以获取图片切图的标签信息tag和图片id;The parsing unit is set to parse the transmitted picture URL corresponding to the user terminal to obtain the tag information tag and picture id of the picture cut;
判断单元,被设置为根据所述标签信息tag判断是否需要切图;The judging unit is set to judge whether the image needs to be cut according to the tag information tag;
读取单元,被设置为在所述判断单元判断为否时,构造图片原图标签并上传至所述元信息读取模块;其还被设置为在所述判断单元判断为是时,读取所述标签信息tag中的切图样式并上传至所述元信息读取模块;The reading unit is set to construct the original image tag of the picture and upload it to the meta-information reading module when the judgment unit judges no; it is also set to read when the judgment unit judges yes Uploading the cut-out style in the tag information tag to the meta-information reading module;
其中,所述标签信息tag包括用于表示是否切图的第一特征信息和包含切图样式的第二特征信息。Wherein, the tag information tag includes first feature information used to indicate whether the image is cut and second feature information including the image cut style.
通过采用上述技术方案,在得到原图信息及裁剪尺寸样式后,利用裁剪样式即可对原图进行裁剪。裁剪灵活可配置,通过配置规格样式,即可满足不同尺寸的要求,无需每次对图片遍历,生成不同尺寸的图片,减轻了系统压力。同时在裁剪的过程中,可以配置是否缩放等各种参数,以满足不同尺寸的要求,提高系统的适配性。By adopting the above technical solution, after obtaining the original image information and the crop size style, the original image can be cropped using the crop style. The cutting is flexible and configurable. By configuring the specifications and styles, the requirements of different sizes can be met. There is no need to traverse the pictures each time to generate pictures of different sizes, which reduces the pressure on the system. At the same time, various parameters such as whether to zoom or not can be configured during the cutting process to meet the requirements of different sizes and improve the adaptability of the system.
本申请的图形适配方法是通过以下技术方案得以实现的:The graphics adaptation method of this application is realized through the following technical solutions:
一种图形适配方法,所述图形适配方法基于上述技术方案所述的图形适配系统,包括图片上传方法A和图片切图方法B;A graphic adaptation method, which is based on the graphic adaptation system described in the above technical solution, and includes a picture upload method A and a picture cut method B;
所述图片上传方法A包括以下步骤:The picture uploading method A includes the following steps:
S100、图片校验去重:在用户上传图片时进行去重,对于重复图片直接返回图片id,不再重复上传;S100. Image verification and de-duplication: De-duplication is performed when the user uploads the image, and the image id is directly returned to the duplicate image, and no repeated upload is required;
S200、转发及备份:转发步骤S100中判断为不重复的图片到写服务器并写入文件,同时管理维护图片的元信息,每一图片的元信息均包括图片id;S200. Forwarding and backup: forwarding the pictures judged to be non-repetitive in step S100 to the writing server and writing the files, while managing and maintaining the meta information of the pictures, the meta information of each picture includes the picture id;
所述图片切图方法B包括以下步骤:The picture cutting method B includes the following steps:
S300、获取切图规格:解析传来的与用户终端类型相对应的图片URL并获取图片id和切图样式;S300. Obtain the picture cut specification: parse the transmitted picture URL corresponding to the user terminal type and obtain the picture id and picture cut style;
S400、获取图片元信息:根据图片id获取图片的元信息,以及原图的文件信息;S400. Obtaining image meta information: obtaining the meta information of the image and the file information of the original image according to the image id;
S500、切图:在得到图片的元信息、原图的文件信息及切图样式后,利用切图样式对原图进行裁剪并返回至用户终端。S500. Cut the picture: After obtaining the meta information of the picture, the file information of the original picture and the picture cut style, use the picture cut style to cut the original picture and return it to the user terminal.
通过采用上述技术方案,图片系统在只存一份原图的基础上,配合样式规则,根据用户的样式需求,每次请求动态切图,返回不同尺寸的图片,具有能够减轻服务器压力同时能够实时为业务方反馈相应尺寸的图片的效果。By adopting the above technical solutions, the picture system saves only one copy of the original picture, cooperates with the style rules, and according to the style needs of the user, each request dynamically cuts the picture, and returns pictures of different sizes, which can reduce the pressure on the server while being able to real-time Feedback the effect of the corresponding size picture for the business side.
可选地,步骤S100包括以下子步骤:Optionally, step S100 includes the following sub-steps:
S101、将用户上传的图片通过MD5信息摘要算法进行处理并产生一个散列 值;S101. Process the picture uploaded by the user through the MD5 information digest algorithm and generate a hash value;
S102、将子步骤S101中产生的散列值与写服务器中所有图片的散列值进行对比并判断是否重复;若重复,则进入子步骤S103;若不重复,则进入子步骤S104;S102. Compare the hash value generated in sub-step S101 with the hash values of all pictures in the writing server and determine whether it is repeated; if it is repeated, go to sub-step S103; if not, go to sub-step S104;
S103、对重复图片直接返回相应的图片id,不再重复上传;S103: Directly return the corresponding picture id for the repeated pictures, and do not repeatedly upload them;
S104、将子步骤S101中产生的散列值进行存储,然后进入步骤S200。S104: Store the hash value generated in sub-step S101, and then go to step S200.
通过采用上述技术方案,通过散列值能够快速的将用户上传图片与现有图片进行对比,从而达到去重的目的,避免重复上传和重复存储。另一方面,即使用户上传的图片与系统存储的图片有略微差别,但肉眼无法明显分辨时,也可通过散列值分辨出,从而避免重复上传。最后,由于处理产生的散列值较小,所以利于存储,从而减轻了系统压力。By adopting the above technical solution, the user-uploaded picture can be quickly compared with the existing picture through the hash value, thereby achieving the purpose of deduplication and avoiding repeated uploading and repeated storage. On the other hand, even if the picture uploaded by the user is slightly different from the picture stored in the system, it can be distinguished by the hash value when the picture cannot be clearly distinguished by the naked eye, so as to avoid repeated uploads. Finally, because the hash value generated by the processing is small, it is conducive to storage, thereby reducing the pressure on the system.
可选地,所述图片上传方法A还包括以下步骤:Optionally, the picture uploading method A further includes the following steps:
S600、图片预处理:将步骤S100中判断为不重复的图片预处理成固定规则的图片;S600. Picture preprocessing: preprocessing the pictures judged to be non-repetitive in step S100 into pictures with fixed rules;
所述步骤S600包括以下子步骤:The step S600 includes the following sub-steps:
S601、获取步骤S100中判断为不重复的图片的基本信息,所述基本信息包括格式和样式规格;S601: Acquire basic information of pictures that are determined to be non-repetitive in step S100, where the basic information includes format and style specifications;
S602、判断子步骤S601中获取图片的格式;若图片非jpg格式,则进入子步骤S603;若图片为jpg格式,则进入子步骤S604;S602. Determine the format of the picture obtained in sub-step S601; if the picture is not in jpg format, go to sub-step S603; if the picture is in jpg format, go to sub-step S604;
S603、将图片转换为jpg格式,并进入子步骤S604;S603: Convert the picture into a jpg format, and enter sub-step S604;
S604、将图片裁剪为设定样式规格的图片,并进入步骤S200。S604: Crop the picture into a picture with a set style and specification, and go to step S200.
通过采用上述技术方案,从源头上限制了图片的存储大小,不仅节省了存储资源,也利于系统对所存储原图的动态裁剪,提高系统响应效率。By adopting the above technical solutions, the storage size of the pictures is limited from the source, which not only saves storage resources, but also facilitates the dynamic cropping of the stored original pictures by the system, and improves the response efficiency of the system.
可选地,所述步骤S300包括以下子步骤:Optionally, the step S300 includes the following sub-steps:
S301、根据终端的类型生成图片URL;S301: Generate a picture URL according to the type of the terminal;
S302、对子步骤S301中生成的图片URL进行解析并获取图片id和图片切图的标签信息tag;S302: parse the picture URL generated in sub-step S301 and obtain the picture id and the tag information tag of the picture cut;
S303、判断子步骤S302中获取的图片切图的标签信息tag是否为原图;若判断为是,则进入子步骤S304;若判断为否,则进入子步骤S305;S303. Determine whether the tag information tag of the picture cut obtained in sub-step S302 is the original image; if the judgment is yes, then go to sub-step S304; if the judgment is no, then go to sub-step S305;
S304、构造图片原图标签,并进入步骤S400;S304, construct the original picture label of the picture, and enter step S400;
S305、读取标签信息tag中的切图样式,并进入步骤S400。S305: Read the cut pattern in the tag information tag, and enter step S400.
通过采用上述技术方案,能够根据标签信息tag快速判断是否需要切图,若不需要切图,则直接输出原图标签进行原图信息读取,若需要切图,则才会读取标签信息tag中的切图样式,以供后续裁剪。通过以上判断方式,提高了系统的响应效率,减小系统负载压力。By adopting the above technical solution, it is possible to quickly determine whether the image needs to be cut according to the label information tag. If the image does not need to be cut, the original image tag is directly output to read the original image information, and the tag information tag is read only if the image needs to be cut. The cutting pattern in the middle, for subsequent cutting. Through the above judgment method, the response efficiency of the system is improved, and the load pressure of the system is reduced.
可选地,所述图片URL由域名、标签信息tag以及图片id组成,所述标签信息tag包括用于表示是否切图的第一特征信息和包含切图样式的第二特征信息。Optionally, the picture URL is composed of a domain name, a tag information tag, and a picture id, and the tag information tag includes first feature information indicating whether to cut a picture and second feature information including a cut picture style.
通过采用上述技术方案,能够根据标签信息tag快速判断切图信息,且通过图片URL的解析,也能够准确地对应到相应的原图从而对其进行动态操作。By adopting the above technical solution, it is possible to quickly determine the image cutting information based on the tag information tag, and through the analysis of the image URL, it can also accurately correspond to the corresponding original image to perform dynamic operations on it.
综上所述,本申请具有如下优点:In summary, this application has the following advantages:
1、通过Web服务器、写服务器、tag信息读取模块、元信息读取模块与切图模块的设置,具有能够节省大量存储成本的效果;1. Through the setting of Web server, writing server, tag information reading module, meta information reading module and picture cutting module, it has the effect of saving a lot of storage costs;
2、通过去重模块、存储模块及预处理模块的设置,从源头上限制是否存储图片以及所存储图片的大小,极大的减轻了系统的负载压力;2. Through the settings of the deduplication module, storage module and preprocessing module, from the source, whether to store pictures and the size of the stored pictures is restricted, which greatly reduces the load pressure of the system;
3、通过解析单元、判断单元及读取单元的设置,利于快速识别用户的样式需求,从而实时给用户反馈不同尺寸的图片。3. Through the setting of the analysis unit, the judgment unit and the reading unit, it is conducive to quickly identify the user's style needs, so as to feed back pictures of different sizes to the user in real time.
附图说明Description of the drawings
图1是本发明实施例一示出的图形适配系统的整体结构示意图;FIG. 1 is a schematic diagram of the overall structure of a graphics adaptation system shown in Embodiment 1 of the present invention;
图2是本发明实施例一示出的另一个图形适配系统的结构示意图;2 is a schematic structural diagram of another graphics adaptation system shown in Embodiment 1 of the present invention;
图3是本发明实施例二示出的图形适配方法的流程图;FIG. 3 is a flowchart of a graphics adaptation method shown in Embodiment 2 of the present invention;
图4是本发明实施例二示出的步骤S100的流程图;4 is a flowchart of step S100 shown in the second embodiment of the present invention;
图5是本发明实施例二示出的步骤S600的流程图;FIG. 5 is a flowchart of step S600 shown in the second embodiment of the present invention;
图6是本发明实施例二示出的步骤S300的流程图。Fig. 6 is a flowchart of step S300 shown in the second embodiment of the present invention.
图中,1、Web服务器;11、去重模块;12、存储模块;2、写服务器;3、tag信息读取模块;31、解析单元;32、判断单元;33、读取单元;4、元信息读取模块;5、切图模块;6、预处理模块;7、上传子系统;8、切图子系统。In the figure, 1. Web server; 11. Deduplication module; 12. Storage module; 2. Write server; 3. Tag information reading module; 31. Analysis unit; 32. Judgment unit; 33. Reading unit; 4. Meta-information reading module; 5. Picture cutting module; 6. Preprocessing module; 7. Uploading subsystem; 8. Picture cutting subsystem.
具体实施方式detailed description
以下结合附图对本申请作进一步详细说明。The application will be further described in detail below in conjunction with the drawings.
实施例一Example one
参照图1,为本申请公开的一种图形适配系统,包括上传子系统7和切图子系统8,上传子系统7包括Web服务器1、写服务器2和预处理模块6,切图子系统8包括tag信息读取模块3、元信息读取模块4和切图模块5。1, a graphics adaptation system disclosed in this application includes an uploading subsystem 7 and a picture cutting subsystem 8. The uploading subsystem 7 includes a Web server 1, a writing server 2 and a preprocessing module 6, and a picture cutting subsystem 8 includes the tag information reading module 3, the meta information reading module 4 and the image cutting module 5.
Web服务器1用于查询用户上传的图片有无重复,并对不重复的图片进行上传,对重复的图片直接返回相应的图片id,以将该图片与用户输入的信息相绑定。The web server 1 is used for querying whether the pictures uploaded by the user are duplicated, uploading pictures that are not duplicated, and directly returning the corresponding picture id for the duplicated pictures, so as to bind the picture with the information input by the user.
写服务器2用于获取Web服务器1上传的图片并保存,其还用于管理维护所保存图片的元信息,在一些实施例中,图片的元信息包括图片id、图片内容信息、图片分类信息等。The writing server 2 is used to obtain and save the pictures uploaded by the Web server 1, and it is also used to manage and maintain the meta-information of the saved pictures. In some embodiments, the meta-information of the pictures includes picture id, picture content information, picture classification information, etc. .
tag信息读取模块3用于接收并解析传来的与用户终端类型相对应的图片URL,并用于根据解析数据获取对应的图片id和切图样式。The tag information reading module 3 is used to receive and parse the transmitted picture URL corresponding to the user terminal type, and is used to obtain the corresponding picture id and picture cut style according to the parsed data.
元信息读取模块4用于根据tag信息读取模块3获取的图片id从写服务器2中获取相应图片的元信息以及原图文件信息。The meta-information reading module 4 is used to obtain the meta-information of the corresponding picture and the original image file information from the writing server 2 according to the picture id obtained by the tag information reading module 3.
切图模块5用于利用tag信息读取模块3获取的切图样式对元信息读取模块4获取的原图进行裁剪,并将裁剪后的图片返回至用户终端。The image cutting module 5 is configured to use the image cutting style obtained by the tag information reading module 3 to crop the original image obtained by the meta-information reading module 4, and return the cropped image to the user terminal.
预处理模块6用于将Web服务器1上传的图片预处理为设定格式和设定样式规格的图片后,上传至所述写服务器2。在一些实施例中,当Web服务器1上传的图片不是jpg格式时,预处理模块6将图片转换为jpg格式;当Web服务器1上传的图片的像素大于设定值例如1500时,将图片处理为1500*1500的样式规格。The preprocessing module 6 is used to preprocess the pictures uploaded by the Web server 1 into pictures with a set format and a set style specification, and then upload them to the writing server 2. In some embodiments, when the picture uploaded by the Web server 1 is not in the jpg format, the preprocessing module 6 converts the picture into the jpg format; when the pixels of the picture uploaded by the Web server 1 are greater than the set value, such as 1500, the picture is processed as 1500*1500 style specifications.
参照图2,Web服务器1包括去重模块11和存储模块12。去重模块11用于将用户上传的图片进行像素处理,以使图片的所有像素点均只有黑白两种颜色,即将彩色照片处理为黑白照片;去重模块11将彩色照片处理为黑白照片以后还会将黑白照片进行等比例缩小并形成对比图像,在本实施例中,去重模块11将处理后的黑白图片等比例缩小为原来的四分之一;另外,去重模块11还用于将得到的对比图像与写服务器2中所有图片对应的对比图像进行对比,并判断是否重复。存储模块12用于存储写服务器2中所有图片的对比图像,其还用于在去重模块11判断图片为不重复时,将去重模块11得到的对比图像进行存储。2, the Web server 1 includes a deduplication module 11 and a storage module 12. The deduplication module 11 is used for pixel processing of the picture uploaded by the user, so that all pixels of the picture have only two colors of black and white, that is, the color photo is processed into a black and white photo; the deduplication module 11 processes the color photo into a black and white photo and then restores it. The black and white photos will be scaled down to form a contrast image. In this embodiment, the deduplication module 11 will scale down the processed black and white pictures to a quarter of the original; in addition, the deduplication module 11 is also used to reduce The obtained comparison image is compared with the comparison images corresponding to all the pictures in the writing server 2, and it is judged whether it is a duplicate. The storage module 12 is used to store the comparison images of all the pictures in the writing server 2, and is also used to store the comparison images obtained by the deduplication module 11 when the deduplication module 11 determines that the pictures are not repeated.
参照图2,tag信息读取模块3包括解析单元31、判断单元32、读取单元33。解析单元31用于对传来的与用户终端对应的图片URL进行解析,从而获 取图片切图的标签信息tag和图片id,在一些实施例中,图片URL由系统解析用户端的请求而来并由域名、切图的规则、图片id组成。判断单元32用于根据标签信息tag判断是否需要切图,读取单元33用于在判断单元32判断为否时,构造图片原图标签并上传至元信息读取模块4,在判断单元32判断为是时,读取单元33才读取标签信息tag中的切图样式并上传至元信息读取模块4。需要说明的是,标签信息tag包括用于表示是否切图的第一特征信息和包含切图样式的第二特征信息。2, the tag information reading module 3 includes an analysis unit 31, a judgment unit 32, and a reading unit 33. The parsing unit 31 is used to parse the image URL corresponding to the user terminal, so as to obtain the tag information tag and the image id of the image cut. In some embodiments, the image URL is derived from the request of the user terminal after the system parses the image. The domain name, the rules for cutting pictures, and the picture id composition. The judging unit 32 is used for judging whether the image needs to be cut according to the tag information tag, and the reading unit 33 is used for constructing the original image tag of the picture and uploading it to the meta-information reading module 4 when the judging unit 32 judges no, and the judging unit 32 judges If yes, the reading unit 33 reads the cut pattern in the tag information tag and uploads it to the meta-information reading module 4. It should be noted that the tag information tag includes first feature information used to indicate whether to cut the image and second feature information including the image cut style.
上述实施例的实施原理为:The implementation principle of the foregoing embodiment is as follows:
当用户上传一份图片时,为了节省存储容量,避免图片重复上传,首先Web服务器1会对图片进行校验去重,对于重复图片直接返回相应的图片id并与用户请求信息形成对应,不再重复上传。不重复的图片上传后,预处理模块6对上传的图片进行预处理,即,在默认情况下,对于上传原图像素大于设定值的图片进行实时切图,例如对上传原图像素大于1500的图片进行实时切图时,会统一处理到1500*1500的样式规格且调整图片格式为jpg,从而限制图片存储大小和格式。最后进行转发及备份,即预处理模块6将处理好的图片转发到写服务器2,并写入文件,同时通过写服务器2可以管理维护图片的元信息。When a user uploads a picture, in order to save storage capacity and avoid repeated uploading of the picture, the Web server 1 first checks the picture and removes duplicates. For repeated pictures, the corresponding picture id is directly returned and corresponds to the information requested by the user. Repeat upload. After uploading unique pictures, the preprocessing module 6 preprocesses the uploaded pictures, that is, by default, real-time cutting is performed on pictures with pixels larger than the set value in the original uploaded picture, for example, if the pixels of the uploaded original picture are larger than 1500 When cutting the pictures in real time, it will be uniformly processed to the style specification of 1500*1500 and the picture format will be adjusted to jpg, thus limiting the picture storage size and format. Finally, forwarding and backup are performed, that is, the preprocessing module 6 forwards the processed pictures to the writing server 2 and writes them into the file. At the same time, the writing server 2 can manage and maintain the meta-information of the pictures.
在切图时,系统在只存一份原图的基础上,配合样式规则,根据用户的样式需求,每次请求动态切图,即可返回不同尺寸的图片。在一些实施例中,用户终端发送请求后,tag信息读取模块3首先解析图片URL,根据图片URL的构成规则,获取切图规格。随后,元信息读取模块4会根据图片id获取图片的原信息以及原图的文件信息。最后,切图模块5在得到原图信息及切图样式后,利用切图样式对原图进行裁剪,同时在裁剪的过程中,可以配置是否缩放等各种参数,以满足不同尺寸的要求。裁剪完成后,系统会将相应尺寸的图片返回至请求端。When cutting the picture, the system saves only one original picture, cooperates with the style rules, and according to the style requirements of the user, every time a dynamic picture cutting is requested, pictures of different sizes can be returned. In some embodiments, after the user terminal sends the request, the tag information reading module 3 first parses the picture URL, and obtains the picture cut specifications according to the composition rule of the picture URL. Subsequently, the meta-information reading module 4 obtains the original information of the image and the file information of the original image according to the image id. Finally, after the image cutting module 5 obtains the original image information and the image cutting style, it uses the image cutting style to cut the original image. At the same time, various parameters such as whether to zoom or not can be configured during the cutting process to meet the requirements of different sizes. After the cropping is completed, the system will return the corresponding size picture to the requester.
实施例二Example two
参照图3,为本申请公开的一种基于实施例一中图形适配系统的图形适配方法,包括图片上传方法A和图片切图方法B。Referring to FIG. 3, a graphics adaptation method based on the graphics adaptation system in the first embodiment disclosed in this application includes a picture upload method A and a picture cut method B.
图片上传方法A包括以下步骤:Picture upload method A includes the following steps:
S100、图片校验去重:在用户上传图片时进行去重,对于重复图片直接返回图片id,不再重复上传。S100. Image verification and deduplication: deduplication is performed when the user uploads the image, and the image id is directly returned to the duplicate image, and the upload is not repeated.
S600、图片预处理:将步骤S100中判断为不重复的图片预处理为原图片然 后进入S200。S600. Picture preprocessing: preprocess the pictures judged to be non-repetitive in step S100 as original pictures, and then enter S200.
S200、转发及备份:转发步骤S600中预处理后的图片到写服务器2并写入文件,同时管理维护图片的元信息,每一图片的元信息均包括图片id。S200. Forwarding and backup: forwarding the picture preprocessed in step S600 to the writing server 2 and writing the file, while managing and maintaining the meta-information of the picture. The meta-information of each picture includes a picture id.
图片切图方法B包括以下步骤:Picture cutting method B includes the following steps:
S300、获取切图规格:解析传来的与用户终端类型相对应的图片URL并获取图片id和切图样式。在一些实施例中,图片URL由域名、标签信息tag以及图片id组成,标签信息tag包括用于表示是否切图的第一特征信息和包含切图样式的第二特征信息。S300. Obtain the picture cut specification: parse the transmitted picture URL corresponding to the user terminal type and obtain the picture id and picture cut style. In some embodiments, the picture URL is composed of a domain name, a tag information tag, and a picture id. The tag information tag includes first feature information indicating whether to cut the picture and second feature information including the cut picture style.
S400、获取图片元信息:根据图片id获取图片的元信息以及原图的文件信息。S400. Obtain the picture meta information: Obtain the meta information of the picture and the file information of the original picture according to the picture id.
S500、切图:在得到图片的元信息、原图的文件信息及切图样式后,利用切图样式对原图进行裁剪并返回至用户终端。S500. Cut the picture: After obtaining the meta information of the picture, the file information of the original picture and the picture cut style, use the picture cut style to cut the original picture and return it to the user terminal.
参照图4,步骤S100包括以下子步骤:Referring to FIG. 4, step S100 includes the following sub-steps:
S101、将用户上传的图片通过MD5信息摘要算法进行处理并产生一个散列值;S101: Process the picture uploaded by the user through the MD5 information digest algorithm and generate a hash value;
S102、将子步骤S101中产生的散列值与写服务器2中所有图片的散列值进行对比并判断是否重复;若重复,则进入子步骤S103;若不重复,则进入子步骤S104;S102. Compare the hash value generated in sub-step S101 with the hash values of all pictures in the writing server 2 and determine whether it is repeated; if it is repeated, go to sub-step S103; if not, go to sub-step S104;
S103、对重复图片直接返回相应的图片id,不再重复上传;S103: Directly return the corresponding picture id for the repeated pictures, and do not repeatedly upload them;
S104、将子步骤S101中产生的散列值进行存储,然后进入步骤S200。S104: Store the hash value generated in sub-step S101, and then go to step S200.
参照图5,步骤S600包括以下子步骤:Referring to FIG. 5, step S600 includes the following sub-steps:
S601、获取步骤S100中判断为不重复的图片的基本信息,该基本信息包括图片的格式和图片的样式规格;S601: Acquire basic information of pictures that are determined to be non-repetitive in step S100, where the basic information includes the format of the picture and the style specification of the picture;
S602、判断子步骤S601中获取图片的格式是否为jpg;若图片不是jpg格式,则进入子步骤S603;若图片是jpg格式,则进入子步骤S604;S602. Determine whether the format of the picture obtained in sub-step S601 is jpg; if the picture is not in jpg format, go to sub-step S603; if the picture is in jpg format, go to sub-step S604;
S603、将图片转换为jpg格式,并进入子步骤S604;S603: Convert the picture into a jpg format, and enter sub-step S604;
S604、将图片裁剪为设定样式规格的原图片,并进入步骤S200。S604: Crop the picture into an original picture with a set style and specification, and go to step S200.
参照图6,步骤S300包括以下子步骤:Referring to FIG. 6, step S300 includes the following sub-steps:
S301、终端应用根据终端的类型生成图片URL;S301: The terminal application generates a picture URL according to the type of the terminal;
S302、对子步骤S301中生成的图片URL进行解析并获取图片id和图片切图的标签信息tag;S302: parse the picture URL generated in sub-step S301 and obtain the picture id and the tag information tag of the picture cut;
S303、判断子步骤S302中获取的图片切图的标签信息tag是否为原图;若判断为是,则进入子步骤S304;若判断为否,则进入子步骤S305;S303. Determine whether the tag information tag of the picture cut obtained in sub-step S302 is the original image; if the determination is yes, then go to sub-step S304; if the judgment is no, then go to sub-step S305;
S304、构造图片原图标签,并进入步骤S400;S304, construct the original picture label of the picture, and enter step S400;
S305、读取标签信息tag中的切图样式,并进入步骤S400。S305: Read the cut pattern in the tag information tag, and enter step S400.

Claims (9)

  1. 一种图形适配系统,包括:A graphics adaptation system, including:
    Web服务器(1),被设置为查询用户上传的图片有无重复,并对不重复的图片进行上传,对重复的图片直接返回相应的图片id;The web server (1) is set to query whether the pictures uploaded by the user are duplicated, upload the pictures that are not duplicated, and directly return the corresponding picture id for the duplicate pictures;
    写服务器(2),被设置为获取所述Web服务器(1)上传的图片并保存,其还被设置为管理维护所保存图片的元信息,所述元信息包括图片id;The writing server (2) is set to obtain and save the pictures uploaded by the Web server (1), and it is also set to manage and maintain the meta information of the saved pictures, and the meta information includes the picture id;
    tag信息读取模块(3),被设置为接收并解析传来的与用户终端类型相对应的图片URL,以获取对应的图片id和切图样式;The tag information reading module (3) is set to receive and parse the transmitted picture URL corresponding to the user terminal type to obtain the corresponding picture id and picture cut style;
    元信息读取模块(4),被设置为根据所述tag信息读取模块(3)获取的图片id从写服务器(2)中获取相应图片的元信息以及原图文件信息;The meta-information reading module (4) is configured to obtain the meta-information of the corresponding picture and the original picture file information from the writing server (2) according to the picture id obtained by the tag information reading module (3);
    切图模块(5),被设置为利用所述tag信息读取模块(3)获取的切图样式对元信息读取模块(4)获取的原图进行裁剪并返回至用户终端。The image cutting module (5) is configured to use the image cutting style acquired by the tag information reading module (3) to cut the original image acquired by the meta information reading module (4) and return it to the user terminal.
  2. 根据权利要求1所述的图形适配系统,其中,所述Web服务器(1)包括:The graphics adaptation system according to claim 1, wherein the Web server (1) comprises:
    去重模块(11),被设置为将用户上传的图片处理为所有像素点均只有黑白两种颜色的图片并对处理后的图片进行等比例缩小以形成对比图像,其还被设置为将形成的对比图像与写服务器(2)中所有图片对应的对比图像进行对比并判断是否重复;The deduplication module (11) is set to process the picture uploaded by the user into a picture in which all pixels are only black and white, and the processed picture is scaled down to form a contrast image. It is also set to form a Compare the comparison image of with the comparison images corresponding to all the pictures in the writing server (2) and judge whether they are duplicates;
    存储模块(12),被设置为存储所述写服务器(2)中所有图片的对比图像,其还被设置为在所述去重模块(11)判断为否时,将所述去重模块(11)得到的对比图像进行存储。The storage module (12) is configured to store the comparison images of all pictures in the writing server (2), and is also configured to, when the deduplication module (11) determines no, the deduplication module ( 11) The obtained comparison image is stored.
  3. 根据权利要求1所述的图形适配系统,所述图形适配系统还包括预处理模块(6),所述预处理模块(6)被设置为将Web服务器(1)上传的图片预处理为设定格式和设定样式规格的图片后上传至所述写服务器(2)。The graphics adaptation system according to claim 1, further comprising a preprocessing module (6), the preprocessing module (6) is configured to preprocess the pictures uploaded by the Web server (1) into After setting the format and setting style specifications, the pictures are uploaded to the writing server (2).
  4. 根据权利要求1所述的图形适配系统,其中,所述tag信息读取模块(3)包括:The graphics adaptation system according to claim 1, wherein the tag information reading module (3) comprises:
    解析单元(31),被设置为对传来的与用户终端对应的图片URL进行解析以获取图片切图的标签信息tag和图片id;The parsing unit (31) is set to parse the transmitted picture URL corresponding to the user terminal to obtain the tag information tag and picture id of the picture cut;
    判断单元(32),被设置为根据所述标签信息tag判断是否需要切图;The judging unit (32) is set to judge whether the image needs to be cut according to the tag information tag;
    读取单元(33),被设置为在所述判断单元(32)判断为否时,构造图片原图标签并上传至所述元信息读取模块(4);其还被设置为在所述判断单元(32)判断为是时,读取所述标签信息tag中的切图样式并上传至所述元信息读取模块(4);The reading unit (33) is set to construct the original picture tag and upload it to the meta-information reading module (4) when the judgment unit (32) judges no; it is also set to When the judgment unit (32) judges as yes, read the cut pattern in the tag information tag and upload it to the meta-information reading module (4);
    其中,所述标签信息tag包括用于表示是否切图的第一特征信息和包含切图 样式的第二特征信息。Wherein, the tag information tag includes first feature information used to indicate whether the image is cut and second feature information including the image cut style.
  5. 一种图形适配方法,所述图形适配方法基于权利要求1所述的图形适配系统,包括图片上传方法A和图片切图方法B;A graphics adaptation method, which is based on the graphics adaptation system of claim 1, and includes a picture upload method A and a picture cut method B;
    所述图片上传方法A包括以下步骤:The picture uploading method A includes the following steps:
    S100、图片校验去重:在用户上传图片时进行去重,对于重复图片直接返回图片id,不再重复上传;S100. Image verification and de-duplication: De-duplication is performed when the user uploads the image, and the image id is directly returned to the duplicate image, and no repeated upload is required;
    S200、转发及备份:转发步骤S100中判断为不重复的图片到写服务器(2)并写入文件,同时管理维护图片的元信息,每一图片的元信息均包括图片id;S200. Forwarding and backup: forwarding the pictures judged to be non-repetitive in step S100 to the writing server (2) and writing them into files, while managing and maintaining the meta information of the pictures, the meta information of each picture includes a picture id;
    所述图片切图方法B包括以下步骤:The picture cutting method B includes the following steps:
    S300、获取切图规格:解析传来的与用户终端类型相对应的图片URL并获取图片id和切图样式;S300. Obtain the picture cut specification: parse the transmitted picture URL corresponding to the user terminal type and obtain the picture id and picture cut style;
    S400、获取图片元信息:根据图片id获取图片的元信息,以及原图的文件信息;S400. Obtaining image meta information: obtaining the meta information of the image and the file information of the original image according to the image id;
    S500、切图:在得到图片的元信息、原图的文件信息及切图样式后,利用切图样式对原图进行裁剪并返回至用户终端。S500. Cut the picture: After obtaining the meta information of the picture, the file information of the original picture and the picture cut style, use the picture cut style to cut the original picture and return it to the user terminal.
  6. 根据权利要求5所述的图形适配方法,其中,步骤S100包括以下子步骤:The graphics adaptation method according to claim 5, wherein step S100 comprises the following sub-steps:
    S101、将用户上传的图片通过MD5信息摘要算法进行处理并产生一个散列值;S101: Process the picture uploaded by the user through the MD5 information digest algorithm and generate a hash value;
    S102、将子步骤S101中产生的散列值与写服务器(2)中所有图片的散列值进行对比并判断是否重复;若重复,则进入子步骤S103;若不重复,则进入子步骤S104;S102. Compare the hash value generated in sub-step S101 with the hash values of all pictures in the writing server (2) and determine whether it is repeated; if it is repeated, go to sub-step S103; if not, go to sub-step S104 ;
    S103、对重复图片直接返回相应的图片id,不再重复上传;S103: Directly return the corresponding picture id for the repeated pictures, and do not repeatedly upload them;
    S104、将子步骤S101中产生的散列值进行存储,然后进入步骤S200。S104: Store the hash value generated in sub-step S101, and then go to step S200.
  7. 根据权利要求5所述的图形适配方法,其中,所述图片上传方法A还包括以下步骤:The graphic adaptation method according to claim 5, wherein the picture uploading method A further comprises the following steps:
    S600、图片预处理:将步骤S100中判断为不重复的图片预处理成固定规则的图片;S600. Picture preprocessing: preprocessing the pictures judged to be non-repetitive in step S100 into pictures with fixed rules;
    所述步骤S600包括以下子步骤:The step S600 includes the following sub-steps:
    S601、获取步骤S100中判断为不重复的图片的基本信息,所述基本信息包括格式和样式规格;S601: Acquire basic information of pictures that are determined to be non-repetitive in step S100, where the basic information includes format and style specifications;
    S602、判断子步骤S601中获取图片的格式;若图片非jpg格式,则进入子 步骤S603;若图片为jpg格式,则进入子步骤S604;S602. Determine the format of the picture obtained in sub-step S601; if the picture is not in jpg format, go to sub-step S603; if the picture is in jpg format, go to sub-step S604;
    S603、将图片转换为jpg格式,并进入子步骤S604;S603: Convert the picture into a jpg format, and enter sub-step S604;
    S604、将图片裁剪为设定样式规格的图片,并进入步骤S200。S604: Crop the picture into a picture with a set style and specification, and go to step S200.
  8. 根据权利要求5所述的图形适配方法,其中,所述步骤S300包括以下子步骤:The graphics adaptation method according to claim 5, wherein said step S300 comprises the following sub-steps:
    S301、根据终端的类型生成图片URL;S301: Generate a picture URL according to the type of the terminal;
    S302、对子步骤S301中生成的图片URL进行解析并获取图片id和图片切图的标签信息tag;S302: parse the picture URL generated in sub-step S301 and obtain the picture id and the tag information tag of the picture cut;
    S303、判断子步骤S302中获取的图片切图的标签信息tag是否为原图;若判断为是,则进入子步骤S304;若判断为否,则进入子步骤S305;S303. Determine whether the tag information tag of the picture cut obtained in sub-step S302 is the original image; if the judgment is yes, then go to sub-step S304; if the judgment is no, then go to sub-step S305;
    S304、构造图片原图标签,并进入步骤S400;S304, construct the original picture label of the picture, and enter step S400;
    S305、读取标签信息tag中的切图样式,并进入步骤S400。S305: Read the cut pattern in the tag information tag, and enter step S400.
  9. 根据权利要求8所述的图形适配方法,其中,所述图片URL由域名、标签信息tag以及图片id组成,所述标签信息tag包括用于表示是否切图的第一特征信息和包含切图样式的第二特征信息。The graphic adaptation method according to claim 8, wherein the picture URL is composed of a domain name, a tag information tag, and a picture id, and the tag information tag includes first feature information for indicating whether to cut the picture and includes the cut picture The second feature information of the style.
PCT/CN2019/122009 2019-09-28 2019-11-29 Graphic adaptation system and graphic adaptation method based on same WO2021056812A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910928402.0A CN110765396A (en) 2019-09-28 2019-09-28 Figure adapting system and figure adapting method based on same
CN201910928402.0 2019-09-28

Publications (1)

Publication Number Publication Date
WO2021056812A1 true WO2021056812A1 (en) 2021-04-01

Family

ID=69330740

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/122009 WO2021056812A1 (en) 2019-09-28 2019-11-29 Graphic adaptation system and graphic adaptation method based on same

Country Status (3)

Country Link
CN (1) CN110765396A (en)
DE (1) DE202020105321U1 (en)
WO (1) WO2021056812A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113382180B (en) * 2021-06-01 2023-02-28 海南车智易通信息技术有限公司 Picture processing method, computing device and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102811442A (en) * 2011-06-03 2012-12-05 杨珺 Control method and control system for supporting self-adaptation display of multi-type cellphone terminal pictures based on internet of things
CN103390012A (en) * 2012-09-13 2013-11-13 爱乐活(北京)科技有限公司 Display picture generating method and device based on access
CN103729825A (en) * 2013-12-31 2014-04-16 世纪龙信息网络有限责任公司 Method for processing picture in dynamic adaption to terminal
CN105512329A (en) * 2015-12-24 2016-04-20 上海携程商务有限公司 GO-language-based dynamic figure cutting system
CN106682130A (en) * 2016-12-14 2017-05-17 北京五八信息技术有限公司 Similar picture detection method and device
CN109684568A (en) * 2018-12-13 2019-04-26 珠海天燕科技有限公司 Image processing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102811442A (en) * 2011-06-03 2012-12-05 杨珺 Control method and control system for supporting self-adaptation display of multi-type cellphone terminal pictures based on internet of things
CN103390012A (en) * 2012-09-13 2013-11-13 爱乐活(北京)科技有限公司 Display picture generating method and device based on access
CN103729825A (en) * 2013-12-31 2014-04-16 世纪龙信息网络有限责任公司 Method for processing picture in dynamic adaption to terminal
CN105512329A (en) * 2015-12-24 2016-04-20 上海携程商务有限公司 GO-language-based dynamic figure cutting system
CN106682130A (en) * 2016-12-14 2017-05-17 北京五八信息技术有限公司 Similar picture detection method and device
CN109684568A (en) * 2018-12-13 2019-04-26 珠海天燕科技有限公司 Image processing method and device

Also Published As

Publication number Publication date
CN110765396A (en) 2020-02-07
DE202020105321U1 (en) 2020-12-03

Similar Documents

Publication Publication Date Title
US7065249B2 (en) System and method for image editing
CN101277355B (en) Printer and scanner utilizing a file sharing protocol
JP2007523409A (en) Method and apparatus for content synchronization / tracking
US20020133515A1 (en) Method and apparatus for synchronizing multiple versions of digital data
US20080032739A1 (en) Management of digital media using portable wireless devices in a client-server network
JP2005534108A (en) Imaging system that provides dynamic viewport tiering optimized for specific client device types
US20070263260A1 (en) Print record management device, print record management method, print record management program storage medium, and print record management system
US20140067456A1 (en) Cost management system, cost management apparatus, and cost management method
US20150146246A1 (en) Information processing apparatus, system, method, and storage medium
JP2008502985A (en) Print / display control information transmission / storage device and method, and recording medium storing computer program for performing the method
JP5829083B2 (en) Techniques for synchronizing any of multiple associated multimedia assets in a distributed system
WO2021056812A1 (en) Graphic adaptation system and graphic adaptation method based on same
US8873110B2 (en) Host apparatus to generate workform, workform management server to edit an image, workform management system, and method of editing an image using a workform
US20050157343A1 (en) Image forming apparatus, apparatus for creating electronic album, image forming method, method for creating electronic album, program and index sheet
JP2016514393A (en) Serialization for differential encoding
US20200293610A1 (en) Document editing apparatus and non-transitory computer readable medium
US8482763B2 (en) Method and apparatus for generating a file using address and information tags
JP2008035224A (en) Log information management system, log information management device, log information management method, log information management program, and storage medium
US20070185753A1 (en) Image processing apparatus and image processing method
JP4434925B2 (en) Information processing method, information processing apparatus, program, and storage medium
JP4497539B2 (en) Printing condition judgment method
JP2003196042A (en) Terminal unit, printing system, server, program and output medium
JP2002354309A (en) Digital camera link system and record medium recording image data processing program
JP2004048564A (en) Digital camera apparatus
US10931848B2 (en) Adding a graphical symbol to a print stream for a document file

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19946276

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19946276

Country of ref document: EP

Kind code of ref document: A1