Data storage method and device, storage medium, program and electronic equipment
By configuring the RAID level and hard disk group according to the data importance and performance requirements level of the message packet, and selecting the storage method according to the security level indicators, the problem of unreasonable configuration of hard disk resources in traditional storage methods is solved, and the utilization rate and efficiency of hard disk resources are improved.
Patent Information
- Application Number
- CN202411894773.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The traditional storage method uses the same set of hard disks to backup different message packets, resulting in unreasonable configuration of hard disk resources, resulting in poor utilization of hard disk resources, and it is difficult to achieve ideal performance in modern business scenarios with high concurrency and low latency.
According to the data importance of multiple message packets in the target service and the performance requirements level for the server, multiple RAID levels are determined, and a hard disk group that meets each RAID level is configured for the server. When receiving the target message packet, the security level indicator is determined based on its data importance, data access frequency and data recovery time target, and thus select the appropriate RAID level and hard disk group for storage.
It realizes the rational configuration of hard disk resources, improves the utilization rate and efficiency of hard disk resources, avoids waste and unbalanced use of hard disk space, and ensures full utilization of server hard disk space.
Smart Images

Figure CN119806419A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular, to a data storage method, a storage device, a computer-readable storage medium, a computer program product, and an electronic device. Background Art
[0002] Traditional storage methods use the same set of hard disks to back up different message packages. This extensive resource allocation method may cause key business data to face security risks due to insufficient resource allocation, while non-critical data may occupy too many storage resources, resulting in resource waste. Storage systems often find it difficult to achieve ideal performance in modern business scenarios such as high concurrency and low latency, affecting business continuity and user experience. Summary of the invention
[0003] The main purpose of the present application is to provide a data storage method, a storage device, a computer-readable storage medium, a computer program product and an electronic device, so as to at least solve the problem of unreasonable hard disk resource configuration in the prior art, resulting in poor hard disk resource utilization.
[0004] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a data storage method is provided, comprising: determining multiple RAID (Redundant Arrays of Independent Disks) levels according to the data importance of multiple message packets in the target business and the performance requirement level of each message packet for the server, and configuring a hard disk group that meets each RAID level for the server, the performance requirement level includes: the requirement level of the read and write rate and the requirement level of the delay rate, the server is used to execute the target business, and one hard disk group includes at least one hard disk; when the server receives the target message packet sent by the device end, according to the data importance, data access frequency and data recovery time target of the target message packet, a security level index is determined, the security level index is an index for evaluating the security level required for the message packet, and the target message packet is part of multiple message packets; according to the security level index, a target RAID level is determined from the multiple RAID levels, and the hard disk group corresponding to the target RAID level is determined as the target hard disk group, and the target hard disk group is used to store the target message packet, and the target RAID level is one of the multiple RAID levels.
[0005] Optionally, the data importance of the message packet includes a first degree, a second degree and a third degree, and the importance represented by the first degree, the second degree and the third degree decreases in sequence. After configuring a hard disk group that meets each of the RAID levels for the server, the method further includes: determining a backup strategy and a backup frequency of the RAID level corresponding to each of the message packets according to the data importance of the plurality of message packets, the backup strategy including: adopting a full backup when the data importance of the message packet is the first degree, adopting an incremental backup when the data importance of the message packet is the second degree, and adopting a differential backup when the data importance of the message packet is the third degree;
[0006] Optionally, a security level index is determined based on the data importance, data access frequency and data recovery time target of the target message packet, including: determining a first score as a score corresponding to an importance range of the data importance of the target message packet based on a first correspondence relationship, wherein the first correspondence relationship is a correspondence between the importance range and the score; determining a second score as a score corresponding to a frequency range of the data access frequency of the target message packet based on a second correspondence relationship, wherein the second correspondence relationship is a correspondence between the frequency range and the score; determining a third score as a score corresponding to a time range of the data recovery time target of the target message packet based on a third correspondence relationship, wherein the third correspondence relationship is a correspondence between the time range and the score; and determining the security level index as the sum of the first score, the second score and the third score.
[0007] Optionally, configuring a hard disk group satisfying each of the RAID levels for the server includes: configuring hard disks of a quantity and capacity corresponding to each of the RAID levels for the server according to the multiple RAID levels.
[0008] Optionally, after configuring a hard disk group that meets each of the RAID levels for the server, the method further includes: deploying a RAID controller on the server and configuring parameters of the RAID controller, the parameters of the RAID controller including at least one of the following: stripe size, verification method; mounting key data on the server to the RAID, the key data including at least one of the following: database, log file.
[0009] Optionally, before determining the security level indicator based on the data importance, data access frequency and data recovery time target of the target message packet, the method also includes: decoding the message packet to obtain JSON object data in a string format; parsing the JSON object data to obtain key value information in the JSON object; verifying the key value information, the data verification including: data integrity verification, data format verification, data content verification and data security verification, the data content verification including: verifying whether the ID of the key value information comes from a legitimate device, whether the key value information is within a preset range, and whether the update time of the key value information is within a preset time period.
[0010] According to another aspect of the present application, a data storage device for a smart home device is provided, comprising: a first determination unit, for determining a plurality of RAID levels according to the data importance of a plurality of message packets in a target service and the performance requirement level of each of the message packets for a server, and configuring a hard disk group that meets each of the RAID levels for the server, wherein the performance requirement level comprises: the requirement level of the read and write rate and the requirement level of the delay rate, the server is used to execute the target service, and one of the hard disk groups comprises at least one hard disk; a second determination unit, for determining a security level index according to the data importance, data access frequency and data recovery time target of the target message packet when the server receives a target message packet sent by a device end, the security level index being an index for evaluating the security level required for the message packet, and the target message packet being part of a plurality of the message packets; a storage unit, for determining a target RAID level from the plurality of RAID levels according to the security level index, and determining the hard disk group corresponding to the target RAID level as a target hard disk group, and using the target hard disk group to store the target message packet, wherein the target RAID level is one of the plurality of RAID levels.
[0011] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.
[0012] According to another aspect of the present application, a computer program product is provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, any one of the methods described above is implemented.
[0013] According to another aspect of the present application, an electronic device includes: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of the methods described.
[0014] By applying the technical solution of the present application, firstly, according to the data importance of multiple message packets in the target business and the performance requirements such as the read / write rate and delay rate of the server, multiple RAID levels are determined, then the corresponding hard disk group is configured for the server according to the determined multiple RAID levels, and when the target message packet sent by the device is received, the security level index of the target message packet is determined according to the data importance, data access frequency and data recovery time target of the target message packet, and finally, according to the security level index, the target RAID level is determined from multiple RAID levels, and the hard disk group corresponding to the target RAID level is determined as the target hard disk group, and the hard disk group is used to store the target message packet. The present application dynamically selects the RAID level according to the characteristics and requirements of the data, realizes the reasonable configuration of the hard disk resources, ensures the full utilization of the server hard disk space, avoids the waste and uneven use of the hard disk space, and improves the utilization rate and efficiency of the hard disk resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 A hardware structure block diagram of a mobile terminal for executing a data storage method provided in an embodiment of the present application is shown;
[0017] Figure 2 A schematic diagram of a data storage method according to an embodiment of the present application is shown;
[0018] Figure 3 A flow chart of a data storage method provided by an embodiment of the present application is shown;
[0019] Figure 4 A schematic diagram of a data storage device for a smart home device provided in an embodiment of the present application is shown.
[0020] The above drawings include the following reference numerals:
[0021] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the accompanying drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] As introduced in the background technology, the hard disk resource configuration in the prior art is unreasonable. To solve the above technical problems, the embodiments of the present application provide a data storage method, a storage device, a computer-readable storage medium, a computer program product and an electronic device.
[0026] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0027] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a data storage method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data storage method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the method described is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0029] In this embodiment, a data storage method running on a server, a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] Figure 2 is a flow chart of a data storage method according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0031] Step S201, determining multiple RAID levels according to the data importance of multiple message packets in the target business and the performance requirement level of each message packet on the server, and configuring a hard disk group that meets each RAID level for the server, the performance requirement level includes: the requirement level of the read and write rate and the requirement level of the delay rate, the server is used to execute the target business, and one hard disk group includes at least one hard disk;
[0032] Specifically, the RAID level corresponds to the hard disk group one by one, and multiple RAID levels constitute the RAID array of the target business. The target business refers to a specific business or application scenario that requires data storage. To configure the hard disk group, the appropriate hard disk type, capacity and quantity must be selected according to the requirements of the RAID level, and the hard disks must be physically connected and logically configured.
[0033] Specifically, the performance requirement levels include a first level, a second level and a third level, and the levels of the performance requirements represented by the first level, the second level and the third level decrease in sequence.
[0034] Step S202, when the server receives a target message packet sent by the device, determining a security level indicator according to the data importance, data access frequency and data recovery time target of the target message packet, wherein the security level indicator is an indicator for evaluating the security level required for the message packet, and the target message packet is a part of a plurality of the message packets;
[0035] Specifically, the target message packet refers to a specific data unit sent from the device to the server, and the security level index is calculated based on data importance, data access frequency, and data recovery time target to evaluate the security level required for the target message packet. Different security levels correspond to different RAID levels.
[0036] Step S203, according to the security level index, determine the target RAID level from the multiple RAID levels, and determine the hard disk group corresponding to the target RAID level as the target hard disk group, and use the target hard disk group to store the target message packet, the target RAID level is one of the multiple RAID levels.
[0037] Specifically, according to the security level index, a target RAID level is determined from a plurality of RAID levels, a hard disk group corresponding to the target RAID level is determined, and the corresponding hard disk group is used to store the target message packet.
[0038] Through the embodiment, firstly, according to the data importance of multiple message packets in the target business and the performance requirements such as the read and write rate and delay rate of the server, multiple RAID levels are determined, and then the corresponding hard disk group is configured for the server according to the determined multiple RAID levels. When the target message packet sent by the device is received, the security level index of the target message packet is determined according to the data importance, data access frequency and data recovery time target of the target message packet. Finally, according to the security level index, the target RAID level is determined from multiple RAID levels, and the hard disk group corresponding to the target RAID level is determined as the target hard disk group, and the hard disk group is used to store the target message packet. The present application dynamically selects the RAID level according to the characteristics and requirements of the data, realizes the reasonable configuration of the hard disk resources, ensures the full utilization of the server hard disk space, avoids the waste and uneven use of the hard disk space, and improves the utilization rate and efficiency of the hard disk resources.
[0039] In an optional solution, the data importance of the message packet includes a first degree, a second degree and a third degree, and the importance represented by the first degree, the second degree and the third degree decreases in sequence. After configuring a hard disk group that meets each of the RAID levels for the server, the method further includes:
[0040] Step S204: determining the backup strategy and backup frequency of the RAID level corresponding to each message packet according to the data importance of the plurality of message packets, wherein the backup strategy includes: adopting full backup when the data importance of the message packet is the first degree, adopting incremental backup when the data importance of the message packet is the second degree, and adopting differential backup when the data importance of the message packet is the third degree;
[0041] Specifically, multiple RAID levels are determined according to the data importance of multiple message packets in the target business and the performance requirement level of each message packet to the server, including: when the data importance of the message packet is the first level and the performance requirement level is the first level, determining that the multiple RAID levels include RAID10; when the data importance of the message packet is the first level and the performance requirement level is the second level, determining that the multiple RAID levels include RAID1; when the data importance of the message packet is the first level and the performance requirement level is the third level, determining that the multiple RAID levels include RAID6; when the data importance of the message packet is the second level and the performance requirement level is the first level, determining that the multiple RAID levels include RAID5; and when the data importance of the message packet is the second level and the performance requirement level is the first level, determining that the multiple RAID levels include RAID6. When the importance of the data of the message packet is the second level and the performance requirement level is the second level, it is determined that the multiple RAID levels include RAID5 or RAID6; when the importance of the data of the message packet is the second level and the performance requirement level is the third level, it is determined that the multiple RAID levels include RAID0; when the importance of the data of the message packet is the third level and the performance requirement level is the first level, it is determined that the multiple RAID levels include RAID0; when the importance of the data of the message packet is the third level and the performance requirement level is the second level, it is determined that the multiple RAID levels include RAID0 or RAID1; when the importance of the data of the message packet is the third level and the performance requirement level is the third level, it is determined that the multiple RAID levels include RAID0.
[0042] Specifically, for message packets with high data importance and high performance requirements, RAID10 can provide data redundancy and high performance; for message packets with high data importance and medium performance requirements, RAID1 can provide data redundancy at a lower cost; for message packets with high data importance and low performance requirements, RAID6 can provide data redundancy and high fault tolerance, but poor write performance; for message packets with medium data importance and high performance requirements, RAID5 can provide data redundancy and better performance; for message packets with medium data importance and medium performance requirements, RAID5 or RAID6 can be selected according to specific needs, among which RAID6 provides higher fault tolerance; for message packets with medium data importance and low performance requirements, RAID0 can improve performance but does not provide data redundancy, and is suitable for non-critical data; for message packets with low data importance and high performance requirements, RAID0 can improve performance, and is suitable for scenarios with extremely high performance requirements but low data security requirements; for message packets with low data importance and medium performance requirements, RAID 0 or RAID 6 can be selected according to specific needs 1, where RAID1 provides data redundancy but at a higher cost; for message packets with low data importance and low performance requirements, RAID0 can improve performance and reduce costs, and is suitable for non-core business data.
[0043] Specifically, full backup refers to a complete backup of data at regular intervals, incremental backup refers to backing up only the data that has changed since the last backup, and differential backup refers to backing up all data that has changed since the last full backup. The backup frequency and strategy can be adjusted according to the target business and data importance.
[0044] Step S205: setting backup parameters of multiple RAID levels according to the backup strategy and the backup frequency.
[0045] Specifically, the backup parameters that are set include: according to the backup strategy, the backup frequency and the backup window (ie, the time period for performing the backup operation).
[0046] Specifically, for data with lower importance, a lower backup frequency or incremental backup or differential backup is used. These backup methods only back up data that has changed since the last backup, reducing the redundancy of backup data, thereby reducing the occupation of system resources and improving overall performance; for data with higher importance, a higher backup frequency or full backup is used, which means that each backup will contain a complete data set, thereby ensuring that key data is backed up more frequently and comprehensively, improving data security. Using different backup frequencies and strategies for data of different importance can avoid unnecessary frequent backups and redundant storage, make reasonable use of the storage space of the hard disk, and further solve the problem of unreasonable hard disk resource allocation in the prior art.
[0047] In the described embodiment, different backup strategies are adopted according to the different data importance levels of message packets, so that differentiated backup of different RAID levels can be achieved, further ensuring that the determined backup strategy and backup frequency match the message packets of different data importance, thereby further realizing the rational application of hard disk resources.
[0048] In some other exemplary embodiments, the security level index is determined according to the data importance, data access frequency and data recovery time target of the target message packet, including:
[0049] According to the first corresponding relationship, determining the first score as the score corresponding to the importance degree range of the data importance of the target message packet, wherein the first corresponding relationship is the corresponding relationship between the importance degree range and the score;
[0050] According to the second corresponding relationship, determining the second score as the score corresponding to the frequency range where the data access frequency of the target message packet is located, wherein the second corresponding relationship is a corresponding relationship between the frequency range and the score;
[0051] According to the third corresponding relationship, determine that the third score is the score corresponding to the time range where the data recovery time target of the target message packet is located, and the third corresponding relationship is the corresponding relationship between the time range and the score;
[0052] The security level indicator is determined to be the sum of the first score, the second score and the third score.
[0053] Specifically, the first corresponding relationship, the second corresponding relationship, and the third corresponding relationship are pre-set corresponding relationships, and the importance degree range, the frequency range, and the time range are pre-set ranges.
[0054] In the described embodiment, by comprehensively considering and scoring the data importance, data access frequency and data recovery time target of the target message package, the data security level index can be evaluated more accurately, and different RAID levels can be selected for backup based on the determined security level index, thereby further achieving targeted storage of the target message package, further ensuring that the backup strategy of the target message package meets the security requirements of the target message package, and further ensuring the security and reliability of the target message package in the event of a system failure.
[0055] In addition, the present application also presets a correspondence relationship between the security level indicator and the RAID level (hereinafter referred to as the fourth correspondence relationship). After obtaining the security level indicator of the target message packet, the RAID level corresponding to the security level indicator is searched in the fourth correspondence relationship, and the RAID level is the target RAID level. The hard disk group corresponding to the target RAID level is the target hard disk group.
[0056] Exemplarily, for the settings of the first correspondence, the second correspondence, and the third correspondence, in this application, for data with high importance, that is, data that is critical to the business and whose loss or damage will cause significant losses, the threshold is set to 9-10 points; for data with medium importance, that is, data that has a certain impact on the business but is non-critical, the threshold is set to 5-8 points; for data with low importance, that is, data that has little impact on the business and whose loss or damage will not cause serious consequences, the threshold is set to 1-4 points; for data with high access frequency, that is, the number of visits per day is greater than or equal to 1,000 times, the threshold is set to 10 points. The threshold is set to 9-10 points; for medium access frequency, that is, the number of accesses per day is greater than 100 times and less than 1000 times, the threshold is set to 5-8 points; for low access frequency, that is, the number of accesses per day is less than 100 times, the threshold is set to 1-4 points; for low recovery time objectives, that is, the recovery time objectives are less than or equal to 1 hour, the threshold is set to 9-10 points; for medium recovery time objectives, that is, the recovery time objectives are greater than one hour and less than 12 hours, the threshold is set to 5-8 points; for low recovery time objectives, that is, the recovery time objectives are greater than or equal to 12 hours, the threshold is set to 1-4 points. According to the actual situation of the data, score each factor, including data importance, access frequency and recovery time objectives, and add the scores of each factor to get the total score, and select the RAID level according to the total score. Total score: 24-30 points: select RAID 10 or RAID 1 to ensure high data redundancy and high performance; total score: 15-23 points: select RAID 5 or RAID 6 to balance performance, redundancy and cost; total score: 6-14 points: select RAID 0 to reduce cost and improve performance, but it needs to be combined with a good backup strategy. By comprehensively considering and scoring the data importance, data access frequency and data recovery time goals of the target message package, the data security level index can be more accurately evaluated. By selecting different RAID levels for backup based on the determined security level index, the target message package can be stored in a targeted manner, further ensuring that the backup strategy of the target message package meets the security requirements of the target message package, and further ensuring the security and reliability of the target message package in the event of a system failure.
[0057] In another optional solution, configuring a hard disk group that meets each of the RAID levels for the server includes: configuring hard disks of a quantity and capacity corresponding to each of the RAID levels for the server according to the multiple RAID levels.
[0058] In the embodiment, by configuring hard disks with the number and capacity corresponding to each RAID level for the server, each RAID level is reasonably configured, thereby further optimizing the configuration of hard disk resources.
[0059] In another optional solution, after configuring the hard disk group that meets each of the RAID levels for the server, the method further includes: deploying a RAID controller on the server and configuring parameters of the RAID controller, the parameters of the RAID controller including at least one of the following: stripe size, verification mode;
[0060] Specifically, the average file size should be considered when configuring the stripe size. If large files such as videos and database files are mainly processed, a larger stripe size should be selected. If small files such as documents and pictures are processed, a smaller stripe size should be selected. Common verification methods include parity check, cyclic redundancy check, B+ check, etc.
[0061] The key data on the server is mounted on the RAID, wherein the key data includes at least one of the following: a database and a log file.
[0062] Specifically, mounting involves the following steps: confirming that the RAID has been correctly configured and is in an available state, creating a file system on the RAID, creating a mount point, mounting the RAID, verifying that the RAID has been successfully mounted, etc.
[0063] In the embodiment, by deploying a RAID controller on the server side and configuring stripe size parameters, the size of the blocks into which the data is divided is determined. A reasonable stripe size can optimize the use of storage space while ensuring the performance of the RAID controller. By configuring the verification method of the RAID controller, the RAID controller can detect and correct errors in the data, thereby ensuring the integrity and reliability of the data. The key data on the server is mounted on the RAID, thereby ensuring that the data is synchronized to the RAID in real time while being written to the main server.
[0064] In some further exemplary solutions of the present application, before determining the security level indicator according to the data importance, data access frequency and data recovery time target of the target message packet, the method further includes:
[0065] Decoding the message packet to obtain JSON object data in a string format;
[0066] Parsing the JSON object data to obtain key value information in the JSON object;
[0067] The key-value information is subjected to data verification, and the data verification includes: data integrity verification, data format verification, data content verification and data security verification. The data content verification includes: verifying whether the ID of the key-value information comes from a legitimate device, whether the key-value information is within a preset range, and whether the update time of the key-value information is within a preset time period.
[0068] Specifically, the message packet is subjected to data decoding and data parsing, and the processing result is subjected to data verification.
[0069] In the embodiment, the server ensures that the data can be correctly identified by decoding and parsing the data, which helps the server to accurately understand the data content sent by the device end and provide an accurate information basis for subsequent data processing; through data integrity verification, it checks whether the decoded and parsed data contains all the necessary fields, and compares the hash value of the JSON object with the expected hash value to ensure that the data has not been tampered with or lost during transmission; through data format verification, it helps to prevent data processing errors caused by format errors; through data content verification, it helps to prevent illegal devices from sending data or devices from sending abnormal data, thereby maintaining the security and stability of the system; through data security verification, it ensures that only legal devices can send messages, prevents data from being eavesdropped and tampered with during transmission, protects information from being leaked, and maintains data security. By decoding, parsing and verifying the data, the type and characteristics of the data can be more accurately identified, making the scoring of the message package more accurate, thereby making the security level index of the message package more accurate, and further optimizing the configuration of hard disk resources.
[0070] For example, taking the target message packet as the status update message of the smart bulb as an example, the specific process of data decoding, data parsing and data verification described in this application is described as follows: the server receives the status update message from the smart bulb through the MQTTBroker, the message format is JSON, including the ID, current brightness, color temperature and other information of the bulb; the server parses the payload part in the MQTT message and converts it from binary format to a JSON object in string format; extracts the bulb ID (bulb_id), current brightness (brightness) and color temperature (color_temp) and other fields from the JSON object. Convert the values of these fields to appropriate types, such as converting the brightness from a string to an integer; check whether the brightness value is within the valid range (for example, 0-255), check whether the color temperature value is within the valid range (for example, 1500K-9000K, but the specific range may vary depending on the bulb model), if an invalid value is found, replace it with a default value or record an error log; store the parsed and cleaned data in the database. The database table contains fields such as bulb ID, brightness, color temperature, and update time; use transaction processing to ensure data atomicity and consistency; check whether the payload part of the MQTT message contains all necessary fields (such as bulb_id, brightness, color_temp); calculate the hash value of the JSON object and compare it with the expected hash value to verify the integrity of the data; verify whether the format of the JSON object is correct, including whether the field name is correct and whether the data type matches; use JSON Schema format verification to ensure that the message conforms to the expected format specification; verify whether the bulb ID exists in the database to ensure that the message comes from a legitimate device; check whether the brightness and color temperature values are within a reasonable range to prevent the device from sending abnormal data; verify whether the update time of the message is reasonable to prevent timestamp forgery; use MQTT username and password for authentication to ensure that only legitimate devices can send messages; use TLS / SSL to encrypt MQTT connections to prevent data from being eavesdropped or tampered with during transmission; use encryption technology to protect data security when storing sensitive information (such as device keys) in the database; measure the average response time of the server to process MQTT messages to ensure that data processing is completed within a reasonable time frame; monitor the performance indicators of the database (such as query response time, write throughput, etc.) to ensure that the database can handle high concurrent requests; use stress testing tools to simulate scenarios where a large number of devices send messages at the same time to verify the performance and stability of the server.
[0071] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the data storage method of the present application will be described in detail below in conjunction with specific embodiments.
[0072] This embodiment relates to a specific data storage method, such as Figure 3 As shown, the following steps are included:
[0073] Step S1: Determine multiple RAID levels;
[0074] Step S2: configuring the hard disk groups corresponding to each RAID level;
[0075] Step S3: deploying a RAID controller on the server;
[0076] Step S4: receiving a target message packet;
[0077] Step S5: performing data processing and data verification on the target message packet;
[0078] Step S6: writing the processed and verified data into the hard disk group;
[0079] Step S7: Determine whether the server fails. If the server does not fail, execute step S4, step S5 and step S6 at least once in a loop. If the server fails, execute step S8.
[0080] Step S8: reading data from multiple hard disk groups;
[0081] Step S9: Perform data recovery.
[0082] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0083] The embodiment of the present application also provides a data storage device for a smart home device. It should be noted that the data storage device for the smart home device in the embodiment of the present application can be used to execute the data storage method provided in the embodiment of the present application. The device is used to implement the embodiments and preferred implementations, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0084] The following is an introduction to the data storage device of the smart home device provided in the embodiment of the present application.
[0085] Figure 4 Schematic diagram of a data storage device for a smart home device according to an embodiment of the present application. Figure 4 As shown, the device comprises:
[0086] The first determination unit 10 is used to determine multiple RAID levels according to the data importance of multiple message packets in the target business and the performance requirement level of each message packet on the server, and configure a hard disk group that meets each RAID level for the server, the performance requirement level includes: the requirement level of the read and write rate and the requirement level of the delay rate, the server is used to execute the target business, and one hard disk group includes at least one hard disk;
[0087] Specifically, the RAID level corresponds to the hard disk group one by one, and multiple RAID levels constitute the RAID array of the target business. The target business refers to a specific business or application scenario that requires data storage. To configure the hard disk group, the appropriate hard disk type, capacity and quantity must be selected according to the requirements of the RAID level, and the hard disks must be physically connected and logically configured.
[0088] A second determining unit 20 is used to determine a security level indicator according to the data importance, data access frequency and data recovery time target of the target message packet when the server receives the target message packet sent by the device end, wherein the security level indicator is an indicator for evaluating the security level required for the message packet, and the target message packet is a part of the plurality of message packets;
[0089] Specifically, the target message packet refers to a specific data unit sent from the device to the server, and the security level index is calculated based on data importance, data access frequency, and data recovery time target to evaluate the security level required for the target message packet. Different security levels correspond to different RAID levels.
[0090] The storage unit 30 is used to determine the target RAID level from the multiple RAID levels according to the security level index, and determine the hard disk group corresponding to the target RAID level as the target hard disk group, and use the target hard disk group to store the target message packet, and the target RAID level is one of the multiple RAID levels.
[0091] Specifically, according to the security level index, a target RAID level is determined from a plurality of RAID levels, a hard disk group corresponding to the target RAID level is determined, and the corresponding hard disk group is used to store the target message packet.
[0092] Through the embodiment, the first determination unit determines multiple RAID levels according to the data importance of multiple message packets in the target business and the performance requirements such as the read and write rate and delay rate of the server, and configures the corresponding hard disk group for the server according to the determined multiple RAID levels. When the target message packet sent by the device is received, the second determination unit determines the security level index of the target message packet according to the data importance, data access frequency and data recovery time target of the target message packet, and the storage unit determines the target RAID level from multiple RAID levels according to the security level index, and determines the hard disk group corresponding to the target RAID level as the target hard disk group. The present application dynamically selects the RAID level according to the characteristics and requirements of the data, realizes the reasonable configuration of the hard disk resources, ensures the full utilization of the server hard disk space, avoids the waste and uneven use of the hard disk space, and improves the utilization rate and efficiency of the hard disk resources.
[0093] In another optional solution, the device further includes:
[0094] A third determining unit is used to determine the backup strategy and backup frequency of the RAID level corresponding to each of the message packets according to the data importance of the plurality of message packets, wherein the backup strategy includes: adopting full backup when the data importance of the message packet is the first degree, adopting incremental backup when the data importance of the message packet is the second degree, and adopting differential backup when the data importance of the message packet is the third degree;
[0095] Specifically, full backup refers to a complete backup of data at regular intervals, incremental backup refers to backing up only the data that has changed since the last backup, and differential backup refers to backing up all data that has changed since the last full backup. The backup frequency and strategy can be adjusted according to the target business and data importance.
[0096] The setting unit is used to set the backup parameters of the multiple RAID levels according to the backup strategy and the backup frequency.
[0097] Specifically, the backup parameters that are set include: according to the backup strategy, the backup frequency and the backup window (ie, the time period for performing the backup operation).
[0098] In the described embodiment, different backup strategies are adopted according to the different data importance levels of message packets, so that differentiated backup of different RAID levels can be achieved, further ensuring that the determined backup strategy and backup frequency match the message packets of different data importance, thereby further realizing the rational application of hard disk resources.
[0099] Specifically, for data with lower importance, a lower backup frequency or incremental backup or differential backup is used. These backup methods only back up data that has changed since the last backup, reducing the redundancy of backup data, thereby reducing the occupation of system resources and improving overall performance; for data with higher importance, a higher backup frequency or full backup is used, which means that each backup will contain a complete data set, thereby ensuring that key data is backed up more frequently and comprehensively, improving data security. Using different backup frequencies and strategies for data of different importance can avoid unnecessary frequent backups and redundant storage, make reasonable use of the storage space of the hard disk, and further solve the problem of unreasonable hard disk resource allocation in the prior art.
[0100] In some other exemplary embodiments, the second determining unit includes:
[0101] A first determination module, configured to determine, based on a first corresponding relationship, that a first score is a score corresponding to a range of importance of the data importance of the target message packet, wherein the first corresponding relationship is a corresponding relationship between the range of importance and the score;
[0102] A second determination module, configured to determine, according to a second corresponding relationship, that a second score is a score corresponding to a frequency range in which the data access frequency of the target message packet is located, wherein the second corresponding relationship is a corresponding relationship between the frequency range and the score;
[0103] A third determination module, configured to determine, according to a third corresponding relationship, that a third score is a score corresponding to a time range in which the data recovery time target of the target message packet is located, wherein the third corresponding relationship is a corresponding relationship between the time range and the score;
[0104] The fourth determination module is used to determine the security level indicator as the sum of the first score, the second score and the third score.
[0105] Specifically, the first corresponding relationship, the second corresponding relationship, and the third corresponding relationship are pre-set corresponding relationships, and the importance degree range, the frequency range, and the time range are pre-set ranges.
[0106] In the described embodiment, by comprehensively considering and scoring the data importance, data access frequency and data recovery time target of the target message package, the data security level index can be evaluated more accurately, and different RAID levels can be selected for backup based on the determined security level index, thereby further achieving targeted storage of the target message package, further ensuring that the backup strategy of the target message package meets the security requirements of the target message package, and further ensuring the security and reliability of the target message package in the event of a system failure.
[0107] In addition, the present application also presets a correspondence relationship between the security level indicator and the RAID level (hereinafter referred to as the fourth correspondence relationship). After obtaining the security level indicator of the target message packet, the RAID level corresponding to the security level indicator is searched in the fourth correspondence relationship, and the RAID level is the target RAID level. The hard disk group corresponding to the target RAID level is the target hard disk group.
[0108] Exemplarily, for the settings of the first correspondence, the second correspondence, and the third correspondence, in this application, for data with high importance, that is, data that is critical to the business and whose loss or damage will cause significant losses, the threshold is set to 9-10 points; for data with medium importance, that is, data that has a certain impact on the business but is non-critical, the threshold is set to 5-8 points; for data with low importance, that is, data that has little impact on the business and whose loss or damage will not cause serious consequences, the threshold is set to 1-4 points; for data with high access frequency, that is, the number of visits per day is greater than or equal to 1,000 times, the threshold is set to 10 points. The threshold is set to 9-10 points; for medium access frequency, that is, the number of accesses per day is greater than 100 times and less than 1000 times, the threshold is set to 5-8 points; for low access frequency, that is, the number of accesses per day is less than 100 times, the threshold is set to 1-4 points; for low recovery time objectives, that is, the recovery time objectives are less than or equal to 1 hour, the threshold is set to 9-10 points; for medium recovery time objectives, that is, the recovery time objectives are greater than one hour and less than 12 hours, the threshold is set to 5-8 points; for low recovery time objectives, that is, the recovery time objectives are greater than or equal to 12 hours, the threshold is set to 1-4 points. According to the actual situation of the data, score each factor, including data importance, access frequency and recovery time objectives, and add the scores of each factor to get the total score, and select the RAID level according to the total score. Total score: 24-30 points: select RAID 10 or RAID 1 to ensure high data redundancy and high performance; total score: 15-23 points: select RAID 5 or RAID 6 to balance performance, redundancy and cost; total score: 6-14 points: select RAID 0 to reduce cost and improve performance, but it needs to be combined with a good backup strategy. By comprehensively considering and scoring the data importance, data access frequency and data recovery time goals of the target message package, the data security level index can be more accurately evaluated. By selecting different RAID levels for backup based on the determined security level index, the target message package can be stored in a targeted manner, further ensuring that the backup strategy of the target message package meets the security requirements of the target message package, and further ensuring the security and reliability of the target message package in the event of a system failure.
[0109] In another optional solution, the first determination unit includes: a configuration module, which is used to configure the server with a number and capacity of hard disks corresponding to each RAID level according to the multiple RAID levels, and the device further includes: a deployment unit, which is used to deploy a RAID controller on the server and configure parameters of the RAID controller after configuring a hard disk group that meets each RAID level for the server, and the parameters of the RAID controller include at least one of the following: stripe size, verification mode;
[0110] Specifically, the average file size should be considered when configuring the stripe size. If large files such as videos and database files are mainly processed, a larger stripe size should be selected. If small files such as documents and pictures are processed, a smaller stripe size should be selected. Common verification methods include parity check, cyclic redundancy check, B+ check, etc.
[0111] The mounting unit is used to mount the key data on the server to the RAID, wherein the key data includes at least one of the following: a database and a log file.
[0112] Specifically, mounting involves the following steps: confirming that the RAID has been correctly configured and is in an available state, creating a file system on the RAID, creating a mount point, mounting the RAID, verifying that the RAID has been successfully mounted, etc.
[0113] In the embodiment, by deploying a RAID controller on the server side and configuring stripe size parameters, the size of the blocks into which the data is divided is determined. A reasonable stripe size can optimize the use of storage space while ensuring the performance of the RAID controller. By configuring the verification method of the RAID controller, the RAID controller can detect and correct errors in the data, thereby ensuring the integrity and reliability of the data. The key data on the server is mounted on the RAID, thereby ensuring that the data is synchronized to the RAID in real time while being written to the main server.
[0114] In some further exemplary embodiments of the present application, the device further comprises:
[0115] A decoding unit, used for decoding the data of the target message packet to obtain JSON object data in a string format before determining the security level indicator according to the data importance, data access frequency and data recovery time target of the target message packet;
[0116] A parsing unit, used to parse the JSON object data to obtain key value information in the JSON object;
[0117] A verification unit is used to perform data verification on the key-value information, wherein the data verification includes: data integrity verification, data format verification, data content verification and data security verification, wherein the data content verification includes: verifying whether the ID of the key-value information comes from a legitimate device, whether the key-value information is within a preset range, and whether the update time of the key-value information is within a preset time period.
[0118] Specifically, the message packet is subjected to data decoding and data parsing, and the processing result is subjected to data verification.
[0119] In the embodiment, the server ensures that the data can be correctly identified by decoding and parsing the data, which helps the server to accurately understand the data content sent by the device end and provide an accurate information basis for subsequent data processing; through data integrity verification, it checks whether the decoded and parsed data contains all the necessary fields, and compares the hash value of the JSON object with the expected hash value to ensure that the data has not been tampered with or lost during transmission; through data format verification, it helps to prevent data processing errors caused by format errors; through data content verification, it helps to prevent illegal devices from sending data or devices from sending abnormal data, thereby maintaining the security and stability of the system; through data security verification, it ensures that only legal devices can send messages, prevents data from being eavesdropped and tampered with during transmission, protects information from being leaked, and maintains data security. By decoding, parsing and verifying the data, the type and characteristics of the data can be more accurately identified, making the scoring of the message package more accurate, thereby making the security level index of the message package more accurate, and further optimizing the configuration of hard disk resources.
[0120] For example, taking the target message packet as the status update message of the smart bulb as an example, the specific process of data decoding, data parsing and data verification described in this application is described as follows: the server receives the status update message from the smart bulb through the MQTTBroker, the message format is JSON, including the ID, current brightness, color temperature and other information of the bulb; the server parses the payload part in the MQTT message and converts it from binary format to a JSON object in string format; extracts the bulb ID (bulb_id), current brightness (brightness) and color temperature (color_temp) and other fields from the JSON object. Convert the values of these fields to appropriate types, such as converting the brightness from a string to an integer; check whether the brightness value is within the valid range (for example, 0-255), check whether the color temperature value is within the valid range (for example, 1500K-9000K, but the specific range may vary depending on the bulb model), if an invalid value is found, replace it with a default value or record an error log; store the parsed and cleaned data in the database. The database table contains fields such as bulb ID, brightness, color temperature, and update time; use transaction processing to ensure data atomicity and consistency; check whether the payload part of the MQTT message contains all necessary fields (such as bulb_id, brightness, color_temp); calculate the hash value of the JSON object and compare it with the expected hash value to verify the integrity of the data; verify whether the format of the JSON object is correct, including whether the field name is correct and whether the data type matches; use JSON Schema format verification to ensure that the message conforms to the expected format specification; verify whether the bulb ID exists in the database to ensure that the message comes from a legitimate device; check whether the brightness and color temperature values are within a reasonable range to prevent the device from sending abnormal data; verify whether the update time of the message is reasonable to prevent timestamp forgery; use MQTT username and password for authentication to ensure that only legitimate devices can send messages; use TLS / SSL to encrypt MQTT connections to prevent data from being eavesdropped or tampered with during transmission; use encryption technology to protect data security when storing sensitive information (such as device keys) in the database; measure the average response time of the server to process MQTT messages to ensure that data processing is completed within a reasonable time frame; monitor the performance indicators of the database (such as query response time, write throughput, etc.) to ensure that the database can handle high concurrent requests; use stress testing tools to simulate scenarios where a large number of devices send messages at the same time to verify the performance and stability of the server.
[0121] The data storage device of the smart home device includes a processor and a memory, the first determination unit, the second determination unit, and the storage unit are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.
[0122] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of unreasonable hard disk resource configuration and poor hard disk resource utilization in the prior art can be at least solved by adjusting the kernel parameters.
[0123] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0124] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the data storage method.
[0125] Specifically, the data storage method includes:
[0126] Step S201, determining multiple RAID levels according to the data importance of multiple message packets in the target business and the performance requirement level of each message packet on the server, and configuring a hard disk group that meets each RAID level for the server, the performance requirement level includes: the requirement level of the read and write rate and the requirement level of the delay rate, the server is used to execute the target business, and one hard disk group includes at least one hard disk;
[0127] Specifically, the RAID level corresponds to the hard disk group one by one, and multiple RAID levels constitute the RAID array of the target business. The target business refers to a specific business or application scenario that requires data storage. To configure the hard disk group, the appropriate hard disk type, capacity and quantity must be selected according to the requirements of the RAID level, and the hard disks must be physically connected and logically configured.
[0128] Step S202, when the server receives a target message packet sent by the device, determining a security level indicator according to the data importance, data access frequency and data recovery time target of the target message packet, wherein the security level indicator is an indicator for evaluating the security level required for the message packet, and the target message packet is a part of a plurality of the message packets;
[0129] Specifically, the target message packet refers to a specific data unit sent from the device to the server, and the security level index is calculated based on data importance, data access frequency, and data recovery time target to evaluate the security level required for the target message packet. Different security levels correspond to different RAID levels.
[0130] Step S203, according to the security level index, determine the target RAID level from the multiple RAID levels, and determine the hard disk group corresponding to the target RAID level as the target hard disk group, and use the target hard disk group to store the target message packet, the target RAID level is one of the multiple RAID levels.
[0131] Specifically, according to the security level index, a target RAID level is determined from a plurality of RAID levels, a hard disk group corresponding to the target RAID level is determined, and the corresponding hard disk group is used to store the target message packet.
[0132] Optionally, the data importance of the message packet includes a first degree, a second degree and a third degree, and the degrees of importance represented by the first degree, the second degree and the third degree decrease in sequence. After configuring a hard disk group that meets each of the RAID levels for the server, the method further includes: determining a backup strategy and a backup frequency of the RAID level corresponding to each of the message packets according to the data importance of a plurality of the message packets, the backup strategy including: using a full backup when the data importance of the message packet is the first degree, using an incremental backup when the data importance of the message packet is the second degree, and using a differential backup when the data importance of the message packet is the third degree; and setting backup parameters for a plurality of the RAID levels according to the backup strategy and the backup frequency.
[0133] Optionally, a security level index is determined based on the data importance, data access frequency and data recovery time target of the target message packet, including: determining a first score as a score corresponding to an importance range of the data importance of the target message packet based on a first correspondence relationship, wherein the first correspondence relationship is a correspondence between the importance range and the score; determining a second score as a score corresponding to a frequency range of the data access frequency of the target message packet based on a second correspondence relationship, wherein the second correspondence relationship is a correspondence between the frequency range and the score; determining a third score as a score corresponding to a time range of the data recovery time target of the target message packet based on a third correspondence relationship, wherein the third correspondence relationship is a correspondence between the time range and the score; and determining the security level index as the sum of the first score, the second score and the third score.
[0134] Optionally, configuring a hard disk group that meets each of the RAID levels for the server includes: according to the multiple RAID levels, configuring the server with hard disks of the quantity and capacity corresponding to each of the RAID levels; after configuring the server with a hard disk group that meets each of the RAID levels, the method further includes: deploying a RAID controller on the server, and configuring parameters of the RAID controller, the parameters of the RAID controller including at least one of the following: stripe size, verification method; mounting key data on the server to the RAID, the key data including at least one of the following: database, log file.
[0135] Optionally, before determining the security level indicator based on the data importance, data access frequency and data recovery time target of the target message packet, the method also includes: decoding the message packet to obtain JSON object data in a string format; parsing the JSON object data to obtain key value information in the JSON object; verifying the key value information, the data verification including: data integrity verification, data format verification, data content verification and data security verification, the data content verification including: verifying whether the ID of the key value information comes from a legitimate device, whether the key value information is within a preset range, and whether the update time of the key value information is within a preset time period.
[0136] An embodiment of the present invention provides a processor, which is used to run a program, wherein the data storage method is executed when the program is running.
[0137] Specifically, the data storage method includes:
[0138] Step S201, determining multiple RAID levels according to the data importance of multiple message packets in the target business and the performance requirement level of each message packet on the server, and configuring a hard disk group that meets each RAID level for the server, the performance requirement level includes: the requirement level of the read and write rate and the requirement level of the delay rate, the server is used to execute the target business, and one hard disk group includes at least one hard disk;
[0139] Specifically, the RAID level corresponds to the hard disk group one by one, and multiple RAID levels constitute the RAID array of the target business. The target business refers to a specific business or application scenario that requires data storage. To configure the hard disk group, the appropriate hard disk type, capacity and quantity must be selected according to the requirements of the RAID level, and the hard disks must be physically connected and logically configured.
[0140] Step S202, when the server receives a target message packet sent by the device, determining a security level indicator according to the data importance, data access frequency and data recovery time target of the target message packet, wherein the security level indicator is an indicator for evaluating the security level required for the message packet, and the target message packet is a part of a plurality of the message packets;
[0141] Specifically, the target message packet refers to a specific data unit sent from the device to the server, and the security level index is calculated based on data importance, data access frequency, and data recovery time target to evaluate the security level required for the target message packet. Different security levels correspond to different RAID levels.
[0142] Step S203, according to the security level index, determine the target RAID level from the multiple RAID levels, and determine the hard disk group corresponding to the target RAID level as the target hard disk group, and use the target hard disk group to store the target message packet, the target RAID level is one of the multiple RAID levels.
[0143] Specifically, according to the security level index, a target RAID level is determined from a plurality of RAID levels, a hard disk group corresponding to the target RAID level is determined, and the corresponding hard disk group is used to store the target message packet.
[0144] Optionally, the data importance of the message packet includes a first degree, a second degree and a third degree, and the degrees of importance represented by the first degree, the second degree and the third degree decrease in sequence. After configuring a hard disk group that meets each of the RAID levels for the server, the method further includes: determining a backup strategy and a backup frequency of the RAID level corresponding to each of the message packets according to the data importance of a plurality of the message packets, the backup strategy including: using a full backup when the data importance of the message packet is the first degree, using an incremental backup when the data importance of the message packet is the second degree, and using a differential backup when the data importance of the message packet is the third degree; and setting backup parameters for a plurality of the RAID levels according to the backup strategy and the backup frequency.
[0145] Optionally, a security level index is determined based on the data importance, data access frequency and data recovery time target of the target message packet, including: determining a first score as a score corresponding to an importance range of the data importance of the target message packet based on a first correspondence relationship, wherein the first correspondence relationship is a correspondence between the importance range and the score; determining a second score as a score corresponding to a frequency range of the data access frequency of the target message packet based on a second correspondence relationship, wherein the second correspondence relationship is a correspondence between the frequency range and the score; determining a third score as a score corresponding to a time range of the data recovery time target of the target message packet based on a third correspondence relationship, wherein the third correspondence relationship is a correspondence between the time range and the score; and determining the security level index as the sum of the first score, the second score and the third score.
[0146] Optionally, configuring a hard disk group satisfying each of the RAID levels for the server includes: configuring hard disks of a quantity and capacity corresponding to each of the RAID levels for the server according to the multiple RAID levels.
[0147] Optionally, after configuring a hard disk group that meets each of the RAID levels for the server, the method further includes: deploying a RAID controller on the server and configuring parameters of the RAID controller, the parameters of the RAID controller including at least one of the following: stripe size, verification method; mounting key data on the server to the RAID, the key data including at least one of the following: database, log file.
[0148] Optionally, before determining the security level indicator based on the data importance, data access frequency and data recovery time target of the target message packet, the method also includes: decoding the message packet to obtain JSON object data in a string format; parsing the JSON object data to obtain key value information in the JSON object; verifying the key value information, the data verification including: data integrity verification, data format verification, data content verification and data security verification, the data content verification including: verifying whether the ID of the key value information comes from a legitimate device, whether the key value information is within a preset range, and whether the update time of the key value information is within a preset time period.
[0149] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement at least the following method steps:
[0150] Step S201, determining multiple RAID levels according to the data importance of multiple message packets in the target business and the performance requirement level of each message packet on the server, and configuring a hard disk group that meets each RAID level for the server, the performance requirement level includes: the requirement level of the read and write rate and the requirement level of the delay rate, the server is used to execute the target business, and one hard disk group includes at least one hard disk;
[0151] Specifically, the RAID level corresponds to the hard disk group one by one, and multiple RAID levels constitute the RAID array of the target business. The target business refers to a specific business or application scenario that requires data storage. To configure the hard disk group, the appropriate hard disk type, capacity and quantity must be selected according to the requirements of the RAID level, and the hard disks must be physically connected and logically configured.
[0152] Step S202, when the server receives a target message packet sent by the device, determining a security level indicator according to the data importance, data access frequency and data recovery time target of the target message packet, wherein the security level indicator is an indicator for evaluating the security level required for the message packet, and the target message packet is a part of a plurality of the message packets;
[0153] Specifically, the target message packet refers to a specific data unit sent from the device to the server, and the security level index is calculated based on data importance, data access frequency, and data recovery time target to evaluate the security level required for the target message packet. Different security levels correspond to different RAID levels.
[0154] Step S203, according to the security level index, determine the target RAID level from the multiple RAID levels, and determine the hard disk group corresponding to the target RAID level as the target hard disk group, and use the target hard disk group to store the target message packet, the target RAID level is one of the multiple RAID levels.
[0155] Specifically, according to the security level index, a target RAID level is determined from a plurality of RAID levels, a hard disk group corresponding to the target RAID level is determined, and the corresponding hard disk group is used to store the target message packet.
[0156] Optionally, the data importance of the message packet includes a first degree, a second degree and a third degree, and the degrees of importance represented by the first degree, the second degree and the third degree decrease in sequence. After configuring a hard disk group that meets each of the RAID levels for the server, the method further includes: determining a backup strategy and a backup frequency of the RAID level corresponding to each of the message packets according to the data importance of a plurality of the message packets, the backup strategy including: using a full backup when the data importance of the message packet is the first degree, using an incremental backup when the data importance of the message packet is the second degree, and using a differential backup when the data importance of the message packet is the third degree; and setting backup parameters for a plurality of the RAID levels according to the backup strategy and the backup frequency.
[0157] Optionally, a security level index is determined based on the data importance, data access frequency and data recovery time target of the target message packet, including: determining a first score as a score corresponding to an importance range of the data importance of the target message packet based on a first correspondence relationship, wherein the first correspondence relationship is a correspondence between the importance range and the score; determining a second score as a score corresponding to a frequency range of the data access frequency of the target message packet based on a second correspondence relationship, wherein the second correspondence relationship is a correspondence between the frequency range and the score; determining a third score as a score corresponding to a time range of the data recovery time target of the target message packet based on a third correspondence relationship, wherein the third correspondence relationship is a correspondence between the time range and the score; and determining the security level index as the sum of the first score, the second score and the third score.
[0158] Optionally, configuring a hard disk group satisfying each of the RAID levels for the server includes: configuring hard disks of a quantity and capacity corresponding to each of the RAID levels for the server according to the multiple RAID levels.
[0159] Optionally, after configuring a hard disk group that meets each of the RAID levels for the server, the method further includes: deploying a RAID controller on the server and configuring parameters of the RAID controller, the parameters of the RAID controller including at least one of the following: stripe size, verification method; mounting key data on the server to the RAID, the key data including at least one of the following: database, log file.
[0160] Optionally, before determining the security level indicator based on the data importance, data access frequency and data recovery time target of the target message packet, the method also includes: decoding the message packet to obtain JSON object data in a string format; parsing the JSON object data to obtain key value information in the JSON object; verifying the key value information, the data verification including: data integrity verification, data format verification, data content verification and data security verification, the data content verification including: verifying whether the ID of the key value information comes from a legitimate device, whether the key value information is within a preset range, and whether the update time of the key value information is within a preset time period.
[0161] The embodiment of the present application also provides an electronic device, including: one or more processors, a memory, and one or more programs, wherein the one or more programs include a method for executing any one of the methods described. When the program is executed, at least the following steps are implemented:
[0162] Step S201, determining multiple RAID levels according to the data importance of multiple message packets in the target business and the performance requirement level of each message packet on the server, and configuring a hard disk group that meets each RAID level for the server, the performance requirement level includes: the requirement level of the read and write rate and the requirement level of the delay rate, the server is used to execute the target business, and one hard disk group includes at least one hard disk;
[0163] Specifically, the RAID level corresponds to the hard disk group one by one, and multiple RAID levels constitute the RAID array of the target business. The target business refers to a specific business or application scenario that requires data storage. To configure the hard disk group, the appropriate hard disk type, capacity and quantity must be selected according to the requirements of the RAID level, and the hard disks must be physically connected and logically configured.
[0164] Step S202, when the server receives a target message packet sent by the device, determining a security level indicator according to the data importance, data access frequency and data recovery time target of the target message packet, wherein the security level indicator is an indicator for evaluating the security level required for the message packet, and the target message packet is a part of a plurality of the message packets;
[0165] Specifically, the target message packet refers to a specific data unit sent from the device to the server, and the security level index is calculated based on data importance, data access frequency, and data recovery time target to evaluate the security level required for the target message packet. Different security levels correspond to different RAID levels.
[0166] Step S203, according to the security level index, determine the target RAID level from the multiple RAID levels, and determine the hard disk group corresponding to the target RAID level as the target hard disk group, and use the target hard disk group to store the target message packet, the target RAID level is one of the multiple RAID levels.
[0167] Specifically, according to the security level index, a target RAID level is determined from a plurality of RAID levels, a hard disk group corresponding to the target RAID level is determined, and the corresponding hard disk group is used to store the target message packet.
[0168] Optionally, the data importance of the message packet includes a first degree, a second degree and a third degree, and the degrees of importance represented by the first degree, the second degree and the third degree decrease in sequence. After configuring a hard disk group that meets each of the RAID levels for the server, the method further includes: determining a backup strategy and a backup frequency of the RAID level corresponding to each of the message packets according to the data importance of a plurality of the message packets, the backup strategy including: using a full backup when the data importance of the message packet is the first degree, using an incremental backup when the data importance of the message packet is the second degree, and using a differential backup when the data importance of the message packet is the third degree; and setting backup parameters for a plurality of the RAID levels according to the backup strategy and the backup frequency.
[0169] Optionally, a security level index is determined based on the data importance, data access frequency and data recovery time target of the target message packet, including: determining a first score as a score corresponding to an importance range of the data importance of the target message packet based on a first correspondence relationship, wherein the first correspondence relationship is a correspondence between the importance range and the score; determining a second score as a score corresponding to a frequency range of the data access frequency of the target message packet based on a second correspondence relationship, wherein the second correspondence relationship is a correspondence between the frequency range and the score; determining a third score as a score corresponding to a time range of the data recovery time target of the target message packet based on a third correspondence relationship, wherein the third correspondence relationship is a correspondence between the time range and the score; and determining the security level index as the sum of the first score, the second score and the third score.
[0170] Optionally, configuring a hard disk group satisfying each of the RAID levels for the server includes: configuring hard disks of a quantity and capacity corresponding to each of the RAID levels for the server according to the multiple RAID levels.
[0171] Optionally, after configuring a hard disk group that meets each of the RAID levels for the server, the method further includes: deploying a RAID controller on the server and configuring parameters of the RAID controller, the parameters of the RAID controller including at least one of the following: stripe size, verification method; mounting key data on the server to the RAID, the key data including at least one of the following: database, log file.
[0172] Optionally, before determining the security level indicator based on the data importance, data access frequency and data recovery time target of the target message packet, the method also includes: decoding the message packet to obtain JSON object data in a string format; parsing the JSON object data to obtain key value information in the JSON object; verifying the key value information, the data verification including: data integrity verification, data format verification, data content verification and data security verification, the data content verification including: verifying whether the ID of the key value information comes from a legitimate device, whether the key value information is within a preset range, and whether the update time of the key value information is within a preset time period.
[0173] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0174] Obviously, those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0175] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0176] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0177] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0178] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0179] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0180] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0181] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0182] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0183] From the above description, it can be seen that the embodiments described in this application achieve the following technical effects:
[0184] 1) The storage method of the present application first determines multiple RAID levels according to the data importance of multiple message packets in the target business and the performance requirements such as the read and write rate and delay rate of the server, and then configures the corresponding hard disk group for the server according to the determined multiple RAID levels. When the target message packet sent by the device is received, the security level index of the target message packet is determined according to the data importance, data access frequency and data recovery time target of the target message packet. Finally, the target RAID level is determined from multiple RAID levels according to the security level index, and the hard disk group corresponding to the target RAID level is determined as the target hard disk group, and the hard disk group is used to store the target message packet. The present application dynamically selects the RAID level according to the characteristics and requirements of the data, realizes the reasonable configuration of the hard disk resources, ensures the full utilization of the server hard disk space, avoids the waste and uneven use of the hard disk space, and improves the utilization rate and efficiency of the hard disk resources.
[0185] 2) The data storage device of the smart home device of the present application determines multiple RAID levels according to the data importance of multiple message packets in the target business and the performance requirement level of each message packet to the server through the first determination unit, configures hard disk groups that meet each RAID level for the server according to the multiple RAID levels through the configuration unit to form a RAID array, and determines the security level index according to the data importance, data access frequency and data recovery time target of the target message packet when the server receives the target message packet sent by the device end through the second determination unit, and determines the hard disk group corresponding to the target RAID level from the RAID level array to store the target message packet according to the security level index through the storage unit. Multiple RAID levels are determined according to the data importance of multiple message packets in the target business of the smart home device and the performance requirements such as the read and write rate and delay rate of the server, and the corresponding hard disk groups are configured for the server according to the determined multiple RAID levels to form a RAID array. After receiving the target message packet sent by the device, the server determines the security level index of the target message packet according to the data importance, data access frequency and data recovery time target of the target message packet, and determines the hard disk group corresponding to the target RAID level from the RAID array according to the security level index to store the target message packet. According to the characteristics and requirements of the smart home device data, the RAID level is dynamically selected to achieve reasonable allocation of hard disk resources.
[0186] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A data storage method, characterized in that: include: Determine multiple RAID levels according to the data importance of multiple message packets in the target business and the performance requirement level of each message packet on the server, and configure a hard disk group that meets each RAID level for the server, the performance requirement level includes: the requirement level of read and write rate and the requirement level of delay rate, the server is used to execute the target business, and one hard disk group includes at least one hard disk; When the server receives a target message packet sent by the device, a security level indicator is determined according to the data importance, data access frequency and data recovery time target of the target message packet, wherein the security level indicator is an indicator for evaluating the security level required for the message packet, and the target message packet is a part of a plurality of the message packets; According to the security level index, the target RAID level is determined from the multiple RAID levels, and the hard disk group corresponding to the target RAID level is determined as the target hard disk group, and the target hard disk group is used to store the target message packet. The target RAID level is one of the multiple RAID levels.
2. The method according to claim 1, characterized in that The data importance of the message packet includes a first degree, a second degree and a third degree, and the first degree, the second degree and the third degree represent the importance in descending order. After configuring a hard disk group that meets each of the RAID levels for the server, the method further includes: Determine the backup strategy and backup frequency of the RAID level corresponding to each message packet according to the data importance of the plurality of message packets, the backup strategy comprising: adopting full backup when the data importance of the message packet is the first degree, adopting incremental backup when the data importance of the message packet is the second degree, and adopting differential backup when the data importance of the message packet is the third degree; According to the backup strategy and the backup frequency, backup parameters of multiple RAID levels are set.
3. The method according to claim 1, characterized in that According to the data importance, data access frequency and data recovery time target of the target message packet, the security level index is determined, including: According to the first corresponding relationship, determining the first score as the score corresponding to the importance degree range of the data importance of the target message packet, wherein the first corresponding relationship is the corresponding relationship between the importance degree range and the score; According to the second corresponding relationship, determining the second score as the score corresponding to the frequency range where the data access frequency of the target message packet is located, wherein the second corresponding relationship is a corresponding relationship between the frequency range and the score; According to the third corresponding relationship, determine that the third score is the score corresponding to the time range where the data recovery time target of the target message packet is located, and the third corresponding relationship is the corresponding relationship between the time range and the score; The security level indicator is determined to be the sum of the first score, the second score and the third score.
4. The method according to any one of claims 1 to 3, characterized in that Configuring a hard disk group that satisfies each of the RAID levels for the server includes: configuring hard disks of a quantity and capacity corresponding to each of the RAID levels for the server according to the multiple RAID levels.
5. The method according to any one of claims 1 to 3, characterized in that After configuring the server with a hard disk group that meets each of the RAID levels, the method further includes: Deploy a RAID controller on the server and configure parameters of the RAID controller, wherein the parameters of the RAID controller include at least one of the following: stripe size and verification mode; The key data on the server is mounted on the RAID, wherein the key data includes at least one of the following: a database and a log file.
6. The method according to any one of claims 1 to 3, characterized in that Before determining the security level indicator according to the data importance, data access frequency and data recovery time target of the target message packet, the method further includes: Decoding the message packet to obtain JSON object data in a string format; Parsing the JSON object data to obtain key value information in the JSON object; The key-value information is subjected to data verification, and the data verification includes: data integrity verification, data format verification, data content verification and data security verification. The data content verification includes: verifying whether the ID of the key-value information comes from a legitimate device, whether the key-value information is within a preset range, and whether the update time of the key-value information is within a preset time period.
7. A data storage device for smart home equipment, characterized in that: include: A first determining unit is used to determine multiple RAID levels according to the data importance of multiple message packets in the target business and the performance requirement level of each message packet on the server, and configure a hard disk group that meets each RAID level for the server, wherein the performance requirement level includes: the requirement level of the read and write rate and the requirement level of the delay rate, the server is used to execute the target business, and one of the hard disk groups includes at least one hard disk; a second determining unit, configured to determine, when the server receives a target message packet sent by the device, a security level indicator according to the data importance, data access frequency and data recovery time target of the target message packet, wherein the security level indicator is an indicator for evaluating the security level required for the message packet, and the target message packet is a part of the plurality of message packets; A storage unit is used to determine a target RAID level from the multiple RAID levels according to the security level index, and to determine the hard disk group corresponding to the target RAID level as a target hard disk group, and to use the target hard disk group to store the target message packet, wherein the target RAID level is one of the multiple RAID levels.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 6.
9. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of claims 1 to 6.
Citation Information
Patent Citations
Data storage method and system based on RAID (Redundant Array of Inexpensive Disk)
CN102033717A
Data processing method, device and equipment based on solid-state disk array and storage medium
CN111880745A
Data replication and cloud backup tower server for RAID (redundant array of independent disks) hard disk
CN117389795A
Performance evaluation system and method for multi-stage RAID system
CN117909198A
Dynamic security policy selection method and device, electronic equipment and storage medium
CN118074963A