A time series database
By using a hardware accelerator data manager to manage the mapping operations between time stamps and data storage addresses, the problem of low performance in time-series databases was solved, processing speed was improved, and software overhead was reduced.
Patent Information
- Application Number
- CN202210238661.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-01
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2039-10-01
AI Technical Summary
Existing time-series databases exhibit low performance in maintaining the mapping between time stamps and data storage addresses, resulting in high software management overhead and excessive consumption of host resources.
A hardware accelerator data manager is used to manage the mapping between time stamps and data storage addresses, including insert, query, delete, and replace operations. The hardware accelerator improves processing speed and reduces software management overhead.
It improves the processing speed of time-series databases, reduces the overhead of software management of time stamp and data storage address mapping, and reduces the consumption of host resources.
Smart Images

Figure CN114625780B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to storage technology, in particular, to a data manager, a time series database and an information processing system. BACKGROUND
[0002] A time series database, also called a time series database, is used to store and provide use of time series data. Figure 1A A block diagram of a time series database is shown. A host 120 is coupled to and uses a time series database 150. The host 120 accesses the time series database 150 using time series data. Time series data is data with time labels. Time labels are orderable. It is inefficient to store time series data using a conventional relational database, so a time series database optimized specifically for time series data is usually used.
[0003] The time series database maintains a mapping between time labels and data storage addresses. Insertion, query, deletion and other operations of the time series database all involve access to the mapping between time labels and data storage addresses.
[0004] In an insertion operation, time series data to be inserted includes at least a time label and data. The time series database allocates a storage address for it, establishes an index between the time label and the allocated storage address, and stores the data (optionally also including the time label) in a storage device indicated by the allocated storage address.
[0005] In a query operation, the time series database is instructed to query corresponding data according to a time label or a time period. The time series database obtains matching storage addresses from the index between the time label and the storage address, and accesses a storage device using the storage addresses to read out the data.
[0006] In a deletion operation, the time series database is instructed to delete corresponding data according to a time label or a time period. The time series database obtains matching storage addresses from the index between the time label and the storage address, and deletes data recorded by these storage addresses in a storage device, and also deletes the index corresponding to these storage addresses.
[0007] A method for processing get / pu t requests using an accelerator and an information processing system thereof are provided in Chinese patent application No. 201910874351.8, and an accelerator for cluster computing is provided in Chinese patent application No. 201910874345.2, the contents of which are incorporated herein by reference in their entirety. SUMMARY
[0008] When using a time-series database, the operation of accessing the mapping between time tags and data storage addresses affects the performance of the time-series database. It is desirable to provide a hardware accelerator to maintain and manage the operation of the mapping between time tags and data storage addresses, which is referred to as a data manager. With the data manager as a hardware accelerator, the processing speed and latency of the time-series database are improved, the overhead of software managing the mapping between time tags and data storage addresses is reduced, and the consumption of host resources for operating software is reduced.
[0009] The data storage address provided by the data manager is an address for a storage device. Thus, the time-series database includes the data manager and the storage device. Also refer to Figure 1B , which shows a time-series database 150 including a data manager 152 and a storage device 154. The storage device 154 is a storage device that receives a logical address or a physical address to access a storage space, such as a solid-state disk or an OCSSD (Open-Channel SSD), in the prior art. In particular, when the storage device 154 is an OCSSD, the data manager 152 also acts as an FTL (Flash Translation Layer) of the storage device.
[0010] The data manager receives a time or a time range and outputs one or more data storage addresses corresponding to the received time or time range.
[0011] When the storage device is a solid-state disk or an OCSSD (hereinafter collectively referred to as a solid-state disk), since the solid-state disk has operations such as garbage collection / wear leveling that change the storage location of data, the data storage address maintained by the data manager is also updated in response.
[0012] The data manager / time-series database according to the present application is, for example, a standalone product, or is, for example, integrated into a storage device and integrated into a control component of the storage device.
[0013] The data manager / time-series database according to the embodiments of the present application can also be applied to the "Method for processing read (Get) / Put (write) requests using an accelerator and information processing system thereof" provided in the Chinese patent application No. 201910874351.8. When the time tag is carried in the read (Get) / Put (write) request, the mapping manager in the Chinese patent application No. 201910874351.8 is replaced with the data manager according to the embodiments of the present application, and the time tag is added to the address allocation request / address acquisition request provided to the address allocation request / address acquisition request to request the data manager to provide the corresponding data storage address, and the data storage address is used to access the storage device.
[0014] According to a first aspect of the present application, a first data manager according to the first aspect of the present application is provided, comprising an insertion module and a storage module, wherein the data manager receives a first command, the first command being an insert element command, a delete element command, a search element command or a replace element command; when the first command is an insert element command, the first command carries a first time label; the insertion module allocates a first storage space of the storage module for the first time label, and operates the storage module to save the first time label and a first storage address in the first storage space, the first storage address corresponding to the first time label, and the first storage address being an address for accessing a storage device coupled to the data manager.
[0015] According to the first data manager of the first aspect of the present application, a second data manager according to the first aspect of the present application is provided, wherein the first storage address is sent by an external unit coupled to the data manager to the data manager; or the data manager further comprises an allocation module, and after the insertion module receives the first command, the insertion module sends the first time label to the allocation module; after the allocation module receives the first time label, the allocation module allocates the first storage address for the first time label, and sends the first storage address to the insertion module.
[0016] According to the first or second data manager of the first aspect of the present application, a third data manager according to the first aspect of the present application is provided, wherein when the insertion module allocates the first storage space, the insertion module finds a second storage space in the storage module according to the first time label, and determines that a storage space of unsaved data adjacent to the second storage space as the first storage space, wherein the second storage space is a storage space in which a time label with the smallest difference from the first time label among a plurality of time labels saved in the storage module is located.
[0017] According to the first or second data manager of the first aspect of the present application, a fourth data manager according to the first aspect of the present application is provided, wherein the insertion module allocates, from the storage module, a storage space of unsaved data adjacent to a storage space of saved data as the first storage space.
[0018] According to the third data manager of the first aspect of the present application, a fifth data manager according to the first aspect of the present application is provided, wherein the insertion module reads time labels saved in at least one storage space in the storage module in ascending or descending order of physical address, and determines a time label with the smallest difference from the first time label among the at least one time label.
[0019] According to the sixth data manager of the first aspect of the present application, the seventh data manager of the first aspect of the present application is provided, wherein the first command carries two second time labels, the two second time labels respectively indicate a first time and a second time, and the search module searches the third storage space whose saved time label is between the first time and the second time in the at least one storage space.
[0020] According to the sixth data manager of the first aspect of the present application, the seventh data manager of the first aspect of the present application is provided, wherein the first command carries two second time labels, the two second time labels respectively indicate a first time and a second time, and the search module searches the third storage space whose saved time label is between the first time and the second time in the at least one storage space.
[0021] According to the sixth data manager of the first aspect of the present application, the eighth data manager of the first aspect of the present application is provided, wherein the first command carries one second time label, if the one second time label indicates a start time, the search module searches the third storage space whose time label is between the start time and a maximum time in the data saved in the storage module; if the one second time label includes an end time, the search module searches the third storage space whose saved time label is between a minimum time and the end time in the at least one storage space; wherein the maximum time is the maximum time in at least one time corresponding to at least one time label saved in the storage module, and the minimum time is the minimum time in the at least one time.
[0022] According to the sixth data manager of the first aspect of the present application, the ninth data manager of the first aspect of the present application is provided, wherein if the second time label includes a third time and a time flow direction, the search module determines the third time as a start time or an end time according to the time flow direction; wherein if the time flow direction represents searching for time labels greater than the third time, the search module determines the third time as the start time, and searches the third storage space whose saved time label is between the start time and a maximum time in the at least one storage space; if the time flow direction represents searching for time labels less than the third time, the search module determines the first time as the end time, and searches the third storage space whose saved time label is between a minimum time and the end time in the at least one storage space.
[0023] According to one of the sixth to ninth data managers of the first aspect of the present application, the tenth data manager of the first aspect of the present application is provided, further comprising an acquisition module, when the first command is the search element command, the search module sends the first command and the physical address corresponding to the third storage space to the acquisition module after searching the third storage space; the acquisition module reads the first data saved in the third storage space from the storage module; the acquisition module sends at least one second storage address to an external unit coupled with the data manager after reading the first data, the first data includes the at least one second storage address, and the at least one second storage address is an address for accessing the storage device.
[0024] According to one of the sixth to ninth data managers of the first aspect of the present application, the eleventh data manager of the first aspect of the present application is provided, further comprising a deletion module, when the first command is the delete element command, the search module sends the first command and the physical address corresponding to the third storage space to the deletion module after searching the third storage space; the deletion module acquires the first data saved in the third storage space from the storage module and operates the storage module to delete the first data; the deletion module also sends at least one second storage address to an external unit coupled with the data manager, the first data includes the at least one second storage address, and the at least one second storage address is an address for accessing the storage device.
[0025] According to one of the first to eleventh data managers of the first aspect of the present application, the twelfth data manager of the first aspect of the present application is provided, further comprising a replacement module, when the first command is a replace element command, the first command carries a storage address before change and a storage address after change, both of which are addresses for accessing the storage device; the replacement module acquires a fourth storage space in the storage module storing the storage address before change according to the storage address before change, and replaces the storage address before change in the fourth storage space with the storage address after change.
[0026] According to one of the first to twelfth data managers of the first aspect of the present application, the thirteenth data manager of the first aspect of the present application is provided, and the storage module saves data in regions according to index values, wherein data with the same index value is saved in the same region, and data with different index values is saved in different regions.
[0027] According to the thirteenth data manager of the first aspect of the present application, the fourteenth data manager of the first aspect of the present application is provided, the first command further carries a first index value, the first index value points to a first area in the storage module.
[0028] According to the fourteenth data manager of the first aspect of the present application, the fifteenth data manager of the first aspect of the present application is provided, when the first command is an insert element command, the insert module determines the first storage space in the first area, and operates the storage module to save the first time tag and the first storage address in the first storage space.
[0029] According to the fourteenth or fifteenth data manager of the first aspect of the present application, the sixteenth data manager of the first aspect of the present application is provided, the mapping module provides an indication of the first area to the insert module according to the first index value; when the insert module determines the first storage space, the insert module finds a second storage space in the first area according to the first time tag, and determines that the storage space of the unsaved data adjacent to the second storage space is the first storage space, wherein the second storage space is a storage space in which a time tag with the smallest difference from the first time tag among a plurality of time tags saved in the storage module.
[0030] According to the sixteenth data manager of the first aspect of the present application, the seventeenth data manager of the first aspect of the present application is provided, the insert module reads the time tags saved in at least one storage space in the first area in ascending order of physical address or descending order of physical address, and determines a time tag with the smallest difference from the first time tag among the at least one time tag.
[0031] According to one of the fourteenth to seventeenth data managers of the first aspect of the present application, the eighteenth data manager of the first aspect of the present application is provided, when the first command is the search element command or the delete element command, the mapping module provides an indication of the first area to the search module according to the first index value; the search module searches for a third storage space corresponding to the one or two second time tags in at least one storage space in the first area according to the one or two second time tags.
[0032] According to the eighteenth data manager of the first aspect of the present application, the nineteenth data manager of the first aspect of the present application is provided, the first command carries two second time tags and the first index value, each of the two second time tags respectively corresponds to a first time and a second time, and then the search module searches the third storage space whose saved time tag is between the first time and the second time in the at least one storage space in the first area.
[0033] According to the eighteenth data manager of the first aspect of the present application, the twentieth data manager of the first aspect of the present application is provided, the first command carries one second time tag and the first index value, if the one second time tag includes a start time, the search module searches the third storage space whose time tag is between the start time and a maximum time in the saved data in the first area; if the one second time tag includes an end time, the search module searches the third storage space whose saved time tag is between a minimum time and the end time in the at least one storage space; wherein the maximum time is a maximum time in at least one time corresponding to at least one time tag saved in the first area, and the minimum time is a minimum time in the at least one time.
[0034] According to the eighteenth data manager of the first aspect of the present application, the twenty-first data manager of the first aspect of the present application is provided, if the second time tag includes the first index value, a third time and a time flow direction, the search module determines the third time as a start time or an end time according to the time flow direction information; wherein if the time flow direction information represents searching for a time greater than the third time, the search module determines the third time as the start time, and the search module searches the third storage space whose saved time tag is between the start time and a maximum time in the at least one storage space; if the time flow direction information represents searching for a time less than the third time, the search module determines the first time as the end time, and the search module searches the third storage space whose saved time tag is between a minimum time and the end time in the at least one storage space.
[0035] According to one of the eighteenth to twenty-first data managers of the first aspect of the present application, the twenty-second data manager of the first aspect of the present application is provided, when the first command is the search element command, the search module sends the third storage space to the acquisition module after searching the third storage space;
[0036] The acquisition module reads the first data saved in the third storage space from the first area;
[0037] After the obtaining module reads the first data, the obtaining module sends at least one second storage address to an external unit coupled to the data manager, the first data includes the at least one second storage address, and the at least one second storage address is an address for accessing the storage device.
[0038] According to the one of the eighteenth to twenty-first data managers of the first aspect of the present application, when the first command is the delete element command, the searching module sends the third storage space to the deleting module after searching the third storage space; the deleting module reads first data saved in the third storage space from the first area and operates the storage module to delete the first data; and the deleting module further sends at least one second storage address to an external unit coupled to the data manager, the first data includes the at least one second storage address, and the at least one second storage address is an address for accessing the storage device.
[0039] According to the one of the fourteenth to twenty-third data managers of the first aspect of the present application, when the first command is the replace element command, the first command carries a changed storage address and a changed storage address, and the changed storage address and the changed storage address are both addresses for accessing the storage device; and the replacing module acquires a storage space in the first area storing the changed storage address according to the changed storage address, and replaces the changed storage address stored therein with the changed storage address.
[0040] According to the second aspect of the present application, the first time-series database according to the second aspect of the present application includes a data manager and a storage device, wherein the time-series database receives a data write command, the data write command indicates data to be written and a first time label; the data manager allocates a first storage address to the data write command, the first storage address is an address for accessing the storage device; the data manager saves the first storage address and the first time label in a first storage space in association, the first storage space is a storage space in the data manager; and the storage device saves the data to be written according to the first storage address.
[0041] According to the first time sequence database of the second aspect of the present application, the second time sequence database of the second aspect of the present application is provided, a plurality of time address data are stored in the data manager, the data manager stores the plurality of time address data according to the order of increasing or decreasing of the time label, the time address data includes a time label and a storage address, and the storage address is an address for accessing the storage device.
[0042] According to the first or second time sequence database of the second aspect of the present application, the third time sequence database of the second aspect of the present application is provided, the time sequence database further includes a processor, the processor receives a data processing command sent by an external unit, and generates a first command for the data manager according to the data processing command, the data processing command includes a data write command, a data delete command, a data query command and a data replacement command, and the first command includes an insert element command, a delete element command, a search element command and a replace element command.
[0043] According to the third time sequence database of the second aspect of the present application, the fourth time sequence database of the second aspect of the present application is provided, the time sequence database receives a data query command, the data query command indicates one or two second time labels, the processor generates the first command according to the data query command, and sends the search element command to the data manager; the data manager obtains at least one second storage address corresponding to the second time label from the data stored by itself according to the second time label carried by the search element command; and the storage device provides the data stored in the at least one second storage address according to the at least one second storage address.
[0044] According to one of the first to fourth time sequence databases of the second aspect of the present application, the fifth time sequence database of the second aspect of the present application is provided, the processor receives a data delete command, the data delete command indicates one or two third time labels, and generates and sends the element delete command to the data manager according to the data delete command; the data manager obtains at least one third storage address corresponding to the third time label from the data stored by itself according to the third time label carried by the delete element command, and deletes the third time label and the at least one third storage address stored by itself; and the storage device deletes the data stored in the third storage address.
[0045] According to the first to fifth time sequence databases of the second aspect of the present application, the sixth time sequence database of the second aspect of the present application is provided, in response to moving the data of the fourth storage address in the storage device to the fifth storage address, the processor receives a data replacement command, the processor generates and sends a replacement element command to the data manager according to the data replacement command, the replacement element command carries the fourth storage address and the fifth storage address; the data manager replaces the fourth storage address saved by itself to the fifth storage address according to the replacement element command.
[0046] According to the sixth time sequence database of the second aspect of the present application, the seventh time sequence database of the second aspect of the present application is provided, in response to moving the data of the fourth storage address in the storage device to the fifth storage address, the storage device sends the data replacement command to the processor.
[0047] According to the first to sixth time sequence databases of the second aspect of the present application, the eighth time sequence database of the second aspect of the present application is provided, the data manager saves data in regions according to index values, the data with the same index value is saved in the same region, and the data with different index values is saved in different regions, wherein the data write command, the data query command, the data replacement command or the data deletion command further carries a first index value.
[0048] According to the first to eighth time sequence databases of the second aspect of the present application, the ninth time sequence database of the second aspect of the present application is provided, the data manager is any one of the data managers in the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art according to these drawings.
[0050] Figure 1A It is a schematic diagram of the time sequence database in the prior art;
[0051] Figure 1B It is a block diagram of the time sequence database according to the embodiments of the present application;
[0052] Figure 2A It is a schematic diagram of the structure of the data manager in the embodiments of the present application;
[0053] Figure 2B It is a schematic diagram of the storage module storing data in the embodiments of the present application;
[0054] Figure 3A Another structure diagram of the data manager in the embodiment of the present application;
[0055] Figure 3B Another diagram of the data storage of the storage module in the embodiment of the present application;
[0056] Figure 4 A structure diagram of the time series database in the embodiment of the present application;
[0057] Figure 5A A structure diagram of the information processing system in the embodiment of the present application;
[0058] Figures 5B-5C A flow diagram of the information processing system processing command in the embodiment of the present application. DETAILED DESCRIPTION
[0059] The embodiment of the present application relates to data manager, time series database and information processing system, and data management is realized by using hardware, so that data access speed can be effectively improved.
[0060] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application. The following specific embodiments with reference to the drawings can use the same reference signs to identify the same or similar elements in different drawings. In the following description, for the purpose of explanation and not limitation, specific details such as specific structure, architecture, interface, technology, etc. are described in order to provide a thorough understanding of various aspects of the claimed application. Then, it is obvious for those skilled in the art that various aspects of the claimed application can be implemented in other examples without these specific details. In some embodiments, the description of public facilities, circuits and methods is omitted to avoid unnecessary details to obscure the description of the present application.
[0061] In addition, various operations will be described in sequential order to most assist in understanding illustrative implementations; however, the order of description is not to be construed as a requirement and the descriptions are presented for the purpose of exemplification and not limitation. In particular, the operations need not be performed in the order presented.
[0062] The phrases "in various embodiments," "in some embodiments," and the like are used repeatedly. These phrases generally do not refer to the same embodiments; however, these phrases can refer to the same embodiments. The terms "including," "having," and "comprising" are synonymous, unless the context dictates otherwise. The phrase "A and / or B" means (A), (B), or (A and B). The phrases "A / B" and "A or B" mean (A) or (B). The phrase "at least one of A and B" means (A), (B), or (A and B).
[0063] Figure 2A An exemplary data manager is shown in a structural schematic diagram as Figure 2A The data manager 200 is capable of saving and managing time series data in time order. The data manager 200 includes an insertion module 210, a storage module 220, a search module 230, an acquisition module 240, a deletion module 250, and a replacement module 260, wherein the storage module 220 is coupled with the insertion module 210, the acquisition module 240, the deletion module 250, the search module 230, and the replacement module 260, respectively.
[0064] Figure 2B An exemplary diagram of the storage module storing data is shown. Referring to Figure 2B , the storage module 220 of the data manager 200 records entries in time order of time labels of the time series data. An entry includes a time label and an address for a storage device corresponding to the time label (see also Figure 1B , the storage device 154). It is understood that the time series data includes an associated time label and data, such as collected video data or a thumbnail thereof, collected sensor data, etc. Optionally, the entry of the storage module 220 records the time label and the address for the storage device, but does not record the data associated with the time label in the time series data. The data associated with the time label in the time series data is stored by, for example, the storage device 154, and the storage location is indicated by the address for the storage device corresponding to the time label in the entry of the storage module 220. Figure 2B The time label 1, the time label 2,..., the time label N shown are saved in time increasing or decreasing order, N being a positive integer.
[0065] Referring back to Figure 2AThe data manager 200 receives a first command sent by the external unit, executes the first command, and returns the processing result of the first command to the external unit. The first command in the present application includes an insert element command, a delete element command, a search element command, or a replace element command, wherein the insert element command instructs the data manager 200 to add a new entry in the storage module 220, the delete element command instructs the data manager 200 to delete an entry from the storage module 220, the search element command instructs the data manager 200 to read a specified entry from the storage module 220, and the replace element command instructs the data manager 200 to replace an address for a storage device recorded in an entry saved in the storage module 220 with a new address.
[0066] When the data manager 200 receives the first command, the first command is directly received by the insert module 210, the search module 230, or the replace module 260; or the data manager further includes a command distribution module (not shown in the figure), all the first commands are received by the command distribution module, and the first command is sent to the corresponding module according to the identification of the first command or the data carried by the first command; or the command distribution module receives a data processing command sent by the external unit, the command distribution module generates the first command according to the data processing command, and sends the first command to the corresponding module, wherein the data processing command includes a data delete command, a data replace command, a data search command, a data insert command, etc. For example, the first command is an insert element command, and the first command is received by the insert module 210. For another example, the first command is a replace element command, and the command distribution module sends the replace element command to the replace module 260 after receiving the replace element command.
[0067] In another example, the data processing command is sent by the host, and the data processing command instructs the data manager 200 to perform a corresponding operation, wherein the data delete command instructs to delete part or all of the data in the data manager 200, the data replace command instructs to replace part or all of the data in the data manager 200, the data insert command instructs that the data manager 200 has new data to be saved, and the data search command instructs to read part or all of the data in the data manager 200. The command distribution module generates and sends a delete element command to the delete module 250 or the search module 230 according to the received data delete command, generates and sends an insert element command to the insert module 210 according to the received data insert command, generates and sends a replace element command to the replace module 260 according to the received data replace command, and generates and sends a search element command to the acquisition module 240 or the search module 230 according to the received data search command. It should be noted that the data manager in the present application is implemented by hardware, and the first command can also be a start command of each module, for example, the replace element command is used to start the replace module 260.
[0068] According to an embodiment of the present application, the insert element command carries a first time tag, when the first command is the insert element command, the insert module 210 allocates a first storage space in the storage module 220 for the first time tag, and operates the storage module 220 to save the first time tag and a first storage address in the first storage space. In the present application, the storage module 220 is a memory device such as DRAM, SDRAM, etc. Alternatively, the storage module 220 is a storage space for accessing an external DDR memory. The storage module 220 (or the memory it manages) includes a plurality of storage spaces, each of which has the same or different size, for example, each of which has a fixed size such as 8 bytes, 16 bytes or hundreds of bytes. The physical addresses of adjacent storage spaces are continuous or discontinuous. In the present embodiment, the first storage space is used to save the first time tag and the first storage address, the first storage address is an address for accessing a storage device coupled with the data manager 200, for example, the first storage address is a physical address in the storage device, for another example, the first storage address is a logical address corresponding to a physical address in the storage device. The first storage address corresponds to the first time tag, and the first storage address is used to save the to-be-saved data corresponding to the first command, and the first time tag is the time information of obtaining the to-be-saved data. In one example, the to-be-saved data is video data, and the first time tag is the time information of shooting the video data.
[0069] In the present embodiment, the first time tag and the first storage address are saved together in the first storage space of the storage module 220.
[0070] In one embodiment, the first storage address is sent by an external unit coupled with the data manager 200 to the data manager 200; or, the data manager 200 further includes an allocation module (not shown in the figure), after the insert module 210 receives the first command, the insert module 210 sends the first time tag to the allocation module. After the allocation module receives the first time tag, the allocation module allocates a first storage address for the first time tag, and sends the first storage address to the insert module 210. The first storage address indicates, for example, an unused storage space (first storage space) in the storage space of the storage module 220. For example, the first storage address is sent by a controller of the storage device to the data manager. It should be noted that the manner in which the allocation module allocates the first storage address can refer to the prior art, which is not limited herein.
[0071] In some embodiments, when the insertion module 210 allocates the first storage space, the second storage space in the storage module 220 is searched according to the first time tag, the second storage space is a storage space in the storage module 220 that has already saved data, and among all the time tags saved in the storage module 220, the time tag saved in the second storage space has the smallest difference with the first time tag. Thus, the first storage space is the storage space adjacent to the second storage space and not saving data. For example, the first time tag is T1, and the time tag saved in the second storage space is T2. When T1 is greater than T2, the first storage space is the idle storage space adjacent to the second storage space and in the time increasing direction. When T1 is less than T2, the first storage space is the idle storage space adjacent to the second storage space and in the time decreasing direction.
[0072] In some embodiments, the first storage space allocated by the insertion module 210 is the storage space adjacent to the storage space that has already saved data in the storage module 220 and not saving data. For example, the first storage space is the first storage space searched by the insertion module 210 when searching all the storage spaces in the storage module 220 and not saving data.
[0073] In yet some embodiments, the insertion module 220 reads the time tags saved in at least one storage space in the storage module 220 in the order of the physical address from small to large or from large to small, and calculates the time tag having the smallest difference with the first time tag among the at least one time tag, thereby determining the second storage space.
[0074] In various embodiments, when the first command is the search element command or the delete element command, the first command carries one or two second time tags. In the present embodiment, the search element command indicates to read part or all of the data in the storage module 220, and the delete element command indicates to delete part or all of the data in the storage module 220, thereby needing to obtain the storage space of the data to be deleted in the storage module 220 before executing the delete element command. In order to simplify the difficulty of hardware implementation, the search module 230 is used to search the storage space in the present embodiment. Specifically, the search module 230 searches the third storage space corresponding to one or two second time tags in at least one storage space in the storage module 220 according to the one or two second time tags.
[0075] In some embodiments, the first command carries two second time labels, which respectively indicate the first time and the second time, and the search module 230 searches the time labels saved in the at least one storage space, and the storage space between the first time and the second time is the third storage space. For example, the first time is T3, the second time is T4, T4 is greater than T3, and the storage module saves three time labels, which respectively indicate the time T5, the time T6 and the time T7, wherein T3
[0076] In yet some embodiments, the first command carries only one second time label, and if the second time label indicates a start time, which represents the start time of the required data, the search module 230 searches the storage space between the start time and the maximum time indicated by all the time labels saved in the storage module 220 from all the time labels saved in the storage module 220, wherein the maximum time is the maximum time from all the times indicated by the time labels saved in the storage module 220.
[0077] If the second time label indicates an ending time point, the ending time point represents an ending time of the required data, and the search module 230 searches, among all the time labels stored in the storage module 220, a storage space in which a time label is between a minimum time point and an ending time point indicated in all the time labels. In one embodiment, the first command carries only one second time label, and the second time label includes a third time point and a time flow direction. The search module can determine whether the third time point is a starting time point or an ending time point according to the time flow direction. When the time flow direction represents searching for a time label greater than the third time point, the third time point is a starting time point, and the search module 230 searches, among all the time labels stored in the storage module 220, a storage space in which a time label is between the third time point and a maximum time point indicated in all the time labels. When the time flow direction represents searching for a time label less than the third time point, the third time point is an ending time point, and the search module 230 searches, among all the time labels stored in the storage module 220, a storage space in which a time label is between a minimum time point indicated in all the time labels and the third time point. When the first command is a search element command, after the search module 230 searches the third storage space, the search module 230 sends an address corresponding to the third storage space to the acquisition module 240, so that the acquisition module 240 accesses the third storage space according to the address and reads first data stored in the third storage space. The first data read by the acquisition module 240 is a second storage address or a second storage address and a time label. After the acquisition module 240 reads the first data, the acquisition module 240 sends at least one second storage address to an external unit coupled to the data manager 200, so that the external unit can access the storage device according to the second storage address. For example, the acquisition module 240 sends at least one second storage address to a host or a processor coupled to the data manager 200, so that the host or the processor accesses the storage device through the second storage address and reads data stored in the second storage address.
[0078] When the first command is a delete element command, after the search module 230 searches the third storage space, the search module 230 sends a physical address corresponding to the third storage space to the deletion module 250. The deletion module 250 operates the storage module 220 to delete the first data stored in the third storage space. In some examples, the first data in the storage module 220 is deleted, but the storage address recorded by the first data in the storage device does not need to be deleted, and the storage space corresponding to the storage address recorded by the first data is recycled when garbage data recycling is performed on the storage device.
[0079] Different storage devices store data in different ways. For example, when the storage device is a solid state disk, the solid state disk will perform garbage collection, that is, the data stored in the solid state disk will change the storage address. In order to ensure that the data is not lost or needs a long time to find the data, in various embodiments of the present application, when the first command is a replace element command, the replace element command carries the changed storage address and the changed storage address. After the replace module 260 receives the replace element command, the fourth storage space storing the changed storage address is obtained from the storage module 220, and the storage address stored in the fourth storage space is replaced with the changed storage address. In this embodiment, the changed storage address and the changed storage address are used to access different physical addresses in the storage device, but the changed storage address and the changed storage address correspond to the same data.
[0080] Figure 3A Another structure diagram of the data manager is given. Referring to Figure 3A In another embodiment, the data manager 300 includes an insertion module 310, a storage module 320, a search module 330, an acquisition module 340, a deletion module 350, a replacement module 360, and a command distribution module 370. The storage module 320 stores data in different regions according to index values (Index). The index value is, for example, the index value defined in Chinese patent application No. 201910874351.8 or 201910874345.2.
[0081] Figure 3B A diagram of storing data in different regions in the storage module 320 is given in the
[0082] According to Figure 3A Compared with Figure 3B Compared with Figure 2A Compared with Figure 2B The first command also carries a first index value, and the first index value points to a first region in the storage module 320. For example, there are four index values, which are index value 1, index value 2, index value 3, and index value 4. The storage module 320 is divided into four regions. If the first index value is index value 2, the first region is the region corresponding to index value 2.
[0083] In this embodiment, after the command distribution module 370 receives the first command, the address of the first region in the storage module 320 is obtained according to the first index value, and the first command and the address of the first region are sent to the corresponding module together, so that other modules can directly find the first region, simplifying the operation of other modules.
[0084] When the first command is an insert element command, the insert module 310 determines the first storage space from the at least one storage space in the first region, and operates the storage module 320 to save the first time tag and the first storage address in the first storage space. Specifically, after receiving the address of the first region, the insert module 310 can directly access the first region according to the address, and find the second storage space in the first region, and determine the first storage space as the storage space adjacent to the second storage space and not storing data, wherein the second storage space is the storage space storing the time tag with the minimum value among the time tags saved in the first region and greater than the first time tag.
[0085] In another embodiment, the insert module 310 receives the first command carrying the first index value, and then determines the first region in the storage module 320 according to the first index value, and determines the first storage space from the at least one storage space in the first region, and operates the storage module 320 to save the first time tag and the first storage address in the first storage space. The method for determining the first storage space by the insert module 310 can refer to the method for determining the first storage space by the insert module 210 in the above embodiment, and will not be described in detail here.
[0086] In some embodiments, the insert module 310 reads the time tags saved in the at least one storage space in ascending order of physical address or descending order of physical address, and calculates the difference between each time tag and the first time tag to determine the time tag with the minimum difference from the first time tag.
[0087] In yet some embodiments, when the first command is a search element command or a delete element command, the command distribution module 370 sends the first command and the address of the first region to the search module 330. The search module 330 searches the third storage space corresponding to the one or two second time tags in the at least one storage space in the first region according to the one or two second time tags.
[0088] When the first command carries two second time tags, the two second time tags correspond to the first time and the second time respectively, and the search module 330 searches the third storage space storing the time tag between the first time and the second time in the at least one storage space in the first region.
[0089] When the first command carries one second time tag, the first command carries only one second time tag, and if the second time tag indicates a start time, the start time represents the start time of the required data, and thus the search module 330 searches the storage space storing the time tag between the start time and the maximum time among all the time tags saved in the first region, wherein the maximum time is the maximum time among the times corresponding to all the time tags saved in the first region.
[0090] If the second time label indicates a start time and an end time, the search module 330 searches the storage space between the minimum time and the maximum time among all the time labels stored in the first area. In an embodiment, the first command carries only one second time label, which includes a third time and a time flow direction. The search module 330 can determine whether the third time is a start time or an end time according to the time flow direction. If the time flow direction indicates to search for a time label greater than the third time, the third time is a start time, and the search module 330 searches the storage space between the third time and the maximum time among all the time labels stored in the first area. If the time flow direction indicates to search for a time label less than the third time, the third time is an end time, and the search module 330 searches the storage space between the minimum time and the third time among all the time labels stored in the first area.
[0091] The search module 330 searches the third storage space in the manner described above with reference to the search module 230, except that the search module 330 searches in the first area, while the search module 230 searches in the storage module 220.
[0092] Optionally, when the first command is a search element command, after the search module 330 searches the third storage space, the search module 330 sends the address corresponding to the third storage space to the acquisition module 340, so that the acquisition module 340 accesses the third storage space according to the address and reads the first data stored in the third storage space. The first data read by the acquisition module 340 is the second storage address or the second storage address and the time label. After the acquisition module 340 reads the first data, the acquisition module 340 sends at least one second storage address to the external unit coupled to the data manager 300, so that the external unit can access the storage device according to the second storage address.
[0093] When the first command is a delete element command, after the search module 330 searches the third storage space, the search module 330 sends the first command and the address corresponding to the third storage space to the deletion module 350. The deletion module 350 operates the storage module 320 to delete the first data of the third storage space.
[0094] Optionally, after the first data is deleted by the deletion module 350, at least one second storage address recorded by the deleted first data is sent to an external unit coupled to the data manager 300, so that the external unit accesses the storage device according to the second storage address and deletes the data saved in the second storage address. Still optionally, the first data in the storage module 320 is deleted, but the storage address recorded by the first data in the storage device does not need to be deleted, but the storage space corresponding to the storage address recorded by the first data is recycled when garbage data recycling is performed on the storage device.
[0095] In various embodiments, when the first command is a replace element command, the command distribution module sends the address of the first region and the replace element command to the replacement module 360, and the replace element command carries the changed storage address and the changed storage address. After the replacement module 360 receives the replace element command and the physical address of the first region, the fourth storage space storing the changed storage address is obtained from the first region, and the storage address saved in the fourth storage space is replaced by the changed storage address. Figure 4 A timing database structure diagram according to an embodiment of the present application is given. As shown in the figure, Figure 4 In one embodiment, the timing database 400 includes an interface 410, a processor 420, a storage device 430, a data manager 440, and a dynamic storage 450 of the storage device 430. The data manager 440 can use the data manager 200 or the data manager 300 in the above embodiments. The storage device 430 is a solid state disk SSD (including OCSSD, KVSSD, etc.), a mechanical hard disk HDD, etc. The interface 410 receives the command for operating the timing database sent by the client directly or through the network, and the interface 410 sends the command for operating the timing database to the processor 420. The software running on the processor 420 operates the data manager 440 and the storage device 430 according to the command for operating the timing database illustrated, to complete the command for operating the timing database and give the command processing result through the interface 410.
[0096] The processor 420 converts the operation of the timing database into a first command suitable for the data manager 440 and / or a second command suitable for the storage device 430, and sends the first command to the data manager 440 and / or the second command to the storage device 430.
[0097] In one embodiment, the timing database 400 receives a data write command, which indicates a first time tag and data to be written. The timing database 400 processes the data write command and saves the data to be written, wherein the processor 420 generates an insert element command and sends it to the data manager 440.
[0098] The data manager 440 allocates a first storage address according to the insert element command, the first storage address being an address for accessing the storage device 430. The data manager 440 associates the first storage address with a first time tag, and stores the associated first storage address and first time tag in a first storage space of itself. The data manager 440 also sends the allocated first storage address to the processor 420, which sends a second command to the storage device 430 according to the received first storage address, to instruct the storage device 430 to store the data indicated by the data write command.
[0099] The storage device 430 stores the data to be written in a storage space corresponding to the first storage address.
[0100] The data manager 440 stores a plurality of time address data, the data manager 440 storing the plurality of time address data according to an order of increasing or decreasing of time corresponding to the time tags, the time address data including a time tag and a storage address, the storage address being an address for accessing the storage device 430.
[0101] In one embodiment, the time series database 400 receives a data query command, the data query command indicating one or two second time tags. The processor 420 generates a search element command according to the data query command, and sends the search element command to the data manager 440. After receiving the search element command, the data manager 440 obtains at least one second storage address corresponding to the second time tag from the data stored by itself according to the second time tag carried by the search element command. The data manager 440 sends the at least one second storage address to the processor 420. The processor 420 sends a second command to the storage device 430 according to the received at least one second storage address, the second command being a read command, to instruct the storage device 430 to read out data in the at least one second storage address as a response to the data query command.
[0102] The storage device 430 provides the data in the at least one second storage address according to the at least one second storage address after receiving the read command. For example, the client 460 sends a data query command to the time series database 400, and the storage device 430 provides the data in the at least one second storage address to the client 460 through the interface 410.
[0103] In one embodiment, the time series database 400 receives a data deletion command, which indicates one or two third time labels. The processor 420 generates a delete element command according to the data deletion command, and sends the delete element command to the data manager 440. After receiving the delete element command, the data manager 440 acquires at least one third storage address corresponding to the third time label according to the third time label, and deletes the at least one third storage address and the third time label saved by itself.
[0104] In one example, the data manager 440 indicates to the processor 420 that the processing of the delete element command is completed, and the processor 420 identifies that the processing of the data deletion command is completed without deleting the data protected by the one third storage address in the storage device.
[0105] Optionally, the data manager 440 sends the at least one third storage address to the storage device 430. The processor 420 also instructs the storage device 430 to delete the data saved in the third storage address according to the data deletion command and the one third storage address.
[0106] In various embodiments, the time series database 400 also receives a data replacement command, which is generated by the storage device 430 or the storage controller of the storage device 430 in response to the moving of the data in a fourth storage address in the storage device 430 to a fifth storage address. The processor 420 generates a replace element command according to the data replacement command, and the data replacement command and the replace element command both carry the fourth storage address and the fifth storage address. The processor 420 sends the replace element command to the data manager 440, and the data manager 440 replaces the fourth storage address saved by itself with the fifth storage address.
[0107] In another embodiment, the data manager 440 saves data in regions according to index values, and the data with the same index value is saved in the same region, and the data with different index values is saved in different regions. The data processing command received by the time series database 400 also carries a first index value, and the first index value points to a first region in the data manager 440. Specifically, when the data processing command carries the first index value, the processor 420 generates a first command carrying the first index value according to the data processing command.
[0108] Figure 5A A possible structure of an information processing system is shown. As shown in FIG. 1, the information processing system includes a time series database 400, a storage device 430, and a data manager 440. Figure 5AThe embodiment of the application shown provides an information processing system 500, including a host 510, an accelerator 530, a processor 550, a storage device 520 and a data manager 540. The data manager 550 in the embodiment adopts the data manager in the above embodiment, or the information processing system 500 adopts the time series database 400, the accelerator 530 and the host 510 in the above embodiment two to implement.
[0109] In the embodiment, the host 510 generates and sends a first request to the processor 550 according to an interface function, the first request including a read request and a write request, the first request carrying a keyword and a time label, or the first request carrying a keyword, a time label and a first index value corresponding to the keyword, the read request including a read index request, a read data request and a read data request carrying an index, and the write request including a write data request and a write data request carrying an index; the processor 550 generates a second request according to the first request, the second request including one or more of a clustering request, a search request, an address allocation request, an address acquisition request or a storage device access request; the processor 550 uses the second request to operate at least one of the accelerator 530, the data manager 540 and the storage device 520 to complete the processing of the second request, and obtains and returns the processing result of the first request to the host. It should be noted that the first request in the embodiment includes a data processing command, and the second request includes a first command. For example, the first request is a read request, and the first request includes a data search request, so that the second request generated by the processor 550 is a search element command. For another example, the access request includes a data insertion request and a data acquisition request. The first request in the following can be understood as a data processing command, and the second request can be understood as a first command.
[0110] In one embodiment, when the first request is a write data request carrying an index, the first request carries a keyword, a time label and a first index value, and the processor 550 generates an address allocation request and an access request; when the first request is a write data request, the first request carries a keyword and a time label, and the processor 550 generates a clustering request, an address allocation request and an access request.
[0111] Figure 5B A flowchart of the information processing system 500 executing a write data request is given.
[0112] The patent application No. 201910874351.8 provides a method for processing Get / Put request using accelerator and its information processing system, in which key, index and vector are explained. An information processing system needs to process various data. For example, video, picture, text file and the like are unstructured data. Unstructured data is inconvenient for retrieval and use. In order to facilitate retrieval or use, unstructured data is structured. For example, tags are added to original data to indicate structured information such as source, format, storage location, required access permission of original data. As another example, the content of original data is analyzed, such as extracting, thumbnail, abstract from video or picture, extracting objects such as portrait, car, extracting features such as human face, height, gender, age, extracting features such as car brand, license plate, etc. The tags, features and the like associated with the original data are all structured information generated by structured processing. Structured information is convenient for retrieval, and can be retrieved by existing database or search engine technology, or other search technology existing or to be developed in the future.
[0113] One or more tags and / or features in structured information are used as keys, and the data associated with structured information and / or structured information itself are used as values, so that unstructured data can be recorded, accessed and retrieved through KV storage device. The patent application No. 2018102074169, entitled "Method and device for generating key and value of KV storage" provides a method for generating keys using machine learning components.
[0114] Using machine learning components to process data such as human face pictures will get feature values (also known as vectors) associated with specific human face pictures. Feature values are generated by machine learning components for each of multiple pictures. Compared with data, feature values have smaller size, for example, 64 bytes to 4 KB.
[0115] In a KV storage system, input key is used to retrieve data (value). In order to facilitate retrieval and data acquisition, in the embodiments of the present application, key, index and feature value are essentially used as index of data, i.e. key, index and feature value can be essentially called feature value, the difference is that index is pre-configured, key is input by user host and carried in the first request, and feature value is calculated according to data. Specifically, according to the type of data to be stored by the information processing system, the form of feature value is different. For example, the data to be stored is image data, and the feature value is a vector obtained by processing the image. The way to process image data to obtain feature value can be referred to the prior art, which is not limited here.
[0116] The clustering of the plurality of feature values results in a plurality of groups of feature values. Each group includes one or more feature values. An index value is used to represent each group of feature values. For example, a center value (i.e., an average value) of the plurality of feature values belonging to the same group is used as the index value representing the group. Conversely, a feature value having a distance to the index value less than a preset threshold value is considered as a feature value belonging to the group represented by the index value.
[0117] In the Get / Put request, in addition to the indication of the key, a time label can also be indicated. In Figure 5B , the host 510 sends the processor 550 a Put request carrying a key and a time label (Put(Key, Time)), the processor 550 generates a clustering request sent to the accelerator 530, an insert element command (also called an "address allocation request" in the Chinese patent application with the application number 201910874351.8) sent to the data manager 540, and an access request sent to the storage device 520.
[0118] In some embodiments, when the first request is a Get request carrying an index, the first request carries a key, a time label, and a first index value, the processor 550 generates an address acquisition request, an access request, and a search request; when the first request is a Get request, the first request carries a key and a time label, the processor 550 generates a clustering request, an address acquisition request, an access request, and a search request; when the first request is a Get Index request, the first request carries a key, and the processor 550 only generates a clustering request. Figure 5C A flowchart of the information processing system 500 executing a Get request is given. As shown in Figure 5C , the host 510 sends the processor 550 a Get request carrying a key and a time label (Get(Key, Time)), the processor 550 generates a clustering request and a search request sent to the accelerator 530, a search element command (also called an "address acquisition request" in the Chinese patent application with the application number 201910874351.8) sent to the data manager 540, and an access request sent to the storage device 520.
[0119] In some embodiments, if the second request generated by the processor 550 comprises the insert element command and the access request, the processor 550 sends the insert element command carrying the key and the time label to the data manager 540; the data manager 540 allocates the first storage address for the data associated with the key according to the time label carried by the insert element command, saves the first storage address in association with the time label and returns the first storage address to the processor 550; and the processor 550 sends the access request carrying the first storage address to the storage device 520 to instruct the storage device 520 to save the data associated with the key according to the first storage address.
[0120] In some embodiments, if the second request generated by the processor 550 comprises the clustering request, the insert element command and the access request, the processor 550 sends the clustering request to the accelerator 530 and acquires the first index value returned by the accelerator 530; the processor 550 sends the insert element command carrying the first index value, the key and the time label to the data manager 540; the data manager allocates the first storage address for the data associated with the key according to the time label carried by the insert element command and the first index value, saves the first storage address in association with the time label and returns the first storage address to the processor 550; and the processor 550 sends the access request carrying the first storage address to the storage device 520 to instruct the storage device 520 to save the data associated with the key according to the first storage address.
[0121] In some embodiments, if the second request generated by the processor 550 comprises only the clustering request, the processor 550 sends the clustering request to the accelerator 530 and acquires the first index value returned by the accelerator 530, and the processor 550 returns the first index value to the host 510 as the processing result of the first request.
[0122] In some embodiments, if the second request generated by the processor 550 comprises a search element command, an access request and a search request, the processor 550 sends the search element command carrying the first index value and the time label to the data manager 540; the data manager 540 acquires at least one second storage address corresponding to the at least one feature value corresponding to the time label and the first index value from the data saved by itself according to the time label and the first index value, and returns the at least one second storage address to the processor; the processor 550 accesses the storage device 520 using the at least one second storage address to acquire at least one feature value returned by the storage device 520; the processor 550 sends the search request indicating the keyword and the at least one feature value to the accelerator 530 to acquire at least one first feature value corresponding to the keyword filtered from the at least one feature value by the accelerator 530, and returns the at least one first feature value to the processor 550, the first feature value being a feature value with a distance to the keyword less than a preset threshold or the at least one first feature value being M feature values with the smallest distance to the keyword in the at least one feature value, M being greater than or equal to 1; and the processor 550 returns the at least one first feature value to the host 510 as the processing result of the first request.
[0123] In some embodiments, as shown in Figure 5C if the second request generated by the processor 550 comprises a clustering request, a search element command, an access request and a search request, the processor 550 sends the clustering request to the accelerator and acquires the first index value returned by the accelerator; the processor 550 sends the search element command carrying the first index value and the time label to the data manager 540; the data manager 540 acquires at least one second storage address of the at least one feature value corresponding to the first index value from the data saved by itself according to the time label and the first index value, and returns the at least one storage address to the processor 550; the processor 550 accesses the storage device 520 using the at least one second storage address, for example, the processor 550 sends a data reading request and the at least one second storage address to the storage device 520 to acquire at least one feature value returned by the storage device 520; the processor 550 sends the search request indicating the keyword and the at least one feature value to the accelerator 530, and acquires at least one first feature value returned by the accelerator 530, the first feature value being a feature value with a distance to the keyword less than a preset threshold or the at least one first feature value being M feature values with the smallest distance to the keyword in the at least one feature value, M being greater than or equal to 1; and the processor 550 returns the at least one first feature value to the host 510 as the processing result of the first request.
[0124] In various embodiments, the processor 550 indicates to the host 510 that the processing of the first request is completed in response to receiving completion information for characterizing the completion of the storage of the keyword from the storage device 520.
[0125] In some embodiments, as shown inFigure 5B As shown, if the second request generated by the processor 550 comprises a clustering request, an address allocation request and an access request, the processor 550 generates the clustering request according to the first request, and sends the clustering request to the accelerator 530; in response to the clustering request, the accelerator 530 determines the first index value corresponding to the key, and returns the first index value to the processor 550; after the processor 550 receives the first index value, the processor 550 generates the insert element command according to the first request and the first index value, and sends the insert element command to the data manager 540; in response to the insert element command, the data manager 540 allocates the first storage address for the key according to the first index value and the time label, and returns the first storage address to the processor 550, the first storage address being used to access the storage device 520; after the processor 550 receives the first storage address, the processor 550 generates the data insertion command of the storage device according to the first request and the first storage address, and sends the data insertion command to the storage device 520; in response to the data insertion command, the storage device 520 saves the data associated with the key according to the first storage address.
[0126] In various embodiments, the interface function carries at least one of the type of the request, the key and the first index value.
[0127] In various embodiments, if the second request generated by the processor 550 comprises at least two of the clustering request, the search request, the address allocation request, the address acquisition request and the access request, the processor 550 generates the at least two requests at one time according to the first request; or, the processor 550 generates the at least two requests at multiple times according to the first request.
[0128] Embodiment four of the present application provides a host, comprising an application program module, an API interface module, a management module, an acceleration drive module, a mapping drive module and a hard disk drive module, wherein the application program module calls an API provided by the API interface module to provide a time label; the management module sends a drive request to at least one of the acceleration drive module, the mapping drive module and the hard disk drive module according to the called API; if the drive request is received, the acceleration drive module operates an accelerator coupled with itself, and returns a first operation result to the management module; if the drive request carrying the time label is received, the mapping drive module operates a data manager coupled with itself, and returns a second operation result to the management module; if the drive request is received, the hard disk drive module operates a storage device coupled with itself, and returns a third operation result to the management module; after the management module receives the first operation result, the second operation result or the third operation result, the management module returns information indicating that the called API is called to completion to the application program module through the API interface module.
[0129] In one embodiment, the first operation result indicates a first index value corresponding to the keyword, the keyword being a keyword provided by the application program calling the API; the second operation result indicates one or more storage addresses of the storage device; and the third operation result indicates that the storage device has completed a write operation on the one or more addresses, or a first feature value read from the storage device, the first feature value being a feature value with a distance to the keyword less than a preset threshold or at least one first feature value being M feature values with the smallest distance to the keyword among at least one feature value, M being greater than or equal to 1.
[0130] Embodiment five of the present application provides an information processing method, comprising: in response to receiving a first request indicating a keyword (Key) and a time label (time), generating one or more second requests, the second request including one or more of a clustering request, a search request, an address allocation request, an address acquisition request, and a storage device access request; and generating a processing result of the first request according to a processing result of the one or more second requests.
[0131] In one embodiment, the clustering request indicates obtaining an index value with the smallest distance to the keyword among X index values, where X is a positive integer; the search request indicates obtaining M feature values with the smallest distance to the keyword among N feature values, where M and N are positive integers; the address allocation request indicates obtaining one or more storage addresses corresponding to the time label and the keyword and / or the first index value; the address acquisition request indicates obtaining one or more storage addresses storing X index values corresponding to the time label and the keyword; and the storage device access request indicates the storage device accessing the one or more storage addresses.
[0132] In one embodiment, if the first request is a request indicating a keyword generated by calling a Get(Key, time) API, a clustering request is generated according to the keyword, an address acquisition request is generated using an index value returned by the clustering request and a time label (time), a storage device access request is generated according to a storage address returned by the address acquisition request, a search request is generated according to X index values returned by the storage device access request, and M feature values returned by the search request are used as the processing result of the first request.
[0133] In one embodiment, if the first request is a request indicating a keyword and an index value generated by calling a Get_With_Index(Key, Index, time) API, an address acquisition request is generated according to the index value and a time label (time), a storage device access request is generated according to a storage address returned by the address acquisition request, a search request is generated according to X index values returned by the storage device access request, and M feature values returned by the search request are used as the processing result of the first request.
[0134] In various embodiments, if the first request is a request indicating a key generated by calling the Get_Index(Key) API, a clustering request is generated according to the key, and an index value returned by the clustering request is used as a processing result of the first request.
[0135] In various embodiments, if the first request is a request indicating a key generated by calling the Put(Key, time) API, a clustering request is generated according to the key, an address allocation request is generated according to an index value returned by the clustering request and the key and a time label (time), and an access request of a storage device is generated according to a storage address returned by the address allocation request to write data corresponding to the key into the storage device.
[0136] In various embodiments, if the first request is a request indicating a key and an index value generated by calling the Put_With_Index(Key, Index, time) API, an address allocation request is generated according to the index value and the key and a time label (time), and an access request of a storage device is generated according to a storage address returned by the address allocation request to write data corresponding to the key into the storage device.
[0137] Embodiment six of the present application provides an information processing system, comprising: a first module configured to generate one or more second requests in response to receiving a first request indicating a key (Key) and a time label (Time), the second request comprising one or more of a clustering request, a search request, an address allocation request, an address acquisition request, and an access request of a storage device; and a second module configured to generate a processing result of the first request according to a processing result of the one or more second requests.
[0138] Embodiment seven of the present application provides an information processing system, comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, and the processor implements the following steps when executing the program: generating one or more second requests in response to receiving a first request indicating a key (Key) and a time label (Time), the second request comprising one or more of a clustering request, a search request, an address allocation request, an address acquisition request, and an access request of a storage device; and generating a processing result of the first request according to a processing result of the one or more second requests.
[0139] Embodiment eight of the present application provides an information processing system, comprising a host, an accelerator, a data manager and a storage device, wherein the accelerator, the data manager and the storage device are coupled to the host respectively; the host generates a second request according to a first request, the second request comprising one or more of a clustering request, a search request, an address allocation request carrying a time label (Time), an address acquisition request carrying a time label (Time) and an access request of the storage device; the host uses the second request to operate at least one of the accelerator, the data manager and the storage device to complete the processing of one or more second requests to obtain the processing result of the first request. The working mode of the information processing system in the embodiment can refer to the information processing system in embodiment three, the difference is that the information processing system in the embodiment does not comprise the processor in embodiment four, and the functions realized by the processor in the embodiment four are realized by the host.
[0140] In one embodiment, an application program of the host generates a first request carrying a time label (Time); a hypervisor of the host generates a second request according to the first request; the first request comprises a read request or a write request, the first request carries a key or the first request carries a key and an index value corresponding to the key.
[0141] In some embodiments, if the first request is a request carrying a time label (Time), a key and a first index value generated by calling Put_With_Index (Key, Index, time) API, the host generates an address allocation request and an access request of the storage device; or, if the first request is a write request carrying a key generated by calling Put (Key) API, the host generates a clustering request, an address allocation request and an access request of the storage device.
[0142] In some embodiments, if the first request is a read request carrying a time label (Time), a key and an index value generated by calling Get_With_Index (Key, Index, time) API, the host generates an address acquisition request, an access request of the storage device and a search request; or, if the first request is a read request carrying a time label (Time) and a key generated by calling Get (Key, Time) API, the host generates a clustering request, an address acquisition request, an access request of the storage device and a search request; or, the first request is a read request generated by calling Get_Index (Key) API, and the processor 550 only generates a clustering request.
[0143] In some embodiments, if the second request generated by the host includes an address allocation request and a storage device access request, the host sends the address allocation request to the data manager and obtains a storage address provided by the data manager; and the host sends the storage device access request carrying the storage address to the storage device to instruct the storage device to save the data associated with the keyword according to the storage address.
[0144] In some embodiments, if the second request generated by the host includes a clustering request, an address allocation request and an access request, the host sends the clustering request to the accelerator and obtains a first index value returned by the accelerator; the host sends the address allocation request carrying the obtained time label (time) and the first index value and / or the keyword to the data manager and obtains a storage address allocated by the data manager for the keyword according to the first index value; and the host sends the storage device access request carrying the storage address to the storage device to instruct the storage device to save the data associated with the keyword according to the storage address.
[0145] In some embodiments, if the second request generated by the host includes only a clustering request, the host sends the clustering request to the accelerator and obtains a first index value returned by the accelerator; and the host takes the first index value as the processing result of the first request.
[0146] In some embodiments, if the second request generated by the host includes an address allocation request, an access request and a search request, the host sends the address allocation request carrying the obtained first index value and time label (time) to the data manager and obtains at least one storage address of at least one feature value corresponding to the first index value returned by the data manager; the host accesses the storage device with the at least one storage address and obtains at least one feature value returned by the storage device; the host sends the search request indicating the keyword and the at least one feature value to the accelerator to obtain at least one first feature value corresponding to the keyword from the at least one feature value filtered by the accelerator and returned to the processor, the first feature value being a feature value with a distance less than a preset threshold from the keyword or the at least one first feature value being M feature values with the smallest distance from the keyword in the at least one feature value, M being greater than or equal to 1; and the host takes the at least one first feature value as the processing result of the first request.
[0147] In some embodiments, if the second request generated by the host comprises a clustering request, an address obtaining request, an access request and a search request, the host sends the clustering request to the accelerator, and obtains the first index value returned by the accelerator; the host sends the address obtaining request carrying the obtained first index value to the data manager, and obtains the at least one storage address of the at least one feature value corresponding to the first index value returned by the data manager; the host accesses the storage device by using the at least one storage address to obtain the at least one feature value returned by the storage device; the host sends the search request indicating the keyword and the at least one feature value to the accelerator, and obtains the at least one first feature value returned by the accelerator, the first feature value being a feature value with a distance to the keyword less than a preset threshold, or the at least one first feature value being M feature values with the smallest distance to the keyword among the at least one feature value, M being greater than or equal to 1; and the host takes the at least one first feature value as the processing result of the first request.
[0148] In other embodiments, the host identifies that the processing of the first request is completed in response to receiving completion information from the storage device, the completion information being used to characterize the completion of storing the keyword.
[0149] In various embodiments, the interface function carries at least one of the type of the request, the keyword and the first index value.
[0150] In various embodiments, if the second request generated by the host comprises at least two of a clustering request, a search request, an address allocation request, an address obtaining request and an access request, the host generates the at least two requests at one time according to the first request; or, the host generates the at least two requests at multiple times according to the first request.
[0151] In various embodiments, if the second request generated by the host comprises a clustering request, an address allocation request and an access request, the host generates the clustering request according to the first request, and sends the clustering request to the accelerator; in response to the clustering request, the accelerator determines the first index value corresponding to the keyword, and returns the first index value to the host; after receiving the first index value, the host generates the address allocation request according to the first request, the first index value and a time label (time), and sends the address allocation request to the data manager; in response to the address allocation request, the data manager allocates the storage address for the keyword according to the first index value, and returns the storage address to the host, the storage address being used to access the storage device; after receiving the storage address, the host generates the access request of the storage device according to the first request and the storage address, and sends the access request of the storage device to the storage device; in response to the access request of the storage device, the storage device saves the keyword according to the storage address.
[0152] Embodiment nine of the present application provides an information processing method, comprising: generating a second request according to a first request, the second request comprising one or more of a clustering request, a search request, an address allocation request, an address acquisition request, and a storage device access request; and using the second request to operate at least one of an accelerator, a data manager, and a storage device to complete processing of the one or more second requests to obtain a processing result of the first request.
[0153] Embodiment ten of the present application provides an information processing system, comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the program: generating a second request according to a first request, the second request comprising one or more of a clustering request, a search request, an address allocation request, an address acquisition request, and a storage device access request; and using the second request to operate at least one of an accelerator, a data manager, and a storage device to complete processing of the one or more second requests to obtain a processing result of the first request.
[0154] Although the examples described with reference to the present application are only for the purpose of explanation and not a limitation of the present application, changes, additions and / or deletions to the embodiments can be made without departing from the scope of the present application.
[0155] The above merely describes specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A time-series database, characterized in that, Including data managers and storage devices, among which, The time-series database receives data processing commands, which indicate one or more time tags. The data processing commands include data write commands, data delete commands, data query commands, or data replace commands. The data manager receives or generates a first command corresponding to the data processing command, executes the first command, and outputs one or more storage addresses corresponding to the time tag carried by the first command to the outside; wherein, the storage address is used to access the storage device; the data manager is used to maintain and manage the time tags of time series data and the storage addresses corresponding to the time tags; In response to the data processing command being a data write command, the storage device writes the data to be written as indicated by the data write command according to the one or more storage addresses.
2. The time-series database as described in claim 1, characterized in that, The data manager includes an insertion module and a storage module, wherein, In response to the data processing command being a data write command, the first command received or generated by the data manager is an element insertion command, and the element insertion command carries a first time tag; The insertion module allocates a first storage space to the storage module according to the first time tag, and operates the storage module to save the first time tag and the first storage address in the first storage space, wherein the first storage address corresponds to the first time tag.
3. The time-series database as described in claim 2, wherein the data manager further includes a mapping module, characterized in that, The first command also carries a first index value, which points to a first region in the storage module; The mapping module provides the insertion module with an indication of the first region based on the first index value; when the insertion module determines the first storage space, the insertion module searches for the second storage space in the first region based on the first time tag, and determines the storage space of the unsaved data adjacent to the second storage space as the first storage space, wherein the second storage space is the storage space of the time tag with the smallest difference from the first time tag among the multiple time tags saved in the storage module.
4. The time-series database as described in claim 2 or 3, characterized in that, The data manager also includes a search module, wherein, In response to the data processing command being a data deletion command, the first command received or generated by the data manager is a delete element command; or in response to the data processing command being a data query command, the first command received or generated by the data manager is a search element command. When the first command is the search element command or the delete element command, the first command carries one or two second time tags. The search module searches for a third storage space corresponding to the one or two second time tags in at least one storage space in the storage module.
5. The time-series database as described in claim 4, characterized in that, The first command carries a second time tag. If the second time tag indicates a start time, the search module searches for the third storage space where the time tag stored in the storage module is located between the start time and the maximum time indicated by all time tags. If the second time tag indicates an end time, the search module searches for the third storage space where the time tag stored in the storage module is located between the minimum time indicated by all time tags and the end time. The maximum time is the largest time among all times corresponding to all time tags stored in the storage module, and the minimum time is the smallest time among all times corresponding to all time tags.
6. The time-series database as described in claim 5, characterized in that, The second time tag includes a time moment and a time flow direction. The search module determines the time moment as a start time moment or an end time moment based on the time flow direction. If the time flow direction indicates that a time tag greater than the time moment is being searched, the search module determines the time moment as a start time moment. The search module then searches the third storage space, where the saved time tag is located between the start time moment and the maximum time moment, within the at least one storage space. If the time flow direction indicates that a time tag less than the time moment is being searched, the search module determines the time moment as an end time moment. The search module then searches the third storage space, where the saved time tag is located between the minimum time moment and the end time moment, within the at least one storage space.
7. The time-series database as described in claim 6, wherein the data manager further includes an acquisition module, characterized in that, When the first command is the search element command, after the search module finds the third storage space, it sends the first command and the physical address corresponding to the third storage space to the acquisition module; the acquisition module reads the first data stored in the third storage space from the storage module; after reading the first data, the acquisition module sends at least one second storage address to the external unit coupled to the data manager, wherein the first data includes the at least one second storage address, and the at least one second storage address is an address used to access the storage device.
8. The time-series database as described in claim 4, characterized in that, The data manager further includes a deletion module. When the first command is the delete element command, after the search module finds the third storage space, it sends the first command and the physical address corresponding to the third storage space to the deletion module. The deletion module retrieves the first data stored in the third storage space from the storage module and operates the storage module to delete the first data. The deletion module also sends at least one second storage address to an external unit coupled to the data manager. The first data includes the at least one second storage address, which is an address used to access the storage device.
9. The time-series database as described in claim 2 or 3, wherein the data manager further includes a replacement module, characterized in that, In response to the data processing command being a data replacement command, the first command received or generated by the data manager is a replacement element command. The first command carries the storage address before the change and the storage address after the change. Both the storage address before the change and the storage address after the change are addresses used to access the storage device. The replacement module obtains the storage space in the storage module that stores the storage address before the change based on the storage address before the change, and replaces the stored storage address before the change with the storage address after the change.
10. The time-series database as described in claim 9, wherein the data manager further includes a command distribution module, characterized in that, The command distribution module receives the first command or generates the first command according to the data processing command, and sends the first command to the insertion module, search module, acquisition module, deletion module or replacement module according to the identifier of the first command or the data carried by the first command.
Citation Information
Patent Citations
Methods and information processing systems for handling read (Get) / Put (Write) requests using accelerators.
CN111580742B
Accelerator for clustering computation
CN111581441A
Data writing method, data reading method and related equipment and systems
CN107229415A
Method, apparatus, device and computer storage medium for storing and querying timing data
CN109063012A