WO2020057229A1 - 数据检索方法及装置 - Google Patents

数据检索方法及装置 Download PDF

Info

Publication number
WO2020057229A1
WO2020057229A1 PCT/CN2019/094378 CN2019094378W WO2020057229A1 WO 2020057229 A1 WO2020057229 A1 WO 2020057229A1 CN 2019094378 W CN2019094378 W CN 2019094378W WO 2020057229 A1 WO2020057229 A1 WO 2020057229A1
Authority
WO
WIPO (PCT)
Prior art keywords
retrieval
data
address
task
read
Prior art date
Application number
PCT/CN2019/094378
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to EP19862554.3A priority Critical patent/EP3846026A4/en
Publication of WO2020057229A1 publication Critical patent/WO2020057229A1/zh
Priority to US17/206,903 priority patent/US11620082B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0646Configuration or reconfiguration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5017Task decomposition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1008Correctness of operation, e.g. memory ordering

Definitions

  • the present application relates to the field of data processing, and in particular, to a data reading method and related equipment when performing data processing tasks.
  • the processing method for the retrieval service is to read data from the database and perform retrieval calculations based on the multi-read data, until all data in the database are traversed, the retrieval task ends, and the retrieval result is returned. If other search requests are received during the execution of the search process, it is usually necessary to wait for the execution of the first search task and then start from the beginning to read and calculate the data of the next search task.
  • the embodiments of the present application provide a data reading method and device, which can improve the parallel reading efficiency of data and reduce the delay of business processing in the scenario where multiple services are concurrent.
  • an embodiment of the present application provides a data reading method for a retrieval task, including: receiving a first retrieval task request, where the first retrieval task request corresponds to a first retrieval start address and a first retrieval address in a target data area.
  • a retrieval end address; data reading for starting a first retrieval task based on the first retrieval start address; data reading for performing the first retrieval task is sequential reading from the first retrieval start address
  • the data in the target data area is up to the first retrieval end address; a second retrieval task request is received during the execution of the first retrieval task to read data; based on the data of the first retrieval task being read
  • the address determines a second retrieval start address of the second retrieval task within the target data area; the second retrieval start address may be located at an address of data to be read by the first retrieval task and the first Within the search end address range; starting to perform data reading of the second search task based on the second search start address; the target data area is the first check And second search task executes retrieval tasks require read data to traverse range.
  • Reading can realize multiple concurrent tasks to read data at the same time, which can improve the reading efficiency of data, reduce the waiting between services, and reduce the delay of business processing.
  • reading from the first retrieval start address to the first retrieval end address may traverse the reading target data area.
  • the determining that the second retrieval task is after the second retrieval start address in the target data area based on an address of data to be read by the first retrieval task Continue reading data from the address of the data to be read by the first retrieval task, determine whether the address of the read data is the second retrieval start address, and if so, the read data Configured to execute the second retrieval task.
  • the determining that the second retrieval task is after the second retrieval start address in the target data area based on an address of data to be read by the first retrieval task Continue reading data from the address of the data to be read by the first retrieval task, determine whether the address of the read data is the first retrieval end address, and if not, the read data is still Configured to execute the first retrieval task.
  • the determining that the second retrieval task is after the second retrieval start address in the target data area based on an address of data to be read by the first retrieval task Continue reading data from the address of the data to be read by the first retrieval task, determine whether the address of the read data is the first retrieval end address, and if so, the read data is used
  • the first search task ends after the first search task is executed.
  • the read data By judging the retrieval task to which the read data belongs, the read data can be used for a plurality of parallel retrieval tasks at the same time, thereby improving data reading efficiency.
  • determining the second retrieval start address of the second retrieval task in the target data area based on the address of the data to be read includes: The address of the data to be read determines the second retrieval start address and the second retrieval end address of the second retrieval task within the target data area.
  • reading from the second retrieval start address to the second retrieval end address may traverse the reading target data area.
  • the start reading position and the end reading position of the retrieval task can be judged more accurately, and the data reading efficiency and task execution efficiency of the retrieval task are improved, and no duplicate data is made. Read or miss unread data.
  • the determining a second retrieval start address of a second retrieval task in the target data area based on an address of data to be read includes: setting The address of the data to be read is the second retrieval start address.
  • the retrieval end address includes: setting an address of a previous data of the address of the data to be read as the second retrieval end address.
  • the waiting delay of the newly initiated retrieval task can be saved to the greatest extent, so that the new retrieval task can be processed in time.
  • the target data region includes multiple data blocks, and each data block includes multiple data units.
  • the target data region includes a plurality of data units.
  • the address is a data block address or a data unit address.
  • the data reading start position and the end position are identified by the data block or data unit address, so that the multi-tasking data reading can be performed in parallel while accurately judging whether the data of each task is completed.
  • an embodiment of the present application provides a retrieval method, including: receiving a first retrieval task request, the first retrieval task request corresponding to a first retrieval start address and a first retrieval end address in a target data area; Read data from the first search task based on the first search start address; read data from the first search task by sequentially reading data in the target data area from the first search start address Up to the first retrieval end address; receiving a second retrieval task request in the process of reading data performed by the first retrieval task; determining a second retrieval based on the address of the data to be read by the first retrieval task
  • the second search start address of the task in the target data area; the second search start address may be located within the range of the address of the data to be read by the first search task and the first search end address Within; read the data of the target data area; determine the retrieval task corresponding to the read data, and perform retrieval based on the corresponding retrieval task.
  • data reading of the second retrieval task is started based on the second retrieval start address.
  • the target data region is a range of data that needs to be traversed for performing the retrieval for the first retrieval task and the second retrieval task.
  • the retrieval starting position of the newly initiated retrieval task is located, and there is no need to wait for the reading of the data of the retrieval task initiated after the completion of the reading of the first retrieval task
  • Data can be read simultaneously by multiple parallel tasks, which can improve data read efficiency, reduce waiting between services, and reduce service processing delays.
  • reading from the first retrieval start address to the first retrieval end address may traverse the reading target data area.
  • the determining a retrieval task corresponding to the read data further includes: determining whether an address of the read data is the second retrieval start address, and if If yes, the read data is used to perform the second retrieval task.
  • the retrieval task corresponding to the read data further includes: determining whether the address of the read data is the first retrieval end address, and if not, then The read data is also used to perform the first retrieval task.
  • the read data can be used for multiple parallel retrieval tasks at the same time, and the data reading efficiency is improved.
  • the determining a second retrieval start address of a second retrieval task in the target data area based on an address of the data to be read includes: The address of the data to be read determines the second retrieval start address and the second retrieval end address of the second retrieval task within the target data area.
  • reading from the second retrieval start address to the second retrieval end address may traverse the reading target data area.
  • the retrieval start address and the retrieval end address mark of the retrieval task are deleted.
  • the start reading position and the end reading position of the retrieval task can be judged more accurately, and the data reading efficiency and task execution efficiency of the retrieval task are improved, and no duplicate data is made. Read or miss unread data.
  • the determining a second retrieval start address of a second retrieval task in the target data area based on an address of the data to be read includes: setting The address of the data to be read is the second retrieval start address.
  • the retrieval end address includes: setting an address of a previous data of the address of the data to be read as the second retrieval end address.
  • the waiting delay of the newly initiated retrieval task can be saved to the greatest extent, so that the new retrieval task can be processed in time.
  • the target data region includes multiple data blocks, and each data block includes multiple data units.
  • the target data region includes a plurality of data units.
  • the address is a data block address or a data unit address.
  • the data reading start position and the end position are identified by the data block or data unit address, so that the multi-tasking data reading can be performed in parallel while accurately judging whether the data of each task is completed.
  • an embodiment of the present application further discloses a data retrieval device.
  • the device includes: an interface module, configured to receive a first retrieval task request, and receive during a process of reading data of the first retrieval task.
  • a second search task request ; the first search task request corresponds to a first search start address and a first search end address in a target data area;
  • a location setting module configured to receive the second After the retrieval task request, a second retrieval start address of the second retrieval task in the target data area is determined based on the address of the data to be read by the first retrieval task; the second retrieval start address is located at The address of the data to be read by the first retrieval task and the range of the first retrieval end address;
  • a data reading module configured to start performing data reading of the first retrieval task based on the first retrieval start address.
  • the reading is to sequentially read the data in the target data area from the first search start address to the first search end address; the target data area needs to be traversed when performing the search for the first search task and the second search task.
  • the retrieval starting position of the newly initiated retrieval task is located, and there is no need to wait for the reading of the data of the retrieval task initiated after the completion of the reading of the first retrieval task
  • Data can be read simultaneously by multiple parallel tasks, which can improve data read efficiency, reduce waiting between services, and reduce service processing delays.
  • the data reading module is further configured to determine whether an address of the read data is the second retrieval start address, and if so, the read data Configured to execute the second retrieval task.
  • the data reading module is further configured to determine whether an address of the read data is the first retrieval end address, and if not, the read data It is also used to perform the first retrieval task.
  • the read data can be used for multiple parallel retrieval tasks at the same time, and the data reading efficiency is improved.
  • the data retrieval apparatus further includes: a retrieval module, configured to perform a retrieval task based on data read by the data reading module and a retrieval task corresponding to the read data. retrieve.
  • the start reading position and the end reading position of the retrieval task can be judged more accurately, and the data reading efficiency and task execution efficiency of the retrieval task are improved, and no duplicate data is made. Read or miss unread data.
  • an embodiment of the present application further discloses a data retrieval system.
  • the system includes: a data retrieval device and a memory; the memory is configured to store data required for retrieval by a retrieval task, and the retrieval task of the data retrieval system To perform retrieval, it is necessary to traverse the data in the memory; the data retrieval device is configured to receive a first retrieval task request, and the first retrieval task request corresponds to a first retrieval start address and a first retrieval in the memory.
  • the retrieval starting position of the newly initiated retrieval task is located, and there is no need to wait for the reading of the data of the retrieval task initiated after the completion of the reading of the first retrieval task
  • Data can be read simultaneously by multiple parallel tasks, which can improve data read efficiency, reduce waiting between services, and reduce service processing delays.
  • an embodiment of the present application further discloses a data retrieval device, including: one or more processors, and a memory; the memory is configured to store data required for retrieval by the retrieval task, and the retrieval tasks perform the retrieval.
  • the data in the memory needs to be traversed; the one or more processors are configured to receive a first retrieval task request, and the first retrieval task request corresponds to a first retrieval start address and a first retrieval end in the memory.
  • the retrieval starting position of the newly initiated retrieval task is located, and there is no need to wait for the reading of the data of the retrieval task initiated after the completion of the reading of the first retrieval task
  • Data can be read simultaneously by multiple parallel tasks, which can improve data read efficiency, reduce waiting between services, and reduce service processing delays.
  • the one or more processors are further configured to determine whether an address of the read data is the second retrieval start address, and if so, the read data is used to execute the second retrieval start address. Retrieval tasks.
  • the one or more processors are further configured to determine whether an address of the read data is the first retrieval end address, and if not, the read data is further used to execute the first Retrieval tasks.
  • the read data can be used for multiple parallel retrieval tasks at the same time, and the data reading efficiency is improved.
  • the one or more processors are further configured to determine a second retrieval end address of the second retrieval task in the target data area based on an address of the data to be read.
  • the determining, by the one or more processors, a second retrieval start address of the second retrieval task within the target data area based on the address of the data to be read includes: the data retrieval device The address of the data to be read is set as the second retrieval start address.
  • the one or more processors are further configured to determine a second retrieval end address of the second retrieval task in the target data area based on the address of the data to be read, including: the data The retrieval device sets the address of the previous data to the address of the data to be read as the second retrieval end address.
  • the start reading position and the end reading position of the retrieval task can be judged more accurately, and the data reading efficiency and task execution efficiency of the retrieval task are improved, and no duplicate data is made. Read or miss unread data.
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores program code, where the program code includes a method for performing any one of the first or second aspects. Instructions for some or all steps.
  • an embodiment of the present application provides a computer program product, and when the computer program product is run on a computer, the computer is caused to execute part or all of the steps of any one of the methods in the first or second aspect.
  • data reading operations of multiple data processing tasks can be processed at the same time.
  • Data can be read simultaneously by two parallel tasks, which can improve the efficiency of data reading, reduce the waiting between services, and reduce the delay of business processing.
  • start position and end position of data reading are identified by data blocks or data units, so that it can accurately determine whether the data of each task has been read while performing multi-task data reading in parallel, and will not repeat the data. Read or missed read.
  • FIG. 1a shows a schematic diagram of concurrent search service processing in the prior art
  • FIG. 1b shows another schematic diagram of concurrent search service processing in the prior art
  • FIG. 2 is a schematic diagram of processing a concurrent search service according to an embodiment of the present application
  • FIG. 3a is a schematic diagram of an application scenario according to an embodiment of the present application.
  • FIG. 3b is a schematic diagram of another application scenario according to an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a retrieval device according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of another retrieval apparatus according to an embodiment of the present application.
  • FIG. 6 shows a specific implementation form of the address record table in the embodiment of the present application.
  • FIG. 7 is a schematic diagram of a method for reading retrieval task data according to an embodiment of the present application.
  • FIG. 8 shows a flowchart of a data reading method for a retrieval task according to an embodiment of the present application
  • FIG. 9 shows a flowchart of a retrieval method according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a retrieval device according to an embodiment of the present application.
  • One or more structures of the functions, modules, features, units, etc. mentioned in the specific embodiments of the present application can be understood as being composed of any physical or tangible component (for example, software, hardware running on computer equipment (E.g., a logic function implemented by a processor or chip), etc., and / or any other combination) is implemented in any manner.
  • dividing the various devices into different modules or units shown in the drawings may reflect the use of corresponding different physical and tangible components in an actual implementation.
  • a single module in the drawings of the embodiments of the present application may also be implemented by multiple actual physical components.
  • any two or more modules depicted in the drawings may also reflect different functions performed by a single actual physical component.
  • the embodiments of the present application are mainly used for processing multiple concurrent services, specifically an application scenario in which multiple concurrent services need to read data from a specified storage area, for example, a feature-based retrieval service provided by a video surveillance system in a safe city.
  • FIG. 1a is a schematic diagram of a concurrent retrieval service process of a general retrieval platform such as a CPU and GPU in the prior art, where T is the time required for a single QPS retrieval task to execute without waiting, as shown in FIG.
  • QPS0_START receives the search request from QPS0, it starts to read data from the memory and retrieves the data based on the search request from QPS0.
  • QPS0_END starts to read data from the memory serially for the retrieval tasks of QPS1 and QPS2.
  • the read data is used for the search task of QPS1
  • the search time of QPS1 is T + t1 + t2 (the time from the time when the search request is issued to the search result), and the time of the search task of QPS2 is 2T + t2. , And so on, the delay of the concurrent QPS retrieval tasks will increase.
  • the search tasks of QPS1 and QPS2 also need to wait.
  • QPS0_END starts to read data from the memory. After reading, it is used for the retrieval of the retrieval tasks of QPS1 and QPS2 respectively. Therefore, the total execution time of the three search tasks is 2 * T.
  • the search time of QPS1 is T + t1 + t2 (the time from the time when the search request is issued to the search result), and the time of the search task of QPS2 is T + t2. .
  • FIG. 2 is a schematic diagram of a concurrent search service process according to an embodiment of the present application.
  • T is the time required for a single QPS search task to execute without waiting.
  • QPS0_START is the initial time when a QPS0 search request is received. Data at QPS0 When the reading is not finished, the search requests for QPS1 and QPS2 are received at QPS1_START and QPS2_START respectively.
  • the embodiment of the present application does not have to wait for the reading of QPS0 data to be completed, and directly separates QPS1 and QPS2 from QPS1_START and QPS2_START start to read data.
  • the read data for the currently executing search task for example, the data read from QPS1_START to QPS2_START are used for QPS0 and QPS1.
  • Retrieval tasks from QPS2_START to QPS0_END are used for retrieval tasks from QPS0, QPS1 and QPS2, data from QPS0_END to QPS1_END are used for retrieval tasks from QPS1 and QPS2, data from QPS1_END to QPS2_END are used for QPS2 retrieval task. Therefore, the concurrent retrieval tasks in the embodiment of the present application can directly perform data reading without waiting.
  • the total execution time of the three retrieval tasks in the example is T + t1 + t2, and the retrieval tasks of QPS1-QPS2 All time is T.
  • Reading QPS0_END ends QPS0 data reading
  • reading QPS1_END ends QPS1 data reading
  • reading QPS2_END ends QPS2 data reading.
  • FIG. 2 is only an implementation of the embodiment of the present application, that is, when a new QPS request is received during the execution of QPS0, for example, QPS1 immediately executes the data reading and retrieval of the QPS1 task, and during actual execution, this
  • the execution time of QPS1 may also be arbitrary, and is not necessarily the time when a QPS1 request is received.
  • the execution of the QPS1 task may be started at the time when QPS0 receives a new QPS request and before the end of the QPS0 task.
  • FIG. 3a shows a schematic diagram of an application scenario according to an embodiment of the present application, including a plurality of terminal devices (101a, 101b, 101c), a data retrieval device 102, and a data storage device 103.
  • the terminal devices (101a, 101b, 101c) may be computers, notebooks, and computers. Work stations, smartphones or other types of mobile phones, tablet-type devices, wearable devices, etc.
  • the data retrieval device 102 may be a device or server having a data processing function, such as a cloud server, a network server, an application server, and a management server.
  • the data retrieval device 102 may be composed of one or more servers and are used to jointly implement data service processing.
  • the data retrieval devices 102 may be placed in a centralized manner, or they may be distributed in a physical space for long-distance communication connections.
  • the specific embodiment of the present application is related to the processing of services that need to read data, it also includes a data storage device 103.
  • the data storage device 103 may have multiple forms, such as an independent storage device or integrated in other devices Or memory in the system, the number of data storage devices 103 may be one or more. When there are multiple data storage devices 103, they may be placed centrally, or they may be distributed in physical space. Distance communication connection.
  • the data storage device 103 is independently provided and the data processing system 102 is only an example form.
  • the data storage device 103 may also be provided in the data retrieval device 102, and the data retrieval device 102 may also be connected with some other Network devices, such as routers, load balancing devices, etc., are not shown here in the drawings.
  • the terminal equipment (101a, 101b, 101c) and the data retrieval device 102 can be connected in a variety of ways, including but not limited to any wired or wireless connection such as a wide area network, a local area network, and a point-to-point connection.
  • the retrieval system 300 includes a data retrieval device 102 and a data storage device 103.
  • the data retrieval device 102 of the retrieval system 300 receives the QPS retrieval task task1 input by any terminal device (101a, 101b, 101c), for example, a picture, it starts to read and retrieve all the data storage devices 103 (Here specifically, the system picture library 103), and return the most relevant picture.
  • the system picture library in FIG. 3 a is one or more independent storage devices.
  • the picture library may also be integrated in the data retrieval device 102.
  • the data retrieval device 102 determines whether there are still old QPS retrieval tasks that are still reading the pictures in the system picture library 103. If not, it starts to traverse from the starting position.
  • the system picture library 103 performs a search for task2. If the old QPS search task (task1) is still reading the existing data, the data reading start position of the new QPS search task task2 is read from the current task1 From the data reading position, the retrieval tasks for different QPS continue to read the data in the storage unit at the same time, and the read data are retrieved for different retrieval tasks respectively, and the reading of each recorded QPS retrieval task is performed.
  • Data end position address to judge the data reading progress of each retrieval task, such as whether the reading is completed.
  • search modules of different QPS finish their respective searches, they report the search results separately. There are multiple ways to report the search results, which can also be reported while searching, or not specifically limited here.
  • FIG. 3a illustrates a schematic diagram of a scenario implemented in the network-side data retrieval device 102 according to the embodiment of the present application.
  • the optional embodiment of the present application can also perform parallel retrieval of multiple retrieval tasks directly on the terminal 301 as shown in FIG. 3b. .
  • the capability of the terminal 301 to perform the retrieval task is the same as that of the data processing apparatus in FIG. 3a, and therefore will not be described again.
  • the data read when the terminal 301 performs the retrieval task may be from the data storage device 302, or may be from a storage unit of the terminal 301 itself.
  • Figures 3a and 3b incorporate new search tasks and read data simultaneously during the execution of old search tasks, which can reduce the waiting time between concurrent search tasks and improve data read efficiency.
  • FIG. 4 is one of the specific implementations of the data retrieval device 400 according to the embodiment of the present application.
  • the data retrieval device 400 may be the data retrieval device 102 in FIG. 3a, or the terminal 301 in FIG. 3b, or other physical devices.
  • the exemplary data retrieval apparatus 400 in this embodiment of the present application may specifically include an interface module 401, a location setting module 403, and a data reading module 404.
  • the interface module 401 is configured to receive a first retrieval task request, and receive a second retrieval task request in a process of reading execution data of the first retrieval task.
  • the interface module 401 is mainly used for communicating with external devices, receiving retrieval task request information sent by external devices such as terminal devices (any one or more of 411a, 411b, 411c), and according to the retrieval task request information.
  • the processing result feeds back the corresponding search result information.
  • the interface module 401 can receive one or more search task request information sent by the terminal device (any one or more of 411a, 411b, and 411c), which can be a task currently being performed. If it is not finished, one or more new task requests are accepted again, and the retrieval results are returned according to the processing results.
  • the terminal device 411a may send a search task request message to the interface module 401 when a search is needed, and when the search task of the terminal device 411a has not been completed, it receives a request initiated by itself or another terminal device (411b, 411c). For a new search task request, the data search device 400 returns the search result to the terminal that sends the search task request information through the interface module 401 after the search task processing is completed.
  • the retrieval tasks targeted by the retrieval task request received by the interface module 401 are data reading and retrieval for the same target data area. After the data area is read and retrieved, the retrieval task ends and the retrieval result is returned.
  • the embodiments of the present application mainly focus on introducing the data reading process. There is no particular limitation on whether the data is retrieved while the data is being retrieved, or the data is retrieved while the data is being retrieved.
  • the retrieval task request accepted by the interface module 401 may also be a retrieval task request input by a terminal user.
  • a location setting module 403, configured to determine, after the interface module 401 receives the second retrieval task request, based on the address of the data to be read by the first retrieval task, that the second retrieval task is in the target data area Within the second search start address.
  • the position setting module 403 sets a search start address of the received search task request.
  • the start search address of the new search task is set as the start data position of the target data area.
  • the interface module 401 receives a new search task (second search task) request during the execution of the search task (first search task)
  • the acquired current search task (first search task) is requested.
  • the address of the read data sends the address information to the location setting module 403, and the sending may be a direct transmission or an indirect acquisition by the location device module 403.
  • the location setting module 403 learns the address of the data to be read by the current search task at the current moment, determines the search start address of the new search task to read the data according to the address of the data to be read by the current search task.
  • the target data area may be composed of multiple data units or multiple data blocks, where each data block may include multiple data units, and the address may be a data unit address or data of the target data area.
  • the data block address can be identified by the address of a data unit in the data block.
  • the retrieval start address is an address used to indicate a starting position for reading data of the new retrieval task when the new retrieval task performs data reading.
  • the search end address may be the search end address of any search task in progress, for example, the search end address of the search task that is the earliest end is set by default, or the search task is currently newly received.
  • the address of the data currently being read can be set as the retrieval start address of the new retrieval task, or the address of the next data block or data unit of the address currently being read can be set as the address of the new retrieval task. retrieve the start address.
  • the address setting module 403 may set the search end address of the new search task while setting the search start address of the new search task. Because the retrieval tasks all need to traverse the read target data area, after selecting the retrieval start address of the retrieval task, the retrieval end address is also clear. For example, when the address of the current data to be read is set as the retrieval start address of the new search task, in order to ensure that all data in the read target data area is traversed, the previous address of the address of the current data to be read can be set to new The retrieval end position of the retrieval task.
  • the method for setting the search start address and the search end address can be to set the address record table to record the search start address, as shown in Figure 6, where START0, END0, etc. indicate the search start address and search end address of the corresponding task. address.
  • other fields can be added to the table to identify the address information.
  • the optional location setting module 403 is further configured to delete the address of the corresponding task from the address record table after the execution of the retrieval task is completed.
  • a data reading module 404 configured to start reading data of the first search task based on the first search start address, and start reading data of the second search task based on the second search start address .
  • the data reading module 404 reads the target data area based on the task request sequence.
  • the data retrieval device 400 receives the task request, if no other retrieval task is currently executing, the data The reading module 404 sequentially reads data from the first data in the target data area. If there are other retrieval tasks currently executing, the other retrieval tasks may be one or more. Then, the data reading module 404 will not stop or read the data again because of the newly added retrieval task, but continue to read the data according to the current reading progress.
  • the data reading module 404 continues to read the data DATAn, DATAn + 1,... According to a predetermined data reading sequence.
  • Each newly added search task is set with a search start position by the position setting module 403.
  • the search start position of the newly added search task it indicates that the newly added search task starts to perform data reading, that is, The data to be read at this time is used for all search tasks currently in progress, including newly added search tasks.
  • each retrieval task is also provided with a retrieval end address.
  • the optional data retrieval device 400 may further include a determination module 406 and a data retrieval module 405.
  • the judging module 406 is configured to judge a retrieval task corresponding to the data read by the data reading module 404.
  • the judgment module 406 judges the retrieval task corresponding to the read data based on the address of the data read by the data reading module 404 and the retrieval end address of each ongoing retrieval task; if there is a newly received retrieval task It is also necessary to determine the retrieval task corresponding to the read data based on the retrieval start address of the newly received retrieval task.
  • the determination module 406 obtains the position of the data to be read by the current search task from the position setting module 403, and obtains the newly received search task from the address record table of the search task (Second retrieval task) The retrieval start address of the read data. At this time, if the address of the data unit DATAn is the retrieval start address, the judgment module 406 judges that the address of the read data is the retrieval of the newly received retrieval task by comparing the address of the read data and the retrieval start address information in the address record table. At the starting position, the judgment module 406 judges that the read data needs to be retrieved for a newly received retrieval task.
  • the judgment module 406 judges that the data reading of this retrieval task has been completed, and the next read data does not need to be used for this Retrieval task. For subsequent read data, if no new search task request is initiated, it is determined whether the position is the search end position of the currently ongoing search task by comparison. If not, it is determined that the read data continues to be used for all current Searches are in progress. Until the read data address is determined to be the retrieval end address of an ongoing retrieval task, the judgment module 406 judges that the data reading of this retrieval task has been completed, and the next read data does not need to be used for this retrieval task again. Search.
  • the determination module 406 is based on the address of the data read by the data reading module 404 and the ongoing search task and the search start address and the newly received search task.
  • the search end address determines the search task corresponding to the read data. That is, after receiving the data address read by the data reading module 404, the judgment module 406 compares the search start address and the search end address in the address record table of the search task. At this time, if the read data address is a retrieval start address of a certain task, the judging module 406 judges that the read data starts to be needed for this retrieval task for retrieval. If the read data address is the retrieval end address of a certain task, the judging module 406 judges that the data reading of this retrieval task has been completed, and the next read data does not need to be used for this retrieval task for retrieval.
  • the retrieval module 405 is configured to retrieve data read by the data reading module 404.
  • the retrieval module 405 searches the data read by the data reading module 404 and the retrieval tasks corresponding to the read data determined by the judgment module 406, respectively, and returns the retrieval results.
  • the retrieval module 405 may include a fixed number of retrieval sub-modules. Each search task corresponds to a different search sub-module.
  • the retrieval module 405 receives the read data sent by the data reading module 404, and according to the read data judged by the judgment module 406, for the retrieval task that needs to be retrieved, distributes the read data to the retrieval child corresponding to the retrieval task Module.
  • the address record table may further include a search submodule identifier corresponding to the search task.
  • the judgment module 406 makes a judgment, it sends the retrieval submodule identification of the corresponding task to the retrieval module 405, and the retrieval module 405 sends data to the corresponding retrieval submodule for retrieval according to the retrieval submodule identification.
  • the number may be fixed.
  • the later retrieval tasks need to wait.
  • Quantity for a newly entered search task, assign a search submodule to it.
  • the number of retrieval sub-modules may also be non-fixed, and corresponding retrieval sub-modules may be generated according to the number of retrieval tasks.
  • Reading can realize multiple concurrent tasks to read data at the same time, which can improve the reading efficiency of data, reduce the waiting between services, and reduce the delay of business processing.
  • the read data can be used for multiple parallel retrieval tasks at the same time, and the data reading progress of each retrieval task can be accurately controlled to improve the accuracy of data retrieval of each retrieval task. rate.
  • its structure may also be as shown in FIG. 5, where the functions of the interface module 501 and the position setting module 503 are the same as the corresponding modules in FIG. 4, and no judgment module is provided.
  • the data reading module 504 and the retrieval module 505 may be:
  • the data reading module 504 is configured to read the data of the target data area in sequence. When a task request is received and no other retrieval tasks are currently executing, the data is read sequentially from the first data in the target data area. When a new retrieval task is received during the execution of an existing retrieval task, the data reading module continues to sequentially read the data based on the position of the data to be read by the retrieval task at the current time in the target data area, and based on The position of the data to be continuously read and the start position and the end position of the data to be read by the target retrieval task determine the retrieval task corresponding to the data to be continuously read.
  • the data reading module 504 may further include a judgment function, that is, the data reading module 504 judges a retrieval task corresponding to the currently read data based on the address record table while reading the data.
  • the retrieval module 505 is configured to retrieve the data read by the data reading module 504 for the corresponding retrieval tasks.
  • the retrieval module 505 distributes the read data to the retrieval submodule corresponding to the retrieval task according to the retrieval task required for retrieval. After the search task is completed, the search result corresponding to the task is returned.
  • the data reading module 504 and the retrieval module 505 may also be:
  • a data reading module 504 configured to continue reading the target data area based on the position of the data to be read by other retrieval tasks at the current time in the target data area, and send the read data and the address of the data to the retrieval module 505.
  • the retrieval module 505 after receiving the data read by the data reading module 504 and its address, determines the retrieval task corresponding to the currently read data based on the address record table. The retrieval module 505 retrieves the data read by the data reading module 504 for its corresponding retrieval task. The retrieval module 505 distributes the read data to the retrieval submodule corresponding to the retrieval task according to the retrieval task required for retrieval. After the search task is completed, the search result corresponding to the task is returned.
  • the first search task mentioned in the embodiments of the present application is a general reference, which can be used to refer to any one or more search tasks that are currently in progress and have not ended, or to clarify the time relationship, and refer to the second search task.
  • the second search task mentioned in the embodiment of the present application is used to refer to a search task corresponding to a new search task request received during the execution of the first search task.
  • the target data area is exemplarily shown in FIGS. 4 and 5 as memories 420 and 520.
  • the target data area may be set in the form of a memory independently of the data retrieval device, or may be set in the data retrieval device as a storage unit. Or set up in other devices.
  • the data location in the embodiment of the present application may also be an identifier other than a data unit or data block address that can be used to identify the data location.
  • FIGS. 4 and 5 are only examples of retrieval tasks, and describe the system's processing of retrieval tasks, especially the video surveillance retrieval system used in safe cities for retrieving face pictures.
  • the embodiments of the present application can also apply other types of retrieval tasks, such as retrieval tasks for documents, retrieval tasks for audio files, and the like. All or part of the functions of each module in FIGS. 4 and 5 can also be implemented by other modules.
  • FIG. 7 is a detailed example of a data reading method according to an embodiment of the present application.
  • the address DATA0 of the start data of the target data area is used as the retrieval start address START0 of QPS0.
  • DATAY can be set to the search end address END0 of QPS0 and recorded.
  • the addresses DATA0 and DATAY may be data unit addresses or data block addresses of the target data area.
  • the data reading module reads the data in the target data area from DATA0.
  • the data retrieval device executes QPS0 and receives a new retrieval task request QPS1 when DATA7 is to be read
  • the data retrieval device obtains the address of the data to be read by QPS0.
  • the retrieval start address of the QPS1 is determined based on the address of the data to be read by the QPS0.
  • QPS1 can traverse the entire retrieval area; read the data at START1.
  • the ongoing retrieval task has QPS0 and QPS1, the read data is used to perform the retrieval of QPS0 and the retrieval of QPS1, respectively.
  • the data retrieval device executes QPS0 and QPS1 in parallel and is about to read DATAY, it receives a new retrieval task request QPS2, repeats the above address setting method, sets the address to be read by QPS0 and QPS1 to START2, and records in the address In the record table, you can also set the last read data or data block address to END2 and record; continue to start data reading from the data at position START2.
  • the read The data is used to perform the retrieval of QPS0, QPS1, and QPS2, respectively. Whenever the END of a QPS task is read, the end of a QPS task and the next read data will no longer be used for the retrieved QPS task.
  • FIG. 8 is a flowchart of a data reading method for a retrieval task according to an embodiment of the present application.
  • the method includes receiving a first retrieval task request, and the first retrieval task request corresponds to a first retrieval start address and a first retrieval end address in the target data area; the target data area needs to traverse the read data for the retrieval task to perform retrieval range.
  • the first retrieval start address is an address where the first retrieval task starts reading and retrieval is performed based on the read data
  • the first retrieval end address is the last data read by the first retrieval task. Reading the first retrieval start address to the first retrieval end address can ensure that the first retrieval task traverses all the data in the read completion target data area.
  • the read data is used to perform the retrieval of the first retrieval task.
  • the reading of the data of the first retrieval task is finished, and the data read thereafter will not be used for the retrieval of the first retrieval task. That is, the data for performing the first retrieval task is to sequentially read the data in the target data area from the first retrieval start address to the first retrieval end address.
  • S804. Determine a second retrieval start address of the second retrieval task in the target data area based on an address of data to be read by the first retrieval task.
  • the second retrieval start address may be located within a range of an address of data to be read by the first retrieval task and the first retrieval end address.
  • the new search task (second search) is determined according to the address of the data to be read by the current search task.
  • (Task) Read the search start address of the search data.
  • the retrieval start address is an address used to indicate a starting position for reading data of the new retrieval task when the new retrieval task performs data reading. You can set the search start address to any address (including the address of the current data to be read and the search end address of the current search task) between the address of the current data to be read and the search end address of the current search task.
  • a (second search task) search end address of the new search task can be determined. Because the retrieval tasks all need to traverse the read target data area, after selecting the retrieval start address of the retrieval task, the retrieval end address is also clear. For example, when the address of the current data to be read is set as the retrieval start address of the new search task, in order to ensure that all data in the read target data area is traversed, the previous address of the address of the current data to be read can be set to new The retrieval end position of the retrieval task.
  • the setting method of the search start address and the search end address may record the search start address for setting an address record table.
  • the second retrieval task starts to perform data reading, that is, the data started to be read at this time is used in addition to The first retrieval task also needs to be used for the second retrieval task.
  • each search task is also set with a search end address.
  • Each time a search task is read it indicates that the data reading of this task has ended, and the next read data will not be used again. Retrieval of this task.
  • FIG. 9 is a retrieval method according to an embodiment of the present application. Steps S901, S902, S903, and S904 are the same as the corresponding steps in the embodiment of the method for reading data of the retrieval task in FIG. 8, and are not repeated here.
  • it includes: obtaining the data address to be read by the first retrieval task, because the reading of data is performed sequentially, so if the currently read data is DATAn, the data DATAn, DATAn + 1 ...
  • S906 Determine a retrieval task corresponding to the read data
  • the determination method has been described in detail in the description of FIG. 4, and may be based on the address of the read data and the retrieval end address of each ongoing retrieval task to determine the retrieval task corresponding to the read data; if there is a new
  • the received retrieval task also needs to determine the retrieval task corresponding to the read data based on the retrieval start address of the newly received retrieval task.
  • the search task corresponding to the read data may be determined based on the address of the read data and the ongoing search task and the search start address and the search end address of the newly received search task. That is, after receiving the read data address, the search start address and the search end address in the address record table of the search task are compared. At this time, if the read data address is the retrieval start address of a certain task, it is judged that the read data needs to be used for the retrieval task for retrieval. If the read data address is the retrieval end address of a certain task, it is judged that the data reading of this retrieval task has been completed, and the next read data does not need to be used for this retrieval task for retrieval.
  • S907 Perform a search based on a search task corresponding to the read data.
  • the read data includes searching for the read data and the retrieval task corresponding to the determined read data. Returns the search results.
  • the read data corresponds to multiple retrieval tasks
  • the read data is used for retrieval of multiple retrieval tasks, respectively.
  • FIG. 10 is a schematic structural diagram of a retrieval device according to an embodiment of the present application.
  • the inspection device may include one or more processors 1000 and one or more memories 1001.
  • the retrieval device may further include components such as an input unit 1006, a display unit 1003, and a communication unit 1002.
  • the processor 2011 may be connected to the memory 1001, the communication unit 1002, the input unit 1006, and the display unit 1003 through a bus, respectively. They are described as follows:
  • the processor 1000 is a control center of the retrieval device, and various components of the retrieval device are connected by using various interfaces and lines.
  • the processor 1000 may further include one or more processing cores.
  • the processor 1000 may execute the retrieval task by reading the data stored in the memory 1001 and performing analysis and comparison.
  • the processor 1000 may be a dedicated processor or a general-purpose processor, when the processor 1000 is a general-purpose processor, the processor 1000 runs or executes a software program (instruction) and / or module stored in the memory 1001.
  • the memory 1001 may include a high-speed random access memory, and may further include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1001 may further include a memory controller to provide the processor 1000 and the input unit 1006 to access the memory 1001.
  • the memory 1001 may be specifically used to store software programs (instructions) and data (relevant data in the acoustic model library, relevant data in the TTS parameter library).
  • the input unit 1006 may be used to receive digital or character information input by a user, and generate a keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
  • the input unit 1006 may include a touch-sensitive surface 1005 and other input devices 1007.
  • the touch-sensitive surface 1005 is also referred to as a touch display screen or a touchpad, which can collect user's touch operations on or near it, and drive the corresponding connection device according to a preset program.
  • the other input device 1007 may include, but is not limited to, one or more of a physical keyboard, function keys, trackball, mouse, joystick, and the like.
  • the display unit 1003 may be used to display a search request input by a user or a search result provided to the user by the search device and various graphical user interfaces of the search device. These graphic user interfaces may be composed of graphics, text, icons, videos, and any combination thereof .
  • the display unit 1003 may include a display panel 1004.
  • the display panel 1004 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
  • the touch-sensitive surface 1005 and the display panel 1004 are two separate components, in some embodiments, the touch-sensitive surface 1005 and the display panel 1004 may be integrated to implement input and output functions.
  • the touch-sensitive surface 1005 may cover the display panel 1004.
  • the touch-sensitive surface 1005 detects a touch operation on or near the touch-sensitive surface 1005, the touch-sensitive surface 1005 transmits the touch operation to the processor 1000 to determine the type of the touch event.
  • a corresponding visual output is provided on the display panel 1004.
  • the communication unit 1002 is used for communication connection with other devices through wireless or wired communication technology, such as cellular mobile communication technology, WLAN, Bluetooth, etc. Used to receive search task requests from the outside world and return search results to the outside world.
  • wireless or wired communication technology such as cellular mobile communication technology, WLAN, Bluetooth, etc.
  • the retrieval device in the embodiments of the present application may include more or fewer components than those shown in the figure, or some components may be combined, or different components may be arranged.
  • the retrieval device may further include a speaker, a camera, and the like, and details are not described herein again.
  • the processor 1000 may implement the data reading method of the retrieval task in the embodiment of the present application by reading and analyzing and judging the data stored in the memory 1001.
  • the method includes: receiving a first retrieval task request; starting to perform data reading of the first retrieval task based on the first retrieval start address; and receiving a second retrieval task request in the process of reading data of the first retrieval task.
  • the second retrieval start address may be located within a range of an address of data to be read by the first retrieval task and the first retrieval end address; starting to execute the first retrieval based on the second retrieval start address. Data retrieval for the second retrieval task.
  • the processor 1000 may also implement the retrieval method in the embodiment of the present application by reading and analyzing the data stored in the memory 1001.
  • the method includes: receiving a first retrieval task request; starting to perform data reading of the first retrieval task based on the first retrieval start address; and receiving a second retrieval task request in the process of reading data of the first retrieval task.
  • a second retrieval start address of a second retrieval task within the target data area based on an address of data to be read by the first retrieval task; the second retrieval start address may be located at the first The address of the data to be read by the retrieval task and the first retrieval end address range; the data is read sequentially; the retrieval task corresponding to the read data is determined; the retrieval task corresponding to the read data is based on Search.
  • the memory 1001 may further be used to store these software modules, and the processor 1000 may be used to call the execution memory 1001.
  • FIG. 10 is only an implementation manner of the retrieval device of the present application, the processor 1000 and the memory 1001 in the retrieval device may be integrated and deployed in a possible embodiment.
  • the computer program product includes one or more computer instructions.
  • the processor may be a general-purpose processor or a special-purpose processor.
  • the retrieval device may be one or a computer network composed of a plurality of retrieval devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be from a network site, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, and may also be a data storage device such as a server, a data center, and the like that includes one or more available medium integrations.
  • the usable medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape, etc.), an optical medium (such as a DVD, etc.), or a semiconductor medium (such as a solid state hard disk), and the like.
  • the optional execution body may be ASIC, FPGA, CPU, GPU, etc., which is implemented by hardware or software
  • the optional memory may be volatile such as DDR, SRAM, HDD, and SSD. Or non-volatile storage.
  • the data retrieval device may be applied to various scenarios, for example, a server for a video surveillance system, and an exemplary embodiment may be in the form of a PCIe expansion card.
  • ASIC and FPGA are hardware implementation, that is, the method of this application is implemented by means of hardware description language during hardware design;
  • CPU and GPU are software implementation, that is, the method of this application is implemented by means of software program code during software design .

Landscapes

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

Abstract

本申请提供了一种检索任务的数据读取方法及检索装置,该方法包括:接收第一检索任务请求,所述第一检索任务请求对应有目标数据区域内的第一检索起始地址和第一检索结束地址;基于所述第一检索起始地址开始执行第一检索任务的数据读取;在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求;在接收所述第二检索任务请求后获取第一检索任务正要读取的数据的地址;基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址;基于所述第二检索起始地址开始执行所述第二检索任务的数据读取。实施本申请的方案,能够在多检索任务并发的情况下减少等待时延,提高单个检索任务的处理效率。

Description

数据检索方法及装置 技术领域
本申请涉及数据处理领域,尤其涉及执行数据处理任务时的数据读取方法及相关设备。
背景技术
目前,在互联网迅猛发展的时代,高并发业务的场景不断增加,如何提高高并发业务的处理效率已成为当前重点关注的热点问题之一。现有很多业务都涉及大量数据的读取以及分析处理,比如检索业务,就需要对数据库中的数据进行遍历读取和分析判断其与检索请求之间得相关性,并最终输出检索结果。如果涉及到高并发的检索业务,则必然会涉及针对不同检索请求的多次对数据库中数据的遍历读取。目前现在技术中对于检索业务的处理方式是从数据库中读取数据,并基于多读取的数据进行检索计算,直到遍历数据库中的所有数据,则检索任务结束,返回检索结果,如果一个检索业务的执行过程中接收到其他的检索请求,则通常需要等第一个检索任务执行结束后,从头开始下一个检索任务的数据读取和检索计算。
由此,可以看出现有的业务处理方案存在检索时延较大的问题,面对涉及大量数据的读取的业务类型,例如检索业务,多个业务并发时,如何提高业务处理效率,减小时延,成为亟待解决的问题。
发明内容
本申请实施例提供了数据读取方法及装置,针对多个业务并发的场景,能够提高数据的并行读取效率,降低业务处理时延。
第一方面,本申请实施例提供一种检索任务的数据读取方法,包括:接收第一检索任务请求,所述第一检索任务请求对应有目标数据区域内的第一检索起始地址和第一检索结束地址;基于所述第一检索起始地址开始执行第一检索任务的数据读取;所述执行第一检索任务的数据读取为从所述第一检索起始地址开始顺序读取目标数据区域的数据直至所述第一检索结束地址;在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求;基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址;所述第二检索起始地址可以位于所述第一检索任务正要读取的数据的地址和所述第一检索结束地址区间范围内;基于所述第二检索起始地址开始执行所述第二检索任务的数据读取;所述目标数据区域为第一检索任务和第二检索任务执行检索均需要遍历读取的数据范围。
可见,通过获取正在进行的第一检索任务的数据读取位置作为基准,定位新发起检索任务的检索起始位置,不需要等到第一检索任务读取完成之后再进行后发起的检索任务的数据读取,可以实现多个并行任务同时进行数据读取,能够提高数据的读取效率,减少业务之间的等待,降低业务处理时延。
在所述第一方面的某些实现方式下,从所述第一检索起始地址读取到所述第一检索结束地址可以遍历读取目标数据区域。
在所述第一方面的某些实现方式下,所述基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址之后,从所述第一检索任务正要读取的数据的地址开始继续读取数据,判断读取的数据的地址是否为所述第二检索起始地址,如果是,则所述读取的数据用于执行所述第二检索任务。
在所述第一方面的某些实现方式下,所述基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址之后,从所述第一检索任务正要读取的数据的地址开始继续读取数据,判断读取的数据的地址是否为所述第一检索结束地址,如果不是,则所述读取的数据还用于执行所述第一检索任务。
在所述第一方面的某些实现方式下,所述基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址之后,从所述第一检索任务正要读取的数据的地址开始继续读取数据,判断读取的数据的地址是否为所述第一检索结束地址,如果是,则所述读取的数据用于执行所述第一检索任务后结束第一检索任务。
通过判断所读取的数据所属的检索任务,能够将读取的数据同时用于多个并行的检索任务,提高数据读取效率。
在所述第一方面的某些实现方式下,所述基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址,包括:基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的所述第二检索起始地址和第二检索结束地址。
在所述第一方面的某些实现方式下,从所述第二检索起始地址读取到所述第二检索结束地址可以遍历读取目标数据区域。
通过检索起始地址和检索结束地址的设置,能够更加准确的判断检索任务的开始读取位置和结束读取的位置,提高检索任务的数据读取效率和任务执行效率,不会做重复的数据读取,或者遗漏未读取的数据。
在所述第一方面的某些实现方式下,所述基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址,包括:设定所述正要读取的数据的地址为所述第二检索起始地址。
在所述第一方面的某些实现方式下,所述基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的所述第二检索起始地址和第二检索结束地址,包括:设定所述正要读取的数据的地址的上一个数据的地址为所述第二检索结束地址。
通过设定正要读取的数据为第二检索起始地址,能够最大程度的节约新发起的检索任务的等待时延,使得新的检索任务能够及时处理。
在所述第一方面的某些实现方式下,所述目标数据区域包括多个数据块,每个数据块包括多个数据单元。
在所述第一方面的某些实现方式下,所述目标数据区域包括多个数据单元。
所述地址为数据块地址或数据单元地址。
通过数据块或者数据单元地址来标识数据读取起始位置和结束位置,从而能够在并行进行多任务数据读取的同时准确的判断各个任务的数据是否读取完成。
第二方面,本申请实施例提供一种检索方法,包括:接收第一检索任务请求,所述第 一检索任务请求对应有目标数据区域内的第一检索起始地址和第一检索结束地址;基于所述第一检索起始地址开始执行第一检索任务的数据读取;所述执行第一检索任务的数据读取为从所述第一检索起始地址开始顺序读取目标数据区域的数据直至所述第一检索结束地址;在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求;基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址;所述第二检索起始地址可以位于所述第一检索任务正要读取的数据的地址和所述第一检索结束地址区间范围内;读取目标数据区域的数据;确定所述读取的数据对应的检索任务,基于所述对应的检索任务进行检索。
在所述第二方面的某些实现方式下,基于所述第二检索起始地址开始执行所述第二检索任务的数据读取。
在所述第二方面的某些实现方式下,所述目标数据区域为第一检索任务和第二检索任务执行检索均需要遍历读取的数据范围。
通过获取正在进行的第一检索任务的数据读取位置作为基准,定位新发起检索任务的检索起始位置,不需要等到第一检索任务读取完成之后再进行后发起的检索任务的数据读取,可以多个并行任务同时进行数据读取,能够提高数据的读取效率,减少业务之间的等待,降低业务处理时延。
在所述第二方面的某些实现方式下,从所述第一检索起始地址读取到所述第一检索结束地址可以遍历读取目标数据区域。
在所述第二方面的某些实现方式下,所述判断所述读取的数据所对应的检索任务,还包括:判断读取的数据的地址是否为所述第二检索起始地址,如果是,则所述读取的数据用于执行所述第二检索任务。
在所述第二方面的某些实现方式下,所述所读取的数据所对应的检索任务,还包括:判断读取的数据的地址是否为所述第一检索结束地址,如果不是,则所述读取的数据还用于执行所述第一检索任务。
通过判断所读取的数据所述的检索任务,能够将读取的数据同时用于多个并行的检索任务,提高数据读取效率。
在所述第二方面的某些实现方式下,所述基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址,包括:基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的所述第二检索起始地址和第二检索结束地址。
在所述第二方面的某些实现方式下,从所述第二检索起始地址读取到所述第二检索结束地址可以遍历读取目标数据区域。
在所述第二方面的某些实现方式下,读取到检索任务的检索结束地址后,删除所述检索任务的检索起始地址和检索结束地址标记。
通过检索起始地址和检索结束地址的设置,能够更加准确的判断检索任务的开始读取位置和结束读取的位置,提高检索任务的数据读取效率和任务执行效率,不会做重复的数据读取,或者遗漏未读取的数据。
在所述第二方面的某些实现方式下,所述基于所述正要读取的数据的地址确定第二检 索任务在所述目标数据区域内的第二检索起始地址,包括:设定所述正要读取的数据的地址为所述第二检索起始地址。
在所述第二方面的某些实现方式下,所述基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的所述第二检索起始地址和第二检索结束地址,包括:设定所述正要读取的数据的地址的上一个数据的地址为所述第二检索结束地址。
通过设定正要读取的数据为第二检索起始地址,能够最大程度的节约新发起的检索任务的等待时延,使得新的检索任务能够及时处理。
在所述第二方面的某些实现方式下,所述目标数据区域包括多个数据块,每个数据块包括多个数据单元。
在所述第二方面的某些实现方式下,所述目标数据区域包括多个数据单元。
所述地址为数据块地址或数据单元地址。
通过数据块或者数据单元地址来标识数据读取起始位置和结束位置,从而能够在并行进行多任务数据读取的同时准确的判断各个任务的数据是否读取完成。
第三方面,本申请实施例还公开一种数据检索装置,所述装置包括:接口模块,用于接收第一检索任务请求,以及在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求;所述第一检索任务请求对应有目标数据区域内的第一检索起始地址和第一检索结束地址;位置设置模块,用于在所述接口模块接收到所述第二检索任务请求后,基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址;所述第二检索起始地址位于所述第一检索任务正要读取的数据的地址和所述第一检索结束地址区间范围内;数据读取模块,用于基于所述第一检索起始地址开始执行第一检索任务的数据读取,并基于位置设置模块确定的所述第二检索起始地址开始执行所述第二检索任务的数据读取;所述第一检索任务的数据读取为从所述第一检索起始地址开始顺序读取目标数据区域的数据直至所述第一检索结束地址;所述目标数据区域为第一检索任务和第二检索任务执行检索均需要遍历读取的数据范围。
通过获取正在进行的第一检索任务的数据读取位置作为基准,定位新发起检索任务的检索起始位置,不需要等到第一检索任务读取完成之后再进行后发起的检索任务的数据读取,可以多个并行任务同时进行数据读取,能够提高数据的读取效率,减少业务之间的等待,降低业务处理时延。
在所述第三方面的某些实现方式下,所述数据读取模块还用于判断读取的数据的地址是否为所述第二检索起始地址,如果是,则所述读取的数据用于执行所述第二检索任务。
在所述第三方面的某些实现方式下,所述数据读取模块,还用于判断读取的数据的地址是否为所述第一检索结束地址,如果不是,则所述读取的数据还用于执行所述第一检索任务。
通过判断所读取的数据所述的检索任务,能够将读取的数据同时用于多个并行的检索任务,提高数据读取效率。
在所述第三方面的某些实现方式下,所述数据检索装置还包括:检索模块,用于基于数据读取模块所读取的数据,以及所述读取的数据所对应的检索任务进行检索。
通过检索起始地址和检索结束地址的设置,能够更加准确的判断检索任务的开始读取 位置和结束读取的位置,提高检索任务的数据读取效率和任务执行效率,不会做重复的数据读取,或者遗漏未读取的数据。
第四方面,本申请实施例还公开一种数据检索系统,所述系统包括:数据检索装置和存储器;所述存储器用于存储检索任务进行检索所需要的数据,所述数据检索系统的检索任务执行检索均需要遍历读取存储器的数据;所述数据检索装置用于:接收第一检索任务请求,所述第一检索任务请求对应有所述存储器内的第一检索起始地址和第一检索结束地址;基于所述第一检索起始地址开始执行第一检索任务的数据读取;所述执行第一检索任务的数据读取为从所述第一检索起始地址开始顺序读取目标数据区域的数据直至所述第一检索结束地址;在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求;在接收所述第二检索任务请求后获取第一检索任务正要读取的数据的地址;基于所述正要读取的数据的地址确定第二检索任务在所述存储器的第二检索起始地址;所述第二检索起始地址位于所述第一检索任务正要读取的数据的地址和所述第一检索结束地址区间范围内;基于所述第二检索起始地址开始执行所述第二检索任务的数据读取。
通过获取正在进行的第一检索任务的数据读取位置作为基准,定位新发起检索任务的检索起始位置,不需要等到第一检索任务读取完成之后再进行后发起的检索任务的数据读取,可以多个并行任务同时进行数据读取,能够提高数据的读取效率,减少业务之间的等待,降低业务处理时延。
第五方面,本申请实施例还公开一种数据检索装置,包括:一个或多个处理器,以及存储器;所述存储器用于存储检索任务进行检索所需要的数据,所述检索任务执行检索均需要遍历读取存储器的数据;所述一个或多个处理器用于:接收第一检索任务请求,所述第一检索任务请求对应有所述存储器内的第一检索起始地址和第一检索结束地址;基于所述第一检索起始地址开始执行第一检索任务的数据读取;所述执行第一检索任务的数据读取为从所述第一检索起始地址开始顺序读取目标数据区域的数据直至所述第一检索结束地址;在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求;基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述存储器的第二检索起始地址;所述第二检索起始地址位于所述第一检索任务正要读取的数据的地址和所述第一检索结束地址区间范围内;基于所述第二检索起始地址开始执行所述第二检索任务的数据读取。
通过获取正在进行的第一检索任务的数据读取位置作为基准,定位新发起检索任务的检索起始位置,不需要等到第一检索任务读取完成之后再进行后发起的检索任务的数据读取,可以多个并行任务同时进行数据读取,能够提高数据的读取效率,减少业务之间的等待,降低业务处理时延。
可选的,所述一个或多个处理器还用于判断读取的数据的地址是否为所述第二检索起始地址,如果是,则所述读取的数据用于执行所述第二检索任务。
可选的,所述一个或多个处理器还用于判断读取的数据的地址是否为所述第一检索结束地址,如果不是,则所述读取的数据还用于执行所述第一检索任务。
通过判断所读取的数据所述的检索任务,能够将读取的数据同时用于多个并行的检索任务,提高数据读取效率。
可选的,所述一个或多个处理器还用于基于所述正要读取的数据的地址确定第二检索 任务在所述目标数据区域内的第二检索结束地址。
可选的,所述一个或多个处理器基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址,包括:所述数据检索装置设定所述正要读取的数据的地址为所述第二检索起始地址。
可选的,所述一个或多个处理器还用于基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索结束地址,包括:所述数据检索装置设定所述正要读取的数据的地址的上一个数据的地址为所述第二检索结束地址。
通过检索起始地址和检索结束地址的设置,能够更加准确的判断检索任务的开始读取位置和结束读取的位置,提高检索任务的数据读取效率和任务执行效率,不会做重复的数据读取,或者遗漏未读取的数据。
第六方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储了程序代码,其中,所述程序代码包括用于执行第一或二方面的任意一种方法的部分或全部步骤的指令。
第七方面,本申请实施例提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行第一或二方面的任意一种方法的部分或全部步骤。
应当理解的是,本申请的第二至七方面与本申请的第一方面的技术方案一致,各方面及对应的可行实施方式所取得的有益效果相似,不再赘述。
可以看到,实施本申请实施例的技术方案,能够同时处理多个数据处理任务的数据读取操作,不需要等到当前所执行任务读取完成之后再进行下一个任务的数据读取,可以多个并行任务同时进行数据读取,能够提高数据的读取效率,减少业务之间的等待,降低业务处理时延。同时通过数据块或者数据单元来标识数据读取起始位置和结束位置,从而能够在并行进行多任务数据读取的同时准确的判断各个任务的数据是否读取完成,不会对数据进行重复的读取,或者出现漏读的情况。
附图说明
为了更清楚地说明本申请实施例或背景技术中的技术方案,下面将对本申请实施例或背景技术中所需要使用的附图进行说明。
图1a示出了现有技术中的一种并发搜索业务处理示意图;
图1b示出了现有技术中的另一种并发搜索业务处理示意图;
图2示出了本申请实施例的一种并发搜索业务处理示意图;
图3a示出了本申请实施例的一种应用场景的示意图;
图3b示出了本申请实施例的另一种应用场景的示意图;
图4示出了本申请实施例提供的一种检索装置的结构示意图;
图5示出了本申请实施例提供的另一种检索装置的结构示意图;
图6示出了本申请实施例中的地址记录表的一种具体实现形式;
图7示出了本申请实施例提供的一种检索任务数据读取的方法示意图;
图8示出了本申请实施例提供的一种检索任务的数据读取方法流程图;
图9示出了本申请实施例提供的一种检索方法流程图;
图10示出了本申请实施例的一种检索装置的结构示意图。
具体实施方式
下面结合本申请实施例中的附图对本申请的具体实现方式进行举例描述。然而本申请的实现方式还可以包括在不脱离本申请的精神或范围的前提下将这些实施例组合,比如采用其它实施例和做出结构性改变。因此以下实施例的详细描述不应从限制性的意义上去理解。本申请的实施例部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
本申请的具体实施例中所提到的功能、模块、特征、单元等的一个或多个结构组成可以理解为由任何物理的或有形的组件(例如,由在计算机设备上运行的软件、硬件(例如,处理器或芯片实现的逻辑功能)等、和/或其它任何组合)以任何方式来实现。在某些实施例中,所示出的将附图中的将各种设备分成不同的模块或单元可以反映在实际实现中使用对应的不同的物理和有形的组件。可选的,本申请实施例附图中的单个模块也可以由多个实际物理组件来实现。同样,在附图中描绘的任何两个或更多个模块也可以反映由单个实际物理组件所执行的不同的功能。
关于本申请实施例的方法流程图,将某些操作描述为以一定顺序执行的不同的步骤。这样的流程图属于说明性的而非限制性的。可以将在本文中所描述的某些步骤分组在一起并且在单个操作中执行、可以将某些步骤分割成多个子步骤、并且可以以不同于在本文中所示出的顺序来执行某些步骤。可以由任何电路结构和/或有形机制(例如,由在计算机设备上运行的软件、硬件(例如,处理器或芯片实现的逻辑功能)等、和/或其任何组合)以任何方式来实现在流程图中所示出的各个步骤。
以下的说明可以将一个或多个特征标识为“可选的”。该类型的声明不应当被解释为对可以被认为是可选的特征的详尽的指示;即,尽管没有在文本中明确地标识,但其他特征可以被认为是可选的。此外,对单个实体的任何描述不旨在排除对多个这样的实体的使用;类似地,对多个实体的描述不旨在排除对单个实体的使用。最后,术语“示例性的”是指在潜在的许多实现中的一个实现。
本申请实施例主要用于多并发业务的处理,具体为多并发业务均需要对指定的存储区域进行数据读取的应用场景,例如平安城市的视频监控系统提供的基于人物特征的检索业务。
目前对于此类业务,业界CPU、GPU等通用检索平台的软件检索方案,通常对不同并发QPS的检索任务进行串行处理,即串行从存储器进行数据读取、检索(此处的检索为对所读取的数据进行分析判断之后输出检索结果)。图1a为现有技术中CPU、GPU等通用检索平台的一种并发检索业务处理的示意图,其中T为不等待的情况下,单个QPS检索任务执行所需要的时间,如图1a所示在初始时刻QPS0_START收到QPS0的检索请求,开始从存储器中读取数据并基于QPS0的检索请求对所读取的数据进行检索,在QPS0的数据还没有读完时,又分别在QPS1_START、QPS2_START时刻收到QPS1和QPS2的检索请求,则QPS1和QPS2的检索任务需要等待QPS0的数据读取完的时刻QPS0_END开始依次串行从存储器中读取数据用于QPS1和QPS2的检索任务,即QPS0_END开始从存储器中读 取数据用于QPS1的检索任务,QPS1的数据读取完的时刻QPS1_END开始再从存储器中读取数据用于QPS2的检索任务。因此三个检索任务执行完成的总时间是3*T,QPS1的检索任务耗时为T+t1+t2(从发出检索请求到获得检索结果的时间),QPS2的检索任务耗时为2T+t2,依此类推越是后并发的QPS检索任务时延会越来越大。
除上述方式外,现有技术中FPGA、ASIC等专用计算平台在碰到类似场景时,有一种技术方案为对并发QPS的检索任务进行定时等待,并在指定时间同时读取存储器的数据,并在读取后分别针对不同检索任务进行检索(对读取数据分别进行分析判断),具体实现方式如图1b所示,同图1a一样T为不等待的情况下单个QPS检索任务执行所需要的时间,QPS0_START为收到QPS0的检索请求的初始时刻,在QPS0的数据还没有读完时,又分别在QPS1_START、QPS2_START时刻收到QPS1和QPS2的检索请求,则QPS1和QPS2的检索任务同样需要等待QPS0的数据读取完的时刻QPS0_END开始从存储器中读取数据,读取后同时分别用于QPS1和QPS2的检索任务的检索。因此三个检索任务执行完成的总时间是2*T,QPS1的检索任务耗时为T+t1+t2(从发出检索请求到获得检索结果的时间),QPS2的检索任务耗时为T+t2。
图2为本申请实施例的一种并发搜索业务处理示意图;同样T为不等待的情况下单个QPS检索任务执行所需要的时间,QPS0_START为收到QPS0的检索请求的初始时刻,在QPS0的数据还没有读完时,又分别在QPS1_START、QPS2_START时刻收到QPS1和QPS2的检索请求,则本申请实施例相比于现有技术可以不用等待QPS0的数据读取完成,将QPS1和QPS2直接分别从QPS1_START、QPS2_START开始读取数据,读取后根据当前同时存在的QPS业务情况,将所读取的数据分别用于当前正在执行的检索任务,例如QPS1_START到QPS2_START区间读取的数据用于QPS0和QPS1的检索任务,QPS2_START到QPS0_END区间读取的数据用于QPS0、QPS1和QPS2的检索任务,QPS0_END到QPS1_END区间读取的数据用于QPS1和QPS2的检索任务,QPS1_END到QPS2_END区间读取的数据用于QPS2的检索任务。由此,本申请实施例中并发的检索任务不需要进行等待就能直接执行数据的读取,示例中的三个检索任务执行完成的总时间是T+t1+t2,QPS1-QPS2的检索任务耗时均为T。读到QPS0_END结束QPS0的数据读取,读到QPS1_END结束QPS1的数据读取,同样读取到QPS2_END结束QPS2的数据读取。
此处列举的为进行数据读取的同时进行数据检索的情况,同样本申请的实施例在用于先读取数据然后再用于检索的方案中,也同样能够在当前检索任务读取未完成时接收到其它检索任务请求的情况下,节省多检索任务的总数据读取时间,达到提高检索任务处理效率的技术效果。图2中所示例的仅为本申请实施例的一种实现方式,即在QPS0执行期间接收到新的QPS请求后例如QPS1立即执行QPS1任务的数据读取和检索,而实际执行的过程中这个QPS1的开始执行时间也可以是任意的,并不一定是接收到QPS1请求的时刻,可以是在QPS0接收到新QPS请求时刻和QPS0任务结束之前的任意时刻开始QPS1任务的执行。本申请实施例的具体实现方式会在后续实施例中详细介绍。
图3a示出了本申请实施例的一个应用场景的示意图,包括多个终端设备(101a,101b,101c)和数据检索装置102、数据存储装置103。此处仅是示例性的示出了3个终端,在实际的应用场景中,终端的数量根据实际情况可以是任意的,所述终端设备(101a,101b, 101c)可以是计算机,笔记本,电脑工作站,智能手机或者其他类型手机,平板电脑型设备,可穿戴设备等。所述数据检索装置102可以为云服务器、网络服务器、应用服务器以及管理服务器等具有数据处理功能的设备或服务器,数据检索装置102可以是一个或者多个服务器组成,用于共同实现数据业务的处理,如搜索业务,当数据检索装置102为多个的时候,可以是集中放置,也可以在物理空间上分布放置,远距离通信连接。因为本申请的具体实施例是关于需要进行数据读取的业务的处理,因此还包括数据存储装置103,同样数据存储装置103可以有多种形式,如独立的存储设备,或是集成在其他设备或系统中的存储器等,数据存储装置103的个数可以是一个或者多个,当数据存储装置103为多个的时候,可以是集中放置,也可以在物理空间上分布放置,之间通过远距离通信连接。图中将数据存储装置103独立设置与数据处理系统102之外只是一种示例形式,具体实现中,数据存储装置103也可以设置在数据检索装置102中,数据检索装置102还可以连接有一些其他的网络设备,如路由器、负载均衡设备等,此处在附图中并未示出。终端设备(101a,101b,101c)和数据检索装置102之间可以通过多种方式通信连接,包括但不限于广域网,局域网,点到点连接等任意的有线或者无线连接方式。
此处,仍然以平安城市的视频监控作为示例性应用场景,检索系统300包括,数据检索装置102和数据存储装置103。所述检索系统300的数据检索装置102在接收到任意终端设备(101a,101b,101c)输入的QPS检索任务task1后,例如,一张图片,会开始遍历读取并检索全部的数据存储装置103(此处具体为系统图片库103)中的图片,并返回最相关的图片,例如查找请求为一个嫌疑人的图片,则目标检索结果为图片库中所有包含具备嫌疑人特征的人物的图片,所述最相关的图片可以是一个也可以是多个。此处在附图3a中系统图片库为一个或多个独立的存储装置,可选的,图片库也可以集成在数据检索装置102中。
此时,若又接收到了其他QPS检索任务,如task2,数据检索装置102判断是否还有旧的QPS检索任务仍在读取系统图片库103中的图片,如无,则从起始位置开始遍历系统图片库103进行针对task2的检索,如有旧的QPS检索任务(task1)仍在读取存量数据,则将新的QPS检索任务task2的数据读取起始位置从当前task1正要读取的数据读取位置开始,针对不同QPS的检索任务继续同时读取存储单元中的数据,并将读取的数据分别针对不同的检索任务分别进行检索,并通过所记录的各个QPS检索任务的读取数据结束位置地址,来判断各个检索任务的数据读取的进度,例如是否读取完成。不同QPS的检索模块完成各自的检索后,分别上报检索结果。上报检索结果的方式有多种,也可以是边检索边上报,或者在此不做具体限定。
图3a示例了本申请实施例在网络侧数据检索装置102中实现的一种场景示意图,可选的本申请实施例也可以如图3b所示,直接在终端301上执行多检索任务的并行检索。此时终端301的执行检索任务的能力和图3a中的数据处理装置相同,因此不再赘述。终端301执行检索任务时进行读取的数据可以是来自于数据存储装置302,也可以是来自于终端301自身的存储单元。
图3a,3b通过在旧检索任务的执行过程中并入新的检索任务同时进行数据的读取,能够减少并发检索任务之间的等待时常,提高数据的读取效率。
图4为本申请实施例的数据检索装置400的具体实现方式之一,所述数据检索装置400可以为图3a中的数据检索装置102,也可以为图3b中的终端301,或其它实体装置。本申请实施例示例性的此种数据检索装置400具体可以包括,接口模块401,位置设置模块403,数据读取模块404。
接口模块401,用于接收第一检索任务请求,以及在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求。
具体包括:接口模块401主要用于与外部设备进行通信,接收外部设备如终端设备(411a,411b,411c中的任意的一个或多个)发送的检索任务请求信息,并根据检索任务请求信息的处理结果反馈相应检索结果信息,如接口模块401可以接收终端设备(411a,411b,411c中的任意的一个或多个)发送的一个或多个检索任务请求信息,可以是在当前正在进行的任务还没有结束的情况下再次接受到一个或多个新的任务请求,并根据处理结果返回检索结果。例如,终端设备411a可以在需要进行检索的时候向接口模块401发送检索任务请求信息,在终端设备411a的检索任务还没有执行完成时,又接收到自身或者其他终端设备(411b,411c)发起的新的检索任务请求,数据检索装置400在检索任务处理完成后通过接口模块401向发送检索任务请求信息的终端返回检索结果。
其中接口模块401所接受到的检索任务请求所针对的检索任务均是针对同一目标数据区域进行数据读取并检索,将数据区域遍历读取并检索完成后检索任务结束,并返回检索结果。本申请实施例中重点侧重于介绍数据的读取过程,对于数据读取后如果进行检索,是边读取数据边检索,还是数据读取完成后再进行检索不做特别限定。当数据检索装置400为终端设备时,接口模块401所接受的检索任务请求还可以是终端用户输入的检索任务请求。
位置设置模块403,用于在所述接口模块401接收到所述第二检索任务请求后,基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址。
具体包括:
位置设置模块403设置接受到的检索任务请求的检索起始地址。当接收到新检索任务请求的时候当前没有在进行的其它检索任务,则设置新所述检索任务的起始检索地址为目标数据区域的起始数据位置。当在检索任务(第一检索任务)的执行过程中接口模块401接收到新的检索任务(第二检索任务)请求的时候,获取的当前正在进行的检索任务(第一检索任务)所正要读取的数据的地址,将地址信息发送给位置设置模块403,所述发送可以是直接发送,也可以是位置设备模块403间接获取。位置设置模块403获知当前时刻正在进行的检索任务正要读取数据的地址后,根据所述当前检索任务所正要读取数据的地址确定新检索任务读取检索数据的检索起始地址。
其中目标数据区域可以是由多个数据单元组成,也可以是由多个数据块组成,其中每个数据块可以包括多个数据单元,所述地址可以是目标数据区域的数据单元地址或者是数据块的地址。数据块地址可以用数据块中的某个数据单元的地址来标识。当前时刻正在进行的检索任务可以是一个,也可以是多个,每个检索任务都有各自的检索起始地址和检索 结束地址。
其中检索起始地址是新检索任务进行数据读取时用于指示新检索任务读取数据的起始位置的地址。可以设置检索起始地址为当前正要读取数据的地址到当前检索任务的检索结束地址之间的任意地址(包括当前正要读取数据的地址和当前检索任务的检索结束地址),如果当前正在进行的检索任务有多个时,所述检索结束地址可以是任意一个正在进行的检索任务的检索结束地址,例如默认设置为最早结束的检索任务的检索结束地址,或者是当前新接收检索任务之前最近接收的一个检索任务的结束地址等。示例性的,可以设定当前正要读取数据的地址为新检索任务的检索起始地址,或者设置当前正要读取数据的地址的下一个数据块或数据单元地址地址为新检索任务的检索起始地址。
可选的,地址设置模块403在设置新检索任务检索起始地址的同时还可以设置新检索任务的检索结束地址。因为检索任务均需要遍历读取目标数据区域,因此选定一个检索任务的检索起始地址后,检索结束地址也随之明确。例如当设置当前正要读取数据的地址为新检索任务的检索起始地址,则为了保证遍历读取目标数据区域的所有数据则可以设置当前正要读取数据的地址的上一个地址为新检索任务的检索结束位置。
检索起始地址和检索结束地址的设置方法可以为设置地址记录表对检索起始地址进行记录,如图6所示,其中START0、END0等表示相应的任务的检索起始地址和检索结束地址的地址。除上述方式外还可以在表格中增加其他的字段,用于对地址信息进行标识。
可选的位置设置模块403还用于在检索任务执行结束之后从地址记录表中删除相应任务的地址。
数据读取模块404,用于基于所述第一检索起始地址开始执行第一检索任务的数据读取,并基于所述第二检索起始地址开始执行所述第二检索任务的数据读取。
具体包括:数据检索装置400接收到检索任务请求后,数据读取模块404基于任务请求顺序读取目标数据区域,数据检索装置400接收到任务请求时,如果当前没有其他检索任务在执行,则数据读取模块404从目标数据区域的第一个数据开始顺序读取数据,如果当前还存在其他检索任务在执行,其他检索任务可以是一个或者多个。则数据读取模块404不会因为新加入的检索任务而停止或者从新读取数据,而是按照当前的读取进度继续读取数据。如果位置设置模块403获取当前时刻其他检索任务正要读取的数据单元为DATAn,则数据读取模块404按照预定的数据读取顺序继续读取数据DATAn、DATAn+1……。每个新加入的检索任务都会被位置设置模块403设置有检索起始位置,当读取到新加入的检索任务的检索起始位置则表示所述新加入的检索任务开始执行数据读取,即此时开始读取的数据除了要用于当前正在进行的所有检索任务包括新加入的检索任务。
可选的,每个检索任务也设置有检索结束地址,数据读取模块404每读取到一个检索任务的检索结束地址则表示此任务的数据读取已经结束,下一个再读取的数据将不会再用于此任务的检索。
除了上述模块之外,可选的数据检索装置400还可以包括判断模块406,数据检索模块405。
判断模块406,用于判断数据读取模块404所读取的数据对应的检索任务。
具体包括:判断模块406基于所述数据读取模块404读取的数据的地址和各个正在进 行的检索任务的检索结束地址判断所读取的数据所对应的检索任务;如果有新接收的检索任务,还需要基于新接收的检索任务的检索开始地址来判断所读取的数据所对应的检索任务。
如果有新发起的检索任务请求,则判断模块406从位置设置模块403获取当前时刻正在进行的检索任务所正要读取的数据的位置,并从检索任务的地址记录表获取新接收的检索任务(第二检索任务)读取数据的检索起始地址。此时如果数据单元DATAn的地址为检索起始地址,则判断模块406通过比对读取数据的地址和地址记录表中检索起始地址信息判断读取数据的地址为新接收的检索任务的检索起始位置时,判断模块406判断读取的数据开始需要用于新接收的检索任务进行检索。如果此时读取到的数据地址还判断为某一正在进行的检索任务的检索结束地址,判断模块406判断此检索任务的数据读取已经完成,下一个读取的数据不需要再用于此检索任务进行检索。后续再读取的数据,如果没有新的检索任务请求发起,则通过比对判断其位置是否为当前正在进行的检索任务的检索结束位置,如果不是则确定读取的数据继续需要用于所有当前正在进行的检索任务进行检索。直到读取到的数据地址判断为某一正在进行的检索任务的检索结束地址时,判断模块406判断此检索任务的数据读取已经完成,下一个读取的数据不需要再用于此检索任务进行检索。
可选的,除了上述任务判断方式外,还可以是,判断模块406基于所述数据读取模块404读取的数据的地址和正在进行的检索任务以及新接收的检索任务的检索起始地址和检索结束地址判断所读取的数据所对应的检索任务。即接受到数据读取模块404所读取的数据地址后,则判断模块406对比检索任务的地址记录表中的检索起始地址和检索结束地址。此时如果所述读取数据地址为某一任务的检索起始地址,则判断模块406判断读取的数据开始需要用于此检索任务进行检索。如果所述读取数据地址为某一任务的检索结束地址,则判断模块406判断此检索任务的数据读取已经完成,下一个读取的数据不需要再用于此检索任务进行检索。
检索模块405,用于针对所述数据读取模块404读取的数据进行检索。
具体包括:检索模块405针对所述数据读取模块404读取的数据,以及判断模块406所判断的读取数据所对应的检索任务分别进行检索,并返回检索结果。
检索模块405可以包括固定数目个检索子模块。每个检索任务对应不同的检索子模块。检索模块405接收数据读取模块404发送的读取的数据,根据判断模块406判断的读取的数据针对所需要进行检索的检索任务,将所读取的数据分发给检索任务所对应的检索子模块。
具体实现时,地址记录表中还可以包括检索任务所对应的检索子模块标识。判断模块406做出判断之后,将对应的任务的检索子模块标识发送给检索模块405,检索模块405根据所述检索子模块标识将数据发送给相应的检索子模块进行检索。
检索子模块通过硬件来实现时,其数量可以是固定的,当同时进行的检索任务超出检索子模块的数量,则后进入的检索任务需要等待,当同时进行的检索任务没有超出检索子模块的数量,则对于新进入的检索任务,为其指定一个检索子模块。
检索子模块的数量还可以为不固定的,可以根据检索任务的数量来生成相应的检索子模块。
上述实施例,通过获取正在进行的检索任务的数据读取位置作为基准,定位新发起检索任务的检索起始位置,不需要等到在先检索任务读取完成之后再进行后发起的检索任务的数据读取,可以实现多个并行任务同时进行数据读取,能够提高数据的读取效率,减少业务之间的等待,降低业务处理时延。同时通过判断所读取的数据所属的检索任务,能够将读取的数据同时用于多个并行的检索任务,同时精准控制各个检索任务的数据读取进度,提高各个检索任务数据读取的准确率。
对于数据检索装置,其结构还可以是如图5所示,其中接口模块501,位置设置模块503的功能和图4中的相应模块相同,不设置判断模块。
数据读取模块504和检索模块505,可以是:
数据读取模块504,用于按顺序读取目标数据区域的数据。当接收到任务请求时,当前没有其他检索任务在执行,则从目标数据区域的第一个数据开始顺序读取数据。当已有检索任务执行过程中接收到新的检索任务,则数据读取模块依然基于所述目标数据区域的当前时刻检索任务所正要读取的数据的位置继续按顺序读取数据,并基于所述继续读取的数据的位置和所述目标检索任务读取数据的起始位置和结束位置判断所述继续读取的数据所对应的检索任务。
数据读取模块504还可以包括判断功能,即数据读取模块504在进行数据读取的同时基于地址记录表判断当前所读取的数据所对应的检索任务。
检索模块505,用于将数据读取模块504读取的数据针对其所对应的检索任务分别进行检索。检索模块505根据所需要进行检索的检索任务,将所读取的数据分发给检索任务所对应的检索子模块。并在检索任务结束后返回任务对应的检索结果。
数据读取模块504和检索模块505,还可以是:
数据读取模块504,用于基于所述目标数据区域的当前时刻其他检索任务所正要读取的数据的位置继续读取目标数据区域,并将读取的数据和数据的地址发送给检索模块505。
检索模块505,检索模块505接收到数据读取模块504读取的数据及其地址后基于地址记录表判断当前所读取的数据所对应的检索任务。检索模块505,将数据读取模块504读取的数据针对其所对应的检索任务分别进行检索。检索模块505根据所需要进行检索的检索任务,将所读取的数据分发给检索任务所对应的检索子模块。并在检索任务结束后返回任务对应的检索结果。
图5所对应的实施例所能取得的有益效果和图4所对应的实施例相似。
本申请实施例中所提到第一检索任务为泛指,可以用于指代当前正在进行还没有结束的任意的一个或者多个检索任务,或者用于明确时间关系,指代第二检索任务请求发出之前发生的且还没有结束的某个检索任务,或者指代第二检索任务请求发出之前发生的且还没有结束的最邻近的一个检索任务。本申请实施例中所提到第二检索任务用于指代第一检索任务执行过程中接受到的新的检索任务请求所对应的检索任务。
其中所述目标数据区域在图4、5中示例性的表示为存储器420、520,目标数据区域可以是以存储器的形式独立于数据检索装置设置,也可以设置于数据检索装置作为一个存储单元,或是设置于其他装置之中。本申请实施例中的数据位置,还可以是数据单元或数据块地址以外的其它可以用于标识数据位置的标识。
图4、5仅是示例性的以检索任务为例,介绍了系统对于检索任务的处理方式,尤其是应用于平安城市中的视频监控检索系统,用于对人脸图片进行检索。此外,本申请实施例也可以应用其他类型的检索任务,例如针对文档的检索任务,针对音频文件的检索任务等。图4、5中各个模块的全部或者部分功能也可以由其他模块来实现。
图7为本申请实施例的数据读取方法的详细示例。数据检索装置在空闲状态下接收到检索任务请求QPS0时,由于此时没有其他检索任务在进行数据读取,因此将所述目标数据区域的起始数据的地址DATA0作为QPS0的检索起始地址START0,并记录在地址记录表图6中任务0一栏,同时可以将DATAY设置为为QPS0的检索结束地址END0并记录。其中所述地址DATA0,DATAY可以是目标数据区域的数据单元地址或者是数据块的地址。数据读取模块从DATA0开始遍历读取目标数据区域中的数据。
当数据检索装置在执行QPS0并在将要读取DATA7时接收到新的检索任务请求QPS1,数据检索装置获取QPS0所正要读取的数据的地址。基于QPS0所正要读取的数据的地址确定所述QPS1的检索起始地址。然后将QPS0所正要读取的数据单元或数据块的地址设置成QPS1的START1,记录于地址记录表中,还可以将QPS0上一个读取的数据或数据块地址设置为END1并记录,以保证QPS1能够遍历整个检索区域;读取START1位置的数据,此时因为正在进行的检索任务有QPS0和QPS1,因此,读取的数据分别用于执行QPS0的检索和执行QPS1的检索。
当数据检索装置在并行执行QPS0和QPS1并正要读取DATAY时,接收到新的检索任务请求QPS2,重复上述地址设置方式,将QPS0和QPS1正要读取的地址设置为START2,记录于地址记录表中,还可以将上一个读取的数据或数据块地址设置为END2并记录;继续从START2位置的数据开始数据读取,此时因为同时进行的QPS任务有3个,因此读取的数据分别用于执行QPS0,QPS1,QPS2的检索。每当读取到一个QPS任务的END,则结束一个QPS任务下一个读取的数据将不再用于所结束的QPS任务进行检索。结束一个QPS任务后,在地址记录表中删除上述任务相关的地址记录,以表示这个检索任务已经结束,返回检索任务对应的检索结果。直到所有QPS任务都读到各自的END并结束,然后数据检索装置进入空闲状态。
图8为本申请实施例的一种检索任务的数据读取方法流程图。
S801,接收第一检索任务请求。
具体包括:接收第一检索任务请求,第一检索任务请求对应有目标数据区域内的第一检索起始地址和第一检索结束地址;目标数据区域为检索任务执行检索均需要遍历读取的数据范围。其中第一检索起始地址为第一检索任务开始读取并基于读取的数据进行检索的地址,第一检索结束地址为第一检索任务最后一个读取的数据。第一检索起始地址到第一检索结束地址的读取可以保证第一检索任务遍历读取完成目标数据区域的所有数据。
S802,基于所述第一检索起始地址开始执行第一检索任务的数据读取。
具体包括:当读取到第一检索起始地址开始,所述读取的数据用于执行第一检索任务的检索。当读取到第一检索结束地址,所述第一检索任务的数据读取结束,此后再读取的数据将不用于第一检索任务的检索。即,所述执行第一检索任务的数据读取为从所述第一检索起始地址开始顺序读取目标数据区域的数据直至所述第一检索结束地址。
S803,在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求。
S804,基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址。所述第二检索起始地址可以位于所述第一检索任务正要读取的数据的地址和所述第一检索结束地址区间范围内。
具体包括:当获知当前正在进行的检索任务(第一检索任务)所正要读取的数据的地址后,根据所述当前检索任务所正要读取数据的地址确定新检索任务(第二检索任务)读取检索数据的检索起始地址。其中检索起始地址是新检索任务进行数据读取时用于指示新检索任务读取数据的起始位置的地址。可以设置检索起始地址为当前正要读取数据的地址到当前检索任务的检索结束地址之间的任意地址(包括当前正要读取数据的地址和当前检索任务的检索结束地址)。
可选的,同时还可以确定新检索任务的(第二检索任务)检索结束地址。因为检索任务均需要遍历读取目标数据区域,因此选定一个检索任务的检索起始地址后,检索结束地址也随之明确。例如当设置当前正要读取数据的地址为新检索任务的检索起始地址,则为了保证遍历读取目标数据区域的所有数据则可以设置当前正要读取数据的地址的上一个地址为新检索任务的检索结束位置。检索起始地址和检索结束地址的设置方法可以为设置地址记录表对检索起始地址进行记录。
S805,基于所述第二检索起始地址开始执行所述第二检索任务的数据读取;
具体包括:获取第一检索任务正要读取的数据地址,因为数据的读取是顺序进行的,因此若当前读取的数据为DATAn,则按照预定的数据读取顺序继续读取数据DATAn、DATAn+1……。对每一个继续读取的数据进行判断,当判断所读取的数据为第二检索起始位置,则表示第二检索任务开始执行数据读取,即此时开始读取的数据除了要用于第一检索任务还需要用于第二检索任务。
可选的,每个检索任务也设置有检索结束地址,每读取到一个检索任务的检索结束地址则表示此任务的数据读取已经结束,下一个再读取的数据将不会再用于此任务的检索。
图9为本申请实施例的一种检索方法。其中步骤S901,S902,S903,S904和图8检索任务的数据读取方法实施例中的相应步骤相同,在此不再赘述。
S905,顺序读取数据;
具体包括:获取第一检索任务正要读取的数据地址,因为数据的读取是顺序进行的,因此若当前读取的数据为DATAn,则按照预定的数据读取顺序继续读取数据DATAn、DATAn+1……。
S906,判断所读取的数据所对应的检索任务;
所述判断方法在图4的描述中已经详细介绍,可以是基于所读取的数据的地址和各个正在进行的检索任务的检索结束地址判断所读取的数据所对应的检索任务;如果有新接收的检索任务,还需要基于新接收的检索任务的检索开始地址来判断所读取的数据所对应的检索任务。
还可以是,基于读取的数据的地址和正在进行的检索任务以及新接收的检索任务的检索起始地址和检索结束地址判断所读取的数据所对应的检索任务。即接收到所读取的数据地址后,对比检索任务的地址记录表中的检索起始地址和检索结束地址。此时如果所述读 取数据地址为某一任务的检索起始地址,则判断读取的数据开始需要用于此检索任务进行检索。如果所述读取数据地址为某一任务的检索结束地址,则判断此检索任务的数据读取已经完成,下一个读取的数据不需要再用于此检索任务进行检索。
S907,基于所读取的数据所对应的检索任务进行检索。
具体包括:针对所读取的数据,以及所判断的读取数据所对应的检索任务分别进行检索。返回检索结果。当读取的数据对应多个检索任务时,将所读取的数据分别用于多个检索任务的检索。
图10是本申请实施例提供的一种检索装置的结构示意图,如图10所示,检所装置可以包括一个或者多个处理器1000、一个或多个存储器1001。具体实现中,检索装置还可以进一步包括输入单元1006、显示单元1003,通信单元1002等部件,处理器2011可通过总线分别连接存储器1001、通信单元1002、输入单元1006、显示单元1003等部件。分别描述如下:
处理器1000是检索装置的控制中心,利用各种接口和线路连接检索装置的各个部件,在可能实施例中,处理器1000还可包括一个或多个处理核心。处理器1000可通读取存储在存储器1001内的数据并进行分析比较来执行检索任务。当处理器1000可以为专用处理器也可以为通用处理器,当处理器1000为通用处理器时,处理器1000通过运行或执行存储在存储器1001内的软件程序(指令)和/或模块。
存储器1001可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器1001还可以包括存储器控制器,以提供处理器1000和输入单元1006对存储器1001的访问。存储器1001可具体用于存储软件程序(指令)、以及数据(声学模型库中的相关数据、TTS参数库中的相关数据)。
输入单元1006可用于接收用户输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,输入单元1006可包括触敏表面1005以及其他输入设备1007。触敏表面1005也称为触摸显示屏或者触控板,可收集用户在其上或附近的触摸操作,并根据预先设定的程式驱动相应的连接装置。具体地,其他输入设备1007可以包括但不限于物理键盘、功能键、轨迹球、鼠标、操作杆等中的一种或多种。
显示单元1003可用于显示由用户输入的检索请求或检索装置提供给用户的检索结果以及检索装置的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。具体的,显示单元1003可包括显示面板1004,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板1004。虽然在图10中,触敏表面1005与显示面板1004是作为两个独立的部件,但是在某些实施例中,可以将触敏表面1005与显示面板1004集成而实现输入和输出功能。例如,触敏表面1005可覆盖显示面板1004,当触敏表面1005检测到在其上或附近的触摸操作后,传送给处理器1000以确定触摸事件的类型,随后处理器1000根据触摸事件的类型在显示面板1004上提供相应的视觉输出。
通信单元1002用于通过无线或有线通信技术和其他设备之间进行通信连接,如蜂窝移 动通信技术,WLAN,蓝牙等。用于接收外界发送的检索任务请求,以及向外界返回检索结果。
本领域技术人员可以理解,本申请实施例中检索装置可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。例如,检索装置还可以进一步包括扬声器、摄像头等,在此不再赘述。
具体的,处理器1000可通过读取,并分析判断存储在存储器1001内的数据来实现本申请实施例的检索任务的数据读取方法。包括:接收第一检索任务请求;基于所述第一检索起始地址开始执行第一检索任务的数据读取;在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求;在接收所述第二检索任务请求后获取第一检索任务正要读取的数据的地址;基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址。所述第二检索起始地址可以位于所述第一检索任务正要读取的数据的地址和所述第一检索结束地址区间范围内;基于所述第二检索起始地址开始执行所述第二检索任务的数据读取。
处理器1000还可以通过读取,并分析判断存储在存储器1001内的数据来实现本申请实施例的检索方法。包括:接收第一检索任务请求;基于所述第一检索起始地址开始执行第一检索任务的数据读取;在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求;基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址;所述第二检索起始地址可以位于所述第一检索任务正要读取的数据的地址和所述第一检索结束地址区间范围内;顺序读取数据;判断所读取的数据所对应的检索任务;基于所读取的数据所对应的检索任务进行检索。
处理器1000执行检索任务的数据读取方法,以及数据检索方法的具体实施过程可参考前文的各个方法实施例,这里不再赘述。
需要说明的是,在可能的实现方式中,当图4或图5实施例中的模块为软件模块时,存储器1001可还用于存储这些软件模块,处理器1000可用于调用执行存储器1001内的软件程序(指令)和/或这些软件模块,以及读取存储在存储器1001内的数据来执行检索任务。
还需要说明的是,虽然图10仅仅是本申请检索装置的一种实现方式,所述检索装置中处理器1000和存储器1001,在可能的实施例中,还可以是集成部署的。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者任意组合来实现。当使用软件实现时,可以全部或者部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令,在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述处理器可以是通用处理器或者专用处理器。所述检索装置可以是一个,也可以是多个检索装置组成的计算机网络。所述计算机指令可存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网络站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、微波等)方式向另一个网络站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质,也可以是包含一个或多个可用介质集成的服务器、数据中 心等数据存储设备。所述可用介质可以是磁性介质(例如软盘、硬盘、磁带等)、光介质(例如DVD等)、或者半导体介质(例如固态硬盘)等等。
示例性的,本申请实施例的方案,执行主体可选的可以为ASIC、FPGA、CPU、GPU等,通过硬件或软件方式实现,存储器可选的可以为DDR、SRAM、HDD、SSD等易失或非易失性的存储设备。所述数据检索装置可以应用于多种场景,例如用于视频监控系统的服务器上,示例性的可以是以PCIe扩展卡的形式。
其中ASIC、FPGA属于硬件实现,即在硬件设计时通过硬件描述语言的方式将本申请的方法落地;CPU、GPU属于软件实现,即在软件设计时通过软件程序代码的方式将本申请的方法落地。
在上述实施例中,对各个实施例的描述各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。

Claims (20)

  1. 一种检索任务的数据读取方法,其特征在于,所述方法包括:
    接收第一检索任务请求,所述第一检索任务请求对应有目标数据区域内的第一检索起始地址和第一检索结束地址;
    基于所述第一检索起始地址开始执行第一检索任务的数据读取;
    所述执行第一检索任务的数据读取为从所述第一检索起始地址开始顺序读取目标数据区域的数据直至所述第一检索结束地址;
    在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求;
    基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址;所述第二检索起始地址位于所述第一检索任务正要读取的数据的地址和所述第一检索结束地址区间范围内;
    基于所述第二检索起始地址开始执行所述第二检索任务的数据读取;
    所述目标数据区域为第一检索任务和第二检索任务执行检索均需要遍历读取的数据范围。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址,包括:
    基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的所述第二检索起始地址和第二检索结束地址。
  3. 根据权利要求1或2所述的方法,其特征在于,所述基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址之后,还包括:从所述第一检索任务正要读取的数据的地址开始继续读取数据,判断所述读取的数据的地址是否为所述第二检索起始地址,如果是,则所述读取的数据用于执行所述第二检索任务。
  4. 根据权利要求1或2所述的方法,其特征在于:所述基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址之后,还包括:
    从所述第一检索任务正要读取的数据的地址开始继续读取数据,判断读取的数据的地址是否为所述第一检索结束地址,如果不是,则所述读取的数据还用于执行所述第一检索任务。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,其中所述第二检索任务请求对应有所述目标数据区域内的第二检索起始地址和第二检索结束地址。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址,包括:
    设定所述第一检索任务正要读取的数据的地址为所述第二检索起始地址,或者,设定所述第一检索任务正要读取的数据的地址的下一个地址为所述第二检索起始地址。
  7. 根据权利要求4-6任一项所述的方法,其特征在于,所述基于所述正要读取的数据 的地址确定第二检索任务在所述目标数据区域内的所述第二检索起始地址和第二检索结束地址,包括:
    设定所述第一检索任务正要读取的数据的地址的上一个数据的地址为所述第二检索结束地址;或者,
    设定所述第一检索任务正要读取的数据的地址的地址为所述第二检索结束地址。
  8. 一种数据检索装置,其特征在于,所述装置包括:
    接口模块,用于接收第一检索任务请求,以及在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求;
    所述第一检索任务请求对应有目标数据区域内的第一检索起始地址和第一检索结束地址;
    位置确定模块,用于在所述接口模块接收到所述第二检索任务请求后,基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址,其中,
    所述第二检索起始地址位于所述第一检索任务正要读取的数据的地址和所述第一检索结束地址区间范围内;
    数据读取模块,用于基于所述第一检索起始地址开始执行第一检索任务的数据读取,并基于所述位置确定模块确定的所述第二检索起始地址开始执行所述第二检索任务的数据读取;
    所述第一检索任务的数据读取为从所述第一检索起始地址开始顺序读取目标数据区域的数据直至所述第一检索结束地址;
    所述目标数据区域为第一检索任务和第二检索任务执行检索均需要遍历读取的数据范围。
  9. 根据权利要求8所述的装置,其特征在于,所述数据读取模块还用于判断读取的数据的地址是否为所述第二检索起始地址,如果是,则所述读取的数据用于执行所述第二检索任务。
  10. 根据权利要求8-9任一所述的装置,其特征在于:所述数据读取模块,还用于判断读取的数据的地址是否为所述第一检索结束地址,如果不是,则所述读取的数据还用于执行所述第一检索任务。
  11. 根据权利要求8-10任一所述的装置,其特征在于,所述数据检索装置还包括:
    检索模块,用于基于数据读取模块所读取的数据,以及所述读取的数据所对应的检索任务进行检索。
  12. 根据权利要求8-11任一所述的装置,其特征在于,所述位置设置模块还用于基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索结束地址。
  13. 根据权利要求8-12任一所述的装置,其特征在于,在基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址的方面,
    所述位置设置模块具体用于设定所述正要读取的数据的地址为所述第二检索起始地址。
  14. 根据权利要求12-13所述的装置,其特征在于,在基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索结束地址的方面,
    所述位置设置模块具体用于设定所述正要读取的数据的地址的上一个数据的地址为所述第二检索结束地址。
  15. 一种数据检索系统,其特征在于,所述系统包括:数据检索装置和存储器;
    所述存储器用于存储检索任务进行检索所需要的数据,所述数据检索系统的检索任务执行检索均需要遍历读取存储器的数据;
    所述数据检索装置用于:
    接收第一检索任务请求,所述第一检索任务请求对应有所述存储器内的第一检索起始地址和第一检索结束地址;基于所述第一检索起始地址开始执行第一检索任务的数据读取;所述执行第一检索任务的数据读取为从所述第一检索起始地址开始顺序读取目标数据区域的数据直至所述第一检索结束地址;在所述第一检索任务的执行数据读取的过程中接收第二检索任务请求;基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述存储器的第二检索起始地址;所述第二检索起始地址位于所述第一检索任务正要读取的数据的地址和所述第一检索结束地址区间范围内;基于所述第二检索起始地址开始执行所述第二检索任务的数据读取。
  16. 根据权利要求15所述的系统,其特征在于,所述数据检索装置还用于在所述基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址之后,从所述第一检索任务正要读取的数据的地址开始继续读取数据,判断所述读取的数据的地址是否为所述第二检索起始地址,如果是,则所述读取的数据用于执行所述第二检索任务。
  17. 根据权利要求15-16任一所述的系统,其特征在于:所述数据检索装置还用于在所述基于所述第一检索任务正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址之后,从所述第一检索任务正要读取的数据的地址开始继续读取数据,判断读取的数据的地址是否为所述第一检索结束地址,如果不是,则所述读取的数据还用于执行所述第一检索任务。
  18. 根据权利要求15-17任一所述的系统,其特征在于,所述数据检索装置还用于基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索结束地址。
  19. 根据权利要求15-18任一所述的系统,其特征在于,所述数据检索装置基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索起始地址,包括:
    所述数据检索装置设定所述正要读取的数据的地址为所述第二检索起始地址,或者,设定所述第一检索任务正要读取的数据的地址的下一个地址为所述第二检索起始地址。
  20. 根据权利要求18-19所述的系统,其特征在于,所述数据检索装置还用于基于所述正要读取的数据的地址确定第二检索任务在所述目标数据区域内的第二检索结束地址,包括:
    所述数据检索装置设定所述正要读取的数据的地址的上一个数据的地址为所述第二检索结束地址,或者,
    设定所述第一检索任务正要读取的数据的地址的地址为所述第二检索结束地址。
PCT/CN2019/094378 2018-09-21 2019-07-02 数据检索方法及装置 WO2020057229A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP19862554.3A EP3846026A4 (en) 2018-09-21 2019-07-02 DATA EXTRACTION PROCESS AND DEVICE
US17/206,903 US11620082B2 (en) 2018-09-21 2021-03-19 Data retrieval method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811106483 2018-09-21
CN201811106483.8 2018-09-21

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/206,903 Continuation US11620082B2 (en) 2018-09-21 2021-03-19 Data retrieval method and apparatus

Publications (1)

Publication Number Publication Date
WO2020057229A1 true WO2020057229A1 (zh) 2020-03-26

Family

ID=69888223

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/094378 WO2020057229A1 (zh) 2018-09-21 2019-07-02 数据检索方法及装置

Country Status (4)

Country Link
US (1) US11620082B2 (zh)
EP (1) EP3846026A4 (zh)
CN (1) CN110941636A (zh)
WO (1) WO2020057229A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075233A (zh) * 2006-05-17 2007-11-21 华为技术有限公司 多媒体内容收集部件、系统及其方法
CN102436513A (zh) * 2012-01-18 2012-05-02 中国电子科技集团公司第十五研究所 分布式检索方法和系统
US20120227051A1 (en) * 2011-03-03 2012-09-06 International Business Machines Corporation Composite Contention Aware Task Scheduling
CN103516536A (zh) * 2012-06-26 2014-01-15 重庆新媒农信科技有限公司 基于线程数量限制的服务器业务请求并行处理方法及系统
CN107180113A (zh) * 2017-06-16 2017-09-19 成都亿橙科技有限公司 一种大数据检索平台

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7937541B2 (en) * 2006-10-12 2011-05-03 International Business Machines Corporation Speed selective table scan operation
JP5760556B2 (ja) * 2011-03-18 2015-08-12 富士通株式会社 ストレージ装置、制御装置およびストレージ装置制御方法
US8904091B1 (en) * 2011-12-22 2014-12-02 Western Digital Technologies, Inc. High performance media transport manager architecture for data storage systems
US9292569B2 (en) * 2012-10-02 2016-03-22 Oracle International Corporation Semi-join acceleration
US9411521B2 (en) * 2014-05-30 2016-08-09 Macronix International Co., Ltd. Method and apparatus for improving sequential memory read preformance
US9661066B2 (en) * 2014-06-18 2017-05-23 Yahoo! Inc. System and method for address based locations
CN105808560B (zh) * 2014-12-29 2020-07-31 腾讯科技(深圳)有限公司 一种同机多业务的检索方法及系统
KR20170044782A (ko) * 2015-10-15 2017-04-26 에스케이하이닉스 주식회사 메모리 시스템 및 메모리 시스템의 동작방법
TWI685744B (zh) * 2018-09-06 2020-02-21 大陸商深圳大心電子科技有限公司 指令處理方法及使用所述方法的儲存控制器

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075233A (zh) * 2006-05-17 2007-11-21 华为技术有限公司 多媒体内容收集部件、系统及其方法
US20120227051A1 (en) * 2011-03-03 2012-09-06 International Business Machines Corporation Composite Contention Aware Task Scheduling
CN102436513A (zh) * 2012-01-18 2012-05-02 中国电子科技集团公司第十五研究所 分布式检索方法和系统
CN103516536A (zh) * 2012-06-26 2014-01-15 重庆新媒农信科技有限公司 基于线程数量限制的服务器业务请求并行处理方法及系统
CN107180113A (zh) * 2017-06-16 2017-09-19 成都亿橙科技有限公司 一种大数据检索平台

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3846026A4 *

Also Published As

Publication number Publication date
US20210208818A1 (en) 2021-07-08
EP3846026A1 (en) 2021-07-07
CN110941636A (zh) 2020-03-31
EP3846026A4 (en) 2021-11-03
US11620082B2 (en) 2023-04-04

Similar Documents

Publication Publication Date Title
JP7230083B2 (ja) 地図サービステスト用の方法及び装置
US10826980B2 (en) Command process load balancing system
US8078628B2 (en) Streaming faceted search
US20080040538A1 (en) File readahead method with the use of access pattern information attached to metadata
WO2019000933A1 (zh) 信息显示方法、装置及计算机可读存储介质
US10592312B2 (en) Message oriented middleware with integrated rules engine
CN109564566B (zh) 对调用应用的发现以用于控制文件水化行为
US10515078B2 (en) Database management apparatus, database management method, and storage medium
WO2013078583A1 (zh) 优化数据访问的方法及装置、优化数据存储的方法及装置
CN106294387B (zh) 数据迁移方法和装置
US20210064473A1 (en) Method and device for failover in hbase system, and non-transitory computer-readable storage medium
US11799961B2 (en) File directory traversal method, apparatus, device, and medium
EP3058481A1 (en) Acceleration based on cached flows
CN110413413A (zh) 一种数据写入方法、装置、设备及存储介质
CN111400625A (zh) 页面处理方法、装置、电子设备及计算机可读存储介质
CN110706148B (zh) 人脸图像处理方法、装置、设备和存储介质
CN110168513A (zh) 在不同存储系统中对大文件的部分存储
WO2020057229A1 (zh) 数据检索方法及装置
US20150002275A1 (en) Methods, apparatuses, and computer program products for data transfer between wireless memory tags
US10929432B2 (en) System and method for intelligent data-load balancing for backups
CN114840562B (zh) 业务数据的分布式缓存方法、装置、电子设备及存储介质
US10579446B2 (en) Per-request event detection to improve request-response latency
WO2015039585A1 (en) Method and device for testing software reliability
CN104572638A (zh) 数据读写方法及装置
CN115965074A (zh) 深度学习模型的训练方法、数据处理方法、装置和设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19862554

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019862554

Country of ref document: EP

Effective date: 20210331