Management method and device for redirecting serial port to network service, controller and medium
By configuring a subprocess for each remote user device in the baseboard management controller and storing and reading serial port data in shared memory, the problem that the SOL service can only be used by a single user is solved, and multi-user collaborative development and data transmission efficiency are improved.
Patent Information
- Application Number
- CN202510883970.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-30
AI Technical Summary
In the existing technology, redirecting the server's serial port to a network service (SOL service) can only support a single remote user and cannot achieve multi-user collaborative development, resulting in a poor user experience.
By redirecting the serial port to the network service main process in the baseboard management controller, configuring a corresponding sub-process for each remote user device, and storing and reading serial port data in the preset shared memory, multi-user support is achieved.
The server SOL service supports multiple users, improves the user experience, and speeds up the transmission response speed and efficiency of serial port data.
Smart Images

Figure CN120729947A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a management method, device, controller and medium for redirecting a serial port to a network service. Background Art
[0002] Currently, most server manufacturers have implemented the Serial Over Lan (SOL) service. The primary application scenario for this service is capturing server boot logs. During server boot, the Basic Input / Output System (BIOS) writes detailed BIOS information to the motherboard serial port. Because the motherboard serial port is connected to the Baseboard Management (BMC) serial port, the BMC can collect this information in real time. The BMC then transmits this information to remote users over the network, allowing them to remotely capture this information for code analysis and troubleshooting, such as server crashes.
[0003] In the related art, although the whole server manufacturer can implement the server's SOL service function, the SOL service can only be used by a single remote user. That is, when a remote user is using the SOL service to capture the server's boot log, other remote users cannot use the SOL service. They can only wait for the previous remote user to terminate the SOL service, or force the previous remote user to terminate the SOL service before they can take over the SOL service. Therefore, how to implement the server's SOL service to support multiple users, compared with the single-user support in the related art, to facilitate multi-user collaborative development and improve the user experience, is a problem that needs to be solved nowadays. Summary of the Invention
[0004] The purpose of the present invention is to provide a management method, device, baseboard management controller and computer-readable storage medium for redirecting a serial port to a network service, so as to realize the support of the server's SOL service for multiple users, facilitate the collaborative development of multiple users, and improve the user experience.
[0005] To solve the above technical problems, the present invention provides a management method for redirecting a serial port to a network service, which is applied to a baseboard management controller, comprising:
[0006] Receive serial port redirection to network service startup request sent by each remote user device;
[0007] Utilize the serial port redirection to the network service main process, and configure the corresponding sub-process for each of the remote user devices according to the serial port redirection to the network service start request;
[0008] The sub-processes are used to respectively read the serial port data stored in the preset shared memory and redirected to the network service main process, and send the read serial port data to the corresponding remote user equipment.
[0009] On the other hand, the method of utilizing the serial port redirection to the network service main process and configuring a corresponding sub-process for each remote user device according to the serial port redirection to the network service start request includes:
[0010] Detect whether the currently received serial port redirection to network service start request is the first remote user's serial port redirection to network service start request;
[0011] If so, allocating a preset size of inter-process shared memory space as the preset shared memory;
[0012] Collecting serial port data redirected to the network service and storing it in the preset shared memory, creating a child process corresponding to the remote user device that sends the currently received serial port redirection to the network service start request, and recording the correspondence between the child process corresponding to the currently received serial port redirection to the network service start request and the remote user device;
[0013] If not, create a child process corresponding to the remote user device that sends the currently received serial port redirection to network service startup request, and record the corresponding relationship between the child process corresponding to the currently received serial port redirection to network service startup request and the remote user device.
[0014] On the other hand, before creating a subprocess corresponding to the remote user device that sends the currently received serial port redirection to the network service startup request and recording the correspondence between the subprocess corresponding to the currently received serial port redirection to the network service startup request and the remote user device, the process further includes:
[0015] Determine whether the number of remote user devices currently running serial port redirection to network service has reached the preset number of users;
[0016] If the preset number of users is not reached, executing the step of creating a subprocess corresponding to the remote user device that sends the currently received serial port redirection to the network service startup request, and recording the corresponding relationship between the subprocess corresponding to the currently received serial port redirection to the network service startup request and the remote user device;
[0017] If the preset number of users is reached, a user full-load prompt message is sent to the remote user device corresponding to the currently received serial port redirection network service start request.
[0018] On the other hand, before the method redirects the currently received serial port to the remote user equipment corresponding to the network service startup request and sends the user number full prompt information, it also includes:
[0019] Determine whether the user authority level of the remote user device corresponding to the currently received serial port redirection to network service start request is higher than that of a remote user device currently running the serial port redirection to network service;
[0020] If it is not higher than any remote user device currently running the serial port redirection to network service, executing the step of sending a user number full load prompt message to the remote user device corresponding to the currently received serial port redirection to network service start request;
[0021] If it is higher than a remote user device currently running the serial port redirection to the network service, a target user device is determined from the remote user devices currently running the serial port redirection to the network service, the sub-process corresponding to the target user device is terminated and the recorded corresponding correspondence is deleted, and the steps of creating a sub-process corresponding to the remote user device that sends the currently received serial port redirection to the network service start-up request, and recording the correspondence between the sub-process corresponding to the currently received serial port redirection to the network service start-up request and the remote user device are performed; wherein the target user device is a remote user device with the lowest user authority level among the remote user devices currently running the serial port redirection to the network service.
[0022] On the other hand, recording the correspondence between the sub-process corresponding to the currently received serial port redirection request to the network service startup request and the remote user device includes:
[0023] The process code linked list is used to record the correspondence between the sub-process corresponding to the currently received serial port redirection to the network service startup request and the remote user device.
[0024] On the other hand, the method of using each of the sub-processes to respectively read the serial port data in the preset shared memory that is redirected to the serial port data stored in the network service main process includes:
[0025] When the size of the unread data in the preset shared memory of the current child process is not less than the preset read size, the unread data of the preset read size is read; when the size of the unread data is less than the preset read size, all the unread data is read; wherein the current child process is any of the child processes, and the unread data is the serial port data in the preset shared memory that has not been read by the current child process.
[0026] On the other hand, after reading the unread data of the preset read size and reading all the unread data, the method further includes:
[0027] Redirecting the serial port to the network service main process to send the read data information;
[0028] The management method of redirecting the serial port to the network service also includes:
[0029] The serial port is redirected to the network service main process, and the serial port data read by all the sub-processes is deleted according to the read data information sent by each sub-process.
[0030] The present invention also provides a management device for redirecting a serial port to a network service, which is applied to a baseboard management controller and includes:
[0031] The request receiving module is used to receive the serial port redirection to network service startup request sent by each remote user device;
[0032] A sub-process configuration module is used to use the serial port redirection to the network service main process to configure a corresponding sub-process for each of the remote user devices according to the serial port redirection to the network service start request;
[0033] The shared reading module is used to use each of the sub-processes to respectively read the serial port data stored in the preset shared memory and redirected to the network service main process, and send the read serial port data to the corresponding remote user equipment.
[0034] The present invention also provides a baseboard management controller, comprising:
[0035] memory for storing computer programs;
[0036] The processor is configured to implement the steps of the management method for redirecting the serial port to the network service as described above when executing the computer program.
[0037] In addition, the present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the management method for redirecting a serial port to a network service as described above are implemented.
[0038] A management method for serial port redirection to network service provided by the present invention is applied to a baseboard management controller, comprising: receiving a serial port redirection to network service startup request sent by each remote user device; utilizing a serial port redirection to network service main process to configure a corresponding sub-process for each remote user device according to the serial port redirection to network service startup request; utilizing each sub-process to respectively read serial port data stored in a preset shared memory by the serial port redirection to network service main process, and sending the read serial port data to the corresponding remote user device.
[0039] As can be seen, the present invention enables the server's SOL service to support multiple users by utilizing the subprocesses corresponding to each remote user device to read the serial port data stored by the SOL service master process in the preset shared memory and send the read serial port data to the corresponding remote user device. Compared to the single-user support in the related art, this facilitates multi-user collaborative development and improves the user experience. Furthermore, utilizing the configuration of the subprocesses corresponding to each remote user device can accelerate the response speed of the SOL service in transmitting serial port data, improving transmission efficiency. Furthermore, the present invention also provides a management device for redirecting serial ports to network services, a baseboard management controller, and a computer-readable storage medium, which also have the aforementioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0041] Figure 1 A flowchart of a management method for redirecting a serial port to a network service provided by an embodiment of the present invention;
[0042] Figure 2 A flowchart of another management method for redirecting a serial port to a network service provided by an embodiment of the present invention;
[0043] Figure 3 A flow chart of another management method for redirecting a serial port to a network service provided by an embodiment of the present invention;
[0044] Figure 4 A structural block diagram of a management device for redirecting a serial port to a network service provided by an embodiment of the present invention;
[0045] Figure 5 This is a structural diagram of a baseboard management controller provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0047] Please refer to Figure 1 , Figure 1 This is a flow chart of a management method for redirecting a serial port to a network service provided by an embodiment of the present invention. The method is applied to a baseboard management controller (BMC) and may include:
[0048] Step 101: Receive a serial port redirection to network service start request sent by each remote user device.
[0049] The remote user device in this embodiment may be a device of the remote user, such as a computer or mobile phone, that sends a serial port redirection to network (SOL) service startup request to the server's BMC via the network. The SOL service startup request in this embodiment may be a request from the remote user to start the SOL service.
[0050] Correspondingly, the specific type of the SOL service startup request in this embodiment can be set by the designer according to the practical scenario and user needs. For example, the SOL service startup request can only include a regular SOL service request for normal request to start the SOL service; the SOL service startup request can also include a regular SOL service request and a forced SOL service request for forced occupation of the SOL service. This embodiment does not impose any restrictions on this.
[0051] Accordingly, the specific method for the BMC to receive the serial port redirection to the network service startup request sent by each remote user device in this step can be set by the designer. For example, it can be implemented in the same or similar manner as the method for the BMC to receive the SOL service request from the remote user in the related art. This embodiment does not do anything about this.
[0052] Step 102: Utilize the serial port redirection to the network service main process, and configure the corresponding sub-process for each remote user device according to the serial port redirection to the network service start request.
[0053] It can be understood that in this step, the BMC operating system can run the SOL service main process, and configure a corresponding sub-process (i.e., SOL service sub-process) for each remote user device based on the received SOL service startup request, thereby using each sub-process to cooperate with the SOL service main process to implement SOL service support for multiple users.
[0054] Correspondingly, in this step, the BMC utilizes the SOL service master process to configure a corresponding sub-process for each remote user device based on the serial port redirection to the network service startup request. This can be configured by the designer based on practical scenarios and user needs. For example, the SOL service master process can create a new corresponding sub-process for each remote user device; or the SOL service master process can use a pre-established sub-process to assign a corresponding sub-process to each remote user device. This embodiment does not impose any restrictions on this.
[0055] Correspondingly, when the SOL service main process creates a corresponding child process for each remote user device, in this step, the SOL service main process can detect whether the currently received SOL service startup request is the SOL service startup request of the first remote user; if so, allocate an inter-process shared memory space of a preset size (such as 256k) as the preset shared memory; collect the serial port data of the SOL service and store it in the preset shared memory, and create a child process corresponding to the remote user device that sends the currently received SOL service startup request, and record the correspondence between the child process corresponding to the currently received SOL service startup request and the remote user device; if not, create a child process corresponding to the remote user device that sends the currently received SOL service startup request, and record the correspondence between the child process corresponding to the currently received SOL service startup request and the remote user device.
[0056] In this embodiment, the maximum number of users supported by the SOL service can be limited, that is, the maximum number of subprocesses that can read serial port data from the preset shared memory in step 103 can be limited. For example, the number of subprocesses that can read serial port data from the preset shared memory can be less than or equal to the preset number of users. For example, if the currently received SOL service initiation request is not the first remote user's SOL service initiation request, before creating a subprocess corresponding to the remote user device that sent the currently received SOL service initiation request and recording the corresponding relationship between the subprocess corresponding to the currently received SOL service initiation request and the remote user device, the method can further include: determining whether the number of remote user devices currently running the SOL service has reached a preset number of users; if the preset number of users has not been reached, creating a subprocess corresponding to the remote user device that sent the currently received SOL service initiation request and recording the corresponding relationship between the subprocess corresponding to the currently received SOL service initiation request and the remote user device; and if the preset number of users has been reached, sending a user full-load prompt message to the remote user device corresponding to the currently received SOL service initiation request.
[0057] In other embodiments, when the SOL service main process creates a corresponding sub-process for each remote user device, the SOL service main process can detect in step 102 whether the currently received SOL service startup request is the SOL service startup request of the first remote user; if so, the collected serial port data of the SOL service is sent to the remote user device corresponding to the SOL service startup request; if so, it is determined whether the currently received SOL service startup request is the SOL service startup request of the second remote user; if it is the SOL service startup request of the second remote user, a preset size of inter-process shared memory space is allocated as the preset shared memory; the collected serial port data of the SOL service is stored in the shared memory. The SOL service start request is stored in the preset shared memory, and sub-processes corresponding to the remote user device that sends the currently received SOL service start request and the first remote user's SOL service start request are created, and the corresponding relationship between the sub-process corresponding to the currently received SOL service start request and the remote user device and the corresponding relationship between the sub-process corresponding to the first remote user's SOL service start request and the remote user device are recorded respectively; if it is not the SOL service start request of the second remote user, a sub-process corresponding to the remote user device that sends the currently received SOL service start request is created, and the corresponding relationship between the sub-process corresponding to the currently received SOL service start request and the remote user device is recorded. In other words, when the SOL service main process detects only one remote user's SOL service start request, it can first provide SOL service to the single user according to the conventional SOL service process; when it detects SOL service start requests from two or more remote users, it uses the preset shared memory and sub-processes to provide SOL service to the users.
[0058] Step 103: Utilize each child process to read the serial port data stored in the preset shared memory and redirected to the network service main process, and send the read serial port data to the corresponding remote user equipment.
[0059] It should be noted that the preset shared memory in this embodiment can be an inter-process shared memory space of a preset size, enabling the SOL service master process to write serial port data for the SOL service to the preset shared memory, and each child process to read serial port data from the preset shared memory. In other words, in this embodiment, the SOL service master process collects serial port data in real time and writes the collected serial port data to the preset shared memory; the SOL service child processes corresponding to different remote user devices can each read the serial port data from the preset shared memory and send it to the corresponding remote user device via the network.
[0060] Correspondingly, the specific method for using each child process to read the serial port data stored in the preset shared memory and redirected to the network service main process in this step can be set by the designer according to practical scenarios and user needs. For example, due to the use of a preset shared memory shared between processes, the SOL service main process writes the collected serial port data, and one or more SOL service child processes read the serial port data stored in the preset shared memory. The BMC code needs to implement the shared memory synchronization function; to simplify the shared memory synchronization logic, each child process can read a fixed preset read size (such as 200 bytes) of serial port data each time. If the remaining data in the preset shared memory is less than the preset read size, the SOL service child process can read all the remaining data. In other words, in this step, the BMC can use the current child process to read the unread data of the preset read size when the size of the unread data in the preset shared memory is not less than the preset read size; if the size of the unread data is less than the preset read size, it can read all the unread data; where the current child process is any child process, and the unread data is the serial port data in the preset shared memory that the current child process has not read.
[0061] Furthermore, after reading the preset read size of unread data and reading all unread data, the current sub-process can send the read data information to the SOL service main process; accordingly, the BMC can redirect the serial port to the network service main process and delete the serial port data that all sub-processes have read based on the read data information sent by each sub-process. For example, after reading the serial port data, the sub-process sends a corresponding signal to the SOL service main process, and the SOL service main process records the ID of the SOL service sub-process that has completed reading the data; when all sub-processes have finished reading a certain data, the SOL service main process deletes the read data from the preset shared memory. The SOL service main process can also calculate and record the remaining data size in the preset shared memory to facilitate comparison with the preset read size.
[0062] Among them, in this embodiment, when the SOL service main process writes serial port data to the preset shared memory, if the space of the preset shared memory is full of serial port data, the SOL service main process can sleep and wait for each sub-process to read data from the preset shared memory.
[0063] Correspondingly, the method provided in this embodiment may further include: utilizing the SOL service main process to terminate the sub-process corresponding to the SOL service reception request according to the received SOL service reception request, and deleting the recorded corresponding correspondence, such as deleting the ID-related information of the sub-process from the process ID (code) linked list.
[0064] In this embodiment, the embodiment of the present invention uses the sub-process corresponding to each remote user device to read the serial port data stored in the SOL service main process in the preset shared memory, and sends the read serial port data to the corresponding remote user device, thereby realizing the server's SOL service support for multiple users. Compared with the single-user support in the related technology, it facilitates the collaborative development of multiple users and improves the user experience; and by using the configuration of the sub-process corresponding to each remote user device, the response speed of the SOL service in transmitting serial port data can be accelerated, thereby improving the transmission efficiency.
[0065] Please refer to Figure 2 , Figure 2 This is a flow chart of another method for controlling the fan speed of a server provided by an embodiment of the present invention. The method is applied to a BMC and may include:
[0066] Step 201: Receive a SOL service start request sent by each remote user equipment.
[0067] This step is similar to step 101 and will not be described again here.
[0068] Step 202 : Using the SOL service main process, detect whether the currently received SOL service start request is the first remote user's SOL service start request; if so, proceed to step 203 ; if not, proceed to step 205 .
[0069] In this embodiment, the BMC operating system can run the SOL service main process to query whether there is an SOL service start request sent by a remote user device, that is, to query whether there is a remote user requesting the SOL service or requesting to forcibly occupy the SOL service; when the SOL service start request sent by the remote user device is queried, it is determined whether the currently received SOL service start request is the first remote user's SOL service start request; if Figure 3 As shown, in this step, it can be determined whether the number of currently running SOL service subprocesses is 0, so as to determine that the currently received SOL service start request is the first remote user's SOL service start request when the number is 0.
[0070] Step 203: Allocate an inter-process shared memory space of a preset size as a preset shared memory.
[0071] Step 204: collect the serial port data of the SOL service and store it in the preset shared memory, create a subprocess corresponding to the remote user device that sends the currently received SOL service start request, and record the correspondence between the subprocess corresponding to the currently received SOL service start request and the remote user device.
[0072] For example, when the currently received SOL service startup request is the first remote user's SOL service startup request, the SOL service master process can allocate 256KB of inter-process shared memory space as the preset shared memory, and the SOL service master process begins to collect serial port data and write the serial port data to the preset shared memory. The SOL service master process can create a new process ID linked list to record the child processes created by the SOL service. In other words, the SOL service master process can use the process ID linked list to record the correspondence between the child process corresponding to the currently received SOL service startup request and the remote user device. The SOL service master process creates a new child process for the remote user, and the child process returns a process ID. The SOL service master process records the child process ID in the process ID linked list to record the correspondence between the child process and the remote user device.
[0073] Step 205 : Determine whether the number of remote user devices currently running the SOL service reaches a preset number of users; if so, proceed to step 206 ; if not, proceed to step 207 .
[0074] like Figure 3 As shown, when the currently received SOL service start request is not the SOL service start request of the first remote user, the SOL service main process can check whether the number of sub-processes currently running the SOL service (i.e., the number of remote user devices) is less than 6 (i.e., the preset number of users); if it reaches 6, a user full load prompt message is sent to the remote user device currently requesting the SOL service through step 206; if it does not reach 6, a new sub-process is created for the remote user through step 207, and the sub-process returns a process ID. The SOL service main process records the sub-process ID in the process ID linked list to record the correspondence between the sub-process and the remote user device.
[0075] Step 206: Sending user full-load prompt information to the remote user equipment corresponding to the currently received SOL service start request.
[0076] It should be noted that this embodiment is demonstrated by taking the example of the SOL service main process directly sending a user full load prompt message to the remote user device corresponding to the currently received SOL service start request when the number of remote user devices currently running the SOL service reaches a preset number of users.
[0077] In other embodiments, the SOL service main process may, when the number of remote user devices currently running the SOL service reaches a preset number of users, determine whether the user authority level of the remote user device corresponding to the currently received serial port redirection to network service initiation request is higher than that of a remote user device currently running the serial port redirection to network service; if the user authority level is not higher than that of any remote user device currently running the serial port redirection to network service, send a user full-load prompt message to the remote user device corresponding to the currently received serial port redirection to network service initiation request; if the user authority level is higher than that of a remote user device currently running the serial port redirection to network service, determine a target user device from the remote user devices currently running the serial port redirection to network service, terminate the subprocess corresponding to the target user device, delete the recorded corresponding correspondence, and proceed to step 207. In other words, when the number of remote user devices currently running the SOL service reaches the preset number of users, the SOL service main process selects the preset number of remote user devices to run the SOL service based on the user authority level corresponding to each remote user device.
[0078] In other embodiments, when the SOL service startup request may include a regular SOL service request and a forced SOL service request, the SOL service main process may detect whether the currently received SOL service startup request is a forced SOL service request when the number of remote user devices currently running the SOL service reaches a preset number of users; if not, a user number full load prompt message is sent to the remote user device corresponding to the currently received serial port redirection to network service startup request; if so, a determination is made as to whether the user authority level of the remote user device corresponding to the currently received serial port redirection to network service startup request is higher than that of a certain remote user device currently running the serial port redirection to network service; if not, a user authority level insufficient prompt message is sent to the remote user device corresponding to the currently received serial port redirection to network service startup request; if higher than that of a certain remote user device currently running the serial port redirection to network service, a target user device is determined from the remote user devices currently running the serial port redirection to network service, the subprocess corresponding to the target user device is terminated, the recorded corresponding correspondence is deleted, and the process proceeds to step 207.
[0079] Step 207: Create a sub-process corresponding to the remote user equipment that sends the currently received SOL service start request, and record the corresponding relationship between the sub-process corresponding to the currently received SOL service start request and the remote user equipment.
[0080] Step 208: Utilize each sub-process to read the serial port data stored in the preset shared memory by the SOL service main process, and send the read serial port data to the corresponding remote user device.
[0081] This step is similar to step 103 and will not be described again here.
[0082] Corresponding to the above method embodiment, an embodiment of the present invention also provides a management device for redirecting a serial port to a network service. The management device for redirecting a serial port to a network service described below and the management method for redirecting a serial port to a network service described above can refer to each other.
[0083] Please refer to Figure 4 , Figure 4 This is a block diagram of a management device for redirecting a serial port to a network service provided by an embodiment of the present invention. The device is applied to a baseboard management controller and may include:
[0084] The request receiving module 10 is used to receive the serial port redirection to network service start request sent by each remote user device;
[0085] The sub-process configuration module 20 is used to use the serial port redirection to the network service main process to configure the corresponding sub-process for each remote user device according to the serial port redirection to the network service start request;
[0086] The shared reading module 30 is used to use each sub-process to read the serial port data stored in the preset shared memory redirected to the network service main process, and send the read serial port data to the corresponding remote user equipment.
[0087] In some embodiments, the sub-process configuration module 20 may include:
[0088] The start detection submodule is used to detect whether the currently received serial port redirection to network service start request is the first remote user's serial port redirection to network service start request;
[0089] The memory allocation submodule is used to allocate an inter-process shared memory space of a preset size as a preset shared memory if the serial port of the first remote user is redirected to a network service startup request;
[0090] The collection and creation submodule is used to collect the serial port data redirected to the network service and store it in the preset shared memory, and create a subprocess corresponding to the remote user device that sends the currently received serial port redirection to the network service startup request, and record the correspondence between the subprocess corresponding to the currently received serial port redirection to the network service startup request and the remote user device;
[0091] Create a submodule for creating a subprocess corresponding to the remote user device that sends the currently received serial port redirection to the network service startup request if it is not the first remote user's serial port redirection to the network service startup request, and record the correspondence between the subprocess corresponding to the currently received serial port redirection to the network service startup request and the remote user device.
[0092] In some embodiments, creating a submodule includes:
[0093] A user number determination unit is used to determine whether the number of remote user devices currently running the serial port redirection to the network service has reached a preset number of users;
[0094] A creating unit, configured to create a subprocess corresponding to the remote user device that sends the currently received serial port redirection to network service startup request if the preset number of users has not been reached, and record a correspondence between the subprocess corresponding to the currently received serial port redirection to network service startup request and the remote user device;
[0095] The prompt unit is used to send a user full load prompt message to the remote user device corresponding to the currently received serial port redirection network service startup request if the preset user number is reached.
[0096] In some embodiments, the prompt unit may include:
[0097] The authority judgment subunit is used to judge whether the user authority level of the remote user device corresponding to the currently received serial port redirection to network service startup request is higher than that of a remote user device currently running the serial port redirection to network service;
[0098] The prompt subunit is used to send a user full load prompt message to the remote user device corresponding to the currently received serial port redirection to network service start request if the number of users is not higher than any remote user device currently running the serial port redirection to network service;
[0099] The replacing sub-unit is configured to determine a target user device from the remote user devices currently running the serial port redirection to the network service, terminate the sub-process corresponding to the target user device, delete the recorded corresponding correspondence, and send a start signal to the creating unit if the target user device is higher than a remote user device currently running the serial port redirection to the network service, wherein the target user device is a remote user device with the lowest user authority level among the remote user devices currently running the serial port redirection to the network service.
[0100] In some embodiments, recording the correspondence between the sub-process corresponding to the currently received serial port redirection to network service startup request and the remote user device includes:
[0101] The process code linked list is used to record the correspondence between the sub-process corresponding to the currently received serial port redirection to the network service startup request and the remote user device.
[0102] In some embodiments, the sub-process configuration module 20 can be specifically used to read the unread data of a preset read size when the size of the unread data of the current sub-process in the preset shared memory is not less than the preset read size; when the size of the unread data is less than the preset read size, read all the unread data; wherein the current sub-process is any sub-process, and the unread data is the serial port data in the preset shared memory that has not been read by the current sub-process.
[0103] In some embodiments, the sub-process configuration module 20 is further configured to redirect the serial port to send read data information to the network service main process;
[0104] The device also includes:
[0105] The data deletion module is used to redirect the serial port to the main process of the network service, and delete the serial port data read by all sub-processes according to the read data information sent by each sub-process.
[0106] In this embodiment, the embodiment of the present invention uses the sub-process configuration module 20 to use the sub-process corresponding to each remote user device to respectively read the serial port data stored in the SOL service main process in the preset shared memory, and sends the read serial port data to the corresponding remote user device, which can realize the server's SOL service support for multiple users. Compared with the single-user support in the related technology, it facilitates the collaborative development of multiple users and improves the user experience; and by using the configuration of the sub-process corresponding to each remote user device, the response speed of the SOL service transmitting serial port data can be accelerated, thereby improving the transmission efficiency.
[0107] Corresponding to the above method embodiment, an embodiment of the present invention further provides a baseboard management controller. The baseboard management controller described below and the management method for redirecting a serial port to a network service described above can refer to each other.
[0108] Please refer to Figure 5 , Figure 5 This is a schematic diagram of the structure of a baseboard management controller provided by an embodiment of the present invention. The baseboard management controller may include:
[0109] Memory D1, for storing computer programs;
[0110] The processor D2 is configured to implement the steps of the management method for redirecting the serial port to the network service provided in the above method embodiment when executing the computer program.
[0111] Corresponding to the above BMC embodiment, an embodiment of the present invention further provides a server. The server described below and the baseboard management controller described above can refer to each other.
[0112] A server includes: a baseboard management controller as provided in the above embodiment.
[0113] Corresponding to the above method embodiment, an embodiment of the present invention further provides a computer program product. The computer program product described below and the management method for redirecting a serial port to a network service described above can refer to each other.
[0114] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of the management method for redirecting a serial port to a network service provided in the above method embodiment.
[0115] Corresponding to the above method embodiment, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium described below and the management method for redirecting a serial port to a network service described above can refer to each other.
[0116] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the management method of redirecting a serial port to a network service in the above-mentioned method embodiment.
[0117] The computer-readable storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, which may store program codes.
[0118] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. References to the common and similar parts between the various embodiments are sufficient. The apparatus, baseboard management controller, server, computer program product, and computer-readable storage medium disclosed in the embodiments are described briefly because they correspond to the methods disclosed in the embodiments. For relevant details, refer to the method description.
[0119] The above is a detailed introduction to the management method, device, baseboard management controller and computer-readable storage medium for redirecting a serial port to a network service provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A management method for redirecting a serial port to a network service, characterized in that: Applicable to baseboard management controllers, including: Receive serial port redirection to network service startup request sent by each remote user device; Utilize the serial port redirection to the network service main process, and configure the corresponding sub-process for each of the remote user devices according to the serial port redirection to the network service start request; The sub-processes are used to respectively read the serial port data stored in the preset shared memory and redirected to the network service main process, and send the read serial port data to the corresponding remote user equipment.
2. The management method for redirecting a serial port to a network service according to claim 1, characterized in that: The method of utilizing the serial port redirection to the network service main process and configuring a corresponding sub-process for each remote user device according to the serial port redirection to the network service start request includes: Detect whether the currently received serial port redirection to network service start request is the first remote user's serial port redirection to network service start request; If so, allocating a preset size of inter-process shared memory space as the preset shared memory; Collecting serial port data redirected to the network service and storing it in the preset shared memory, creating a child process corresponding to the remote user device that sends the currently received serial port redirection to the network service start request, and recording the correspondence between the child process corresponding to the currently received serial port redirection to the network service start request and the remote user device; If not, create a child process corresponding to the remote user device that sends the currently received serial port redirection to network service startup request, and record the corresponding relationship between the child process corresponding to the currently received serial port redirection to network service startup request and the remote user device.
3. The management method for redirecting a serial port to a network service according to claim 2, characterized in that: Before creating a sub-process corresponding to the remote user device that sends the currently received serial port redirection to network service startup request and recording the corresponding relationship between the sub-process corresponding to the currently received serial port redirection to network service startup request and the remote user device, the process further includes: Determine whether the number of remote user devices currently running serial port redirection to network service has reached the preset number of users; If the preset number of users is not reached, executing the step of creating a subprocess corresponding to the remote user device that sends the currently received serial port redirection to the network service startup request, and recording the corresponding relationship between the subprocess corresponding to the currently received serial port redirection to the network service startup request and the remote user device; If the preset number of users is reached, a user full-load prompt message is sent to the remote user device corresponding to the currently received serial port redirection network service start request.
4. The management method for redirecting a serial port to a network service according to claim 3, characterized in that: Before redirecting the currently received serial port to the remote user device corresponding to the network service startup request and sending the user number full load prompt information, the method further includes: Determine whether the user authority level of the remote user device corresponding to the currently received serial port redirection to network service start request is higher than that of a remote user device currently running the serial port redirection to network service; If it is not higher than any remote user device currently running the serial port redirection to network service, executing the step of sending a user full load prompt message to the remote user device corresponding to the currently received serial port redirection to network service start request; If it is higher than a remote user device currently running the serial port redirection to the network service, a target user device is determined from the remote user devices currently running the serial port redirection to the network service, the sub-process corresponding to the target user device is terminated and the recorded corresponding correspondence is deleted, and the steps of creating a sub-process corresponding to the remote user device that sends the currently received serial port redirection to the network service start-up request, and recording the correspondence between the sub-process corresponding to the currently received serial port redirection to the network service start-up request and the remote user device are performed; wherein the target user device is a remote user device with the lowest user authority level among the remote user devices currently running the serial port redirection to the network service.
5. The management method for redirecting a serial port to a network service according to claim 2, characterized in that: The recording of the correspondence between the sub-process corresponding to the currently received serial port redirection request to the network service startup request and the remote user device includes: The process code linked list is used to record the correspondence between the sub-process corresponding to the currently received serial port redirection to the network service startup request and the remote user device.
6. The management method for redirecting a serial port to a network service according to any one of claims 1 to 5, characterized in that: The method of using each of the sub-processes to respectively read the serial port data in the preset shared memory and redirect the serial port to the serial port data stored in the network service main process includes: When the size of the unread data in the preset shared memory of the current child process is not less than the preset read size, the unread data of the preset read size is read; when the size of the unread data is less than the preset read size, all the unread data is read; wherein the current child process is any of the child processes, and the unread data is the serial port data in the preset shared memory that has not been read by the current child process.
7. The management method for redirecting a serial port to a network service according to claim 6, characterized in that: After reading the unread data of the preset read size and reading all the unread data, the method further includes: Redirecting the serial port to the network service main process to send the read data information; The management method of redirecting the serial port to the network service also includes: The serial port is redirected to the network service main process, and the serial port data read by all the sub-processes is deleted according to the read data information sent by each sub-process.
8. A management device for redirecting a serial port to a network service, characterized in that: Applicable to baseboard management controllers, including: The request receiving module is used to receive the serial port redirection to network service startup request sent by each remote user device; A sub-process configuration module is used to use the serial port redirection to the network service main process to configure a corresponding sub-process for each of the remote user devices according to the serial port redirection to the network service start request; The shared reading module is used to use each of the sub-processes to respectively read the serial port data stored in the preset shared memory and redirected to the network service main process, and send the read serial port data to the corresponding remote user equipment.
9. A baseboard management controller, characterized in that: include: Memory for storing computer programs; A processor is configured to implement the steps of the management method for redirecting a serial port to a network service as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the management method for redirecting a serial port to a network service according to any one of claims 1 to 7 are implemented.