TWI739633B - Storage and reading method, electronic equipment and computer-readable storage medium - Google Patents

Storage and reading method, electronic equipment and computer-readable storage medium Download PDF

Info

Publication number
TWI739633B
TWI739633B TW109135770A TW109135770A TWI739633B TW I739633 B TWI739633 B TW I739633B TW 109135770 A TW109135770 A TW 109135770A TW 109135770 A TW109135770 A TW 109135770A TW I739633 B TWI739633 B TW I739633B
Authority
TW
Taiwan
Prior art keywords
sample
target
sample set
field
samples
Prior art date
Application number
TW109135770A
Other languages
Chinese (zh)
Other versions
TW202117565A (en
Inventor
王若暉
胡穎凡
Original Assignee
大陸商深圳市商湯科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 大陸商深圳市商湯科技有限公司 filed Critical 大陸商深圳市商湯科技有限公司
Publication of TW202117565A publication Critical patent/TW202117565A/en
Application granted granted Critical
Publication of TWI739633B publication Critical patent/TWI739633B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/9035Filtering based on additional data, e.g. user or group profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the disclosure relates to a storage and reading method, an electronic device and a computer-readable storage medium. The storage method comprises: determining the description information corresponding to the sample set according to the label of the sample set; the field information corresponding to the sample set is determined according to the sample field and storage location in the sample set, and the configuration file of the sample set is determined according to the description information and field information.

Description

儲存和讀取方法、電子設備和電腦可讀儲存介質Storage and reading method, electronic equipment and computer readable storage medium

本發明關於電腦技術領域,關於一種儲存和讀取方法、電子設備和電腦可讀儲存介質。The present invention relates to the field of computer technology, and relates to a storage and reading method, an electronic device and a computer-readable storage medium.

在機器學習中,尤其是在需要處理多種資料集的情況下,資料集儲存方式就極為重要。在相關技術中,對於資料集儲存也通常是為了適應資料集本身的結構,例如,CSV(Comma-Separated Values,逗號分隔值)、HDF5(Hierarchical Data Format Version 5,層次性資料格式第五版)、檔儲存(圖像音頻)等資料儲存方式。In machine learning, especially when multiple data sets need to be processed, the data set storage method is extremely important. In related technologies, the storage of data sets is usually to adapt to the structure of the data set itself, for example, CSV (Comma-Separated Values), HDF5 (Hierarchical Data Format Version 5, hierarchical data format fifth edition) , File storage (image and audio) and other data storage methods.

本發明實施例提出了一種儲存和讀取方法、電子設備和電腦可讀儲存介質。The embodiments of the present invention provide a storage and reading method, an electronic device, and a computer-readable storage medium.

根據本發明實施例的一方面,提供了一種儲存方法,包括:根據樣本集中樣本的標注,確定與所述樣本集對應的描述資訊;根據樣本集中樣本的欄位及儲存位置,確定與所述樣本集對應的欄位資訊;根據所述描述資訊和所述欄位資訊,確定所述樣本集的設定檔。According to one aspect of the embodiments of the present invention, a storage method is provided, which includes: determining the description information corresponding to the sample set according to the labels of the samples in the sample set; Field information corresponding to the sample set; determine the configuration file of the sample set according to the description information and the field information.

根據本發明實施例的讀取方法,可確定樣本集的描述資訊和樣本的欄位資訊,並基於描述資訊和欄位資訊確定設定檔,生成設定檔,可支援多種資料類型的樣本儲存在一個樣本集中,適應更複雜類型的樣本集的儲存,根據設定檔即可獲取樣本集中各類型樣本資料的資訊,便於樣本資料的讀取。According to the reading method of the embodiment of the present invention, the description information of the sample set and the field information of the sample can be determined, and the configuration file can be determined based on the description information and the field information, and the configuration file can be generated. The sample collection is suitable for the storage of more complex types of sample collections. According to the configuration file, the information of each type of sample data in the sample collection can be obtained, which is convenient for reading the sample data.

在一種可能的實現方式中,所述描述資訊包括對樣本的標注的描述資訊,其中,根據樣本集中樣本的標注,確定與所述樣本集對應的描述資訊,包括:根據所述樣本集中樣本的標注,獲得標注清單,所述標注清單包括樣本的標注的類別;對標注清單中的標注添加描述,獲得所述樣本的標注的描述資訊。通過這種方式,可針對樣本的標注獲得樣本的標注的描述資訊,使各樣本的標注表示的含義統一,便於樣本的儲存與讀取。In a possible implementation manner, the description information includes description information of the label of the sample, wherein, according to the label of the sample in the sample set, determining the description information corresponding to the sample set includes: according to the label of the sample in the sample set Annotate, obtain an annotation list, the annotation list includes the type of the annotation of the sample; add a description to the annotation in the annotation list, and obtain the description information of the annotation of the sample. In this way, the description information of the label of the sample can be obtained for the label of the sample, so that the meaning of the label of each sample is unified, and it is convenient to store and read the sample.

在一種可能的實現方式中,所述樣本集中包括至少一種資料類型的樣本。In a possible implementation manner, the sample set includes samples of at least one data type.

在一種可能的實現方式中,所述欄位資訊還包括樣本的讀取方式資訊,其中,所述方法還包括:根據樣本集中樣本的資料類型,確定用於各資料類型對應的讀取方式;根據所述樣本的資料類型和對應的讀取方式,獲得所述樣本的讀取方式資訊。In a possible implementation manner, the field information further includes sample reading method information, wherein the method further includes: determining the corresponding reading method for each data type according to the data type of the sample in the sample set; According to the data type of the sample and the corresponding reading mode, information about the reading mode of the sample is obtained.

通過這種方式,可確定多種樣本的讀取方式,有利於支援多種類型的資料儲存,適應更複雜類型的資料集的儲存,同時便於讀取時根據設定檔獲取合適的讀取方式讀取樣本。In this way, a variety of sample reading methods can be determined, which is beneficial to support multiple types of data storage, adapt to the storage of more complex types of data sets, and at the same time facilitate the acquisition of suitable reading methods according to the configuration file when reading samples. .

在一種可能的實現方式中,所述根據樣本集中樣本的標注,確定與所述樣本集對應的描述資訊,還包括:確定用於劃分樣本集中樣本的類別的索引範圍資訊;根據所述樣本集中樣本的描述資訊和所述樣本類別的索引範圍資訊,生成與所述樣本集對應的描述資訊。In a possible implementation manner, the determining the description information corresponding to the sample set according to the labels of the samples in the sample set further includes: determining index range information used to classify the types of the samples in the sample set; The description information of the sample and the index range information of the sample category generate description information corresponding to the sample set.

通過這種方式,可在讀取樣本時,便於在特定的索引範圍內查找目標樣本,提高讀取效率。In this way, when reading the sample, it is convenient to find the target sample in a specific index range, and the reading efficiency is improved.

在一種可能的實現方式中,所述欄位資訊包括樣本的多個欄位的欄位清單,其中,根據樣本集中樣本的欄位及儲存位置,確定與所述樣本集對應的欄位資訊,包括:對所述樣本集中多個樣本的欄位進行匯總處理,獲得所述欄位清單。In a possible implementation, the field information includes a field list of multiple fields of the sample, wherein the field information corresponding to the sample set is determined according to the fields and storage locations of the samples in the sample set. The method includes: performing summary processing on the fields of a plurality of samples in the sample set to obtain the field list.

通過這種方式,可將各欄位匯總成欄位清單,便於讀取。In this way, each field can be summarized into a field list, which is easy to read.

在一種可能的實現方式中,所述儲存位置包括所述樣本集的儲存路徑及樣本在所述樣本集中的索引位置。通過這種方式,可獲得各樣本的準確儲存位置,便於讀取。In a possible implementation, the storage location includes a storage path of the sample set and an index position of the sample in the sample set. In this way, the accurate storage location of each sample can be obtained, which is easy to read.

在一種可能的實現方式中,所述欄位資訊包括指示是否允許讀取多個樣本的指示資訊。In a possible implementation manner, the field information includes instruction information indicating whether to allow multiple samples to be read.

通過這種方式,可對是否允許一次性讀取多個樣本進行指示,便於樣本的讀取。In this way, it is possible to indicate whether multiple samples are allowed to be read at one time, facilitating the reading of samples.

根據本發明實施例的一方面,提供了一種讀取方法,包括:根據與樣本集對應的設定檔,獲取樣本集中目標樣本的儲存位置及目標欄位;根據所述儲存位置,讀取所述目標樣本的目標欄位的目標參數值;其中,所述設定檔基於所述樣本集的描述資訊和樣本的欄位資訊確定。According to one aspect of the embodiments of the present invention, there is provided a reading method, including: obtaining the storage location and target field of the target sample in the sample set according to a configuration file corresponding to the sample set; and reading the storage location according to the storage location. The target parameter value of the target field of the target sample; wherein the configuration file is determined based on the description information of the sample set and the field information of the sample.

在一種可能的實現方式中,所述方法還包括:根據所述設定檔,獲取目標樣本的讀取方式。In a possible implementation manner, the method further includes: obtaining a reading manner of the target sample according to the configuration file.

在一種可能的實現方式中,根據所述儲存位置,讀取所述目標樣本的目標欄位的目標參數值,包括:根據目標樣本的儲存位置,獲取所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置;根據所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置,查詢所述目標樣本;根據所述目標樣本的讀取方式,對目標樣本進行讀取,獲得目標樣本的一個或多個欄位的參數值;在所述目標樣本的一個或多個欄位的參數值中,確定所述目標參數值。In a possible implementation manner, reading the target parameter value of the target field of the target sample according to the storage location includes: obtaining the storage path of the sample set and the location of the target sample according to the storage location of the target sample The index position of the sample set; query the target sample according to the storage path of the sample set and the index position of the target sample in the sample set; read the target sample according to the reading method of the target sample to obtain the target sample The parameter value of one or more fields of the target sample; among the parameter values of one or more fields of the target sample, the target parameter value is determined.

在一種可能的實現方式中,根據所述儲存位置,讀取所述目標樣本的目標欄位的目標參數值,包括:根據目標樣本的儲存位置,獲取所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置;根據所述樣本集的儲存路徑及所述目標欄位,獲取樣本集中多個樣本的目標欄位的參數值的儲存位置;根據目標樣本在樣本集中的索引位置,在所述多個樣本的目標欄位的參數值的儲存位置中,確定目標樣本的目標欄位的參數值的儲存位置;根據所述目標樣本的讀取方式,在所述目標樣本的目標欄位的參數值的儲存位置中讀取所述目標參數值。In a possible implementation manner, reading the target parameter value of the target field of the target sample according to the storage location includes: obtaining the storage path of the sample set and the location of the target sample according to the storage location of the target sample The index position of the sample set; according to the storage path of the sample set and the target field, the storage position of the parameter value of the target field of the multiple samples in the sample set is obtained; according to the index position of the target sample in the sample set, Among the storage locations of the parameter values of the target field of the multiple samples, the storage location of the parameter values of the target field of the target sample is determined; according to the reading method of the target sample, in the target field of the target sample The target parameter value is read from the parameter value storage location.

在一種可能的實現方式中,所述設定檔包括指示是否允許讀取多個樣本的指示資訊,根據所述儲存位置,讀取所述目標樣本的目標欄位的目標參數值,包括:獲取所述目標樣本預設的讀取模式;根據所述預設的讀取模式以及所述指示資訊,在所述目標樣本的目標欄位的參數值的儲存位置中讀取所述目標參數值。In a possible implementation manner, the configuration file includes instruction information indicating whether to allow reading of multiple samples, and reading the target parameter value of the target field of the target sample according to the storage location includes: obtaining all The preset reading mode of the target sample; according to the preset reading mode and the instruction information, the target parameter value is read in the storage location of the parameter value of the target field of the target sample.

在一種可能的實現方式中,根據所述預設的讀取模式以及所述指示資訊,在所述目標樣本的目標欄位的參數值的儲存位置中讀取所述目標參數值,包括:在所述預設的讀取模式與所述指示資訊不匹配的情況下,使用所述指示資訊對應的讀取方式,讀取所述目標樣本的目標欄位的參數值。In a possible implementation manner, reading the target parameter value in the storage location of the parameter value of the target field of the target sample according to the preset reading mode and the instruction information includes: When the preset reading mode does not match the instruction information, the reading method corresponding to the instruction information is used to read the parameter value of the target field of the target sample.

根據本發明實施例的一方面,提供了一種儲存裝置,包括: 第一確定部分,被配置為根據樣本集中樣本的標注,確定與所述樣本集對應的描述資訊; 第二確定部分,被配置為根據樣本集中樣本的欄位及儲存位置,確定與所述樣本集對應的欄位資訊; 第三確定部分,被配置為根據所述描述資訊和所述欄位資訊,確定所述樣本集的設定檔。According to an aspect of the embodiments of the present invention, there is provided a storage device, including: The first determining part is configured to determine the description information corresponding to the sample set according to the label of the sample in the sample set; The second determining part is configured to determine the field information corresponding to the sample set according to the column and storage location of the sample in the sample set; The third determining part is configured to determine the configuration file of the sample set based on the description information and the field information.

在一種可能的實現方式中,所述描述資訊包括對樣本的標注的描述資訊: 其中,所述第一確定部分被進一步配置為: 根據所述樣本集中樣本的標注,獲得標注清單,所述標注清單包括樣本的標注的類別; 對標注清單中的標注添加描述,獲得所述樣本的標注的描述資訊。In a possible implementation, the description information includes the description information of the label of the sample: Wherein, the first determining part is further configured as: Obtaining a label list according to the labels of the samples in the sample set, the label list including the label categories of the samples; Add a description to the label in the label list to obtain the description information of the label of the sample.

在一種可能的實現方式中,所述樣本集中包括至少一種資料類型的樣本。In a possible implementation manner, the sample set includes samples of at least one data type.

在一種可能的實現方式中,所述欄位資訊還包括樣本的讀取方式資訊; 其中,所述裝置還包括: 第四確定部分,被配置為根據樣本集中樣本的資料類型,確定用於各資料類型對應的讀取方式; 第一獲得部分,被配置為根據所述樣本的資料類型和對應的讀取方式,獲得所述樣本的讀取方式資訊。In a possible implementation manner, the field information also includes information on how to read the sample; Wherein, the device further includes: The fourth determining part is configured to determine the corresponding reading method for each data type according to the data type of the samples in the sample set; The first obtaining part is configured to obtain the reading mode information of the sample according to the data type of the sample and the corresponding reading mode.

在一種可能的實現方式中,所述第一確定部分被進一步配置為: 確定用於劃分樣本集中樣本的類別的索引範圍資訊; 根據所述樣本集中樣本的描述資訊和所述樣本類別的索引範圍資訊,生成與所述樣本集對應的描述資訊。In a possible implementation manner, the first determining part is further configured to: Determine the index range information used to classify the types of samples in the sample set; According to the description information of the samples in the sample set and the index range information of the sample category, the description information corresponding to the sample set is generated.

在一種可能的實現方式中,所述欄位資訊包括樣本的多個欄位的欄位清單; 其中,所述第二確定部分被進一步配置為: 對所述樣本集中多個樣本的欄位進行匯總處理,獲得所述欄位清單。In a possible implementation manner, the field information includes a field list of multiple fields of the sample; Wherein, the second determining part is further configured as: The fields of the multiple samples in the sample set are summarized to obtain the field list.

在一種可能的實現方式中,所述儲存位置包括所述樣本集的儲存路徑及樣本在所述樣本集中的索引位置。In a possible implementation, the storage location includes a storage path of the sample set and an index position of the sample in the sample set.

在一種可能的實現方式中,所述欄位資訊包括指示是否允許讀取多個樣本的指示資訊。In a possible implementation manner, the field information includes instruction information indicating whether to allow multiple samples to be read.

根據本發明實施例的一方面,提供了一種讀取裝置,包括: 第一獲取部分,被配置為根據與樣本集對應的設定檔,獲取樣本集中目標樣本的儲存位置及目標欄位; 第一讀取部分,被配置為根據所述儲存位置,讀取所述目標樣本的目標欄位的目標參數值; 其中,所述設定檔基於所述樣本集的描述資訊和樣本的欄位資訊確定。According to an aspect of the embodiments of the present invention, there is provided a reading device, including: The first obtaining part is configured to obtain the storage location and target field of the target sample in the sample set according to the configuration file corresponding to the sample set; The first reading part is configured to read the target parameter value of the target field of the target sample according to the storage location; Wherein, the configuration file is determined based on the description information of the sample set and the field information of the sample.

在一種可能的實現方式中,所述裝置還包括: 根據所述設定檔,獲取目標樣本的讀取方式。In a possible implementation manner, the device further includes: According to the profile, the reading mode of the target sample is obtained.

在一種可能的實現方式中,所述第一讀取部分被進一步配置為: 根據目標樣本的儲存位置,獲取所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置; 根據所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置,查詢所述目標樣本; 根據所述目標樣本的讀取方式,對目標樣本進行讀取,獲得目標樣本的一個或多個欄位的參數值; 在所述目標樣本的一個或多個欄位的參數值中,確定所述目標參數值。In a possible implementation manner, the first reading part is further configured to: Obtaining the storage path of the sample set and the index position of the target sample in the sample set according to the storage location of the target sample; Query the target sample according to the storage path of the sample set and the index position of the target sample in the sample set; According to the reading method of the target sample, the target sample is read to obtain the parameter value of one or more fields of the target sample; Determine the target parameter value among the parameter values of one or more fields of the target sample.

在一種可能的實現方式中,所述第一讀取部分被進一步配置為: 根據目標樣本的儲存位置,獲取所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置; 根據所述樣本集的儲存路徑及所述目標欄位,獲取樣本集中多個樣本的目標欄位的參數值的儲存位置; 根據目標樣本在樣本集中的索引位置,在所述多個樣本的目標欄位的參數值的儲存位置中,確定目標樣本的目標欄位的參數值的儲存位置; 根據所述目標樣本的讀取方式,在所述目標樣本的目標欄位的參數值的儲存位置中讀取所述目標參數值。In a possible implementation manner, the first reading part is further configured to: Obtaining the storage path of the sample set and the index position of the target sample in the sample set according to the storage location of the target sample; Acquiring, according to the storage path of the sample set and the target field, the storage locations of the parameter values of the target fields of the multiple samples in the sample set; According to the index position of the target sample in the sample set, among the storage positions of the parameter values of the target field of the multiple samples, determine the storage position of the parameter value of the target field of the target sample; According to the reading mode of the target sample, the target parameter value is read in the storage location of the parameter value of the target field of the target sample.

在一種可能的實現方式中,所述設定檔包括指示是否允許讀取多個樣本的指示資訊; 所述第一讀取部分被進一步配置為: 獲取所述目標樣本預設的讀取模式; 根據所述預設的讀取模式以及所述指示資訊,在所述目標樣本的目標欄位的參數值的儲存位置中讀取所述目標參數值。In a possible implementation manner, the configuration file includes instruction information indicating whether to allow multiple samples to be read; The first reading part is further configured to: Acquiring the preset reading mode of the target sample; According to the preset reading mode and the instruction information, the target parameter value is read in the storage location of the parameter value of the target field of the target sample.

在一種可能的實現方式中,所述第一讀取部分被進一步配置為: 在所述預設的讀取模式與所述指示資訊不匹配的情況下,使用所述指示資訊對應的讀取方式,讀取所述目標樣本的目標欄位的參數值。In a possible implementation manner, the first reading part is further configured to: In the case that the preset reading mode does not match the instruction information, the reading method corresponding to the instruction information is used to read the parameter value of the target field of the target sample.

根據本發明實施例的一方面,提供了一種電子設備,包括: 處理器; 用於儲存處理器可執行指令的記憶體; 其中,所述處理器被配置為:執行上述儲存和/或讀取方法。According to an aspect of the embodiments of the present invention, there is provided an electronic device, including: processor; Memory used to store executable instructions of the processor; Wherein, the processor is configured to execute the above-mentioned storing and/or reading method.

根據本發明實施例的一方面,提供了一種電腦可讀儲存介質,其上儲存有電腦程式指令,所述電腦程式指令被處理器執行時實現上述儲存和/或讀取方法。According to an aspect of the embodiments of the present invention, there is provided a computer-readable storage medium having computer program instructions stored thereon, and the computer program instructions implement the above-mentioned storing and/or reading methods when executed by a processor.

根據本發明實施例的一方面,提供了一種電腦程式,包括電腦可讀代碼,當所述電腦可讀代碼在電子設備中運行時,所述電子設備中的處理器執行用於實現上述儲存和/或讀取的方法。According to one aspect of the embodiments of the present invention, there is provided a computer program, including computer-readable code. When the computer-readable code is run in an electronic device, a processor in the electronic device executes for realizing the aforementioned storage and / Or the method of reading.

應當理解的是,以上的一般描述和後文的細節描述僅是示例性和解釋性的,而非限制本發明實施例。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, rather than limiting the embodiments of the present invention.

根據下面參考附圖對示例性實施例的詳細說明,本發明實施例的其它特徵及方面將變得清楚。According to the following detailed description of exemplary embodiments with reference to the accompanying drawings, other features and aspects of the embodiments of the present invention will become clear.

以下將參考附圖詳細說明本發明實施例的各種示例性實施例、特徵和方面。附圖中相同的附圖標記表示功能相同或相似的組件。儘管在附圖中示出了實施例的各種方面,但是除非特別指出,不必按比例繪製附圖。Various exemplary embodiments, features, and aspects of embodiments of the present invention will be described in detail below with reference to the drawings. The same reference numerals in the drawings indicate components with the same or similar functions. Although various aspects of the embodiments are shown in the drawings, unless otherwise noted, the drawings are not necessarily drawn to scale.

在這裡專用的詞“示例性”意為“用作例子、實施例或說明性”。這裡作為“示例性”所說明的任何實施例不必解釋為優於或好於其它實施例。The dedicated word "exemplary" here means "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" need not be construed as being superior or better than other embodiments.

本文中術語“和/或”,僅僅是一種描述關聯物件的關聯關係,表示可以存在三種關係,例如,A和/或B,可以表示:單獨存在A,同時存在A和B,單獨存在B這三種情況。另外,本文中術語“至少一種”表示多種中的任意一種或多種中的至少兩種的任意組合,例如,包括A、B、C中的至少一種,可以表示包括從A、B和C構成的集合中選擇的任意一個或多個元素。The term "and/or" in this article is only an association relationship describing related objects, which means that there can be three relationships. For example, A and/or B can mean: A alone exists, A and B exist at the same time, and B exists alone. three conditions. In addition, the term "at least one" herein means any one or any combination of at least two of the multiple, for example, including at least one of A, B, and C, and may mean including those made from A, B, and C Any one or more elements selected in the set.

另外,為了更好地說明本發明實施例,在下文的實施方式中給出了眾多的細節。本領域技術人員應當理解,沒有某些細節,本發明實施例同樣可以實施。在一些實例中,對於本領域技術人員熟知的方法、手段、組件和電路未作詳細描述,以便於凸顯本發明實施例的主旨。In addition, in order to better illustrate the embodiments of the present invention, numerous details are given in the following embodiments. Those skilled in the art should understand that the embodiments of the present invention can also be implemented without certain details. In some instances, the methods, means, components, and circuits well-known to those skilled in the art have not been described in detail, so as to highlight the gist of the embodiments of the present invention.

圖1示出根據本發明實施例的儲存方法的流程圖,如圖1所示,所述方法包括: 在步驟S11中,根據樣本集中樣本的標注,確定與所述樣本集對應的描述資訊; 在步驟S12中,根據樣本集中樣本的欄位及儲存位置,確定與所述樣本集對應的欄位資訊; 在步驟S13中,根據所述描述資訊和所述欄位資訊,確定所述樣本集的設定檔。Fig. 1 shows a flowchart of a storage method according to an embodiment of the present invention. As shown in Fig. 1, the method includes: In step S11, the description information corresponding to the sample set is determined according to the labels of the samples in the sample set; In step S12, the column information corresponding to the sample set is determined according to the column and storage location of the sample in the sample set; In step S13, the configuration file of the sample set is determined according to the description information and the field information.

根據本發明的實施例的讀取方法,可確定樣本集的描述資訊和樣本的欄位資訊,並基於描述資訊和欄位資訊確定設定檔,生成設定檔,可支援多種資料類型的樣本儲存在一個樣本集中,適應更複雜類型的樣本集的儲存,根據設定檔即可獲取樣本集中各類型樣本資料的資訊,便於樣本資料的讀取。According to the reading method of the embodiment of the present invention, the description information of the sample set and the field information of the sample can be determined, and the configuration file is determined based on the description information and the field information, and the configuration file is generated. It can support samples of multiple data types to be stored in A sample set is suitable for the storage of more complex types of sample sets. According to the configuration file, the information of each type of sample data in the sample set can be obtained, which is convenient for reading the sample data.

在一種可能的實現方式中,所述儲存方法的執行主體可以是終端設備或伺服器或其它處理設備,其中,終端設備可以為使用者設備(User Equipment,UE)、移動設備、使用者終端、終端、蜂窩電話、無線電話、個人數位助理(Personal Digital Assistant,PDA)、手持設備、計算設備、車載設備、可穿戴設備等。在一些可能的實現方式中,該方法可以通過處理器調用記憶體中儲存的電腦可讀指令的方式來實現或通過伺服器來執行,例如,可將伺服器中的資料通過所述儲存方法進行儲存。In a possible implementation, the execution subject of the storage method may be a terminal device or a server or other processing equipment, where the terminal device may be a user equipment (User Equipment, UE), a mobile device, a user terminal, Terminals, cellular phones, wireless phones, personal digital assistants (PDAs), handheld devices, computing devices, in-vehicle devices, wearable devices, etc. In some possible implementations, the method can be implemented by a processor calling computer-readable instructions stored in memory or executed by a server. For example, the data in the server can be executed by the storage method. store.

在一種可能的實現方式中,所述樣本集中可包括多個樣本,所述樣本的資料類型可包括圖像、視頻、數位或文本資料等,樣本的儲存格式可包括CSV(Comma-Separated Values,字元分隔值檔)、HDF5(Hierarchical Data Format 5,層次資料格式5)等,本發明實施例對樣本的資料類型和儲存格式不做限制。所述樣本集可以以清單的形式儲存各樣本,即,每個樣本可佔用清單中的一行儲存區域,在該行儲存區域中,可包括樣本的一個或多個欄位。或者,還可以以字典、陣列等形式儲存各樣本。本發明實施例對儲存方式不做限制。樣本集儲存時,可根據使用者輸入的樣本集描述等資訊生成樣本集對應的設定檔,或自動根據儲存的樣本集的樣本資訊生成與樣本集對應的設定檔。In a possible implementation, the sample set may include multiple samples, the data types of the samples may include images, videos, digital or text data, etc., and the storage format of the samples may include CSV (Comma-Separated Values, Character-separated value file), HDF5 (Hierarchical Data Format 5, hierarchical data format 5), etc. The embodiment of the present invention does not limit the data type and storage format of the sample. The sample set may store each sample in the form of a list, that is, each sample can occupy a row of storage area in the list, and the row of storage area may include one or more fields of the sample. Alternatively, each sample can be stored in the form of a dictionary, an array, etc. The embodiment of the present invention does not limit the storage method. When the sample set is saved, the configuration file corresponding to the sample set can be generated based on the sample set description and other information input by the user, or the configuration file corresponding to the sample set can be automatically generated based on the sample information of the stored sample set.

圖2示出根據本發明實施例的清單的示意圖,如圖2所示,所述清單可以以樣本的索引為行座標,以欄位為列座標。例如,某樣本(例如樣本1)為某個人的資料資料,該樣本的欄位可包括該人的身高(例如,欄位1)、體重(例如,欄位2)、學歷(例如,欄位3)等,且該樣本可具有與各欄位對應的資料。本發明實施例對欄位不做限制。Fig. 2 shows a schematic diagram of a list according to an embodiment of the present invention. As shown in Fig. 2, the list may take the index of the sample as the row coordinates and the column as the column coordinates. For example, a sample (such as sample 1) is a person’s data, and the sample’s fields can include the person’s height (for example, field 1), weight (for example, field 2), and academic qualifications (for example, field 3) Etc., and the sample can have data corresponding to each field. The embodiment of the present invention does not limit the field.

在一種可能的實現方式中,所述樣本集可包括csv檔,所述csv檔可以以表格的形式儲存數值型資料、類別型資料、字元型資料以及資料路徑等資訊。所述樣本集可包括音頻、視頻、圖像等影音圖像類檔,例如可以包括AU檔,MP4檔,JPEG檔等,樣本集還可包括HDF5檔,可記錄音頻、視頻、圖像等檔的檔案格式。所述樣本集還可包括txt檔,所述txt檔可儲存字元型資料等。所述樣本集中可包括上述類型的檔中的至少一種,樣本集中的樣本為包括的檔中的資料。在示例中,樣本集中可包括多個類型的子集,例如,某子集為csv檔,該檔中包括多個數值型資料樣本,另一個子集為圖像樣本組成的子集等。在示例中,每個子集可以以清單的形式儲存樣本,例如,csv檔中包括多個數值型資料樣本組成的清單,圖像樣本組成的子集包括多個圖像樣本組成的清單。也可將多個子集的清單進行匯總,獲得儲存樣本集中所有樣本的清單。本發明實施例對樣本集中的清單的形式不做限制。In a possible implementation manner, the sample set may include a csv file, and the csv file may store information such as numeric data, categorical data, character data, and data path in the form of a table. The sample set may include audio, video, image and other audiovisual image files, for example, it may include AU files, MP4 files, JPEG files, etc. The sample set may also include HDF5 files, which can record audio, video, image, etc. files File format. The sample set may also include a txt file, and the txt file may store character data and the like. The sample set may include at least one of the aforementioned types of files, and the samples in the sample set are data in the included files. In an example, the sample set may include multiple types of subsets. For example, a certain subset is a csv file that includes multiple numerical data samples, and the other subset is a subset of image samples. In the example, each subset may store samples in the form of a list. For example, the csv file includes a list composed of multiple numerical data samples, and the subset composed of image samples includes a list composed of multiple image samples. It is also possible to summarize the lists of multiple subsets to obtain a list of all samples in the stored sample set. The embodiment of the present invention does not limit the form of the list in the sample collection.

在一種可能的實現方式中,樣本集中可包括多個資料類型的樣本,各類型的樣本可具有特定的儲存和讀取方式,在儲存樣本集中的多種樣本時,可通過與樣本集對應的欄位資訊對樣本集進行描述,以便於儲存或讀取多個類型的樣本。在示例中,樣本集中包括多個視頻,欄位資訊中可包括對視頻的儲存或讀取方式的描述。In a possible implementation, the sample set can include samples of multiple data types, and each type of sample can have a specific storage and reading method. When storing multiple samples in the sample set, you can pass the column corresponding to the sample set. The bit information describes the sample set to facilitate storage or reading of multiple types of samples. In the example, the sample set includes multiple videos, and the field information may include a description of how the videos are stored or read.

在一種可能的實現方式中,所述樣本集中的樣本可以是訓練神經網路時使用的訓練樣本,樣本集可具有對標注進行描述的描述資訊。所述描述資訊可以是中繼資料meta格式的描述資訊,本發明實施例對描述資訊的類型不做限制。在示例中,每個樣本可具有標注,例如,用於表示樣本的類別、屬性或概率等資訊的標注。例如,所述樣本可包括人臉圖像樣本,在通過神經網路進行身份驗證時,神經網路將各人臉圖像樣本與參考圖像(例如,某個目標人物的人臉圖像)進行對比,並確定人臉圖像樣本與參考圖像的相似度。在相似度大於或等於相似度閾值(例如,0.5)時,可確定人臉圖像樣本與參考圖像的相似度較高,身份驗證通過,否則,身份驗證不通過。在訓練該神經網路時,則需要對各人臉圖像樣本進行標注,為神經網路的損失函數提供參數。例如,如果某個人臉圖像樣本為目標人物的人臉圖像,則可標注為1,表示該人臉圖像樣本中的人臉為目標人物的人臉,如果某個人臉圖像樣本不是目標人物的人臉圖像,則可標注為0,表示該人臉圖像樣本中的人臉不是目標人物的人臉。In a possible implementation manner, the samples in the sample set may be training samples used in training the neural network, and the sample set may have descriptive information describing the annotations. The description information may be description information in the metadata meta format, and the embodiment of the present invention does not limit the type of the description information. In the example, each sample may have a label, for example, a label used to indicate information such as the type, attribute, or probability of the sample. For example, the sample may include a face image sample. When performing identity verification through a neural network, the neural network combines each face image sample with a reference image (for example, a face image of a certain target person). Make a comparison and determine the similarity between the face image sample and the reference image. When the similarity is greater than or equal to the similarity threshold (for example, 0.5), it can be determined that the face image sample has a high similarity with the reference image, and the identity verification passes; otherwise, the identity verification fails. When training the neural network, it is necessary to label each face image sample to provide parameters for the loss function of the neural network. For example, if a face image sample is the face image of the target person, it can be marked as 1, which means that the face in the face image sample is the face of the target person. If the face image sample is not The face image of the target person can be marked as 0, which means that the face in the face image sample is not the face of the target person.

在一種可能的實現方式中,所述描述資訊包括對樣本的標注的描述資訊,其中,步驟S11可包括:根據所述樣本集中樣本的標注,獲得標注清單,所述標注清單包括樣本的標注的類別;對標注清單中的標注添加描述,獲得所述樣本的標注的描述資訊。In a possible implementation manner, the description information includes description information of the label of the sample, wherein step S11 may include: obtaining a label list according to the label of the sample in the sample set, the label list including the label of the sample Category: add a description to the label in the label list to obtain the description information of the label of the sample.

在一種可能的實現方式中,所述樣本的標注的描述資訊可以是對標注進行描述的資訊。可將各樣本的標注進行匯總,獲得標注清單。在示例中,所述樣本可包括人臉圖像樣本,各人臉圖像樣本可被標注為0或1,標注為0的樣本可表示該人臉圖像樣本中的人臉不是目標人物的人臉,標注為1的樣本可表示該人臉圖像樣本中的人臉為目標人物的人臉。可將標注進行匯總,例如,可將標注0和1匯總成標注清單,即,標注清單中包括兩列,一列為0,另一列為1。本發明實施例對標注的類型及標注清單的類型不做限制。當然,在其他實施例中,也可以將標注名稱,即標注的描述進行匯總,生成樣本集中包括的各樣本的標注名稱的清單(label_names)。In a possible implementation, the description information of the label of the sample may be information describing the label. The labeling of each sample can be summarized to obtain a labeling list. In an example, the sample may include a face image sample, each face image sample may be marked as 0 or 1, and a sample marked as 0 may indicate that the face in the face image sample is not of the target person Face, the sample marked as 1 may indicate that the face in the face image sample is the face of the target person. The labels can be summarized. For example, labels 0 and 1 can be summarized into a label list, that is, the label list includes two columns, one column is 0 and the other column is 1. The embodiment of the present invention does not limit the type of the annotation and the type of the annotation list. Of course, in other embodiments, the label names, that is, the label descriptions may also be summarized to generate a list (label_names) of the label names of each sample included in the sample set.

在一種可能的實現方式中,可對標注清單中的各標注添加描述,例如,可對標注為0的一列添加“人臉圖像樣本中的人臉不是目標人物的人臉”的描述,可對標注為1的一列添加“人臉圖像樣本中的人臉為目標人物的人臉”的描述,在為各標注添加描述後,可獲得所述樣本的標注的描述資訊(label_imap)。以上的標注和描述僅為示例,本發明實施例對標注的類型及描述不做限制。In a possible implementation, you can add a description to each label in the label list. For example, you can add a description of "the face in the face image sample is not the face of the target person" to the column labeled 0. Add the description of “the face in the face image sample is the face of the target person” to the column labeled 1, and after adding the description for each label, the label description information (label_imap) of the sample can be obtained. The above labeling and description are only examples, and the embodiment of the present invention does not limit the labeling type and description.

在一種可能的實現方式中,在所述樣本集中儲存樣本的過程中,樣本的標注均按照統一的方式添加描述,例如,均對標注為0的一列添加“人臉圖像樣本中的人臉不是目標人物的人臉”的描述,對標注為1的一列添加“人臉圖像樣本中的人臉為目標人物的人臉”的描述,不可互換,多種類型的資料均可以按照統一的方式添加描述。In a possible implementation manner, in the process of storing samples in the sample set, the labels of the samples are all described in a unified way, for example, the column marked as 0 is added "face in the face image sample" The description of the face that is not the target person", the description of "the face in the face image sample is the face of the target person" is added to the column marked with 1, which is not interchangeable. Various types of information can be in a unified way Add a description.

在一種可能的實現方式中,樣本的標注的描述資訊可被配置為字典型資料,即,字典的鍵為標注,字典的值為對標注的描述,本發明實施例對樣本的標注的描述資訊的資料類型不做限制。In a possible implementation, the description information of the label of the sample can be configured as dictionary-type data, that is, the key of the dictionary is the label, and the value of the dictionary is the description of the label, and the description information of the label of the sample is described in the embodiment of the present invention. There is no restriction on the type of data.

通過這種方式,可針對樣本的標注獲得樣本的標注的描述資訊,使各樣本的標注表示的含義統一,便於樣本的儲存與讀取。In this way, the description information of the label of the sample can be obtained for the label of the sample, so that the meaning of the label of each sample is unified, and it is convenient to store and read the sample.

在一種可能的實現方式中,所述描述資訊還包括用於劃分樣本集中各樣本的類型的索引範圍資訊。所述方法確定描述資訊過程還包括:確定用於劃分樣本集中各樣本的類別的索引範圍資訊;根據所述樣本集中樣本的描述資訊和所述樣本類別的索引範圍資訊,生成與所述樣本集對應的描述資訊。例如,可根據樣本的標注進行類別劃分。例如,可將樣本集分為訓練集、驗證集和測試集,在訓練集中包括5000的樣本,其中,3000個樣本的標注為1,2000個樣本的標注為0。或者,可不區分標注,直接根據樣本集中樣本的數量和索引來劃分,例如,所述樣本集中的樣本可以是訓練神經網路時使用的訓練樣本,可將訓練樣本劃分為多個類別,例如,可將40%的樣本劃分為訓練集,可將30%的樣本劃分為測試集,並將30%的樣本劃分為驗證集。或者可根據各樣本的索引進行劃分,並確定各類別的索引範圍。例如,所述樣本集以清單的形式儲存各樣本,在清單中儲存了10000個樣本,可將清單中的第1個-第4000個樣本劃分為訓練集,可將清單中第4001個-第7000個樣本劃分為測試集,並將第7001個-第10000個樣本劃分為驗證集。其中,描述資訊中可包括對樣本類別進行劃分的索引範圍資訊(例如,第1個-第4000個、第4001個-第7000個、第7001個-第10000個等)。本發明實施例對劃分方式和索引範圍不做限制。In a possible implementation manner, the description information further includes index range information used to classify the types of samples in the sample set. The process of determining description information by the method further includes: determining index range information used to classify the categories of each sample in the sample set; generating and matching the sample set based on the description information of the samples in the sample set and the index range information of the sample categories. Corresponding description information. For example, it can be classified according to the label of the sample. For example, the sample set can be divided into a training set, a validation set, and a test set. The training set includes 5000 samples, of which 3000 samples are labeled as 1, and 2000 samples are labeled as 0. Alternatively, the labels may not be distinguished, and the classification may be directly based on the number and index of the samples in the sample set. For example, the samples in the sample set may be training samples used when training a neural network, and the training samples may be divided into multiple categories, for example, 40% of the samples can be divided into the training set, 30% of the samples can be divided into the test set, and 30% of the samples can be divided into the validation set. Or it can be divided according to the index of each sample, and the index range of each category can be determined. For example, the sample set stores each sample in the form of a list, and 10,000 samples are stored in the list. The 1st-4000th sample in the list can be divided into the training set, and the 4001th-1st sample in the list can be divided into training sets. The 7000 samples are divided into the test set, and the 7001th-10000th samples are divided into the verification set. Among them, the description information may include index range information (for example, 1st-4000th, 4001th-7000th, 7001th-10000th, etc.) for dividing sample categories. The embodiment of the present invention does not limit the division method and the index range.

樣本集除了上述訓練集、測試集、驗證集三個樣本類別的樣本子集外,還可以包括其他形式的資料子集,例如圖像子集、視頻子集等。樣本集的描述資訊除了上述訓練集、測試集、驗證集三個樣本類別的樣本子集描述資訊外,還可以包括其他形式的資料子集的描述資訊,例如圖像子集、視頻子集等。In addition to the sample subsets of the above-mentioned training set, test set, and validation set, the sample set may also include other forms of data subsets, such as image subsets, video subsets, and so on. The description information of the sample set can include the description information of other forms of data subsets, such as image subsets, video subsets, etc., in addition to the sample subset description information of the three sample categories of training set, test set, and validation set. .

通過這種方式,可在讀取樣本時,便於在特定的索引範圍內查找目標樣本,提高讀取效率。In this way, when reading the sample, it is convenient to find the target sample in a specific index range, and the reading efficiency is improved.

描述資訊包括但不限於上述描述資訊,也可以包括其他類型的描述資訊,例如,對樣本的簡介資訊,屬性資訊、佔用空間資訊等。本發明實施例對描述資訊包括的資訊不做限制。The description information includes but is not limited to the above description information, and can also include other types of description information, for example, profile information about the sample, attribute information, space occupation information, etc. The embodiment of the present invention does not limit the information included in the description information.

在一種可能的實現方式中,在步驟S12中,可根據樣本的欄位及儲存位置,確定樣本集的欄位資訊(fields)。例如,可根據樣本集中具有的每個樣本檔(如CSV檔、HDF5檔)中的樣本欄位和儲存位置,確定每個樣本檔的欄位資訊,進而得到整個樣本集的欄位資訊。或者根據樣本集中各種類型(如圖片、視頻、文字等)的樣本的欄位和儲存位置,確定每個類型的樣本的欄位資訊,進而得到整個樣本集的欄位資訊。當然,也可以根據樣本集中所有樣本的欄位和儲存位置,得到整個樣本集的欄位資訊。樣本集中的每個樣本可包括一個或多個欄位,例如,某樣本為某個人的資料資料,該樣本的欄位可包括該人的身高、體重、學歷、國籍等,另一樣本為某個人的人臉圖像,該樣本的欄位可包括該人的身份資訊等,本發明實施例對欄位不做限制。In a possible implementation manner, in step S12, field information (fields) of the sample set can be determined according to the fields and storage locations of the samples. For example, the field information of each sample file can be determined according to the sample field and storage location of each sample file (such as CSV file, HDF5 file) in the sample set, and then the field information of the entire sample set can be obtained. Or according to the fields and storage locations of samples of various types (such as pictures, videos, texts, etc.) in the sample set, determine the field information of each type of sample, and then obtain the field information of the entire sample set. Of course, the field information of the entire sample set can also be obtained according to the fields and storage locations of all samples in the sample set. Each sample in the sample set can include one or more fields. For example, a sample is a person’s data, the sample’s fields can include the person’s height, weight, education, nationality, etc., and the other sample is a certain For an individual's face image, the sample field may include the person's identity information, etc. The embodiment of the present invention does not limit the field.

在一種可能的實現方式中,所述欄位資訊包括樣本的多個欄位的欄位清單(name),其中,步驟S12可包括:對所述樣本集中各樣本的欄位進行匯總處理,獲得所述欄位清單。例如,可在欄位清單中匯總所有欄位,例如,可將人的身高、體重、學歷、國籍等欄位填入欄位清單,將人臉圖像的身份資訊等欄位也填入欄位清單,所述欄位清單可表示樣本集中的多個樣本的欄位。例如,樣本集中包括多個樣本檔或多種類型的樣本,每個樣本檔或每種類型的樣本可以對應一個欄位清單,每個欄位清單中具有對應的樣本檔或對應類型的多個樣本包括的欄位。或者,也可以用一個欄位清單包括樣本集中的所有樣本的欄位。每個欄位在樣本的清單中對應有一列資料,在該列資料的某些區域,資料可為空。例如,在樣本的清單中,包括“國籍”欄位,在某個人的資料資料的樣本中,該欄位可存在資料,例如“中國”、“美國”等,而在人臉圖像樣本中,該欄位不存在資料,即,在所述清單中,在該人臉圖像樣本所在行、“國籍”欄位所在的列對應的區域中,資料為空。In a possible implementation manner, the field information includes a field list (name) of a plurality of fields of a sample, wherein step S12 may include: performing a summary processing on the fields of each sample in the sample set to obtain The list of said fields. For example, you can summarize all the fields in the field list, for example, you can fill in fields such as the person's height, weight, education, nationality, etc. into the field list, and fill in fields such as the identity information of the face image. A list of bits, the list of fields may represent the fields of multiple samples in the sample set. For example, the sample set includes multiple sample files or samples of multiple types, each sample file or each type of sample can correspond to a field list, and each field list has corresponding sample files or multiple samples of corresponding types Included fields. Or, you can use a field list to include the fields of all samples in the sample set. Each field corresponds to a row of data in the list of samples. In some areas of the row of data, the data can be empty. For example, in the list of samples, the "nationality" field is included. In a sample of a person's data, this field can contain data, such as "China", "United States", etc., while in the face image sample , There is no data in this field, that is, in the list, the data is empty in the row where the face image sample is located and the area corresponding to the row where the "nationality" field is located.

在一種可能的實現方式中,所述欄位資訊可包括對樣本的儲存位置的記錄,所述儲存位置包括所述樣本集的儲存路徑及樣本在所述樣本集中的索引位置。例如,所述樣本集的儲存路徑為所述樣本集存放在電腦的C槽中的“樣本集”資料夾中。In a possible implementation, the field information may include a record of the storage location of the sample, and the storage location includes the storage path of the sample set and the index position of the sample in the sample set. For example, the storage path of the sample set is that the sample set is stored in the "sample set" folder in the C slot of the computer.

在一種可能的實現方式中,所述樣本在樣本集中的索引位置即為樣本的具體位置。在示例中,每個樣本的資料可以以物件(object)的形式儲存於樣本集中,即,佔用樣本集中的某個儲存區域。所述樣本集可以以清單的形式儲存各樣本,則樣本的資料可佔用樣本集中的某一行,所述索引位置可表示行號,例如,第1個樣本位於樣本集中清單的第1行,第2個樣本位於樣本集中清單的第2行…在所述欄位資訊中可包括樣本集的儲存路徑及各樣本的索引位置,可根據欄位資訊,確定每個樣本的具體位置,例如,第2個樣本位於電腦的C槽中的“樣本集”資料夾中的樣本集中清單的第2行。又例如,某些樣本可能只具有某些欄位,或者多個樣本屬於同類型或同一個樣本檔,該索引位置可以是樣本在樣本集中的行列範圍,或多個樣本的行列範圍。本發明實施例對儲存位置不做限制。In a possible implementation, the index position of the sample in the sample set is the specific position of the sample. In the example, the data of each sample can be stored in the sample set in the form of an object, that is, occupy a certain storage area in the sample set. The sample set can store each sample in the form of a list, the data of the sample can occupy a certain row in the sample set, and the index position can represent the row number, for example, the first sample is located in the first row of the sample set list, The 2 samples are located in the second row of the sample set list... The field information can include the storage path of the sample set and the index position of each sample. The specific location of each sample can be determined according to the field information, for example, the first The 2 samples are located in the second row of the sample set list in the "sample set" folder in the C slot of the computer. For another example, some samples may only have certain fields, or multiple samples belong to the same type or the same sample file. The index position may be the row and column range of the sample in the sample set, or the row and column range of multiple samples. The embodiment of the present invention does not limit the storage location.

在一種可能的實現方式中,所述樣本集中包括至少一種資料類型的樣本。例如CSV、HDF5、txt、其他圖影像類等類型的樣本。所述欄位資訊還包括各樣本的讀取方式資訊,其中,所述方法還包括:根據樣本集中樣本的資料類型,確定用於讀取樣本的讀取方式;根據所述樣本的資料類型和對應的讀取方式,獲得樣本的讀取方式資訊。In a possible implementation manner, the sample set includes samples of at least one data type. For example, samples of CSV, HDF5, txt, and other image types. The field information also includes the reading method information of each sample, wherein the method further includes: determining the reading method for reading the sample according to the data type of the sample in the sample set; and according to the data type of the sample and Corresponding to the reading method, obtain the reading method information of the sample.

在一種可能的實現方式中,所述讀取方式資訊可以是對樣本的讀取方式進行描述的資訊。可根據樣本的資料類型,對樣本的讀取方式進行判斷,例如,某個樣本的資料類型為圖像,則該樣本可用圖像讀取函數進行讀取,某個樣本的資料類型為視頻,則該樣本可用視頻讀取函數進行讀取,可分別確定每個樣本的讀取方式。也可匯總各樣本的資料類型,例如,樣本集或樣本集種包括的樣本檔中包括多個樣本,所述多個樣本的資料類型共有三種,分別為圖像、視頻和普通資料,可確定通過圖像讀取函數讀取圖像類型的樣本,通過視頻讀取函數讀取視頻類型的樣本,通過資料讀取函數讀取普通資料類型的樣本,則該樣本集或樣本檔的讀取方式資訊可以包括上述資料類型及其對應的讀取方式。本發明實施例對樣本的資料類型及讀取方式不做限制。In a possible implementation manner, the reading mode information may be information describing the reading mode of the sample. The reading method of the sample can be judged according to the data type of the sample. For example, if the data type of a sample is an image, the sample can be read by the image reading function, and the data type of a sample is video. Then the sample can be read by the video reading function, and the reading method of each sample can be determined separately. The data type of each sample can also be summarized. For example, the sample file included in the sample set or the sample set includes multiple samples. There are three types of data for the multiple samples, which are images, videos, and general data, which can be determined Read the sample of the image type through the image reading function, read the sample of the video type through the video reading function, read the sample of the common data type through the data reading function, then the reading method of the sample set or sample file The information may include the above-mentioned data types and corresponding reading methods. The embodiment of the present invention does not limit the data type and reading method of the sample.

在一種可能的實現方式中,可根據樣本的資料類型和對應的讀取方式,獲得所述讀取方式資訊(proc)。在示例中,可將讀取方式資訊配置為字典型資料,例如,字典的鍵為資料類型,字典的值為與資料類型對應的讀取方式,例如,字典的鍵為圖像,字典的值為圖像讀取函數。本發明實施例對讀取方式資訊的資料類型不做限制。In a possible implementation manner, the reading method information (proc) can be obtained according to the data type of the sample and the corresponding reading method. In the example, the reading method information can be configured as dictionary data. For example, the key of the dictionary is the data type, and the value of the dictionary is the reading method corresponding to the data type. For example, the key of the dictionary is the image and the value of the dictionary. It is the image reading function. The embodiment of the present invention does not limit the data type of the reading mode information.

在一種可能的實現方式中,所述欄位資訊也可不包括讀取方式資訊,讀取樣本時可根據樣本檔的尾碼等資訊確定讀取方式,例如,某樣本檔的尾碼為txt,則可選用文本打開方式來讀取該樣本,某樣本檔的尾碼為jpg,則可選用圖片打開方式來讀取該樣本。本發明實施例對樣本的尾碼及打開方式不做限制。In a possible implementation manner, the field information may not include the reading method information. When reading the sample, the reading method can be determined according to the information such as the suffix of the sample file. For example, the suffix of a sample file is txt. You can select the text opening method to read the sample. If the end code of a sample file is jpg, you can select the image opening method to read the sample. The embodiment of the present invention does not limit the tail code and the opening method of the sample.

通過這種方式,可確定多種樣本的讀取方式,有利於支援多種類型的資料儲存,適應更複雜類型的資料集的儲存,同時便於讀取時根據設定檔獲取合適的讀取方式讀取樣本。In this way, a variety of sample reading methods can be determined, which is beneficial to support multiple types of data storage, adapt to the storage of more complex types of data sets, and at the same time facilitate the acquisition of suitable reading methods according to the configuration file when reading samples. .

在一種可能的實現方式中,所述欄位資訊還包括指示是否允許讀取多個樣本的指示資訊(fullonly),該指示資訊可指示能否一次性讀取多個樣本的資料。例如,如果該指示資訊指示可以一次性讀取樣本集或樣本檔中所有樣本的資料,則在讀取資料的情況下,可將樣本集或樣本檔中的樣本全部讀取,例如,HDF5檔支持一次性讀取整個檔中的樣本。如果該指示資訊指示不可一次性讀取樣本集或樣本檔中樣本的資料,則在讀取資料的情況下,無法一次性讀取樣本集或樣本檔中全部樣本,支援隨用隨讀,例如,每次僅可讀取一個樣本的資料,或者一部分樣本的資料。In a possible implementation manner, the field information further includes instruction information (fullonly) indicating whether multiple samples are allowed to be read, and the instruction information may indicate whether the data of multiple samples can be read at one time. For example, if the instruction information indicates that the data of all samples in the sample set or sample file can be read at one time, in the case of reading data, all samples in the sample set or sample file can be read, for example, HDF5 file Supports reading the samples in the entire file at one time. If the instruction information indicates that the data of the sample set or the sample in the sample file cannot be read at one time, in the case of reading the data, the sample set or all the samples in the sample file cannot be read at one time, and it supports reading at any time, such as , Only one sample or part of the sample data can be read at a time.

在一種可能的實現方式中,在步驟S13中,可根據描述資訊和欄位資訊,確定樣本集的設定檔(index.yml),在示例中,可將描述資訊和欄位資訊的內容寫入設定檔中,或者將描述資訊和欄位資訊打包獲得設定檔,本發明實施例對獲得設定檔的方式不做限制。In a possible implementation, in step S13, the configuration file (index.yml) of the sample set can be determined based on the description information and the field information. In the example, the content of the description information and the field information can be written In the configuration file, or package the description information and the field information to obtain the configuration file, the embodiment of the present invention does not limit the way of obtaining the configuration file.

在一種可能的實現方式中,所述設定檔可以是記錄多種樣本的儲存方式的檔,即,設定檔中包括各樣本的欄位、標注、儲存位置和讀取方式等資訊,各種資料類型的樣本均能夠儲存在樣本集中,並在設定檔中保存欄位、標注、儲存位置和讀取方式等資訊,以便於讀取,所述設定檔為儲存和讀取多種資料類型的樣本提供了基礎。In a possible implementation, the configuration file may be a file that records the storage methods of multiple samples, that is, the configuration file includes information such as the fields, labels, storage locations, and reading methods of each sample, and various data types Samples can be stored in the sample collection, and information such as fields, annotations, storage locations, and reading methods are saved in the configuration file for easy reading. The configuration file provides a basis for storing and reading samples of multiple data types .

圖3示出根據本發明實施例的讀取方法的流程圖,如圖3所示,所述方法包括: 在步驟S14中,根據與樣本集對應的設定檔,獲取樣本集中目標樣本的儲存位置及目標欄位; 在步驟S15中,根據所述儲存位置,讀取所述目標樣本的目標欄位的目標參數值。Fig. 3 shows a flowchart of a reading method according to an embodiment of the present invention. As shown in Fig. 3, the method includes: In step S14, obtain the storage location and target field of the target sample in the sample set according to the configuration file corresponding to the sample set; In step S15, the target parameter value of the target field of the target sample is read according to the storage location.

其中,所述設定檔基於所述樣本集的描述資訊和樣本的欄位資訊確定。Wherein, the configuration file is determined based on the description information of the sample set and the field information of the sample.

根據本發明的實施例的讀取方法,可根據設定檔確定目標樣本的儲存位置和目標欄位,並對目標樣本的目標參數進行讀取,可根據設定檔在樣本集中讀取各種類別的樣本,使不同類型的樣本都可通過設定檔讀取,無需針對每個類別的樣本配置程式介面,便於樣本資料的儲存和讀取,提高了讀取效率。基於該設定檔,可支援多種資料類型的樣本檔(例如,CSV、HDF5、其他檔(圖像、音頻)類型的樣本)的儲存和讀取,適應更複雜類型的樣本集中的樣本的讀取。According to the reading method of the embodiment of the present invention, the storage location and target field of the target sample can be determined according to the configuration file, and the target parameters of the target sample can be read. Various types of samples can be read in the sample set according to the configuration file. , So that different types of samples can be read through the configuration file, no need to configure the program interface for each type of sample, which facilitates the storage and reading of sample data, and improves the reading efficiency. Based on this configuration file, it can support the storage and reading of sample files of multiple data types (for example, CSV, HDF5, samples of other file (image, audio) types), adapting to the reading of samples in more complex types of sample sets .

在一種可能的實現方式中,所述設定檔可以是用於描述樣本集中的樣本的檔,可利用設定檔讀取樣本集中的樣本。所述設定檔可包括與樣本集對應的描述資訊和欄位資訊,在讀取樣本的情況下,可根據描述資訊和欄位資訊讀取樣本。樣本集中可以有多種資料類型的樣本,例如CSV、HDF5、其他檔(圖像音頻)等類型的樣本。描述資訊可以是對樣本標注的描述資訊,可包括樣本集中各樣本的標注的清單、標注的描述資訊以及用於劃分樣本集中各樣本的類別的索引範圍資訊等。欄位資訊可以是用於描述樣本的資訊,欄位資訊可記錄多種樣本的欄位清單、資料類型、讀取方式、儲存路徑、索引位置等,可根據描述資訊和欄位資訊讀取某個樣本,例如目標樣本。每種資料類型的樣本均可按照上述方式進行讀取,因此,可支援多種類型的資料讀取。In a possible implementation manner, the configuration file may be a file used to describe the samples in the sample set, and the configuration file may be used to read the samples in the sample set. The configuration file may include description information and field information corresponding to the sample set. In the case of reading a sample, the sample can be read based on the description information and field information. There can be samples of multiple data types in the sample set, such as CSV, HDF5, other files (image and audio) and other types of samples. The descriptive information may be descriptive information marked on the sample, and may include a marked list of each sample in the sample set, marked description information, and index range information used to classify each sample in the sample set. The field information can be the information used to describe the sample. The field information can record the field list, data type, reading method, storage path, index location, etc. of a variety of samples. It can read a certain Samples, such as target samples. Samples of each data type can be read in the above-mentioned manner, so multiple types of data can be read.

在一種可能的實現方式中,可基於設定檔,讀取樣本集中的樣本或樣本的欄位資料。在步驟S14中,所述樣本集可以以清單的形式儲存各樣本,可在設定檔的欄位資訊中獲得待讀取的目標樣本的儲存位置和待讀取的目標欄位。並在步驟S15中,讀取所述目標樣本的目標欄位的目標參數值。In a possible implementation manner, the sample in the sample set or the column data of the sample can be read based on the configuration file. In step S14, the sample set can store each sample in the form of a list, and the storage location of the target sample to be read and the target field to be read can be obtained from the field information of the configuration file. And in step S15, the target parameter value of the target field of the target sample is read.

在一種可能的實現方式中,在讀取目標樣本的情況下,可根據目標樣本所屬的樣本檔的名稱或尾碼確定目標樣本的讀取方式,例如,某樣本檔的尾碼為txt,則可選用文本打開方式來讀取該樣本,某樣本檔的尾碼為jpg,則可選用圖片打開方式來讀取該樣本。或者,所述設定檔的欄位資訊中,可包括樣本、樣本檔或某資料類型的讀取方式,所述方法還包括:根據所述設定檔,獲取目標樣本的讀取方式。即,在設定檔的欄位資訊中,可獲取樣本的讀取方式資訊,例如,可直接獲取目標樣本的讀取方式,或者根據目標樣本所屬樣本檔(如CSV或HDF5等)獲取對應的讀取方式,又或者根據目標樣本所屬的資料類型(如圖像、文本等)獲取對應的讀取方式,繼而可通過該讀取方式讀取目標樣本。In a possible implementation manner, in the case of reading the target sample, the reading method of the target sample can be determined according to the name or end code of the sample file to which the target sample belongs. For example, if the end code of a sample file is txt, then You can choose the text opening method to read the sample. If the end code of a sample file is jpg, you can choose the picture opening method to read the sample. Alternatively, the field information of the configuration file may include a sample, a sample file, or a reading method of a certain data type, and the method further includes: obtaining a reading method of a target sample according to the configuration file. That is, in the field information of the configuration file, the reading method information of the sample can be obtained, for example, the reading method of the target sample can be directly obtained, or the corresponding reading method can be obtained according to the sample file (such as CSV or HDF5, etc.) to which the target sample belongs. Alternatively, the corresponding reading method can be obtained according to the data type (such as image, text, etc.) to which the target sample belongs, and then the target sample can be read through the reading method.

在一種可能的實現方式中,在步驟S14中,可根據目標樣本的儲存位置查找到目標樣本,並按照目標樣本的讀取方式讀取目標樣本及目標樣本的目標欄位,所述目標欄位可以是目標樣本的多個欄位中的任意一個或多個,也可以是目標樣本的全部欄位。步驟S14可包括:根據目標樣本的儲存位置,獲取所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置;根據所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置,查詢所述目標樣本;根據所述目標樣本的讀取方式,對目標樣本進行讀取,獲得目標樣本的一個或多個欄位的參數值;在所述目標樣本的一個或多個欄位的參數值中,確定所述目標參數值。In a possible implementation manner, in step S14, the target sample can be found according to the storage location of the target sample, and the target sample and the target field of the target sample can be read according to the reading method of the target sample. It can be any one or more of the multiple fields of the target sample, or all the fields of the target sample. Step S14 may include: obtaining the storage path of the sample set and the index position of the target sample in the sample set according to the storage location of the target sample; querying all data according to the storage path of the sample set and the index position of the target sample in the sample set The target sample; according to the reading method of the target sample, the target sample is read to obtain the parameter value of one or more fields of the target sample; the parameter value of one or more fields of the target sample , Determine the target parameter value.

在一種可能的實現方式中,可確定目標樣本的儲存位置,例如,根據欄位資訊中記錄的樣本集的儲存路徑與目標樣本在樣本清單中的索引位置,可以確定目標樣本的精確位置,並通過精確位置查詢目標樣本。例如,目標樣本為樣本2,根據該樣本的儲存位置,可在電腦的C槽中的“樣本集”資料夾中的樣本集中清單的第2行查詢到該樣本。In a possible implementation, the storage location of the target sample can be determined. For example, according to the storage path of the sample set recorded in the field information and the index position of the target sample in the sample list, the precise location of the target sample can be determined, and Query the target sample by precise location. For example, the target sample is sample 2. According to the storage location of the sample, the sample can be found in the second row of the sample set list in the "sample set" folder in the C slot of the computer.

在一種可能的實現方式中,可通過讀取方式資訊中記錄的目標樣本的讀取方式,讀取目標樣本,例如,目標樣本為文本資料,可通過文本資料讀取函數來讀取目標樣本,可獲得目標樣本的一個或多個欄位的參數值。進一步地,可在一個或多個欄位的參數值中,確定目標欄位的目標參數值。例如,可讀取樣本2的身高、體重、學歷、國籍等欄位的參數值,其中,目標欄位為身高,可在上述參數值中,確定身高欄位的參數值。In a possible implementation manner, the target sample can be read by the target sample reading method recorded in the reading mode information. For example, if the target sample is text data, the target sample can be read by the text data reading function. The parameter value of one or more fields of the target sample can be obtained. Further, the target parameter value of the target field can be determined from the parameter values of one or more fields. For example, the parameter values of the height, weight, education, nationality and other fields of the sample 2 can be read, where the target field is the height, and the parameter value of the height field can be determined from the above parameter values.

在一種可能的實現方式中,在步驟S14中,可在設定檔的欄位資訊中獲取某個欄位(目標欄位),並在清單中獲取多個樣本的目標欄位的參數值。進一步地,可獲取目標樣本的目標欄位的參數值。步驟S14可包括:根據目標樣本的儲存位置,獲取所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置;根據所述樣本集的儲存路徑及所述目標欄位,獲取樣本集中多個樣本的目標欄位的參數值的儲存位置;根據目標樣本在樣本集中的索引位置,在所述多個樣本的目標欄位的參數值的儲存位置中,確定目標樣本的目標欄位的參數值的儲存位置;根據所述目標樣本的讀取方式,在所述目標樣本的目標欄位的參數值的儲存位置中讀取所述目標參數值。In a possible implementation manner, in step S14, a certain field (target field) may be obtained from the field information of the configuration file, and the parameter values of the target fields of multiple samples may be obtained in the list. Further, the parameter value of the target field of the target sample can be obtained. Step S14 may include: obtaining the storage path of the sample set and the index position of the target sample in the sample set according to the storage location of the target sample; obtaining multiple sample sets according to the storage path of the sample set and the target field The storage position of the parameter value of the target field of the sample; according to the index position of the target sample in the sample set, the parameter value of the target field of the target sample is determined in the storage position of the parameter value of the target field of the multiple samples The storage location of; according to the reading method of the target sample, read the target parameter value in the storage location of the parameter value of the target field of the target sample.

在一種可能的實現方式中,可根據欄位資訊,確定目標樣本的儲存位置,例如,根據欄位資訊中記錄的樣本集的儲存路徑與目標樣本在樣本清單中的索引位置,可以確定目標樣本的精確位置。例如,樣本集的儲存路徑為電腦的C槽中的“樣本集”資料夾中的樣本集,目標樣本的索引位置為樣本集中清單的第2行。In a possible implementation, the storage location of the target sample can be determined based on the field information. For example, the target sample can be determined based on the storage path of the sample set recorded in the field information and the index position of the target sample in the sample list. Precise location. For example, the storage path of the sample set is the sample set in the "sample set" folder in the C slot of the computer, and the index position of the target sample is the second row of the sample set list.

在一種可能的實現方式中,可在欄位資訊中選擇目標欄位,並可根據樣本集的儲存路徑及目標欄位,獲取目標欄位的參數值的儲存位置。例如,可在電腦的C槽中的“樣本集”資料夾中的樣本集中,獲取身高欄位的參數值的儲存位置。並根據目標樣本在樣本集中的索引位置,確定目標樣本的目標欄位的儲存位置,例如,從身高欄位的多個參數值的儲存位置中,確定樣本2的身高欄位的儲存位置,即,身高欄位的多個參數值的儲存位置中的第2行的儲存位置。進一步地,可在設定檔中獲取目標樣本的讀取方式,並讀取目標參數值,例如,可通過資料讀取函數,讀取該儲存位置中的目標參數值。In a possible implementation manner, the target field can be selected in the field information, and the storage location of the parameter value of the target field can be obtained according to the storage path and the target field of the sample set. For example, you can obtain the storage location of the parameter value of the height field in the sample set in the "sample set" folder in the C slot of the computer. And according to the index position of the target sample in the sample set, determine the storage location of the target field of the target sample, for example, determine the storage location of the height field of sample 2 from the storage locations of multiple parameter values of the height field, namely , The storage location of the second row in the storage location of multiple parameter values in the height field. Further, the reading method of the target sample can be obtained in the configuration file, and the target parameter value can be read, for example, the target parameter value in the storage location can be read through a data reading function.

在一種可能的實現方式中,還可根據標注讀取目標樣本,例如,在神經網路的訓練過程中,可按照預設比例讀取各標注類型的樣本,例如,可讀取預定數量的樣本,其中,50%為標注1的樣本,50%為標注0的樣本。或可根據索引範圍資訊讀取樣本,例如,在訓練的情況下,可讀取訓練集中的樣本,在測試的情況下,讀取測試集中的樣本,在驗證的情況下,讀取驗證集中的樣本。本發明實施例對讀取方式不做限制。In a possible implementation manner, the target samples can also be read according to the annotations. For example, in the training process of the neural network, the samples of each annotation type can be read according to a preset ratio, for example, a predetermined number of samples can be read , Of which 50% are samples labeled 1, and 50% are samples labeled 0. Or you can read samples based on the index range information. For example, in the case of training, you can read the samples in the training set, in the case of testing, you can read the samples in the test set, and in the case of verification, you can read the samples in the verification set. sample. The embodiment of the present invention does not limit the reading mode.

在一種可能的實現方式中,所述設定檔包括指示是否允許讀取多個樣本的指示資訊,根據所述儲存位置,讀取所述目標樣本的目標欄位的目標參數值,包括:獲取所述目標樣本預設的讀取模式;根據所述預設的讀取模式以及所述指示資訊,在所述目標樣本的目標欄位的參數值的儲存位置中讀取所述目標參數值。在示例中,讀取樣本的情況下,使用者可設定預設的讀取模式,可針對各樣本隨用隨讀,也可一次性讀取所有樣本。例如,針對圖像、視頻、文本等樣本,使用者可設定為隨用隨讀,即,可針對一個或多個樣本分別讀取。也可依次讀取多個樣本,或者一次讀取所有樣本。In a possible implementation manner, the configuration file includes instruction information indicating whether to allow reading of multiple samples, and reading the target parameter value of the target field of the target sample according to the storage location includes: obtaining all The preset reading mode of the target sample; according to the preset reading mode and the instruction information, the target parameter value is read in the storage location of the parameter value of the target field of the target sample. In the example, in the case of reading samples, the user can set a preset reading mode, which can be read at any time for each sample, or all samples can be read at once. For example, for samples of images, videos, texts, etc., the user can set it to be read as needed, that is, one or more samples can be read separately. It is also possible to read multiple samples in sequence, or read all samples at once.

在一種可能的實現方式中,根據所述預設的讀取模式以及所述指示資訊,在所述目標樣本的目標欄位的參數值的儲存位置中讀取所述目標參數值,包括:在所述預設的讀取模式與所述指示資訊不匹配的情況下,使用所述指示資訊對應的讀取方式,讀取所述目標樣本的目標欄位的參數值。有些資料格式的樣本僅支援一次性讀取所有樣本,例如,HDF5格式的樣本只能一次性讀取所有樣本,此時,該樣本檔的指示資訊為允許讀取多個樣本的指示資訊(如支援一次性讀取所有樣本的指示資訊),如果預設的讀取模式為隨用隨讀,則預設讀取模式與指示資訊不匹配,無法使用預設讀取模式讀取HDF5格式的樣本,因此,可根據該類型的樣本的指示資訊,一次性讀取所有HDF5格式的樣本,進而可在讀取到的所有樣本中,查詢到目標樣本的目標欄位的目標參數值。類似的,某些資料格式的樣本不支援一次性讀取所有樣本的情況下,其指示資訊可以設置為不允許讀取多個樣本的指示資訊(如不支援一次性讀取所有樣本),如果預設的讀取模式為一次性讀取所有樣本,則預設讀取模式與指示資訊不匹配,無法使用預設讀取模式讀取樣本,因此,可根據該類型的樣本的指示資訊,隨讀隨取樣本資料。In a possible implementation manner, reading the target parameter value in the storage location of the parameter value of the target field of the target sample according to the preset reading mode and the instruction information includes: When the preset reading mode does not match the instruction information, the reading method corresponding to the instruction information is used to read the parameter value of the target field of the target sample. Some data format samples only support reading all samples at one time. For example, HDF5 format samples can only read all samples at one time. At this time, the instruction information of the sample file is the instruction information that allows multiple samples to be read (such as Supports reading the instruction information of all samples at one time). If the default reading mode is read as you want, the default reading mode does not match the instruction information, and you cannot use the default reading mode to read samples in HDF5 format. Therefore, according to the instruction information of this type of sample, all HDF5 format samples can be read at one time, and then the target parameter value of the target field of the target sample can be queried among all the samples read. Similarly, when some data format samples do not support reading all samples at once, the instruction information can be set to the instruction information that does not allow reading multiple samples (if not supporting reading all samples at once), if The default reading mode is to read all samples at once. The default reading mode does not match the instruction information, and the default reading mode cannot be used to read the samples. Therefore, you can follow the instruction information of this type of sample. Read the sample data.

根據本發明的實施例的讀取方法,可針對樣本的標注獲得樣本的標注的描述資訊,使各樣本的標注表示的含義統一,便於樣本的儲存與讀取,並可確定多種類型的樣本的讀取方式,有利於支援多種類型的資料儲存,適應更複雜類型的資料集的儲存。進一步地,基於描述資訊和欄位資訊確定設定檔,可根據設定檔在樣本集中讀取各種類別的樣本,使不同類型的樣本都可通過設定檔獲取樣本描述和欄位資訊並讀取,無需針對每個類別的樣本配置程式介面,便於樣本資料的儲存和讀取,可支援多種類型的資料儲存,適應更複雜類型的資料集的儲存。According to the reading method of the embodiment of the present invention, the description information of the label of the sample can be obtained for the label of the sample, so that the meaning of the label of each sample is unified, which is convenient for the storage and reading of the sample, and the identification information of multiple types of samples can be determined. The reading method is conducive to supporting multiple types of data storage and adapting to the storage of more complex types of data sets. Further, the configuration file is determined based on the description information and field information, and various types of samples can be read in the sample set according to the configuration file, so that different types of samples can be obtained and read through the configuration file. The program interface is configured for each type of sample to facilitate the storage and reading of sample data. It can support multiple types of data storage and adapt to the storage of more complex types of data sets.

圖4示出根據本發明實施例的讀取方法的應用示意圖,如圖4所示,樣本集中可包括多個樣本,樣本的資料類型可包括圖像、音頻、視頻和/或普通資料(例如,數值型資料、類別型資料、字元型資料)等。樣本集可以以清單的形式儲存各樣本,即,每個樣本可佔用樣本的清單中的一行儲存區域。每個樣本可包括一個或多個欄位,例如,某樣本為某個人的資料資料,該樣本的欄位可包括該人的身高、體重、學歷、國籍等,該樣本可具有與各欄位對應的資料。Figure 4 shows a schematic diagram of the application of the reading method according to an embodiment of the present invention. As shown in Figure 4, the sample set can include multiple samples, and the data types of the samples can include images, audio, video, and/or common data (for example, , Numeric data, categorical data, character data), etc. The sample set can store each sample in the form of a list, that is, each sample can occupy a row of storage areas in the list of samples. Each sample can include one or more fields. For example, a sample is a person’s data. The sample’s fields can include the person’s height, weight, education, nationality, etc., and the sample can have various fields. Corresponding information.

在一種可能的實現方式中,樣本集中的樣本可包括多個資料類型,各類型的樣本可具有特定的儲存和讀取方式,且各樣本可具有對應的標注。在設定檔(index.yml)中可包括描述資訊,例如,中繼資料meta格式的描述資訊,所述描述資訊可記錄各樣本的標注以及對標注的描述。In a possible implementation, the samples in the sample set may include multiple data types, each type of sample may have a specific storage and reading method, and each sample may have a corresponding label. The configuration file (index.yml) may include description information, for example, description information in a meta format of metadata, and the description information may record the label of each sample and the description of the label.

在示例中,樣本的標注的描述資訊(label_imap)可以是字典型資料,字典的鍵為標注,字典的值為對標注的描述,例如,字典的鍵為0,字典的值為樣本中的物件不是目標物件,字典的鍵為1,字典的值為字典的值為樣本中的物件是目標物件。In the example, the label description information (label_imap) of the sample can be dictionary data, the key of the dictionary is the label, and the value of the dictionary is the description of the label. For example, the key of the dictionary is 0, and the value of the dictionary is the object in the sample. It is not the target object, the key of the dictionary is 1, and the value of the dictionary is the value of the dictionary. The object in the sample is the target object.

在示例中,描述資訊還包括用於劃分樣本集中各樣本的類型(如樣本子集subsets)的索引範圍資訊,例如,樣本集中的樣本為訓練神經網路的情況下使用的訓練樣本,可將訓練樣本劃分為多個類別,例如,可將40%的樣本劃分為訓練集,可將30%的樣本劃分為測試集,並將30%的樣本劃分為驗證集。索引範圍資訊確定了訓練集的樣本、測試集的樣本以及驗證集的樣本在樣本的清單中的索引範圍。In the example, the description information also includes index range information used to classify the types of samples in the sample set (such as sample subsets). For example, if the samples in the sample set are training samples used when training a neural network, you can add The training samples are divided into multiple categories. For example, 40% of the samples can be divided into the training set, 30% of the samples can be divided into the test set, and 30% of the samples can be divided into the validation set. The index range information determines the index range of the training set samples, the test set samples, and the validation set samples in the sample list.

在一種可能的實現方式中,所述設定檔中可包括欄位資訊,欄位資訊包括樣本的多個欄位的欄位清單(name),以及樣本的儲存位置。可用於通過欄位和儲存位置讀取樣本的資料。In a possible implementation manner, the configuration file may include field information, and the field information includes a field list (name) of multiple fields of the sample, and the storage location of the sample. It can be used to read the data of the sample through the field and storage location.

在示例中,欄位資訊還可以包括樣本的讀取方式資訊,樣本的讀取方式資訊(proc)可以是字典型資料,字典的鍵為樣本的資料類型,字典的值為與資料類型對應的讀取方式,例如,字典的鍵為圖像,字典的值為圖像讀取函數,字典的鍵為視頻,字典的值為視頻讀取函數等。In the example, the field information can also include the reading method information of the sample. The reading method information of the sample (proc) can be dictionary data. The key of the dictionary is the data type of the sample, and the value of the dictionary corresponds to the data type. The reading method, for example, the key of the dictionary is an image, the value of the dictionary is an image reading function, the key of the dictionary is a video, and the value of the dictionary is a video reading function, etc.

在示例中,可將各樣本的欄位進行匯總,例如,某個樣本為某個人的資料資料,該樣本的欄位可包括該人的身高、體重、學歷和國籍;另一個樣本為該人的人臉圖像樣本,人臉圖像樣本的欄位可包括該人的身份資訊(例如,姓名、編號等),可將上述所有欄位進行匯總,獲得欄位清單,例如,欄位清單中包括身高、體重、學歷、國籍和身份資訊等欄位。In the example, the fields of each sample can be summarized. For example, a sample is the data of a person, and the fields of the sample can include the person's height, weight, education and nationality; the other sample is the person The face image sample of, the fields of the face image sample can include the person’s identity information (for example, name, number, etc.), and all the above fields can be summarized to obtain a list of fields, for example, a list of fields It includes fields such as height, weight, education, nationality, and identity information.

在示例中,欄位資訊還可以包括樣本的儲存位置,可確定各樣本的儲存位置,所述儲存位置可包括樣本集的儲存路徑和樣本在樣本的清單中的索引位置,例如,樣本集的儲存路徑為C槽中的“樣本集”資料夾,待查詢的目標樣本的索引位置為樣本的清單中的第2行,則該樣本的儲存位置為C槽中的“樣本集”資料夾中的樣本集中清單的第2行。In an example, the field information can also include the storage location of the sample, which can determine the storage location of each sample. The storage location can include the storage path of the sample set and the index position of the sample in the sample list, for example, the sample set’s index position. The storage path is the "sample set" folder in slot C, and the index position of the target sample to be queried is the 2nd row in the list of samples, then the storage location of the sample is in the "sample set" folder in slot C Line 2 of the list of sample sets.

在示例中,欄位資訊還包括指示是否允許讀取所有樣本的指示資訊(fullonly),該指示資訊可指示能否一次性讀取所有樣本的資料。例如,如果該指示資訊指示可以一次性讀取所有樣本的資料,則在讀取資料的情況下,可將樣本集中的樣本全部讀取,例如,可讀取整個樣本清單。如果該指示資訊指示不可一次性讀取所有樣本的資料,則在讀取資料的情況下,無法一次性讀取全部樣本,例如,每次僅可讀取一個樣本的資料,或者一部分樣本的資料。In the example, the field information also includes instruction information (fullonly) indicating whether to allow all samples to be read. The instruction information can indicate whether or not to read the data of all samples at once. For example, if the instruction information indicates that the data of all samples can be read at one time, in the case of reading the data, all the samples in the sample set can be read, for example, the entire sample list can be read. If the instruction information indicates that the data of all samples cannot be read at one time, it is not possible to read all the samples at one time when the data is read, for example, the data of only one sample can be read at a time, or the data of a part of the sample can be read at a time .

在一種可能的實現方式中,可基於設定檔,讀取樣本集中的樣本或樣本的資料。例如,可在設定檔的欄位資訊中獲得待讀取的目標樣本在樣本的清單中的索引,並在設定檔的描述檔中,獲得目標樣本的讀取方式,根據目標樣本在清單中的索引查找到目標樣本的儲存位置,並按照目標樣本的讀取方式讀取目標樣本或目標樣本的一個或多個參數值。又例如,可在欄位資訊中獲取某個欄位,並在清單中獲取多個樣本的該欄位的資料(可忽略該欄位為空的樣本)的儲存位置,並根據目標樣本在樣本的清單中的索引,查詢目標樣本的該欄位的資料的儲存位置,並可按照目標樣本的讀取方式,在目標樣本的該欄位的儲存位置中讀取該資料。In a possible implementation manner, the sample or the data of the sample in the sample set can be read based on the configuration file. For example, the index of the target sample to be read in the sample list can be obtained in the field information of the configuration file, and the reading method of the target sample can be obtained in the description file of the configuration file, according to the target sample in the list The index finds the storage location of the target sample, and reads the target sample or one or more parameter values of the target sample according to the reading method of the target sample. For another example, you can obtain a certain field in the field information, and obtain the storage location of the field data of multiple samples in the list (the samples whose field is empty can be ignored), and according to the target sample in the sample The index in the list of the target sample can query the storage location of the data in the field of the target sample, and read the data in the storage location of the field of the target sample according to the reading method of the target sample.

在一種可能的實現方式中,所述儲存和讀取方法可用於對多種類型的樣本的儲存中,例如,在電腦教育領域,使用該儲存方法可將多種類型的樣本按照統一的儲存方法進行儲存,便於儲存和讀取,便於學生進行操作。所述儲存方法可不限於程式設計語言環境,可利用設定檔將不同類型的樣本按照統一的方式進行儲存。In a possible implementation, the storage and reading method can be used to store multiple types of samples. For example, in the field of computer education, using this storage method can store multiple types of samples according to a unified storage method. , Easy to store and read, easy for students to operate. The storage method is not limited to the programming language environment, and different types of samples can be stored in a unified manner using configuration files.

下面,將說明本發明實施例在一個實際的應用場景中的示例性應用。In the following, an exemplary application of the embodiment of the present invention in an actual application scenario will be described.

在機器學習中,尤其是在需要處理多種資料集的情況下,資料集儲存方式就極為重要,需要將不同的資料集按同一種協定組織起來。當前資料集的儲存方式並沒有通用的協定和法則,對於資料集儲存也通常是為了適應資料集本身的結構,無法相互適應。現有的CSV、HDF5、檔儲存(圖像音頻)等資料儲存方式雖然功能強大,但是支援的資料類型受限,並不能滿足資料集中各種資料的儲存需求。In machine learning, especially when multiple data sets need to be processed, the data set storage method is extremely important, and different data sets need to be organized according to the same agreement. There is no general agreement or rule for the storage of data sets at present, and the storage of data sets is usually to adapt to the structure of the data set itself and cannot be adapted to each other. Although the existing data storage methods such as CSV, HDF5, and file storage (image and audio) are powerful, the types of data supported are limited and cannot meet the storage requirements of various data in the data set.

在機器學習中,資料集越來越廣泛,我們需要找到一種合適的資料集儲存協定來儲存多數資料迥異的,中繼資料描述複雜的資料集,使得整體資料框架更加的清晰,並且對於資料集中各類資料的描述也更加完備。In machine learning, data sets are becoming more and more extensive. We need to find a suitable data set storage protocol to store most of the data sets that are very different. Metadata describes complex data sets, so that the overall data framework is clearer and is more important for data collection. The description of various materials is also more complete.

因此,本發明實施例提供了一種資料集儲存協定,旨在將機器學習相關資料集盡可能的以同樣的方式組織起來,涵蓋資料集的中繼資料和各類資料檔案資訊,同時此協定可以移植到不同底層的資料集儲存,適應多種語言環境。Therefore, the embodiment of the present invention provides a data set storage protocol, which aims to organize machine learning-related data sets in the same way as possible, covering the metadata of the data set and various data file information. At the same time, this protocol can It is transplanted to the data set storage of different bottom layers to adapt to multiple language environments.

在一種可能的實現方式中,本發明實施例包括: 1、此協定通過設定檔提供了一種資料集儲存的解決方案,協定包括中繼資料以及資料集欄位資訊。 2、中繼資料包含資料描述,子集範圍,資料字典等資訊。 3、資料集欄位包括資料集涵蓋的各類資料檔案的資訊。In a possible implementation manner, the embodiment of the present invention includes: 1. This agreement provides a data set storage solution through the configuration file. The agreement includes metadata and data set field information. 2. Metadata includes data description, subset range, data dictionary and other information. 3. The data set field includes information on various data files covered by the data set.

在一種可能的實現方式中,本發明實施例包括: 每個資料集包含一個設定檔(index.yml),檔中包含了中繼資料資訊(meta),以及資料集中各類資料的資料集欄位資訊(fields)。In a possible implementation manner, the embodiment of the present invention includes: Each data set contains a configuration file (index.yml), which contains metadata information (meta) and data set field information (fields) of various data in the data set.

中繼資料(meta)可以包含多個用於描述資料集的資訊,通常可包括(但不限於)以下欄位: 1、各樣本的標注名稱的清單(label_names),即全部標籤名字的清單; 2、樣本的標注的描述資訊(label_imap),即標籤名字和數位標籤一一對應的字典; 3、各樣本的類型的索引範圍資訊(subsets),即針對機器學習模型,需要對資料集劃分訓練集,測試集和驗證集,包含對應資料的索引範圍。也可以儲存其他形式的資料子集。Metadata (meta) can contain multiple pieces of information used to describe the data set, usually including (but not limited to) the following fields: 1. A list of label names of each sample (label_names), that is, a list of all label names; 2. The description information (label_imap) of the label of the sample, that is, a dictionary of one-to-one correspondence between the label name and the digital label; 3. The index range information (subsets) of each sample type, that is, for the machine learning model, the data set needs to be divided into training set, test set and validation set, including the index range of the corresponding data. Other forms of data subsets can also be stored.

資料集欄位(fields)中包含以下資訊: 1、欄位清單(name),即資料集中該數據的欄位名稱。 2、索引位置(file),即資料所在的檔路徑以及對應的行列範圍。 3、讀取方式資訊(proc),即資料讀取方式(文本,圖像等)以及資料類型。 4、指示資訊(fullonly),即是否支援全部資料一次性讀取。The data set fields (fields) contain the following information: 1. Field list (name), that is, the field name of the data in the data set. 2. Index location (file), that is, the file path where the data is located and the corresponding row and column range. 3. Reading method information (proc), that is, data reading method (text, image, etc.) and data type. 4. Instruction information (fullonly), that is, whether to support reading all data at once.

程式可以根據設定檔的中繼資料和資料集欄位資訊,在對應的檔中提取需要的資訊。The program can extract the required information from the corresponding file based on the metadata and data set field information of the configuration file.

在一種可能的實現方式中,本發明實施例中各類儲存資料檔案包括: 1、csv檔:以表格儲存的資料。通常可包含數值型資料、類別型資料、字元型資料,以及其他資料的路徑等資訊。 2、HDF5檔:整合資料集中所有圖像資料,音頻資料等,為fullonly提供支援。 3、txt檔:儲存字元資料的檔。 4、其他圖影像類檔:根據資料類型的不同(音頻,視頻,圖像等),通常會生成不同的資料檔案(au檔,MP4檔,JPEG檔等)。In a possible implementation manner, the various types of stored data files in the embodiment of the present invention include: 1. csv file: data stored in a table. Usually can include numeric data, categorical data, character data, and other data paths and other information. 2. HDF5 file: Integrate all image data, audio data, etc. in the data set to provide support for fullonly. 3. txt file: a file for storing character data. 4. Other image files: According to different data types (audio, video, image, etc.), different data files (au files, MP4 files, JPEG files, etc.) are usually generated.

相對於現有技術中通常並沒有通用的資料集儲存協定的缺點,本發明實施例使得大多數機器學習資料集可以以更加統一的方式儲存。Compared with the disadvantage that there is no general data set storage protocol in the prior art, the embodiment of the present invention enables most machine learning data sets to be stored in a more uniform manner.

相對於現有技術中通常局限在子集語言環境中進行儲存,本發明實施例可以在不同底層儲存,不受語言環境限制。Compared with the prior art that is generally limited to storage in a subset language environment, the embodiment of the present invention can be stored in different bottom layers without being restricted by the language environment.

綜上,本發明實施例提供了一種將不同儲存方式的資料集合在一起形成資料集的方式,且不受具體程式設計語言和環境的限制。To sum up, the embodiments of the present invention provide a way to gather data of different storage methods together to form a data set, and is not restricted by specific programming languages and environments.

可以理解,本發明實施例提及的上述各個方法實施例,在不違背原理邏輯的情況下,均可以彼此相互結合形成結合後的實施例,限於篇幅,本發明實施例不再贅述。It can be understood that the various method embodiments mentioned in the embodiments of the present invention can be combined with each other to form a combined embodiment without violating the principle and logic. The length is limited, and the embodiments of the present invention will not be repeated.

此外,本發明實施例還提供了儲存和讀取裝置、電子設備、電腦可讀儲存介質、程式,上述均可用來實現本發明實施例提供的任一種儲存和讀取方法,相應技術方案和描述和參見方法部分的相應記載,不再贅述。In addition, the embodiments of the present invention also provide storage and reading devices, electronic equipment, computer-readable storage media, and programs. All of the above can be used to implement any of the storage and reading methods provided in the embodiments of the present invention. The corresponding technical solutions and descriptions And refer to the corresponding records in the method section, so I won’t repeat them here.

本領域技術人員可以理解,在實施方式的上述方法中,各步驟的撰寫順序並不意味著嚴格的執行順序而對實施過程構成任何限定,各步驟的執行順序應當以其功能和可能的內在邏輯確定。Those skilled in the art can understand that in the above-mentioned method of implementation, the writing order of the steps does not mean a strict execution order but constitutes any limitation on the implementation process. The execution order of each step should be based on its function and possible internal logic. Sure.

圖5示出根據本發明實施例的儲存裝置的方塊圖,如圖5所示,所述裝置包括: 第一確定部分11,被配置為根據樣本集中樣本的標注,確定與所述樣本集對應的描述資訊; 第二確定部分12,被配置為根據樣本集中樣本的欄位及儲存位置,確定與所述樣本集對應的欄位資訊; 第三確定部分13,被配置為根據所述描述資訊和所述欄位資訊,確定所述樣本集的設定檔。FIG. 5 shows a block diagram of a storage device according to an embodiment of the present invention. As shown in FIG. 5, the device includes: The first determining part 11 is configured to determine the description information corresponding to the sample set according to the labels of the samples in the sample set; The second determining part 12 is configured to determine the field information corresponding to the sample set according to the fields and storage locations of the samples in the sample set; The third determining part 13 is configured to determine the configuration file of the sample set based on the description information and the field information.

在一種可能的實現方式中,所述描述資訊包括對樣本的標注的描述資訊; 其中,所述第一確定部分被進一步配置為: 根據所述樣本集中樣本的標注,獲得標注清單,所述標注清單包括樣本的標注的類別; 對標注清單中的標注添加描述,獲得所述樣本的標注的描述資訊。In a possible implementation manner, the description information includes description information of the label of the sample; Wherein, the first determining part is further configured as: Obtaining a label list according to the labels of the samples in the sample set, the label list including the label categories of the samples; Add a description to the label in the label list to obtain the description information of the label of the sample.

在一種可能的實現方式中,所述樣本集中包括至少一種資料類型的樣本。In a possible implementation manner, the sample set includes samples of at least one data type.

在一種可能的實現方式中,所述欄位資訊還包括樣本的讀取方式資訊; 其中,所述裝置還包括: 第四確定部分,被配置為根據樣本集中樣本的資料類型,確定用於各資料類型對應的讀取方式; 第一獲得部分,被配置為根據所述樣本的資料類型和對應的讀取方式,獲得所述樣本的讀取方式資訊。In a possible implementation manner, the field information also includes information on how to read the sample; Wherein, the device further includes: The fourth determining part is configured to determine the corresponding reading method for each data type according to the data type of the samples in the sample set; The first obtaining part is configured to obtain the reading mode information of the sample according to the data type of the sample and the corresponding reading mode.

在一種可能的實現方式中,所述第一確定部分被進一步配置為: 確定用於劃分樣本集中樣本的類別的索引範圍資訊; 根據所述樣本集中樣本的描述資訊和所述樣本類別的索引範圍資訊,生成與所述樣本集對應的描述資訊。In a possible implementation manner, the first determining part is further configured to: Determine the index range information used to classify the types of samples in the sample set; According to the description information of the samples in the sample set and the index range information of the sample category, the description information corresponding to the sample set is generated.

在一種可能的實現方式中,所述欄位資訊包括樣本的多個欄位的欄位清單; 其中,所述第二確定部分被進一步配置為: 對所述樣本集中各樣本的欄位進行匯總處理,獲得所述欄位清單。In a possible implementation manner, the field information includes a field list of multiple fields of the sample; Wherein, the second determining part is further configured as: A summary process is performed on the fields of each sample in the sample set to obtain the field list.

在一種可能的實現方式中,所述儲存位置包括所述樣本集的儲存路徑及樣本在所述樣本集中的索引位置。In a possible implementation, the storage location includes a storage path of the sample set and an index position of the sample in the sample set.

在一種可能的實現方式中,所述欄位資訊包括指示是否允許讀取多個樣本的指示資訊。In a possible implementation manner, the field information includes instruction information indicating whether to allow multiple samples to be read.

圖6示出根據本發明實施例的讀取裝置的方塊圖,如圖6所示,所述裝置包括: 第一獲取部分14,被配置為根據與樣本集對應的設定檔,獲取樣本集中目標樣本的儲存位置及目標欄位; 第一讀取部分15,被配置為根據所述儲存位置,讀取所述目標樣本的目標欄位的目標參數值; 其中,所述設定檔基於所述樣本集的描述資訊和樣本的欄位資訊確定。Fig. 6 shows a block diagram of a reading device according to an embodiment of the present invention. As shown in Fig. 6, the device includes: The first obtaining part 14 is configured to obtain the storage location and target field of the target sample in the sample set according to the configuration file corresponding to the sample set; The first reading part 15 is configured to read the target parameter value of the target field of the target sample according to the storage location; Wherein, the configuration file is determined based on the description information of the sample set and the field information of the sample.

在一種可能的實現方式中,所述裝置還包括: 根據所述設定檔,獲取目標樣本的讀取方式。In a possible implementation manner, the device further includes: According to the profile, the reading mode of the target sample is obtained.

在一種可能的實現方式中,所述第一讀取部分被進一步配置為: 根據目標樣本的儲存位置,獲取所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置; 根據所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置,查詢所述目標樣本; 根據所述目標樣本的讀取方式,對目標樣本進行讀取,獲得目標樣本的一個或多個欄位的參數值; 在所述目標樣本的一個或多個欄位的參數值中,確定所述目標參數值。In a possible implementation manner, the first reading part is further configured to: Obtaining the storage path of the sample set and the index position of the target sample in the sample set according to the storage location of the target sample; Query the target sample according to the storage path of the sample set and the index position of the target sample in the sample set; According to the reading method of the target sample, the target sample is read to obtain the parameter value of one or more fields of the target sample; Determine the target parameter value among the parameter values of one or more fields of the target sample.

在一種可能的實現方式中,所述第一讀取部分被進一步配置為: 根據目標樣本的儲存位置,獲取所述樣本集的儲存路徑及目標樣本在樣本集中的索引位置; 根據所述樣本集的儲存路徑及所述目標欄位,獲取樣本集中多個樣本的目標欄位的參數值的儲存位置; 根據目標樣本在樣本集中的索引位置,在所述多個樣本的目標欄位的參數值的儲存位置中,確定目標樣本的目標欄位的參數值的儲存位置; 根據所述目標樣本的讀取方式,在所述目標樣本的目標欄位的參數值的儲存位置中讀取所述目標參數值。In a possible implementation manner, the first reading part is further configured to: Obtaining the storage path of the sample set and the index position of the target sample in the sample set according to the storage location of the target sample; Acquiring, according to the storage path of the sample set and the target field, the storage locations of the parameter values of the target fields of the multiple samples in the sample set; According to the index position of the target sample in the sample set, among the storage positions of the parameter values of the target field of the multiple samples, determine the storage position of the parameter value of the target field of the target sample; According to the reading mode of the target sample, the target parameter value is read in the storage location of the parameter value of the target field of the target sample.

在一種可能的實現方式中,所述設定檔包括指示是否允許讀取多個樣本的指示資訊; 所述第一讀取部分被進一步配置為: 獲取所述目標樣本預設的讀取模式; 根據所述預設的讀取模式以及所述指示資訊,在所述目標樣本的目標欄位的參數值的儲存位置中讀取所述目標參數值。In a possible implementation manner, the configuration file includes instruction information indicating whether to allow multiple samples to be read; The first reading part is further configured to: Acquiring the preset reading mode of the target sample; According to the preset reading mode and the instruction information, the target parameter value is read in the storage location of the parameter value of the target field of the target sample.

在一種可能的實現方式中,所述第一讀取部分被進一步配置為: 在所述預設的讀取模式與所述指示資訊不匹配的情況下,使用所述指示資訊對應的讀取方式,讀取所述目標樣本的目標欄位的參數值。In a possible implementation manner, the first reading part is further configured to: In the case that the preset reading mode does not match the instruction information, the reading method corresponding to the instruction information is used to read the parameter value of the target field of the target sample.

在一些實施例中,本發明實施例提供的裝置具有的功能或包含的部分可以用於執行上文方法實施例描述的方法,其實現可以參照上文方法實施例的描述,為了簡潔,這裡不再贅述。In some embodiments, the functions or parts included in the apparatus provided by the embodiments of the present invention can be used to execute the methods described in the above method embodiments. For implementation, refer to the description of the above method embodiments. For brevity, this is not Go into details again.

本發明實施例還提出一種電腦可讀儲存介質,其上儲存有電腦程式指令,所述電腦程式指令被處理器執行的情況下實現上述方法。電腦可讀儲存介質可以是易失性電腦可讀儲存介質或非易失性電腦可讀儲存介質。An embodiment of the present invention also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions are executed by a processor to implement the above method. The computer-readable storage medium may be a volatile computer-readable storage medium or a non-volatile computer-readable storage medium.

本發明實施例還提出一種電子設備,包括:處理器;被配置為儲存處理器可執行指令的記憶體;其中,所述處理器被配置為上述方法。An embodiment of the present invention also provides an electronic device, including: a processor; a memory configured to store executable instructions of the processor; wherein the processor is configured as the aforementioned method.

電子設備可以被提供為終端、伺服器或其它形態的設備。Electronic devices can be provided as terminals, servers, or other types of devices.

圖7是根據一示例性實施例示出的一種電子設備800的方塊圖。例如,電子設備800可以是行動電話,電腦,數位廣播終端,消息收發設備,遊戲控制台,平板設備,醫療設備,健身設備,個人數位助理等終端。Fig. 7 is a block diagram showing an electronic device 800 according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and other terminals.

參照圖7,電子設備800可以包括以下一個或多個組件:處理組件802,記憶體804,電源組件806,多媒體組件808,音頻組件810,輸入/輸出(Input/Output,I/ O)介面812,感測器組件814,以及通信組件816。7, the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, and an input/output (Input/Output, I/O) interface 812 , The sensor component 814, and the communication component 816.

處理組件802通常控制電子設備800的整體操作,諸如與顯示,電話呼叫,資料通信,相機操作和記錄操作相關聯的操作。處理組件802可以包括一個或多個處理器820來執行指令,以完成上述的方法的全部或部分步驟。此外,處理組件802可以包括一個或多個部分,便於處理組件802和其他組件之間的交互。例如,處理組件802可以包括多媒體部分,以方便多媒體組件808和處理組件802之間的交互。The processing component 802 generally controls the overall operations of the electronic device 800, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the foregoing method. In addition, the processing component 802 may include one or more parts to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia part to facilitate the interaction between the multimedia component 808 and the processing component 802.

記憶體804被配置為儲存各種類型的資料以支援在電子設備800的操作。這些資料的示例包括被配置為在電子設備800上操作的任何應用程式或方法的指令,連絡人資料,電話簿資料,消息,圖片,視頻等。記憶體804可以由任何類型的易失性或非易失性存放裝置或者它們的組合實現,如靜態隨機存取記憶體(Static Random-Access Memory,SRAM),電可擦除可程式設計唯讀記憶體(Electrically Erasable Programmable read only memory,EEPROM),可擦除可程式設計唯讀記憶體(Erasable Programmable Read-Only Memory,EPROM),可程式設計唯讀記憶體(Programmable Read-Only Memory,PROM),唯讀記憶體(Read-Only Memory,ROM),磁記憶體,快閃記憶體,磁片或光碟。The memory 804 is configured to store various types of data to support the operation of the electronic device 800. Examples of such data include instructions of any application or method configured to operate on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be realized by any type of volatile or non-volatile storage device or their combination, such as static random-access memory (Static Random-Access Memory, SRAM), electrically erasable, programmable read-only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM) , Read-Only Memory (Read-Only Memory, ROM), magnetic memory, flash memory, floppy disk or CD-ROM.

電源組件806為電子設備800的各種組件提供電力。電源組件806可以包括電源管理系統,一個或多個電源,及其他與為電子設備800生成、管理和分配電力相關聯的組件。The power supply component 806 provides power for various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with the generation, management, and distribution of power for the electronic device 800.

多媒體組件808包括在所述電子設備800和使用者之間的提供一個輸出介面的螢幕。在一些實施例中,螢幕可以包括液晶顯示器(Liquid Crystal Display,LCD)和觸摸面板(Touch panel,TP)。如果螢幕包括觸摸面板,螢幕可以被實現為觸控式螢幕,以接收來自使用者的輸入信號。觸摸面板包括一個或多個觸摸感測器以感測觸摸、滑動和觸摸面板上的手勢。所述觸摸感測器可以不僅感測觸摸或滑動動作的邊界,而且還檢測與所述觸摸或滑動操作相關的持續時間和壓力。在一些實施例中,多媒體組件808包括一個前置攝影頭和/或後置攝影頭。當電子設備800處於操作模式,如拍攝模式或視訊模式的情況下,前置攝影頭和/或後置攝影頭可以接收外部的多媒體資料。每個前置攝影頭和後置攝影頭可以是一個固定的光學透鏡系統或具有焦距和光學變焦能力。The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or sliding action, but also detect the duration and pressure related to the touch or sliding operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.

音頻組件810被配置為輸出和/或輸入音頻信號。例如,音頻組件810包括一個麥克風(microphone,MIC),當電子設備800處於操作模式,如呼叫模式、記錄模式和語音辨識模式的情況下,麥克風被配置為接收外部音頻信號。所接收的音頻信號可以被進一步儲存在記憶體804或經由通信組件816發送。在一些實施例中,音頻組件810還包括一個揚聲器,被配置為輸出音頻信號。The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a microphone (MIC). When the electronic device 800 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive external audio signals. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 further includes a speaker configured to output audio signals.

I/ O介面812為處理組件802和週邊介面部分之間提供介面,上述週邊介面部分可以是鍵盤,點擊輪,按鈕等。這些按鈕可包括但不限於:主頁按鈕、音量按鈕、啟動按鈕和鎖定按鈕。The I/O interface 812 provides an interface between the processing component 802 and the peripheral interface part. The peripheral interface part may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: home button, volume button, start button, and lock button.

感測器組件814包括一個或多個感測器,被配置為電子設備800提供各個方面的狀態評估。例如,感測器組件814可以檢測到電子設備800的打開/關閉狀態,組件的相對定位,例如所述組件為電子設備800的顯示器和小鍵盤,感測器組件814還可以檢測電子設備800或電子設備800一個組件的位置改變,使用者與電子設備800接觸的存在或不存在,電子設備800方位或加速/減速和電子設備800的溫度變化。感測器組件814可以包括接近感測器,被配置用來在沒有任何的物理接觸的情況下檢測附近物體的存在。感測器組件814還可以包括光感測器,如CMOS(Complementary Metal Oxide Semiconductor,互補金屬氧化物半導體)或CCD(Charge-coupled Device,電荷耦合組件)圖像感測器,被配置為在成像應用中使用。在一些實施例中,該感測器組件814還可以包括加速度感測器,陀螺儀感測器,磁感測器,壓力感測器或溫度感測器。The sensor component 814 includes one or more sensors, and is configured to provide the electronic device 800 with various aspects of state assessment. For example, the sensor component 814 can detect the on/off state of the electronic device 800 and the relative positioning of the components. For example, the component is the display and the keypad of the electronic device 800. The sensor component 814 can also detect the electronic device 800 or The position of a component of the electronic device 800 changes, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration/deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 814 may also include a light sensor, such as a CMOS (Complementary Metal Oxide Semiconductor) or CCD (Charge-coupled Device) image sensor, which is configured to perform imaging Used in the application. In some embodiments, the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.

通信組件816被配置為便於電子設備800和其他設備之間有線或無線方式的通信。電子設備800可以接入基於通信標準的無線網路,如Wi-Fi,2G(2-Generation wireless telephone technology,第二代移動通信技術)或3G(3-Generation wireless telephone technology,第三代移動通信技術),或它們的組合。在一個示例性實施例中,通信組件816經由廣播通道接收來自外部廣播管理系統的廣播信號或廣播相關資訊。在一個示例性實施例中,所述通信組件816還包括近場通信(Near Field Communication,NFC)部分,以促進短程通信。例如,在NFC部分可基於射頻識別(Radio Frequency Identification,RFID)技術,紅外資料協會(Infrared Data Association,IrDA)技術,超寬頻(Ultra Wide Band,UWB)技術,藍牙(Bluetooth,BT)技術和其他技術來實現。The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access wireless networks based on communication standards, such as Wi-Fi, 2G (2-Generation wireless telephone technology, second-generation mobile communication technology) or 3G (3-Generation wireless telephone technology, third-generation mobile communication) Technology), or a combination of them. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) part to facilitate short-range communication. For example, the NFC part can be based on radio frequency identification (Radio Frequency Identification, RFID) technology, infrared data association (Infrared Data Association, IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (Bluetooth, BT) technology and other Technology to achieve.

在示例性實施例中,電子設備800可以被一個或多個應用專用積體電路(Application Specific Integrated Circuit,ASIC)、數位訊號處理器(Digital Signal Processing,DSP)、數位信號處理設備(Digital signal processing device,DSPD)、可程式設計邏輯器件(programmable logic device,PLD)、現場可程式設計閘陣列(Field Programmable Gate Array,FPGA)、控制器、微控制器、微處理器或其他電子組件實現,用於執行上述方法。In an exemplary embodiment, the electronic device 800 may be used by one or more application specific integrated circuits (Application Specific Integrated Circuit, ASIC), digital signal processing (Digital Signal Processing, DSP), and digital signal processing equipment (Digital Signal Processing). device, DSPD), programmable logic device (programmable logic device, PLD), field programmable gate array (Field Programmable Gate Array, FPGA), controller, microcontroller, microprocessor or other electronic components to achieve于Execute the above method.

在示例性實施例中,還提供了一種電腦可讀儲存介質,例如包括電腦程式指令的記憶體804,上述電腦程式指令可由電子設備800的處理器820執行以完成上述方法。In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to complete the above method.

本發明實施例還提供了一種電腦程式產品,包括電腦可讀代碼,當電腦可讀代碼在設備上運行的情況下,設備中的處理器執行用於實現如上任一實施例提供的方法的指令。The embodiment of the present invention also provides a computer program product, including computer readable code. When the computer readable code runs on the device, the processor in the device executes instructions for implementing the method provided in any of the above embodiments. .

該電腦程式產品可以通過硬體、軟體或其結合的方式實現。在一個可選實施例中,所述電腦程式產品體現為電腦儲存介質,在另一個可選實施例中,電腦程式產品體現為軟體產品,例如軟體發展包(Software Development Kit,SDK)等等。The computer program product can be realized through hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium. In another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and so on.

圖8是根據一示例性實施例示出的一種電子設備1900的方塊圖。例如,電子設備1900可以被提供為一伺服器。參照圖8,電子設備1900包括處理組件1922,其進一步包括一個或多個處理器,以及由記憶體1932所代表的記憶體資源,被配置為儲存可由處理組件1922的執行的指令,例如應用程式。記憶體1932中儲存的應用程式可以包括一個或一個以上的每一個對應於一組指令的部分。此外,處理組件1922被配置為執行指令,以執行上述方法。Fig. 8 is a block diagram showing an electronic device 1900 according to an exemplary embodiment. For example, the electronic device 1900 may be provided as a server. 8, the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932, configured to store instructions that can be executed by the processing component 1922, such as an application program . The application program stored in the memory 1932 may include one or more parts each corresponding to a set of commands. In addition, the processing component 1922 is configured to execute instructions to perform the above-described methods.

電子設備1900還可以包括一個電源組件1926被配置為執行電子設備1900的電源管理,一個有線或無線網路介面1950被配置為將電子設備1900連接到網路,和一個輸入輸出(I/O)介面1958。電子設備1900可以操作基於儲存在記憶體1932的作業系統,例如Windows ServerTM,Mac OS XTM,UnixTM, LinuxTM,FreeBSDTM或類似。The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input and output (I/O) Interface 1958. The electronic device 1900 can operate based on an operating system stored in the memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.

在示例性實施例中,還提供了一種非易失性電腦可讀儲存介質,例如包括電腦程式指令的記憶體1932,上述電腦程式指令可由電子設備1900的處理組件1922執行以完成上述方法。In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to complete the above method.

本發明實施例可以是系統、方法和/或電腦程式產品。電腦程式產品可以包括電腦可讀儲存介質,其上載有用於使處理器實現本發明實施例的各個方面的電腦可讀程式指令。The embodiments of the present invention may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium loaded with computer-readable program instructions for enabling the processor to implement various aspects of the embodiments of the present invention.

電腦可讀儲存介質可以是可以保持和儲存由指令執行設備使用的指令的有形設備。電腦可讀儲存介質例如可以但不限於是電存放裝置、磁存放裝置、光存放裝置、電磁存放裝置、半導體存放裝置或者上述的任意合適的組合。電腦可讀儲存介質的例子(非窮舉的清單)包括:可擕式電腦盤、硬碟、隨機存取記憶體(Random Access Memory,RAM)、唯讀記憶體(Read Only Memory,ROM)、可擦式可程式設計唯讀記憶體(Electrical Programmable Read Only Memory,EPROM或快閃記憶體)、靜態隨機存取記憶體(Static Random Access Memory,SRAM)、可擕式壓縮磁碟唯讀記憶體(Compact Disc Read-Only Memory,CD-ROM)、數位多功能盤(Digital Video Disc,DVD)、記憶棒、軟碟、機械編碼設備、例如其上儲存有指令的打孔卡或凹槽內凸起結構、以及上述的任意合適的組合。這裡所使用的電腦可讀儲存介質不被解釋為暫態信號本身,諸如無線電波或者其他自由傳播的電磁波、通過波導或其他傳輸媒介傳播的電磁波(例如,通過光纖電纜的光脈衝)、或者通過電線傳輸的電信號。The computer-readable storage medium may be a tangible device that can hold and store instructions used by the instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. Examples of computer-readable storage media (non-exhaustive list) include: portable computer disks, hard disks, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), Erasable programmable read-only memory (Electrical Programmable Read Only Memory, EPROM or flash memory), static random access memory (Static Random Access Memory, SRAM), portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), Digital Video Disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punched cards with instructions stored on them or convex grooves From the structure, and any suitable combination of the above. The computer-readable storage medium used here is not interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (for example, light pulses through fiber optic cables), or passing through Electrical signals transmitted by wires.

這裡所描述的電腦可讀程式指令可以從電腦可讀儲存介質下載到各個計算/處理設備,或者通過網路、例如網際網路、局域網、廣域網路和/或無線網下載到外部電腦或外部存放裝置。網路可以包括銅傳輸電纜、光纖傳輸、無線傳輸、路由器、防火牆、交換機、閘道電腦和/或邊緣伺服器。每個計算/處理設備中的網路介面卡或者網路介面從網路接收電腦可讀程式指令,並轉發該電腦可讀程式指令,以供儲存在各個計算/處理設備中的電腦可讀儲存介質中。The computer-readable program instructions described here can be downloaded from a computer-readable storage medium to various computing/processing devices, or downloaded to an external computer or external storage via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network Device. The network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. The network interface card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for computer-readable storage in each computing/processing device Medium.

用於執行本發明實施例操作的電腦程式指令可以是彙編指令、指令集架構(Industry Standard Architecture,ISA)指令、機器指令、機器相關指令、微代碼、固件指令、狀態設置資料、或者以一種或多種程式設計語言的任意組合編寫的原始程式碼或目標代碼,所述程式設計語言包括物件導向的程式設計語言—諸如Smalltalk、C++等,以及常規的過程式程式設計語言—諸如“C”語言或類似的程式設計語言。電腦可讀程式指令可以完全地在使用者電腦上執行、部分地在使用者電腦上執行、作為一個獨立的套裝軟體執行、部分在使用者電腦上部分在遠端電腦上執行、或者完全在遠端電腦或伺服器上執行。在涉及遠端電腦的情形中,遠端電腦可以通過任意種類的網路—包括局域網(local area network,LAN)或廣域網路(Wide Area Network,WAN)—連接到使用者電腦,或者,可以連接到外部電腦(例如利用網際網路服務提供者來通過網際網路連接)。在一些實施例中,通過利用電腦可讀程式指令的狀態資訊來個性化定制電子電路,例如可程式設計邏輯電路、現場可程式設計閘陣列(FPGA)或可程式設計邏輯陣列(programmable logic array,PLA),該電子電路可以執行電腦可讀程式指令,從而實現本發明實施例的各個方面。The computer program instructions used to perform the operations of the embodiments of the present invention may be assembly instructions, instruction set architecture (Industry Standard Architecture, ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, or one or more Source code or object code written in any combination of multiple programming languages, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages—such as "C" language or Similar programming language. Computer-readable program instructions can be executed entirely on the user's computer, partly on the user's computer, executed as a stand-alone software package, partly on the user's computer and partly executed on a remote computer, or completely remotely executed. Run on the end computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network-including local area network (LAN) or wide area network (Wide Area Network, WAN)-or, it can be connected To an external computer (for example, using an Internet service provider to connect via the Internet). In some embodiments, the electronic circuit is personalized by using the status information of computer-readable program instructions, such as programmable logic circuit, field programmable gate array (FPGA), or programmable logic array (programmable logic array, PLA), the electronic circuit can execute computer-readable program instructions to realize various aspects of the embodiments of the present invention.

這裡參照根據本發明實施例的方法、裝置(系統)和電腦程式產品的流程圖和/或方塊圖描述了本發明實施例的各個方面。應當理解,流程圖和/或方塊圖的每個方塊以及流程圖和/或方塊圖中各方塊的組合,都可以由電腦可讀程式指令實現。Here, various aspects of the embodiments of the present invention are described with reference to the flowcharts and/or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present invention. It should be understood that each block of the flowchart and/or block diagram and the combination of each block in the flowchart and/or block diagram can be implemented by computer-readable program instructions.

這些電腦可讀程式指令可以提供給通用電腦、專用電腦或其它可程式設計資料處理裝置的處理器,從而生產出一種機器,使得這些指令在通過電腦或其它可程式設計資料處理裝置的處理器執行的情況下,產生了實現流程圖和/或方塊圖中的一個或多個方塊中規定的功能/動作的裝置。也可以把這些電腦可讀程式指令儲存在電腦可讀儲存介質中,這些指令使得電腦、可程式設計資料處理裝置和/或其他設備以特定方式工作,從而,儲存有指令的電腦可讀介質則包括一個製造品,其包括實現流程圖和/或方塊圖中的一個或多個方塊中規定的功能/動作的各個方面的指令。These computer-readable program instructions can be provided to the processors of general-purpose computers, special-purpose computers, or other programmable data processing devices, thereby producing a machine that allows these instructions to be executed by the processors of the computer or other programmable data processing devices In the case of, a device that implements the functions/actions specified in one or more blocks in the flowchart and/or block diagram is produced. It is also possible to store these computer-readable program instructions in a computer-readable storage medium. These instructions make the computer, programmable data processing device and/or other equipment work in a specific manner, so that the computer-readable medium storing the instructions is It includes an article of manufacture, which includes instructions for implementing various aspects of the functions/actions specified in one or more blocks in the flowchart and/or block diagram.

也可以把電腦可讀程式指令載入到電腦、其它可程式設計資料處理裝置、或其它設備上,使得在電腦、其它可程式設計資料處理裝置或其它設備上執行一系列操作步驟,以產生電腦實現的過程,從而使得在電腦、其它可程式設計資料處理裝置、或其它設備上執行的指令實現流程圖和/或方塊圖中的一個或多個方塊中規定的功能/動作。It is also possible to load computer-readable program instructions into a computer, other programmable data processing device, or other equipment, so that a series of operation steps are executed on the computer, other programmable data processing device, or other equipment to generate a computer The process of implementation enables instructions executed on a computer, other programmable data processing device, or other equipment to implement the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.

附圖中的流程圖和方塊圖顯示了根據本發明實施例的多個實施例的系統、方法和電腦程式產品的可能實現的體系架構、功能和操作。在這點上,流程圖或方塊圖中的每個方塊可以代表一個模組、程式段或指令的一部分,所述模組、程式段或指令的一部分包含一個或多個用於實現規定的邏輯功能的可執行指令。在有些作為替換的實現中,方塊中所標注的功能也可以以不同於附圖中所標注的順序發生。例如,兩個連續的方塊實際上可以基本並行地執行,它們有時也可以按相反的循序執行,這依所涉及的功能而定。也要注意的是,方塊圖和/或流程圖中的每個方塊、以及方塊圖和/或流程圖中的方塊的組合,可以用執行規定的功能或動作的專用的基於硬體的系統來實現,或者可以用專用硬體與電腦指令的組合來實現。The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions, and operations of systems, methods, and computer program products according to multiple embodiments of the embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, program segment, or part of an instruction, and the module, program segment, or part of an instruction includes one or more logic for implementing the specified Executable instructions for the function. In some alternative implementations, the functions marked in the block may also occur in a different order than the order marked in the drawings. For example, two consecutive blocks can actually be executed basically in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and/or flowchart, and the combination of blocks in the block diagram and/or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions. It can be realized, or it can be realized by a combination of dedicated hardware and computer instructions.

以上已經描述了本發明的各實施例,上述說明是示例性的,並非窮盡性的,並且也不限於所披露的各實施例。在不偏離所說明的各實施例的範圍和精神的情況下,對於本技術領域的普通技術人員來說許多修改和變更都是顯而易見的。本文中所用術語的選擇,旨在最好地解釋各實施例的原理、實際應用或對市場中的技術改進,或者使本技術領域的其它普通技術人員能理解本文披露的各實施例。The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Without departing from the scope and spirit of the illustrated embodiments, many modifications and changes are obvious to those of ordinary skill in the art. The choice of terms used herein is intended to best explain the principles, practical applications, or technical improvements in the market of the various embodiments, or to enable other ordinary skilled in the art to understand the various embodiments disclosed herein.

11:第一確定部分 12:第二確定部分 13:第三確定部分 14:第一獲取部分 15:第一讀取部分 800:電子設備 802:處理組件 804:記憶體 806:電源組件 808:多媒體組件 810:音頻組件 812:輸入/輸出介面 814:感測器組件 816:通信組件 820:處理器 1900:電子設備 1922:處理組件 1926:電源組件 1932:記憶體 1950:網路介面 1958:輸入輸出介面 S11~S15:步驟11: The first determination part 12: The second certain part 13: The third determination part 14: The first acquisition part 15: The first reading part 800: electronic equipment 802: Processing component 804: memory 806: Power Components 808: Multimedia components 810: Audio component 812: input/output interface 814: Sensor component 816: Communication Components 820: processor 1900: electronic equipment 1922: processing components 1926: power supply components 1932: memory 1950: network interface 1958: Input and output interface S11~S15: steps

此處的附圖被併入說明書中並構成本說明書的一部分,這些附圖示出了符合本發明的實施例,並與說明書一起用於說明本發明實施例的技術方案。 圖1示出根據本發明實施例的儲存方法的流程圖; 圖2示出根據本發明實施例的清單的示意圖; 圖3示出根據本發明實施例的讀取方法的流程圖; 圖4示出根據本發明實施例的讀取方法的應用示意圖; 圖5示出根據本發明實施例的儲存裝置的方塊圖; 圖6示出根據本發明實施例的讀取裝置的方塊圖; 圖7示出根據本發明實施例的電子裝置的方塊圖; 圖8示出根據本發明實施例的電子裝置的方塊圖。The drawings here are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments in accordance with the present invention, and are used together with the specification to illustrate the technical solutions of the embodiments of the present invention. Fig. 1 shows a flowchart of a storage method according to an embodiment of the present invention; Figure 2 shows a schematic diagram of a list according to an embodiment of the present invention; Fig. 3 shows a flowchart of a reading method according to an embodiment of the present invention; FIG. 4 shows a schematic diagram of the application of the reading method according to an embodiment of the present invention; Figure 5 shows a block diagram of a storage device according to an embodiment of the present invention; Fig. 6 shows a block diagram of a reading device according to an embodiment of the present invention; FIG. 7 shows a block diagram of an electronic device according to an embodiment of the present invention; Fig. 8 shows a block diagram of an electronic device according to an embodiment of the present invention.

S11~S13:步驟S11~S13: steps

Claims (16)

一種儲存方法,包括:根據樣本集中樣本的標注,確定與所述樣本集對應的描述資訊;根據所述樣本集中樣本的欄位及儲存位置,確定與所述樣本集對應的欄位資訊;根據所述描述資訊和所述欄位資訊,確定所述樣本集的設定檔。 A storage method includes: determining the description information corresponding to the sample set according to the labels of the samples in the sample set; determining the field information corresponding to the sample set according to the fields and storage locations of the samples in the sample set; The description information and the field information determine the configuration file of the sample set. 根據請求項1所述的方法,其中,所述描述資訊包括對樣本的標注的描述資訊;其中,根據樣本集中樣本的標注,確定與所述樣本集對應的描述資訊,包括:根據所述樣本集中樣本的標注,獲得標注清單,所述標注清單包括樣本的標注的類別;對標注清單中的標注添加描述,獲得所述樣本的標注的描述資訊。 The method according to claim 1, wherein the description information includes the description information of the label of the sample; wherein, determining the description information corresponding to the sample set according to the label of the sample in the sample set includes: according to the sample Collect the labels of the samples to obtain a label list, which includes the label categories of the samples; add a description to the labels in the label list to obtain the description information of the labels of the sample. 根據請求項1或2所述的方法,其中,所述樣本集中包括至少一種資料類型的樣本。 The method according to claim 1 or 2, wherein the sample set includes samples of at least one data type. 根據請求項3所述的方法,其中,所述欄位資訊還包括樣本的讀取方式資訊:其中,所述方法還包括:根據樣本集中樣本的資料類型,確定用於各資料類型對應的讀取方式;根據所述樣本的資料類型和對應的讀取方式,獲得所述 樣本的讀取方式資訊。 The method according to claim 3, wherein the field information further includes sample reading method information: wherein, the method further includes: determining the corresponding reading method for each data type according to the data type of the sample in the sample set Acquisition method; according to the data type of the sample and the corresponding reading method, the Information on how to read the sample. 根據請求項1或2所述的方法,其中,所述根據樣本集中樣本的標注,確定與所述樣本集對應的描述資訊,還包括:確定用於劃分樣本集中樣本的類別的索引範圍資訊;根據所述樣本集中樣本的描述資訊和所述樣本類別的索引範圍資訊,生成與所述樣本集對應的描述資訊。 The method according to claim 1 or 2, wherein the determining the description information corresponding to the sample set according to the labels of the samples in the sample set further includes: determining index range information used to classify the samples in the sample set; According to the description information of the samples in the sample set and the index range information of the sample category, the description information corresponding to the sample set is generated. 根據請求項1或2所述的方法,其中,所述欄位資訊包括樣本的多個欄位的欄位清單;其中,根據樣本集中樣本的欄位及儲存位置,確定與所述樣本集對應的欄位資訊,包括:對所述樣本集中多個樣本的欄位進行匯總處理,獲得所述欄位清單。 The method according to claim 1 or 2, wherein the field information includes a field list of multiple fields of the sample; wherein, according to the field and storage location of the sample in the sample set, it is determined to correspond to the sample set The field information of includes: summarizing the fields of multiple samples in the sample set to obtain the field list. 根據請求項1或2所述的方法,其中,所述儲存位置包括所述樣本集的儲存路徑及樣本在所述樣本集中的索引位置。 The method according to claim 1 or 2, wherein the storage location includes a storage path of the sample set and an index position of the sample in the sample set. 根據請求項1或2所述的方法,其中,所述欄位資訊包括指示是否允許讀取多個樣本的指示資訊。 The method according to claim 1 or 2, wherein the field information includes instruction information indicating whether to allow multiple samples to be read. 一種讀取方法,包括:根據與樣本集對應的設定檔,獲取樣本集中目標樣本的儲存位置及目標欄位;根據所述儲存位置,讀取所述目標樣本的所述目標欄位的目標參數值;其中,所述設定檔基於所述樣本集的描述資訊和欄位資 訊確定。 A reading method includes: obtaining the storage location and target field of a target sample in the sample set according to a configuration file corresponding to the sample set; and reading the target parameter of the target field of the target sample according to the storage location Value; wherein the configuration file is based on the description information and field data of the sample set News is confirmed. 根據請求項9所述的方法,還包括:根據所述設定檔,獲取所述目標樣本的讀取方式。 The method according to claim 9, further comprising: obtaining a reading mode of the target sample according to the configuration file. 根據請求項10所述的方法,其中,根據所述儲存位置,讀取所述目標樣本的所述目標欄位的目標參數值,包括:根據所述目標樣本的儲存位置,獲取所述樣本集的儲存路徑及所述目標樣本在樣本集中的索引位置;根據所述樣本集的儲存路徑及所述目標樣本在樣本集中的索引位置,查詢所述目標樣本;根據所述目標樣本的讀取方式,對所述目標樣本進行讀取,獲得所述目標樣本的一個或多個欄位的參數值;在所述目標樣本的一個或多個欄位的參數值中,確定所述目標參數值。 The method according to claim 10, wherein, according to the storage location, reading the target parameter value of the target field of the target sample includes: obtaining the sample set according to the storage location of the target sample According to the storage path of the sample set and the index position of the target sample in the sample set; query the target sample according to the storage path of the sample set and the index position of the target sample in the sample set; according to the reading method of the target sample , Reading the target sample to obtain parameter values of one or more fields of the target sample; determining the target parameter value among the parameter values of one or more fields of the target sample. 根據請求項10所述的方法,其中,根據所述儲存位置,讀取所述目標樣本的所述目標欄位的目標參數值,包括:根據所述目標樣本的儲存位置,獲取所述樣本集的儲存路徑及所述目標樣本在樣本集中的索引位置;根據所述樣本集的儲存路徑及所述目標欄位,獲取樣本集中多個樣本的所述目標欄位的參數值的儲存位置;根據所述目標樣本在樣本集中的索引位置,在所述多個樣本的所述目標欄位的參數值的儲存位置中,確定所述目標樣本的所述目標欄位的參數值的儲存位置; 根據所述目標樣本的讀取方式,在所述目標樣本的所述目標欄位的參數值的儲存位置中讀取所述目標參數值。 The method according to claim 10, wherein, according to the storage location, reading the target parameter value of the target field of the target sample includes: obtaining the sample set according to the storage location of the target sample According to the storage path of the sample set and the index position of the target sample in the sample set; according to the storage path of the sample set and the target field, obtain the storage location of the parameter value of the target field of the multiple samples in the sample set; according to The index position of the target sample in the sample set, among the storage positions of the parameter values of the target field of the multiple samples, determine the storage position of the parameter values of the target field of the target sample; According to the reading mode of the target sample, the target parameter value is read in the storage location of the parameter value of the target field of the target sample. 根據請求項9至12任一項所述的方法,其中,所述設定檔包括指示是否允許讀取多個樣本的指示資訊;根據所述儲存位置,讀取所述目標樣本的所述目標欄位的目標參數值,包括:獲取所述目標樣本預設的讀取模式;根據所述預設的讀取模式以及所述指示資訊,在所述目標樣本的所述目標欄位的參數值的儲存位置中讀取所述目標參數值。 The method according to any one of claims 9 to 12, wherein the configuration file includes instruction information indicating whether to allow reading of multiple samples; according to the storage location, the target column of the target sample is read The target parameter value of the target sample includes: obtaining the preset reading mode of the target sample; according to the preset reading mode and the indication information, the parameter value in the target field of the target sample The target parameter value is read from the storage location. 根據請求項13所述的方法,其中,所述根據所述預設的讀取模式以及所述指示資訊,在所述目標樣本的所述目標欄位的參數值的儲存位置中讀取所述目標參數值,包括:在所述預設的讀取模式與所述指示資訊不匹配的情況下,使用所述指示資訊對應的讀取方式,讀取所述目標樣本的所述目標欄位的參數值。 The method according to claim 13, wherein, according to the preset reading mode and the instruction information, the target sample is read in the storage location of the parameter value of the target field The target parameter value includes: in the case where the preset reading mode does not match the indication information, using the reading method corresponding to the indication information to read the target field of the target sample The parameter value. 一種電子設備,包括:處理器;用於儲存處理器可執行指令的記憶體;其中,所述處理器被配置為調用所述記憶體儲存的指令,以執行請求項1至6中任意一項所述的方法。 An electronic device comprising: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to call the instructions stored in the memory to execute any one of request items 1 to 6 The method described. 一種電腦可讀儲存介質,其上儲存有電腦程 式指令,所述電腦程式指令被處理器執行時實現請求項1至14中任意一項所述的方法。 A computer-readable storage medium on which a computer program is stored Formula instructions, when the computer program instructions are executed by the processor, the method described in any one of request items 1 to 14 is implemented.
TW109135770A 2019-10-28 2020-10-15 Storage and reading method, electronic equipment and computer-readable storage medium TWI739633B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911031019.1 2019-10-28
CN201911031019.1A CN110765111B (en) 2019-10-28 2019-10-28 Storage and reading method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
TW202117565A TW202117565A (en) 2021-05-01
TWI739633B true TWI739633B (en) 2021-09-11

Family

ID=69334163

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109135770A TWI739633B (en) 2019-10-28 2020-10-15 Storage and reading method, electronic equipment and computer-readable storage medium

Country Status (5)

Country Link
JP (1) JP2022510643A (en)
KR (1) KR20210089242A (en)
CN (1) CN110765111B (en)
TW (1) TWI739633B (en)
WO (1) WO2021082461A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765111B (en) * 2019-10-28 2023-03-31 深圳市商汤科技有限公司 Storage and reading method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7836012B1 (en) * 2002-12-09 2010-11-16 Google Inc. Systems and methods for information extraction
TW201842478A (en) * 2017-04-28 2018-12-01 美商英特爾股份有限公司 Compute optimizations for low precision machine learning operations
TW201909007A (en) * 2017-07-10 2019-03-01 美商高通公司 Processing media data using a common descriptor for one of the file format logic boxes
TW201915837A (en) * 2017-10-12 2019-04-16 英屬開曼群島商意騰科技股份有限公司 Local learning system in artificial intelligence device
TW201931104A (en) * 2017-10-20 2019-08-01 英商葛夫科有限公司 Generating randomness in neural networks

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2003900854A0 (en) * 2003-02-26 2003-03-13 Sesay, Sahid General purpose electronic controller software
US7685380B1 (en) * 2005-06-29 2010-03-23 Xilinx, Inc. Method for using configuration memory for data storage and read operations
CN100521623C (en) * 2007-05-22 2009-07-29 网御神州科技(北京)有限公司 High-performance Syslog processing and storage method
JP2010003029A (en) * 2008-06-19 2010-01-07 Dainippon Printing Co Ltd Effect analyzing method and effect analyzing system
CN102567361A (en) * 2010-12-23 2012-07-11 金蝶软件(中国)有限公司 Data table layering summarizing method and data table layering summarizing device
US20130246336A1 (en) * 2011-12-27 2013-09-19 Mcafee, Inc. System and method for providing data protection workflows in a network environment
CN103294714B (en) * 2012-02-28 2016-04-27 阿里巴巴集团控股有限公司 The defining method of the memory location of the field attribute value of index field and device
EP2909747B1 (en) * 2012-10-22 2019-11-27 Ab Initio Technology LLC Characterizing data sources in a data storage system
CN104102652B (en) * 2013-04-08 2017-05-24 国家电网公司 Unstructured data storage system and method
US9116901B2 (en) * 2013-05-23 2015-08-25 Oracle International Corporation Database snapshot analysis
CN104346358B (en) * 2013-07-29 2018-11-23 腾讯科技(深圳)有限公司 Data processing system, administrative center and data processing method
CN103823845B (en) * 2014-01-28 2017-01-18 浙江大学 Method for automatically annotating remote sensing images on basis of deep learning
CN105426541B (en) * 2015-12-23 2019-03-08 北京奇虎科技有限公司 A kind of storage method and device of general data
CN107015985B (en) * 2016-01-27 2021-03-30 创新先进技术有限公司 Data storage and acquisition method and device
CN108319645B (en) * 2017-12-25 2022-09-16 中国科学院信息工程研究所 Multi-version file view management method and device in heterogeneous storage environment
CN109634805A (en) * 2018-11-19 2019-04-16 平安科技(深圳)有限公司 Monitoring data processing method, device, electronic equipment and storage medium
CN109739893B (en) * 2018-12-28 2022-04-22 上海尚往网络科技有限公司 Metadata management method, equipment and computer readable medium
CN110765111B (en) * 2019-10-28 2023-03-31 深圳市商汤科技有限公司 Storage and reading method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7836012B1 (en) * 2002-12-09 2010-11-16 Google Inc. Systems and methods for information extraction
TW201842478A (en) * 2017-04-28 2018-12-01 美商英特爾股份有限公司 Compute optimizations for low precision machine learning operations
TW201909007A (en) * 2017-07-10 2019-03-01 美商高通公司 Processing media data using a common descriptor for one of the file format logic boxes
TW201915837A (en) * 2017-10-12 2019-04-16 英屬開曼群島商意騰科技股份有限公司 Local learning system in artificial intelligence device
TW201931104A (en) * 2017-10-20 2019-08-01 英商葛夫科有限公司 Generating randomness in neural networks

Also Published As

Publication number Publication date
JP2022510643A (en) 2022-01-27
CN110765111B (en) 2023-03-31
KR20210089242A (en) 2021-07-15
CN110765111A (en) 2020-02-07
TW202117565A (en) 2021-05-01
WO2021082461A1 (en) 2021-05-06

Similar Documents

Publication Publication Date Title
WO2020029966A1 (en) Method and device for video processing, electronic device, and storage medium
US20170199943A1 (en) User interface for multivariate searching
WO2017092122A1 (en) Similarity determination method, device, and terminal
WO2021082463A1 (en) Data processing method and apparatus, electronic device and storage medium
WO2017028416A1 (en) Classifier training method, type recognition method, and apparatus
JP7315796B2 (en) Circuit principle diagram check method, device and system
WO2017028624A1 (en) Method and device for processing resources
US9661133B2 (en) Electronic device and method for extracting incoming/outgoing information and managing contacts
WO2018157631A1 (en) Method and device for processing multimedia resource
WO2016050038A1 (en) Communication message recognition method and device
TW202107337A (en) Face image recognition method and device, electronic device and storage medium
TWI785638B (en) Target detection method, electronic equipment and computer-readable storage medium
CN104636164B (en) Start page generation method and device
CN114090575A (en) Data storage method and retrieval method based on key value database and corresponding devices
TW201837752A (en) Feedback response method and device
TWI739633B (en) Storage and reading method, electronic equipment and computer-readable storage medium
CN105187597B (en) A kind of management method of voice record, device and its mobile terminal
CN113987128A (en) Related article searching method and device, electronic equipment and storage medium
WO2024093443A1 (en) Information display method and apparatus based on voice interaction, and electronic device
WO2015000433A1 (en) Multimedia search method, terminal, server and system
WO2023184745A1 (en) Data labeling method and apparatus, electronic device, and storage medium
CN109800019A (en) Code administration method, system, electronic equipment and computer readable storage medium
KR20140086853A (en) Apparatus and Method Managing Contents Based on Speaker Using Voice Data Analysis
CN106959970B (en) Word bank, processing method and device of word bank and device for processing word bank
CN109445757B (en) New design drawing generation method and device and terminal equipment