Data processing method, device, storage medium and processor

By dividing the index into a first index and a second index, real-time writing of incremental data in data processing and real-time retrieval of massive data is realized, and the problem of low data processing efficiency in the prior art is solved.

CN113553455BActive Publication Date: 2025-05-02ALIBABA GROUP HOLDING LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010339666.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-26
Publication Date
2025-05-02
Estimated Expiration
2040-04-26

AI Technical Summary

Technical Problem

The prior art lacks high-performance real-time write and retrieval solutions in data processing, resulting in low data processing efficiency.

Method used

By dividing the index into a first index and a second index, real-time writing of incremental data is achieved using the first index, and real-time retrieval of massive data is supported using the second index converted from the first index.

Benefits of technology

Real-time writing and real-time retrieval of incremental data is realized, the efficiency of data retrieval is improved, and the problem of low data processing efficiency is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113553455B_ABST
    Figure CN113553455B_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method, device, storage medium and processor. The method comprises: obtaining data to be written; obtaining a first index, wherein the first index is used to write data; writing the data to be written into a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support the retrieval of data that meets a preset condition. The present invention solves the technical problem of low efficiency in data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a data processing method, device, storage medium and processor. Background Art

[0002] At present, in data processing, quantitative indexes are usually oriented towards offline static indexes. Although they can meet the high performance requirements for data queries, there is generally a lack of high-performance solutions for the real-time nature of data processing. For example, the open source basic high-dimensional vector retrieval library (faiss) can only provide basic vector retrieval algorithms, but has no service capabilities and cannot achieve real-time writing and real-time retrieval of indexes, resulting in a technical problem of low efficiency in data processing.

[0003] Currently, no effective solution has been proposed for the above-mentioned problem of low efficiency in data processing. Summary of the invention

[0004] Embodiments of the present invention provide a data processing method, device, storage medium, and processor to at least solve the technical problem of low efficiency in data processing.

[0005] According to one aspect of an embodiment of the present invention, a method for processing data is provided. The method may include: obtaining data to be written; obtaining a first index, wherein the first index is used to write data; writing the data to be written into a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support retrieval of data whose data volume meets a preset condition.

[0006] According to another aspect of an embodiment of the present invention, another data processing method is also provided. The method may include: receiving image data, and extracting feature vectors in the image data as data to be written; obtaining a first index, wherein the first index is used to write data; storing the feature vectors to an associated storage location based on the first index; converting the first index into a second index, wherein, when an image query request is received, an image matching the image query request is queried through the second index, and the second index is used to support the retrieval of data whose data volume meets a preset condition.

[0007] According to another aspect of an embodiment of the present invention, another data processing method is also provided. The method may include: receiving multiple newly added image data, wherein the multiple image data are taken by cameras set at different positions; obtaining a first index, wherein the first index is used to write data; writing the multiple newly added image data and associated information to a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support retrieval of associated information matching the query request.

[0008] According to another aspect of an embodiment of the present invention, another data processing method is also provided. The method may include: receiving data to be written, wherein the data to be written is collected by at least one data collector associated with a data retrieval system; obtaining a first index, wherein the first index is used to write data; writing the data to be written into a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition.

[0009] According to another aspect of an embodiment of the present invention, a data processing device is also provided. The device may include: a first receiving module, used to obtain data to be written; a first obtaining module, used to obtain a first index, wherein the first index is used to write data; a first writing module, used to write the data to be written to a corresponding storage location based on the first index; a first conversion module, used to convert the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition.

[0010] According to another aspect of an embodiment of the present invention, another data processing device is also provided. The device may include: a second receiving module, used to receive image data and extract feature vectors in the image data as data to be written; a second acquisition module, used to acquire a first index, wherein the first index is used to write data; a second writing module, used to store the feature vector to an associated storage location based on the first index; a second conversion module, used to convert the first index into a second index, wherein, when an image query request is received, an image matching the image query request is queried through the second index, and the second index is used to support the retrieval of data whose data volume meets a preset condition.

[0011] According to another aspect of an embodiment of the present invention, another data processing device is also provided. The device may include: a third receiving module, used to receive multiple newly added image data, wherein the multiple image data are taken by cameras set at different positions; a third acquisition module, used to acquire a first index, wherein the first index is used to write data; a third writing module, used to write the multiple newly added image data and associated information to a corresponding storage location based on the first index; a third conversion module, used to convert the first index into a second index, wherein the second index is used to support the retrieval of associated information matching the query request.

[0012] According to another aspect of an embodiment of the present invention, a processor is provided. The processor is used to run a program, wherein the following steps are performed when the program is run: obtaining data to be written; obtaining a first index, wherein the first index is used to write data; writing the data to be written to a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support retrieval of data whose data volume meets a preset condition.

[0013] According to another aspect of an embodiment of the present invention, a mobile terminal is also provided. The terminal may include: a processor; a transmission device for obtaining data to be written; a memory connected to the processor and used to provide the processor with instructions for processing the following processing steps: obtaining a first index, wherein the first index is used to write data; writing the data to be written into a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition.

[0014] In an embodiment of the present invention, data to be written is obtained; a first index is obtained, wherein the first index is used to write data; the data to be written is written to a corresponding storage location based on the first index; the first index is converted into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition. In other words, the present application divides the index into a first index and a second index, and the writing of incremental data is realized through the first index, while the retrieval of massive data is realized through the second index converted from the first index, thereby achieving the purpose of real-time writing and real-time retrieval of incremental data, achieving the technical effect of improving the efficiency of data retrieval, and thus solving the technical problem of low efficiency in data processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0016] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a data processing method is shown;

[0017] Figure 2 is a flow chart of a data processing method according to an embodiment of the present invention;

[0018] Figure 3 is a flow chart of another data processing method according to an embodiment of the present invention;

[0019] Figure 4 is a flow chart of another data processing method according to an embodiment of the present invention;

[0020] Figure 5 is a structural diagram of data processing according to an embodiment of the present invention;

[0021] Figure 6 is a schematic diagram of an interactive interface of a data interaction method according to an embodiment of the present invention;

[0022] Figure 7 is a schematic diagram of a data processing device according to an embodiment of the present invention;

[0023] Figure 8 is a schematic diagram of another data processing device according to an embodiment of the present invention;

[0024] Fig. 9 is a schematic diagram of another data processing device according to an embodiment of the present invention; and

[0025] Fig.10 It is a structural block diagram of a computer terminal according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:

[0029] Real-time: The system must achieve end-to-end real-time capabilities, including the real-time nature of data updates to the system and the real-time nature of front-end retrieval. The general indicator is measured by latency, which is in the second level.

[0030] Feature vector, a vector of features generated by deep learning, can be a high-dimensional vector array;

[0031] Similarity search: input an image and find the top N similar images.

[0032] The Central Processing Unit (CPU) is the computing and control core of a computer, used to interpret computer instructions and process data in computer software;

[0033] The Graphics Processing Unit (GPU) is used to convert and drive the display information required by the computer system, provide line scanning signals to the display, and control the correct display of the display.

[0034] Example 1

[0035] According to an embodiment of the present invention, an embodiment of a data processing method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0036] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a data processing method. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0037] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0038] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the data processing method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the data processing method of the above-mentioned application program is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0039] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0040] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0041] It should be noted that, in some optional embodiments, the above Figure 1The computer device (or mobile device) shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the above-described computer device (or mobile device).

[0042] exist Figure 1 In the operating environment shown, this application provides Figure 2 It should be noted that the data processing method of this embodiment can be Figure 1 The illustrated embodiment is executed by a mobile terminal.

[0043] Figure 2 is a flow chart of a data processing method according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0044] Step S202, obtaining data to be written.

[0045] In the technical solution provided in the above step S202 of the present invention, the data to be written can be incremental data, which is also newly added data, and is data that needs to be written in real time and used for real-time retrieval. Among them, the file with incremental data can be a static file. Real-time is aimed at realizing end-to-end real-time capabilities of the system, which can include the real-time nature of data updates to the system and the real-time nature of front-end retrieval. Its indicators can be measured by latency. Optionally, its indicators can be delays in seconds.

[0046] Step S204, obtaining a first index.

[0047] In the technical solution provided in step S204 of the present invention, after receiving the incremental data to be written, obtaining the first index may be to use an index service to generate the first index, and the first index is used to write the data. The first index may be a linear index,

[0048] Optionally, in this embodiment, the indexes are classified, and a read-write separation data architecture can be adopted to split the index service and the search service. Optionally, this embodiment adopts the above-mentioned read-write separation architecture at the service layer, wherein the index service and the search service can be understood as two modules in terms of performance. The index service is used to implement data writing and can be used to generate a first index, for example, to generate a linear index of real-time memory, which is also a real-time linear index, and can be called a linear index service, which can be a mutable linear index used to write only mutable files, that is, only incremental data; the search service can be used to provide upper-layer index query capabilities for implementing data reading.

[0049] Step S206: write the data to be written into the corresponding storage location based on the first index.

[0050] In the technical solution provided in the above step S206 of the present invention, after the linear index is generated using the index service, the received incremental data can be written to the corresponding storage location based on the linear index, and the corresponding storage location can be a corresponding memory, such as the memory of the predetermined server, so as to improve the ability to write incremental data in real time. Optionally, in this embodiment, the index service can write the incremental data into the message queue (Message Queue) of the corresponding data structure in the CPU or GPU by inserting (Append). Among them, the Append method is to insert the specified content at the end of the selected element (still inside).

[0051] Step S208: converting the first index into a second index, wherein the second index is used to support retrieval of data whose data volume meets a preset condition.

[0052] In the technical solution provided in the above step S208 of the present invention, data query can be queried in a tree manner. Since data query is not a sequential query, after the first index is generated by using the index service, the linear index can be converted into a second index. The second index is used to support the retrieval of data whose data volume meets the preset conditions. For example, when the data volume exceeds the target threshold, it is determined that the data volume meets the preset conditions, so that the second index is used to support the retrieval of data whose data volume exceeds the target threshold, that is, the second index can be used to support the retrieval of massive data. Optionally, the second index of this embodiment is a quantitative index, which is an index that is first filtered and then classified, and can be applied to the query method. The index result of the quantitative index makes the data processing more efficient. For example, the product quantization (ProductQuantization, referred to as PQ) algorithm is used to improve the ability of real-time data retrieval. In this embodiment, the background is configured with a background service corresponding to the linear index. The linear index can periodically construct a quantitative index through the background service.

[0053] Optionally, the quantization index of this embodiment is an immutable quantization index that supports massive historical data. The mutable linear index can be converted into the above-mentioned immutable quantization index, so as to target read-only data, such as static historical data. Among them, the retrieval service can retrieve the above-mentioned immutable quantization index and mutable linear index, and rerank the above two parts of data, so as to achieve the ability of similar retrieval, wherein similar retrieval can refer to inputting an image and finding similar topN image results. Optionally, in the case of a large amount of data, a large number of quantization indexes can be continuously generated, and linear indexing cannot be performed. The mutable linear index can be a log file, which targets new incremental data.

[0054] Optionally, in this embodiment, the background is configured with a background service corresponding to the linear index, and the linear index can periodically construct a quantitative index through the background service. Optionally, the immutable quantitative index can be automatically constructed from the mutable linear index by the background thread, and through flexible adaptation of various high-performance indexing algorithms, it supports the retrieval data volume that is multiple times that of the mutable linear index, while providing real-time retrieval capabilities at the second level.

[0055] Through the above steps S202 to S208 of the present application, the data to be written is obtained; the first index is obtained, wherein the first index is used to write the data; the data to be written is written to the corresponding storage location based on the first index; the first index is converted into a second index, wherein the second index is used to support the retrieval of data whose data volume meets the preset conditions. In other words, this embodiment divides the index into a first index and a second index, and the writing of incremental data is realized through the first index, and the retrieval of massive data is realized through the second index converted from the first index, thereby achieving the purpose of real-time writing and real-time retrieval of incremental data, achieving the technical effect of improving the efficiency of data retrieval, and thus solving the technical problem of low efficiency in data processing.

[0056] The above method of this embodiment is further introduced below.

[0057] As an optional implementation, the creation service uses an indexing algorithm to convert the linear index into a quantized index, wherein the quantized index uses a mixture of heterogeneous computing resources.

[0058] In this embodiment, a service may be created in the background, and the service may be a conversion service (build service), and the linear index may be automatically converted into a quantitative index according to a suitable index algorithm through the created service. Optionally, the index method used in this embodiment to convert the linear index into a quantitative index may be a quantization algorithm of an inverted index, and may be a quantization method based on an inverted index.

[0059] As an optional implementation, in step S208, before converting the first index into the second index, the method also includes: reading a pre-stored conversion condition; based on the conversion condition, determining whether to convert the linear index into a quantized index, wherein the conversion condition includes at least one of the following: the amount of data to be written, the remaining space of the storage space where the storage location is located, and the set conversion cycle.

[0060] In this embodiment, the conversion of the linear index into the quantized index requires certain conversion conditions. Before converting the linear index into the quantized index, the pre-stored conversion condition can be read, and the conversion condition can be set according to the configuration data, and can be set according to the amount of data to be written, for example, according to the amount of data to be written; it can also be set according to hardware performance, for example, according to the storage capacity of the configured machine, and can be set according to the remaining space of the storage space where the storage location corresponding to the incremental data is located; a certain conversion cycle can also be set, that is, by setting the timing condition to determine whether the linear index needs to be converted into a quantized index.

[0061] As an optional implementation, the linear index is converted into a quantitative index when the conversion conditions meet at least one of the following conditions: the amount of data to be written exceeds a preset order of magnitude, the remaining space of the storage space where the storage location is located is less than a preset storage capacity, and the set conversion cycle is reached.

[0062] In this embodiment, when the conversion condition is set according to the amount of data to be written, the order of magnitude can be set in advance. When the amount of incremental data exceeds the preset order of magnitude, it can be determined that the conversion condition is met, and then the linear index is converted into a quantized index.

[0063] Optionally, when the conversion condition is set based on the remaining space of the storage space where the storage location is located, the storage capacity for the storage space can be set in advance, and when the remaining space of the storage space where the storage location is located is less than the preset storage capacity, it can be determined that the conversion condition is met, then the linear index is converted into a quantized index.

[0064] Optionally, in the case where the conversion condition is set according to the conversion period, when the current time reaches the set conversion period, it can be determined that the conversion condition is satisfied, and then the linear index is converted into a quantized index.

[0065] As an optional implementation, the method further includes: receiving a query request; and obtaining a query result by using the linear index and the quantitative index in parallel based on the query request by the heterogeneous computing resources.

[0066] In this embodiment, a query request is received, and the query request may be a query request in a certain scenario, such as an image query request, for searching for images matching the image query request. Optionally, this embodiment uses a linear index and a quantitative index to obtain a query result based on the query request using heterogeneous computing resources in a parallel manner, wherein the heterogeneous computing resources are also heterogeneous computing resources. Optionally, by dividing the index into two types of index architectures, namely, mutable linear index and immutable quantitative index, and using heterogeneous computing resources, real-time update and real-time query of the index are achieved.

[0067] Optionally, in this embodiment, for mutable linear indexes, a writing scheme similar to the database WAL architecture can be used to ensure the real-time reading and writing of background indexes, and also to ensure the real-time retrieval of historical massive data. Optionally, data is first appended to a linear queue, and the linear queue is in small batches and flexibly uses heterogeneous computing resources, thereby providing high-performance linear retrieval capabilities to the outside world and achieving the effect of real-time writing and real-time retrieval of incremental data.

[0068] As an optional implementation, the heterogeneous computing resources include a CPU and a GPU, wherein the computing resources are selected based on the query request.

[0069] In this embodiment, heterogeneous computing resources may include CPU computing and GPU computing resources, wherein the selection basis of CPU computing resources or GPU computing resources may be determined according to the query request, that is, CPU computing resources or GPU computing resources may be flexibly used according to the amount of data to be processed. For example, GPU computing resources may be used for scenarios requiring high throughput, and GPU computing resources may be used for data amounts below the billion level. Otherwise, CPU computing resources may be used as a substitute, and CPU computing resources may be used for data amounts above the billion level. It should be noted that this embodiment may be flexibly configured according to specific usage scenarios.

[0070] Optionally, in this embodiment, for heterogeneous computing resources, real-time, small-batch linear indexes can be built through CPU / GPU, and massive static indexes can be built through GPU / CPU to achieve real-time performance of the entire link.

[0071] exist Figure 1 Under the operating environment shown, this application also provides Figure 3 It should be noted that the data processing method of this embodiment can also be implemented by Figure 1 The illustrated embodiment is executed by a mobile terminal.

[0072] Figure 3 FIG. 1 is a flow chart of another data processing method according to an embodiment of the present invention. Figure 3 As shown, the method may include the following steps:

[0073] Step S302, receiving image data, and extracting feature vectors in the image data as data to be written.

[0074] In the technical solution provided in the above step S302 of the present invention, image data may be received, which may be data of a picture collected by an image acquisition device, wherein the camera device may be a camera. This embodiment may use a deep learning algorithm to extract feature vectors from the image data, which may be a high-dimensional vector array, and use it as data to be written, and the data to be written may be incremental data to be written. The feature vectors of this embodiment are data that need to be written in real time and used for real-time retrieval.

[0075] Step S304, obtaining a first index.

[0076] In the technical solution provided in the above step S304 of the present invention, after receiving the image data and extracting the feature vector in the image data as the data to be written, the first index is obtained, and the first index may be generated by using an index service, thereby improving the ability to write the feature vector in real time. The first index is used for writing data and may be a linear index.

[0077] Optionally, in this embodiment, the indexes are classified, and a read-write separation data architecture can be adopted at the service layer to split the index service and the retrieval service. The index service is used to implement data writing and can be used to generate a first index, which can be a linear index, such as a mutable linear index; the retrieval service can be used to provide an upper-layer index query capability to implement data reading.

[0078] Step S306: storing the feature vector to an associated storage location based on the first index.

[0079] In the technical solution provided in the above step S306 of the present invention, after the first index is generated using the index service, the received feature vector can be written to an associated storage location based on the first index, and the associated storage location can refer to a storage location associated with the image data. Optionally, in this embodiment, the index service can write the feature vector to a message queue of a corresponding data structure in the CPU or GPU through an Append method, and provide a first index, such as providing a linear index.

[0080] Step S308: converting the first index into a second index, wherein when an image query request is received, searching for images matching the image query request through the second index.

[0081] In the technical solution provided in the above step S308 of the present invention, after the feature vector is stored in the associated storage location based on the first index, the first index can be converted into a second index, and the second index is used to support the retrieval of data whose data volume meets the preset conditions, for example, when the data volume exceeds the target threshold, it is determined that the data volume meets the preset conditions, that is, the second index is used to support the retrieval of data whose data volume exceeds the target threshold, for example, to support the retrieval of massive data, and can be a quantitative index, for example, an immutable quantitative index, and when an image query request is received, an image matching the image query request can be queried through the second index. Optionally, in this embodiment, the background is configured with a background service corresponding to the linear index, and the linear index can periodically construct the above-mentioned quantitative index through the background service.

[0082] In this embodiment, the real-time image retrieval can be achieved through mutable linear indexing and immutable indexing, and by adopting different indexing algorithms and heterogeneous computing resources, thereby realizing image search services.

[0083] Through the above steps S302 to S308, image data is received, and feature vectors in the image data are extracted as data to be written; a linear index is generated using an index service, wherein a first index is used to write data; feature vectors in the image data are stored in an associated storage location based on the linear index; the first index is converted into a second index, wherein, when an image query request is received, an image matching the image query request is queried through the second index, and the second index is used to support the retrieval of data whose data volume meets a preset condition. In other words, this embodiment divides the index into a linear index and a quantitative index, and writes feature vectors in the image data through the linear index, and queries images matching the image query request through the second index, thereby achieving the purpose of real-time writing and real-time retrieval of incremental data, achieving the technical effect of improving the efficiency of data retrieval, and thus solving the technical problem of low efficiency in data processing.

[0084] exist Figure 1 Under the operating environment shown, this application also provides Figure 4 It should be noted that the data processing method of this embodiment can also be implemented by Figure 1 The illustrated embodiment is executed by a mobile terminal.

[0085] Figure 4 FIG. 1 is a flow chart of another data processing method according to an embodiment of the present invention. Figure 4 As shown, the method may include the following steps:

[0086] Step S402: receiving a plurality of newly added image data, wherein the plurality of image data are captured by cameras disposed at different positions.

[0087] In the technical solution provided in the above step S402 of the present invention, the received multiple image data, i.e., the newly added data, are data that need to be written in real time for real-time retrieval. Optionally, the multiple image data are collected by an image acquisition device, and the image acquisition device can be a camera set at different locations, for example, thousands of cameras set at different locations in a city, so that the multiple image data are obtained by shooting with the cameras at different locations. The multiple image data are data of multiple pictures that need to be written in real time for real-time retrieval.

[0088] Step S404, obtaining a first index.

[0089] In the technical solution provided in the above step S404 of the present invention, after receiving the newly added multiple image data, the first index is obtained, and the second index may be generated by using the first service, and the first index is used for writing data.

[0090] Optionally, in this embodiment, the indexes are classified, and a read-write separation data architecture can be adopted at the service layer to split the index service and the retrieval service. The index service is used to implement data writing and can be used to generate a second index, such as generating a linear index, which can be a mutable linear index; the retrieval service can be used to provide an upper-layer index query capability to implement data reading.

[0091] Step S406: writing the newly added plurality of image data and associated information into corresponding storage locations based on the first index.

[0092] After the index service is used to generate a linear index, the newly added multiple image data and associated information can be written into the corresponding storage location based on the linear index, wherein the associated information can be any information related to the image data, thereby improving the ability to write feature vectors in real time. Optionally, in this embodiment, the index service can write the newly added multiple image data and associated information into the message queue of the corresponding data structure in the CPU or GPU through the Append method to provide a linear index.

[0093] Step S408: convert the first index into a second index, wherein the second index is used to support retrieval of associated information matching the query request.

[0094] In the technical solution provided in the above step S408 of the present invention, after the newly added multiple image data and associated information are written into the corresponding storage location based on the first index, the first index is converted into a second index. For example, the linear index can be converted into a quantitative index. The quantitative index is used to support the retrieval of data whose data volume exceeds the target threshold. It can be an immutable quantitative index. When a query request is received, the associated information matching the query request can be queried through the quantitative index. Optionally, in this embodiment, the background is configured with a background service corresponding to the linear index, and the linear index can periodically construct a quantitative index through the background service.

[0095] In this embodiment, real-time retrieval of matching associated information can be achieved through mutable linear indexing and immutable quantitative indexing, and by adopting different indexing algorithms and heterogeneous computing resources.

[0096] Through the above steps S402 to S408, multiple newly added image data are received, wherein the multiple image data are obtained by taking pictures of cameras set at different positions; a first index is obtained, wherein the first index is used to write data; based on the first index, the multiple newly added image data and related information are written into the corresponding storage location; the first index is converted into a second index, wherein the second index is used to support the retrieval of related information matching the query request. In other words, this embodiment divides the index into a first index and a second index, and the writing of the multiple newly added image data is realized through the first index, and the related information matching the query request is queried through the second index, thereby achieving the purpose of real-time writing and real-time retrieval of the multiple newly added image data, achieving the technical effect of improving the efficiency of data retrieval, and thus solving the technical problem of low efficiency in data processing.

[0097] The above method of this embodiment is further introduced below.

[0098] As an optional implementation, a query request is received, wherein the query request includes image information to be queried; associated information matching the image information to be queried is obtained through quantitative indexing, wherein the associated information includes at least one of the following: device information of a camera that captures each image data, shooting time, and shooting location.

[0099] In this embodiment, online search can be implemented through query requests. Optionally, image information can be queried through query requests, and the image information can include key attributes of the image. After the linear index is converted into a quantitative index, the associated information matching the image information to be queried can be obtained through the quantitative index. The associated information can include but is not limited to the information of the camera of each image data, the time when each image was taken, and the location where each image was taken, etc. Optionally, it can also be a real-time query result similar to the input image data, for example, to find the topN image data similar to the input image data, thereby improving the performance of data retrieval.

[0100] As an optional implementation, the image data captured by the camera at different times is used as data to be written into the memory and needs to be written into a predetermined server in real time or at a scheduled time.

[0101] In this embodiment, after receiving the image data captured by the camera at different times, the image data captured by the camera at different times can be used as data to be written into the memory, and the data to be written into the memory can be incremental data, which can be written into the memory of the predetermined server in real time or periodically. Optionally, this embodiment writes the incremental data into the memory of the predetermined server based on the linear index.

[0102] As an optional example, the data processing method of this embodiment includes: receiving data to be written, wherein the data to be written is collected by at least one data collector associated with a data retrieval system; obtaining a first index, wherein the first index is used to write data; writing the data to be written to a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets preset conditions.

[0103] The data processing method of this embodiment can be applied to a data retrieval system, and the data retrieval system can be any retrieval system belonging to a big data scenario, for example, a retrieval system in an industrial artificial intelligence (AI) scenario, without specific limitation here. Optionally, data to be written is received, that is, new data is received from the data retrieval system, which needs to be written in real time for real-time retrieval. Optionally, the data to be written is collected by at least one data collector associated with the data retrieval system, and the at least one data collector can be a data collector arranged at different positions as needed.

[0104] Optionally, in this embodiment, the indexes are classified, and a read-write separation data architecture can be adopted at the service layer to split the index service and the retrieval service. The index service is used to write data to the data retrieval system, and can be used to generate a second index, such as generating a linear index, which can be a mutable linear index; the retrieval service can be used to provide the upper layer index query capability, and is used to realize the data reading of the data retrieval system.

[0105] After the linear index is generated using the index service, the data to be written can be written to the corresponding storage location based on the linear index. Optionally, in this embodiment, the index service can write the data to be written into the message queue of the corresponding data structure in the CPU or GPU through the Append method to provide the linear index.

[0106] After the data to be written is written to the corresponding storage location based on the first index, the first index is converted into a second index. For example, the linear index can be converted into a quantitative index. The quantitative index is used to support the retrieval of data whose data volume exceeds the target threshold, and can be an immutable quantitative index. Optionally, in this embodiment, the background is configured with a background service corresponding to the linear index, and the linear index can periodically construct a quantitative index through the background service.

[0107] As an optional implementation, receiving data to be written includes: receiving multiple newly added image data, wherein the multiple image data are captured by at least one camera associated with the data retrieval system, and the at least one camera is set at a different position.

[0108] In this embodiment, the data retrieval system can be a retrieval system in an image retrieval scenario, and the received multiple image data, i.e., newly added data, are data that need to be written in real time for real-time retrieval. Optionally, multiple image data are collected by an image acquisition device, and the image acquisition device can be a camera set at different locations, for example, thousands of cameras set at different locations in a city, so that multiple image data are obtained by shooting with cameras at different locations, and the multiple image data are data of multiple pictures that need to be written in real time for real-time retrieval. Optionally, after using the index service to generate a linear index, this embodiment can write the newly added multiple image data and associated information into the corresponding storage location based on the linear index, wherein the associated information can be any information related to the image data, thereby improving the ability to write feature vectors in real time. Optionally, in this embodiment, the index service can write the newly added multiple image data and associated information into the message queue of the corresponding data structure in the CPU or GPU through the Append method to provide a linear index. After the newly added multiple image data and associated information are written into the corresponding storage location based on the first index, the first index is converted into a second index. For example, the linear index can be converted into a quantitative index. When a query request is received, the associated information matching the query request can be queried through the quantitative index. Optionally, in this embodiment, the background is configured with a background service corresponding to the linear index, and the linear index can periodically construct a quantitative index through the background service.

[0109] As an optional implementation, the data to be written is used to be input into a trained neural network model for processing, or is used to train a neural network model.

[0110] The data retrieval system of this embodiment can be applied in industrial AI, and the data to be written can be used to input into a trained neural network model for processing to obtain corresponding output results, and can also be used as sample data for training the neural network model, wherein the neural network model is a unified data processing model that uses AI technology in industrial applications to map input data to output data with a corresponding relationship therewith, thereby realizing automatic data processing. This embodiment can write the above-mentioned data to be written into the corresponding storage location based on the first index, convert the first index into a second index, so as to realize the retrieval of data whose data volume meets the preset conditions through the second index, thereby improving the efficiency of data processing.

[0111] In this embodiment, indexes are classified into linear indexes that support real-time writing and quantitative indexes that support massive data retrieval, and real-time data retrieval is achieved by adopting different indexing algorithms and heterogeneous computing resources. Among them, linear indexes can periodically build quantitative indexes through background services; the real-time nature of background reading and writing can be guaranteed through the database writing scheme, while also ensuring the real-time nature of retrieval of historical massive data; the CPU / GPU computing resources are flexibly used to build real-time, small-batch linear indexes, and massive static indexes are built through the GPU / CPU to achieve full-link real-time nature, thereby providing high-performance linear retrieval capabilities to the outside world, and achieving the purpose of real-time writing and real-time retrieval of incremental data, solving the technical problem of low efficiency in data processing, and achieving the technical effect of improving the efficiency of data processing.

[0112] Example 2

[0113] The technical solution of the present invention is illustrated below in conjunction with preferred implementation modes.

[0114] In the process of building the city brain visual computing platform system, the system uses deep learning algorithms to calculate target attributes and feature vectors for images collected by thousands of cameras, and updates the calculated structured data to the visual index system. Among them, it can provide basic similar target search and key attribute filtering capabilities for upper-level applications. At the same time, the system requires end-to-end real-time performance of indexing, and the visible delay from insertion to indexing to the front end must be guaranteed to be within 1 second, and can provide the highest possible query rate (Query Per Second, referred to as QPS). Traditional quantitative indexing is oriented towards offline static indexing. Although it can meet the high performance of queries, it generally lacks high-performance solutions for real-time performance.

[0115] This embodiment can implement real-time update and real-time query of the index by dividing the index into a mutable linear index and an immutable quantitative index and using GPU / CPU heterogeneous computing resources in a mixed manner. The method is further described below.

[0116] Figure 5 Schematic diagram of a data processing structure according to an embodiment of the present invention. Figure 5 As shown, a read-write separation architecture is adopted in the service layer, which is split into index service and search service. The index service and search service can be understood as two modules in terms of performance. The index service is used to implement data writing and generate real-time memory linear indexes, and the search service is used to provide upper-layer index query capabilities.

[0117] The index service of this embodiment writes the newly added data into the message queue (Message Queue) of the corresponding data structure of the central processing unit (CPU) or graphics processing unit (GPU) by appending, and provides linear index service. Among them, the selection basis of CPU / GPU is based on the query request. In the scenario requiring high throughput, GPU can be used, otherwise CPU can be used instead. Optionally, the index service only writes variable files and only writes incremental data, and the files with increments can be static files.

[0118] In this embodiment, the background is configured with a background service corresponding to the linear index, and the linear index can build a quantitative index regularly through the background service. In the background, the real-time data can be automatically converted into an immutable quantitative index according to a suitable indexing algorithm through the build service. This part can flexibly use the computing resources of the CPU / GPU according to the size of the data. For general data indexes below the billion level, the GPU can be used, and for data above the billion level, the CPU can be used, which can be flexibly configured according to specific scenarios.

[0119] In this embodiment, two parts of data can be retrieved using the retrieval service, including the immutable quantized index and the mutable linear index, and the two parts of data are reranked, thereby realizing the similarity retrieval capability.

[0120] In this embodiment, the real-time update and real-time query of the index are achieved by dividing the index into two types of index architectures: mutable linear index and immutable quantitative index, and hybrid use of GPU / CPU heterogeneous computing resources. For mutable linear index, a WAL-like architecture can be adopted. First, the data is appended to the linear queue (CPU / GPU). The linear queue is a small batch and flexibly uses the computing resources of the CPU / GPU, thereby providing high-performance linear retrieval capabilities to the outside world and achieving the purpose of real-time writing and real-time retrieval capabilities for incremental data; for immutable quantitative index, it can be automatically constructed from the mutable linear index by the background thread, and by flexibly adapting various high-performance indexing algorithms, it supports the retrieval data volume that is many times that of the mutable linear index, while providing real-time retrieval capabilities at the second level.

[0121] Figure 6 Schematic diagram of an interactive interface of a data interaction method according to an embodiment of the present invention. Figure 6As shown, the user can drag the newly added multiple image data obtained by taking pictures with cameras set at different positions into the "Add" text box, and process the newly added multiple image data by clicking the "Data Processing" button. Finally, the newly added multiple image data and related information are written into the corresponding storage location, and the related information matching the query request is output. The related information may include but is not limited to the information of the camera of each image data, the time when each image is taken, and the location where each image is taken, etc., so as to achieve the purpose of real-time writing and real-time retrieval of incremental data, solve the technical problem of low efficiency in data processing, and achieve the technical effect of improving the efficiency of data processing.

[0122] This embodiment classifies the indexes through the above method to obtain mutable linear indexes that support real-time writing and immutable quantitative indexes that support historical massive data retrieval, and realizes real-time image retrieval by adopting different indexing algorithms and heterogeneous computing resources; the database WAL writing solution can be adopted to ensure the real-time reading and writing of background indexes, and the real-time retrieval of historical massive data can also be guaranteed; the architecture of heterogeneous computing resources builds real-time, small batch, linear indexes through CPU / GPU, and builds massive static indexes through GPU / CPU to achieve full-link real-time, thereby solving the technical problem of low efficiency in data processing and achieving the technical effect of improving the efficiency of data processing.

[0123] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0125] Example 3

[0126] According to an embodiment of the present invention, there is also provided a method for implementing the above Figure 2 A data processing device according to the data processing method shown.

[0127] Figure 7 is a schematic diagram of a data processing device according to an embodiment of the present invention. Figure 7 As shown, the data processing device 70 may include: a first receiving module 71 , a first acquiring module 72 , a first writing module 73 and a first converting module 74 .

[0128] The first receiving module 71 is used to obtain data to be written.

[0129] A first acquisition module 72, used to acquire a first index, wherein the first index is used to write data;

[0130] The first writing module 73 is used to write the to-be-written data into a corresponding storage location based on the first index.

[0131] The first conversion module 74 is used to convert the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition.

[0132] It should be noted that the first receiving module 71, the first acquiring module 72, the first writing module 73 and the first converting module 74 correspond to steps S202 to S208 in Embodiment 1, respectively. The four modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Embodiment 1.

[0133] According to another embodiment of the present invention, there is also provided a method for implementing the above Figure 3 A data processing device according to the data processing method shown.

[0134] Figure 8 is a schematic diagram of another data processing device according to an embodiment of the present invention. Figure 8 As shown, the data processing device 80 may include: a second receiving module 81 , a second acquiring module 82 , a second writing module 83 and a second converting module 84 .

[0135] The second receiving module 81 is used to receive image data and extract feature vectors in the image data as data to be written.

[0136] A second acquisition module 82 is used to acquire a first index, wherein the first index is used to write data;

[0137] The second writing module 83 is used to store the feature vector to the associated storage location based on the first index.

[0138] The second conversion module 84 is used to convert the first index into a second index, wherein, when an image query request is received, an image matching the image query request is searched through the second index, and the second index is used to support the retrieval of data whose data volume meets a preset condition.

[0139] It should be noted that the second receiving module 81, the second acquiring module 82, the second writing module 83 and the second converting module 84 correspond to steps S302 to S308 in Embodiment 1, respectively. The examples and application scenarios implemented by the four modules and the corresponding steps are the same, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Embodiment 1.

[0140] According to another embodiment of the present invention, there is also provided a method for implementing the above Figure 4 A data processing device according to the data processing method shown.

[0141] Fig. 9 is a schematic diagram of another data processing device according to an embodiment of the present invention. Fig. 9 As shown, the data processing device 90 may include: a third receiving module 91 , a third acquiring module 92 , a third writing module 93 and a third converting module 94 .

[0142] The third receiving module 91 is used to receive a plurality of newly added image data, wherein the plurality of image data are captured by cameras arranged at different positions.

[0143] The third acquisition module 92 is used to acquire a first index, wherein the first index is used to write data.

[0144] The third writing module 93 is used to write the newly added multiple image data and associated information into a corresponding storage location based on the first index.

[0145] The third conversion module 94 is used to convert the first index into a second index, wherein the second index is used to support the retrieval of associated information matching the query request.

[0146] It should be noted that the third receiving module 91, the third acquiring module 92, the third writing module 93 and the third converting module 94 correspond to steps S402 to S408 in Embodiment 1, respectively. The examples and application scenarios implemented by the four modules and the corresponding steps are the same, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Embodiment 1.

[0147] The data processing device of this embodiment divides the index into a first index and a second index, and implements the writing of incremental data through the first index, and implements the retrieval of massive data through the second index converted from the first index, thereby achieving the purpose of real-time writing and real-time retrieval of incremental data, realizing the technical effect of improving the efficiency of data retrieval, and further solving the technical problem of low efficiency in data processing.

[0148] Example 4

[0149] The embodiment of the present invention can provide a computer terminal, which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal can also be replaced by a terminal device such as a mobile terminal.

[0150] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.

[0151] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the method for processing data of an application: obtaining the data to be written; obtaining a first index, wherein the first index is used to write the data; writing the data to be written into a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets preset conditions.

[0152] Optionally, Fig.10 is a structural block diagram of a computer terminal according to an embodiment of the present invention. Fig.10 As shown, the mobile terminal A may include: one or more (only one is shown in the figure) processors 102 , a memory 104 and a transmission device 106 .

[0153] A transmission device is used to obtain data to be written; a memory is connected to a processor and is used to provide the processor with instructions for processing the following processing steps: obtaining a first index, wherein the first index is used to write data; writing the data to be written into a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition.

[0154] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the data processing method and device in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned data processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the mobile terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0155] As an optional example, the processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the data to be written; obtain a first index, wherein the first index is used to write the data; write the data to be written to the corresponding storage location based on the first index; convert the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets the preset conditions.

[0156] Optionally, the processor may further execute program code of the following steps: creating a service to convert a linear index into a quantized index using an index algorithm, wherein the quantized index uses a mixture of heterogeneous computing resources.

[0157] Optionally, the processor may also execute the following program code: before converting the first index into the second index, reading a pre-stored conversion condition; based on the conversion condition, determining whether to convert the linear index into a quantized index, wherein the conversion condition includes at least one of the following: the amount of data to be written, the remaining space of the storage space where the storage location is located, and the set conversion cycle.

[0158] Optionally, the processor may also execute the program code of the following steps: converting the linear index into a quantitative index when the conversion conditions meet at least one of the following conditions: the amount of data to be written exceeds a preset order of magnitude, the remaining space of the storage space where the storage location is located is less than a preset storage capacity, and the set conversion cycle is reached.

[0159] Optionally, the processor may also execute program codes of the following steps: receiving a query request; and obtaining query results by using linear indexes and quantitative indexes in parallel based on the query request by heterogeneous computing resources.

[0160] Optionally, the processor may further execute program code of the following steps: selecting computing resources based on the query request.

[0161] As another optional example, the processor can call the information and application stored in the memory through the transmission device to perform the following steps: receive image data, and extract feature vectors in the image data as data to be written; obtain a first index, wherein the first index is used to write data; store the feature vector to an associated storage location based on the first index; convert the first index into a second index, wherein, when an image query request is received, an image matching the image query request is queried through the second index, and the second index is used to support the retrieval of data whose data volume meets preset conditions.

[0162] Optionally, the processor may also execute program code of the following steps: when the data volume exceeds a target threshold, determining that the data volume satisfies a preset condition.

[0163] As another optional example, the processor can call the information and application stored in the memory through the transmission device to perform the following steps: receiving multiple newly added image data, wherein the multiple image data are captured by cameras set at different positions; obtaining a first index, wherein the first index is used to write data; based on the first index, writing the multiple newly added image data and related information to the corresponding storage location; converting the first index into a second index, wherein the second index is used to support the retrieval of related information that matches the query request.

[0164] Optionally, the processor may also execute program code of the following steps: receiving a query request, wherein the query request includes image information to be queried; obtaining associated information matching the image information to be queried through a quantitative index, wherein the associated information includes at least one of the following: device information of a camera that captures each image data, shooting time, and shooting location.

[0165] Optionally, the processor may also execute program code of the following steps: image data captured by the camera at different times is used as incremental data to be written into the memory, and needs to be written into a predetermined server in real time or periodically.

[0166] As another optional example, the processor can call the information and application stored in the memory through the transmission device to perform the following steps: receiving data to be written, wherein the data to be written is collected by at least one data collector associated with the data retrieval system; obtaining a first index, wherein the first index is used to write data; writing the data to be written to a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets preset conditions.

[0167] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: receiving multiple newly added image data, wherein the multiple image data are captured by at least one camera associated with the data retrieval system, and the at least one camera is set at a different position.

[0168] According to an embodiment of the present invention, a method for processing data is provided, which is characterized by comprising: obtaining data to be written; obtaining a first index, wherein the first index is used for writing data; writing the data to be written into a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition. In other words, the present application divides the index into a first index and a second index, and implements the writing of incremental data through the first index, and implements the retrieval of massive data through the second index converted from the first index, thereby achieving the purpose of real-time writing and real-time retrieval of incremental data, achieving the technical effect of improving the efficiency of data retrieval, and thus solving the technical problem of low efficiency in data processing.

[0169] It can be understood by those skilled in the art that Fig.10 The structure shown is for illustration only, and the mobile terminal A may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Fig.10 It does not limit the structure of the above electronic device. For example, the mobile terminal A may also include Fig.10 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig.10 Different configurations are shown.

[0170] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0171] Example 5

[0172] The embodiment of the present invention further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the data processing method provided in the first embodiment.

[0173] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0174] As an optional example, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining data to be written; obtaining a first index, wherein the first index is used to write data; writing the data to be written to a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition.

[0175] Optionally, the storage medium is further configured to store program codes for executing the following steps: the creation service uses an indexing algorithm to convert a linear index into a quantized index, wherein the quantized index uses a mixture of heterogeneous computing resources.

[0176] Optionally, the storage medium is also configured to store program code for performing the following steps: before converting the first index into the second quantity index, reading a pre-stored conversion condition; based on the conversion condition, determining whether to convert the linear index into a quantitative index, wherein the conversion condition includes at least one of the following: the amount of data to be written, the remaining space of the storage space where the storage location is located, and the set conversion cycle.

[0177] Optionally, the storage medium is also configured to store program code for executing the following steps: converting the linear index into a quantized index when the conversion conditions meet at least one of the following: the amount of data to be written exceeds a preset order of magnitude, the remaining space of the storage space where the storage location is located is less than a preset storage capacity, and the set conversion cycle is reached.

[0178] Optionally, the storage medium is further configured to store program codes for executing the following steps: receiving a query request; and obtaining query results by using linear indexes and quantized indexes in parallel based on the query request by heterogeneous computing resources.

[0179] Optionally, the storage medium is further configured to store program code for executing the following steps: selecting a computing resource based on the query request.

[0180] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving image data and extracting feature vectors in the image data as data to be written; obtaining a first index, wherein the first index is used to write data; storing the feature vector to an associated storage location based on the first index; converting the first index into a second index, wherein, upon receiving an image query request, searching for an image matching the image query request through the second index.

[0181] As an optional example, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving image data and extracting feature vectors in the image data as data to be written; obtaining a first index, wherein the first index is used to write data; storing the feature vector to an associated storage location based on the first index; converting the first index into a second index, wherein, when an image query request is received, an image matching the image query request is queried through the second index.

[0182] Optionally, in this embodiment, the storage medium is configured to store a program code for executing the following steps: when the data amount exceeds a target threshold, determining that the data amount meets a preset condition.

[0183] As an optional example, in this embodiment, the storage medium is configured to store program code for executing the following steps: receiving multiple newly added image data, wherein the multiple image data are captured by cameras set at different positions; obtaining a first index, wherein the first index is used to write data; writing the multiple newly added image data and associated information to a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support retrieval of associated information that matches the query request.

[0184] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving a query request, wherein the query request includes image information to be queried; obtaining associated information matching the image information to be queried through a quantitative index, wherein the associated information includes at least one of the following: device information of a camera that captures each image data, a capturing time, and a capturing location.

[0185] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: image data captured by the camera at different times is used as incremental data to be written into the memory, and needs to be written into a predetermined server in real time or periodically.

[0186] As an optional example, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving data to be written, wherein the data to be written is collected by at least one data collector associated with a data retrieval system; obtaining a first index, wherein the first index is used to write data; writing the data to be written to a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition.

[0187] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: receiving multiple newly added image data, wherein the multiple image data are captured by at least one camera associated with the data retrieval system, and the at least one camera is set at a different position.

[0188] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0189] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0190] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0191] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0192] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0193] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0194] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A data processing method, characterized in that: include: Get the data to be written; Obtain a first index, wherein the first index is used for writing data and the first index is a linear index; Writing the to-be-written data into a corresponding storage location based on the first index; The first index is converted into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition and the second index is an index that is filtered first and then classified.

2. The method according to claim 1, characterized in that The second index is a quantization index.

3. The method according to claim 2, characterized in that The creation service converts the linear index into the quantized index using an indexing algorithm, wherein the quantized index uses a mixture of heterogeneous computing resources.

4. The method according to claim 2, characterized in that: Before converting the first index into a second index, the method further includes: Read the pre-stored conversion conditions; Based on the conversion condition, determine whether to convert the linear index into the quantization index, wherein the conversion condition includes at least one of the following: the amount of data to be written, the remaining space of the storage space where the storage location is located, and a set conversion period.

5. The method according to claim 4, characterized in that The linear index is converted into the quantized index when the conversion condition satisfies at least one of the following conditions: the amount of data to be written exceeds a preset order of magnitude, the remaining space of the storage space where the storage location is located is less than a preset storage capacity, and the set conversion cycle is reached.

6. The method according to any one of claims 2 to 5, characterized in that The method further comprises: receiving a query request; The heterogeneous computing resources use the linear index and the quantitative index in parallel based on the query request to obtain the query result.

7. The method according to claim 6, characterized in that The heterogeneous computing resources include a CPU and a GPU, wherein the computing resources are selected based on the query request.

8. The method according to any one of claims 1 to 5 and 7, characterized in that: The data to be written is incremental data.

9. The method according to any one of claims 1 to 5 and 7, characterized in that: The method further comprises: In a case where the data volume exceeds the target threshold, it is determined that the data volume meets the preset condition.

10. A data processing method, characterized in that: include: receiving image data, and extracting feature vectors in the image data as data to be written; Obtain a first index, wherein the first index is used for writing data and the first index is a linear index; storing the feature vector to an associated storage location based on the first index; The first index is converted into a second index, wherein, when an image query request is received, an image matching the image query request is queried through the second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition and the second index is an index that is filtered first and then classified.

11. The method according to claim 10, characterized in that The data to be written is incremental data.

12. The method according to claim 10, characterized in that The method further comprises: In a case where the data volume exceeds the target threshold, it is determined that the data volume meets the preset condition.

13. A data processing method, characterized in that: include: Receiving a plurality of newly added image data, wherein the plurality of image data are taken by cameras disposed at different positions; Obtain a first index, wherein the first index is used for writing data and the first index is a linear index; Writing the newly added multiple image data and associated information into corresponding storage locations based on the first index; The first index is converted into a second index, wherein the second index is used to support retrieval of associated information matching the query request and the second index is an index that is filtered first and then classified.

14. The method according to claim 13, characterized in that The first index is a linear index, and the second index is a quantized index.

15. The method according to claim 14, characterized in that The method further comprises: receiving the query request, wherein the query request includes image information to be queried; The associated information matching the image information to be queried is obtained through the quantized index, wherein the associated information includes at least one of the following: device information, shooting time and shooting location of a camera shooting each image data.

16. The method according to claim 15, characterized in that The image data captured by the camera at different times is used as data to be written into the memory and needs to be written into a predetermined server in real time or at a fixed time.

17. The method according to claim 16, characterized in that The data to be written into the memory is incremental data.

18. A data processing method, characterized in that: include: Receiving data to be written, wherein the data to be written is collected by at least one data collector associated with the data retrieval system; Obtain a first index, wherein the first index is used for writing data and the first index is a linear index; Writing the to-be-written data into a corresponding storage location based on the first index; The first index is converted into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition and the second index is an index that is filtered first and then classified.

19. The method according to claim 18, characterized in that Receive data to be written, including: A plurality of newly added image data are received, wherein the plurality of image data are obtained by taking pictures based on at least one camera associated with the data retrieval system, and the at least one camera is set at different positions.

20. The method according to claim 18, characterized in that The data to be written is used to be input into a trained neural network model for processing, or is used to train a neural network model.

21. A data processing device, characterized in that: include: A first receiving module, used for acquiring data to be written; A first acquisition module, used to acquire a first index, wherein the first index is used to write data and is a linear index; A first writing module, used for writing the to-be-written data into a corresponding storage location based on the first index; The first conversion module is used to convert the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition and the second index is an index that is filtered first and then classified.

22. A data processing device, characterized in that: include: A second receiving module, used for receiving image data and extracting feature vectors in the image data as data to be written; A second acquisition module, used for acquiring a first index, wherein the first index is used for writing data and is a linear index; a second writing module, configured to store the feature vector to an associated storage location based on the first index; A second conversion module is used to convert the first index into a second index, wherein, when an image query request is received, an image matching the image query request is queried through the second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition and the second index is an index that is filtered first and then classified.

23. A data processing device, characterized in that: include: A third receiving module is used to receive a plurality of newly added image data, wherein the plurality of image data are taken by cameras arranged at different positions; A third acquisition module is used to acquire a first index, where the first index is used to write data and is a linear index; A third writing module, configured to write the newly added plurality of image data and associated information into a corresponding storage location based on the first index; The third conversion module is used to convert the first index into a second index, wherein the second index is used to support the retrieval of associated information matching the query request and the second index is an index that is filtered first and then classified.

24. A processor, characterized in that: The processor is used to run a program, wherein the following steps are performed when the program is run: Get the data to be written; Obtain a first index, wherein the first index is used for writing data and the first index is a linear index; Writing the to-be-written data into a corresponding storage location based on the first index; The first index is converted into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition and the second index is an index that is filtered first and then classified.

25. A mobile terminal, characterized in that: include: processor; A transmission device, used for acquiring data to be written; A memory connected to the processor, for providing the processor with instructions for processing the following processing steps: obtaining a first index, wherein the first index is used for writing data and the first index is a linear index; writing the data to be written into a corresponding storage location based on the first index; converting the first index into a second index, wherein the second index is used to support the retrieval of data whose data volume meets a preset condition and the second index is an index that is filtered first and then classified.

Citation Information

Patent Citations

  • Method and device for data search

    CN104820693A