Server RAID card log synchronous download method, device, equipment and medium
By saving the RAID card log synchronization file in the server and using the update cycle and line number comparison mechanism, the problems of long RAID card log downloading process and page crashes are solved, and fast and stable log download is achieved.
Patent Information
- Application Number
- CN202310157986.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2043-02-23
AI Technical Summary
The existing technology requires synchronous collection of logs when downloading RAID card logs, which results in a long process and easily causes the web page to crash.
By saving the RAID card log synchronization file in the server and transferring only the latest synchronization file during downloading, repeated log collection is avoided, and the synchronization file is updated using the preset update cycle and line number comparison mechanism.
It shortens download time, avoids web page crashes, and improves user experience.
Smart Images

Figure CN116405478B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server technology, and in particular to a method, device, computer equipment, and storage medium for synchronously downloading server RAID card logs. Background Art
[0002] To facilitate baseboard management controller (BMC) operation and maintenance personnel to view relevant record information during the use of independent disk redundant array (RAID) cards and to troubleshoot error logs, a RAID log download function has been added. The original method is to trigger the log collection function by clicking the download button. When the log is initialized for collection, the original log information needs to be read from the RAID card and written to the corresponding download log file. If it is the first download, this process may take a long time, and the web page may crash due to the long collection time and become unusable. When downloading logs again subsequently, the newly added log information needs to be collected from the RAID card and then synchronized to the download log file. This processing method of synchronously triggering log collection during downloading makes the log download process longer and can easily cause the web page to crash and become unusable. Summary of the Invention
[0003] Based on this, it is necessary to provide a server RAID card log synchronization download method, device, computer equipment and storage medium to address the above technical problems, which can solve the technical problems that log collection needs to be synchronized when downloading RAID logs, and the RAID log collection process is long and easily causes web pages to crash.
[0004] On the one hand, a method for synchronously downloading a server RAID card log is provided, the method comprising:
[0005] Obtain the server's RAID card log content and generate a RAID card log synchronization file;
[0006] Update the RAID card log synchronization file according to the RAID card log content according to a preset update cycle;
[0007] In response to obtaining the current RAID card log download command, the RAID card log synchronization file is downloaded.
[0008] In one embodiment, the step of obtaining the RAID card log content of the server and forming a RAID card log synchronization file includes:
[0009] Create an empty synchronous RAID card log file, and set the last line number value to zero in the empty synchronous RAID card log file;
[0010] Setting a log synchronization flag in the synchronous RAID card log empty file, and setting the log synchronization flag to need to be synchronized;
[0011] Get the last line number value of the server's RAID card log;
[0012] Compare the last line number value set in the synchronized RAID card log empty file with the last line number value of the RAID card log to see if they are equal;
[0013] If they are equal, the empty RAID card log file is used as the RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not need to be synchronized;
[0014] If they are not equal, the content of the RAID card log empty file is updated to form a RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not require synchronization.
[0015] In one embodiment, the step of updating the RAID card log synchronization file according to the RAID card log content according to a preset update period includes:
[0016] Setting the update period of the RAID card log synchronization file;
[0017] Obtain the last line number value of the RAID card log of the server according to the preset update cycle;
[0018] Get the last line number value in the RAID card log synchronization file;
[0019] Compare the last line number value of the RAID card log with the last line number value of the RAID card log synchronization file to see if they are equal;
[0020] If they are equal, the RAID card log synchronization file is not updated;
[0021] If they are not equal, the difference between the RAID card log synchronization file and the RAID card log is obtained, and the difference is updated to the RAID card log synchronization file.
[0022] In one embodiment, the step of obtaining the difference between the RAID card log synchronization file and the RAID card log synchronization file, and updating the difference to the RAID card log synchronization file includes:
[0023] In response to comparing the last line number value of the RAID card log and the last line number value of the RAID card log synchronization file and finding that they are not equal, modifying the log synchronization flag in the RAID card log synchronization file to require synchronization;
[0024] Obtain the difference line number between the RAID card log synchronization file and the RAID card log;
[0025] Obtaining the difference content of the RAID card log synchronization file to be synchronized from the RAID card log according to the difference line number;
[0026] Updating the difference content to the RAID card log synchronization file;
[0027] The log synchronization flag in the RAID card log synchronization file is modified to not require synchronization.
[0028] In one embodiment, the step of obtaining the difference line numbers between the RAID card log synchronization file and the RAID card log includes:
[0029] Obtain the last line number value of the RAID card log, and the last line number value of the RAID card log synchronization file;
[0030] The difference line number between the RAID card log synchronization file and the RAID card log is calculated by adding one to the last line number of the RAID card log.
[0031] In one embodiment, after the step of updating the difference content to the RAID card log synchronization file and before the step of modifying the log synchronization flag in the RAID card log synchronization file to not requiring synchronization, the method further includes:
[0032] Obtain the last line number value of the RAID card log and the last line number value of the RAID card log synchronization file again;
[0033] Determine whether the line number value of the last line of the RAID card log is equal to the line number value of the last line of the RAID card log synchronization file;
[0034] If they are equal, it is determined that synchronization with the RAID card log synchronization file is completed and the next step is executed;
[0035] If they are not equal, the difference between the RAID card log synchronization file and the RAID card log synchronization file is obtained again, and the difference is updated to the RAID card log synchronization file.
[0036] In one embodiment, in response to obtaining the current RAID card log download command, the step of downloading the RAID card log synchronization file includes:
[0037] Obtaining a log synchronization flag in the RAID card log synchronization file;
[0038] In response to the log synchronization flag in the RAID card log synchronization file indicating that synchronization is not required, downloading the RAID card log synchronization file;
[0039] In response to the log synchronization flag in the RAID card log synchronization file indicating that synchronization is required, an alarm message indicating that log collection is in progress is issued.
[0040] On the other hand, a server RAID card log synchronization downloading device is provided, the device comprising:
[0041] A RAID card log synchronization file module is formed to obtain the RAID card log content of the server and form a RAID card log synchronization file;
[0042] A RAID card log synchronization file update module is used to update the RAID card log synchronization file according to the RAID card log content according to a preset update cycle;
[0043] The RAID log download control module is configured to download the RAID card log synchronization file in response to obtaining the current RAID card log download command.
[0044] In another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0045] Obtain the server's RAID card log content and generate a RAID card log synchronization file;
[0046] Update the RAID card log synchronization file according to the RAID card log content according to a preset update cycle;
[0047] In response to obtaining the current RAID card log download command, the RAID card log synchronization file is downloaded.
[0048] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0049] Obtain the server's RAID card log content and generate a RAID card log synchronization file;
[0050] Update the RAID card log synchronization file according to the RAID card log content according to a preset update cycle;
[0051] In response to obtaining the current RAID card log download command, the RAID card log synchronization file is downloaded.
[0052] The above-mentioned server RAID card log synchronization downloading method, device, computer equipment and storage medium pre-place the log synchronization collection process and save the RAID card log synchronization file in the server. When downloading the RAID card log, only the latest RAID card log synchronization file is downloaded, and there is no need to collect logs, thereby shortening the download time, preventing web page crashes, and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0054] Figure 1 This is an application environment diagram of a method for synchronously downloading server RAID card logs in one embodiment;
[0055] Figure 2 A schematic diagram of a flow chart of a method for synchronously downloading server RAID card logs in one embodiment;
[0056] Figure 3 A flowchart of the steps of obtaining the RAID card log content of a server and forming a RAID card log synchronization file in one embodiment;
[0057] Figure 4 A flowchart of the steps of updating the RAID card log synchronization file according to the RAID card log content according to a preset update cycle in one embodiment;
[0058] Figure 5 A flowchart illustrating the steps of obtaining the difference between the RAID card log synchronization file and the RAID card log synchronization file and updating the difference to the RAID card log synchronization file in one embodiment;
[0059] Figure 6 A flowchart of the step of obtaining the difference line numbers between the RAID card log synchronization file and the RAID card log in one embodiment;
[0060] Figure 7 A flowchart of the steps of downloading the RAID card log synchronization file in response to obtaining a RAID card log download command in one embodiment;
[0061] Figure 8 A logical principle diagram of a method for synchronously downloading server RAID card logs in one embodiment;
[0062] Figure 9 A structural block diagram of a server RAID card log synchronization downloading device in one embodiment;
[0063] Figure 10 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0065] The server RAID card log synchronization download method provided in this application can be applied to Figure 1 In the application environment shown, the terminal 20 communicates with the server 10 via a network. The terminal 20 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and the server 10 can be implemented as an independent server or a server cluster consisting of multiple servers.
[0066] In one embodiment, Figure 2 As shown, a server RAID card log synchronization download method is provided, which is applied to Figure 1 Taking the server 10 in the example as an example, the following steps are included:
[0067] Step S1, obtaining the RAID card log content of the server and forming a RAID card log synchronization file;
[0068] Step S2, updating the RAID card log synchronization file according to the RAID card log content according to a preset update cycle;
[0069] Step S3: In response to obtaining the current RAID card log download command, download the RAID card log synchronization file.
[0070] Here, the term RAID is a definition of Redundant Array of Independent Disks.
[0071] like Figure 3 As shown, in this embodiment, the step of obtaining the RAID card log content of the server and forming a RAID card log synchronization file includes:
[0072] Step S11, creating a synchronous RAID card log empty file, and setting the last line number value in the synchronous RAID card log empty file to zero;
[0073] Step S12, setting a log synchronization flag in the synchronous RAID card log empty file, and setting the log synchronization flag to need synchronization;
[0074] Step S13, obtaining the last line number value of the RAID card log of the server;
[0075] Step S14, comparing the last line number value set in the synchronized RAID card log empty file with the last line number value of the RAID card log to see if they are equal;
[0076] Step S15: If they are equal, the empty RAID card log file is used as the RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not need synchronization;
[0077] Step S16: If they are not equal, the content of the RAID card log empty file is updated to form a RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not require synchronization.
[0078] like Figure 4 As shown, in this embodiment, the step of updating the RAID card log synchronization file according to the RAID card log content according to the preset update period includes:
[0079] Step S21, setting the update period of the RAID card log synchronization file;
[0080] Step S22, obtaining the last line number value of the server's RAID card log according to the preset update cycle;
[0081] Step S23, obtaining the last line number value in the RAID card log synchronization file;
[0082] Step S24, comparing the line number value of the last line of the RAID card log with the line number value of the last line of the RAID card log synchronization file to see whether they are equal;
[0083] Step S25: If they are equal, the RAID card log synchronization file is not updated;
[0084] Step S26: If they are not equal, obtaining the difference between the RAID card log synchronization file and the RAID card log, and updating the difference to the RAID card log synchronization file.
[0085] like Figure 5 As shown, in this embodiment, the step of obtaining the difference between the RAID card log synchronization file and the RAID card log synchronization file, and updating the difference to the RAID card log synchronization file includes:
[0086] Step S261, in response to comparing the last line number value of the RAID card log and the last line number value of the RAID card log synchronization file and finding that they are not equal, modifying the log synchronization flag in the RAID card log synchronization file to require synchronization;
[0087] Step S262, obtaining the difference line numbers between the RAID card log synchronization file and the RAID card log;
[0088] Step S263, obtaining the difference content to be synchronized of the RAID card log synchronization file from the RAID card log according to the difference line number;
[0089] Step S264, updating the difference content to the RAID card log synchronization file;
[0090] Step S269: modify the log synchronization flag in the RAID card log synchronization file to indicate that synchronization is not required.
[0091] like Figure 6 As shown, in this embodiment, the step of obtaining the difference line numbers between the RAID card log synchronization file and the RAID card log includes:
[0092] Step S2621, obtaining the line number value of the last line of the RAID card log, and the line number value of the last line of the RAID card log synchronization file;
[0093] Step S2622: add one to the last line number of the RAID card log synchronization file and the last line number of the RAID card log as the difference line number between the RAID card log synchronization file and the RAID card log.
[0094] like Figure 5 As shown, in this embodiment, after step S264 of updating the difference content to the RAID card log synchronization file and before step S269 of modifying the log synchronization flag in the RAID card log synchronization file to not requiring synchronization, the process further includes:
[0095] Step S265, again obtaining the line number value of the last line of the RAID card log and the line number value of the last line of the RAID card log synchronization file;
[0096] Step S266, determining whether the line number value of the last line of the RAID card log is equal to the line number value of the last line of the RAID card log synchronization file;
[0097] Step S267: If they are equal, it is determined that synchronization with the RAID card log synchronization file is completed and the next step is executed;
[0098] Step S268: If they are not equal, obtaining the difference between the RAID card log synchronization file and the RAID card log synchronization file again, and updating the difference to the RAID card log synchronization file.
[0099] like Figure 7 As shown, in this embodiment, in response to obtaining the current RAID card log download command, the step of downloading the RAID card log synchronization file includes:
[0100] Step S31, obtaining the log synchronization flag in the RAID card log synchronization file;
[0101] Step S32, in response to the log synchronization flag in the RAID card log synchronization file being not synchronized, downloading the RAID card log synchronization file;
[0102] Step S33: In response to the log synchronization flag in the RAID card log synchronization file indicating that synchronization is required, an alarm message indicating that log collection is in progress is issued.
[0103] like Figure 8 As shown, the specific processing logic of the server RAID card log synchronous download method is described below by example:
[0104] 1) During the first initialization, create an empty file raid_log.txt and set the last line number raid_log_id=0.
[0105] 2) Set the log synchronization flag raid_updated = 1 (1 means synchronization is required, 0 means synchronization is not required).
[0106] 3) According to the number of log lines in the RAID card log.txt, initialize the last line number log_id=n (n>=0).
[0107] 4) After initializing the basic data, the synchronization indicator bit, raid_updated, is used to determine whether synchronization is required. If not, synchronization ends. Further verification of the number of rows is performed. If the number of rows is equal, synchronization is not required. If the number of rows is not equal, the contents of lines 1 through 1 in log.txt are synchronized to raid_log.txt. After synchronization is complete, a further verification of the number of rows is performed. If they are equal, synchronization ends and raid_updated is set to 0. If not, synchronization continues until the number of rows is equal.
[0108] 5) Initialize subsequent synchronization work, which requires the use of a scheduled task (the scheduled task period can be set). When the task is executed, it determines whether the line numbers of the two log files are equal. If they are equal, no new logs have been generated and no synchronization is required. If they are not equal, the flag raid_updated = 1 is first set, and then the log synchronization work is carried out. The specific processing logic is the same as that during initialization.
[0109] When downloading logs through the web page, the value of the flag raid_updated is used for judgment. If the value is 0, the system can download the logs directly. If the value is 1, a warning message "Logs are being collected. Please try again later" will be displayed, indicating that log collection is in progress.
[0110] In the above-mentioned server RAID card log synchronization download method, the log synchronization collection process is pre-placed, and the RAID card log synchronization file is saved in the server. When downloading the RAID card log, only the latest RAID card log synchronization file is downloaded, and there is no need to collect logs, thereby shortening the download time, preventing web page crashes, and improving user experience.
[0111] It should be understood that although Figure 2-Figure 7 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2-Figure 7 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0112] In one embodiment, Figure 9 As shown, a server RAID card log synchronization downloading device 10 is provided, comprising: a RAID card log synchronization file forming module 1, a RAID card log synchronization file updating module 2 and a RAID log downloading control module 3.
[0113] The module 1 for forming a RAID card log synchronization file is used to obtain the RAID card log content of the server and form a RAID card log synchronization file.
[0114] The RAID card log synchronization file updating module 2 is used to update the RAID card log synchronization file according to the RAID card log content according to a preset update cycle.
[0115] The RAID log download control module 3 is configured to download the RAID card log synchronization file in response to obtaining the current RAID card log download command.
[0116] In the module 1 for forming a RAID card log synchronization file in this embodiment, the step of obtaining the RAID card log content of the server and forming a RAID card log synchronization file includes:
[0117] Create an empty synchronous RAID card log file, and set the last line number value to zero in the empty synchronous RAID card log file;
[0118] Setting a log synchronization flag in the synchronous RAID card log empty file, and setting the log synchronization flag to need to be synchronized;
[0119] Get the last line number value of the server's RAID card log;
[0120] Compare the last line number value set in the synchronized RAID card log empty file with the last line number value of the RAID card log to see if they are equal;
[0121] If they are equal, the empty RAID card log file is used as the RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not need to be synchronized;
[0122] If they are not equal, the content of the RAID card log empty file is updated to form a RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not require synchronization.
[0123] In the module 2 for updating the RAID card log synchronization file in this embodiment, the step of updating the RAID card log synchronization file according to the RAID card log content according to the preset update period includes:
[0124] Setting the update period of the RAID card log synchronization file;
[0125] Obtain the last line number value of the RAID card log of the server according to the preset update cycle;
[0126] Get the last line number value in the RAID card log synchronization file;
[0127] Compare the last line number value of the RAID card log with the last line number value of the RAID card log synchronization file to see if they are equal;
[0128] If they are equal, the RAID card log synchronization file is not updated;
[0129] If they are not equal, the difference between the RAID card log synchronization file and the RAID card log is obtained, and the difference is updated to the RAID card log synchronization file.
[0130] In this embodiment, the step of obtaining the difference between the RAID card log synchronization file and the RAID card log synchronization file, and updating the difference to the RAID card log synchronization file includes:
[0131] In response to comparing the last line number value of the RAID card log and the last line number value of the RAID card log synchronization file and finding that they are not equal, modifying the log synchronization flag in the RAID card log synchronization file to require synchronization;
[0132] Obtain the difference line number between the RAID card log synchronization file and the RAID card log;
[0133] Obtaining the difference content of the RAID card log synchronization file to be synchronized from the RAID card log according to the difference line number;
[0134] Updating the difference content to the RAID card log synchronization file;
[0135] The log synchronization flag in the RAID card log synchronization file is modified to not require synchronization.
[0136] In this embodiment, the step of obtaining the difference line numbers between the RAID card log synchronization file and the RAID card log includes:
[0137] Obtain the last line number value of the RAID card log, and the last line number value of the RAID card log synchronization file;
[0138] The difference line number between the RAID card log synchronization file and the RAID card log is calculated by adding one to the last line number of the RAID card log.
[0139] In this embodiment, after the step of updating the difference content to the RAID card log synchronization file and before the step of modifying the log synchronization flag in the RAID card log synchronization file to not requiring synchronization, the method further includes:
[0140] Obtain the last line number value of the RAID card log and the last line number value of the RAID card log synchronization file again;
[0141] Determine whether the line number value of the last line of the RAID card log is equal to the line number value of the last line of the RAID card log synchronization file;
[0142] If they are equal, it is determined that synchronization with the RAID card log synchronization file is completed and the next step is executed;
[0143] If they are not equal, the difference between the RAID card log synchronization file and the RAID card log synchronization file is obtained again, and the difference is updated to the RAID card log synchronization file.
[0144] In the RAID log download control module 3 of this embodiment, the step of downloading the RAID card log synchronization file in response to obtaining the current RAID card log download command includes:
[0145] Obtaining a log synchronization flag in the RAID card log synchronization file;
[0146] In response to the log synchronization flag in the RAID card log synchronization file indicating that synchronization is not required, downloading the RAID card log synchronization file;
[0147] In response to the log synchronization flag in the RAID card log synchronization file indicating that synchronization is required, an alarm message indicating that log collection is in progress is issued.
[0148] In the above-mentioned server RAID card log synchronization downloading device, the log synchronization collection process is pre-placed, and the RAID card log synchronization file is saved in the server. When downloading the RAID card log, only the latest RAID card log synchronization file is downloaded, and there is no need to collect logs, thereby shortening the download time, preventing web page crashes, and improving user experience.
[0149] The specific limitations of the server RAID card log synchronization downloading device can be found in the limitations of the server RAID card log synchronization downloading method described above and will not be repeated here. The various modules in the aforementioned server RAID card log synchronization downloading device can be implemented in whole or in part through software, hardware, or a combination thereof. The aforementioned modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so that the processor can call and execute the corresponding operations of the aforementioned modules.
[0150] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 10As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store server RAID card log synchronous download data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a server RAID card log synchronous download method is implemented.
[0151] Those skilled in the art will understand that Figure 10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0152] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:
[0153] Obtain the server's RAID card log content and generate a RAID card log synchronization file;
[0154] Update the RAID card log synchronization file according to the RAID card log content according to a preset update cycle;
[0155] In response to obtaining the current RAID card log download command, the RAID card log synchronization file is downloaded.
[0156] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0157] The step of obtaining the RAID card log content of the server and forming a RAID card log synchronization file includes:
[0158] Create an empty synchronous RAID card log file, and set the last line number value to zero in the empty synchronous RAID card log file;
[0159] Setting a log synchronization flag in the synchronous RAID card log empty file, and setting the log synchronization flag to need to be synchronized;
[0160] Get the last line number value of the server's RAID card log;
[0161] Compare the last line number value set in the synchronized RAID card log empty file with the last line number value of the RAID card log to see if they are equal;
[0162] If they are equal, the empty RAID card log file is used as the RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not need to be synchronized;
[0163] If they are not equal, the content of the RAID card log empty file is updated to form a RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not require synchronization.
[0164] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0165] The step of updating the RAID card log synchronization file according to the RAID card log content according to a preset update cycle includes:
[0166] Setting the update period of the RAID card log synchronization file;
[0167] Obtain the last line number value of the RAID card log of the server according to the preset update cycle;
[0168] Get the last line number value in the RAID card log synchronization file;
[0169] Compare the last line number value of the RAID card log with the last line number value of the RAID card log synchronization file to see if they are equal;
[0170] If they are equal, the RAID card log synchronization file is not updated;
[0171] If they are not equal, the difference between the RAID card log synchronization file and the RAID card log is obtained, and the difference is updated to the RAID card log synchronization file.
[0172] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0173] The step of obtaining the difference between the RAID card log synchronization file and the RAID card log synchronization file, and updating the difference to the RAID card log synchronization file includes:
[0174] In response to comparing the last line number value of the RAID card log and the last line number value of the RAID card log synchronization file and finding that they are not equal, modifying the log synchronization flag in the RAID card log synchronization file to require synchronization;
[0175] Obtain the difference line number between the RAID card log synchronization file and the RAID card log;
[0176] Obtaining the difference content of the RAID card log synchronization file to be synchronized from the RAID card log according to the difference line number;
[0177] Updating the difference content to the RAID card log synchronization file;
[0178] The log synchronization flag in the RAID card log synchronization file is modified to not require synchronization.
[0179] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0180] The step of obtaining the difference line numbers between the RAID card log synchronization file and the RAID card log includes:
[0181] Obtain the last line number value of the RAID card log, and the last line number value of the RAID card log synchronization file;
[0182] The difference line number between the RAID card log synchronization file and the RAID card log is calculated by adding one to the last line number of the RAID card log.
[0183] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0184] After the step of updating the difference content to the RAID card log synchronization file and before the step of modifying the log synchronization flag in the RAID card log synchronization file to not requiring synchronization, the method further includes:
[0185] Obtain the last line number value of the RAID card log and the last line number value of the RAID card log synchronization file again;
[0186] Determine whether the line number value of the last line of the RAID card log is equal to the line number value of the last line of the RAID card log synchronization file;
[0187] If they are equal, it is determined that synchronization with the RAID card log synchronization file is completed and the next step is executed;
[0188] If they are not equal, the difference between the RAID card log synchronization file and the RAID card log synchronization file is obtained again, and the difference is updated to the RAID card log synchronization file.
[0189] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0190] The step of downloading the RAID card log synchronization file in response to obtaining the current RAID card log download command includes:
[0191] Obtaining a log synchronization flag in the RAID card log synchronization file;
[0192] In response to the log synchronization flag in the RAID card log synchronization file indicating that synchronization is not required, downloading the RAID card log synchronization file;
[0193] In response to the log synchronization flag in the RAID card log synchronization file indicating that synchronization is required, an alarm message indicating that log collection is in progress is issued.
[0194] For specific limitations on the steps implemented when the processor executes the computer program, please refer to the limitations on the method for synchronous downloading of server RAID card logs above, which will not be repeated here.
[0195] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0196] Obtain the server's RAID card log content and generate a RAID card log synchronization file;
[0197] Update the RAID card log synchronization file according to the RAID card log content according to a preset update cycle;
[0198] In response to obtaining the current RAID card log download command, the RAID card log synchronization file is downloaded.
[0199] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0200] The step of obtaining the RAID card log content of the server and forming a RAID card log synchronization file includes:
[0201] Create an empty synchronous RAID card log file, and set the last line number value to zero in the empty synchronous RAID card log file;
[0202] Setting a log synchronization flag in the synchronous RAID card log empty file, and setting the log synchronization flag to need to be synchronized;
[0203] Get the last line number value of the server's RAID card log;
[0204] Compare the last line number value set in the synchronized RAID card log empty file with the last line number value of the RAID card log to see if they are equal;
[0205] If they are equal, the empty RAID card log file is used as the RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not need to be synchronized;
[0206] If they are not equal, the content of the RAID card log empty file is updated to form a RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not require synchronization.
[0207] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0208] The step of updating the RAID card log synchronization file according to the RAID card log content according to a preset update cycle includes:
[0209] Setting the update period of the RAID card log synchronization file;
[0210] Obtain the last line number value of the RAID card log of the server according to the preset update cycle;
[0211] Get the last line number value in the RAID card log synchronization file;
[0212] Compare the last line number value of the RAID card log with the last line number value of the RAID card log synchronization file to see if they are equal;
[0213] If they are equal, the RAID card log synchronization file is not updated;
[0214] If they are not equal, the difference between the RAID card log synchronization file and the RAID card log is obtained, and the difference is updated to the RAID card log synchronization file.
[0215] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0216] The step of obtaining the difference between the RAID card log synchronization file and the RAID card log synchronization file, and updating the difference to the RAID card log synchronization file includes:
[0217] In response to comparing the last line number value of the RAID card log and the last line number value of the RAID card log synchronization file and finding that they are not equal, modifying the log synchronization flag in the RAID card log synchronization file to require synchronization;
[0218] Obtain the difference line number between the RAID card log synchronization file and the RAID card log;
[0219] Obtaining the difference content of the RAID card log synchronization file to be synchronized from the RAID card log according to the difference line number;
[0220] Updating the difference content to the RAID card log synchronization file;
[0221] The log synchronization flag in the RAID card log synchronization file is modified to not require synchronization.
[0222] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0223] The step of obtaining the difference line numbers between the RAID card log synchronization file and the RAID card log includes:
[0224] Obtain the last line number value of the RAID card log, and the last line number value of the RAID card log synchronization file;
[0225] The difference line number between the RAID card log synchronization file and the RAID card log is calculated by adding one to the last line number of the RAID card log.
[0226] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0227] After the step of updating the difference content to the RAID card log synchronization file and before the step of modifying the log synchronization flag in the RAID card log synchronization file to not requiring synchronization, the method further includes:
[0228] Obtain the last line number value of the RAID card log and the last line number value of the RAID card log synchronization file again;
[0229] Determine whether the line number value of the last line of the RAID card log is equal to the line number value of the last line of the RAID card log synchronization file;
[0230] If they are equal, it is determined that synchronization with the RAID card log synchronization file is completed and the next step is executed;
[0231] If they are not equal, the difference between the RAID card log synchronization file and the RAID card log synchronization file is obtained again, and the difference is updated to the RAID card log synchronization file.
[0232] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0233] The step of downloading the RAID card log synchronization file in response to obtaining the current RAID card log download command includes:
[0234] Obtaining a log synchronization flag in the RAID card log synchronization file;
[0235] In response to the log synchronization flag in the RAID card log synchronization file indicating that synchronization is not required, downloading the RAID card log synchronization file;
[0236] In response to the log synchronization flag in the RAID card log synchronization file indicating that synchronization is required, an alarm message indicating that log collection is in progress is issued.
[0237] For specific limitations on the steps implemented when the computer program is executed by the processor, please refer to the above limitations on the method for synchronously downloading server RAID card logs, which will not be repeated here.
[0238] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0239] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0240] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A server RAID card log synchronization download method, characterized in that: include: Obtain the server's RAID card log content and generate a RAID card log synchronization file; Update the RAID card log synchronization file according to the RAID card log content according to a preset update cycle; In response to obtaining the current RAID card log download command, downloading the RAID card log synchronization file; The step of obtaining the RAID card log content of the server and forming a RAID card log synchronization file includes: Create an empty synchronous RAID card log file, and set the last line number value to zero in the empty synchronous RAID card log file; Setting a log synchronization flag in the synchronous RAID card log empty file, and setting the log synchronization flag to need to be synchronized; Get the last line number value of the server's RAID card log; Compare the last line number value set in the synchronized RAID card log empty file with the last line number value of the RAID card log to see if they are equal; If they are equal, the empty RAID card log file is used as the RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not need to be synchronized; If they are not equal, the content of the RAID card log empty file is updated to form a RAID card log synchronization file, and the log synchronization flag in the RAID card log synchronization file is modified to not require synchronization.
2. The server RAID card log synchronous downloading method according to claim 1, characterized in that: The step of updating the RAID card log synchronization file according to the RAID card log content according to a preset update cycle includes: Setting the update period of the RAID card log synchronization file; Obtain the last line number value of the RAID card log of the server according to the preset update cycle; Get the last line number value in the RAID card log synchronization file; Compare the last line number value of the RAID card log with the last line number value of the RAID card log synchronization file to see if they are equal; If they are equal, the RAID card log synchronization file is not updated; If they are not equal, the difference between the RAID card log synchronization file and the RAID card log is obtained, and the difference is updated to the RAID card log synchronization file.
3. The server RAID card log synchronization downloading method according to claim 2, characterized in that: The step of obtaining the difference between the RAID card log synchronization file and the RAID card log synchronization file, and updating the difference to the RAID card log synchronization file includes: In response to comparing the last line number value of the RAID card log and the last line number value of the RAID card log synchronization file and finding that they are not equal, modifying the log synchronization flag in the RAID card log synchronization file to require synchronization; Obtain the difference line number between the RAID card log synchronization file and the RAID card log; Obtaining the difference content of the RAID card log synchronization file to be synchronized from the RAID card log according to the difference line number; Updating the difference content to the RAID card log synchronization file; The log synchronization flag in the RAID card log synchronization file is modified to not require synchronization.
4. The method for synchronously downloading server RAID card logs according to claim 3, characterized in that: The step of obtaining the difference line numbers between the RAID card log synchronization file and the RAID card log includes: Obtain the last line number value of the RAID card log, and the last line number value of the RAID card log synchronization file; The difference line number between the RAID card log synchronization file and the RAID card log is calculated by adding one to the last line number of the RAID card log.
5. The method for synchronously downloading server RAID card logs according to claim 3, characterized in that: After the step of updating the difference content to the RAID card log synchronization file and before the step of modifying the log synchronization flag in the RAID card log synchronization file to not requiring synchronization, the method further includes: Obtain the last line number value of the RAID card log and the last line number value of the RAID card log synchronization file again; Determine whether the line number value of the last line of the RAID card log is equal to the line number value of the last line of the RAID card log synchronization file; If they are equal, it is determined that synchronization with the RAID card log synchronization file is completed and the next step is executed; If they are not equal, the difference between the RAID card log synchronization file and the RAID card log synchronization file is obtained again, and the difference is updated to the RAID card log synchronization file.
6. The method for synchronously downloading server RAID card logs according to claim 1, characterized in that: The step of downloading the RAID card log synchronization file in response to obtaining the current RAID card log download command includes: Obtaining a log synchronization flag in the RAID card log synchronization file; In response to the log synchronization flag in the RAID card log synchronization file indicating that synchronization is not required, downloading the RAID card log synchronization file; In response to the log synchronization flag in the RAID card log synchronization file indicating that synchronization is required, an alarm message indicating that log collection is in progress is issued.
7. A server RAID card log synchronization download device, characterized in that: The device comprises: A RAID card log synchronization file module is formed, which is used to obtain the RAID card log content of the server and form a RAID card log synchronization file, including: creating a synchronized RAID card log empty file, setting the last line number value to zero in the synchronized RAID card log empty file; setting a log synchronization flag in the synchronized RAID card log empty file, and setting the log synchronization flag to need to be synchronized; obtaining the last line number value of the server's RAID card log; comparing the last line number value set in the synchronized RAID card log empty file with the last line number value of the RAID card log to see whether they are equal; if they are equal, using the RAID card log empty file as the RAID card log synchronization file, and modifying the log synchronization flag in the RAID card log synchronization file to not need to be synchronized; if they are not equal, updating the RAID card log empty file content to form a RAID card log synchronization file, and modifying the log synchronization flag in the RAID card log synchronization file to not need to be synchronized; A RAID card log synchronization file update module is used to update the RAID card log synchronization file according to the RAID card log content according to a preset update cycle; The RAID log download control module is configured to download the RAID card log synchronization file in response to obtaining a current RAID card log download command.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
RAID card management method, apparatus and device
CN108459932A