Image metadata processing method and device, equipment and storage medium

By writing definition information in the image file and dynamically managing the image metadata structure, the synchronization problem between the writing side and the parsing side in the existing technology is solved, and the flexibility of the data structure and the adaptability of the decoding are achieved.

CN119336926APending Publication Date: 2025-01-21GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310893245.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-19
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

When processing image metadata, the prior art tends to cause synchronization problems between the write side and the parsing side due to the update of the data structure, resulting in parsing errors.

Method used

By writing definition information in image files, dynamic management of metadata structures is achieved, allowing independent management of data structures on the encoding and decoding sides to avoid synchronization dependencies.

Benefits of technology

It realizes the flexible addition and deletion of data elements within the data structure, as well as the flexible addition and deletion of the data structure, without the need for synchronization of the two parties' agreement, and relieves the synchronization dependence of encoding and decoding on the metadata structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336926A_ABST
    Figure CN119336926A_ABST
Patent Text Reader

Abstract

The invention discloses an image metadata processing method and device, equipment and a storage medium, and the method comprises the steps: determining definition information for defining a data structure at an image coding side according to the data structure of image metadata; generating expansion information for recording the image metadata according to the definition information and the data information; writing the expansion information into the image file; at the image decoding side, the definition information in the expansion information is firstly analyzed, the data structure of the image metadata is determined, and then the data information is analyzed according to the data structure to obtain the image metadata. Thus, dynamic management of the metadata structure is achieved by writing the definition information into the image file, flexible addition and deletion of data elements in the data structure and flexible addition and deletion of the data structure can be specifically achieved, protocol synchronization of the two parties is not needed, and synchronous dependence of encoding and decoding on the metadata structure is relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to image processing technology, and in particular to an image metadata processing method, device, equipment and storage medium. Background Art

[0002] The Exchangeable image file format (Exif) is an exchangeable image file format specially designed for photos taken with digital cameras. It can record the attribute information and shooting data of digital photos, that is, the metadata of the image. During the production process of each frame of the image, metadata such as the hardware, algorithm, and control parameters related to it will be generated. This data is crucial for subsequent image processing, parameter debugging, and viewing. It is necessary to bring out this data in some way and provide it to users, developers, etc.

[0003] Some common metadata storage methods currently use an agreed data structure to store the collected metadata corresponding to the captured image in the form of EXIF ​​in the general EXIF ​​image identification information segment, referred to as the "EXIF information segment". The EXIF ​​data writing side and the EXIF ​​parsing side require a set of agreed and completely consistent data structures to ensure that data storage and parsing can match one-to-one. In the actual R&D process, the output metadata is often dynamically added or deleted according to business needs. Frequent updates can easily lead to the inability of the data writing side and the parsing side to synchronize in time, resulting in parsing errors. Summary of the invention

[0004] The embodiments of the present application are intended to provide an image metadata processing method, apparatus, device and storage medium.

[0005] The technical solution of this application is implemented as follows:

[0006] In a first aspect, a method for processing image metadata is provided, comprising:

[0007] Determine, according to the data structure of the image metadata, definition information for defining the data structure; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure;

[0008] Acquire data information of the image metadata;

[0009] Generate extended information of image metadata according to the definition information and the data information;

[0010] The extended information is written into the image file.

[0011] In a second aspect, a method for processing image metadata is provided, comprising:

[0012] Get the image file;

[0013] Acquire extended information of image metadata from the image file;

[0014] Parsing definition information in the extended information for defining a data structure of image metadata to determine the data structure of the image metadata; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure;

[0015] The data information in the extended information is parsed according to the data structure to obtain the image metadata.

[0016] In a third aspect, an image metadata processing device is provided, comprising:

[0017] A first determining unit is used to determine, according to a data structure of the image metadata, definition information for defining the data structure; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure;

[0018] A first acquisition unit, used to acquire data information of the image metadata;

[0019] The encoding unit is used to generate extended information of the image metadata according to the definition information and the data information; and write the extended information into the image file.

[0020] In a fourth aspect, an image metadata processing device is provided, comprising:

[0021] A second acquisition unit, used for acquiring an image file;

[0022] A second determining unit, configured to obtain extended information of image metadata from the image file;

[0023] A decoding unit, used to parse definition information used to define a data structure of image metadata in the extended information, and determine the data structure of the image metadata; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure;

[0024] The decoding unit is further used to parse the data information in the extended information according to the data structure to obtain the image metadata.

[0025] In a fifth aspect, an image metadata processing device is provided, comprising: a processor and a memory configured to store a computer program that can be run on the processor,

[0026] Wherein, the processor is configured to execute the steps of the aforementioned method when running the computer program.

[0027] In a sixth aspect, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program implements the steps of the aforementioned method when executed by a processor.

[0028] In the embodiments of the present application, a method, device, equipment and storage medium for processing image metadata are provided. On the image encoding side, the definition information for defining the data structure is determined according to the data structure of the image metadata; based on the definition information and the data information, the extended information for recording the image metadata is generated; the extended information is written into the image file; on the image decoding side, the data structure of the image metadata is determined by first parsing the definition information in the extended information, and then the image metadata is obtained by parsing the data information according to the data structure. In this way, dynamic management of the metadata structure is achieved by writing the definition information into the image file, and specifically, the flexible addition and deletion of the data elements within the data structure and the flexible addition and deletion of the data structure can be achieved, without the need for synchronization of the agreement between the two parties, and the synchronization dependence of encoding and decoding on the metadata structure is eliminated. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 This is a schematic diagram of a first process of the image metadata processing method in an embodiment of the present application;

[0030] Figure 2 The structure diagram of the information defined in the embodiment of the present application is shown in FIG. Figure 1 ;

[0031] Figure 3 The composition structure of the data information in the embodiment of the present application is shown in FIG. Figure 1 ;

[0032] Figure 4 The structure diagram of the extended information in the embodiment of the present application is shown in FIG. Figure 1 ;

[0033] Figure 5 The structure diagram of the extended information in the embodiment of the present application is shown in FIG. Figure 2 ;

[0034] Figure 6 This is a schematic diagram of the composition structure of the header information in the embodiment of the present application;

[0035] Figure 7 The structure diagram of the information defined in the embodiment of the present application is shown in FIG. Figure 2 ;

[0036] Figure 8 The composition structure of the data information in the embodiment of the present application is shown in FIG. Figure 2 ;

[0037] Fig. 9 This is a schematic diagram of the storage structure of the Field data type in an embodiment of the present application;

[0038] Fig.10 Schematic diagram of the storage location of the extended information in the image file in the embodiment of the present application Figure 1 ;

[0039] Fig.11 Schematic diagram of the storage location of the extended information in the image file in the embodiment of the present application Figure 2 ;

[0040] Fig.12 Schematic diagram of the storage location of the extended information in the image file in the embodiment of the present application Figure 3 ;

[0041] Fig.13 This is a second flow chart of the image metadata processing method in an embodiment of the present application;

[0042] Fig.14 This is the image metadata decoding process in the embodiment of this application;

[0043] Fig.15 It is the image metadata decoding topology diagram in the embodiment of the present application;

[0044] Fig.16 The structure diagram of the image metadata processing device in the embodiment of the present application is shown in FIG. Figure 1 ;

[0045] Fig.17 The structure diagram of the image metadata processing device in the embodiment of the present application is shown in FIG. Figure 2 ;

[0046] Fig.18 Schematic diagram of the composition structure of the image metadata processing device in the embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0048] An embodiment of the present application provides an image metadata processing method, which is applied to an encoding end. Figure 1 FIG. 1 is a schematic diagram of a first process of the image metadata processing method in an embodiment of the present application. Figure 1 As shown, the method may specifically include:

[0049] Step 101: Determine definition information for defining the data structure according to the data structure of the image metadata; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure;

[0050] It should be noted that the definition information is used to define the data structure of the image metadata (Meatdata). The decoding end can determine the data structure of the metadata written in the image file by parsing the definition information, and parse the data information according to the data structure to obtain the metadata. Exemplarily, the metadata may include the camera's software algorithm, hardware algorithm, control parameters and other related metadata for subsequent image processing, parameter debugging, viewing, etc.

[0051] It should be noted that the definition information may include at least one definition information, and the definition information includes tag information and at least one data element information included in the tag information. The tag information can be understood as tag information of a data structure, which is used to define a data structure, and the data element information is used to define a data element in the data structure. In some embodiments, the definition information may define at least one metadata data structure, that is, the definition information includes at least one tag information.

[0052] In some embodiments, the definition information includes: first-level tag information, and at least one first-level data element information included in the first-level tag information; Figure 2 The structure diagram of the information defined in the embodiment of the present application is shown in FIG. Figure 1 .

[0053] Exemplarily, the first level tag information includes: tag identifier, tag type, number of elements, and tag name;

[0054] The first-level data element information includes: element identifier, data type, data quantity and data name.

[0055] Exemplarily, data types include general data types and extended data types. Specifically, general data types can be understood as basic data types, such as integer types (byte, stort, int, long), floating point types (float, double), character types (char), string types (string), Boolean types (boolean), etc. Extended data types can be understood as a custom data type, such as structure types, array types, enumeration types, etc.

[0056] In some embodiments, the definition information further includes: second-level tag information, and at least one second-level data element information included in the second-level tag information. Determining the definition information for defining the data structure according to the data structure of the image metadata further includes: when the data type of the first-level data element information is a preset extended data type, determining the second-level tag information according to the first-level data element information; and determining at least one second-level data element information included in the second-level tag information according to the data structure corresponding to the extended data type.

[0057] That is to say, when the data type of the first-level data element is an extended data type, the data structure of the extended data type may be further defined, and its definition information may be written into the image unit.

[0058] In some embodiments, extended data types may also be agreed upon through protocols to avoid making the definition information too complex.

[0059] In some embodiments, the method may further include: when the data structure of the image metadata is updated, determining new definition information according to the updated data structure.

[0060] In some embodiments, tag information is a collection of a cluster of information (such as the data structure AecExpData shown in Table 1). Tag information can be defined as TAG type information, which has 4 fields to identify the TAG type information including: tag identifier (id), tag type (type), number of elements (count) and tag name (name). Among them,

[0061] id: The unique ID identification number of this TAG type information (can share the same value with type), which will not be repeated;

[0062] type: a type unique to this TAG type information, which will not be repeated;

[0063] count: This TAG type information contains several data elements (Field).

[0064] name: The data structure name of this TAG type information.

[0065] Exemplarily, when TAG type information is encoded, the relevant identifier is assigned as: Tag1: [id: 1, type: AEC_TAG_AecExpData, count: 7, name: AecExpData].

[0066] It should be noted that TAG information can store multiple TAG1 to TAG-N, and in principle is not limited by the size of the space (only limited by the memory size available when the shooting device is running).

[0067] Data element information refers to each data element in the tag information set (such as the data elements booldata, chardata, etc. in Table 1). Data element information can be defined as Field class information. There are four fields that identify the definition of Field class information, namely, element identifier (id), data type (type), data quantity (count), and data name (name). Among them,

[0068] id: The id identification number of this Field element. It can be incremented from 1 to 1 in the same Tag type information.

[0069] type: The data type of this Field element, such as FIELD_BOOL corresponding to bool, or the basic type of the structure.

[0070] count: The number of elements of a single data type contained in this Field element. 1 indicates a single element, and 2 or more indicates a one-dimensional array.

[0071] name: The data entity name of this Field element.

[0072] For example, when encoding Field class information, the relevant identifier is assigned:

[0073] Field 1:[id:1,type:FIELD_BOOL,count:1,name:Booldata]

[0074] Table 1

[0075]

[0076] Step 102: Obtaining data information of image metadata;

[0077] In some embodiments, obtaining data information of image metadata may include: obtaining first image metadata indicated by at least one data element information corresponding to first tag information; adding the first tag information to a header of the first image metadata to obtain data information corresponding to the first image metadata; wherein the first tag information is any tag information in the definition information.

[0078] It should be noted that when the definition information includes multiple tag information, the data information corresponding to the image metadata is merged according to the arrangement order of the tag information to obtain complete data information. Figure 3 The composition structure of the data information in the embodiment of the present application is shown in FIG. Figure 1 .

[0079] Step 103: Generate extended information of image metadata according to the definition information and data information;

[0080] It should be noted that the extended information includes definition information and data information. Further, the extended information also includes header information, which is used to locate and parse the extended information so that the decoding end can obtain the complete extended information from the image file according to the header information. Specifically, the header information is located at the front end of the positioning information and the data information. Figure 4 The structure diagram of the extended information in the embodiment of the present application is shown in FIG. Figure 1 ,Extended information includes three parts: header information, definition information and data information.

[0081] Exemplarily, the header information includes: first header information and second header information; wherein the first header information includes: segment start identifier and segment length; the second header information includes: start information, index information and version information; the start information includes at least one of the following: the total number of copies of extended information, the number identifier of the current copy of extended information, the total number of slices of the current copy of extended information, and the slice identifier of the current extended information slice.

[0082] It should be noted that the current image may be a combination of multiple images, and the image file may store metadata of multiple images, that is, multiple extended information. Therefore, the total number of extended information and the number of current extended information are required to distinguish the extended information of different images.

[0083] In some embodiments, the starting information may include the total number of copies of the extended information and the number of copies of the current copy of the extended information. That is, when the metadata of multiple images are written in an image file, header information is added to the front end of the extended information of each image, and the header information needs to record the total number of copies of the extended information and the number of copies of the current copy of the extended information. Each copy of the extended information is set with corresponding header information to distinguish the extended information of different images. Correspondingly, the method also includes: when the extended information of multiple images is written in the image file, determining the total number of copies of the extended information in the second header information and the number of copies of the current copy of the extended information; adding the first header information and the second header information to each copy of the extended information; and writing all the extended information into the image file. Specifically, all the extended information can be written into the image file separately, or all the extended information can be merged and written into the image file.

[0084] In some embodiments, the starting information may include the total number of slices of the current extended information and the slice identifier of the current slice. That is, when the extended information is written in slices, header information is added to the front end of each slice, and the header information needs to record the total number of slices of the extended information and the slice identifier of the current slice. Each slice is set with corresponding header information to distinguish different slices. Correspondingly, the method also includes: when the extended information is written into the internal information segment of the image file, when the total length of the extended information is greater than the segment length of the image file, the extended information is sliced ​​according to the segment length to obtain at least two slices and slice information; according to the slice information, the total number of slices of the current extended information in the second header information and the slice identifier of each slice in the current extended information are determined; the first header information and the second header information are added to each slice; and each slice is written into the image file.

[0085] It is understandable that the extended information of an image may be sliced ​​and header information may be added to the front of each slice. The extended information of multiple images may also be merged in a preset order to obtain complete extended information, and further the complete extended information may be sliced ​​and header information may be added to the front of each slice.

[0086] Step 104: Write the extended information into the image file.

[0087] In some embodiments, the extended information is written into the reserved information segment of the image file, or the extended information is written into the end of the image file. The image file format can be any image format, for example, the image file format can be the image format defined by the Joint Photographic Experts Group (JPEG), and the extended information is written into the application information segment of the JPEG file.

[0088] In some embodiments, writing the extended information into the image file includes: encrypting the extended information; and writing the encrypted extended information into the image file.

[0089] It should be noted that when the metadata written into the image file is non-shared data, the extended information can be encrypted and written into the image file to improve the security of the metadata.

[0090] By adopting the above technical solution, dynamic management of metadata structure is achieved by writing definition information into the image file. Specifically, flexible addition and deletion of data elements within the data structure and flexible addition and deletion of the data structure can be achieved without the need for protocol synchronization between the two parties, thereby eliminating the synchronization dependence of encoding and decoding on the metadata structure.

[0091] In order to better reflect the purpose of the present application, based on the above-mentioned embodiments of the present application, the encoding method of the image metadata is further illustrated.

[0092] Figure 5 The structure diagram of the extended information in the embodiment of the present application is shown in FIG. Figure 2 ,like Figure 5 As shown, the extended information can be an extended exchangeable image file format (Exif) information, referred to as "ExtExif information", which can include standard Exif information and related metadata such as the camera's software algorithm, hardware algorithm, and control parameters, which is used for subsequent image processing, parameter debugging, and viewing.

[0093] The embodiment of the present application defines an ExtExif dynamic encoding protocol to divide ExtExif information into three parts and store them in sequence.

[0094] Header information (ExtExif Header): The first part stores flags, MagicString, protocol version information, etc. used to retrieve information.

[0095] Definition information (ExtExif Definition): The second part stores the definition of the data format. For each TAG, the relevant TAG and Field definitions are stored, and the definition content is used to parse the data stored in the third part. The Field definition content includes id, type, count, and name. Here, the type of filed is agreed to be a certain format, such as a basic type or some negotiated and confirmed structure type. In this way, when adding or deleting TAG or Field content subsequently, the main information such as the type and name of the corresponding TAG and filed can be accurately reflected. The decoding side does not need to know the metadata header file in advance, and can obtain the data definition based on it.

[0096] Data information (ExtExif Data): The third part stores metadata values. The data content corresponding to the ExtExif Definition is stored in the image file in the order of the TAG class information corresponding to the ExtExif Definition.

[0097] 1. Part 1: ExtExif_Header encoding method

[0098] (1) General Introduction of ExtExif_Header

[0099] like Figure 6As shown, ExtExif_Header mainly includes two parts, namely the first header information (ExtExif_Header0) and the second header information (ExtExif_Header1), which mainly implements JPEG segment identification and encoded content retrieval, judgment and recording.

[0100] Table 2

[0101]

[0102] The data structure of ExtExif_Header is shown in Table 2.

[0103] ExtExifHeader0 mainly includes APP0 (image identification information), and the default value is FF E4 (2 bytes) + length (2 bytes).

[0104] ExtExifHeader1 mainly covers the identification segment content, ExtExif number of copies, number of splits, protocol version and other contents.

[0105] (2) Introduction to ExtExif_Header0

[0106] Table 3

[0107]

[0108] The data structure of ExtExif_Header0 is shown in Table 3.

[0109] SegmentCode mainly stores APP0 (image identification information) corresponding to the JPEG protocol, FF+(E0~EF). For example, the default setting can be FF E4, and E4 is set as the ExtExif type to distinguish it from the standard EXIF ​​format.

[0110] segmentLen indicates the current segment length. For example, the current segment data length does not exceed 0xFFFFF bytes, that is, 65536. If the ExtExif information is stored at the end of the image, the ExtExif information is not limited by segmentLen when it is written, and this information can be ignored.

[0111] (3) Introduction to ExtExif_Header1

[0112] Table 4

[0113]

[0114] The ExtExif_Header1 data structure is shown in Table 4.

[0115] (a) ExtExif start information (ExtExif_Starter)

[0116] As shown in Table 4, the data structure struct ExtExifStarter contains 4 elements:

[0117] -totalNum: total number of ExtExif copies, cardinality, indicating the storage of ExtExif information of multiple images.

[0118] -ordinalNum: the number of the ExtExif, ordinal number.

[0119] -sliceAll: The total number of slices in the current ExtExif. If the amount of data in an ExtExif exceeds 65536, it needs to be sliced.

[0120] -slice: current ExtExif slice number, current ExtExif slice number.

[0121] (For sliceAll and slice elements, if the ExtExif information is stored in the JPEG standard segment and the data volume exceeds 65536, this information needs to be used for segmentation; if there is an image tail, this information can be ignored.)

[0122] (b) ExtExif index information (ExtExif_MagicString)

[0123] This part of the data structure is ExtExifMagicString, which can be used to retrieve / locate the location of ExtExif information. It usually has a certain length. Figure 6 The length of 20 bytes is for reference only and the length is variable.

[0124] (c) ExtExif version information (ExtExif_Ver)

[0125] This part of the data structure is ExtExifVer, which mainly records the version information of the ExtExif protocol.

[0126] ExtExif_Header information header, the internal elements can vary depending on the location where ExtExif is stored.

[0127] If the ExtExif information is stored in the JPEG standard segment, it will be limited by the segment length, and the segment length, slice and other information need to be written. In addition, the data needs to be divided into different segments and stored in segments during encoding.

[0128] If the ExtExif information is stored at the end of the image, it is not limited by the segment length and does not need to be segmented. Information such as segment length and slicing does not need to be filled in. From the perspective of the protocol, both storage methods are supported.

[0129] 2. Part 2: ExtExif defines information encoding method

[0130] (1) Encoding format of ExtExif and definition-related information

[0131] Figure 7 The structure diagram of the information defined in the embodiment of the present application is shown in FIG. Figure 2 .

[0132] (a) TAG area information definition

[0133] Tag information is a collection of a cluster of information (such as the data structure AecExpData shown in Table 1). Tag information can be defined as TAG class information, which has 4 fields to identify TAG class information including: tag identifier (id), tag type (type), number of elements (count) and tag name (name). Among them,

[0134] id: The unique ID identification number of this TAG type information (can share the same value with type), which will not be repeated;

[0135] type: a type unique to this TAG type information, which will not be repeated;

[0136] count: This TAG type information contains several data elements (Field).

[0137] name: The data structure name of this TAG type information.

[0138] Exemplarily, when TAG type information is encoded, the relevant identifier is assigned as: Tag1: [id: 1, type: AEC_TAG_AecExpData, count: 7, name: AecExpData].

[0139] (b) Field area information definition

[0140] Field class information is each data element in the TAG class information set (such as the data elements booldata, chardata, etc. in Table 1). Table 1 has four fields that identify the definition of Field class information, namely, element identifier (id), data type (type), data quantity (count), and data name (name). Among them,

[0141] id: The id identification number of this Field element. It can be incremented from 1 to 1 in the same Tag type information.

[0142] type: The data type of this Field element, such as FIELD_BOOL corresponding to bool, or the basic type of the structure.

[0143] count: The number of elements of a single data type contained in this Field element. 1 indicates a single element, and 2 or more indicates a one-dimensional array.

[0144] name: The data entity name of this Field element.

[0145] For example, when encoding Field class information, the relevant identifier is assigned:

[0146] Field 1:[id:1,type:FIELD_BOOL,count:1,name:Booldata]

[0147] (c) Number and space of TAG information

[0148] TAG information can store multiple TAG1~TAG-N, and in principle is not limited by the size of the space (only limited by the memory size that can be used by the shooting device when it is running).

[0149] (2) Define methods for dynamically adding and deleting information

[0150] (a) Dynamic addition and deletion of TAG information collection

[0151] If a new TAG class information set needs to be added, such as in Table 1, TAG class information struct AecExpData, the comment part describes the encoding content of the data definition information, and the relevant definition information can be encoded into the storage area of ​​the image file in sequence directly through software engineering methods.

[0152] (b) Dynamic addition and deletion of general Field elements in TAG information

[0153] As shown in Table 1, the TAG class information struct AecExpData contains common data types such as bool, char, float, int32, etc. This type of information can be added at will, either as a single element or a one-dimensional array.

[0154] (c) Dynamic addition and deletion of Field elements in TAG information (extended type)

[0155] As shown in Table 1, the TAG class information struct AecExpData contains extended data types such as structAECDebugROIDim. This type of information can be used as a supplement to the general data type. In some embodiments, if a new data type needs to be added, it needs to be synchronized to the parsing tool side and put into the header file for type numbering. In general, if an extended basic data type needs to be added temporarily, it can be split into general basic data types for storage. Alternatively, it is written into the image file as an extended data type and synchronized to the parsing tool to support the parsing support of this data structure.

[0156] Field data types need to be numbered to represent the corresponding data types and need to be synchronized to the parsing tool in advance so that the parsing tool can parse them.

[0157] The type number and id number of the TAG class information do not need to be synchronized to the parsing tool in advance. You only need to ensure that the type of each TAG class is different during encoding.

[0158] 3. Part 3: ExtExif data information encoding method

[0159] When the definition information of all the tag information sets of ExtExif is encoded and stored in the buffer space corresponding to the JPEG data, the data information of the tag information sets is encoded and stored in the JPEG.

[0160] like Figure 8 The data information composition structure shown in the figure, the TAG-1 area stores the tag-related definition information again, so as to align with the corresponding definition information mentioned above. The Data area stores all the data of this Tag class information set, and the Tag class data information is copied and written into this area as a whole. In a similar way, the data information corresponding to the defined Tag class information is written into the Buffer corresponding to the JEPG one by one.

[0161] (1) Storage structure of Field data

[0162] Fig. 9 Schematic diagram of the storage structure of the Field data type in the embodiment of the present application, such as Fig. 9 As shown, it is a reference for the ExtExif protocol Field storage structure (not limited to the above form, it can be expanded and developed as needed).

[0163] Single-value variables, such as the Field elements booldata, chardata, floatdata, doubledata, uintdata, etc. in Table 1, have data types that are general basic data types, and a single Field element contains only one data. This type of information can be added at will, and the tool side can automatically adapt and parse it.

[0164] A single-value one-dimensional array, such as the intdata[5] of the Field element in Table 1, has a general basic data type, and a single Field element contains multiple data. This type of information can be added at will, and the tool side can automatically adapt and parse it.

[0165] Struct variables, such as the roi of the Field element in Table 1, the data type struct AECDebugROIDim is an extended basic data type, and a single Field element contains a structure data. This type of information cannot be added at will, and some basic data structures need to be defined in advance. The parsing tool must know this data structure in advance before parsing, and after definition, if modification is required, the parsing tool needs to be informed. This data should not be changed frequently.

[0166] One-dimensional array of structures, such as rois[5] of the Field element in Table 1, has a data type that is a general basic data type. A single Field element contains multiple structure data. Its usage is the same as the "structure variable" method.

[0167] The four storage structures introduced above basically cover most business needs, and can be further expanded according to business needs, such as single-value two-dimensional array, structure two-dimensional array, etc. If there is a more complex Field structure, it is recommended to split it into a basic data storage structure, or save it separately as a Tag class information.

[0168] (2) Data type of Field element

[0169] Table 5

[0170]

[0171] (a)Field (general type) basic data type

[0172] As shown in Table 5, the enumeration members starting with FIELD_ are numbers of basic computer data types, representing commonly used computer general data types. This number represents the corresponding data type, and is written into the JPEG file according to the above encoding method. The tool side selects the corresponding data type to parse the relevant data based on this number.

[0173] (b) Field (Extensibility) Basic Data Type

[0174] As shown in Table 5, the enumeration members starting with AEC_FIELD_ are extended data types, not general data types for calculations, but user-defined data types. The data structure of this data type is a user-defined data structure, and the parsing tool must know this type of data structure in advance before parsing it. After definition, if modification is required, the parsing tool must be informed, and this data should not be changed frequently.

[0175] Furthermore, the storage location of ExtExif information in the image file is further illustrated. The image file in JPEG format stores related data information in different segments. There is an information segment called APP0 image identification information. The first two bytes of the segment are FF+(E0~EF), and the next two bytes are the length, which is 0xFFFF, i.e. 65536 bytes at most. For example, the first two bytes of the segment can be set to FF E4 to distinguish it from the standard EXIF ​​data segment (the standard EXIF ​​generally starts with FF+(E0 or E1 or E2), etc.).

[0176] Storage method 1: Image ExtExif information is stored in the standard segment of the JPEG file

[0177] Fig.10 Schematic diagram of the storage location of ExtExif information in an image file in the embodiment of the present application Figure 1 ,like Fig.10 As shown, if the total data encoded by information such as ExtExif_Header1, Exif_Definition, and Exif_Data does not exceed 65536, it can be stored directly without data segmentation.

[0178] Fig.11 Schematic diagram of the storage location of ExtExif information in an image file in the embodiment of the present application Figure 2 ,like Fig.11 As shown in the figure, if the total data encoded by ExtExif_Header1, Exif_Definition, Exif_Data and other information exceeds 65536, one data segment cannot be fully stored, and the data encoded by Exif_Definition and Exif_Data above needs to be divided into 2 or more data segments for storage. The segment length (segmentLen), slice information (sliceAll and slice), etc. need to be written. In addition, the data needs to be divided into different segments and stored in segments during encoding.

[0179] Storage method 2: ExtExif information is stored at the end of the JPEG file

[0180] Fig.12 Schematic diagram of the storage location of ExtExif information in an image file in the embodiment of the present application Figure 3 ,like Fig.12 As shown in the figure, the image ExtExif information is stored at the end of the JPEG file, that is, after EOI. To avoid the need to divide the data into multiple segments and store them in the APP0 image identification information segment after the data volume exceeds 65536 bytes, which will bring complexity to software processing, all ExtExif information can also be stored at the end of the image, without being restricted by the segment length, without segmentation, and without segment length, slice and other information, or the segment length, slice and other information can be set to the default value.

[0181] This solution reduces the complexity of ExtExif information storage to a certain extent. In addition, ExtExif information is stored at the end of the image, which will hardly affect the parsing of other image information of the image file and the image display speed when opening the image file.

[0182] An embodiment of the present application also provides an image metadata processing method, which is applied to a decoding end. Fig.13 FIG. 2 is a second flow chart of the image metadata processing method in the embodiment of the present application. Fig.13 As shown, the method may specifically include:

[0183] Step 201: Obtain an image file;

[0184] Step 202: Acquire extended information of image metadata from the image file;

[0185] In some embodiments, it should be noted that the extended information includes definition information and data information. Further, the extended information may also include header information, which is used to locate and parse the extended information so that the decoding end can obtain the complete extended information from the image file according to the header information. Specifically, the header information is located at the front end of the positioning information and the data information. Figure 4 The structure diagram of the extended information in the embodiment of the present application is shown in FIG. Figure 1 ,Extended information includes three parts: header information, definition information and data information.

[0186] The header information includes: first header information and second header information; wherein, the first header information includes: segment start identifier and segment length; the second header information includes: start information, index information and version information; the start information includes at least one of the following: the total number of copies of the extended information, the number identifier of the current copy of the extended information, the total number of slices of the current copy of the extended information, and the slice identifier of the current extended information slice.

[0187] It should be noted that the current image may be a combination of multiple images, and the image file may store metadata of multiple images, that is, multiple extended information. Therefore, the total number of extended information and the number of current extended information are required to distinguish the extended information of different images.

[0188] In some embodiments, obtaining extended information of image metadata from an image file includes: determining the total number of copies of extended information and the number identifier of the current copy of extended information contained in the image file according to the extended information start information in the second header information; when the total number of copies of the extended information is greater than 1, obtaining extended information of multiple images from the image file;

[0189] And / or, obtaining extended information of image metadata from the image file, including: determining the total number of slices of the current extended information and the slice identifier of the current extended information slice according to the extended information starting information in the second header information; when the total number of slices of the current extended information is greater than 1, obtaining multiple extended information slices from the image file; and splicing the multiple extended information slices to obtain the current extended information.

[0190] In some embodiments, obtaining extended information of image metadata from an image file includes: obtaining encrypted extended information from the image file; and decrypting the encrypted extended information to obtain the extended information.

[0191] Step 203: parsing definition information in the extended information for defining a data structure of image metadata, and determining the data structure of the image metadata; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure;

[0192] It should be noted that the definition information is used to define the data structure of the image metadata (Meatdata). The decoding end can determine the data structure of the metadata written in the image file by parsing the definition information, and obtain the metadata by parsing the data information according to the data structure.

[0193] It should be noted that the definition information may include at least one definition information, and the definition information includes tag information and at least one data element information included in the tag information. The tag information can be understood as tag information of a data structure, which is used to define a data structure, and the data element information is used to define a data element in the data structure. In some embodiments, the definition information may define at least one metadata data structure, that is, the definition information includes at least one tag information.

[0194] In some embodiments, the definition information includes: first-level tag information, and at least one first-level data element information included in the first-level tag information; Figure 2 The structure diagram of the information defined in the embodiment of the present application is shown in FIG. Figure 1 .

[0195] Exemplarily, the first level tag information includes: tag identifier, tag type, number of elements, and tag name;

[0196] The first-level data element information includes: element identifier, data type, data quantity and data name.

[0197] In some embodiments, the definition information further includes: second-level tag information, and at least one second-level data element information included in the second-level tag information. Parsing the definition information used to define the data structure of the image metadata in the extended information to determine the data structure of the image metadata further includes: when the data type of the first-level data element information is a preset extended data type, determining the second-level tag information according to the first-level data element information; determining the data structure corresponding to the extended data type according to the at least one second-level data element information included in the second-level tag information.

[0198] In some embodiments, extended data types may also be agreed upon through protocols to avoid making the definition information too complex.

[0199] Step 204: parse the data information in the extended information according to the data structure to obtain image metadata.

[0200] In some embodiments, parsing definition information in the extended information for defining a data structure of image metadata includes: determining a data structure corresponding to the first tag information according to the first tag information and at least one data element information included in the first tag information; wherein the first tag information is any tag information in the definition information;

[0201] Correspondingly, the data information in the image file is parsed according to the data structure to obtain the image metadata, including: determining the data information corresponding to the first image metadata in the extended information according to the first tag information; and parsing the data information corresponding to the first image metadata according to the data structure corresponding to the first tag information to obtain the first image metadata.

[0202] It should be noted that when the definition information includes multiple tag information, the corresponding data information is acquired in sequence according to the arrangement order of the tag information.

[0203] Fig.14 This is the image metadata decoding process in the embodiment of this application. Fig.15 This is the image metadata decoding topology diagram in the embodiment of the present application, such as Fig.14 and Fig.15 As shown in the figure, the decoding process of ExtExif information includes the following steps:

[0204] 1. Image file acquisition: Get the JPEG file that has been written into ExtExif data according to the encoding requirements.

[0205] 2. Load: Read the JPEG file and load it into the memory of the computer (or mobile phone or other device).

[0206] 3. Splicing (optional): If the storage method is 1-multi-segment storage, you need to read the multiple segments of data and splice them into complete ExtExif information and store them in memory. If it is method 1-single segment storage, or method 2 is stored at the end of the file, no splicing operation is required.

[0207] When parsing, first locate the ExtExif information location according to ExtExif_MagicString in ExtExif_Header, and get the following related information:

[0208] -totalNum: total number of ExtExif copies, cardinality, indicating the storage of ExtExif information of multiple images.

[0209] -ordinalNum: the number of the ExtExif, ordinal number.

[0210] -sliceAll: The total number of slices in the current ExtExif. If the amount of data in an ExtExif exceeds 65536, it needs to be sliced.

[0211] -slice: current ExtExif slice number, current ExtExif slice number.

[0212] Thus, the number of ExtExif copies and slices can be determined. If there are slices, the same ExtExif needs to be spliced ​​into a complete information. Multiple ExtExif copies are complete and independent of each other.

[0213] 4. Parse definition information: Combine the basic information shared by the encoding side and the tool side, such as data storage structure, Field element data type number, etc., and parse the TAG definition and Field element definition in each TAG class information of ExtExif. You can get the definition information of all elements in turn, such as data type, data name, whether the data is an array or a single-value variable, etc., and store this definition in the corresponding data table, such as std::map table, std::vector and other containers.

[0214] 5. Parse data information: According to the definition part parsed in 4, traverse and parse the corresponding data information in turn, and store it in the corresponding matching data structure, such as std::map table, std::vector and other containers. As long as the definition and value of the metadata are stored in the above agreed format, the decoding side tool can successfully decode it regardless of how the content changes. The parsing side tool does not require any other TAG-type information data structure or header file, except for the basic data type numbering convention and the subsequent extended basic data type in advance, and is very flexible for information encoding and decoding.

[0215] 6. Storage, display, and application: The above data can be used to store different files, such as JSON, XML, txt, etc., and can also be used for tool-side page display, and can be used for subsequent parameter tuning, simulation, or image modification and beautification of JPEG images.

[0216] Compared with the traditional method of storing only certain fixed data structure metadata information and not easy to add or delete, the encoding protocol of ExtExif information provided in the embodiment of the present application opens up a new data definition area to store the definition information of the data structure, and stores it in the image file after encoding, so as to realize dynamic addition and deletion of elements at runtime without protocol synchronization. In addition, ExtExif information can be placed in the internal information segment of the image file or at the end of the image, which has great flexibility and can meet different data storage requirements.

[0217] Implement adaptive decoding of image metadata. By first decoding the metadata format definition information into a data structure type, the data information is parsed based on this data structure to remove the synchronization or dependency between the encoding and decoding sides. The metadata definition and value are stored in the above basic encoding format. No matter how the content changes, the decoding side tool can successfully decode it. The parsing side tool does not require any other TAG-type information data structure or header file, except for the basic data type numbering convention and the subsequent extended basic data type in advance, and is very flexible for information encoding and decoding.

[0218] It should be noted that the method for processing image metadata in the embodiment of the present application can also be applied to the recording of metadata such as video and audio.

[0219] To implement the method of the embodiment of the present application, based on the same inventive concept, the embodiment of the present application also provides an image metadata processing device, which is applied to the encoding end, such as Fig.16 As shown, the image metadata processing device 160 includes:

[0220] A first determining unit 161 is used to determine definition information for defining a data structure according to a data structure of image metadata; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure;

[0221] A first acquisition unit 162 is used to acquire data information of image metadata;

[0222] The encoding unit 163 is used to generate extended information of the image metadata according to the definition information and the data information; and write the extended information into the image file.

[0223] In some embodiments, the definition information includes: first-level tag information, and at least one first-level data element information included in the first-level tag information; the first-level tag information includes: tag identifier, tag type, number of elements and tag name; the first-level data element information includes: element identifier, data type, number of data and data name.

[0224] In some embodiments, the definition information further includes: second-level tag information, and at least one second-level data element information included in the second-level tag information;

[0225] The first determination unit 161 is also used to determine the second-level label information according to the first-level data element information when the data type of the first-level data element information is a preset extended data type; determine at least one second-level data element information included in the second-level label information according to the data structure corresponding to the extended data type; wherein the second-level data element information includes: element identifier, data type, data quantity and data name.

[0226] In some embodiments, the first determining unit 161 is further configured to determine new definition information according to the updated data structure when the data structure of the image metadata is updated.

[0227] In some embodiments, the first acquisition unit 162 is used to acquire the first image metadata indicated by at least one data element information corresponding to the first tag information; add the first tag information to the header of the first image metadata to obtain the data information corresponding to the first image metadata; wherein the first tag information is any tag information in the definition information.

[0228] In some embodiments, the extended information also includes header information, and the header information is used to locate and parse the extended information. Specifically, the header information is located at the front end of the positioning information and the data information.

[0229] In some embodiments, the header information includes: first header information and second header information; wherein the first header information includes: a segment start identifier and a segment length; the second header information includes: start information, index information and version information; the start information includes at least one of the following: the total number of copies of the extended information, the number identifier of the current copy of the extended information, the total number of slices of the current copy of the extended information, and the slice identifier of the current extended information slice.

[0230] In some embodiments, the encoding unit 163 is further used to determine the total number of copies of the extended information in the second header information and the number of copies of the current extended information when the extended information of multiple images is written in the image file; add the first header information and the second header information to each copy of the extended information; write all the extended information into the image file;

[0231] And / or, the encoding unit 163 is also used to, when writing the extended information into the internal information segment of the image file, if the total length of the extended information is greater than the segment length of the image file, slice the extended information according to the segment length to obtain at least two slices and slice information; determine the total number of slices of the current portion of the extended information in the second header information and the slice identifier of each slice in the current portion of the extended information according to the slice information; add the first header information and the second header information to each slice; and write each slice into the image file.

[0232] In some embodiments, the encoding unit 163 is further used to encrypt the extended information and write the encrypted extended information into the image file.

[0233] To implement the method of the embodiment of the present application, based on the same inventive concept, the embodiment of the present application also provides an image metadata processing device, which is applied to a decoding end, such as Fig.17 As shown, the image metadata processing device 170 includes:

[0234] The second acquisition unit 171 is used to acquire an image file;

[0235] A second determining unit 172 is used to obtain extended information of image metadata from the image file;

[0236] The decoding unit 173 is used to parse the definition information used to define the data structure of the image metadata in the extended information, and determine the data structure of the image metadata; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure;

[0237] The decoding unit 173 is further used to parse the data information in the extended information according to the data structure to obtain the image metadata.

[0238] In some embodiments, the definition information includes: first-level tag information, and at least one first-level data element information included in the first-level tag information; the first-level tag information includes: tag identifier, tag type, number of elements and tag name; the first-level data element information includes: element identifier, data type, number of data and data name.

[0239] In some embodiments, the definition information further includes second-level tag information, and at least one second-level data element information included in the second-level tag information;

[0240] The decoding unit 173 is used to determine the second-level tag information according to the first-level data element information when the data type of the first-level data element information is a preset extended data type; determine the data structure corresponding to the extended data type according to at least one second-level data element information included in the second-level tag information; wherein the second-level data element information includes: element identifier, data type, data quantity and data name.

[0241] In some embodiments, the extended information also includes header information, and the header information is used to locate and parse the extended information.

[0242] In some embodiments, the header information includes: first header information and second header information; wherein the first header information includes: a segment start identifier and a segment length; the second header information includes: start information, index information and version information; the start information includes at least one of the following: the total number of copies of the extended information, the number identifier of the current copy of the extended information, the total number of slices of the current copy of the extended information, and the slice identifier of the current extended information slice.

[0243] In some embodiments, the second determining unit 172 is used to determine the total number of copies of the extended information and the number identifier of the current copy of the extended information contained in the image file according to the starting information in the second header information; when the total number of copies of the extended information is greater than 1, obtain the extended information of multiple images from the image file;

[0244] And / or, a second determination unit 172 is used to determine the total number of slices of the current extended information and the slice identifier of the current slice according to the starting information in the second header information; when the total number of slices of the current extended information is greater than 1, obtain multiple slices from the image file; and splice the multiple slices to obtain the current extended information.

[0245] In some embodiments, the second determining unit 172 is used to obtain the encrypted extended information from the image file; and decrypt the encrypted extended information to obtain the extended information.

[0246] In some embodiments, the decoding unit 173 is used to determine the data structure corresponding to the first tag information based on the first tag information and at least one data element information included in the first tag information; wherein the first tag information is any tag information in the definition information; according to the first tag information, determine the data information corresponding to the first image metadata in the extended information; according to the data structure corresponding to the first tag information, parse the data information corresponding to the first image metadata to obtain the first image metadata.

[0247] In practical applications, the above device can realize the functions of multiple units through software, hardware, or a combination of software and hardware, so that the device can execute the image metadata processing method provided by any of the above embodiments. The technical effects of each technical solution of the device can refer to the technical effects of the corresponding technical solution in the image metadata processing method, and this application will not elaborate on them one by one.

[0248] Based on the hardware implementation of each unit in the above-mentioned image metadata processing device, the embodiment of the present application also provides an image metadata processing device, such as Fig.18 As shown, the image metadata processing device may be an image encoding device or an image decoding device, and the image metadata processing device 180 includes: a processor 1801 and a memory 1802 configured to store a computer program that can be run on the processor;

[0249] The processor 1801 is configured to execute the method steps in the aforementioned embodiment when running a computer program.

[0250] The memory 1802 may be a separate device independent of the processor 1801 , or may be integrated into the processor 1801 .

[0251] Of course, in practical applications, Fig.18 As shown, the various components in the image metadata processing device 180 are coupled together via a bus system 1803. It can be understood that the bus system 1803 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1803 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are marked as bus system 1803 in the figure.

[0252] In practical applications, the processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a controller, a microcontroller, and a microprocessor. It is understandable that for different devices, the electronic device used to implement the functions of the processor may also be other, and the embodiments of the present application do not specifically limit this.

[0253] The above-mentioned memory can be a volatile memory (volatile memory), such as a random access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor.

[0254] In an exemplary embodiment, the present application also provides a computer-readable storage medium, such as a memory including a computer program, and the computer program can be executed by a processor of the image metadata processing device to complete the steps of the aforementioned method.

[0255] An embodiment of the present application also provides a computer program product, including computer program instructions.

[0256] Optionally, the computer program product may be applied to the image metadata processing device in the embodiments of the present application, and the computer program instructions enable the computer to execute the corresponding processes implemented by the image metadata processing device in the various methods of the embodiments of the present application. For the sake of brevity, they are not repeated here.

[0257] The embodiment of the present application also provides a computer program.

[0258] Optionally, the computer program may be applied to the image metadata processing device in the embodiment of the present application. When the computer program runs on a computer, the computer executes the corresponding processes implemented by the image metadata processing device in the various methods in the embodiment of the present application. For the sake of brevity, they are not described here.

[0259] It should be understood that in the embodiments of the present application, when the relevant metadata of user information is applied to specific products or technologies, the user's permission or consent must be obtained, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0260] It should be understood that the terms used in the present application are only for the purpose of describing specific embodiments, but are not intended to limit the present application. The singular forms of "a", "said" and "the" used in the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items. The expressions "having", "may have", "include" and "include", or "may include" and "may include" in this application can be used to indicate the presence of corresponding features (e.g., elements such as numerical values, functions, operations or components), but the presence of additional features is not excluded.

[0261] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other and are not necessarily used to describe a specific order or sequence. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.

[0262] The technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.

[0263] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and equipment can be implemented in other ways. The embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0264] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0265] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0266] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A method for processing image metadata, characterized in that: The method comprises: Determine, according to the data structure of the image metadata, definition information for defining the data structure; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure; Acquire data information of the image metadata; Generating extended information of the image metadata according to the definition information and the data information; The extended information is written into the image file.

2. The method according to claim 1, characterized in that The definition information includes: first-level tag information, and at least one first-level data element information included in the first-level tag information; The first level tag information includes: tag identification, tag type, number of elements and tag name; The first-level data element information includes: element identification, data type, data quantity and data name.

3. The method according to claim 2, characterized in that The definition information further includes: second-level tag information, and at least one second-level data element information included in the second-level tag information; The determining, according to the data structure of the image metadata, definition information for defining the data structure further includes: When the data type of the first-level data element information is a preset extended data type, determining the second-level tag information according to the first-level data element information; Determine, according to the data structure corresponding to the extended data type, at least one second-level data element information included in the second-level tag information; The second-level data element information includes: element identification, data type, data quantity and data name.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When the data structure of the image metadata is updated, new definition information is determined according to the updated data structure.

5. The method according to claim 1, characterized in that The step of obtaining the data information of the image metadata includes: Acquire first image metadata indicated by at least one data element information corresponding to the first tag information; Adding first tag information to the header of the first image metadata to obtain data information corresponding to the first image metadata; The first tag information is any tag information in the definition information.

6. The method according to claim 1, characterized in that The extended information also includes header information, and the header information is used to locate and parse the extended information.

7. The method according to claim 6, characterized in that The header information includes: first header information and second header information; The first header information includes: a segment start identifier and a segment length; The second header information includes: start information, index information and version information; The starting information includes at least one of the following: the total number of copies of the extended information, the copy number identifier of the current copy of the extended information, the total number of slices of the current copy of the extended information, and the slice identifier of the current extended information slice.

8. The method according to claim 7, characterized in that The method further comprises: When the extended information of multiple images is written in the image file, determining the total number of copies of the extended information in the second header information and the number identifier of the current copy of the extended information; Adding the first header information and the second header information to each piece of extended information; Writing all extended information into the image file; And / or, the method further comprises: When writing the extended information into the internal information segment of the image file, if the total length of the extended information is greater than the segment length of the image file, slicing the extended information according to the segment length to obtain at least two slices and slice information; Determine, according to the slice information, a total number of slices of the current portion of the extended information in the second header information and a slice identifier of each slice in the current portion of the extended information; Add the first header information and the second header information to each slice; Each slice is written to the image file.

9. The method according to claim 1 or 8, characterized in that: The step of writing the extended information into the image file comprises: Encrypting the extended information; The encrypted extended information is written into the image file.

10. A method for processing image metadata, characterized in that: The method comprises: Get the image file; Acquire extended information of image metadata from the image file; Parsing definition information in the extended information for defining a data structure of image metadata to determine the data structure of the image metadata; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure; The data information in the extended information is parsed according to the data structure to obtain the image metadata.

11. The method according to claim 10, characterized in that The definition information includes: first-level tag information, and at least one first-level data element information included in the first-level tag information; The first level tag information includes: tag identification, tag type, number of elements and tag name; The first-level data element information includes: element identification, data type, data quantity and data name.

12. The method according to claim 11, characterized in that The definition information further includes second-level tag information and at least one second-level data element information included in the second-level tag information; The parsing of the definition information in the extended information for defining the data structure of the image metadata to determine the data structure of the image metadata further includes: When the data type of the first-level data element information is a preset extended data type, determining the second-level tag information according to the first-level data element information; Determine a data structure corresponding to the extended data type according to at least one second-level data element information included in the second-level tag information; The second-level data element information includes: element identification, data type, data quantity and data name.

13. The method according to claim 10, characterized in that The extended information also includes header information, and the header information is used to locate and parse the extended information.

14. The method according to claim 13, characterized in that The header information includes: first header information and second header information; The first header information includes: a segment start identifier and a segment length; The second header information includes: start information, index information and version information; The starting information includes at least one of the following: the total number of copies of the extended information, the copy number identifier of the current copy of the extended information, the total number of slices of the current copy of the extended information, and the slice identifier of the current extended information slice.

15. The method according to claim 14, characterized in that The step of obtaining extended information of image metadata from the image file includes: Determine, according to the start information in the second header information, the total number of copies of the image file containing the extended information and the number identifier of the current copy of the extended information; When the total number of the extended information is greater than 1, the extended information of the multiple images is obtained from the image file; And / or, the acquiring extended information of the image metadata from the image file includes: Determine, according to the starting information in the second header information, the total number of slices of the current portion of the extended information and the slice identifier of the current slice; When the total number of slices of the current extended information is greater than 1, obtaining multiple slices from the image file; The multiple slices are spliced ​​to obtain the current extension information.

16. The method according to claim 10 or 15, characterized in that The step of obtaining extended information of image metadata from the image file includes: Acquire the encrypted extended information from the image file; The encrypted extended information is decrypted to obtain the extended information.

17. The method according to claim 10, characterized in that The parsing of definition information in the extended information for defining a data structure of image metadata includes: Determine a data structure corresponding to the first tag information according to the first tag information and at least one data element information included in the first tag information; wherein the first tag information is any tag information in the definition information; The step of parsing the data information in the image file according to the data structure to obtain the image metadata includes: Determine, according to the first tag information, data information corresponding to the first image metadata in the extended information; According to the data structure corresponding to the first tag information, the data information corresponding to the first image metadata is parsed to obtain the first image metadata.

18. An image metadata processing device, characterized in that: The device comprises: A first determining unit is used to determine, according to a data structure of the image metadata, definition information for defining the data structure; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure; A first acquisition unit, used to acquire data information of the image metadata; The encoding unit is used to generate the extended information of the image metadata according to the definition information and the data information; and write the extended information into the image file.

19. An image metadata processing device, characterized in that: The device comprises: A second acquisition unit, used for acquiring an image file; A second determining unit, configured to obtain extended information of image metadata from the image file; a decoding unit, configured to parse definition information in the extended information for defining a data structure of image metadata, and determine the data structure of the image metadata; wherein the definition information includes tag information and at least one data element information included in the tag information, and the data element information is used to indicate metadata of a data type in the data structure; The decoding unit is further used to parse the data information in the extended information according to the data structure to obtain the image metadata.

20. An image metadata processing device, characterized in that: The device comprises: a processor and a memory configured to store a computer program capable of being executed on the processor, Wherein, the processor is configured to execute the steps of the method described in any one of claims 1 to 17 when running the computer program.

21. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 17 are implemented.