A server in-band acquisition software batch installation method, device and medium
By using the WebSocket protocol and thread pool technology, the installation progress of the server-side data acquisition software is monitored and fed back in real time, solving the problems of low installation efficiency and poor user experience, and achieving an efficient installation process and good user interaction.
Patent Information
- Application Number
- CN202210878563.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-07-25
AI Technical Summary
In existing technologies, the installation efficiency of server-based data acquisition software is low, and users cannot obtain real-time information about the installation progress, which affects the user experience.
A data transmission channel between the front-end and back-end is established through the WebSocket protocol. The installation of the data collection software is carried out using a thread pool, and the installation progress is fed back to the front-end in real time. Thread execution time monitoring and blocking queue management are used to optimize the installation process.
It improves the installation efficiency of the data acquisition software, allows users to view the installation progress in real time, enhances the user experience, and adapts to the management needs of large-scale data centers.
Smart Images

Figure CN115145606B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of data monitoring, in particular to a server in-band acquisition software batch installation method and device and medium. BACKGROUND
[0002] With the development of cloud computing and big data, the scale of data centers is expanding, and the number of servers is increasing. Monitoring and managing these servers often requires batch installation of in-band acquisition software on these servers. Manual installation and deployment of acquisition software is too inefficient and does not meet the needs of practical applications. Therefore, thread pool is usually used to install acquisition software.
[0003] Thread pool is a form of multi-thread processing, which can handle multiple different tasks in parallel through multiple threads to improve the installation efficiency of acquisition software. In the processing process, the thread pool adds tasks to the queue and automatically starts these tasks after creating threads. Thread pool threads are background threads, so the front-end user cannot know the installation progress of the acquisition software, affecting the user experience.
[0004] Therefore, there is an urgent need for a server in-band acquisition software batch installation method to solve the problem that the front-end cannot perceive the installation progress of the acquisition software, thereby affecting the user experience. SUMMARY
[0005] The purpose of the application is to provide a server in-band acquisition software batch installation method, device and medium to solve the problem that the front-end cannot perceive the installation progress of the acquisition software, thereby affecting the user experience.
[0006] To solve the above technical problems, the application provides a server in-band acquisition software batch installation method, which comprises:
[0007] Establish a data transmission channel with the front end based on the WebSocket protocol;
[0008] Receive a server ID list sent by the front end;
[0009] According to the server ID list, a corresponding number of threads are established and submitted to the thread pool for execution; wherein the thread is used to implement the installation of the acquisition software when executed;
[0010] Real-time acquisition of the installation progress of each thread and return to the front end through the data transmission channel.
[0011] Preferably, it further comprises:
[0012] The execution time of each thread is timed respectively, and when the execution time of the thread exceeds a preset time threshold, the execution of the thread is terminated.
[0013] Preferably, the execution time of each thread is timed respectively, and when the execution time of the thread exceeds a preset time threshold, the execution of the thread is terminated, including:
[0014] When each thread starts to execute, the start time is recorded, and the threads are sequentially put into the blocking queue according to a preset order;
[0015] The blocking queue is polled, and the difference between the current time and the start time of the current thread is compared with the time threshold to determine whether the current thread is timed out;
[0016] If the thread is timed out, the execution of the thread is terminated, and the thread is released from the blocking queue;
[0017] If the thread is not timed out, the thread is inserted into the tail of the blocking queue to continue polling.
[0018] Preferably, after the execution of the thread is terminated, it further includes:
[0019] The timeout information is returned to the front end, and the installation result is determined as installation failure.
[0020] Preferably, it further includes:
[0021] When the thread is executed and the installation of the acquisition software is implemented, the installation result is determined as installation success;
[0022] The installation result is saved in a storage medium.
[0023] Preferably, the thread pool is a thread priority thread pool.
[0024] Preferably, a corresponding number of threads are established according to the server ID list, and the threads are submitted to the thread pool for execution, including:
[0025] After all the threads are established, the threads are submitted to the thread pool for execution.
[0026] To solve the above technical problems, the application also provides a server in-band acquisition software batch installation device, including:
[0027] The channel establishment module is configured to establish a data transmission channel with the front end based on the WebSocket protocol;
[0028] The information receiving module is configured to receive a server ID list sent by the front end;
[0029] The software installation module is configured to establish a corresponding number of threads according to the server ID list and submit the threads to the thread pool for execution; when the threads are executed, the software installation is implemented.
[0030] The progress feedback module is configured to acquire the installation progress of each thread in real time and return to the front end through the data transmission channel.
[0031] Preferably, the method further comprises:
[0032] The timeout monitoring module is configured to time the execution time of each thread respectively, and terminate the execution of the thread when the execution time of the thread exceeds a preset time threshold.
[0033] The timeout prompt module is configured to return timeout information to the front end and determine that the installation result is installation failure.
[0034] The result storage module is configured to determine that the installation result is installation success when the thread is executed and the installation of the collection software is implemented, and save the installation result in the storage medium.
[0035] To solve the above technical problems, the application further provides a server in-band collection software batch installation device, comprising:
[0036] The storage is configured to store the computer program.
[0037] The processor is configured to implement the steps of the server in-band collection software batch installation method when executing the computer program.
[0038] To solve the above technical problems, the application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the server in-band collection software batch installation method.
[0039] The server in-band collection software batch installation method provided by the application establishes a data transmission channel with the front end through the WebSocket protocol, so as to realize the persistent communication connection between the background and the front end, and then the background can feed back the installation progress to the front end for the user to view, so as to meet the user's demand for knowing the real-time installation progress of the collection software of each server and further improve the user's use experience. At the same time, the installation of the collection software is realized through threads, without manual installation, and the installation efficiency of the collection software is considered.
[0040] The server in-band collection software batch installation device and the computer readable storage medium provided by the application correspond to the above method and have the same effect. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings described in the following embodiments are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort.
[0042] Figure 1 The flow chart of the server in-band acquisition software batch installation method provided by the present application is shown in Figure 1.
[0043] Figure 2 The flow chart of another server in-band acquisition software batch installation method provided by the present application is shown in Figure 2.
[0044] Figure 3 The structural diagram of an application example of the server in-band acquisition software batch installation method provided by the present application is shown in Figure 3.
[0045] Figure 4 The structural diagram of a server in-band acquisition software batch installation device provided by the present application is shown in Figure 4.
[0046] Figure 5 The structural diagram of another server in-band acquisition software batch installation device provided by the present application is shown in Figure 5. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without any creative effort are within the protection scope of the present application.
[0048] The core of the present application is to provide a server in-band acquisition software batch installation method, device and medium.
[0049] In order to make the personnel in the technical field better understand the present application, the present application will be further described in detail with reference to the drawings and specific embodiments.
[0050] For such a large data center nowadays, when monitoring and managing the data in the server, it is often necessary to install the in-band collection software in batches on these servers, and then collect and monitor the data of the servers through the installed collection software. At present, the installation and deployment of the collection software is mostly in the form of manual or through threads in the form of pure background tasks. These two methods have the problems of low installation efficiency and the user cannot know the execution progress and results of the server currently executing the software installation in real time, affecting the user experience. Manual installation of collection software can help the operator know the progress of the installation, but since the number of servers in the data center is large, and the manual installation of collection software for each server is a tedious and time-consuming process, the efficiency is low. Replacing manual installation with thread pool and other methods cannot make the user aware of the installation progress of the collection software, and the user experience cannot be well guaranteed.
[0051] To solve the above problem that the current collection software installation method cannot balance efficiency and user experience, as shown in Figure 1 The application provides a server in-band collection software batch installation method, which comprises:
[0052] S11: Establish a data transmission channel with the front end based on the WebSocket protocol.
[0053] WebSocket is a communication protocol, and the connection established by WebSocket allows full-duplex communication between the client and the server, so that either party can push data to the other end through the established connection. Moreover, WebSocket only needs to establish a connection once, and can always keep the connection state, which greatly improves the communication efficiency compared with the polling method of establishing a connection for data communication.
[0054] In addition, it should be noted that since the user is not necessarily unique and the server is not necessarily unique during the installation of the collection software, the data transmission channel established based on the WebSocket protocol is not necessarily unique. In this application scenario, based on the WebSocket protocol, each data transmission channel holds a WebSocket session identifier, Session and the current user identifier.
[0055] The WebSocket session identifier represents the correspondence between the current data transmission channel and a specific WebSocket session, which is the persistent connection maintained between the front-end and the back-end. The Session acts as an identifier, controlling the sending and receiving of data through the data transmission channel; only the party holding the Session can send data to the other end within this channel. The user identifier represents the user corresponding to the current data transmission channel. Specifically, it can represent a specific user operating on the same front-end device, or specify a particular front-end device among different front-end devices. These three identifiers enable the data transmission channel established by this method to be applied in multi-user scenarios.
[0056] S12: Receive the list of server IDs sent by the front end.
[0057] The server ID list mentioned above is a collection of identity documents (IDs) of each server that the user needs to install the data collection software for, selected according to actual requirements. Based on the server ID list, the thread can find the correct server and execute the installation during the subsequent data collection software installation process.
[0058] S13: Create the appropriate number of threads based on the list of server IDs, and submit the threads to the thread pool for execution.
[0059] When a thread is executed, it is used to install the data acquisition software.
[0060] Considering that in practical applications, the installation of data collection software on servers via threads is usually performed one-to-one, the number of servers requiring software installation can be determined based on the server ID list, allowing for the creation of the corresponding number of threads. These threads are then submitted to a thread pool for execution of the software installation process.
[0061] In addition, to achieve efficient and rapid installation of the acquisition software, this embodiment also provides a preferred implementation scheme: the thread pool established above is a thread-first thread pool.
[0062] S14: Obtain the installation progress of each thread in real time and return it to the front end through the data transmission channel.
[0063] It should be noted that the installation progress reflected above includes not only the installation of the data acquisition software, but also processes such as data verification and communication verification. Specifically, a possible implementation scheme for the installation process of the data acquisition software is shown below:
[0064] a, parameter preparation detection: after obtaining the server ID list, obtain the device information of the server according to each server ID in the list, the device information includes device model, manufacturer, serial number, in-band operating system Internet Protocol (IP), SSH protocol information, etc., and verify whether the IP and Secure Shell (SSH) information are missing; if missing, terminate execution, and report installation failure, the prompt information is parameter missing, otherwise report the current execution progress, prompt parameter preparation success and execute the next step.
[0065] b, execution state detection: check whether the server currently being installed has been installed or is in the installation state, if yes, terminate execution, otherwise report the current execution progress, prompt state detection through and execute the next step.
[0066] c, execution device and SSH protocol connectivity detection: detect whether the in-band IP and SSH protocol of the server currently being installed can normally establish a connection, if one of them fails, terminate execution, report installation failure, and the prompt information is connectivity check failure, otherwise report the current execution progress, prompt device and SSH protocol connectivity check through and execute the next step.
[0067] d, execution device information matching detection: obtain the server device manufacturer, model, serial number information through in-band IP and SSH protocol, and compare with the device information obtained in the above parameter preparation step. If they are inconsistent, terminate execution, report installation failure to the receiver, and the prompt information is device information mismatch, otherwise report the current execution progress, prompt device information matching check through and execute the next step.
[0068] e, execution operating system recognition detection: obtain the server in-band operating system type through in-band IP and SSH protocol. If the acquisition fails, terminate execution, report installation failure to the receiver, and the prompt information is operating system type acquisition failure, otherwise report the current execution progress, prompt operating system type and execute the next step;
[0069] f, execution installation package and installation script upload detection. Based on the operating system type obtained in the last step, use in-band IP and SSH protocol to upload the installation package and installation script of the corresponding operating system to the corresponding server, if it fails, terminate execution, report installation failure to the receiver, and the prompt information is installation package and installation script upload failure, otherwise report the current execution progress, prompt installation package and installation script upload success and execute the next step.
[0070] g, software installation detection. Execute the installation script remotely through in-band IP and SSH protocol. If the execution fails, report installation failure, and the prompt information is installation execution failure, otherwise report installation completion, and prompt installation success.
[0071] The above-mentioned preferred solution clearly and explicitly divides the installation process into multiple different stages, providing a feasible implementation method for dividing the installation progress. This facilitates returning the installation progress to the front end for users to view, which is more conducive to improving the user's experimental experience while ensuring the installation efficiency of the data acquisition software.
[0072] This application provides a method for batch installation of in-band data acquisition software on a server. It utilizes threads in a thread pool to automate the installation process, replacing the traditional manual installation method and improving efficiency. Furthermore, it establishes a data transmission channel based on the WebSocket protocol, enabling a continuous connection between the front-end and back-end. The back-end can transmit installation progress back to the front-end in real time via this channel, allowing users to monitor the process at any time. While ensuring efficient installation, this method also meets users' needs for real-time progress tracking, optimizing the user experience and making the physical infrastructure management platform more adaptable to practical needs, thus further enhancing its competitiveness.
[0073] Considering that in practical applications, the maximum number of threads supported by a thread pool may not be sufficient to install all data collection software simultaneously, a queue can be set up during installation to store installation tasks not yet assigned to threads. Once a thread finishes execution and releases its resources, the task is retrieved from the queue and assigned to the appropriate thread, thus efficiently completing the installation of the data collection software on the server. Therefore, the smoothness of thread flow is crucial for the data collection software installation process; if threads are blocked for extended periods, it will significantly impact the installation efficiency.
[0074] Based on this, this embodiment provides a preferred implementation scheme, and the above method further includes:
[0075] The execution time of each thread is timed separately, and the thread is terminated when its execution time exceeds a preset time threshold.
[0076] To monitor all threads in the thread pool that are currently executing, multiple threads can be monitored in parallel. When the execution time of a thread that has completed the installation of the data collection software exceeds a preset time threshold, the thread's execution is stopped, and the corresponding resources are released to allow subsequent installation tasks to proceed, thus improving the efficiency of the data collection software installation.
[0077] This embodiment times the execution time of each thread and compares it with a preset time threshold to determine whether the execution time of each thread has timed out or whether blocking has occurred. If a timeout occurs, the thread is released to free up runtime resources for subsequent data acquisition software installation tasks, thus improving installation efficiency.
[0078] However, it is too wasteful to detect the execution time of the thread performing the installation task in parallel through multiple threads, and this part of the running resources can be used to improve the installation efficiency and speed of the installation of the collection software, and is more suitable for the actual needs of users.
[0079] Therefore, based on the above embodiment, the present embodiment further provides a preferred embodiment, as shown in Figure 2 The execution time of each thread is timed, and when the execution time of the thread exceeds the preset time threshold, the execution thread is terminated, specifically:
[0080] S21: When each thread starts to execute, record the start time, and put the threads into the blocking queue in turn according to the preset order.
[0081] Generally, the above-mentioned preset order is the time order, so the threads can be put into the blocking queue in turn according to the order of the start time to complete the subsequent steps of monitoring the execution time.
[0082] It should be noted that the above-mentioned blocking queue is a first-in first-out queue, the thread put into the blocking queue first comes out, that is, the thread can only be taken out from the head of the queue, and the thread can only be put in from the tail of the queue, so as to realize the effect of polling the threads put into the blocking queue in turn according to a certain order.
[0083] But in a possible implementation, in order to facilitate the statistics of the start execution time of each thread, the present embodiment provides a preferred embodiment, and the above-mentioned establishing a corresponding number of threads according to the server ID list and submitting the threads to the thread pool for execution is specifically:
[0084] After all the threads are established, the threads are submitted to the thread pool for execution.
[0085] As can be seen from the above embodiment, the threads need to be submitted to the thread pool for execution after being established, so the time when the threads are submitted to the thread pool can be approximately considered as the start time of the execution of the threads. Through the above-mentioned preferred embodiment, all the threads are submitted to the thread pool at the same time to obtain the same execution time, and in the monitoring of the execution time of the threads, it is not necessary to obtain and store the start time of each thread for subsequent comparison, but only one start time is needed, and it is not necessary to retrieve the corresponding start time from the storage medium for comparison, which simplifies the monitoring process and improves the installation efficiency of the collection software.
[0086] In the application scenario corresponding to the above-mentioned embodiment, the start time of each thread is the same, so the above-mentioned preset order can be the order in which the threads are established, and for the sake of simplifying the steps, a thread can be put into the above-mentioned blocking queue for monitoring as soon as it is established.
[0087] S22: Poll the blocking queue and compare the difference between the current time and the start time of the current thread with the time threshold to determine whether the current thread is timed out, if yes, go to step S23, if not, go to step S24.
[0088] As known from the above, the blocking queue is a first-in first-out queue, and the thread at the head of the queue is taken out to determine whether the difference between the start time and the current time exceeds the preset time threshold, so as to determine whether the current thread is timed out.
[0089] It is easy to understand that the physical infrastructure management platform like the one implementing the above installation process of the collection task usually has its own system time, which is usually determined by the local time as the unified time of all programs or threads running in the platform, so the above current time is the background current system time. Similarly, the determination of the start time also needs to be determined based on the same reference time, that is, determined based on the system time.
[0090] In addition, it also needs to be pointed out that before determining whether the execution time of the thread is timed out, it is necessary to determine whether the current thread is executed, if executed, it is not necessary to determine whether it is timed out, and it is released from the blocking queue for the subsequent execution of the installation task.
[0091] S23: Terminate the execution of the thread and release the thread from the blocking queue.
[0092] S24: Insert the thread into the tail of the blocking queue to continue polling.
[0093] When the execution time of the thread exceeds the preset time threshold, it means that the execution time of the current thread is too long, which may cause congestion due to failure, in order to release the running resources for the execution of other installation tasks, the thread execution is terminated and the thread is released, which can support the execution of other installation tasks by establishing another thread. Therefore, the thread in the blocking queue is also released accordingly.
[0094] For the case where the execution time of the thread is not timed out, subsequent monitoring is still needed, and due to the first-in first-out characteristic of the blocking queue, the thread is inserted into the tail of the blocking queue, and the polling is completed in this order to monitor all threads.
[0095] The embodiment realizes the polling monitoring of multiple threads through a blocking queue, and only one thread is executed at the same time to compare the execution time and the preset time threshold, so that only one monitoring process can realize the effect of timeout monitoring of multiple threads for executing installation tasks, which not only ensures the timeout monitoring of all threads, but also saves running resources. Only one monitoring thread can realize further saving of running resources, and the saved running resources can be used in the threads for executing installation tasks to further improve the installation efficiency of the collection software.
[0096] From the above embodiment, it can be seen that in the installation process of the collection software, there is a detection of the execution state of the server, which needs to judge whether the current server has installed the collection software according to the historical installation result, so as to avoid repeated installation. Therefore, the embodiment provides an optimal solution about the historical installation result, and the above method further includes:
[0097] returning the timeout information to the front end and determining that the installation result is installation failure.
[0098] In addition to the embodiment of the installation result being installation failure in the embodiment, the embodiment also includes the implementation mode of determining that the installation result is installation failure when each detection in the above installation process fails.
[0099] Similarly, the embodiment also provides another embodiment about the historical result, and the above method further includes:
[0100] when the thread is executed and the installation of the collection software is realized, determining that the installation result is installation success;
[0101] saving the installation result in the storage medium.
[0102] The embodiment provides a determination mode for the success and failure of the installation result, and stores the installation result in the storage medium as the historical installation result for the user to query at any time. In a specific application scenario, the installation result can be used as a way to obtain the installation state for the platform to determine whether the current server has installed the collection software, so as to avoid the waste of resources and the reduction of efficiency caused by repeated installation.
[0103] To further illustrate the server in-band collection software batch installation method provided in the present application, the following will be described from the perspective of specific implementation:
[0104] The above method can be realized by the device as shown in Figure 3 , which includes a device manager 31, an executor 32, a receiver 33 and a monitor 34.
[0105] The device manager 31 is connected with the executor 32 and the receiver 33, and is used for:
[0106] 1) Receive user input instructions, filter the server list that needs to perform in-band collection software installation and deployment, and send the server ID list to the executor 32.
[0107] 2) Open a WebSocket session to establish a data transmission channel, and register the corresponding data transmission channel in the receiver 33, wait for the receiver 33 to push the installation progress data of the corresponding server software to the data transmission channel, and return to the front end to display to the user.
[0108] The executor 32 is connected with the receiver 33 and the monitor 34, which is used for:
[0109] 1) According to the server ID list issued by the device manager 31, a corresponding number of threads are established and submitted to the built-in thread pool to execute the installation of the collection software.
[0110] 2) The established thread is submitted to the blocking queue of the monitor 34 for monitoring and judging whether the execution time is overdue, and taking corresponding operations such as releasing the thread and inserting the thread into the tail of the queue.
[0111] 3) Realize parameter preparation, execution state detection, execution device and SSH protocol connectivity detection, execution device information matching detection, execution operating system identification detection, execution installation package and installation script upload detection, execution software installation detection, etc.
[0112] The receiver 33 is used for:
[0113] 1) Store the real-time installation progress information of each server reported by the executor 32 in the built-in blocking queue, and return the real-time installation progress information to the corresponding user or front end through the corresponding data transmission channel according to the server ID.
[0114] 2) If the real-time installation progress information is the final execution result of a certain server, that is, installation success or installation failure, it is reported to the device manager 31 for storage as a historical record for subsequent user query and review.
[0115] The monitor 34 is used for:
[0116] 1) Take out the thread from the blocking queue, judge whether the current thread is executed, if not, proceed to the next step of timeout judgment, if completed, release the corresponding thread.
[0117] 2) Calculate the execution time of the thread, which is the current time minus the start time of the thread body execution. When the execution time is greater than the preset time threshold, the thread is notified to terminate execution, and the installation failure and execution timeout prompt are reported. If it is not overdue, the thread is inserted into the tail of the blocking queue to continue polling.
[0118] The above-mentioned devices and their corresponding connection relationship, data transmission relationship are as shown in Figure 3 The specific content has been clearly and detailed described in the above-mentioned embodiments, and thus will not be repeated here.
[0119] In the above-mentioned embodiments, a server in-band acquisition software batch installation method is described in detail, and the present application also provides a corresponding embodiment of a server in-band acquisition software batch installation device. It should be noted that the embodiments of the device part are described from two angles, one is based on the functional module angle, and the other is based on the hardware angle.
[0120] Based on the functional module angle, as shown in Figure 4 The present embodiment provides a server in-band acquisition software batch installation device, which comprises:
[0121] The channel establishment module 41 is configured to establish a data transmission channel with the front end based on the WebSocket protocol;
[0122] The information receiving module 42 is configured to receive a server ID list sent by the front end;
[0123] The software installation module 43 is configured to establish a corresponding number of threads according to the server ID list, and submit the threads to the thread pool for execution; wherein the thread, when executed, is configured to implement the installation of the acquisition software;
[0124] The progress feedback module 44 is configured to obtain the installation progress of each thread in real time, and return to the front end through the data transmission channel.
[0125] Preferably, it further comprises:
[0126] The timeout monitoring module is configured to time the execution time of each thread respectively, and terminate the execution thread when the execution time of the thread exceeds the preset time threshold.
[0127] The timeout prompt module is configured to return the timeout information to the front end and determine the installation result as installation failure.
[0128] The result storage module is configured to determine the installation result as installation success when the thread execution is completed and the installation of the acquisition software is implemented; and save the installation result in the storage medium.
[0129] Since the embodiments of the device part correspond to the embodiments of the method part, the embodiments of the device part are described in the description of the embodiments of the method part, which will not be described here.
[0130] The server in-band acquisition software batch installation device provided by the embodiment can improve the installation efficiency by automatically installing the acquisition software through the threads in the thread pool instead of the traditional manual installation mode. In addition, the data transmission channel is established based on the WebSocket protocol through the channel establishment module to realize the persistent connection between the front end and the background. The background can return the installation progress to the front end through the data transmission channel through the progress feedback module in real time, so that the user can check at any time. While ensuring the installation efficiency of the acquisition software, the needs of the user to check the installation progress in real time are met, the user experience is optimized, the physical infrastructure management platform is more suitable for actual needs, and the competitiveness is further improved.
[0131] Figure 5 The structure diagram of the server in-band acquisition software batch installation device provided by another embodiment of the application is shown in FIG. 1. The server in-band acquisition software batch installation device includes a memory 50 for storing a computer program. Figure 5
[0132] The processor 51 is configured to execute the computer program to implement the steps of the server in-band acquisition software batch installation method.
[0133] The server in-band acquisition software batch installation device provided by the embodiment can include but is not limited to a smart phone, a tablet computer, a notebook computer, or a desktop computer, etc.
[0134] The processor 51 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 51 can be implemented in at least one of a hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 51 can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 51 can be integrated with a graphics processor (GPU) for rendering and drawing the content to be displayed by the display screen. In some embodiments, the processor 51 can also include an artificial intelligence (AI) processor for processing machine learning-related computing operations.
[0135] The memory 50 can include one or more computer-readable storage media. The memory 50 can also include high-speed random access memory and non-volatile, computer-readable storage media such as one or more magnetic disk storage devices, flash memory devices. In this embodiment, the memory 50 is used to store at least the following computer program 501, wherein the computer program is loaded and executed by the processor 51 and can realize the related steps of the server in-band acquisition software batch installation method disclosed in any of the preceding embodiments. In addition, the resources stored in the memory 50 can also include an operating system 502 and data 503, etc., and the storage mode can be temporary storage or permanent storage. The operating system 502 can include Windows, Unix, Linux, etc. The data 503 can include but is not limited to a server in-band acquisition software batch installation method, etc.
[0136] In some embodiments, a server in-band acquisition software batch installation device can also include a display screen 52, an input / output interface 53, a communication interface 54, a power supply 55, and a communication bus 56.
[0137] Those skilled in the art can understand that the structure shown in the above embodiments does not constitute a limitation on the server in-band acquisition software batch installation device, and can include more or fewer components than those shown in the figure. Figure 5 The structure shown in the above embodiments does not constitute a limitation on the server in-band acquisition software batch installation device, and can include more or fewer components than those shown in the figure.
[0138] The server in-band acquisition software batch installation device provided in the embodiments of the present application includes a memory and a processor. When the processor executes the program stored in the memory, the following method can be realized: a server in-band acquisition software batch installation method.
[0139] The server in-band acquisition software batch installation device provided in the embodiments of the present application realizes automatic installation of acquisition software by threads in a thread pool through the processor executing the computer program saved in the memory, replaces the traditional manual installation method, and improves the installation efficiency. In addition, a data transmission channel is established based on the WebSocket protocol to realize persistent connection between the front end and the background. The background can return the installation progress to the front end through the data transmission channel in real time, so that the user can check at any time. While ensuring the installation efficiency of the acquisition software, the needs of the user to check the installation progress in real time are met, the user's use experience is optimized, the physical infrastructure management platform is more suitable for actual needs, and the competitiveness is further improved.
[0140] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and the computer program is executed by the processor to realize the steps recorded in the above method embodiment.
[0141] It can be understood that if the method in the above embodiment is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and performs all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0142] The computer readable storage medium provided in the embodiment stores a computer program which, when executed, can realize automatic installation of the collection software by threads in the thread pool, instead of the traditional manual installation method, thereby improving the installation efficiency. In addition, a data transmission channel is established based on the WebSocket protocol to realize persistent connection between the front end and the background. The background can return the installation progress to the front end through the data transmission channel in real time, so that the user can check at any time. While ensuring the installation efficiency of the collection software, the needs of the user to check the installation progress in real time are met, the user experience is optimized, the physical infrastructure management platform is more suitable for actual needs, and the competitiveness is further improved.
[0143] The above describes in detail the server in-band collection software batch installation method, device and medium provided by the present application. The embodiments in the specification are described in a progressive manner, and each embodiment mainly describes the differences from other embodiments. The same or similar parts of each embodiment can be referred to. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part. It should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the protection scope of the claims of the present application.
[0144] It also needs to be explained that in the present specification, the relational terms such as first and second and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
Claims
1. A method for installing a software batch in a server in-band acquisition, characterized in that, Comprise: establish a data transmission channel with the front end based on the WebSocket protocol; receive a server ID list sent by the front end; establish a corresponding number of threads according to the server ID list, and submit the threads to the thread pool for execution; wherein the thread, when executed, is used to realize the installation of the collection software; real-time acquisition of the installation progress of each thread, and return to the front end through the data transmission channel; wherein the installation progress comprises: parameter preparation detection phase: according to each server ID in the server ID list, obtain the device information of the corresponding server; execution state detection phase: check whether the server currently being installed has been installed or is in the installation state; execution device and SSH protocol connectivity detection phase: detect whether the in-band IP and SSH protocol of the server currently being installed can normally establish a connection; execution device information matching detection phase: obtain the device manufacturer, model and serial number information of the server through the in-band IP and SSH protocol, and compare with the corresponding device information; execution operating system identification detection phase: obtain the in-band operating system type of the server through the in-band IP and SSH protocol; execution installation package and installation script upload detection phase: based on the in-band operating system type, upload the installation package and installation script of the corresponding operating system to the corresponding server through the in-band IP and SSH protocol; execution software installation detection phase: execute the installation script remotely through the in-band IP and SSH protocol.
2. The server in-band acquisition software bulk installation method of claim 1, wherein, Also include: respectively timing the execution time of each thread, and when the execution time of the thread exceeds a preset time threshold, terminating the execution of the thread.
3. The method of claim 2, wherein the server in-band acquisition software bulk installation method is characterized by, respectively timing the execution time of each thread, and when the execution time of the thread exceeds a preset time threshold, terminating the execution of the thread includes: when each thread starts to execute, record the start time, and put the thread into the blocking queue according to a preset order; poll the blocking queue and compare the difference between the current time and the start time of the current thread with the time threshold to determine whether the current thread is overdue; if the thread is overdue, terminate the execution of the thread and release the thread from the blocking queue; if the thread is not overdue, insert the thread into the tail of the blocking queue to continue polling.
4. The method of claim 2 or 3, wherein the server in-band acquisition software bulk installation method is characterized by, After terminating the execution of the thread, it also includes: return the timeout information to the front end and determine that the installation result is installation failure.
5. The method of claim 4, wherein the server in-band acquisition software bulk installation method is characterized by, Also include: when the thread is executed and the installation of the collection software is realized, determine that the installation result is installation success; save the installation result in the storage medium.
6. The method of claim 1, wherein the server in-band acquisition software bulk installation method is characterized by, The thread pool is a thread priority thread pool.
7. The method of claim 3, wherein the server in-band acquisition software bulk installation method is characterized by, establishing a corresponding number of threads according to the server ID list, and submitting the threads to the thread pool for execution includes: after all the threads are established, submit the threads to the thread pool for execution together.
8. A batch installation device for server-side in-band data acquisition software, characterized in that, Comprise: channel establishment module, for establishing a data transmission channel with the front end based on the WebSocket protocol; An information receiving module is configured to receive a server ID list sent by the front end; A software installing module is configured to establish a corresponding number of threads according to the server ID list and submit the threads to a thread pool for execution; when the threads are executed, the threads are configured to implement installation of the collection software; A progress feedback module is configured to obtain installation progress of each thread in real time and return to the front end through the data transmission channel; The installation progress includes: A parameter preparation detection stage: obtaining device information of a corresponding server according to each server ID in the server ID list; An execution state detection stage: checking whether a server currently being installed has been installed or is in an installation state; An execution device and SSH protocol connectivity detection stage: detecting whether an in-band IP and an SSH protocol of the server currently being installed can normally establish a connection; An execution device information matching detection stage: obtaining device manufacturer, model, and serial number information of the server through the in-band IP and the SSH protocol and comparing the information with corresponding device information; An execution operating system identification detection stage: obtaining an in-band operating system type of the server through the in-band IP and the SSH protocol; An execution installation package and installation script uploading detection stage: uploading an installation package and an installation script of a corresponding operating system to the corresponding server through the in-band IP and the SSH protocol based on the in-band operating system type; An execution software installation detection stage: remotely executing the installation script through the in-band IP and the SSH protocol.
9. A batch installation device for server-side in-band data acquisition software, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the server in-band collection software batch installation method in any one of claims 1 to 7. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the server in-band collection software batch installation method in any one of claims 1 to 7. 10. A computer-readable storage medium, characterized in that,
Citation Information
Patent Citations
Cloud mobile phone batch initialization method and system
CN109257211A