Disk space allocation method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202211247801.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-12
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2042-10-12
AI Technical Summary
[0004]本申请提供一种磁盘空间分配方法、装置、电子设备及存储介质,用以解决消息存储系统的磁盘空间释放不够及时,磁盘空间的使用效率不高的技术问题
[0017] The technical solution provided in this application allows for disk quota adjustment of a target topic in a message storage system when the target topic has not met the conditions for self-adjusting disk quotas. This adjustment utilizes disk configuration reference information provided by a quota management device. Specifically, by obtaining the current disk quota allocated to the target topic by the message storage system, the real-time current disk quota can be obtained. Using the disk configuration reference information and the current disk quota, the target disk quota for the target topic can be determined, adjusting the target topic's disk space from the current quota to the target quota. This achieves real-time and accurate pre-adjustment of the target topic's disk quota. By controlling the adjustment of the target topic's disk quota, advance adjustment of the disk quota can be achieved, improving the efficiency of disk space management for the target topic.
Smart Images

Figure CN116126220B_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer technology, and more particularly to a disk space allocation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Kafka is a distributed, partitioned, multi-replica message storage system that can persistently store large volumes of messages in real time to meet various needs. Typically, to differentiate between different messages, topics are used to store similar messages. Generally, the disk space of a topic is known. The storage time or storage space of messages stored in the same topic can be monitored. Messages can be cleaned up when their storage time reaches a time threshold or when the storage space of the entire topic reaches a disk storage threshold. Cleaning up messages in a topic frees up disk space in the message storage system.
[0003] However, the time threshold monitoring method used above is a post-event message cleanup method, that is, message processing only begins after the threshold is reached. In other words, the current cleanup method has certain limitations on cleanup time and does not release disk space of the message storage system in a timely manner, resulting in low disk space utilization efficiency. Summary of the Invention
[0004] This application provides a disk space allocation method, apparatus, electronic device, and storage medium to solve the technical problems of insufficient disk space release and low disk space utilization efficiency in message storage systems.
[0005] Firstly, this application provides a disk space allocation method, including:
[0006] If the target topic of the message storage system does not meet the self-adjusting disk quota conditions, in response to a quota management request for the target topic, the disk configuration reference information of the target topic is read from the quota management device; at least one message is stored under the target topic;
[0007] Get the current disk quota allocated by the message storage system to the target topic in real time;
[0008] Based on the disk configuration reference information and the current disk quota, determine the target disk quota for the target topic, and adjust the disk space for the target topic from the current disk quota to the target disk quota.
[0009] Secondly, this application provides a disk space allocation device, comprising:
[0010] The reading unit is used to read disk configuration reference information of the target topic from the quota management device in response to a quota management request for the target topic when the target topic of the message storage system has not met the self-adjusting disk quota conditions; at least one message is stored under the target topic;
[0011] The determination unit is used to obtain the current disk quota allocated by the message storage system to the target topic in real time;
[0012] The adjustment unit is used to determine the target disk quota for the target topic based on the disk configuration reference information and the current disk quota, and to adjust the disk space of the target topic from the current disk quota to the target disk quota.
[0013] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0014] The memory stores the instructions that the computer executes;
[0015] The processor executes computer execution instructions stored in memory to implement the disk space allocation method as described in the first aspect.
[0016] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the disk space allocation method as described in the first aspect.
[0017] The technical solution provided in this application allows for disk quota adjustment of a target topic in a message storage system when the target topic has not met the conditions for self-adjusting disk quotas. This adjustment utilizes disk configuration reference information provided by a quota management device. Specifically, by obtaining the current disk quota allocated to the target topic by the message storage system, the real-time current disk quota can be obtained. Using the disk configuration reference information and the current disk quota, the target disk quota for the target topic can be determined, adjusting the target topic's disk space from the current quota to the target quota. This achieves real-time and accurate pre-adjustment of the target topic's disk quota. By controlling the adjustment of the target topic's disk quota, advance adjustment of the disk quota can be achieved, improving the efficiency of disk space management for the target topic. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0019] Figure 1 A schematic diagram of a disk space allocation system provided in an embodiment of this application;
[0020] Figure 2 A flowchart illustrating one embodiment of a disk space allocation method provided in this application;
[0021] Figure 3 A flowchart illustrating yet another embodiment of a disk space allocation method provided in this application;
[0022] Figure 4 A flowchart illustrating yet another embodiment of a disk space allocation method provided in this application;
[0023] Figure 5 A schematic diagram of one embodiment of a disk space allocation device provided in this application;
[0024] Figure 6 This is a hardware structure block diagram of an electronic device provided in an embodiment of this application.
[0025] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0027] To address the lag and inefficiency of existing disk quota management technologies, this disclosure employs a method of setting up a quota management device for a message storage system. This device manages the disk space of topics within the message storage system. When a target topic in the message storage system has not met the conditions for self-adjusting disk quotas, the disk quota for the target topic can be adjusted using the disk configuration reference information provided by the quota management device. Specifically, by obtaining the current disk quota allocated to the target topic by the message storage system, the real-time current disk quota can be obtained. Using the disk configuration reference information and the current disk quota, the target disk quota for the target topic can be determined, allowing the disk space of the target topic to be adjusted from the current disk quota to the target disk quota. This achieves timely and accurate pre-adjustment of the target topic's disk quota. By controlling the adjustment of the target topic's disk quota, the adjustment of the disk quota can be avoided only when the message storage system meets the conditions for self-adjusting disk quotas for the target topic, enabling advance adjustment of the disk quota and improving the efficiency of disk space management for the target topic.
[0028] The technical solution disclosed herein can be applied to information storage scenarios in Kafka message storage systems. By establishing a quota management device for the message storage system, it enables the management of disk quotas for each topic within the system. Even when the target topic in the message storage system has not yet implemented self-adjusting disk quotas, it proactively and in real-time manages the quotas for that topic, improving the efficiency of disk quota management. Specifically, the self-adjusting disk quota condition refers to the message storage system detecting that the storage usage of the current target topic has reached a certain threshold.
[0029] The technical solution disclosed herein can be executed by an electronic device, which can be any device deployed in the message storage system. The electronic device can be a terminal or a server. The terminal can include mobile phones, laptops, desktop computers, smart interactive devices, vehicle terminals, etc.; the server can include an independent physical server, a server cluster consisting of multiple servers, or a cloud server capable of cloud computing.
[0030] The technical solution of this disclosure will now be described in detail with reference to the accompanying drawings.
[0031] like Figure 1 The diagram shown is a schematic of a disk space allocation system provided in an embodiment of this disclosure. The system may include a message storage system 1 and a quota management device 2.
[0032] refer to Figure 1Message storage system 1 can be a Kafka system, capable of storing messages for multiple topics. Quota management device 2 can store disk configuration reference information for each topic, which can be sent to message storage system 1 for use. Disk configuration reference information 2 can be continuously updated, taking effect according to the newly configured disk configuration reference information.
[0033] After obtaining disk configuration reference information from quota management device 2, message storage system 1 can further obtain the current disk quota of the target topic, and then obtain the target disk quota of target topic 11 based on the disk configuration reference information and the current disk quota. The disk space of target topic 11 is then adjusted to the target disk quota.
[0034] like Figure 2 The diagram shown is a flowchart of one embodiment of a disk space allocation method provided in this disclosure. This disk space allocation method can be configured in a disk space allocation device, which can be located in an electronic device. The electronic device can be installed in a message storage system. The method can include the following steps:
[0035] Step 201: If the target topic of the message storage system has not met the self-adjusting disk quota conditions, in response to the quota management request for the target topic, read the disk configuration reference information of the target topic from the quota management device; store at least one message under the target topic.
[0036] A quota management request can refer to an information retrieval request sent by the message storage system to the quota management device. A quota management request may include a target topic. It should be noted that a target topic refers to any topic in the message storage system used to store messages, and that the target topic stores at least one message.
[0037] This quota management device can be deployed in a message storage system as a plugin specifically designed to manage disk configuration reference information for topics. This embodiment uses a separate quota management device to manage the disk quota for each topic, enabling real-time and appropriate pre-configuration of disk quotas for each topic before the message storage system automatically adjusts its disk quotas.
[0038] The disk configuration reference information for the target topic can be information on the disk quota settings for the target topic, specifically including information such as the disk pre-allocation amount (i.e., the total disk quota) and the disk allocation mode.
[0039] Optionally, determining whether a target topic meets the self-adjusting disk quota conditions can include any one or more of the following methods: whether the target topic has reached the self-adjusting disk quota time, or whether the disk utilization rate of the storage space corresponding to the target topic has reached the utilization rate threshold, or whether the disk access speed of the storage space corresponding to the target topic is less than the access speed threshold. The storage space of the target topic can refer to the storage space allocated to the target topic according to the current disk quota, and the storage space can include, for example, RAM (Random Access Memory), ROM (Read-Only Memory), hard disk, etc.
[0040] Specifically, electronic devices can pre-set a self-adjusting disk quota period for each topic in the message storage system. When the self-adjusting disk quota period for any topic is reached, self-adjustment is initiated for that topic. Therefore, for a target topic, if the target topic reaches the self-adjusting disk quota time, that is, the self-adjusting disk quota period configured for the target topic is reached, then it is determined that the target topic has met the self-adjusting disk quota condition.
[0041] If the disk usage rate of the storage space corresponding to the target topic reaches the usage rate threshold, then the target topic is determined to meet the self-adjusting disk quota conditions; otherwise, the target topic is determined to meet the self-adjusting disk quota conditions. If the disk access speed of the storage space corresponding to the target topic is less than the access speed threshold, then the target topic is determined to meet the self-adjusting disk quota conditions; otherwise, the target topic is determined not to meet the self-adjusting disk quota conditions.
[0042] As one embodiment, reading disk configuration reference information of a target topic from a quota management device includes: determining a quota management tag for the target topic; the quota management tag is used to determine read permissions for the target topic; if the quota management tag is determined to be true, then reading the disk configuration reference information of the target topic from the quota management device.
[0043] Optionally, the quota management tag can be a switch for quota management of the target topic. If the quota management tag is true, quota management can be performed on the target topic; if the quota management tag is false, quota management cannot be performed on the target topic.
[0044] In this embodiment of the disclosure, by setting a quota management tag for the target topic, it is possible to identify whether quota management information is set on the quota management device, thereby achieving efficient information management of the target topic and improving information processing efficiency.
[0045] As another embodiment, it further includes: if the quota management tag is determined to be false, then the disk quota amount of the target topic is determined to remain unchanged. In this embodiment of the disclosure, if the quota management tag of the target topic is false, it can be determined that the disk quota amount of the target topic remains unchanged, and the target topic does not have disk configuration reference information in the quota management device, thereby realizing the classification and management of different types of target topics and improving management efficiency.
[0046] Step 202: Obtain the current disk quota allocated by the message storage system for the target topic.
[0047] In one embodiment, the current disk quota can be the storage space available for the target topic to store data. The current disk quota can be obtained from the target topic in real time, or it can be obtained from the disk configuration information. The current disk configuration information stored in the disk configuration information can be the information determined for the target topic when the disk space allocation method was last executed.
[0048] Step 203: Based on the disk configuration reference information and the current disk quota, determine the target disk quota for the target topic, and adjust the disk space for the target topic from the current disk quota to the target disk quota.
[0049] The target disk quota can be used to adjust the disk space allocation for a target topic. For details on how to determine the target disk quota for a target topic based on disk configuration reference information and the current disk quota, please refer to the following description, which will not be repeated here.
[0050] In this embodiment of the disclosure, in response to a quota management request for a target topic in the message storage system, disk configuration reference information for the target topic can be read from a quota management device. The target topic is a data storage topic in the message storage system. The disk configuration reference information for the target topic can be used to obtain its target disk quota, so as to adjust the disk space of the target topic to the target disk quota. The quota management device can be used to manage the disk quota of target topics in the message storage system, improving the efficiency of target disk quota management.
[0051] like Figure 3 The diagram shown is a flowchart of another embodiment of a disk space allocation method provided by this disclosure. The difference from the previous embodiments is that this embodiment focuses on determining the target disk quota for a target topic based on disk configuration reference information and the current disk quota. Optionally, the disk configuration reference information includes the total disk quota corresponding to the target topic and the message growth pattern corresponding to the target topic.
[0052] In one embodiment, determining the target disk quota for a target topic based on disk configuration reference information and the current disk quota may include: performing disk quota processing based on the message growth pattern of the target topic and the total disk quota and the current disk quota to obtain the target disk quota. Specifically, determining the target disk quota for a target topic based on disk configuration reference information and the current disk quota includes the following steps:
[0053] Step 301: If the growth mode of the target topic is self-growth mode, then perform disk quota processing based on the total disk quota and the current disk quota to determine the target disk quota for the target topic.
[0054] Message growth modes can include auto-growth mode and exclusive mode, as well as other growth modes besides these two. Auto-growth mode means that the actual disk space occupied by a topic can grow in real time according to usage demand, but different topics can reuse disk space; for example, disk space A can be occupied by both topic B and topic C. Exclusive mode means that a topic's disk space is exclusive and cannot be reused by other topics. For example, disk space E occupied by topic D can only be used by D and cannot be used by other topics.
[0055] The total disk quota can be the pre-allocated amount of disk quota for the target topic. The current disk quota for the target topic can be the amount of disk space allocated to the target topic by the message storage system, which is the real-time effective disk quota for the target topic.
[0056] Optionally, a disk quota parameter for the target topic can be set, and the current disk quota for the target topic can be obtained by reading the value of the disk quota parameter.
[0057] As one example, disk quota processing is performed based on the total disk quota and the current disk quota to determine the target disk quota for the target topic, including:
[0058] Detect the disk usage of the target topic; determine the disk usage rate of the target topic based on the disk usage and the current disk quota; determine the target disk quota based on the current disk quota, disk usage rate, and total disk quota. The disk usage rate can be the quotient of disk usage and disk quota.
[0059] In one possible design, detecting the disk usage of a target topic includes: obtaining at least one message stored under the target topic and the message storage time corresponding to each message; determining the target message that meets the cleanup conditions from the at least one message based on the message storage time corresponding to each message; deleting the target message, obtaining the message storage space occupied by the at least one message after the target message is cleared, and determining the message storage space occupied as the disk usage.
[0060] Optionally, message storage time can refer to the time period between the start time of message storage in the target topic and the query time of the stored message under the target topic.
[0061] Based on the message storage time corresponding to at least one message, determine the target messages that meet the cleanup conditions from at least one message, including: determining the target messages whose message storage time reaches a time storage threshold based on the message storage time corresponding to at least one message. The time storage threshold can refer to the maximum storage time of a message, such as 7 days. If the storage time of a message reaches the time storage threshold, the message can be destroyed or deleted.
[0062] In this embodiment of the disclosure, when detecting the disk usage of a target topic, at least one message stored under the target topic and the message storage time corresponding to each message can be obtained. Using the message storage time of each message, target messages that meet the cleanup conditions are retrieved, and these target messages are deleted to obtain the message storage space occupancy of the target topic. This message storage space occupancy is then used as the disk usage. Timely cleanup of messages under the target topic using message storage time enables timely acquisition of the target topic's disk usage, improving the efficiency and accuracy of disk usage acquisition.
[0063] In one embodiment, reference Figure 4 Determining the target disk quota based on the current disk quota, disk utilization, and total disk quota may include the following steps:
[0064] 401: If the disk usage rate is greater than the first threshold, then the disk quota amount will be determined to use the quota increase strategy.
[0065] 402: Increase the current disk quota and use the increased disk quota as the target disk quota. The increased disk quota is greater than the current disk quota but less than the total disk quota.
[0066] 403: If disk usage is less than the second threshold, then the disk quota amount will be reduced using the quota reduction strategy.
[0067] 404: According to the quota reduction policy, the current disk quota is reduced and the reduced disk quota is used as the target disk quota. The reduced disk quota is less than the current disk quota. The first threshold is greater than the second threshold.
[0068] 405: If the disk usage rate is less than the first threshold but greater than the second threshold, then the current disk quota is determined as the target disk quota.
[0069] The first threshold can be the limit for increasing disk quota. That is, when the disk utilization reaches the first threshold, the disk quota needs to be increased.
[0070] The second threshold can be the limit for reducing disk quota. That is, when disk usage reaches the second threshold, the disk quota needs to be reduced.
[0071] When disk usage is between the first and second thresholds, the disk quota can remain unchanged.
[0072] In this embodiment, by comparing the disk usage rate with the first threshold and the second threshold, a targeted disk quota allocation strategy can be implemented for disk usage rates that meet different thresholds. By determining different disk quota strategies, the target disk quota can be accurately set, resulting in a more precise target disk quota.
[0073] After step 301, the method further includes: step 302: if the growth mode is determined to be exclusive mode, then the current disk quota is determined to be the target disk quota.
[0074] Optionally, the disk usage of the target topic in exclusive mode can be monitored in real time. If the change in disk usage exceeds a threshold, the disk quota for the target topic in exclusive mode can be increased to obtain a new disk quota. If the change in disk usage is less than the threshold, the disk quota for the target topic in exclusive mode can be decreased to obtain a new disk quota. The change in disk usage can refer to the change in disk usage within a unit of time. The threshold can refer to a threshold set for the change within a unit of time. The unit of time can be the time unit used for calculating the change, such as 1 second or 1 millisecond. Monitoring the change in disk usage allows for timely detection of large-scale data changes in the message storage system, enabling timely expansion or contraction of the current disk quota for the target topic in exclusive mode, thus improving the efficiency of disk space control.
[0075] If the growth mode is determined to be exclusive, a fixed target disk quota can be set to manage the target topic under exclusive mode. By managing topics through different topic modes such as self-growth mode and exclusive mode, accurate and efficient management of target topics can be achieved.
[0076] In this embodiment of the disclosure, the total disk quota and the current disk quota can be adjusted according to the growth pattern of the target topic, so as to determine the current disk quota through self-growth mode and exclusive mode, thereby realizing accurate updating of the current disk quota according to different growth patterns and improving the management efficiency and accuracy of disk quota.
[0077] In this embodiment of the disclosure, the growth pattern of the target topic can be determined from the disk configuration reference information. If the growth pattern is auto-growth, the disk usage of the target topic can be detected, and the disk utilization rate of the target topic can be determined based on the disk usage and disk quota. That is, when the growth pattern is auto-growth, the disk quota of the target topic can be adjusted using the disk quota, disk utilization rate, and total disk quota, thereby achieving automatic adjustment of the disk quota of the target topic and improving the efficiency and accuracy of quota adjustment.
[0078] In one possible design, after determining the growth pattern of the target topic from the disk configuration reference information, the process further includes: if the growth pattern is determined to be an exclusive mode, then the current disk quota is determined as the target disk quota.
[0079] In some embodiments, after determining the target disk quota, the method may further include: updating the target disk quota to the total disk quota for the target topic. Optionally, after updating the target disk quota to the total disk quota, the updated total disk quota may be sent to the quota management device, instructing the quota management device to update the total disk quota in the disk configuration reference information for the target topic stored therein.
[0080] Optionally, the updated target disk quota has higher priority than the disk configuration reference information in the quota management system, and the target disk quota can be used to update the disk configuration reference information in the quota management system.
[0081] In this embodiment of the disclosure, after determining the target disk quota, the target disk quota can be updated to the total disk quota. By setting the total disk quota, the timely updating of the target disk quota can be improved, thereby increasing the management efficiency of the target topic's disk quota.
[0082] like Figure 5 The diagram shown is a structural schematic of one embodiment of a disk space allocation device provided in this disclosure. This disk space allocation device can be configured with... Figures 2-3 The disk space allocation method shown can be located in an electronic device, which may include a message storage system. The disk space allocation device may include:
[0083] Reading unit 501: When the target topic of the message storage system has not met the self-adjusting disk quota conditions, in response to a quota management request for the target topic, reads disk configuration reference information of the target topic from the quota management device; at least one message is stored under the target topic.
[0084] Determining Unit 502: Used to obtain the current disk quota allocated by the message storage system to the target topic in real time.
[0085] The adjustment unit 503 is used to determine the target disk quota for the target topic based on the disk configuration reference information and the current disk quota, and adjust the disk space of the target topic from the current disk quota to the target disk quota.
[0086] As one embodiment, the disk configuration reference information includes the total disk quota corresponding to the target topic and the message growth pattern corresponding to the target topic; when determining the target disk quota for the target topic based on the disk configuration reference information and the current disk quota, the determining unit 502 performs the following operations:
[0087] If the target topic's growth pattern is self-growth, then disk quota processing is performed based on the total disk quota and the current disk quota to determine the target disk quota for the target topic.
[0088] If the growth mode is determined to be exclusive mode, then the current disk quota is determined to be the target disk quota.
[0089] In some embodiments, when determining the target disk quota for a target topic by performing disk quota processing based on the total disk quota and the current disk quota, the determining unit 502 performs the following operations:
[0090] Detect the current disk usage of the target topic;
[0091] Determine the disk usage rate of the target topic based on disk usage and disk quota.
[0092] Determine the target disk quota based on the current disk quota, disk utilization, and total disk quota.
[0093] As another embodiment, when determining the current disk usage of the target topic, the determining unit 502 performs the following operations:
[0094] Retrieve at least one message stored under the target topic and the message storage time corresponding to each message;
[0095] Based on the message storage time corresponding to each message, determine the target message that meets the cleanup conditions from at least one message;
[0096] Delete the target message, obtain the message storage space usage of at least one message after the target message is deleted, and determine the message storage space usage as disk usage.
[0097] As another embodiment, when determining the target disk quota based on the current disk quota, disk utilization, and total disk quota, the determining unit 502 performs the following operations:
[0098] If the disk usage rate is greater than the first threshold, then the disk quota will be increased using the quota increase strategy.
[0099] According to the quota increase strategy, the current disk quota is increased, and the increased disk quota is used as the target disk quota. The increased disk quota is greater than the current disk quota but less than the total disk quota.
[0100] If the disk usage is less than the second threshold, then the disk quota will be reduced using the quota reduction strategy.
[0101] According to the quota reduction strategy, the current disk quota is reduced, and the resulting disk quota is used as the target disk quota. The resulting disk quota is less than the current disk quota, and the first threshold is greater than the second threshold.
[0102] If the disk usage rate is less than the first threshold but greater than the second threshold, then the current disk quota is determined as the target disk quota.
[0103] In one possible design, the disk space allocation device also includes:
[0104] The update unit is used to update the target disk quota to the total disk quota for the target topic.
[0105] As another embodiment, the reading unit 501 reads the disk configuration reference information of the target topic from the quota management device, and specifically performs the following operations:
[0106] Determine the quota management tag for the target topic; the quota management tag is used to determine read permissions for the target topic;
[0107] If the quota management tag is determined to be true, then the disk configuration reference information for the target topic is read from the quota management device.
[0108] In another possible design, the disk space allocation device also includes:
[0109] The hold unit is used to determine that the disk quota for the target topic remains unchanged if the quota management label is determined to be false.
[0110] As one embodiment, the disk space allocation device further includes:
[0111] The adjustment unit is used to send quota adjustment instructions to the quota management device. The quota adjustment instructions instruct the current disk quota in the disk configuration reference information to be updated to the target disk quota.
[0112] The apparatus provided in this disclosure can execute the methods of the above embodiments. The specific steps performed by each unit can be referred to the description of the relevant methods, and will not be repeated here.
[0113] Figure 6 This is a hardware structure block diagram of an electronic device according to an exemplary embodiment. The device may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0114] The device 600 may include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.
[0115] Processing component 602 typically controls the overall operation of device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
[0116] Memory 604 is configured to store various types of data to support the operation of device 600. Examples of such data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0117] Power supply component 606 provides power to the various components of device 600. Power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 600.
[0118] Multimedia component 608 includes a screen that provides an output interface between device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When device 600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0119] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.
[0120] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0121] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of device 600. For example, sensor assembly 614 may detect the on / off state of device 600, the relative positioning of components such as the display and keypad of device 600, changes in the position of device 600 or a component of device 600, the presence or absence of user contact with device 600, the orientation or acceleration / deceleration of device 600, and temperature changes of device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0122] Communication component 616 is configured to facilitate wired or wireless communication between device 600 and other devices. Device 600 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0123] In an exemplary embodiment, the apparatus 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0124] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 620 of the device 600 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0125] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the task verification method of any of the above embodiments.
[0126] This application also provides a computer program product, including a computer program, which, when executed by a processor, describes the task verification method described above.
[0127] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0128] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A disk space allocation method, characterized in that, include: If the target topic of the message storage system does not meet the self-adjusting disk quota conditions, in response to the quota management request of the message storage system for the target topic, the disk configuration reference information of the target topic is read from the quota management device. At least one message is stored under the target topic, and the disk configuration reference information includes the total disk quota corresponding to the target topic and the message growth pattern corresponding to the target topic. Obtain the current disk quota allocated by the message storage system for the target topic; Based on the disk configuration reference information and the current disk quota, the target disk quota for the target topic is determined, and the disk space for the target topic is adjusted from the current disk quota to the target disk quota.
2. The method according to claim 1, characterized in that, Determining the target disk quota for the target topic based on the disk configuration reference information and the current disk quota includes: If the growth mode of the target topic is self-growth mode, then disk quota processing is performed based on the total disk quota and the current disk quota to determine the target disk quota for the target topic; If the growth mode is determined to be exclusive mode, then the current disk quota is determined to be the target disk quota.
3. The method according to claim 2, characterized in that, The step of determining the target disk quota for the target topic by performing disk quota processing based on the total disk quota and the current disk quota includes: Detect the disk usage of the target topic; The disk usage rate of the target topic is determined based on the disk usage and the current disk quota. The target disk quota is determined based on the current disk quota, the disk utilization rate, and the total disk quota.
4. The method according to claim 3, characterized in that, The detection of disk usage for the target topic includes: Obtain at least one message stored under the target topic and the message storage time corresponding to each message; Based on the message storage time corresponding to each message, determine the target message that meets the cleanup conditions from the at least one message; Delete the target message, obtain the message storage space usage corresponding to at least one message after the target message is cleared, and determine the message storage space usage as the disk usage.
5. The method according to claim 3, characterized in that, The step of determining the target disk quota based on the current disk quota, the disk utilization rate, and the total disk quota includes: If the disk usage rate is greater than the first threshold, a quota increase strategy is determined. According to the quota increase strategy, the current disk quota is increased, and the disk quota obtained by the increase is used as the target disk quota. The disk quota obtained by the increase is greater than the current disk quota and less than the total disk quota. If the disk usage rate is less than the second threshold, a quota reduction strategy is determined. According to the quota reduction strategy, the current disk quota is reduced, and the resulting disk quota is used as the target disk quota, wherein the resulting disk quota is less than the current disk quota; and the first threshold is greater than the second threshold. If the disk usage rate is less than the first threshold and greater than the second threshold, then the current disk quota is determined to be the target disk quota.
6. The method according to claim 2, characterized in that, After determining the target disk quota, the process further includes: Update the target disk quota to the total disk quota corresponding to the target topic.
7. The method according to claim 1, characterized in that, The method further includes: Determine the quota management tag for the target topic; the quota management tag is used to determine read permissions for the target topic. If the quota management tag is determined to be true, then the disk configuration reference information of the target topic is read from the quota management device; If the quota management label is determined to be false, then the disk quota for the target topic is determined to remain unchanged.
8. A disk space allocation device, characterized in that, include: The reading unit is used to read disk configuration reference information of the target topic from the quota management device in response to the quota management request of the message storage system for the target topic when the target topic of the message storage system has not reached the self-adjusting disk quota conditions; At least one message is stored under the target topic, and the disk configuration reference information includes the total disk quota corresponding to the target topic and the message growth pattern corresponding to the target topic. The determining unit is used to obtain the current disk quota allocated by the message storage system to the target topic in real time; The adjustment unit is used to determine the target disk quota for the target topic based on the disk configuration reference information and the current disk quota, and adjust the disk space of the target topic from the current disk quota to the target disk quota.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the disk space allocation method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the disk space allocation method as described in any one of claims 1-7.
Citation Information
Patent Citations
Resource container management method and device
CN112667389A
Method, a device, and a computer program product for adjusting a storage space
US20210117376A1