CN107609030B - Picture management method and system - Google Patents

Picture management method and system Download PDF

Info

Publication number
CN107609030B
CN107609030B CN201710676113.7A CN201710676113A CN107609030B CN 107609030 B CN107609030 B CN 107609030B CN 201710676113 A CN201710676113 A CN 201710676113A CN 107609030 B CN107609030 B CN 107609030B
Authority
CN
China
Prior art keywords
picture
file name
data information
hash value
current page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710676113.7A
Other languages
Chinese (zh)
Other versions
CN107609030A (en
Inventor
陈朱尧
薛龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Starcor Information Technology Co ltd
Original Assignee
Chengdu Starcor Information Technology Co ltd
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 Chengdu Starcor Information Technology Co ltd filed Critical Chengdu Starcor Information Technology Co ltd
Priority to CN201710676113.7A priority Critical patent/CN107609030B/en
Publication of CN107609030A publication Critical patent/CN107609030A/en
Application granted granted Critical
Publication of CN107609030B publication Critical patent/CN107609030B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a picture management method and a picture management system. The method comprises the following steps: acquiring static data information and dynamic data information of a current page; determining a hash value of the current page file name according to the static data information and the dynamic data information; acquiring a storage file name corresponding to an initial picture stored in a current page according to the page name of the current page; and managing the pictures according to the hash value and the storage file name. By the technical scheme, on one hand, the technical defect of repeated management caused by the fact that the pictures are managed through the URL in the prior art is overcome; on the other hand, the technical effects of improving the load running speed and saving the storage space of the computer are achieved.

Description

Picture management method and system
Technical Field
The invention relates to the technical field of computers, in particular to a picture management method and a picture management system.
Background
With the continuous development of scientific technology, the development of internet technology is more rapid, and more websites choose to transmit various information to users through pictures. In the prior art, each website caches data of pictures to be displayed, so that picture links (such as picture URLs) on the website use links of a cache service, and a link relationship between the picture links and picture source files is set. When the user accesses, the user only needs to click the picture link, and then directly sees the picture of the related information.
However, in the process of the inventors of the present invention, it was found that at least the following problems exist:
1. the picture is managed by depending on the URL of the picture, and if a plurality of picture servers correspond to different domain names and IPs, repeated management can be caused;
2. wasting space and reducing access speed.
Disclosure of Invention
In order to solve the technical problem, the invention provides a picture management method and a picture management system.
According to an aspect of the present invention, an embodiment of the present invention provides a picture management method, where the method includes:
acquiring static data information and dynamic data information of a current page;
determining a hash value of the file name of the current page according to the static data information and the dynamic data information;
acquiring a storage file name corresponding to an initial picture stored in the current page according to the page name of the current page;
and managing the picture according to the hash value and the storage file name.
According to the technical scheme provided by the embodiment, the picture is managed by obtaining the hash value of the current page file name and obtaining the storage file name corresponding to the initial picture stored in the current page. On one hand, the technical defect that in the prior art, when the pictures are managed through the URLs, the same picture is managed for multiple times because the same picture corresponds to different URLs and different IP addresses in different servers; on the other hand, the technical effects of improving the running speed of the load and saving the storage space are achieved.
Further, the determining a hash value of the current page filename according to the static data information and the dynamic data information specifically includes:
acquiring a first picture file name according to the static data information;
acquiring a second picture file name according to the dynamic data information;
and determining the hash value according to the first picture file name and the second picture file name.
According to the technical scheme provided by the embodiment, the first picture file name corresponding to the static data information is acquired, the second picture file name corresponding to the dynamic data information is acquired, and the hash value is determined according to the two acquired picture file names. The technical effect of rapidly and accurately acquiring the hash value of the current page file name is achieved.
Further, the determining the hash value according to the first picture file name and the second picture file name specifically includes:
splicing the first picture file name and the second picture file name to obtain a spliced file name;
generating a character string according to the spliced file name;
and determining the hash value according to the character string.
According to the technical scheme provided by the embodiment, the two acquired picture file names are spliced to obtain the spliced file name, and the hash value is determined according to the character string corresponding to the spliced file name. The technical effect of rapidly and accurately acquiring the hash value of the current page file name is further achieved.
Further, the managing the picture according to the hash value and the storage filename specifically includes:
deleting the initial picture when the hash value corresponding to the storage file name is different from the hash value;
sending a picture updating request to a server according to the static data information and the dynamic data information;
and caching the picture according to the received information fed back by the server.
By the technical scheme provided by the embodiment, different management modes are provided when the pictures are managed. After the hash value corresponding to the stored file name is compared with the hash value, if the two hash values are different, the initial picture is deleted, and the picture is cached. The management of deleting and updating the pictures in time is realized.
Further, the caching the picture according to the received information fed back by the server specifically includes:
determining an original picture corresponding to the picture to be cached according to the information fed back by the server;
drawing the original picture according to the element information of the current page;
and converting the format of the drawn picture into a preset format and then caching.
According to the technical scheme provided by the embodiment, the original picture is drawn, and the format of the original picture is converted after the original picture is drawn, so that the picture is cached. The technical effect of caching the pictures quickly and accurately is achieved.
According to another aspect of the present invention, an embodiment of the present invention provides a picture management system corresponding to the above-mentioned embodiment, the system including:
a first obtaining module: the method comprises the steps of obtaining static data information and dynamic data information of a current page;
a determination module: the hash value of the current page file name is determined according to the static data information and the dynamic data information;
a second obtaining module: the storage file name corresponding to the initial picture stored in the current page is obtained according to the page name of the current page;
a management module: and the image management module is used for managing the image according to the hash value and the storage file name.
Further, the determining module is specifically configured to:
acquiring a first picture file name according to the static data information;
acquiring a second picture file name according to the dynamic data information;
and determining the hash value according to the first picture file name and the second picture file name.
Further, the determining module is further specifically configured to:
splicing the first picture file name and the second picture file name to obtain a spliced file name;
generating a character string according to the spliced file name;
and determining the hash value according to the character string.
Further, the management module is specifically configured to:
when the storage file name is different from the hash value, deleting the initial picture;
sending a picture updating request to a server according to the static data information and the dynamic data information;
and caching the picture according to the received information fed back by the server.
Further, the management module is further specifically configured to:
determining an original picture corresponding to the picture to be cached according to the information fed back by the server;
drawing the original picture according to the element information of the current page;
and converting the format of the drawn picture into a preset format and then caching.
Drawings
Fig. 1 is a schematic flowchart of a picture management method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a picture management method according to another embodiment of the present invention;
fig. 3 is a flowchart illustrating a picture management method according to another embodiment of the present invention;
fig. 4 is a flowchart illustrating a picture management method according to another embodiment of the present invention;
fig. 5 is a flowchart illustrating a picture management method according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of a picture management system according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, interfaces, techniques, etc., in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
The invention provides a picture management method and a picture management system.
According to an aspect of the present invention, an embodiment of the present invention provides a picture management method.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a picture management method according to an embodiment of the present invention.
As shown in fig. 1, the method includes:
step S100: acquiring static data information and dynamic data information of a current page;
step S200: determining a hash value of the current page file name according to the static data information and the dynamic data information;
step S300: acquiring a storage file name corresponding to an initial picture stored in a current page according to the page name of the current page;
step S400: and managing the pictures according to the hash value and the storage file name.
In this embodiment, the hash value of the filename of the current page is determined according to the obtained static data information and dynamic data information of the current page. It can be understood that the storage file name corresponding to the initial picture stored in each page and the page name thereof have a one-to-one correspondence relationship. Therefore, the storage file name corresponding to the initial picture stored in the current page can be obtained according to the page name of the current page. And after the hash value and the storage file name are obtained, managing the picture according to the hash value and the storage file name.
Through the technical scheme provided by the embodiment, on one hand, the technical defects that in the prior art, the pictures are managed according to the URLs of the pictures, and if a plurality of picture servers correspond to different URLs or IPs, the pictures are repeatedly managed are avoided. And the storage space of picture management is undoubtedly wasted, and the access speed is reduced. On the other hand, the technical effects of quickly and accurately managing the pictures, saving the storage space, reducing the load and accelerating the running speed are achieved.
Referring to fig. 2, fig. 2 is a flowchart illustrating a picture management method according to another embodiment of the present invention.
As shown in fig. 2, step S200 specifically includes:
step S210: acquiring a first picture file name according to the static data information;
step S220: acquiring a second picture file name according to the dynamic data information;
step S230: and determining a hash value according to the first picture file name and the second picture file name.
In the present embodiment, how to determine the hash value of the current page file name according to the static data information and the dynamic data information is described in detail. Specifically, the method comprises the following steps:
and determining a hash value according to the two picture file names according to the first picture file name determined by the static data information and the second picture file name determined by the dynamic data information.
Here, the first picture file name is a file name obtained by combining file names of all pictures acquired from the still data information. Similarly, the second picture file name is a file name obtained by combining the file names of all the pictures acquired from the dynamic data information.
Through the technical scheme that this embodiment provided, realized the technological effect of the hash value of quick and accurate definite current page file name to further realize quick and accurate technological effect of managing the picture.
Referring to fig. 3, fig. 3 is a flowchart illustrating a picture management method according to another embodiment of the present invention.
As shown in fig. 3, step S230 specifically includes:
s231: splicing the first picture file name and the second picture file name to obtain a spliced file name;
s232: generating a character string according to the name of the spliced file;
s233: and determining a hash value according to the character string.
In the present embodiment, how to determine the hash value from two picture files is described in detail. Specifically, the method comprises the following steps:
and splicing the file names of the two pictures to obtain a spliced file name. And after generating a character string according to the spliced file name, determining a hash value according to the generated character string.
Further, the string is computed using the MD5 algorithm to generate a hash value.
Through the technical scheme that this embodiment provided, realized the technological effect of quick and accurate definite hash value to realize quick and accurate carry out definite technological effect to the hash value of current page file name. The technical effect of managing the pictures is further rapidly and accurately achieved.
Referring to fig. 4, fig. 4 is a schematic flowchart illustrating a picture management method according to another embodiment of the present invention.
As shown in fig. 4, step S400 specifically includes:
step S410: when the hash value corresponding to the stored file name is different from the hash value, deleting the initial picture;
step S420: sending a picture updating request to a server according to the static data information and the dynamic data information;
step S430: and caching the picture according to the received information fed back by the server.
In this embodiment, the hash value corresponding to the storage filename is compared with the hash value of the current webpage filename.
It can be understood that if the hash value corresponding to the stored filename is the same as the hash value of the current webpage filename, it indicates that the picture does not need to be updated.
And when the hash value corresponding to the stored file name is different from the hash value of the current webpage file name, indicating that the initial picture needs to be updated. Specifically, the method comprises the following steps:
and deleting the initial picture, and sending a picture updating request to the server according to the static data information and the dynamic data information. Specifically, a picture update request is sent to the server according to the addresses of the pictures in the static data information and the dynamic data information. The request is used for indicating to acquire picture resources corresponding to the picture addresses in the static data information and the dynamic data information, and then caching the pictures according to the information fed back by the server.
By the technical scheme provided by the embodiment, the technical effect of timely managing the deletion and the update of the picture is achieved.
Referring to fig. 5, fig. 5 is a schematic flow chart of a picture management method according to another embodiment of the present invention.
As shown in fig. 5, step S430 specifically includes:
step S431: determining an original picture corresponding to a picture to be cached according to information fed back by the server;
step S432: drawing an original picture according to the element information of the current page;
step S433: and converting the format of the drawn picture into a preset format and then caching.
In this embodiment, the feedback information includes picture resources corresponding to picture addresses in the static data information and the dynamic data information, and an original picture corresponding to a picture to be cached in the picture resources is determined according to the information fed back by the server.
And drawing the original picture according to the element information of the current page, such as position, size and the like, so as to ensure that the drawn picture meets the display requirement of the current page.
After the original picture is drawn, the drawn picture is subjected to format conversion by a canvas method. Specifically, the format of the drawn picture is converted into image/octet-stream. The picture is then cached.
Specifically, after an original picture is drawn into a canvas, a character string is generated in the canvas, wherein the character string is a picture character string of base64, and the mime type in the character string is modified into a byte stream.
For example, a tag a is created, and after the href of the tag a is converted into the data url, the download attribute of the tag a is set to the hash value. And when a click event of the tag a is triggered, acquiring a hash value according to the byte stream, executing the steps in the figure 4 or the figure 5, and updating the picture storage table corresponding to the current webpage.
According to another aspect of the present invention, the present invention provides a picture management system corresponding to the above-mentioned embodiment.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a picture management system according to an embodiment of the present invention.
As shown in fig. 6, the system includes:
a first obtaining module: the method comprises the steps of obtaining static data information and dynamic data information of a current page;
a determination module: the hash value of the current page file name is determined according to the static data information and the dynamic data information;
a second obtaining module: the device comprises a storage file name acquisition module, a storage file name generation module and a storage file name generation module, wherein the storage file name acquisition module is used for acquiring a storage file name corresponding to an initial picture stored in a current page according to the page name of the current page;
a management module: and the image management module is used for managing the image according to the hash value and the storage file name.
More specifically, the determining module is specifically configured to:
acquiring a first picture file name according to the static data information;
acquiring a second picture file name according to the dynamic data information;
and determining a hash value according to the first picture file name and the second picture file name.
More specifically, the determining module is further specifically configured to:
splicing the first picture file name and the second picture file name to obtain a spliced file name;
generating a character string according to the name of the spliced file;
and determining a hash value according to the character string.
More specifically, the management module is specifically configured to:
when the stored file name is different from the hash value, deleting the initial picture;
sending a picture updating request to a server according to the static data information and the dynamic data information;
and caching the picture according to the received information fed back by the server.
More specifically, the management module is further specifically configured to:
determining an original picture corresponding to a picture to be cached according to information fed back by the server;
drawing an original picture according to the element information of the current page;
and converting the format of the drawn picture into a preset format and then caching.
The reader should understand that in the description of this specification, reference to the description of the terms "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
While the invention has been described with reference to specific embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (6)

1. A picture management method, the method comprising:
acquiring static data information and dynamic data information of a current page;
determining a hash value of the file name of the current page according to the static data information and the dynamic data information;
acquiring a storage file name corresponding to an initial picture stored in the current page according to the page name of the current page;
managing the picture according to the hash value and the storage file name;
the determining a hash value of the current page file name according to the static data information and the dynamic data information specifically includes:
acquiring a first picture file name according to the static data information;
acquiring a second picture file name according to the dynamic data information;
determining the hash value according to the first picture file name and the second picture file name;
the determining the hash value according to the first picture file name and the second picture file name specifically includes:
splicing the first picture file name and the second picture file name to obtain a spliced file name;
generating a character string according to the spliced file name;
and determining the hash value according to the character string.
2. The method according to claim 1, wherein the managing the picture according to the hash value and the storage filename specifically comprises:
deleting the initial picture when the hash value corresponding to the storage file name is different from the hash value;
sending a picture updating request to a server according to the static data information and the dynamic data information;
and caching the picture according to the received information fed back by the server.
3. The method for managing pictures according to claim 2, wherein the caching the pictures according to the received information fed back by the server specifically includes:
determining an original picture corresponding to the picture to be cached according to the information fed back by the server;
drawing the original picture according to the element information of the current page;
and converting the format of the drawn picture into a preset format and then caching.
4. A picture management system, the system comprising:
a first obtaining module: the method comprises the steps of obtaining static data information and dynamic data information of a current page;
a determination module: the hash value of the current page file name is determined according to the static data information and the dynamic data information;
a second obtaining module: the storage file name corresponding to the initial picture stored in the current page is obtained according to the page name of the current page;
a management module: the image management module is used for managing the image according to the hash value and the storage file name;
wherein the determining module is specifically configured to:
acquiring a first picture file name according to the static data information;
acquiring a second picture file name according to the dynamic data information;
determining the hash value according to the first picture file name and the second picture file name;
the determining module is further specifically configured to:
splicing the first picture file name and the second picture file name to obtain a spliced file name;
generating a character string according to the spliced file name;
and determining the hash value according to the character string.
5. The picture management system according to claim 4, wherein the management module is specifically configured to:
when the storage file name is different from the hash value, deleting the initial picture;
sending a picture updating request to a server according to the static data information and the dynamic data information;
and caching the picture according to the received information fed back by the server.
6. The system according to claim 5, wherein the management module is further specifically configured to:
determining an original picture corresponding to the picture to be cached according to the information fed back by the server;
drawing the original picture according to the element information of the current page;
and converting the format of the drawn picture into a preset format and then caching.
CN201710676113.7A 2017-08-09 2017-08-09 Picture management method and system Active CN107609030B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710676113.7A CN107609030B (en) 2017-08-09 2017-08-09 Picture management method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710676113.7A CN107609030B (en) 2017-08-09 2017-08-09 Picture management method and system

Publications (2)

Publication Number Publication Date
CN107609030A CN107609030A (en) 2018-01-19
CN107609030B true CN107609030B (en) 2020-09-29

Family

ID=61064644

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710676113.7A Active CN107609030B (en) 2017-08-09 2017-08-09 Picture management method and system

Country Status (1)

Country Link
CN (1) CN107609030B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112396459A (en) * 2020-11-19 2021-02-23 上海源慧信息科技股份有限公司 Cloud auditing method for shopping certificate verification

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902724A (en) * 2012-09-05 2013-01-30 重庆市勘测院 Mass raster tile map release method
CN107025675A (en) * 2016-02-01 2017-08-08 广州市动景计算机科技有限公司 Method, equipment, browser and the electronic equipment of processing interception picture

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4422088B2 (en) * 2005-09-27 2010-02-24 Necネクサソリューションズ株式会社 Image array type authentication system
JP2011170540A (en) * 2010-02-17 2011-09-01 Fujifilm Corp Inspection system and method, management server, mobile terminal, program, and memory medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902724A (en) * 2012-09-05 2013-01-30 重庆市勘测院 Mass raster tile map release method
CN107025675A (en) * 2016-02-01 2017-08-08 广州市动景计算机科技有限公司 Method, equipment, browser and the electronic equipment of processing interception picture

Also Published As

Publication number Publication date
CN107609030A (en) 2018-01-19

Similar Documents

Publication Publication Date Title
JP6416374B2 (en) Fast rendering of websites containing dynamic content and old content
US9077681B2 (en) Page loading optimization using page-maintained cache
JP6091579B2 (en) Method and apparatus for handling nested fragment caching of web pages
WO2020199751A1 (en) Method and apparatus for loading page picture, and electronic device
US10645192B2 (en) Identifying content files in a cache using a response-based cache index
JP2018506756A (en) Website access method, apparatus, and website system
US8225192B2 (en) Extensible cache-safe links to files in a web page
CN107329963B (en) Method and device for accelerating webpage access
EP2972827B1 (en) Collaborative editing
US20230164208A1 (en) Method and system for enforcing governance across multiple content repositories using a content broker
US20120259945A1 (en) System and method for dynamically modifying content based on user expectations
US10116726B2 (en) Methods for bundling images and devices thereof
CN109284428B (en) Data processing method, device and storage medium
US20160182673A1 (en) Dynamic cache injector
CN107609030B (en) Picture management method and system
US20130124480A1 (en) System and Method for Viewer Based Image Metadata Sanitization
US20140115054A1 (en) Identifying shared content stored by a service
JP6262742B2 (en) Progressive image processing using data URI enhancement
JP2007219619A (en) Information management program, device, and method
JP6782219B2 (en) Data utilization support device, data utilization support system, and data utilization support method
JP2021033513A (en) Program, server, and display control method
CN113742010A (en) Page multi-language display method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant