Data storage method and system, computing equipment and electronic equipment
By determining whether the service data is the target data on the storage side and directly cached to the preset storage disk based on the judgment, the problems of waste of cache resources and low data storage performance are solved, and more efficient cache resource utilization and data storage performance are achieved.
Patent Information
- Application Number
- CN202510273165.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-04-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, computing devices such as servers retain hot and cold data on the cache disk, resulting in wasted cache resources and affecting data storage performance.
By obtaining the service data to be stored and its attribute information on the storage side, it is determined whether the data is the target data (such as backup data). If so, it is cached directly to the preset storage disk, rather than to the cache disk first.
Effectively utilize cache resources to improve the data storage performance of computing devices, and avoid the problems of cache write-through and data double-write problems.
Smart Images

Figure CN119782209A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data storage method, system, computing device and storage medium. Background Art
[0002] At present, in order to improve data storage performance, servers and other computing devices usually add cache disks to cache user business data, and use preset cache optimization algorithms to distinguish the data on the cache disk to distinguish between cold data and hot data. The preset cache optimization algorithm generally tends to retain hot data on the cache disk to ensure data access efficiency, and periodically flush cold data to the storage disk to free up cache space.
[0003] However, in actual applications, business data includes periodic backup data, which is a one-time data that will not be accessed again in a short period of time. If the periodic backup data is also written to the cache disk first, cache resources will be wasted, which is not conducive to ensuring the data storage performance of the computing device. Summary of the invention
[0004] The present application provides a data storage method, system, computing device and electronic device to at least solve the problem in the related art of wasting cache resources and being unfavorable to ensuring the data storage performance of the computing device.
[0005] The present application provides a data storage method, which is applied to a storage end, and the method includes: Acquire the business data to be stored and the attribute information of the business data; According to the attribute information of the business data, determine whether the business data is the target data; When it is determined that the business data is not the target data, the business data is cached to a preset cache disk; When it is determined that the business data is the target data, the business data is directly cached to a preset storage disk; The target data includes backup data.
[0006] The present application also provides a data storage method, which is applied to an application end, and the method includes: Sending a target query command to the storage end to obtain target query information returned by the storage end in response to the target query command; According to the target query information returned by the storage end, determine whether the storage end supports the attribute information analysis function of the business data; When it is determined that the storage end supports the attribute information analysis function of the business data, the business data to be stored is sent to the storage end, and at the same time, the attribute information of the business data is sent to the storage end, so that the storage end obtains the business data to be stored and the attribute information of the business data, and determines whether the business data is the target data according to the attribute information of the business data; Among them, when the storage end determines that the business data is not the target data, the business data is cached to the preset cache disk; when the business data is determined to be the target data, the business data is directly cached to the preset storage disk; the target data includes backup data.
[0007] The present application also provides a data storage system, the system comprising: an application end and a storage end; The application end is used to send target query commands to the storage end; The storage end is used to return the target query information to the application end in response to the target query command; The application end is used to determine whether the storage end supports the attribute information analysis function of the business data according to the target query information returned by the storage end, and when it is determined that the storage end supports the attribute information analysis function of the business data, the application end sends the business data to be stored to the storage end and sends the attribute information of the business data to the storage end at the same time; The storage end is used to determine whether the business data is the target data based on the business data to be stored and the attribute information of the business data, and cache the business data to a preset cache disk if it is determined that the business data is not the target data; if it is determined that the business data is the target data, directly cache the business data to the preset storage disk; The target data includes backup data.
[0008] The present application also provides a data storage device, which is applied to a storage end, and the device includes: An acquisition module, used to acquire the business data to be stored and the attribute information of the business data; A first judgment module, used to judge whether the business data is target data according to the attribute information of the business data; A first storage module, configured to cache the business data to a preset cache disk when it is determined that the business data is not target data; A second storage module is used to directly cache the business data to a preset storage disk when it is determined that the business data is target data; The target data includes backup data.
[0009] The present application also provides a data storage device, which is applied to an application end, and the device includes: A sending module, used for sending a target query command to the storage end to obtain target query information returned by the storage end in response to the target query command; The second judgment module is used to judge whether the storage end supports the attribute information analysis function of the business data according to the target query information returned by the storage end; A third storage module is used to send the business data to be stored to the storage end and the attribute information of the business data to the storage end when it is determined that the storage end supports the attribute information analysis function of the business data, so that the storage end obtains the business data to be stored and the attribute information of the business data, and determines whether the business data is the target data according to the attribute information of the business data; Among them, when the storage end determines that the business data is not the target data, the business data is cached to the preset cache disk; when the business data is determined to be the target data, the business data is directly cached to the preset storage disk; the target data includes backup data.
[0010] The present application also provides a computing device, including: any one of the above-mentioned data storage systems.
[0011] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above data storage methods when executing the computer program.
[0012] The present application also provides a computer-readable storage medium, in which a computer program is stored, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned data storage methods are implemented.
[0013] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above data storage methods when executed by a processor.
[0014] Through the present application, since the target data is identified at the storage end and directly cached to the preset storage disk without first caching it to the preset cache disk, it is possible to solve the problem of wasting cache resources in the related technology and being not conducive to ensuring the data storage performance of the computing device, thereby achieving the technical effect of making full use of cache resources and improving the data caching performance of the computing device. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0016] Figure 1 A schematic diagram of the hardware structure on which the embodiments of the present application are based; Figure 2A schematic diagram of a data storage method provided in an embodiment of the present application; Figure 3 A schematic diagram of the structure of a hyper-convergence scenario provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of the host operating system provided in the embodiment of the present application; Figure 5 A schematic diagram of a flow chart of another data storage method provided in an embodiment of the present application; Figure 6 A schematic diagram of the interaction process of the data storage system provided in an embodiment of the present application; Figure 7 A schematic diagram of the structure of a data storage device provided in an embodiment of the present application; Figure 8 A schematic diagram of the structure of another data storage device provided in an embodiment of the present application; Fig. 9 A schematic diagram of the structure of a computing device provided in an embodiment of the present application; Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0017] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0019] It should be noted that, in the description of this application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0020] In related technologies, hyper-converged architecture (HCI) is a software-defined IT infrastructure, and software-defined storage (SDS) is the core of the hyper-converged structure. SDS stores data in a dispersed manner on multiple hosts and can provide features such as multiple copies and error correction. Compared with traditional centralized storage, it has the advantages of high reliability, high availability and scalability. SDS provides block services, object services, file services, etc. to the upper layer, which can be applied to different application scenarios. Among them, block service is the most important service. In the hyper-converged structure, the iSCSI protocol is often used to provide block services to the host. iSCSI is a data storage technology based on IP SAN, which can encapsulate SCSI protocol data packets into Ethernet data packets and provide block device services to remote hosts based on the existing TCP / IP infrastructure.
[0021] As an old interface standard for connecting computers and peripheral devices, the SCSI protocol has been evolving. Taking the SCSI Block Commands (SBC) protocol in the SCSI protocol family as an example, it has evolved to the fifth generation standard and introduced features such as W-LUN Dual-Actuator, Stream Control model, and io advice hint. The introduction of these features enhances the interaction between the host side and the storage server, and improves data IO access efficiency by providing more data usage model information to the storage side.
[0022] Software-defined storage is essentially a distributed storage, which usually saves data copies on different nodes in a sliced manner according to a predetermined strategy, thereby ensuring data reliability and avoiding single point failure scenarios. Data copies are usually saved on disks in the form of files or data blocks (chunks). For the backend disk as HDD type hardware scenario, there will inevitably be performance bottlenecks. The conventional optimization method introduces SSD cache disks to accept user IO requests and flush data according to the preset flushing algorithm, which can ensure the IO performance of software-defined storage while reducing hardware costs.
[0023] However, the effectiveness of cache management strategies depends on the actual application scenarios, and there is no universal cache management strategy for all scenarios. Generally speaking, based on the "temporal locality" principle and the "spatial locality principle" in computer principles, applications usually focus on accessing data that is close to the address within a period of time, so cache data is usually managed based on a preset flushing algorithm. For example, an LRU-like algorithm divides data into "cold data" and "hot data" according to the access frequency of the data. The cache strategy prioritizes saving "hot data" in the cache to ensure data access efficiency; while cold data is periodically flushed to free up more cache space. However, in hyper-converged application scenarios, due to the complexity of the business, the locality principle is not always effective, which leads to the effectiveness of the cache strategy, resulting in low cache utilization, cache write-through and other problems, affecting the overall performance of the storage. Take the demand for periodic business backup in a hyper-converged application scenario as an example. This demand will write a large amount of data sequentially to the backend storage in a short period of time. These data are one-time data that will not be accessed again in a short period of time. Logically, these data do not need to be written to the cache, but can be directly written to the backend HDD disk. In fact, since software-defined storage cannot perceive the characteristics of such business data, it will still write it into the cache and then flush the data to the HDD, which leads to two problems: 1. It causes cache write-through problem, because the speed of flushing data to the HDD is slower than the speed of writing to the cache, and a large amount of data written in a short period of time will trigger this problem; 2. The problem of double data writing. Backup data is cold data that will not be accessed again within a short period of time after being written. It is more appropriate to write it directly to the HDD rather than writing it to the cache and then flushing it.
[0024] One idea to solve the above problem is to have the upper-layer application actively pass the data write mode to the storage side, and the storage side selects the appropriate cache application mode of the data based on this information to improve data storage and access efficiency. Since in a hyper-converged system, the virtualization host is usually connected to the software-defined storage based on the iSCSI protocol, we can implement the transmission of IO data write mode information to the storage side based on the io advice hint feature in the SCSISBC-5 protocol.
[0025] Based on the above analysis, in order to solve the above technical problems, the embodiments of the present application firstly add a new control interface ioctl to the file system of the operating system to support the input of IO hint information, which can set the life cycle of file IO; secondly, add io hint information transmission to the block layer and SCSI driver layer of the operating system, wherein the SCSI layer will send the SCSI request to the storage end based on the SBC-5 io advicehint feature according to the SCSI protocol standard; finally, add the analysis of the ioadvice hint feature and the IO request life cycle management on the software-defined storage side, and determine the cache usage strategy according to the IO request life cycle.
[0026] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0027] In conjunction with the specific application environment architecture or the specific hardware architecture on which the execution of the data storage method depends, the specific application environment architecture or the specific hardware architecture is described herein.
[0028] The embodiments of the present application provide a data storage method, system, computing device, and electronic device suitable for storing business data generated by applications on computing devices such as servers. Figure 1 The figure is a schematic diagram of the hardware structure based on the embodiment of the present application, which mainly includes a data storage device, a preset cache disk and a preset storage disk. After obtaining the business data, the data storage device caches the business data to the preset cache disk or directly stores it to the preset storage disk according to the attribute information of the business data.
[0029] An embodiment of the present application provides a data storage method, and the method is described in detail in conjunction with the execution flow of the data storage method.
[0030] The data storage method provided in the embodiment of the present application is applied to the storage end to store the business data generated by the application on the computing device such as the server. The execution subject of the embodiment of the present application is an electronic device, such as a server, a desktop computer, a laptop computer, a tablet computer and other electronic devices that can be used for business data storage.
[0031] like Figure 2 FIG. 1 is a flow chart of a data storage method provided in an embodiment of the present application, the method comprising: Step 201: Acquire the business data to be stored and the attribute information of the business data.
[0032] Among them, business data includes business data initiated by the application to the storage end, such as user registration information, login records and operation logs, etc. The attribute information of business data includes data type, data usage and data source, etc.
[0033] Step 202: determine whether the business data is target data based on the attribute information of the business data.
[0034] The target data includes backup data.
[0035] It should be noted that target data refers to one-time data that the application will not access again in a short period of time, such as backup data.
[0036] Step 203: When it is determined that the business data is not the target data, the business data is cached to a preset cache disk.
[0037] Specifically, if the business data is not the target data, it indicates that the business data may be accessed by the application in the future. Therefore, the business data is first cached to the preset cache disk to ensure that when an application accesses the business data later, the storage end can respond quickly based on the preset cache disk.
[0038] Step 204: When it is determined that the business data is target data, the business data is directly cached to a preset storage disk.
[0039] Specifically, since the application will no longer access the target data during subsequent operation, when it is determined that the business data is the target data, the business data can be cached directly to the preset storage disk instead of being cached in the preset cache disk first, so as to solve the problem of wasting cache resources in related technologies and not being conducive to ensuring the data storage performance of the computing device.
[0040] Based on the above embodiment, as an implementable manner, in one embodiment, the method further includes: Step 301, when it is determined that the business data is not the target data, the life cycle of the business data is determined according to the attribute information of the business data; Step 302: determine whether the business data is cold data or hot data according to the life cycle of the business data.
[0041] It should be noted that the data storage method provided in the embodiment of the present application is applied to a hyper-convergence scenario, such as Figure 3 As shown, it is a structural diagram of the hyper-convergence scenario provided by the embodiment of the present application, including a host-side IO stack and a software-defined storage-side IO stack. Among them, in the host-side IO stack, the application IO request is completed through file IO reading and writing, and the IO is passed to the block layer of the operating system via the VFS layer (virtual file system layer) interface. The block layer is an abstraction of all storage devices, and SCSI devices are a type of storage device commonly used in server hyper-convergence scenarios. IO requests are passed to the SCSI protocol layer via the block layer. SCSI supports parallel interfaces, SAS interfaces, Fibre Channel, iSCSI protocols, etc. at the transport layer. Hyper-convergence scenarios usually use iSCSI protocols to connect to the storage service side, that is, software-defined storage services. In the software-defined storage IO stack, software-defined storage is usually located in the same hardware cluster as the business application, and data interaction is performed through the iSCSI protocol. Software-defined storage provides iSCSI storage services to the host side through the iSCSI target (iSCSI protocol destination) interface. After the IO request is processed by the software-defined storage core, the data will be copied to the cache disk (preset cache disk) or the back-end HDD device (preset storage disk) according to the strategy determined by the data storage method provided in the embodiment of the present application to complete data persistent storage.
[0042] Specifically, when the business data is not the target data and is therefore cached to a preset cache disk, the life cycle of the business data is determined based on the attribute information of the business data, and then whether the business data is cold data or hot data is determined based on the length of its life cycle.
[0043] Among them, hot data refers to data that is frequently accessed recently. This data is of great significance to the current operation of the business and needs to be accessed quickly to support business operations. For example, the order data currently in progress on the business platform, the real-time status data of users, etc. Cold data refers to data that is rarely accessed. Although this data still has preservation value, the access frequency is low. For example, historical order data of users many years ago, old documents that have been archived, etc.
[0044] Specifically, in one embodiment, the data type and access record information of the business data are determined according to the attribute information of the business data; and the life cycle of the business data is determined according to the data type and access record information of the business data.
[0045] Among them, the attribute information of business data includes the data type and access record information of business data. The access record information is used to characterize the time of each access and the corresponding time interval. The life cycle of business data is used to characterize the access frequency prediction result of business data, so as to determine whether the business data is cold data or hot data.
[0046] Specifically, in one embodiment, the access frequency index of the business data may be determined based on the access record information of the business data; and the life cycle of the business data may be determined based on the data type and access frequency of the business data.
[0047] Specifically, the access frequency index of the business data can be determined by analyzing the access record information of the business data. The access frequency index of the business data represents the actual access frequency of the business data. The access frequency prediction result of the business data can be further determined by combining the data type and access frequency of the business data to obtain the life cycle of the business data.
[0048] Specifically, in one embodiment, the access time interval of the business data can be determined according to the initiation time of the target access behavior; the request time interval of the business data can be determined according to the access timestamp of the business data; and the access frequency index of the business data can be determined according to the access time interval and request time interval of the business data.
[0049] The target access behavior includes the access behavior to the business data, and the access record information includes the initiation time of the target access behavior and the access timestamp of the business data.
[0050] It should be noted that the access time interval of business data is a measurement of the interval between the initiation times of two adjacent access behaviors in a series of access behaviors to a specific file (business data). Here, it focuses more on measuring the interval between each access from the perspective of the initiation time, which is a quantitative indicator of the characteristics of the file access time interval. The request time interval refers to the time difference between two consecutive access requests to the same file. The request time interval and the access time interval are essentially describing the time interval, but the access time interval emphasizes a general and abstract concept of file access interval, while the request time interval focuses more specifically on the time interval between two requests for the same file.
[0051] Specifically, in one embodiment, in order to improve the accuracy of the result of determining the life cycle of the business data, the life cycle of the business data may be determined based on the following formula:
[0052] in, Represents the life cycle of business data. represents the preset weight, Indicates the data type of business data. Indicates the access frequency index of business data. Indicates the access time interval of business data. Indicates the request time interval for business data.
[0053] The data types of business data include ACHIVE (archive type), COLD (cold data type) and HOT (hot data type). The data type is included in the attribute information of the business data and is set by the application end before sending the business data to the storage end. The preset weight of cold data type business data is less than the preset weight of hot data type business data.
[0054] Furthermore, in one embodiment, when it is determined that the business data is cold data, the business data is written to a cold data queue in a preset cache disk; when the preset cache disk meets the preset data flushing conditions, the data to be flushed is screened in the cold data queue; and the data to be flushed is flushed to the preset storage disk to release the cache space of the preset cache disk.
[0055] The preset data flushing condition includes that the remaining cache resources of the preset cache disk are insufficient or the current cache amount of the preset cache disk reaches a preset flushing threshold.
[0056] Specifically, in one embodiment, when screening the data to be flushed, in order to improve the utilization efficiency of the cache space and the rationality of data flushing, the following screening strategy can be adopted: assign a value score to each piece of cold data, and the value score comprehensively considers factors such as the importance of the data and the possible access probability in the future. Specifically, the data can be scored according to its criticality to the business. For example, the historical backup data of the core business is more important, while the general temporary log data is less important. The future access possibility of the data is predicted in combination with the historical access pattern and the business development trend. For data generated by some periodic businesses, its future access probability can be judged according to the periodic law. When screening, data with lower value scores are given priority as the data to be flushed to ensure that the flushed data has the least impact on the business.
[0057] In addition to the above-mentioned screening strategies, you can also filter based on data timeliness. Specifically, you can consider the timeliness of the data and give priority to refreshing data that has expired or has low timeliness. For example, data related to a specific activity will have greatly reduced timeliness after the activity ends, so it can be refreshed first. Some intermediate result data used for temporary calculations can be used as data to be refreshed if they are no longer needed for subsequent analysis after the calculation task is completed. You can also filter based on data relevance. Specifically, you can analyze the relevance between cold data and give priority to refreshing data that has weak relevance to other active data. This can reduce the impact of refreshing data on the overall data association and query performance of the system. For example, through data mining and association rule analysis, find out the association between data. For those isolated data or data with low relevance to the current core business data, give priority to refreshing.
[0058] Finally, comprehensive sorting and screening are performed, taking into account the above factors, and a comprehensive score is calculated for each cold data. The score calculation can be weighted summed, for example: comprehensive score = data value score × weight 1 + timeliness score × weight 2 + relevance score × weight 3. The data in the cold data queue is sorted according to the comprehensive score, and data with lower comprehensive scores are preferentially selected as the data to be refreshed.
[0059] Based on the above embodiment, as an implementable manner, in one embodiment, judging whether the business data is target data according to the attribute information of the business data includes: Step 2021, determining the data type of the business data according to the attribute information of the business data; Step 2022: Determine whether the business data is target data based on the data type of the business data.
[0060] It should be noted that the attribute information of the business data is also called IO hint information. When the IO hint information indicates that the data type of the business data is ACHIVE (archive type), the business data is determined to be one-time data that will not be accessed again in a short period of time, so it is used as the target data. When the IO hint information indicates that the data type of the business data is not ACHIVE (archive type), the business data is determined not to be the target data.
[0061] For example, Figure 4 As shown, it is a schematic diagram of the structure of the host operating system provided in the embodiment of the present application. In order to apply the data storage method provided in the embodiment of the present application, the host operating system adds IO hint information setting support to the file system control interface ioctl of the host operating system. Specifically, the embodiment of the present application adds an ioctl command IO_HINT_CMD, which takes the file descriptor (fd) accessed by the application and the attribute information such as the IO hint type as input parameters, and can set the data access policy of the subsequent file IO, wherein the file descriptor includes at least the file status identifier and the file storage location information, etc. The IO hint types supported in the embodiment of the present application are ACHIVE, COLD, and HOT, which correspond to the three cycle types of no write cache (archive data), cold, and hot, respectively. The three life cycles respectively indicate the possibility of subsequent access to data, and the probability increases successively. By transmitting this information, the storage end can place the subsequently accessed data in the appropriate position based on the data access mode (data type) to improve access efficiency.
[0062] Secondly, the above IO hint information will be passed to the SCSI protocol layer via the block layer request. Based on the IOadvice hint feature of SBC-5, the IO hint information will be encoded as a Stream ID (stream identifier) and continued to be passed downward. The SBC-5 protocol supports setting different IO streams (IO Stream) for different IO data access modes. Different IO streams may have different IO request modes, life cycles, and even data placement strategies. In the embodiment of the present application, three groups of IO streams are used, corresponding to three different IO life cycles of COLD (cold data), NORMAL (target data) and HOT (hot data). At the same time, according to the previously set io hint type information, the corresponding Stream ID is encoded into the SCSI read and write commands.
[0063] Thirdly, the software-defined storage adds parsing support for io advice hint information for the iSCSI target service, so that the storage can determine whether the business data is the target data based on the iSCSI target service.
[0064] Specifically, when the business data is determined to be the target data, it indicates that the written business data is mainly used for archiving / backup, the data volume is large and will not be accessed again in the future. In this mode, the data is directly written to the HDD without writing to the cache, and the cache space will not be occupied, which can solve the problems of cache write-through and reducing the write hit rate. When the business data is determined to be cold data, the subsequent access frequency of the data is low, the data will be written to the cache, and the underlying data storage object will be placed in the cold data queue of the cache. Once the cache is insufficient or the flush threshold is reached, the data object will be written to the HDD disk (preset storage disk). When the business data is determined to be hot data, the data will most likely be accessed immediately and the access frequency is high. The data will be written to the cache, and the underlying data storage object will be placed in the cache hot data queue. When the cache is insufficient or the flush action is triggered, the corresponding data object will still remain in the cache.
[0065] The data storage method provided in the embodiment of the present application obtains the business data to be stored and the attribute information of the business data; determines whether the business data is the target data according to the attribute information of the business data; caches the business data to a preset cache disk when it is determined that the business data is not the target data; directly caches the business data to a preset storage disk when it is determined that the business data is the target data; wherein the target data includes backup data, which solves the problem of wasting cache resources in related technologies and is not conducive to ensuring the data storage performance of computing devices, and achieves the technical effect of making full use of cache resources and improving the data cache performance of computing devices. In addition, the solution provided in the embodiment of the present application implements the IO lifecycle management strategy of the upper and lower coordination between the application layer and the storage side based on the standard SCSI protocol, which can effectively solve the problems of cache failure and cache write-through on the software-defined storage side due to specific IO request modes, and ensures the operating efficiency and stability of software-defined storage, as well as its applicability to various business scenarios. In addition, the solution is based on the in-band standard SCSI protocol, rather than through out-of-band dedicated interface control. The application side can achieve linkage between the upper and lower layers only through the operating system standard, without being aware of the specific type of the underlying storage. The application layer and the back-end storage are completely decoupled, ensuring the portability and stability of applications between different types of operating systems. This solution can enhance the performance and stability of the hyper-converged system in different business application scenarios, and can effectively improve the competitiveness of hyper-converged products.
[0066] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0067] The data storage method provided in the embodiment of the present application is applied to the application end and is used to store the business data generated by the application on the computing device such as the server. The execution subject of the embodiment of the present application is an electronic device, such as a server, a desktop computer, a laptop computer, a tablet computer and other electronic devices that can be used for business data storage.
[0068] like Figure 5 FIG. 1 is a flow chart of another data storage method provided in an embodiment of the present application, the method comprising: Step 501, sending a target query command to a storage end to obtain target query information returned by the storage end in response to the target query command; Step 502, judging whether the storage end supports the attribute information analysis function of the business data according to the target query information returned by the storage end; Step 503, when it is determined that the storage end supports the attribute information analysis function of the business data, the business data to be stored is sent to the storage end, and at the same time, the attribute information of the business data is sent to the storage end, so that the storage end obtains the business data to be stored and the attribute information of the business data, and determines whether the business data is the target data based on the attribute information of the business data.
[0069] Among them, when the storage end determines that the business data is not the target data, the business data is cached to the preset cache disk; when the business data is determined to be the target data, the business data is directly cached to the preset storage disk; the target data includes backup data.
[0070] Accordingly, in one embodiment, when it is determined that the storage end does not support the attribute information analysis function of the business data, the business data is sent to the storage end so that the storage end caches the business data to a preset cache disk.
[0071] Specifically, according to the SCSI Block Commands (SBC) - 5 protocol specification, the VPD (Vital Product Data) information query support, ioadvice mode policy page support, and stream control feature support verification corresponding to the SCSI protocol can be implemented on the software-defined storage side. The initiator (the initiator, referring to the application side) side uses the sg3 command (target query command) to obtain the target query information returned by the storage side in response to the target query command to query whether the storage side supports the io advice hint information analysis function (attribute information analysis function). If the storage side supports it, the initiator side will pass the attribute information (hint information) of the business data to it. This ensures the compatibility of data transmission and avoids data transmission problems caused by the lack of support from the storage side.
[0072] Among them, the group num field is reserved in standard SCSI WRITE / READ (read and write commands) and other instructions, but it has not been used in the past. After the io advice hint feature is enabled, this idle group num field has a new purpose, which can be used to indicate the IO mode (data type) used by the current write operation. Based on this information, software-defined storage can formulate more reasonable data access strategies. For example, for different IO modes, it can decide whether the data is written directly to the preset storage disk, or temporarily stored to the preset cache disk, and in which area of the cache it is stored, so as to optimize the data storage and access process.
[0073] Specifically, in actual applications, the block layer and SCSI driver layer of the application-side operating system can be modified to support the SCSI IO advice hint feature, thereby supporting the transmission of IO hint information to the software-defined storage end through the SCSI protocol.
[0074] The data storage method provided by the embodiment of the present application sends a target query command to the storage end to obtain the target query information returned by the storage end in response to the target query command; based on the target query information returned by the storage end, it is judged whether the storage end supports the attribute information analysis function of the business data; when it is determined that the storage end supports the attribute information analysis function of the business data, the business data to be stored is sent to the storage end, and at the same time, the attribute information of the business data is sent to the storage end, so that the storage end obtains the business data to be stored and the attribute information of the business data, and judges whether the business data is the target data based on the attribute information of the business data; wherein, when the storage end determines that the business data is not the target data, the business data is cached to a preset cache disk; when it is determined that the business data is the target data, the business data is directly cached to the preset storage disk; the target data includes backup data, which solves the problem of wasting cache resources in related technologies and is not conducive to ensuring the data storage performance of the computing device, and achieves the technical effect of making full use of cache resources and improving the data cache performance of the computing device. Moreover, the solution provided in the embodiment of the present application implements an IO lifecycle management strategy based on the standard SCSI protocol for the upper and lower coordination between the application layer and the storage side, which can effectively solve the problems of cache failure and cache write-through on the software-defined storage side caused by specific IO request modes, and ensure the operating efficiency and stability of software-defined storage, as well as its applicability to various business scenarios. In addition, the solution is implemented based on the in-band standard SCSI protocol, rather than being controlled through an out-of-band dedicated interface. The application side only needs to use the operating system standard to achieve upper and lower layer linkage, without being aware of the specific type of the underlying storage. The application layer is completely decoupled from the back-end storage, ensuring the portability and stability of the application between different types of operating systems. The solution can enhance the performance and stability of the hyper-converged system in different business application scenarios, and can effectively improve the competitiveness of hyper-converged products.
[0075] The data storage system provided in the embodiment of the present application is used to store business data generated by applications on computing devices such as servers.
[0076] like Figure 6 As shown, it is a schematic diagram of the interaction process of the data storage system provided in an embodiment of the present application, and the system includes: an application end and a storage end.
[0077] Among them, the application end is used to send a target query command to the storage end; the storage end is used to respond to the target query command and return target query information to the application end; the application end is used to determine whether the storage end supports the attribute information analysis function of the business data based on the target query information returned by the storage end, and when it is determined that the storage end supports the attribute information analysis function of the business data, it sends the business data to be stored to the storage end while sending the attribute information of the business data to the storage end; the storage end is used to determine whether the business data is the target data based on the business data to be stored and the attribute information of the business data, and when it is determined that the business data is not the target data, it caches the business data to a preset cache disk; when it is determined that the business data is the target data, it directly caches the business data to the preset storage disk.
[0078] The target data includes backup data.
[0079] The description of the features in the embodiments corresponding to the data storage system can refer to the relevant description of the embodiments corresponding to the data storage method, which will not be repeated here.
[0080] An embodiment of the present application provides a data storage device, which is applied to a storage end and is used to execute the data storage method provided in the above embodiment.
[0081] like Figure 7 , which is a schematic diagram of a data storage device provided in an embodiment of the present application. The data storage device 70 comprises: an acquisition module 701 , a first judgment module 702 , a first storage module 703 and a second storage module 704 .
[0082] Among them, the acquisition module is used to obtain the business data to be stored and the attribute information of the business data; the first judgment module is used to judge whether the business data is the target data based on the attribute information of the business data; the first storage module is used to cache the business data to the preset cache disk when it is determined that the business data is not the target data; the second storage module is used to cache the business data directly to the preset storage disk when it is determined that the business data is the target data.
[0083] The target data includes backup data.
[0084] The description of the features in the embodiments corresponding to the data storage device can refer to the relevant description of the embodiments corresponding to the data storage method, which will not be repeated here.
[0085] An embodiment of the present application provides a data storage device, which is applied to an application end and is used to execute the data storage method provided in the above embodiment.
[0086] like Figure 8FIG. 8 is a schematic diagram of another data storage device provided in an embodiment of the present application. The data storage device 80 includes: a sending module 801 , a second judgment module 802 and a third storage module 803 .
[0087] Among them, the sending module is used to send a target query command to the storage end to obtain the target query information returned by the storage end in response to the target query command; the second judgment module is used to judge whether the storage end supports the attribute information analysis function of the business data based on the target query information returned by the storage end; the third storage module is used to send the attribute information of the business data to the storage end while sending the business data to be stored to the storage end when it is determined that the storage end supports the attribute information analysis function of the business data, so that the storage end obtains the business data to be stored and the attribute information of the business data, and judges whether the business data is the target data based on the attribute information of the business data.
[0088] Among them, when the storage end determines that the business data is not the target data, the business data is cached to the preset cache disk; when the business data is determined to be the target data, the business data is directly cached to the preset storage disk; the target data includes backup data.
[0089] The description of the features in the embodiments corresponding to the data storage device can refer to the relevant description of the embodiments corresponding to the data storage method, which will not be repeated here.
[0090] The present application also provides a computing device for executing the data storage method provided in the above embodiment.
[0091] like Fig. 9 , which is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device includes: any one of the above-mentioned data storage systems.
[0092] For the description of the features in the embodiments corresponding to the computing device, reference can be made to the relevant description of the embodiments corresponding to the data storage method, which will not be repeated here.
[0093] The embodiment of the present application also provides an electronic device, such as Fig.10 The electronic device 100 includes a memory 1001 and a processor 1002. The memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above data storage method embodiments.
[0094] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above data storage method embodiments when running.
[0095] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0096] An embodiment of the present application further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the steps of any of the above data storage method embodiments are implemented.
[0097] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned data storage method embodiments are implemented.
[0098] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0099] The above is a detailed introduction to a data storage method, system, computing device and electronic device provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.
Claims
1. A data storage method, applied to a storage end, characterized in that: The method comprises: Acquire the business data to be stored and the attribute information of the business data; Determining whether the business data is target data according to the attribute information of the business data; If it is determined that the service data is not the target data, caching the service data to a preset cache disk; When it is determined that the service data is target data, directly caching the service data to a preset storage disk; Wherein, the target data includes backup data.
2. The method according to claim 1, characterized in that The method further comprises: In a case where it is determined that the business data is not the target data, determining the life cycle of the business data according to the attribute information of the business data; According to the life cycle of the business data, it is determined whether the business data is cold data or hot data.
3. The method according to claim 2, characterized in that The determining the life cycle of the business data according to the attribute information of the business data includes: Determining the data type and access record information of the business data according to the attribute information of the business data; The life cycle of the business data is determined according to the data type and access record information of the business data.
4. The method according to claim 3, characterized in that The determining the life cycle of the business data according to the data type and access record information of the business data includes: Determining an access frequency index of the business data according to the access record information of the business data; The life cycle of the business data is determined according to the data type and access frequency of the business data.
5. The method according to claim 4, characterized in that Determining the access frequency index of the business data according to the access record information of the business data includes: Determining an access time interval of the business data according to the initiation time of the target access behavior; Determining a request time interval for the service data according to an access timestamp of the service data; Determining an access frequency index of the business data according to an access time interval and a request time interval of the business data; The target access behavior includes the access behavior to the business data, and the access record information includes the initiation time of the target access behavior and the access timestamp of the business data.
6. The method according to claim 5, characterized in that Determining the life cycle of the business data according to the data type and access frequency of the business data includes: The life cycle of the business data is determined based on the following formula: in, Indicates the life cycle of the business data, represents the preset weight, Indicates the data type of the business data, represents the access frequency index of the business data, represents the access time interval of the service data, Indicates the request time interval for the service data.
7. The method according to claim 1, characterized in that The method further comprises: When it is determined that the service data is cold data, writing the service data into a cold data queue in the preset cache disk; When the preset cache disk meets the preset data flushing condition, the data to be flushed is screened in the cold data queue; The data to be flushed is flushed to the preset storage disk to release the cache space of the preset cache disk.
8. The method according to claim 1, characterized in that The determining, based on the attribute information of the business data, whether the business data is target data includes: Determining the data type of the business data according to the attribute information of the business data; According to the data type of the business data, it is determined whether the business data is target data.
9. A data storage method, applied to an application end, characterized in that: The method comprises: Sending a target query command to the storage end to obtain target query information returned by the storage end in response to the target query command; According to the target query information returned by the storage end, determining whether the storage end supports the attribute information analysis function of the business data; When it is determined that the storage end supports the attribute information analysis function of the business data, the business data to be stored is sent to the storage end, and the attribute information of the business data is sent to the storage end, so that the storage end obtains the business data to be stored and the attribute information of the business data, and determines whether the business data is target data according to the attribute information of the business data; Wherein, when the storage end determines that the business data is not the target data, the business data is cached to a preset cache disk; when the storage end determines that the business data is the target data, the business data is directly cached to a preset storage disk; the target data includes backup data.
10. The method according to claim 9, characterized in that The method further comprises: When it is determined that the storage end does not support the attribute information analysis function of the business data, the business data is sent to the storage end so that the storage end caches the business data to the preset cache disk.
11. A data storage system, characterized in that: include: Application side and storage side; The application end is used to send a target query command to the storage end; The storage end is used to return the target query information to the application end in response to the target query command; The application end is used to determine whether the storage end supports the attribute information analysis function of the business data according to the target query information returned by the storage end, and when it is determined that the storage end supports the attribute information analysis function of the business data, send the business data to be stored to the storage end and send the attribute information of the business data to the storage end at the same time; The storage end is used to determine whether the business data is target data based on the business data to be stored and the attribute information of the business data, and cache the business data to a preset cache disk if it is determined that the business data is not target data; if it is determined that the business data is target data, directly cache the business data to a preset storage disk; Wherein, the target data includes backup data.
12. A computing device, characterized in that: include: The data storage system of claim 11.
13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data storage method according to any one of claims 1 to 8 or the steps of the data storage method according to any one of claims 9 to 10 when executing the computer program.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data storage method according to any one of claims 1 to 8 or the steps of the data storage method according to any one of claims 9 to 10.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the data storage method according to any one of claims 1 to 8 or the steps of the data storage method according to any one of claims 9 to 10 are implemented.
Citation Information
Patent Citations
Storage device write-in method and storage device
CN103714010A
Data writing method and device, storage server and computer readable storage medium
CN111104066A
Data read-write method and device based on solid state disk cache, and storage medium
CN111538461A
Solid state disk data erasing method and system, medium and program product
CN118981278A
Data management method and device, medium and program product
CN119556864A