Picture generation method and device, picture playing method and device, equipment and medium
By encapsulating the to-processed pictures and audio stream data, the target picture containing audio is generated, which solves the problem that the picture protocol format cannot store audio information, and improves the image propagation effect and content richness.
Patent Information
- Application Number
- CN202311459272.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-03
- Publication Date
- 2025-05-06
AI Technical Summary
The protocol format of the picture cannot store audio information, resulting in a single content of the picture being transmitted and poorly transmitted.
By acquiring the audio stream data and the pending pictures based on the picture protocol format, the data encapsulation operation is performed on the to-processed pictures and the audio stream data to generate a target picture based on the picture protocol format, wherein the first data block of the target picture stores the protocol data of the pending pictures, and the second data block stores the encapsulated audio protocol data.
It solves the problem that the image protocol format cannot store audio information, enriches the content of the image dissemination, and improves the effect of the image dissemination.
Smart Images

Figure CN119946374A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a picture generating method, a picture playing method, a device, a equipment and a medium. Background Art
[0002] Pictures refer to flat media composed of graphics, images, etc. The protocol format of traditional pictures does not support the storage of audio information, which makes the content of picture dissemination single and the dissemination effect poor. Summary of the invention
[0003] The embodiments of the present invention provide a picture generation method, a picture playback method, an apparatus, a device and a medium to solve the problem that the picture protocol format cannot store audio information, enrich the dissemination content of the picture, and improve the dissemination effect of the picture.
[0004] In a first aspect, an embodiment of the present invention provides a method for generating an image, the method comprising:
[0005] Get audio stream data and the image to be processed based on the image protocol format;
[0006] Performing a data encapsulation operation on the image to be processed and the audio stream data to generate a target image based on the image protocol format;
[0007] Among them, the first data block in the target image stores the protocol data in the first data block in the image to be processed, and the second data block in the target image stores the audio protocol data corresponding to the audio stream data obtained by the data encapsulation operation, and the first data block and the second data block are both data blocks specified in the image protocol format.
[0008] In a second aspect, an embodiment of the present invention further provides a picture generating device, the device comprising:
[0009] An audio stream data acquisition module is used to acquire audio stream data and images to be processed based on an image protocol format;
[0010] A target image generation module, used to perform a data encapsulation operation on the image to be processed and the audio stream data to generate a target image based on the image protocol format;
[0011] Among them, the first data block in the target image stores the protocol data in the first data block in the image to be processed, and the second data block in the target image stores the audio protocol data corresponding to the audio stream data obtained by the data encapsulation operation, and the first data block and the second data block are both data blocks specified in the image protocol format.
[0012] In a third aspect, an embodiment of the present invention provides a method for playing a picture, the method comprising:
[0013] Performing a data reading operation on a target picture based on a picture protocol format to obtain picture protocol data in the target picture and audio protocol data in a second data block; wherein the picture protocol data includes at least one protocol data in a first data block;
[0014] Performing a picture decoding operation on the picture protocol data to obtain playback picture data, and performing an audio decoding operation on the audio protocol data to obtain audio stream data;
[0015] The playback picture data and the audio stream data are played synchronously.
[0016] In a fourth aspect, an embodiment of the present invention further provides a picture playing device, the device comprising:
[0017] A target picture data reading module, configured to perform a data reading operation on a target picture based on a picture protocol format, and obtain picture protocol data in the target picture and audio protocol data in the second data block; wherein the picture protocol data includes at least one protocol data in the first data block;
[0018] An audio protocol data decoding module, used to perform a picture decoding operation on the picture protocol data to obtain playback picture data, and to perform an audio decoding operation on the audio protocol data to obtain audio stream data;
[0019] The synchronous playing module is used to synchronously play the playing picture data and the audio stream data.
[0020] In a fifth aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0021] at least one processor; and
[0022] a memory communicatively connected to the at least one processor; wherein,
[0023] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the image generation method described in any embodiment of the present invention or execute the image playback method described in any embodiment of the present invention.
[0024] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image generation method described in any embodiment of the present invention or the image playback method described in any embodiment of the present invention when executed.
[0025] The technical solution of the embodiment of the present invention obtains audio stream data and a to-be-processed picture based on a picture protocol format, performs a data encapsulation operation on the to-be-processed picture and the audio stream data, and generates a target picture based on a picture protocol format, wherein the first data block in the target picture stores the protocol data in the first data block in the to-be-processed picture, and the second data block in the target picture stores the audio protocol data corresponding to the audio stream data obtained by the data encapsulation operation, and the first data block and the second data block are both data blocks specified in the picture protocol format, which solves the problem that the picture protocol format cannot store audio information, enriches the dissemination content of the picture, and improves the dissemination effect of the picture. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The above and other features, advantages and aspects of the embodiments of the present invention will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0027] Figure 1 A flowchart of a method for generating an image provided by an embodiment of the present invention;
[0028] Figure 2 A schematic diagram of the structure of a graphics exchange format provided by an embodiment of the present invention;
[0029] Figure 3 A flowchart of another method for generating a picture provided by an embodiment of the present invention;
[0030] Figure 4 A flowchart of a picture playing method provided by an embodiment of the present invention;
[0031] Figure 5 A flowchart of another picture playing method provided by an embodiment of the present invention;
[0032] Figure 6 A schematic diagram of the structure of a picture generating device provided by an embodiment of the present invention;
[0033] Figure 7 A schematic diagram of the structure of a picture playing device provided by an embodiment of the present invention;
[0034] Figure 8 The present invention is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0035] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.
[0036] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0037] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0038] It should be noted that the concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0039] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0040] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.
[0041] It is understandable that before using the technical solutions disclosed in the embodiments of the present invention, the type, scope of use, usage scenarios, etc. of the personal information involved in the present invention should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0042] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present invention according to the prompt message.
[0043] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0044] It is understandable that the above notification and user authorization process is only illustrative and does not constitute a limitation on the implementation of the present invention. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present invention.
[0045] Figure 1 This is a flow chart of a method for generating an image provided by an embodiment of the present invention. This embodiment is applicable to the case of generating an image in an image protocol format containing audio. The method can be executed by an image generating device. The image generating device can be implemented in the form of hardware and / or software. The image generating device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0046] S110: Acquire audio stream data and a to-be-processed picture based on a picture protocol format.
[0047] In an optional embodiment, obtaining audio stream data includes: displaying an audio list in a visual interface, and in response to an audio selection operation on the audio list, using the selected reference audio corresponding to the audio selection operation as the audio stream data. Specifically, the audio list includes at least one reference audio.
[0048] In another optional embodiment, obtaining audio stream data includes: in response to detecting an audio recording request, displaying an audio recording interface in a visual interface, and obtaining audio stream data collected by the audio recording interface.
[0049] Specifically, the image protocol format includes but is not limited to BMP (Bitmap, standard image format), GIF (Graphics Interchange Format, graphics exchange format), Exif (Exchangeable image file format, exchangeable image file format), JPEG (Joint Photographic Experts Group, joint image experts group), etc. The image protocol format is not limited here.
[0050] In an optional example, obtaining a to-be-processed picture based on a picture protocol format includes: displaying a reference picture list in a visual interface, and in response to a picture selection operation on the reference picture list, using a selected reference picture of a picture protocol format corresponding to the picture selection operation as the to-be-processed picture. Specifically, the reference picture list includes at least one reference picture corresponding to at least one picture protocol format.
[0051] In another optional embodiment, obtaining the image to be processed based on the image protocol format includes: in response to detecting an image acquisition request, displaying a picture shooting interface in a visual interface, and obtaining the image to be processed in the image protocol format acquired by the picture shooting interface.
[0052] In another optional embodiment, audio stream data and pictures to be processed based on a picture protocol format are obtained, including: displaying a video list in a visual interface, and in response to a video selection operation for the video list, using the track audio in the selected reference video corresponding to the video selection operation as audio stream data, and using at least one video frame in the selected reference video as the picture to be processed in a picture protocol format; wherein the video list contains at least one reference video.
[0053] In another optional embodiment, audio stream data and images to be processed based on a picture protocol format are obtained, including: in response to detecting a video recording request, displaying a video recording interface in a visual interface, and obtaining real-time video captured by the video recording interface; using the track audio in the real-time video as audio stream data, and using at least one video frame in the real-time video as the image to be processed in a picture protocol format.
[0054] This embodiment does not limit the method for obtaining the audio stream data and the to-be-processed picture based on the picture protocol format, and the specific settings can be customized according to actual needs.
[0055] S120: Perform a data encapsulation operation on the image to be processed and the audio stream data to generate a target image based on the image protocol format.
[0056] In this embodiment, the first data block in the target image stores the protocol data in the first data block in the image to be processed, and the second data block in the target image stores the audio protocol data corresponding to the audio stream data obtained by the data encapsulation operation, and the first data block and the second data block are both data blocks specified in the image protocol format.
[0057] Specifically, in the definition of the picture protocol format, the first data block is used to store protocol data directly related to the image information, and the second data block is used to store protocol data not directly related to the image information, such as remark information, copyright information or blank fields, etc. In this embodiment, the second data block is used to represent an uncommon data block or an unimportant data block in the picture protocol format. Specifically, the first data block in the target picture is a data block other than the second data block.
[0058] In an optional embodiment, when the picture protocol format is a Graphics Interchange Format (GIF), the second data block is an application extension block or an annotation extension block in the Graphics Interchange Format (GIF).
[0059] Specifically, the Graphic Interchange Format (GIF) stores image information in the form of data blocks. According to the characteristics of different data blocks, each data block can be divided into three categories, namely, control block, image description block and special purpose block. Among them, the control block is used to control the processing of image data stream and the setting of hardware parameters. Specifically, the control block contains a file header, a logical screen description block, a graphic control extension block and a file trailing block; the image description block is used to describe the display information required for the image on the display device. Specifically, the image description block contains an image identifier block (Image Descriptor), a global color index table (Global Color Table), a local color index table (Local Color Table), image compression data (ImageData) and an image text extension block (Plain Text Extension). The special purpose block is used to represent information that is not directly related to the image information of the GIF image. Specifically, the special purpose block contains an application extension block (Application Extension) and a comment extension block (Comment Extension).
[0060] Specifically, the application extension block is used to make information related to the application, including a block start code 0x21FF, an application identification code, an application data sub-block, and a block end code 0x00, etc. The comment extension block can be used to store any non-graphic data such as copyright and author, including a block start code 0x21FE, multiple sequence data sub-blocks, and a block end code 0x00. The sequence data sub-block can store up to 255 bytes.
[0061] Figure 2 A schematic diagram of a graphic exchange format provided by an embodiment of the present invention. Specifically, Figure 2The dashed box indicates that the data block is optional, and the solid box indicates that the data block is mandatory. There is at least one global color index table and local color index table in the Graphics Interchange Format GIF. When both global color index table and local color index table exist in the Graphics Interchange Format GIF, the local color index table is used. The scope of the file header, logical screen description block and global color index table is the entire data domain.
[0062] In another optional embodiment, when the image protocol format is the standard image format BMP, the second data block is a color palette block in the standard image format BMP; when the image protocol format is the Joint Photographic Experts Group JPEG or the Exchangeable Image File Format Exif, the second data block is a data block between the character strings 0xFFE0-0xFFEF in JPEG or Exif.
[0063] In an optional embodiment, the data encapsulation operation is performed on the picture to be processed and the audio stream data to generate a target picture based on the picture protocol format, including: obtaining the protocol data in the second data block in the picture to be processed, and deleting the protocol data from the picture to be processed to obtain an intermediate picture; generating audio protocol data corresponding to the second data block according to the audio stream data; and writing the audio protocol data into the second data block in the intermediate picture to obtain a target picture.
[0064] Specifically, in the process of performing a data reading operation on the image to be processed, when a block start character corresponding to the second data block is read, all protocol data from the block start character to the block end character of the second data block are used as protocol data in the second data block. The block start character and the block end character are used to mark the data block position of the second data block.
[0065] Specifically, the block start character and block end character can be used to represent a specific identifier, and can also be used to represent the starting byte number and the ending byte number corresponding to the data block, wherein the difference in bytes between the starting byte number and the ending byte number represents the block field length corresponding to the data block.
[0066] In an optional embodiment, audio protocol data corresponding to the second data block is generated according to the audio stream data, including: when a block start code and a block end code are used to represent a specific identifier, the block start code corresponding to the second data block, the audio stream data and the block end code corresponding to the second data block are written in sequence into the audio protocol data corresponding to the second data block, or the audio data length of the audio stream data is obtained; the block start code corresponding to the second data block, the audio data length, the audio data stream and the block end code corresponding to the second data block are written in sequence into the audio protocol data corresponding to the second data block.
[0067] In another optional embodiment, audio protocol data corresponding to the second data block is generated based on the audio stream data, including: when a block start character and a block end character are used to represent the starting byte number and the ending byte number, the audio stream data is written into the audio protocol data corresponding to the second data block, or the audio data length of the audio stream data is obtained, and the audio data length and the audio data stream are written into the audio protocol data corresponding to the second data block.
[0068] The technical solution of this embodiment obtains audio stream data and a to-be-processed picture based on a picture protocol format, performs a data encapsulation operation on the to-be-processed picture and the audio stream data, and generates a target picture based on a picture protocol format, wherein the first data block in the target picture stores the protocol data in the first data block in the to-be-processed picture, and the second data block in the target picture stores the audio protocol data corresponding to the audio stream data obtained by the data encapsulation operation, and the first data block and the second data block are both data blocks specified in the picture protocol format, which solves the problem that the picture protocol format cannot store audio information, enriches the dissemination content of the picture, and improves the dissemination effect of the picture.
[0069] Figure 3 This is a flowchart of another method for generating an image provided by an embodiment of the present invention. This embodiment further refines the "performing a data encapsulation operation on the image to be processed and the audio stream data to generate a target image based on the image protocol format" in the above embodiment. Figure 3 As shown, the method includes:
[0070] S210: Acquire audio stream data and a to-be-processed picture based on a picture protocol format.
[0071] S210 in this embodiment is similar to that in the above embodiment. Figure 1 The S110 shown corresponds to the same or similar steps, and will not be described in detail in this embodiment.
[0072] S220: Write protocol data in at least one first data block located before the second data block in the picture to be processed into the target picture in sequence.
[0073] Specifically, in the process of performing a data reading operation on the to-be-processed picture, before a block start character corresponding to a second data block is read, protocol data in at least one first data block is sequentially written into the target picture.
[0074] S230. Generate audio protocol data corresponding to the second data block according to the audio stream data, and write the audio protocol data into the target picture.
[0075] In an optional embodiment, audio protocol data corresponding to the second data block is generated according to the audio stream data, including: when a block start code and a block end code are used to represent a specific identifier, the block start code corresponding to the second data block, the audio stream data and the block end code corresponding to the second data block are written in sequence into the audio protocol data corresponding to the second data block, or the audio data length of the audio stream data is obtained; the block start code corresponding to the second data block, the audio data length, the audio data stream and the block end code corresponding to the second data block are written in sequence into the audio protocol data corresponding to the second data block.
[0076] In another optional embodiment, in an optional embodiment, audio protocol data corresponding to the second data block is generated according to the audio stream data, including: when a block start character and a block end character are used to represent the starting byte number and the ending byte number, the audio stream data is written into the audio protocol data corresponding to the second data block, or the audio data length of the audio stream data is obtained, and the audio data length and the audio data stream are written into the audio protocol data corresponding to the second data block.
[0077] In another optional embodiment, generating audio protocol data corresponding to the second data block based on the audio stream data includes: according to a preset readable length, cyclically reading audio segment data in the audio stream data in sequence; if the segment data length of the audio segment data is equal to the preset readable length, writing the preset readable length and the audio segment data corresponding to the audio protocol data corresponding to the second data block; if the segment data length is less than the preset readable length, writing the segment data length and the audio segment data corresponding to the audio protocol data.
[0078] Specifically, the preset readable length can be used to represent the unit storable length corresponding to the second data block, and can also be used to represent the single readable length of the audio reader. Exemplarily, the preset readable length can be 255 bytes, and the preset readable length is not limited here.
[0079] Specifically, the segment data length is used to represent the data length of the audio segment data, and the segment data length is less than or equal to the preset readable length. The advantage of such a setting is that the audio decoding efficiency of the audio protocol data in the subsequent picture playback process can be improved.
[0080] In an optional embodiment, generating audio protocol data corresponding to the second data block based on the audio stream data further includes: when a block start code and a block end code can be used to represent a specific identifier, before cyclically reading the audio segment data in the audio stream data in sequence according to a preset readable length, writing the block start code corresponding to the second data block into the audio protocol data, and after writing the last audio segment data into the audio protocol data, writing the block end code corresponding to the second data block into the audio protocol data.
[0081] In another optional embodiment, writing the audio protocol data into the target picture includes: when a block start symbol and a block end symbol are used to represent a start byte number and an end byte number, writing the audio protocol data into a block position between the start byte number and the end byte number in the target picture.
[0082] Based on the above embodiment, optionally, before cyclically reading the audio segment data in the audio stream data in sequence according to a preset readable length, the method further includes: performing a data encryption operation on the audio stream data to obtain encrypted audio stream data, and using the encrypted audio stream data as the current audio stream data.
[0083] Exemplarily, the encryption algorithms used in data encryption operations include, but are not limited to, the Data Encryption Standard algorithm (DES), the International Data Encryption Algorithm (IDEA), the RSA algorithm, the Digital Signature Algorithm (DSA), and the Advanced Encryption Standard algorithm, etc. The encryption algorithms used are not limited here and can be customized according to actual needs.
[0084] The advantage of this setting is that it can improve the security of audio stream data.
[0085] S240: Write the protocol data in at least one first data block located after the second data block in the picture to be processed into the target picture in sequence.
[0086] Specifically, in the process of performing a data reading operation on the to-be-processed picture, after a block terminator corresponding to the second data block is read, the protocol data in the at least one first data block is sequentially written into the target picture.
[0087] The technical solution of this embodiment solves the data encapsulation problem of the target picture by sequentially writing the protocol data in at least one first data block before the second data block in the picture to be processed into the target picture, generating audio protocol data corresponding to the second data block according to the audio stream data, and writing the audio protocol data into the target picture, and sequentially writing the protocol data in at least one first data block after the second data block in the picture to be processed into the target picture, thereby improving the stability of generating the target picture and the accuracy of the target picture.
[0088] Figure 4 This is a flowchart of a method for playing pictures provided by an embodiment of the present invention. This embodiment is applicable to the case of playing pictures in a picture protocol format containing audio. The method can be executed by a picture playing device. The picture playing device can be implemented in the form of hardware and / or software. The picture playing device can be configured in an electronic device. Figure 4 As shown, the method includes:
[0089] S310: Perform a data reading operation on a target picture based on a picture protocol format to obtain picture protocol data in the target picture and audio protocol data in a second data block.
[0090] In this embodiment, the image protocol data includes protocol data in at least one first data block. Specifically, in the definition of the image protocol format, the first data block is used to store protocol data directly related to the image information, and the second data block is used to store protocol data not directly related to the image information, such as remark information, copyright information or blank fields. In this embodiment, the second data block is used to represent an uncommon data block or an unimportant data block in the image protocol format. Specifically, the first data block in the target image is a data block other than the second data block.
[0091] In an optional embodiment, when the picture protocol format is a Graphics Interchange Format (GIF), the second data block is an application extension block or an annotation extension block in the Graphics Interchange Format (GIF).
[0092] Specifically, the application extension block is used to make information related to the application, including a block start code 0x21FF, an application identification code, an application data sub-block, and a block end code 0x00, etc. The comment extension block can be used to store any non-graphic data such as copyright and author, including a block start code 0x21FE, multiple sequence data sub-blocks, and a block end code 0x00. The sequence data sub-block can store up to 255 bytes.
[0093] In another optional embodiment, when the image protocol format is the standard image format BMP, the second data block is a color palette block in the standard image format BMP; when the image protocol format is the Joint Photographic Experts Group JPEG or the Exchangeable Image File Format Exif, the second data block is a data block between the character strings 0xFFE0-0xFFEF in JPEG or Exif.
[0094] In an optional embodiment, the data reading operation is performed on the target image based on the image protocol format to obtain the image protocol data in the target image and the audio protocol data in the second data block, including: in the process of performing the data reading operation on the target image based on the set image format, the protocol data in the read first data block is written into the image protocol data; until the block start character corresponding to the second data block is read, the protocol data read after the block start character is written into the audio protocol data; until the block end character corresponding to the second data block is read, the protocol data in the first data block read after the block end character is written into the image protocol data; wherein the block start character and the block end character are used to mark the data block position of the second data block.
[0095] Specifically, the block start character and block end character can be used to represent a specific identifier, and can also be used to represent the starting byte number and the ending byte number corresponding to the data block, wherein the difference in bytes between the starting byte number and the ending byte number represents the block field length corresponding to the data block.
[0096] Specifically, the image protocol data and the audio protocol data are separated from the target image through the block start character and the block end character.
[0097] S320: Perform a picture decoding operation on the picture protocol data to obtain playback picture data, and perform an audio decoding operation on the audio protocol data to obtain audio stream data.
[0098] Specifically, a picture decoder corresponding to the picture protocol format is used to perform a picture decoding operation on the picture protocol data to obtain playback picture data, and an audio decoder is used to perform an audio decoding operation on the audio protocol data to obtain audio stream data.
[0099] In an optional embodiment, performing an audio decoding operation on the audio protocol data to obtain the audio stream data includes: taking the protocol data between the block start mark and the block end mark of the second data block in the audio protocol data as the audio stream data.
[0100] In another optional embodiment, performing an audio decoding operation on the audio protocol data to obtain the audio stream data includes: reading the audio stream data in the audio protocol data according to the length of the audio data in the audio protocol data.
[0101] S330: synchronously play the playback picture data and the audio stream data.
[0102] In an optional embodiment, the playback picture data includes at least one playback picture frame, and the playback picture data and the audio stream data are played synchronously, including: time-aligning the playback picture data and the audio stream data, using a picture player to play the time-aligned playback picture data, and simultaneously using an audio player to play the time-aligned audio stream data.
[0103] The technical solution of this embodiment performs a data reading operation on a target image based on an image protocol format to obtain image protocol data in the target image and audio protocol data in a second data block, wherein the image protocol data includes at least one protocol data in a first data block, performs a picture decoding operation on the image protocol data to obtain playback picture data, and performs an audio decoding operation on the audio protocol data to obtain audio stream data, and plays the playback picture data and the audio stream data synchronously, thereby solving the problem that the image protocol format cannot store audio information, enriching the dissemination content of the image, and improving the dissemination effect of the image.
[0104] Figure 5 This is a flowchart of another picture playing method provided by an embodiment of the present invention. This embodiment further refines the "performing an audio decoding operation on the audio protocol data to obtain audio stream data" in the above embodiment. Figure 5 As shown, the method includes:
[0105] S410: Perform a data reading operation on a target picture based on a picture protocol format to obtain picture protocol data in the target picture and audio protocol data in a second data block.
[0106] S410 in this embodiment is similar to that in the above embodiment. Figure 4 The S310 shown corresponds to the same or similar steps, and will not be described in detail in this embodiment.
[0107] S420: Perform a picture decoding operation on the picture protocol data to obtain playback picture data.
[0108] S420 in this embodiment is similar to that in the above embodiment. Figure 4 The "performing a picture decoding operation on the picture protocol data to obtain playback picture data" in S320 shown above corresponds to the same or similar step, and will not be described in detail in this embodiment.
[0109] S430, cyclically reading the segmented data lengths in the audio protocol data in sequence, and reading the audio segmented data in the audio protocol data according to the segmented data lengths.
[0110] Specifically, when the block start symbol and the block end symbol are used to represent a specific identifier, the second byte data in the audio protocol data is used as the segment data length; when the block start symbol and the block end symbol are used to represent the starting byte number and the ending byte number corresponding to the data block, the first byte data in the audio protocol data is used as the segment data length. According to the segment data length, the audio segment data in the audio protocol data is read, and the byte data read after the audio segment data is used as the segment data length, and the step of reading the audio segment data in the audio protocol data according to the segment data length is repeated until the byte data after the audio segment data is the block terminator of the second data block, or the byte number corresponding to the last audio byte in the audio segment data is the ending byte number corresponding to the second data block, and at least one audio segment data is obtained.
[0111] S440: Generate audio stream data according to at least one audio segment data.
[0112] In an optional embodiment, determining the audio stream data according to at least one audio segment data includes: using the audio data constituted by the at least one audio segment data as the audio stream data.
[0113] In another optional embodiment, determining the audio stream data based on at least one audio segment data includes: using audio data composed of at least one audio segment data as reference audio data, and performing a data decryption operation on the reference audio data to obtain the audio stream data.
[0114] Exemplarily, the decryption algorithm used in the data decryption operation includes, but is not limited to, the decryption algorithms corresponding to the Data Encryption Standard (DES), the International Data Encryption Algorithm (IDEA), the RSA algorithm, the Digital Signature Algorithm (DSA), and the Advanced Encryption Standard algorithm, etc., and the decryption algorithm used is not limited here, and can be customized according to actual needs. It can be understood that the decryption algorithm used in this embodiment is a decoding algorithm corresponding to the encryption algorithm used in the above-mentioned picture generation algorithm.
[0115] S450: synchronously play the playback picture data and the audio stream data.
[0116] In an optional embodiment, the playback screen data includes a color index table and preview screen data; accordingly, the synchronous playback of the playback screen data and the audio stream data includes: determining the current playback screen frame according to the color index table and the preview screen data, and obtaining the current audio segment in the audio stream data that is time-aligned with the current playback screen frame; and synchronously playing the current playback screen frame and the current audio segment.
[0117] In this embodiment, the image protocol format is the graphic interchange format GIF, and the playback screen data includes a color index table and preview screen data. The color index table is a global color index table or a local color index table, and the preview screen data includes LZW decompressed data corresponding to each playback screen frame. The basic principle of LZW (Lempel-Ziv-Welch Encoding, string table compression algorithm) is to extract different characters from the original text file data, create a compilation table based on these characters, and then use the index of the characters in the compilation table to replace the corresponding characters in the original data, so as to achieve the purpose of reducing the data size of the original text file data.
[0118] The advantage of such a setting is that if the synchronous playback is performed after waiting for the picture decoding operation and the audio decoding operation to be completed, the decoding time of the target picture will be increased, and the playback efficiency of the target picture will be reduced. In this embodiment, by setting the picture decoding operation to the pre-picture decoding operation, only the color index table and the preview picture data are decoded in the picture decoding stage, and in the synchronous playback process, the current playback picture frame is further decoded, and the current playback picture frame is synchronously played with the current audio segment that has been decoded and aligned in time, which solves the problem of time asynchrony caused by the difference in decoding speed between the picture decoding operation and the audio decoding operation, and reduces the decoding time of the target picture and improves the playback efficiency of the target picture while achieving the purpose of synchronous playback of the picture and audio.
[0119] The technical solution of this embodiment obtains audio stream data by performing an audio decoding operation on audio protocol data, including: cyclically reading the segment data length in the audio protocol data in sequence, and reading the audio segment data in the audio protocol data according to the segment data length, and generating audio stream data according to at least one audio segment data, which solves the data decoding problem of the target image and improves the audio decoding efficiency of the audio protocol data.
[0120] The following is an embodiment of a picture playback device provided in an embodiment of the present invention. The device and the picture playback method of the above embodiment belong to the same inventive concept. For details not fully described in the embodiment of the picture playback device, reference can be made to the contents of the picture playback method in the above embodiment.
[0121] Figure 6 The following is a schematic diagram of the structure of a picture generating device provided by an embodiment of the present invention. Figure 6 As shown, the device includes: an audio stream data acquisition module 510 and a target image generation module 520.
[0122] The audio stream data acquisition module 510 is used to acquire audio stream data and a to-be-processed picture based on a picture protocol format;
[0123] A target picture generating module 520 is used to perform a data encapsulation operation on the picture to be processed and the audio stream data to generate a target picture based on the picture protocol format;
[0124] Among them, the first data block in the target image stores the protocol data in the first data block in the image to be processed, and the second data block in the target image stores the audio protocol data corresponding to the audio stream data obtained by the data encapsulation operation, and the first data block and the second data block are both data blocks specified in the image protocol format.
[0125] The technical solution of this embodiment obtains audio stream data and a to-be-processed picture based on a picture protocol format, performs a data encapsulation operation on the to-be-processed picture and the audio stream data, and generates a target picture based on a picture protocol format, wherein the first data block in the target picture stores the protocol data in the first data block in the to-be-processed picture, and the second data block in the target picture stores the audio protocol data corresponding to the audio stream data obtained by the data encapsulation operation, and the first data block and the second data block are both data blocks specified in the picture protocol format, which solves the problem that the picture protocol format cannot store audio information, enriches the dissemination content of the picture, and improves the dissemination effect of the picture.
[0126] In an optional embodiment, the target image generation module 520 includes:
[0127] A first protocol data writing unit, configured to write protocol data in at least one first data block located before the second data block in the picture to be processed into a target picture in sequence;
[0128] an audio protocol data writing unit, configured to generate audio protocol data corresponding to the second data block according to the audio stream data, and write the audio protocol data into the target picture;
[0129] The second protocol data writing unit is used to write the protocol data in at least one first data block located after the second data block in the to-be-processed picture into the target picture in sequence.
[0130] In an optional embodiment, the audio protocol data writing unit is specifically used to:
[0131] According to a preset readable length, the audio segment data in the audio stream data is read in sequence in a loop;
[0132] If the segmented data length of the audio segmented data is equal to the preset readable length, writing the preset readable length and the audio segmented data into the audio protocol data corresponding to the second data block accordingly;
[0133] If the segment data length is smaller than the preset readable length, the segment data length and the audio segment data are correspondingly written into the audio protocol data.
[0134] In an optional embodiment, the device further comprises:
[0135] The audio stream data encryption module is used to perform data encryption operation on the audio stream data before cyclically reading the audio segment data in the audio stream data in sequence according to a preset readable length, obtain encrypted audio stream data, and use the encrypted audio stream data as the current audio stream data.
[0136] In an optional embodiment, when the picture protocol format is a Graphics Interchange Format (GIF), the second data block is an application extension block or an annotation extension block in the Graphics Interchange Format (GIF).
[0137] Figure 7 The following is a schematic diagram of the structure of a picture playing device provided by an embodiment of the present invention. Figure 7 As shown, the device includes: a target image data reading module 610, an audio protocol data decoding module 620 and a synchronous playing module 630.
[0138] The target picture data reading module 610 is used to perform a data reading operation on a target picture based on a picture protocol format to obtain picture protocol data in the target picture and audio protocol data in the second data block; wherein the picture protocol data includes at least one protocol data in the first data block;
[0139] The audio protocol data decoding module 620 is used to perform a picture decoding operation on the picture protocol data to obtain playback picture data, and perform an audio decoding operation on the audio protocol data to obtain audio stream data;
[0140] The synchronous playing module 630 is used to synchronously play the playing picture data and the audio stream data.
[0141] The technical solution of this embodiment performs a data reading operation on a target image based on an image protocol format to obtain image protocol data in the target image and audio protocol data in a second data block, wherein the image protocol data includes at least one protocol data in a first data block, performs a picture decoding operation on the image protocol data to obtain playback picture data, and performs an audio decoding operation on the audio protocol data to obtain audio stream data, and plays the playback picture data and the audio stream data synchronously, thereby solving the problem that the image protocol format cannot store audio information, enriching the dissemination content of the image, and improving the dissemination effect of the image.
[0142] In an optional embodiment, the audio protocol data decoding module 620 includes:
[0143] An audio segment data reading unit, used for cyclically reading the segment data length in the audio protocol data in sequence, and reading the audio segment data in the audio protocol data according to the segment data length;
[0144] The audio stream data generating unit is used to generate audio stream data according to at least one audio segment data.
[0145] In an optional embodiment, the audio stream data generating unit is specifically configured to:
[0146] The audio data composed of at least one audio segment data is used as reference audio data, and a data decryption operation is performed on the reference audio data to obtain audio stream data.
[0147] In an optional embodiment, the target image data reading module 610 is specifically configured to:
[0148] In a process of performing a data reading operation on a target picture based on a set picture format, writing the protocol data in the read first data block into the picture protocol data;
[0149] When a block start character corresponding to the second data block is read, the protocol data read after the block start character is written into the audio protocol data;
[0150] until a block terminator corresponding to the second data block is read, writing the protocol data in the first data block read after the block terminator into the picture protocol data;
[0151] The block start character and the block end character are used to mark the data block position of the second data block.
[0152] In an optional embodiment, when the picture protocol format is a Graphics Interchange Format (GIF), the second data block is an application extension block or an annotation extension block in the Graphics Interchange Format (GIF).
[0153] In an optional embodiment, the playback screen data includes a color index table and preview screen data. Accordingly, the synchronous playback module 630 is specifically configured to:
[0154] Determine the current playing picture frame according to the color index table and the preview picture data, and obtain the current audio segment in the audio stream data that is time-aligned with the current playing picture frame;
[0155] The currently played picture frame and the current audio segment are played synchronously.
[0156] The picture playing device provided in the embodiment of the present invention can execute the picture playing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0157] Reference below Figure 8 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 700 suitable for implementing an embodiment of the present invention. The terminal device in the embodiment of the present invention may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0158] like Figure 8 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 706 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0159] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 706 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0160] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 709, or installed from the storage device 706, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present invention are executed.
[0161] It should be noted that the computer-readable medium of the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0162] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0163] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0164] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains at least two Internet Protocol addresses; sends a node evaluation request including the at least two Internet Protocol addresses to a node evaluation device, wherein the node evaluation device selects an Internet Protocol address from the at least two Internet Protocol addresses and returns it; receives the Internet Protocol address returned by the node evaluation device; wherein the obtained Internet Protocol address indicates an edge node in a content distribution network.
[0165] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: receives a node evaluation request including at least two Internet Protocol addresses; selects an Internet Protocol address from the at least two Internet Protocol addresses; and returns the selected Internet Protocol address; wherein the received Internet Protocol address indicates an edge node in a content distribution network.
[0166] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0167] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0168] The units involved in the embodiments of the present invention may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0169] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0170] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0171] According to one or more embodiments of the present invention, Example 1 provides a picture playing method, the method comprising:
[0172] Get audio stream data and the image to be processed based on the image protocol format;
[0173] Performing a data encapsulation operation on the image to be processed and the audio stream data to generate a target image based on the image protocol format;
[0174] Among them, the first data block in the target image stores the protocol data in the first data block in the image to be processed, and the second data block in the target image stores the audio protocol data corresponding to the audio stream data obtained by the data encapsulation operation, and the first data block and the second data block are both data blocks specified in the image protocol format.
[0175] According to one or more embodiments of the present invention, Example 2, according to the method described in Example 1, performing a data encapsulation operation on the image to be processed and the audio stream data to generate a target image based on the image protocol format includes:
[0176] Writing protocol data in at least one first data block located before the second data block in the to-be-processed picture into the target picture in sequence;
[0177] Generate audio protocol data corresponding to the second data block according to the audio stream data, and write the audio protocol data into the target picture;
[0178] The protocol data in at least one first data block located after the second data block in the picture to be processed is written into the target picture in sequence.
[0179] According to one or more embodiments of the present invention, Example 3, according to the method of Example 2, generating audio protocol data corresponding to the second data block according to the audio stream data, includes:
[0180] According to a preset readable length, the audio segment data in the audio stream data is read in sequence in a loop;
[0181] If the segmented data length of the audio segmented data is equal to the preset readable length, writing the preset readable length and the audio segmented data into the audio protocol data corresponding to the second data block accordingly;
[0182] If the segment data length is smaller than the preset readable length, the segment data length and the audio segment data are correspondingly written into the audio protocol data.
[0183] According to one or more embodiments of the present invention, Example 4 is a method according to Example 3, and before cyclically reading the audio segment data in the audio stream data in sequence according to a preset readable length, the method further includes:
[0184] A data encryption operation is performed on the audio stream data to obtain encrypted audio stream data, and the encrypted audio stream data is used as current audio stream data.
[0185] According to one or more embodiments of the present invention, Example 5 is based on the method described in any one of Examples 1 to 4, and when the image protocol format is a Graphics Interchange Format (GIF), the second data block is an application extension block or an annotation extension block in the Graphics Interchange Format (GIF).
[0186] According to one or more embodiments of the present invention, Example 6 provides a picture playing method, the method comprising:
[0187] Performing a data reading operation on a target picture based on a picture protocol format to obtain picture protocol data in the target picture and audio protocol data in a second data block; wherein the picture protocol data includes at least one protocol data in a first data block;
[0188] Performing a picture decoding operation on the picture protocol data to obtain playback picture data, and performing an audio decoding operation on the audio protocol data to obtain audio stream data;
[0189] The playback picture data and the audio stream data are played synchronously.
[0190] According to one or more embodiments of the present invention, Example 7, according to the method described in Example 6, performing an audio decoding operation on the audio protocol data to obtain audio stream data, includes:
[0191] Circularly reading the segmented data lengths in the audio protocol data in sequence, and reading the audio segmented data in the audio protocol data according to the segmented data lengths;
[0192] Audio stream data is generated according to at least one audio segment data.
[0193] According to one or more embodiments of the present invention, Example 8 is the method according to Example 7, wherein determining the audio stream data according to at least one audio segment data comprises:
[0194] The audio data composed of at least one audio segment data is used as reference audio data, and a data decryption operation is performed on the reference audio data to obtain audio stream data.
[0195] According to one or more embodiments of the present invention, Example 9 is a method according to Example 6, wherein performing a data reading operation on a target picture based on a picture protocol format to obtain picture protocol data in the target picture and audio protocol data in the second data block includes:
[0196] In a process of performing a data reading operation on a target picture based on a set picture format, writing the protocol data in the read first data block into the picture protocol data;
[0197] When a block start character corresponding to the second data block is read, the protocol data read after the block start character is written into the audio protocol data;
[0198] until a block terminator corresponding to the second data block is read, writing the protocol data in the first data block read after the block terminator into the picture protocol data;
[0199] The block start character and the block end character are used to mark the data block position of the second data block.
[0200] According to one or more embodiments of the present invention, Example 10 is based on the method described in any one of Examples 7-9, and when the image protocol format is a Graphics Interchange Format (GIF), the second data block is an application extension block or an annotation extension block in the Graphics Interchange Format (GIF).
[0201] According to one or more embodiments of the present invention, Example 11 is the method according to Example 10, wherein the playback screen data includes a color index table and preview screen data, and accordingly, the synchronously playing the playback screen data and the audio stream data includes:
[0202] Determine the current playing picture frame according to the color index table and the preview picture data, and obtain the current audio segment in the audio stream data that is time-aligned with the current playing picture frame;
[0203] The currently played picture frame and the current audio segment are played synchronously.
[0204] According to one or more embodiments of the present invention, Example 12 provides a picture generating device, the device comprising:
[0205] An audio stream data acquisition module is used to acquire audio stream data and images to be processed based on an image protocol format;
[0206] A target image generation module, used to perform a data encapsulation operation on the image to be processed and the audio stream data to generate a target image based on the image protocol format;
[0207] Among them, the first data block in the target image stores the protocol data in the first data block in the image to be processed, and the second data block in the target image stores the audio protocol data corresponding to the audio stream data obtained by the data encapsulation operation, and the first data block and the second data block are both data blocks specified in the image protocol format.
[0208] According to one or more embodiments of the present invention, Example 13 provides a picture playing device, the device comprising:
[0209] A target picture data reading module, configured to perform a data reading operation on a target picture based on a picture protocol format, and obtain picture protocol data in the target picture and audio protocol data in the second data block; wherein the picture protocol data includes at least one protocol data in the first data block;
[0210] An audio protocol data decoding module, used to perform a picture decoding operation on the picture protocol data to obtain playback picture data, and to perform an audio decoding operation on the audio protocol data to obtain audio stream data;
[0211] The synchronous playing module is used to synchronously play the playing picture data and the audio stream data.
[0212] According to one or more embodiments of the present invention, Example 14 provides an electronic device, the electronic device comprising:
[0213] at least one processor; and
[0214] a memory communicatively connected to the at least one processor; wherein,
[0215] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the image generation method described in any one of the above examples 1-5 or the image playback method described in any one of the above examples 6-11.
[0216] According to one or more embodiments of the present invention, Example 15 provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the processor to implement the image generation method described in any one of the above Examples 1-5 or the image playback method described in any one of the above Examples 6-11 when executed.
[0217] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the disclosure scope involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) by each other.
[0218] In addition, although each operation is described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present invention. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0219] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for generating an image, characterized in that: include: Get audio stream data and the image to be processed based on the image protocol format; Performing a data encapsulation operation on the image to be processed and the audio stream data to generate a target image based on the image protocol format; Among them, the first data block in the target image stores the protocol data in the first data block in the image to be processed, and the second data block in the target image stores the audio protocol data corresponding to the audio stream data obtained by the data encapsulation operation, and the first data block and the second data block are both data blocks specified in the image protocol format.
2. The method according to claim 1, characterized in that The performing a data encapsulation operation on the to-be-processed picture and the audio stream data to generate a target picture based on the picture protocol format includes: Writing protocol data in at least one first data block located before the second data block in the to-be-processed picture into the target picture in sequence; Generate audio protocol data corresponding to the second data block according to the audio stream data, and write the audio protocol data into the target picture; The protocol data in at least one first data block located after the second data block in the picture to be processed is written into the target picture in sequence.
3. The method according to claim 2, characterized in that The step of generating audio protocol data corresponding to the second data block according to the audio stream data includes: According to a preset readable length, the audio segment data in the audio stream data is read in sequence in a loop; If the segmented data length of the audio segmented data is equal to the preset readable length, writing the preset readable length and the audio segmented data into the audio protocol data corresponding to the second data block accordingly; If the segment data length is smaller than the preset readable length, the segment data length and the audio segment data are correspondingly written into the audio protocol data.
4. The method according to claim 3, characterized in that Before cyclically reading the audio segment data in the audio stream data in sequence according to the preset readable length, the method further includes: A data encryption operation is performed on the audio stream data to obtain encrypted audio stream data, and the encrypted audio stream data is used as current audio stream data.
5. The method according to any one of claims 1 to 4, characterized in that: When the picture protocol format is a GIF (Graphics Interchange Format), the second data block is an application extension block or an annotation extension block in the GIF (Graphics Interchange Format).
6. A method for playing pictures, characterized in that: include: Performing a data reading operation on a target picture based on a picture protocol format to obtain picture protocol data in the target picture and audio protocol data in a second data block; wherein the picture protocol data includes at least one protocol data in a first data block; Performing a picture decoding operation on the picture protocol data to obtain playback picture data, and performing an audio decoding operation on the audio protocol data to obtain audio stream data; The playback picture data and the audio stream data are played synchronously.
7. The method according to claim 6, characterized in that The step of performing an audio decoding operation on the audio protocol data to obtain audio stream data includes: Circularly reading the segmented data lengths in the audio protocol data in sequence, and reading the audio segmented data in the audio protocol data according to the segmented data lengths; Audio stream data is generated according to at least one audio segment data.
8. The method according to claim 7, characterized in that The step of determining the audio stream data according to at least one audio segment data comprises: The audio data composed of at least one audio segment data is used as reference audio data, and a data decryption operation is performed on the reference audio data to obtain audio stream data.
9. The method according to claim 6, characterized in that The performing of a data reading operation on a target picture based on a picture protocol format to obtain picture protocol data in the target picture and audio protocol data in a second data block includes: In a process of performing a data reading operation on a target picture based on a set picture format, writing the protocol data in the read first data block into the picture protocol data; When a block start character corresponding to the second data block is read, the protocol data read after the block start character is written into the audio protocol data; until a block terminator corresponding to the second data block is read, writing the protocol data in the first data block read after the block terminator into the picture protocol data; The block start character and the block end character are used to mark the data block position of the second data block.
10. The method according to any one of claims 7 to 9, characterized in that: When the picture protocol format is a GIF (Graphics Interchange Format), the second data block is an application extension block or an annotation extension block in the GIF (Graphics Interchange Format).
11. The method according to claim 10, characterized in that The play screen data includes a color index table and preview screen data. Accordingly, the play screen data and the audio stream data are played synchronously, including: Determine the current playing picture frame according to the color index table and the preview picture data, and obtain the current audio segment in the audio stream data that is time-aligned with the current playing picture frame; The currently played picture frame and the current audio segment are played synchronously.
12. A picture generating device, characterized in that: include: An audio stream data acquisition module is used to acquire audio stream data and images to be processed based on an image protocol format; A target image generation module, used to perform a data encapsulation operation on the image to be processed and the audio stream data to generate a target image based on the image protocol format; Among them, the first data block in the target image stores the protocol data in the first data block in the image to be processed, and the second data block in the target image stores the audio protocol data corresponding to the audio stream data obtained by the data encapsulation operation, and the first data block and the second data block are both data blocks specified in the image protocol format.
13. A picture playing device, characterized in that: include: A target picture data reading module, configured to perform a data reading operation on a target picture based on a picture protocol format, and obtain picture protocol data in the target picture and audio protocol data in the second data block; wherein the picture protocol data includes at least one protocol data in the first data block; An audio protocol data decoding module, used to perform a picture decoding operation on the picture protocol data to obtain playback picture data, and to perform an audio decoding operation on the audio protocol data to obtain audio stream data; The synchronous playing module is used to synchronously play the playing picture data and the audio stream data.
14. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the image generation method described in any one of claims 1-5 or the image playback method described in any one of claims 6-11.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image generation method described in any one of claims 1-5 or the image playback method described in any one of claims 6-11 when executed.