Log data acquisition method and device, storage medium and electronic equipment

By mounting the target operating system on the baseboard management controller and using the video output port to output log data, efficient collection of server logs is achieved, solving the problem of low log data collection efficiency in the existing technology, and improving operation and maintenance efficiency and reliability. .

CN118689731APending Publication Date: 2024-09-24INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410692213.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

The log data collection efficiency in existing server operation and maintenance is low, the storage capacity of the shared area is small, and the communication stability is poor, resulting in low interaction efficiency and possible data loss, affecting operation and maintenance efficiency.

Method used

By mounting the target operating system on the baseboard management controller, using the video output port to output system logs, and collecting log data through text recognition, the physical interface transmission and storage space division of the baseboard management controller is avoided, and system logs can be obtained immediately. Pick it up and pass it on.

Benefits of technology

It improves the efficiency of log data collection, solves the problem of data loss, and improves the efficiency and reliability of server operation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689731A
    Figure CN118689731A
Patent Text Reader

Abstract

The embodiment of the invention provides a log data collection method and device, a storage medium and electronic device.The method comprises the steps that a target operation request is received, and the target operation request is used for requesting operation of a target operation system; the target operation request is responded, the baseboard management controller is controlled to call and operate a target operation system on a server, and the target operation system is used for outputting a system log of the target operation system through a video output port of the server; acquiring a target image which is output by the video output port and is acquired and sent by the substrate management controller; the target image is subjected to text recognition, target log data are obtained, and the target log data are used for indicating the operation condition of the target operation system. Through the method and the device, the problem of relatively low log data acquisition efficiency in related technologies is solved, and the effect of improving the log data acquisition efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a method and device for collecting log data, a storage medium, and an electronic device. Background Art

[0002] Servers, as important basic physical facilities in the field of information technology, have seen an increasing demand and application scenarios in recent years. In the product life cycle of servers, in addition to production and sales, server operation and maintenance is also an important link. Generally speaking, server operation and maintenance are mostly implemented through BMC, which stands for baseboard management controller. It is defined as a chip in hardware and a management program in software. Operation and maintenance personnel generally access the BMC management page through the network, or call open interfaces to manage servers. This method is generally referred to as out-of-band management. BMC is very powerful and can cover most operation and maintenance operations including hardware management, firmware maintenance, and status monitoring, but it still has certain limitations. This limitation of BMC is mainly reflected in system-level operations, such as system installation, board management, and stress testing. Although the above operations can be implemented by mounting a micro operating system (hereinafter referred to as LiveOS) on the BMC, that is, the BMC separates a space of several MB in its own storage space, which is collectively referred to as the shared area. LiveOS can access this shared area through the IPMI protocol channel. Both BMC and LiveOS have the authority to read and write the shared area, so that the two can interact with each other. However, this solution still has certain disadvantages. First, the storage capacity of the shared area is small, and when the amount of data is large, the interaction efficiency is very low; second, the communication stability of the shared area is poor, and data loss may occur, resulting in interaction errors. In short, during the execution of LiveOS, the BMC cannot monitor the current status of LiveOS and cannot obtain the execution operation logs and results. Obviously, this cannot meet the needs of server operation and maintenance, and greatly affects the efficiency of server operation and maintenance. Summary of the invention

[0003] The embodiments of the present application provide a method and device for collecting log data, a storage medium and an electronic device, so as to at least solve the problem of low efficiency of collecting log data in the related art.

[0004] According to one embodiment of the present application, a server operation control method is provided, which is applied to an operation control device, wherein the operation control device is connected to a baseboard management controller in the server, and a target operating system of the server is mounted on the baseboard management controller by out-of-band control. The method comprises: receiving a target operation request, wherein the target operation request is used to request to run the target operating system; responding to the target operation request, controlling the baseboard management controller to call and run the target operating system on the server, wherein the target operating system is used to output a system log of the target operating system through a video output port of the server; obtaining a target image captured by the baseboard management controller and sent by the video output port; performing text recognition on the target image to obtain target log data, wherein the target log data is used to indicate the operation status of the target operating system.

[0005] Optionally, the obtaining the target image captured and sent by the baseboard management controller and output by the video output port includes:

[0006] Determining log update information of the target operating system based on the business type of the target business handled by the server, wherein the log update information is used to indicate the log update status during the operation of the target operating system;

[0007] The baseboard management controller is obtained to collect the target image output by the video output port according to the log collection method corresponding to the log update information, and the target image is sent to the operation control device.

[0008] Optionally, the acquiring, by the baseboard management controller, collecting the target image output by the video output port in a log collection manner corresponding to the log update information includes one of the following:

[0009] When the log update information is used to instruct the target operating system to output the system log after completing the target business, and the number of characters in the system log is less than or equal to a first threshold, detecting the execution status of the target business by the server; when it is determined that the server completes the target business, controlling the baseboard management controller to print the image output by the video output port to obtain the target image;

[0010] In the case where the log update information is used to instruct the target operating system to continuously output the system log during the execution of the target business, and the number of entries of log data included in the system log is greater than a second threshold, the baseboard management controller is controlled to print out a plurality of log images in sequence in the output image of the video output port according to the sequence of data numbers of the log data, wherein the target operating system is used to number the log data according to the sequence of the output log data, and display the log data on the video output port according to the sequence of data numbers of the log data, and the number of entries of log data allowed to be accommodated in the log image is less than or equal to the second threshold; the plurality of log images are sorted according to the sequence of the numbers of the log data recorded in the plurality of log images to obtain the target image;

[0011] In a case where the log update information is used to instruct the target operating system to periodically update the system log during execution of the target business, the baseboard management controller is controlled to print the image output by the video output port at a target printing frequency; a first image printed at a current moment is matched with a second image printed before the current moment; and when it is determined that the first image and the second image do not match each other, the first image is determined as the target image.

[0012] Optionally, the determining the log update information of the target operating system based on the service type of the target service handled by the server controlled by the target operating system includes one of the following:

[0013] In a case where the target service is a disk array configuration service, determining that the log update information is used to instruct the target operating system to output the system log after completing the target service, and the number of characters in the system log is less than or equal to a first threshold;

[0014] In a case where the target service is a test service, determining that the log update information is used to instruct the target operating system to continuously output the system log during execution of the target service, and the number of entries of log data included in the system log is greater than a second threshold;

[0015] In the case where the target service is a board management service, the log update information is determined to be used to instruct the target operating system to periodically update the system log during the execution of the target service.

[0016] Optionally, performing text recognition on the target image to obtain target log data includes:

[0017] Input the target image into a target recognition model to obtain reference log data output by the target recognition model, wherein the target recognition model is used to locate a text area in the target image, and correct a display angle of the target image according to a text area positioning result, perform image segmentation on the image with the corrected display angle to obtain a reference image recording log data, and determine the reference log data corresponding to the image features of the reference image from the image features and log data having a corresponding relationship;

[0018] Target data carrying a target keyword is identified from the reference log data, wherein the target keyword is a keyword used to indicate an execution state of a target service executed by a target operating system.

[0019] Optionally, before inputting the target image into the target recognition model, the method further includes:

[0020] Obtaining recognition results of the candidate image by the initial recognition model in a reference time period before the current moment;

[0021] Calculating a difference value between the recognition result and the corresponding log data recorded in the candidate image to obtain the recognition accuracy of the initial recognition model;

[0022] Using a target decision model to detect a target benefit parameter of each parameter adjustment operation in the initial recognition model with the recognition accuracy among a plurality of parameter adjustment operations, wherein the target decision model is used to calculate the adjustment effect achieved by executing each parameter adjustment operation for a decision target, the decision target includes adjusting the recognition accuracy of the initial recognition model to a target recognition accuracy, and the target benefit parameter is used to indicate the adjustment effect;

[0023] The target parameter adjustment operation in which the target benefit parameter corresponding to the multiple parameter adjustment operations satisfies the target benefit condition is adopted to adjust the model parameters of the initial recognition model to obtain the target recognition model.

[0024] Optionally, before receiving the target execution request, the method further includes:

[0025] Receiving a target request for controlling the server to execute a target service;

[0026] In response to the target request, a target system file required for handling the target business is obtained, wherein the target system file records the operation logic of the operation required to be performed for handling the target business;

[0027] The target system file is added to a corresponding position in an operating system template to obtain the target operating system, wherein the operating system template records the calling logic for the script file and the calling logic for calling the video output port of the server to output the system log.

[0028] Optionally, after performing text recognition on the target image to obtain target log data, the method further includes:

[0029] generating a target instruction according to the target log data, wherein the target instruction is used to instruct the baseboard management controller to adjust the running state of the target operating system;

[0030] The target instruction is sent to the baseboard management controller.

[0031] According to another embodiment of the present application, a log data collection device is provided, which is applied to an operation control device, wherein the operation control device is connected to a baseboard management controller in a server, and a target operating system of the server is mounted on the baseboard management controller in an out-of-band control manner, and the device includes:

[0032] A first receiving module, configured to receive a target operation request, wherein the target operation request is used to request to operate the target operating system;

[0033] a processing module, configured to respond to the target operation request, control the baseboard management controller to call and run the target operating system on the server, wherein the target operating system is configured to output a system log of the target operating system through a video output port of the server;

[0034] A control module, used for controlling the baseboard management controller to collect and send the target image output by the video output port;

[0035] The recognition module is used to perform text recognition on the target image to obtain target log data, wherein the target log data is used to indicate the running status of the target operating system.

[0036] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0037] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0038] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0039] Through the present application, an operation control device connected to a baseboard management controller is deployed in a server, and a target operating system of the server is mounted on the baseboard management controller by out-of-band control. The target operating system will output the system log of the target operating system through the video output port of the server, and then, when a target operation request is received, the baseboard management controller is controlled to call the operating system to run on the server, so that the log data of the target operating system will output an image carrying the system log through the video output port of the server, and then the system log of the target operating system can be collected by only collecting the target image output from the video output port through the baseboard management controller and performing text recognition. This process does not require the target operating system to call the physical interface of the baseboard management controller to transmit the system log to the baseboard management controller, nor does it require the storage space to be divided in the baseboard management controller to cache the system log, so that the system log can be collected and transmitted immediately. Therefore, the problem of low efficiency in log data collection in the related technology can be solved, and the effect of improving the efficiency of log data collection can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a hardware structure block diagram of a server device of a log data collection method according to an embodiment of the present application;

[0041] Figure 2 is a flow chart of a method for collecting log data according to an embodiment of the present application;

[0042] Figure 3 is a schematic diagram of an optional operation control device structure according to an embodiment of the present application;

[0043] Figure 4 is an optional operation control flow chart according to an embodiment of the present application;

[0044] Figure 5 is an optional log data identification schematic diagram according to an embodiment of the present application;

[0045] Figure 6 It is a structural block diagram of a log data collection device according to an embodiment of the present application. DETAILED DESCRIPTION

[0046] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0048] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a log data collection method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0049] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for collecting log data in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0050] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0051] In this embodiment, a method for collecting log data is provided. Figure 2 is a flow chart of a method for collecting log data according to an embodiment of the present application. Figure 2 As shown, it is applied to a running control device, the running control device is connected to a baseboard management controller in a server, and the baseboard management controller mounts the target operating system of the server in an out-of-band control manner. The process includes the following steps:

[0052] Step S202, receiving a target operation request, wherein the target operation request is used to request to operate the target operating system;

[0053] Step S204, in response to the target operation request, controlling the baseboard management controller to call and run the target operating system on the server, wherein the target operating system is used to output the system log of the target operating system through the video output port of the server;

[0054] Step S206, obtaining the target image captured and sent by the baseboard management controller and output by the video output port;

[0055] Step S208: Perform text recognition on the target image to obtain target log data, wherein the target log data is used to indicate the running status of the target operating system.

[0056] Through the above steps, through the operation control device connected to the baseboard management controller deployed in the server, and mounting the target operating system of the server on the baseboard management controller through the out-of-band control method, the target operating system will output the system log of the target operating system through the video output port of the server, and then, when receiving the target operation request, the baseboard management controller is controlled to call the operating system to run on the server, so that the log data of the target operating system will output an image carrying the system log through the video output port of the server, and then the system log of the target operating system can be collected by only collecting the target image output by the video output port through the baseboard management controller and performing text recognition. This process does not require the target operating system to call the physical interface of the baseboard management controller to transmit the system log to the baseboard management controller, nor does it require the storage space to be divided in the baseboard management controller to cache the system log, so that the system log can be collected and transmitted immediately. Therefore, the problem of low efficiency in log data collection in the related technology can be solved, and the effect of improving the efficiency of log data collection can be achieved.

[0057] In the embodiment provided in the above step S202, the target operating system is used to control the server to execute the corresponding target business. The target business may be a business related to the maintenance of the server's operating status. The target business may include but is not limited to system installation, board management, stress testing, etc. This solution does not limit this.

[0058] Optionally, in an embodiment of the present application, the target operating system is a miniature operating system (such as a liveOS system) mounted through the BMC. This operating system is different from a traditional server operating system (such as a windows system). The target operating system does not need to be installed on a hard disk. The target operating system only needs to be started and run from a removable storage medium. The target operating system is for temporary use, and users can start and run it on different servers without affecting the host system.

[0059] Optionally, in an embodiment of the present application, the target operating system can be, but is not limited to, pre-configured by the running control device according to the control requirements received for the server to run the target business. For example, when a target request is received on the server, the target request is used to request the control server to execute the target business. Then, the running control device packages the tools, scripts, drivers and other files required to execute the target business into a LiveOS template to generate a new LiveOS CD image, thereby obtaining the target operating system. This solution is not limited to this.

[0060] In the embodiment provided in the above step S204, the target operating system is pre-configured with a calling logic for calling the video output port of the server, and the system log of the target operating system can be output in the form of an image by calling the video output port of the server. The specific implementation can be that when the target operating system is running on the server, the board information of the server can be collected, and the video output port information of the server can be identified. After generating the system log, the video output port of the server is called by using the video output port information, and the system log is output through the video port.

[0061] In the embodiment provided in the above step S206, the baseboard management controller may collect images of the video output port of the server according to a target collection frequency. The target collection frequency may be a pre-configured fixed frequency, or may be a frequency configured according to the business type of the target business or the log output type of the target business. This solution does not limit this.

[0062] In the embodiment provided in the above step S208, the text recognition of the target image may be obtained by performing text recognition on the target image using a pre-trained image recognition model.

[0063] Optionally, in an embodiment of the present application, the system log is an image output by the video output port of the calling server. Therefore, the collected target image may include data output by other applications in addition to the system log. Therefore, reference data can be obtained by performing text recognition on the target image, and then the target data carrying the target keyword can be identified by performing keyword recognition on the reference data, and then the target data is determined as target log data, wherein the target keyword is a keyword used to indicate the running status of the operating system on the server, and this scheme does not limit this.

[0064] As an optional embodiment, the acquiring the target image collected and sent by the baseboard management controller and output by the video output port includes:

[0065] Determining log update information of the target operating system based on the business type of the target business handled by the server, wherein the log update information is used to indicate the log update status during the operation of the target operating system;

[0066] The baseboard management controller is obtained to collect the target image output by the video output port according to the log collection method corresponding to the log update information, and the target image is sent to the operation control device.

[0067] Optionally, in an embodiment of the present application, the business handled by the operating system is different, and therefore the way of outputting logs is also different, that is, the log update information is different. For example, when the target business is a RAID configuration business, the system log can be output at one time and the log can be obtained in a screenshot. When the target business is a stress testing business, the system will continue to output the system log, and the number of output system logs will be large, resulting in the inability to collect all log data in sequential access. When the target business is a business that requires multiple restarts, such as a board upgrade business, the system log will be updated periodically because it needs to be restarted sequentially or multiple times during the operation. Therefore, it is necessary to collect the system log periodically.

[0068] Through the above content, for operating systems under different log update information, in order to ensure the quality of log data collection, it is necessary to collect the image of the video output port according to the log collection method corresponding to the log update information, so as to avoid missed and repeated collection of log data and improve the efficiency of log data collection.

[0069] As an optional embodiment, the acquiring, by the baseboard management controller, collecting the target image output by the video output port in a log collection method corresponding to the log update information includes one of the following:

[0070] When the log update information is used to instruct the target operating system to output the system log after completing the target business, and the number of characters in the system log is less than or equal to a first threshold, detecting the execution status of the target business by the server; when it is determined that the server completes the target business, controlling the baseboard management controller to print the image output by the video output port to obtain the target image;

[0071] In the case where the log update information is used to instruct the target operating system to continuously output the system log during the execution of the target business, and the number of entries of log data included in the system log is greater than a second threshold, the baseboard management controller is controlled to print out a plurality of log images in sequence in the output image of the video output port according to the sequence of data numbers of the log data, wherein the target operating system is used to number the log data according to the sequence of the output log data, and display the log data on the video output port according to the sequence of data numbers of the log data, and the number of entries of log data allowed to be accommodated in the log image is less than or equal to the second threshold; the plurality of log images are sorted according to the sequence of the numbers of the log data recorded in the plurality of log images to obtain the target image;

[0072] In a case where the log update information is used to instruct the target operating system to periodically update the system log during execution of the target business, the baseboard management controller is controlled to print the image output by the video output port at a target printing frequency; a first image printed at a current moment is matched with a second image printed before the current moment; and when it is determined that the first image and the second image do not match each other, the first image is determined as the target image.

[0073] Optionally, in an embodiment of the present application, due to different business types at the system level, the operations that the operating system needs to perform are also different, which leads to differences in the way of outputting logs. Therefore, in order to ensure the effective collection of system logs, the corresponding data collection methods are configured for operating systems of different business types to improve the efficiency of log data collection.

[0074] Optionally, in an embodiment of the present application, for logs that are continuously output and cannot be fully obtained in one screenshot, such as operations such as stress testing (i.e., log update information is used to indicate that the target operating system continuously outputs the system log in the process of executing the target business, and the number of entries of log data included in the system log is greater than the second threshold), a stress test cycle is approximately 2 to 10 hours (unlimited), and 60 to 300 logs will be output during this cycle (assuming that they are obtained once every two minutes), and these logs cannot be displayed on one screen. Therefore, a stack log mechanism is designed in this module, and all logs are numbered from 1 to N. A maximum of 20 logs can be stored in the stack, that is, a maximum of 20 logs can be displayed on the same screen. When the number of logs exceeds 20, for every 5 logs that exceed the number, these 5 new logs are pushed into the stack, and the earliest 5 logs are popped out of the stack, that is, the current 20 logs on the screen are cleared, and the latest 20 logs in the stack are reprinted.

[0075] Optionally, in an embodiment of the present application, log collection can be performed according to a predetermined collection frequency, that is, the system maintenance personnel set a fixed value based on experience, or the collection operation of the target image can also be triggered by detection logic, for example, the baseboard management controller is controlled to detect the video signal information of the video output port of the server, and when the video signal information is used to indicate that there is an image output on the video output port of the server, the occupancy of the running memory of the current server is detected, and when it is detected that the running memory of the server is occupied by the target operating system and the occupancy is large, the baseboard management controller is triggered to collect the image of the video output port of the server, thereby avoiding frequent repeated collection of images output from the video output port resulting in a large number of image outputs, and reducing the business volume of log collection; or business information of multiple dimensions of the target business can also be collected, wherein the multiple business information is used to characterize the number of log data generated by the operating system from multiple dimensions, and then the multi-dimensional business information is weighted and calculated, so that the collection frequency corresponding to the calculated value is determined as the target collection frequency to be used currently, and this scheme does not limit this.

[0076] Optionally, in an embodiment of the present application, one or more restarts need to be inserted during the execution process, such as a board upgrade (i.e., the log update information is used to indicate that the target operating system periodically updates the system log during the execution of the target business), and the server needs to be restarted once after the upgrade is completed to verify the upgrade result. For such operations, this module needs to add a timestamp prefix to the log when printing it. The process control module restarts the server after extracting the first log content. When the second log is extracted, it is compared and found that the timestamp is updated, then it can be determined that it is a new log.

[0077] Optionally, in an embodiment of the present application, the above-mentioned log collection methods can be used one by one, or multiple mixed methods can be selected according to business needs, that is, in the process of using the maintenance server, in order to realize the maintenance function of the server, there may be a situation where multiple business types of services are nested according to certain nesting rules. At this time, the corresponding image printing method can be selected to print the image according to the business type of the business involved in the target operating system, or the multiple image printing methods to be used can be determined according to the business type of the business involved in the target operating system, and then the priority of each image printing method can be determined, and a method with a priority higher than the target priority can be selected from the multiple image printing methods as the image printing method adopted by the operating system, wherein the priority is used to indicate the acquisition frequency of the image output port.

[0078] Through the above content, by setting different image acquisition methods for different business types, it is possible to achieve the goal of collecting target images through one-time image printing for businesses with a small number of logs, collecting target images through multiple continuous printings for businesses with a large number of logs, and collecting target images through periodic printing for businesses that periodically update logs, thereby achieving effective collection of log data, avoiding redundant printing of images and reducing business pressure on image recognition while ensuring the quality of log data collection.

[0079] As an optional embodiment, the determining the log update information of the target operating system based on the service type of the target service handled by the server controlled by the target operating system includes one of the following:

[0080] In a case where the target service is a disk array configuration service, determining that the log update information is used to instruct the target operating system to output the system log after completing the target service, and the number of characters in the system log is less than or equal to a first threshold;

[0081] In a case where the target service is a test service, determining that the log update information is used to instruct the target operating system to continuously output the system log during execution of the target service, and the number of entries of log data included in the system log is greater than a second threshold;

[0082] In the case where the target service is a board management service, the log update information is determined to be used to instruct the target operating system to periodically update the system log during the execution of the target service.

[0083] Through the above content, the business type of the business handled by the target operating system is identified, so as to determine the output method of the system log of the operating system, thereby providing a guarantee for selecting the method for collecting the image output from the video output port and ensuring the accurate collection of log data.

[0084] As an optional embodiment, performing text recognition on the target image to obtain target log data includes:

[0085] Input the target image into a target recognition model to obtain reference log data output by the target recognition model, wherein the target recognition model is used to locate a text area in the target image, and correct a display angle of the target image according to a text area positioning result, perform image segmentation on the image with the corrected display angle to obtain a reference image recording log data, and determine the reference log data corresponding to the image features of the reference image from the image features and log data having a corresponding relationship;

[0086] Target data carrying a target keyword is identified from the reference log data, wherein the target keyword is a keyword used to indicate an execution state of a target service executed by a target operating system.

[0087] Optionally, in an embodiment of the present application, the target recognition model can be obtained by pre-training a candidate recognition model using training samples, or it can also be obtained by updating the parameters of the initial recognition model based on the recognition accuracy information of the recognition result output by the initial recognition model used to recognize the image before the current moment, that is, the recognition model is dynamically updated during use, and the model parameters under the current model settings are predicted based on historical usage data and then learned step by step, thereby achieving the expected recognition effect by dynamically updating the model parameters.

[0088] The present application outputs the system log in the form of an image by calling the video output port of the server. Since the video output port of the server outputs images of other services in addition to the output log data, the log data is extracted by performing keyword recognition on the data identified in the image, thereby ensuring the accuracy of the results of the identified log data.

[0089] As an optional embodiment, before inputting the target image into the target recognition model, the method further includes:

[0090] Obtaining recognition results of the candidate image by the initial recognition model in a reference time period before the current moment;

[0091] Calculating a difference value between the recognition result and the corresponding log data recorded in the candidate image to obtain the recognition accuracy of the initial recognition model;

[0092] Using a target decision model to detect a target benefit parameter of each parameter adjustment operation in the initial recognition model with the recognition accuracy among a plurality of parameter adjustment operations, wherein the target decision model is used to calculate the adjustment effect achieved by executing each parameter adjustment operation for a decision target, the decision target includes adjusting the recognition accuracy of the initial recognition model to a target recognition accuracy, and the target benefit parameter is used to indicate the adjustment effect;

[0093] The target parameter adjustment operation in which the target benefit parameter corresponding to the multiple parameter adjustment operations satisfies the target benefit condition is adopted to adjust the model parameters of the initial recognition model to obtain the target recognition model.

[0094] Optionally, in an embodiment of the present application, the training process of the recognition model of the present application can adopt the consideration of reinforcement learning, that is, the target decision model is a model constructed according to the training method of reinforcement learning, and the specific operations include: in order to recognize the image, the RapidOCR framework is set. The RapidOCR framework supports a variety of configurations. The types of light recognition models include ONNX-V4, ONNX-V3, NCNN-V3, etc. Each model supports the number of CPU cores, Padding value, scaling value, Box value, unClipRatio value, etc. Different models and parameters are suitable for different recognition scenarios. For the scenario of server operation and maintenance in this device, it is also necessary to adjust the model and parameters to achieve the best effect. Referring to the idea of ​​reinforcement learning, the model settings are vectorized. For example, the above three models can be transposed to values ​​of [0.8, 0.6, 0.4...], and the number of CPU cores can also be transposed to [1 (full core), 0.5 (half core), 0.1 (single core)...], and other parameters also take values ​​between [0, 1], so a model parameter vector (0.8, 0.5, 0.8, 0, 0.5...) can be obtained, and this value is the state S in the reinforcement learning algorithm. This module continuously records N different model settings, and the difference between each setting is the action A in the reinforcement learning algorithm. The model setting is changed after each M recognition, and the effect of these M recognitions, recognition efficiency, accuracy, etc. are recorded, and it is also transposed into a vector of [0, 1]. The difference in the effect of two different configurations can be calculated to obtain the reward Q in the reinforcement learning algorithm. The reinforcement learning algorithm is as follows:

[0095] Q(s,a)←Q(s,a)+a[r+γmax a′ Q(s′, a′)-Q(s, a)]

[0096] Through the above content, the recognition model is trained by referring to the reinforcement learning method, so as to achieve the iteration of the model parameter adjustment method according to the model recognition accuracy, so as to gradually adjust the model parameters to more accurate model parameters and improve the model recognition accuracy of the recognition model.

[0097] As an optional embodiment, before receiving the target execution request, the method further includes:

[0098] Receiving a target request for controlling the server to execute a target service;

[0099] In response to the target request, a target system file required for handling the target business is obtained, wherein the target system file records the operation logic of the operation required to be performed for handling the target business;

[0100] The target system file is added to a corresponding position in an operating system template to obtain the target operating system, wherein the operating system template records the calling logic for the script file and the calling logic for calling the video output port of the server to output the system log.

[0101] Optionally, in an embodiment of the present application, the target system files may include, but are not limited to, tools, scripts, drivers and other files required for server operation.

[0102] Through the above content, the operation control device configures the operating system template according to the needs of the target business requested by the target request by responding to the received target request, thereby realizing automatic and efficient configuration of the target operating system, optimizing the operating system configuration program, avoiding the occupation of human resources for configuring the operating system, and improving the configuration efficiency of the operating system.

[0103] In a preferred embodiment, after performing text recognition on the target image to obtain target log data, the method further includes:

[0104] generating a target instruction according to the target log data, wherein the target instruction is used to instruct the baseboard management controller to adjust the running state of the target operating system;

[0105] The target instruction is sent to the baseboard management controller.

[0106] Optionally, in an embodiment of the present application, the running state of the target operating system can be achieved by the baseboard management controller directly controlling the target operating system, such as the baseboard management controller controlling the start, stop or periodic execution of the operating system, etc. In addition, the running state of the target operating system can also be achieved by the baseboard management controller controlling the running state of the hardware device on the server, and the running state of the target operating system can be indirectly adjusted by adjusting the running state of the hardware device. This solution does not limit this.

[0107] Through the above content, the operation control device generates target instructions corresponding to the log data by analyzing the log data of the collected system log, thereby controlling the baseboard management controller to adjust the operating status of the target operating system, thereby improving the maintenance efficiency of service operation and maintenance by deploying the target operating system out-of-band.

[0108] This application proposes a server out-of-band operation and maintenance device, which combines classic BMC operation and maintenance with OCR technology, simplifies the communication method between BMC and LiveOS, improves the efficiency of interaction between BMC and LiveOS, and replaces the existing shared area solution, aiming to solve many of the problems mentioned above. Figure 3 is a schematic diagram of an optional operation control device structure according to an embodiment of the present application, such as Figure 3 As shown in the figure, it mainly consists of four parts, namely process control module, operation execution module, OCR analysis module and intelligent learning module. The following will simulate the actual server operation and maintenance process to describe the implementation plan of each module.

[0109] The process control module is responsible for controlling the overall server operation and maintenance process of this device, including the generation of LiveOS (i.e., the target operating system), BMC mounting actions, control of LiveOS execution of business, BMC image capture actions, OCR image content recognition actions, etc. Figure 4 is an optional operation control flow chart according to an embodiment of the present application, such as Figure 4As shown, here we take the board management operation (i.e., the target business is the board management business) as an example. First, this module packages the tools, scripts, drivers and other files required for board management into the LiveOS template (i.e., the operating system template) to generate a new LiveOS CD image. Then, call the BMC mount interface to mount LiveOS on the server, guide the server to restart from the CD medium, read LiveOS into the memory when the server starts, and enter the micro operating system. At this time, LiveOS executes the established script, obtains the board information on the server, and prints it to the standard output (i.e., calls the video output port to output the system log in the form of an image). At the same time, the background of this module calls the BMC image capture interface at fixed intervals. The BMC can capture the video signal of the server video output interface and obtain a screenshot. The OCR analysis module (i.e., the target recognition model) extracts the text information in the picture. Finally, call the BMC interface to uninstall LiveOS, restart the server, and the overall process ends.

[0110] The operation execution module is the main program for executing various operations in LiveOS. It is generally implemented in the form of python or shell scripts. It is responsible for monitoring whether there are scripts to be executed in the working directory when the server enters the system. If so, it performs various operations in a certain execution order and prints the operation log to the standard output. As mentioned above, the system-level operations include board management, stress testing, RAID configuration, etc. The amount of log content of these operations is very different, and the way of log printing is also different. Therefore, in order to meet the needs of various operations, the following three sets of log logic are designed in the operation execution module:

[0111] First, for logs that are output once and can be obtained in one screenshot, such as RAID configuration operations, only the configuration results and the server's RAID information need to be printed. Under normal circumstances, the number of characters can be controlled within 1,000. Such logs only need to be printed normally.

[0112] Second, for logs that are continuously output and cannot be fully captured in one screenshot, such as operations such as stress testing, the cycle of a stress test is about 2 to 10 hours (unlimited), and 60 to 300 logs will be output during this cycle (assuming that they are acquired every two minutes). These logs cannot be displayed on one screen. Therefore, a stack log mechanism is designed in this module, and all logs are numbered from 1 to N. A maximum of 20 logs can be stored in the stack, that is, a maximum of 20 logs can be displayed on the same screen. When the number of logs exceeds 20, for every 5 logs that exceed the number, these 5 new logs are pushed into the stack, and the earliest 5 logs are popped out of the stack, that is, the current 20 logs on the screen are cleared and the latest 20 logs in the stack are reprinted.

[0113] Third, there is another type of operation that requires one or more restarts during execution. For example, when upgrading a board, you need to restart the server once after the upgrade is completed to verify the upgrade result. For this type of operation, this module needs to add a timestamp prefix to the log when printing it. The process control module restarts the server after extracting the first log content. When extracting the second log, if the timestamp is updated, it can be determined to be a new log.

[0114] The OCR analysis module is responsible for processing the images captured by BMC and extracting the text information therein. OCR stands for Optical Character Recognition, which refers to the process of analyzing and identifying image files of text materials to obtain text and layout information. Figure 5 is an optional log data identification schematic diagram according to an embodiment of the present application, such as Figure 5As shown, the area where the text exists in the picture is detected by color contrast or light and dark distinction, and then the obtained text image (i.e., the target image) is corrected to obtain a more refined text outline, and then the text image is segmented by rows and columns in pixel blocks to obtain the basic features of the text image, and finally matched with the features in the data set, and then the final recognition result text data (i.e., target log data) is obtained after some post-processing. At present, there are many open source OCR frameworks. The RapidOCR framework is mainly used in this module. Compared with other frameworks, it supports more recognition models and is more easy to use. In this module, the dynamic library (.so) file of RapidOCR is called in the form of Java code, and then it is encapsulated into a Jar package and introduced into this device. When actually used, the recognition model is initialized first, the image file to be recognized is read into the file stream as the input of the model, the various parameters of the model are set, the recognition program is run, and the text data returned by the model is obtained. The intelligent learning module is responsible for continuously collecting the historical data generated by each operation in the long-term process of server operation and maintenance, dynamically adjusting the parameters of the recognition model, and analyzing the data to obtain the best effect. The RapidOCR framework supports a variety of configurations. The types of models include ONNX-V4, ONNX-V3, NCNN-V3, etc. Each model supports the number of CPU cores, Padding value, scaling value, Box value, unClipRatio value, etc. Different models and parameters are suitable for different recognition scenarios. For the server operation and maintenance scenario in this device, it is also necessary to adjust the model and parameters to achieve the best effect. Here, this module refers to the idea of ​​reinforcement learning and vectorizes the model settings. For example, the above three models can be transposed to values ​​of [0.8, 0.6, 0.4...], the number of CPU cores can also be transposed to [1 (full core), 0.5 (half core), 0.1 (single core)...], and other parameters also take values ​​between [0, 1], so a model parameter vector (0.8, 0.5, 0.8, 0, 0.5...) can be obtained. This value is the state S in the reinforcement learning algorithm. This module continuously records N different model settings. The difference between each setting is the action A in the reinforcement learning algorithm. After every M recognitions, the model setting is changed, and the effect of these M recognitions, recognition efficiency, accuracy, etc. are recorded. It is also transposed into a vector of [0, 1], and the difference between the effects of two different configurations is calculated to obtain the reward Q in the reinforcement learning algorithm. Based on the reinforcement learning algorithm: Q(s, a)←Q(s, a)+a[r+γmax a′ Q(s′, a′)-Q(s, a)]. When the historical data is accumulated large enough and after multiple learning processes, this model can infer that under the current model settings, the model parameters can be dynamically adjusted to achieve the expected best recognition effect.

[0115] The above embodiment proposes a method and device for out-of-band operation and maintenance of a server based on OCR, combines classic BMC operation and maintenance with OCR technology, designs a new LiveOS execution logic, implements the OCR recognition function based on the RapidOCR framework, and optimizes the OCR model based on the idea of ​​reinforcement learning, simplifies the communication method between BMC and LiveOS, improves the efficiency of interaction between BMC and LiveOS, and improves the overall server operation and maintenance capabilities.

[0116] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0117] In this embodiment, a log data collection device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0118] Figure 6 is a structural block diagram of a log data collection device according to an embodiment of the present application, such as Figure 6 As shown, it is applied to an operation control device, the operation control device is connected to a baseboard management controller in a server, and the baseboard management controller mounts the target operating system of the server in an out-of-band control manner. The device includes:

[0119] A first receiving module, configured to receive a target operation request, wherein the target operation request is used to request to operate the target operating system;

[0120] a processing module, configured to respond to the target operation request, control the baseboard management controller to call and run the target operating system on the server, wherein the target operating system is configured to output a system log of the target operating system through a video output port of the server;

[0121] An acquisition module, used for acquiring the target image captured by the baseboard management controller and sent by the video output port;

[0122] The recognition module is used to perform text recognition on the target image to obtain target log data, wherein the target log data is used to indicate the running status of the target operating system.

[0123] Through the above content, through the operation control device connected to the baseboard management controller deployed in the server, and mounting the target operating system of the server on the baseboard management controller through the out-of-band control method, the target operating system will output the system log of the target operating system through the video output port of the server, and then, when the target operation request is received, the baseboard management controller is controlled to call the operating system to run on the server, so that the log data of the target operating system will output an image carrying the system log through the video output port of the server, and then the system log of the target operating system can be collected by only collecting the target image output by the video output port through the baseboard management controller and performing text recognition. This process does not require the target operating system to call the physical interface of the baseboard management controller to transmit the system log to the baseboard management controller, nor does it need to divide the storage space in the baseboard management controller to cache the system log, so as to realize the instant collection and transmission of the system log. Therefore, the problem of low efficiency of log data collection in the related technology can be solved, and the effect of improving the efficiency of log data collection can be achieved.

[0124] Optionally, the acquisition module includes:

[0125] a determining unit, configured to determine log update information of the target operating system based on a business type of the target business handled by the server, wherein the log update information is used to indicate a log update status during operation of the target operating system;

[0126] An acquisition unit is used to acquire the target image output by the video output port by the baseboard management controller in a log acquisition method corresponding to the log update information, and send the target image to the operation control device.

[0127] Optionally, the acquisition unit is used to perform one of the following operations:

[0128] When the log update information is used to instruct the target operating system to output the system log after completing the target business, and the number of characters in the system log is less than or equal to a first threshold, detecting the execution status of the target business by the server; when it is determined that the server completes the target business, controlling the baseboard management controller to print the image output by the video output port to obtain the target image;

[0129] In the case where the log update information is used to instruct the target operating system to continuously output the system log during the execution of the target business, and the number of entries of log data included in the system log is greater than a second threshold, the baseboard management controller is controlled to print out a plurality of log images in sequence in the output image of the video output port according to the sequence of data numbers of the log data, wherein the target operating system is used to number the log data according to the sequence of the output log data, and display the log data on the video output port according to the sequence of data numbers of the log data, and the number of entries of log data allowed to be accommodated in the log image is less than or equal to the second threshold; the plurality of log images are sorted according to the sequence of the numbers of the log data recorded in the plurality of log images to obtain the target image;

[0130] In a case where the log update information is used to instruct the target operating system to periodically update the system log during execution of the target business, the baseboard management controller is controlled to print the image output by the video output port at a target printing frequency; a first image printed at a current moment is matched with a second image printed before the current moment; and when it is determined that the first image and the second image do not match each other, the first image is determined as the target image.

[0131] Optionally, the determining unit is configured to perform one of the following operations:

[0132] In a case where the target service is a disk array configuration service, determining that the log update information is used to instruct the target operating system to output the system log after completing the target service, and the number of characters in the system log is less than or equal to a first threshold;

[0133] In a case where the target service is a test service, determining that the log update information is used to instruct the target operating system to continuously output the system log during execution of the target service, and the number of entries of log data included in the system log is greater than a second threshold;

[0134] In the case where the target service is a board management service, the log update information is determined to be used to instruct the target operating system to periodically update the system log during the execution of the target service.

[0135] Optionally, the identification module includes:

[0136] An input unit, used to input the target image into a target recognition model to obtain reference log data output by the target recognition model, wherein the target recognition model is used to locate a text area in the target image, and correct a display angle of the target image according to a text area positioning result, perform image segmentation on the image with the corrected display angle, obtain a reference image recording log data, and determine the reference log data corresponding to the image features of the reference image from the image features and log data having a corresponding relationship;

[0137] The identification unit is used to identify target data carrying a target keyword from the reference log data, wherein the target keyword is a keyword used to indicate an execution state of a target service executed by a target operating system.

[0138] Optionally, the device further comprises:

[0139] A first acquisition module, used for acquiring, before inputting the target image into the target recognition model, a recognition result of the candidate image recognized by the initial recognition model within a reference time period before the current moment;

[0140] A calculation module, used for calculating the difference between the recognition result and the log data recorded in the corresponding candidate image, to obtain the recognition accuracy of the initial recognition model;

[0141] a detection module, configured to detect a target benefit parameter of each parameter adjustment operation in the initial recognition model having the recognition accuracy among a plurality of parameter adjustment operations using a target decision model, wherein the target decision model is configured to calculate an adjustment effect achieved by executing each parameter adjustment operation on a decision target, wherein the decision target includes adjusting the recognition accuracy of the initial recognition model to a target recognition accuracy, and the target benefit parameter is configured to indicate the adjustment effect;

[0142] The adjustment module is used to adjust the model parameters of the initial recognition model by adopting the target parameter adjustment operation in which the target benefit parameter corresponding to the multiple parameter adjustment operations meets the target benefit condition, so as to obtain the target recognition model.

[0143] Optionally, the device further comprises:

[0144] A second receiving module is used for receiving a target request for controlling the server to execute a target service before receiving the target operation request;

[0145] A second acquisition module is used to respond to the target request and acquire a target system file required for handling the target business, wherein the target system file records the operation logic of the operation required to be performed for handling the target business;

[0146] An adding module is used to add the target system file to the corresponding position in the operating system template to obtain the target operating system, wherein the operating system template records the calling logic for the script file and the calling logic for calling the video output port of the server to output the system log.

[0147] Optionally, the device further comprises:

[0148] The generating module generates a target instruction according to the target log data after performing text recognition on the target image to obtain the target log data, wherein the target instruction is used to instruct the baseboard management controller to adjust the running state of the target operating system;

[0149] The sending module is used to send the target instruction to the baseboard management controller.

[0150] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0151] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0152] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0153] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0154] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0155] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0156] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0157] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.

[0158] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0159] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0160] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for collecting log data, characterized in that: Applied to an operation control device, the operation control device is connected to a baseboard management controller in a server, and the baseboard management controller mounts a target operating system of the server in an out-of-band control manner, the method comprising: receiving a target operation request, wherein the target operation request is used to request to run the target operating system; in response to the target operation request, controlling the baseboard management controller to call and run the target operating system on the server, wherein the target operating system is used to output a system log of the target operating system through a video output port of the server; The baseboard management controller collects and sends a target image output by the video output port; and performs text recognition on the target image to obtain target log data, wherein the target log data is used to indicate the running status of the target operating system.

2. The method according to claim 1, characterized in that The step of acquiring the target image collected by the baseboard management controller and sending the target image output by the video output port includes: Determining log update information of the target operating system based on the business type of the target business handled by the server, wherein the log update information is used to indicate the log update status during the operation of the target operating system; The baseboard management controller is obtained to collect the target image output by the video output port according to the log collection method corresponding to the log update information, and the target image is sent to the operation control device.

3. The method according to claim 2, characterized in that The acquiring the target image output by the video output port according to the log collection method corresponding to the log update information by the baseboard management controller includes one of the following: When the log update information is used to instruct the target operating system to output the system log after completing the target business, and the number of characters in the system log is less than or equal to a first threshold, detecting the execution status of the target business by the server; when it is determined that the server completes the target business, controlling the baseboard management controller to print the image output by the video output port to obtain the target image; In the case where the log update information is used to instruct the target operating system to continuously output the system log during the execution of the target business, and the number of entries of log data included in the system log is greater than a second threshold, the baseboard management controller is controlled to print out a plurality of log images in sequence in the output image of the video output port according to the sequence of data numbers of the log data, wherein the target operating system is used to number the log data according to the sequence of the output log data, and display the log data on the video output port according to the sequence of data numbers of the log data, and the number of entries of log data allowed to be accommodated in the log image is less than or equal to the second threshold; the plurality of log images are sorted according to the sequence of the numbers of the log data recorded in the plurality of log images to obtain the target image; In a case where the log update information is used to instruct the target operating system to periodically update the system log during execution of the target business, the baseboard management controller is controlled to print the image output by the video output port at a target printing frequency; a first image printed at a current moment is matched with a second image printed before the current moment; and when it is determined that the first image and the second image do not match each other, the first image is determined as the target image.

4. The method according to claim 2, characterized in that: The determining the log update information of the target operating system based on the business type of the target business handled by the server includes one of the following: In a case where the target service is a disk array configuration service, determining that the log update information is used to instruct the target operating system to output the system log after completing the target service, and the number of characters in the system log is less than or equal to a first threshold; In a case where the target service is a test service, determining that the log update information is used to instruct the target operating system to continuously output the system log during execution of the target service, and the number of entries of log data included in the system log is greater than a second threshold; In the case where the target service is a board management service, the log update information is determined to be used to instruct the target operating system to periodically update the system log during the execution of the target service.

5. The method according to claim 1, characterized in that The performing text recognition on the target image to obtain target log data includes: Input the target image into a target recognition model to obtain reference log data output by the target recognition model, wherein the target recognition model is used to locate a text area in the target image, and correct a display angle of the target image according to a text area positioning result, perform image segmentation on the image with the corrected display angle to obtain a reference image recording log data, and determine the reference log data corresponding to the image features of the reference image from the image features and log data having a corresponding relationship; Target data carrying a target keyword is identified from the reference log data, wherein the target keyword is a keyword used to indicate an execution state of a target service executed by a target operating system.

6. The method according to claim 5, characterized in that Before inputting the target image into the target recognition model, the method further includes: Obtain recognition results of the candidate image recognized by the initial recognition model within a reference time period before the current moment; Calculating a difference value between the recognition result and the corresponding log data recorded in the candidate image to obtain the recognition accuracy of the initial recognition model; Using a target decision model to detect a target benefit parameter of each parameter adjustment operation in the initial recognition model with the recognition accuracy among a plurality of parameter adjustment operations, wherein the target decision model is used to calculate the adjustment effect achieved by executing each parameter adjustment operation for a decision target, the decision target includes adjusting the recognition accuracy of the initial recognition model to a target recognition accuracy, and the target benefit parameter is used to indicate the adjustment effect; The target parameter adjustment operation in which the target benefit parameter corresponding to the multiple parameter adjustment operations satisfies the target benefit condition is adopted to adjust the model parameters of the initial recognition model to obtain the target recognition model.

7. The method according to claim 1, characterized in that Before receiving the target execution request, the method further includes: Receiving a target request for controlling the server to execute a target service; In response to the target request, a target system file required for handling the target business is obtained, wherein the target system file records the operation logic of the operation required to be performed for handling the target business; The target system file is added to a corresponding position in an operating system template to obtain the target operating system, wherein the operating system template records the calling logic for the script file and the calling logic for calling the video output port of the server to output the system log.

8. The method according to claim 1, characterized in that After performing text recognition on the target image to obtain target log data, the method further includes: generating a target instruction according to the target log data, wherein the target instruction is used to instruct the baseboard management controller to adjust the running state of the target operating system; The target instruction is sent to the baseboard management controller.

9. A log data collection device, characterized in that: Applied to an operation control device, the operation control device is connected to a baseboard management controller in a server, and the baseboard management controller mounts a target operating system of the server in an out-of-band control manner, the device comprises: A first receiving module, configured to receive a target operation request, wherein the target operation request is used to request to operate the target operating system; a processing module, configured to respond to the target operation request, control the baseboard management controller to call and run the target operating system on the server, wherein the target operating system is configured to output a system log of the target operating system through a video output port of the server; The acquisition module is used to acquire the target image collected by the baseboard management controller and sent by the video output port; the recognition module is used to perform text recognition on the target image to obtain target log data, wherein the target log data is used to indicate the operation status of the target operating system.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 8 when executed by a processor.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Data transmission method, device, equipment and medium

    CN119402286A

  • Method for collecting and analyzing video data

    CN121357375A