CN114842097A - Method for converting picture format and related equipment thereof - Google Patents

Method for converting picture format and related equipment thereof Download PDF

Info

Publication number
CN114842097A
CN114842097A CN202210585290.5A CN202210585290A CN114842097A CN 114842097 A CN114842097 A CN 114842097A CN 202210585290 A CN202210585290 A CN 202210585290A CN 114842097 A CN114842097 A CN 114842097A
Authority
CN
China
Prior art keywords
picture
format
conversion
sub
converting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210585290.5A
Other languages
Chinese (zh)
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202210585290.5A priority Critical patent/CN114842097A/en
Publication of CN114842097A publication Critical patent/CN114842097A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/1827Management specifically adapted to NAS
    • 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the application belongs to the field of artificial intelligence, and relates to a picture format conversion method, which is applied to a picture format conversion system. The conversion method comprises the steps of obtaining at least one picture conversion request through a main process, and creating at least one sub-process according to the at least one picture conversion request; a picture conversion request includes a picture in a first format; the number of the subprocess scales is the same as the number of the picture conversion requests; distributing a picture conversion request to each sub-process through the main process; the picture conversion requests corresponding to each sub-process are different; and converting the picture in the first format into the picture in the second format through the sub-process, and storing the picture in the second format. The application also provides a conversion device of the picture format, computer equipment and a storage medium. The method and the device improve the conversion efficiency of the picture format conversion.

Description

Method for converting picture format and related equipment thereof
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a method for converting a picture format and a related device thereof.
Background
The pictures can usually express certain feelings which cannot be described by languages, for example, pictures or emoticons in various social software can enable communication processes of two communication parties to be more interesting, and for example, a large number of pictures on a website page can enable a browser to quickly understand page contents. However, the pictures often cannot be displayed due to the fact that the pictures are not in conformity with the format in the using process, and the using experience of the user is reduced. Therefore, it is important to convert the picture into a format that matches the page.
At present, the conversion of the picture format is generally carried out by using a picture format conversion tool, the tool can only convert one picture at a time in the using process, and the tool needs to be downloaded and installed for use. Therefore, the conversion efficiency of the picture format conversion is low.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method for converting a picture format and a related device thereof, so as to solve the problem of low conversion efficiency of picture format conversion.
In order to solve the foregoing technical problem, an embodiment of the present application provides a method for converting a picture format, which is applied to a system for converting a picture format, where the system for converting a picture format includes a main process and at least one sub-process created by the main process, and the method for converting a picture format adopts the following technical solutions:
acquiring at least one picture conversion request through the main process, and creating at least one sub-process according to the at least one picture conversion request; a picture conversion request includes a picture in a first format; the number of the sub-process scales is the same as that of the picture conversion requests; distributing one picture conversion request to each sub-process through the main process; the picture conversion request corresponding to each subprocess is different; and converting the picture in the first format into a picture in a second format through the subprocess, and storing the picture in the second format.
Further, the converting, by the sub-process, the picture in the first format into the picture in the second format includes: converting the picture in the first format into a picture in a second format according to a preset compression rate through the subprocess; the first format is a portable network graphics PNG format or a joint photographic experts group JPEG format, and the second format is a WebP format.
Further, the storing the picture in the second format includes: and storing the picture in the second format to a Network Attached Storage (NAS) disc through the sub-process.
Further, after the picture in the second format is stored in the NAS disc through the sub-process, the conversion method further includes: acquiring a downloading request; the downloading request comprises an identifier of a target picture; inquiring a picture in a second format corresponding to the identification of the target picture in the NAS disc through the main process; and sending the picture in the second format corresponding to the identification of the target picture.
Further, after converting the picture in the first format into a picture in a second format by the sub-process and storing the picture in the second format, the conversion method further includes: and storing the picture in the second format to a database through the main process.
Further, after converting the picture in the first format into a picture in a second format by the sub-process and storing the picture in the second format, the conversion method further includes: destroying the at least one sub-process by the main process.
Further, the obtaining, by the host process, at least one picture conversion request includes: receiving at least one picture in a first format, and generating the at least one picture conversion request according to the at least one picture in the first format through the main process.
In order to solve the above technical problem, an embodiment of the present application further provides a device for converting a picture format, which is applied to a system for converting a picture format, where the system for converting a picture format includes a main process and at least one sub-process created by the main process, and the following technical solutions are adopted:
the creation module is used for acquiring at least one picture conversion request through the main process and creating at least one sub-process according to the at least one picture conversion request; a picture conversion request includes a picture in a first format; the number of the sub-process scales is the same as that of the picture conversion requests; a distribution module, configured to distribute one of the picture conversion requests to each of the sub-processes through the main process; the picture conversion request corresponding to each subprocess is different; and the conversion module is used for converting the picture in the first format into the picture in the second format through the subprocess and storing the picture in the second format.
Further, the conversion module comprises a conversion submodule. The conversion sub-module is used for converting the picture in the first format into a picture in a second format according to a preset compression rate through the sub-process; the first format is a portable network graphics PNG format or a joint photographic experts group JPEG format, and the second format is a WebP format.
Further, the conversion module further includes a storage sub-module. And the storage sub-module is used for storing the picture in the second format to a Network Attached Storage (NAS) disc through the sub-process.
Further, the conversion device further comprises an acquisition module, a query module and a sending module. The acquisition module is used for acquiring a downloading request; the downloading request comprises an identifier of a target picture; the query module is configured to query, by the host process, the NAS disk for the picture in the second format corresponding to the identifier of the target picture; and the sending module is used for sending the picture in the second format corresponding to the identification of the target picture.
Further, the conversion device further comprises a storage module. The storage module is used for storing the picture in the second format to a database through the main process.
Further, the conversion device further comprises a destruction module. The destroying module is used for destroying the at least one sub-process through the main process.
Further, the creating module includes a generating sub-module. The generating submodule is used for receiving at least one picture in a first format and generating the at least one picture conversion request according to the at least one picture in the first format through the main process.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the above method for converting a picture format when executing the computer program.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above method for converting a picture format are implemented.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects: the method comprises the steps of obtaining at least one picture conversion request through a main process, creating at least one sub-process according to the at least one picture conversion request, and distributing one picture conversion request to each sub-process. And then, converting the picture in the first format into the picture in the second format through a subprocess, and storing the picture in the second format. Therefore, the plurality of sub-processes can be used for simultaneously converting the plurality of pictures in the first format into the pictures in the second format, so that the conversion tool is prevented from being downloaded and installed, the conversion of the plurality of picture formats can be simultaneously carried out, and the conversion efficiency of the picture format conversion is improved.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram to which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for converting a picture format according to the present application;
fig. 3 is a flowchart of another embodiment of a method of converting a picture format according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method for converting picture formats in accordance with the present application;
FIG. 5 is a schematic diagram of an embodiment of a device for converting picture formats according to the present application;
FIG. 6 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the foregoing drawings are used for distinguishing between different objects and not for describing a particular sequential order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that the method for converting a picture format provided in the embodiment of the present application can be applied to the terminal devices 101, 102, and 103. The terminal devices 101, 102, 103 may be collectively referred to as electronic devices. That is, the execution subject of the method for converting a picture format provided in the embodiment of the present application may be a conversion device of a picture format, and the conversion device of a picture format may be the electronic device (e.g., terminal devices 101, 102, 103) described above.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continuing reference to fig. 2, a flow diagram of one embodiment of a method of picture format conversion according to the present application is shown. The method for converting the picture format is applied to a conversion system of the picture format, and the conversion system comprises a main process and at least one sub-process created by the main process. The method for converting the picture format comprises the following steps:
step S21, obtaining at least one picture conversion request through the main process, and creating at least one sub-process according to the at least one picture conversion request.
The number of the sub-processes is the same as the number of the picture conversion requests.
Firstly, after receiving at least one picture in a first format, generating at least one picture conversion request according to the at least one picture in the first format through a main process. Specifically, after logging in the conversion system of the picture format, the user drags or uploads at least one picture of the first format to the conversion system of the picture format. Thus, the picture format conversion system receives at least one picture in the first format and generates at least one picture conversion request according to the at least one picture in the first format through the main process.
In this embodiment, the main process generates at least one conversion request according to at least one picture in the first format, so that the subsequent sub-process performs format conversion according to the picture in the first format in the conversion request.
And then, creating at least one sub-process according to the at least one picture conversion request through the main process. Specifically, after generating the picture conversion requests according to the pictures in the first format, the main process creates sub-processes with the same number as the picture conversion requests according to the preset rules and the number of the picture conversion requests. The preset rule is preset by related personnel, and at least comprises a conversion program of a picture format, wherein the conversion program is used for converting a picture in a first format into a picture in a second format.
In step S22, a picture conversion request is distributed to each sub-process by the main process.
And the picture conversion request corresponding to each sub-process is different.
Specifically, after creating at least one sub-process according to at least one picture conversion request, the main process distributes a picture conversion request to each sub-process, so that the sub-processes convert the picture in the first format into the picture in the second format.
In step S23, the picture in the first format is converted into a picture in a second format by a sub-process, and the picture in the second format is stored.
Specifically, the method for converting the picture in the first format into the picture in the second format through the sub-process may be that the picture in the first format is converted into the picture in the second format through the sub-process according to a preset compression rate. The first format is a Portable Network Graphics (PNG) format or a Joint Photographic Experts Group (JPEG) format, and the second format is a WebP format. Optionally, the value of the compression ratio is preset, for example, may be a default value, a value written by a relevant person according to an actual situation, and the like. For another example, the preset compression ratio is 60%.
In this embodiment, the plurality of sub-processes can be used to simultaneously convert the plurality of pictures in the first format into the pictures in the second format, that is, the plurality of sub-processes can be used to simultaneously convert the picture formats, so that the conversion efficiency of the picture format conversion is improved.
Optionally, the preset rule may further include a picture compression algorithm, and the method for converting the picture format further includes compressing the picture in the first format through a sub-process to generate a compressed picture.
The method for storing the picture in the second format through the sub-process may be that the picture in the second format is stored to a Network Attached Storage (NAS) disk through the sub-process. Optionally, in a case that the preset rule includes a picture compression algorithm, the method for converting the picture format further includes storing the compressed picture to the NAS disk through a sub-process. The NAS disk can provide a download entry for the user, that is, the user can download the picture in the second format or the compressed picture in the NAS disk.
Specifically, the picture conversion request further includes an identifier of the picture in the first format. Therefore, when the picture in the second format is stored, the identifier of the picture in the first format corresponding to the picture in the second format is stored as the identifier of the picture in the second format, so that the converted picture in the second format can be inquired according to the identifier of the picture in the first format. The identifier of the picture in the first format is unique, for example, the identifier of the picture in the first format may be a number, a name, or the like of the picture in the first format. In this embodiment, the picture in the second format is stored through the sub-process, so that a download entry can be provided for the user, and the situation that the converted picture cannot be used by the user is avoided.
In this embodiment, at least one picture conversion request is acquired by the main process, at least one sub-process is created according to the at least one picture conversion request, and one picture conversion request is distributed to each sub-process. And then, converting the picture in the first format into the picture in the second format through a sub-process, and storing the picture in the second format. Therefore, the plurality of sub-processes can be used for simultaneously converting the plurality of pictures in the first format into the pictures in the second format, so that the conversion tool is prevented from being downloaded and installed, the conversion of the plurality of picture formats can be simultaneously carried out, and the conversion efficiency of the picture format conversion is improved.
In some optional implementations, after step S23, the method for converting a picture format further includes obtaining a download request, querying, by the host process, in the NAS disk, for a picture in the second format corresponding to the identifier of the target picture, and sending the picture in the second format corresponding to the identifier of the target picture. And the downloading request comprises the identification of the target picture.
Specifically, when the user needs to download the converted picture in the second format, the NAS disk of the picture format conversion system is opened to select at least one picture to be downloaded, and then the download control is clicked. In this way, the picture format conversion system receives the download request, where the download request includes the identifiers of the multiple target pictures, and then the picture format conversion system host process searches the NAS disk for the picture in the second format corresponding to the identifiers of the multiple target pictures and sends the picture to the client.
In this embodiment, the pictures in the second format that the user wants to download can be matched according to the identifier of the target picture, so that a batch picture downloading service is provided for the user, the situation that the converted pictures cannot be used by the user is avoided, and the downloading efficiency is improved.
In some optional implementations, as shown in fig. 3, after step S23, the method for converting a picture format further includes the following steps:
and step S24, destroying at least one sub-process through the main process.
In this embodiment, after the picture format conversion system converts the picture in the first format into the second format by using the sub-process, the sub-process is destroyed by the main process, so that the useless sub-process is prevented from occupying the resources of the picture format conversion system, and the resource utilization rate is improved.
In some optional implementations, as shown in fig. 4, after step S23, the method for converting a picture format further includes the following steps:
in step S25, the picture in the second format is stored in the database by the host process.
In this embodiment, the picture in the second format can be stored in the database, so that the use condition of the conversion system in the picture format can be analyzed subsequently based on the information of the picture in the second format in the database, and the conversion system in the picture format can be optimized according to the analysis result.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 5, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a device for converting a picture format, where the embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device may be applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for converting a picture format according to the present embodiment includes: a creation module 501, a distribution module 502, and a conversion module 503. Wherein:
a creating module 501, configured to obtain at least one picture conversion request through the main process, and create at least one sub-process according to the at least one picture conversion request; a picture conversion request includes a picture in a first format; the number of the sub-process scales is the same as that of the picture conversion requests; a distribution module 502, configured to distribute one of the picture conversion requests to each of the sub-processes through the main process; the picture conversion request corresponding to each subprocess is different; the converting module 503 is configured to convert the picture in the first format into a picture in a second format through the sub-process, and store the picture in the second format.
In this embodiment, at least one picture conversion request is acquired by the main process, at least one sub-process is created according to the at least one picture conversion request, and one picture conversion request is distributed to each sub-process. And then, converting the picture in the first format into the picture in the second format through a sub-process, and storing the picture in the second format. Therefore, the plurality of sub-processes can be used for simultaneously converting the plurality of pictures in the first format into the pictures in the second format, so that the conversion tool is prevented from being downloaded and installed, the conversion of the plurality of picture formats can be simultaneously carried out, and the conversion efficiency of the picture format conversion is improved.
In some optional implementations of this embodiment, the conversion module 503 includes a conversion sub-module. The conversion sub-module is used for converting the picture in the first format into a picture in a second format according to a preset compression rate through the sub-process; the first format is a portable network graphics PNG format or a joint photographic experts group JPEG format, and the second format is a WebP format.
In this embodiment, the plurality of sub-processes can be used to simultaneously convert the plurality of pictures in the first format into the pictures in the second format, that is, the plurality of sub-processes can be used to simultaneously convert the picture formats, so that the conversion efficiency of the picture format conversion is improved.
In some optional implementations of this embodiment, the conversion module 503 further includes a storage submodule. And the storage sub-module is used for storing the picture in the second format to a Network Attached Storage (NAS) disc through the sub-process.
In this embodiment, the picture in the second format is stored through the sub-process, so that a download entry can be provided for the user, and the situation that the converted picture cannot be used by the user is avoided.
In some optional implementation manners of this embodiment, the conversion apparatus further includes an obtaining module, a querying module, and a sending module. The acquisition module is used for acquiring a downloading request; the downloading request comprises an identifier of a target picture; the query module is configured to query, by the host process, the NAS disk for the picture in the second format corresponding to the identifier of the target picture; and the sending module is used for sending the picture in the second format corresponding to the identification of the target picture.
In this embodiment, the pictures in the second format that the user wants to download can be matched according to the identifier of the target picture, so that a batch picture downloading service is provided for the user, the situation that the converted pictures cannot be used by the user is avoided, and the downloading efficiency is improved.
In some optional implementations of this embodiment, the conversion apparatus further includes a storage module. The storage module is used for storing the picture in the second format to a database through the main process.
In this embodiment, the picture in the second format can be stored in the database, so that the use condition of the conversion system in the picture format can be analyzed subsequently based on the information of the picture in the second format in the database, and the conversion system in the picture format can be optimized according to the analysis result.
In some optional implementations of this embodiment, the conversion apparatus further includes a destruction module. The destroying module is used for destroying the at least one sub-process through the main process.
In this embodiment, after the picture format conversion system converts the picture in the first format into the second format by using the sub-process, the sub-process is destroyed by the main process, so that the useless sub-process is prevented from occupying the resources of the picture format conversion system, and the resource utilization rate is improved.
In some optional implementations of this embodiment, the creating module 501 includes a generating sub-module. The generating submodule is used for receiving at least one picture in a first format and generating the at least one picture conversion request according to the at least one picture in the first format through the main process.
In this embodiment, the main process generates at least one conversion request according to at least one picture in the first format, so that the subsequent sub-process performs format conversion according to the picture in the first format in the conversion request.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 6, fig. 6 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 6 comprises a memory 61, a processor 62, a network interface 63 communicatively connected to each other via a system bus. It is noted that only a computer device 6 having components 61-63 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 61 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 6. Of course, the memory 61 may also comprise both an internal storage unit of the computer device 6 and an external storage device thereof. In this embodiment, the memory 61 is generally used for storing an operating system installed in the computer device 6 and various application software, such as computer readable instructions of a conversion method of a picture format. Further, the memory 61 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 62 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is configured to execute computer readable instructions stored in the memory 61 or computer readable instructions for processing data, such as executing the conversion method of the picture format.
The network interface 63 may comprise a wireless network interface or a wired network interface, and the network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
In this embodiment, at least one picture conversion request is acquired by the main process, at least one sub-process is created according to the at least one picture conversion request, and one picture conversion request is distributed to each sub-process. And then, converting the picture in the first format into the picture in the second format through a sub-process, and storing the picture in the second format. Therefore, the plurality of sub-processes can be used for simultaneously converting the plurality of pictures in the first format into the pictures in the second format, so that the conversion tool is prevented from being downloaded and installed, the conversion of the plurality of picture formats can be simultaneously carried out, and the conversion efficiency of the picture format conversion is improved.
The present application further provides another embodiment, which is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, which can be executed by at least one processor, so as to cause the at least one processor to execute the steps of the method for converting picture formats as described above.
In this embodiment, at least one picture conversion request is acquired by the main process, at least one sub-process is created according to the at least one picture conversion request, and one picture conversion request is distributed to each sub-process. And then, converting the picture in the first format into the picture in the second format through a sub-process, and storing the picture in the second format. Therefore, the plurality of sub-processes can be used for simultaneously converting the plurality of pictures in the first format into the pictures in the second format, so that the conversion tool is prevented from being downloaded and installed, the conversion of the plurality of picture formats can be simultaneously carried out, and the conversion efficiency of the picture format conversion is improved.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields, and all the equivalent structures are within the protection scope of the present application.

Claims (10)

1. A method for converting a picture format is applied to a conversion system of the picture format, the conversion system comprises a main process and at least one sub-process created by the main process, and the method for converting the picture format comprises the following steps:
acquiring at least one picture conversion request through the main process, and creating at least one sub-process according to the at least one picture conversion request; a picture conversion request includes a picture in a first format; the number of the sub-process scales is the same as that of the picture conversion requests;
distributing one picture conversion request to each sub-process through the main process; the picture conversion request corresponding to each subprocess is different;
and converting the picture in the first format into a picture in a second format through the subprocess, and storing the picture in the second format.
2. The conversion method according to claim 1, wherein the converting the picture in the first format into the picture in the second format by the sub-process comprises:
converting the picture in the first format into a picture in a second format according to a preset compression rate through the subprocess; the first format is a portable network graphics PNG format or a joint photographic experts group JPEG format, and the second format is a WebP format.
3. The conversion method according to claim 1, wherein the storing the picture in the second format comprises:
and storing the picture in the second format to a Network Attached Storage (NAS) disc through the sub-process.
4. The conversion method according to claim 3, wherein after storing the picture in the second format to a Network Attached Storage (NAS) disk by the sub-process, the conversion method further comprises:
acquiring a downloading request; the downloading request comprises an identifier of a target picture;
inquiring a picture in a second format corresponding to the identification of the target picture in the NAS disc through the main process;
and sending the picture in the second format corresponding to the identification of the target picture.
5. The conversion method according to claim 1, wherein after converting the picture in the first format into the picture in the second format by the sub-process and storing the picture in the second format, the conversion method further comprises:
and storing the picture in the second format to a database through the main process.
6. The conversion method according to claim 1, wherein after converting the picture in the first format into the picture in the second format by the sub-process and storing the picture in the second format, the conversion method further comprises:
destroying the at least one sub-process by the main process.
7. The conversion method according to claim 1, wherein the obtaining at least one picture conversion request by the host process comprises:
receiving at least one picture in a first format, and generating the at least one picture conversion request according to the at least one picture in the first format through the main process.
8. A picture format conversion apparatus applied to a picture format conversion system including a main process and at least one sub-process created by the main process, the picture format conversion apparatus comprising:
the creation module is used for acquiring at least one picture conversion request through the main process and creating at least one sub-process according to the at least one picture conversion request; a picture conversion request includes a picture in a first format; the number of the sub-process scales is the same as that of the picture conversion requests;
a distribution module, configured to distribute one of the picture conversion requests to each of the sub-processes through the main process; the picture conversion request corresponding to each subprocess is different;
and the conversion module is used for converting the picture in the first format into the picture in the second format through the subprocess and storing the picture in the second format.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of the method of converting picture formats according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon computer-readable instructions which, when executed by a processor, implement the steps of the method for converting picture formats according to any one of claims 1 to 7.
CN202210585290.5A 2022-05-26 2022-05-26 Method for converting picture format and related equipment thereof Pending CN114842097A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210585290.5A CN114842097A (en) 2022-05-26 2022-05-26 Method for converting picture format and related equipment thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210585290.5A CN114842097A (en) 2022-05-26 2022-05-26 Method for converting picture format and related equipment thereof

Publications (1)

Publication Number Publication Date
CN114842097A true CN114842097A (en) 2022-08-02

Family

ID=82573165

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210585290.5A Pending CN114842097A (en) 2022-05-26 2022-05-26 Method for converting picture format and related equipment thereof

Country Status (1)

Country Link
CN (1) CN114842097A (en)

Similar Documents

Publication Publication Date Title
CN110321544B (en) Method and device for generating information
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN111797297B (en) Page data processing method and device, computer equipment and storage medium
CN117312535A (en) Method, device, equipment and medium for processing problem data based on artificial intelligence
CN116956326A (en) Authority data processing method and device, computer equipment and storage medium
CN112507141A (en) Investigation task generation method and device, computer equipment and storage medium
CN112685115A (en) International cue language generating method, system, computer equipment and storage medium
CN116483425A (en) Micro-service gray level edition issuing method, device, equipment and storage medium thereof
CN116383787A (en) Page creation method, page creation device, computer equipment and storage medium
CN114221964B (en) Access request processing method, device, computer equipment and storage medium
CN115712422A (en) Form page generation method and device, computer equipment and storage medium
CN115564000A (en) Two-dimensional code generation method and device, computer equipment and storage medium
CN115330396A (en) Payment state acquisition method and device, computer equipment and storage medium
CN114842097A (en) Method for converting picture format and related equipment thereof
CN115080045A (en) Link generation method and device, computer equipment and storage medium
CN115834685A (en) Screen adaptation method based on dynamic proxy and related equipment thereof
CN117278263A (en) Authentication processing method, authentication processing device, computer equipment and storage medium
CN117290019A (en) Interface calling method and device, computer equipment and storage medium
CN115578050A (en) Approval progress identification method and device, computer equipment and storage medium
CN114969482A (en) Method for automatically completing request by online configuration interface and related equipment thereof
CN117499270A (en) Flow processing method and device, computer equipment and storage medium
CN117112665A (en) Link data processing method and device, computer equipment and storage medium
CN115168471A (en) Data report generation method and device, computer equipment and storage medium
CN115511277A (en) Activity task issuing method and device, computer equipment and storage medium
CN116933290A (en) Data query method, device, computer equipment and storage medium

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