Server log reporting control method and device, storage medium and electronic equipment

By adding and compiling control code in the server BIOS, filtering and writing target control files according to resource load status, the problem of lack of flexibility in adjusting the control option for server log reporting function in the existing technology is solved, and the operation of business is not interrupted In case, the log control options are flexibly adjusted to improve system performance and reliability.

CN119440956AActive Publication Date: 2025-02-14INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411571226.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-02-14
Estimated Expiration
2044-11-05

AI Technical Summary

Technical Problem

In the prior art, the control option adjustment method of the server log reporting function lacks flexibility, resulting in the continuous logging of a large amount of system resources in a high load or resource-constrained environment, affecting system performance, and even causing system crashes.

Method used

By adding and compiling control codes in the server's basic input and output system (BIOS), generating reference control files, filtering and writing target control files according to the server's resource load status, dynamically adjusting log control options, and realizing the server log reporting function Flexible control.

Benefits of technology

It realizes flexibly adjusting log control options without restarting the server or interrupting business operations, and intelligently control log reporting based on the server resource load status, improving the flexibility of adjusting control options for server log reporting function, avoiding system performance degradation and the risk of collapse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440956A_ABST
    Figure CN119440956A_ABST
Patent Text Reader

Abstract

The invention discloses a server log reporting control method and device, a storage medium and electronic equipment, and the server log reporting control method comprises the steps that a target memory is deployed in a server, and an operating system and a basic input and output system are operated in the server; a basic input / output system is used for executing files in a target memory, and the method is applied to an operating system and comprises the following steps: under the condition that a server runs a server service, respectively adding a plurality of sections of control codes into system source codes of the basic input / output system to obtain a plurality of reference system codes; compiling a plurality of reference system codes to obtain reference control files of a plurality of target file types; screening out a target control file matched with the current resource load state of the server from the plurality of reference control files; and writing the target control file into the target memory, thereby solving the problem that the control option adjustment mode of the log reporting function of the server lacks flexibility and the like in related technologies.
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 in particular, to a method and device for controlling the reporting of server logs, a storage medium, and an electronic device. Background Art

[0002] In today's information technology era, the stability and reliability of server systems are critical to business operations. Especially in the field of cloud computing and big data processing, the system needs to continuously process large amounts of data, and any performance bottleneck or stability issues may lead to huge economic losses. Therefore, being able to monitor and adjust system performance in real time, especially the detection and reporting of memory errors, is crucial to maintaining the efficient operation of the system.

[0003] In the prior art, the control option of the server log reporting function is turned on by default after the server system is started, and cannot be changed during the operation of the server system, that is, the error logs generated by the server system will be uploaded to the administrator in real time, but continuous log recording will occupy a large amount of system resources and affect system performance, especially in a high-load or resource-constrained environment, such resource occupation may cause system performance to degrade or even crash. Usually after the server system is turned on, if the administrator wants to adjust the control option of the server log reporting function to off, the system must be restarted or the BIOS (Basic Input Output System) must be upgraded to adjust the status, which is unrealistic in a server environment that needs to run 24 hours a day.

[0004] In view of the problem that the control option adjustment method of the server log reporting function in the related technology lacks flexibility, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a method and device for controlling the reporting of a server log, a storage medium, and an electronic device, so as to at least solve the problem that the control option adjustment method of the server log reporting function lacks flexibility in the related art.

[0006] According to an embodiment of the present application, a method for controlling the reporting of a server log is provided. A target storage is deployed in a server, an operating system and a basic input / output system are run in the server, and the basic input / output system is used to execute files in the target storage. The method is applied to the operating system, and includes:

[0007] When the server runs a server service, multiple control codes are added to the system source code of the basic input and output system to obtain multiple reference system codes, wherein each control code records a control operation of a log control option in the basic input and output system;

[0008] Compile multiple copies of the reference system code to obtain multiple reference control files of target file types, wherein the target file type is a file that the basic input and output system allows to be executed, and each of the multiple reference control files is used to indicate the execution of a corresponding control operation on the log control option, and the log control option is used to indicate whether the server calls the server resource to report the server log;

[0009] Filtering out a target control file that matches the current resource load status of the server from the plurality of reference control files, wherein the resource load status is used to indicate the current occupation of server resources in the server;

[0010] The target control file is written into the target storage.

[0011] Optionally, the adding of the multiple control codes to the system source code of the basic input and output system to obtain multiple reference system codes includes:

[0012] Locating a target function code for implementing a target function from the system source code, wherein the target function is an independently executed function that allows independent execution of system management tasks, and the target function code is a code in the system source code that is allowed to be modified;

[0013] Adding multiple sections of the control code to the target function code of the system source code respectively, to obtain multiple copies of the reference system code.

[0014] Optionally, the adding of the plurality of control codes to the target function code of the system source code to obtain a plurality of reference system codes comprises:

[0015] Add a read control code to the target function code of the system source code to obtain a system read code, wherein multiple sections of the control code include the read control code, the read control code records the state read operation of the log control option, the state read operation is used to read the current state of the log control option, and multiple reference system codes include the system read code; and / or add an enable control code to the target function code of the system source code to obtain a system enable code, wherein multiple sections of the control code include the enable control code, the enable control code records the state enable operation of the log control option, and the state enable operation is used to switch the log control option from the current state to the enabled state. Status, the log control option in the on status is used to instruct the server to call server resources to report server logs, and multiple copies of the reference system code include the system on code; and / or the closing control code is added to the target function code of the system source code to obtain the system closing code, wherein multiple sections of the control code include the closing control code, the closing control code records the status closing operation of the log control option, the status closing operation is used to switch the log control option from the current state to the closed state, and the log control option in the closed state is used to instruct the server to prohibit calling server resources to report server logs, and multiple copies of the reference system code include the system closing code.

[0016] Optionally, compiling multiple copies of the reference system code to obtain reference control files of multiple target file types includes:

[0017] Compiling a plurality of copies of the reference system code to obtain a plurality of initial control files of reference file types, wherein the files of the reference file type are files that the operating system allows to be executed;

[0018] A type conversion script is called to convert the plurality of initial control files into the target file type, thereby obtaining the plurality of reference control files of the target file type.

[0019] Optionally, compiling multiple copies of the reference system code to obtain reference control files of multiple target file types includes:

[0020] Compile the system read code to obtain a reference read control file of the target file type, wherein multiple copies of the reference system code include the system read code, the system read code is obtained by adding the read control code to the target function code of the system source code, multiple sections of the control code include the read control code, the read control code records the status read operation of the log control option, the status read operation is used to read the current status of the log control option, the target function code is the code in the system source code that is allowed to be modified, and the reference control file includes the reference read control file; and / or compile the system enable code to obtain a reference enable control file of the target file type, wherein multiple copies of the reference system code include the system enable code, the system enable code is obtained by adding the enable control code to the target function code of the system source code, multiple sections of the control code include the enable control code, The opening control code records the state opening operation of the log control option, and the state opening operation is used to switch the log control option from the current state to the opening state. The target function code is the code that is allowed to be modified in the system source code, and the reference control file includes the reference opening control file; and / or compiles the system closing code to obtain the reference closing control file of the target file type, wherein multiple copies of the reference system code include the system closing code, and the system closing code is obtained by adding the closing control code to the target function code of the system source code, and multiple sections of the control code include the closing control code, and the closing control code records the state closing operation of the log control option, and the state closing operation is used to switch the log control option from the current state to the closing state. The target function code is the code that is allowed to be modified in the system source code, and the reference control file includes the reference closing control file.

[0021] Optionally, the step of selecting a target control file that matches the current resource load state of the server from the plurality of reference control files includes:

[0022] In the case where the resource load state is a first load state, the reference close control file and the reference read control file among the multiple reference control files are determined as the target control files, wherein the first load state is used to indicate that the occupation parameter of the current server resource in the server is greater than the target parameter threshold, the reference close control file is used to perform the state close operation, and the reference read control file is used to perform the state read operation after the state close operation is completed;

[0023] When the resource load state is the second load state, the reference open control file and the reference read control file among the multiple reference control files are determined as the target control files, wherein the second load state is used to indicate that the occupancy parameter of the current server resources in the server is less than or equal to the target parameter threshold, the reference open control file is used to execute the state open operation, and the reference read control file is used to execute the state read operation after the state open operation is completed.

[0024] Optionally, before selecting a target control file that matches the current resource load state of the server from the plurality of reference control files, the method further includes:

[0025] Detect the current resource load rate of the server; when the resource load rate is greater than a target load rate threshold, determine that the current resource load state of the server is a first load state; when the resource load rate is less than or equal to the target load rate threshold, determine that the current resource load state of the server is a second load state; or receive a control instruction currently input by a target account; when a first control instruction is detected, determine that the current resource load state of the server is a first load state; when a second control instruction is detected, determine that the current resource load state of the server is a second load state, wherein the first control instruction is used to instruct the execution of the state closing operation on the log control option, and the second control instruction is used to instruct the execution of the state opening operation on the log control option.

[0026] According to another embodiment of the embodiment of the present application, a reporting control device for a server log is further provided, wherein a target storage is deployed in a server, an operating system and a basic input / output system are run in the server, and the basic input / output system is used to execute files in the target storage. The device is applied to the operating system and includes:

[0027] An adding module, used for adding a plurality of control codes to the system source code of the basic input and output system respectively when the server runs the server service, so as to obtain a plurality of reference system codes, wherein each control code records a control operation of a log control option in the basic input and output system;

[0028] A compiling module, used for compiling a plurality of the reference system codes to obtain a plurality of reference control files of target file types, wherein the files of the target file types are files that the basic input and output system allows to execute, and each of the plurality of the reference control files is used for indicating the execution of a corresponding control operation on the log control option, and the log control option is used for indicating whether the server calls the server resources to report the server log;

[0029] A screening module, used to screen out a target control file that matches the current resource load status of the server from the plurality of reference control files, wherein the resource load status is used to indicate the current occupancy of server resources in the server;

[0030] A writing module is used to write the target control file into the target storage.

[0031] According to another embodiment of the present application, a computer program product is provided, including a computer program, wherein the computer program is executed by a processor to perform the steps in any of the above method embodiments.

[0032] 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.

[0033] 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.

[0034] In an embodiment of the present application, a method for controlling the reporting of a server log is proposed. A target memory is deployed in the server. An operating system and a basic input / output system are run in the server. The basic input / output system can execute files in the target memory. When the server runs server services, the operating system first adds multiple control codes to the system source code of the basic input / output system respectively to obtain multiple reference system codes. Each control code records a control operation of a log control option in the basic input / output system. Then, the multiple reference system codes are compiled to obtain multiple reference control files of target file types. Files of the target file type are files that the basic input / output system allows to be executed. Each of the multiple reference control files can indicate the execution of a corresponding control operation on the log control option. The log control option can indicate whether the server calls a server resource to report the service. server log; finally, a target control file matching the current resource load status of the server is screened out from multiple reference control files, the resource load status can indicate the current occupancy of server resources in the server, and then the target control file is written into the target memory. In the above control method, even when the server is running server business, the control code is written into the basic input and output system by the operating system, so that the log control options can be adjusted without restarting the server or interrupting business operation, and according to the server resource load status, the target control file matching the current resource load status is screened, thereby realizing an intelligent reporting control method for the server log. The above technical solution is adopted to solve the problem of lack of flexibility in the control option adjustment method of the server log reporting function in the related technology, and achieves the technical effect of improving the flexibility of the control option adjustment method of the server log reporting function. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a hardware structure block diagram of a computer device of a server log reporting control method according to an embodiment of the present application;

[0036] Figure 2 It is a flow chart of a method for controlling the reporting of server logs according to an embodiment of the present application;

[0037] Figure 3 is a schematic diagram of a server structure according to an embodiment of the present application;

[0038] Figure 4 It is a schematic diagram of a flow chart of a reporting control instruction control of a server log according to an embodiment of the present application;

[0039] Figure 5 It is a schematic diagram of a server log reporting control process according to an embodiment of the present application;

[0040] Figure 6It is a structural block diagram of a server log reporting control device according to an embodiment of the present application;

[0041] Figure 7 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

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

[0043] 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.

[0044] 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 computer device for a method for controlling the reporting of server logs in 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 are shown.

[0045] 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 reporting control method of the server log 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.

[0046] 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.

[0047] In this embodiment, a method for controlling the reporting of server logs is provided. A target storage is deployed in a server. An operating system and a basic input / output system are run in the server. The basic input / output system is used to execute files in the target storage. The method is applied to the operating system. Figure 2 is a flow chart of a method for controlling the reporting of server logs according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0048] Step S12, when the server runs a server service, adding multiple control codes to the system source code of the basic input and output system to obtain multiple reference system codes, wherein each control code records a control operation of a log control option in the basic input and output system;

[0049] Step S14, compile multiple copies of the reference system code to obtain multiple reference control files of target file types, wherein the target file type is a file that the basic input and output system allows to be executed, and each of the multiple reference control files is used to indicate the execution of a corresponding control operation on the log control option, and the log control option is used to indicate whether the server calls the server resource to report the server log;

[0050] Step S16, selecting a target control file that matches the current resource load status of the server from the plurality of reference control files, wherein the resource load status is used to indicate the current occupancy of server resources in the server;

[0051] Step S18, writing the target control file into the target storage.

[0052] Optionally, in this embodiment, Figure 3 is a schematic diagram of a server structure according to an embodiment of the present application, such as Figure 3As shown, the server may be deployed with, but not limited to, components including an operating system, a basic input / output system, and a target memory, wherein the operating system may be Linux, Windows Server, Unix, etc.; the basic input / output system is BIOS; the target memory is any type of memory used to store data and run data, including RAM (Random Access Memory), SSD (Solid State Drive), and DRAM (Dynamic Random Access Memory), etc., and data / files may be transmitted between the operating system and the basic input / output system through, but not limited to, the target memory.

[0053] Optionally, in this embodiment, SCI (SMM Code Injection) function support is enabled in the BIOS, wherein the SCI function allows the operating system to inject specific code into the SMM (System Management Mode) of the BIOS without error restarting the system. In the SMM mode, the system can execute some underlying operations that were originally in a read-only state and could not be updated in the system.

[0054] Optionally, in this embodiment, assuming that there are three control codes, namely code A0 (read), code B0 (turn on) and code C0 (turn off), the operating system adds the above three code segments to the SCI function module of the BIOS source code respectively, and obtains three reference system codes: code A1 (read), code B1 (turn on) and code C1 (turn off), compiles the three reference system codes, and obtains reference control files of three target file types: file A1 (performs a read operation on the log control option), file B1 (performs an turn on operation on the log control option) and file C1 (performs a turn off operation on the log control option), wherein the log control option can indicate whether the server is allowed to use server resources to report server logs, and the target file type indicates a file type that can be executed by the BIOS system, such as a cap type.

[0055] Optionally, in this embodiment, according to the current occupancy of server resources in the server, a file matching the current resource load status of the server is selected from file A1, file B1 and file C1 as a target control file, and then the target control file is written into the target storage.

[0056] As an optional solution, the multiple control codes are added to the system source code of the basic input and output system respectively to obtain multiple reference system codes, including:

[0057] S21, locating a target function code for realizing a target function from the system source code, wherein the target function is an independently executed function, the function belonging to the independently executed type allows to independently execute a system management task, and the target function code is a code in the system source code that is allowed to be modified;

[0058] S22, adding the multiple sections of the control code to the target function code of the system source code respectively to obtain multiple copies of the reference system code.

[0059] Optionally, in this embodiment, the operating system adds the control codes, i.e., code A0 (read), code B0 (turn on), and code C0 (turn off), respectively, to the SCI function module of the BIOS source code to obtain three reference system codes in the following manner, but not limited to: determining in the BIOS system source code a code block that can independently execute system management tasks and is allowed to be modified, i.e., the target function code, and then adding code A0 (read), code B0 (turn on), and code C0 (turn off) respectively to the code blocks located above to obtain the reference system codes: code A1 (read), code B1 (turn on), and code C1 (turn off).

[0060] As an optional solution, the multiple control codes are added to the target function code of the system source code to obtain multiple copies of the reference system code, including:

[0061] S31, adding a read control code to the target function code of the system source code to obtain a system read code, wherein multiple sections of the control code include the read control code, the read control code records the state read operation of the log control option, the state read operation is used to read the current state of the log control option, and multiple copies of the reference system code include the system read code; and / or S32, adding an enable control code to the target function code of the system source code to obtain a system enable code, wherein multiple sections of the control code include the enable control code, the enable control code records the state enable operation of the log control option, and the state enable operation is used to switch the log control option from the current state to The on state, the log control option in the on state is used to instruct the server to call server resources to report server logs, and multiple copies of the reference system code include the system on code; and / or S33, adding the off control code to the target function code of the system source code to obtain the system off code, wherein multiple sections of the control code include the off control code, the off control code records the state off operation of the log control option, the state off operation is used to switch the log control option from the current state to the off state, the log control option in the off state is used to instruct the server to prohibit calling server resources to report server logs, and multiple copies of the reference system code include the system off code.

[0062] Optionally, in this embodiment, the read control code can indicate the current state of the read log control option, which can be but is not limited to code A0. Code A0 is added to the target function code in the BIOS system, and the system read code obtained can be but is not limited to code A1; the turn-on control code can indicate switching the log control option from the current state to the turn-on state, that is, allowing the server to call server resources to report server logs, which can be but is not limited to code B0. Code B0 is added to the target function code in the BIOS system, and the system turn-on code obtained can be but is not limited to code B1; the turn-off control code can indicate switching the log control option from the current state to the turn-off state, that is, prohibiting the server from calling server resources to report server logs, which can be but is not limited to code C0. Code C0 is added to the target function code in the BIOS system, and the system turn-off code obtained can be but is not limited to code C1.

[0063] As an optional solution, compiling multiple copies of the reference system code to obtain reference control files of multiple target file types includes:

[0064] S41, compile multiple copies of the reference system code to obtain multiple initial control files of reference file types, wherein the files of the reference file type are files that the operating system allows to be executed;

[0065] S42, calling a type conversion script to convert the multiple initial control files into the target file type, and obtaining the multiple reference control files of the target file type.

[0066] Optionally, in this embodiment, three copies of reference system code are compiled to obtain three initial control files of reference file types: file A0 (performs a read operation on the log control option), file B0 (performs an open operation on the log control option) and file C0 (performs a close operation on the log control option), and then the type conversion script is called to convert the initial control file into a reference control file of the target file type: file A1, file B1 and file C1, wherein the reference file type represents a file type that can be executed by the operating system (such as an efi type), and the target file type represents a file type that can be executed by the BIOS system (such as a cap type). For example, the compilation process can be: first compile the three copies of reference system code into three efi type files (file A0, file B0 and file C0), and then use the GenerateCapsule script (equivalent to the above-mentioned type conversion script) to package the efi type files and related data into cap type files (file A1, file B1 and file C1).

[0067] As an optional solution, compiling multiple copies of the reference system code to obtain reference control files of multiple target file types includes:

[0068] S51, compile the system read code to obtain a reference read control file of the target file type, wherein multiple copies of the reference system code include the system read code, the system read code is obtained by adding the read control code to the target function code of the system source code, multiple sections of the control code include the read control code, the read control code records the status read operation of the log control option, the status read operation is used to read the current status of the log control option, the target function code is the code in the system source code that is allowed to be modified, and the reference control file includes the reference read control file; and / or S52, compile the system start code to obtain a reference start control file of the target file type, wherein multiple copies of the reference system code include the system start code, the system start code is obtained by adding the start control code to the target function code of the system source code, and multiple sections of the control code include the start control code , the opening control code records the state opening operation of the log control option, the state opening operation is used to switch the log control option from the current state to the opening state, the target function code is the code that is allowed to be modified in the system source code, and the reference control file includes the reference opening control file; and / or S53, compile the system closing code to obtain the reference closing control file of the target file type, wherein a plurality of the reference system codes include the system closing code, the system closing code is obtained by adding the closing control code to the target function code of the system source code, a plurality of the control codes include the closing control code, the closing control code records the state closing operation of the log control option, the state closing operation is used to switch the log control option from the current state to the closing state, the target function code is the code that is allowed to be modified in the system source code, and the reference control file includes the reference closing control file.

[0069] Optionally, in this embodiment, the compilation system reads the code, which may be but is not limited to the compilation code A1, and obtains the reference read control file, which may be but is not limited to the file A1; the compilation system opens the code, which may be but is not limited to the compilation code B1, and obtains the reference opening control file, which may be but is not limited to the file B1; the compilation system closes the code, which may be but is not limited to the compilation code C1, and obtains the reference closing control file, which may be but is not limited to the file C1.

[0070] As an optional solution, the step of selecting a target control file that matches the current resource load state of the server from the plurality of reference control files includes:

[0071] S61, when the resource load state is a first load state, determining the reference close control file and the reference read control file among the multiple reference control files as the target control files, wherein the first load state is used to indicate that the occupation parameter of the current server resource in the server is greater than the target parameter threshold, the reference close control file is used to perform the state close operation, and the reference read control file is used to perform the state read operation after the state close operation is completed;

[0072] S62, when the resource load state is the second load state, the reference open control file and the reference read control file among the multiple reference control files are determined as the target control files, wherein the second load state is used to indicate that the occupancy parameter of the current server resource in the server is less than or equal to the target parameter threshold, the reference open control file is used to execute the state open operation, and the reference read control file is used to execute the state read operation after the state open operation is completed.

[0073] Optionally, in this embodiment, according to the current occupancy of server resources in the server, the method of screening files that match the current resource load status of the server from file A1, file B1 and file C1 as target control files can be but is not limited to: the threshold for judging the occupancy of server resources is preset to 80%, that is, the target parameter threshold is 80%. When the occupancy parameter of the current server resources in the server is greater than 80%, the operating system determines the current state as the first load state, and selects file C1 and file A1 as target control files, that is, prohibiting the server from calling server resources to report server logs, and reading the current state of the log control option; when the occupancy parameter of the current server resources is less than or equal to 80%, the operating system determines the current state as the second load state, and selects file B1 and file A1 as target control files, that is, allowing the server to call server resources to report server logs, and read the current state of the log control option.

[0074] As an optional solution, before selecting a target control file matching the current resource load status of the server from the plurality of reference control files, the method further includes:

[0075] S71, detecting the current resource load rate of the server; when the resource load rate is greater than the target load rate threshold, determining that the current resource load state of the server is a first load state; when the resource load rate is less than or equal to the target load rate threshold, determining that the current resource load state of the server is a second load state; or S72, receiving the control instruction currently input by the target account; when the first control instruction is detected, determining that the current resource load state of the server is a first load state; when the second control instruction is detected, determining that the current resource load state of the server is a second load state, wherein the first control instruction is used to instruct the execution of the state closing operation on the log control option, and the second control instruction is used to instruct the execution of the state opening operation on the log control option.

[0076] Optionally, in this embodiment, the operation of instructing to filter the target control file may be, but is not limited to, the following methods: in the first method, the operating system automatically detects the current resource load rate of the server in the background, and then filters out the target control file from the three reference control files; in the second method, the target account (administrator) inputs a control instruction related to the server resources, the operating system receives the input control instruction, determines whether the control instruction is the first control instruction or the second control instruction, and correspondingly determines whether the current resource load state of the server is the first load state or the second load state, and then executes the corresponding operation; in the third method, the target account (administrator) inputs a control instruction related to the log control option, the operating system receives the input control instruction, and selects the corresponding target control file according to the control instruction. In this embodiment, Figure 4 is a schematic diagram of a flow chart of a server log reporting control instruction control according to an embodiment of the present application, such as Figure 4 As shown, for example: when the operating system detects the control instruction -read, it selects file A1 as the target control file, that is, reads the current state of the log control option; when the operating system detects the control instruction -open, it selects file B1 as the target control file, and allows the server to call server resources to report server logs, and then selects file A1 as the target control file, that is, reads the current state of the log control option; when the operating system detects the control instruction -close, it selects file C1 as the target control file, and prohibits the server from calling server resources to report server logs, and then selects file A1 as the target control file, that is, reads the current state of the log control option. According to the above operations, whether to allow the server to call server resources to report server logs can be flexibly controlled in a variety of ways, and when the current state of the log control option is not remembered, the current state of the log control option can be read by inputting control instructions.

[0077] Optionally, in this embodiment, in order to better understand the process of the reporting control method of the above-mentioned server log, the reporting control process of the above-mentioned server log is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.

[0078] In this embodiment, a method for controlling the reporting of server logs is provided. Figure 5 is a schematic diagram of a server log reporting control process according to an embodiment of the present application, such as Figure 5 As shown, the main steps include: first, enabling support for the SCI function in the BIOS system source code, and embedding specific control codes (code A0 (read), code B0 (enable) and code C0 (disable)) therein, and the control codes are added to the BIOS through the SCI function module; then the BIOS source code containing the control code, namely the reference system code (code A1 (read), code B1 (enable) and code C1 (disable)) is compiled to generate three initial control files (SCI image files), and then the GenerateCapsule script is used to convert the initial control files into SCI-capsule files of the cap type executable by the BIOS system, namely the reference control files (files A1, B1 and C1); finally, the operating system dynamically selects and loads the reference control file and executes the response operation according to the current resource load status of the server or the control instructions input by the target account.

[0079] 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.

[0080] In this embodiment, a reporting control device for a server log is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements 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.

[0081] Figure 6is a structural block diagram of a server log reporting control device according to an embodiment of the present application, such as Figure 6 As shown, a target storage is deployed in a server, an operating system and a basic input / output system are run in the server, the basic input / output system is used to execute files in the target storage, and the device is applied to the operating system, including:

[0082] An adding module 602 is used to add multiple control codes to the system source code of the basic input and output system respectively when the server runs the server service, so as to obtain multiple reference system codes, wherein each control code records a control operation of the log control option in the basic input and output system;

[0083] A compiling module 604 is used to compile multiple copies of the reference system code to obtain multiple reference control files of target file types, wherein the target file type is a file that the basic input and output system allows to be executed, and each of the multiple reference control files is used to indicate the execution of a corresponding control operation on the log control option, and the log control option is used to indicate whether the server calls the server resource to report the server log;

[0084] A screening module 606 is used to screen out a target control file that matches the current resource load status of the server from the plurality of reference control files, wherein the resource load status is used to indicate the current occupancy of server resources in the server;

[0085] The writing module 608 is used to write the target control file into the target storage.

[0086] In an exemplary embodiment, the adding module comprises:

[0087] a locating unit, configured to locate a target function code for realizing a target function from the system source code, wherein the target function is an independently executed function, the function belonging to the independently executed type allows to independently execute a system management task, and the target function code is a code in the system source code that is allowed to be modified;

[0088] The adding unit is used to add multiple sections of the control code to the target function code of the system source code respectively to obtain multiple copies of the reference system code.

[0089] In an exemplary embodiment, the adding unit is used to:

[0090] Add a read control code to the target function code of the system source code to obtain a system read code, wherein multiple sections of the control code include the read control code, the read control code records the state read operation of the log control option, the state read operation is used to read the current state of the log control option, and multiple reference system codes include the system read code; and / or add an enable control code to the target function code of the system source code to obtain a system enable code, wherein multiple sections of the control code include the enable control code, the enable control code records the state enable operation of the log control option, and the state enable operation is used to switch the log control option from the current state to the enabled state. Status, the log control option in the on status is used to instruct the server to call server resources to report server logs, and multiple copies of the reference system code include the system on code; and / or the closing control code is added to the target function code of the system source code to obtain the system closing code, wherein multiple sections of the control code include the closing control code, the closing control code records the status closing operation of the log control option, the status closing operation is used to switch the log control option from the current state to the closed state, and the log control option in the closed state is used to instruct the server to prohibit calling server resources to report server logs, and multiple copies of the reference system code include the system closing code.

[0091] In an exemplary embodiment, the compiling module includes:

[0092] A compiling unit, used for compiling a plurality of copies of the reference system code to obtain a plurality of initial control files of reference file types, wherein the files of the reference file types are files that the operating system allows to execute;

[0093] The conversion unit is used to call a type conversion script to convert the multiple initial control files into the target file type, so as to obtain the multiple reference control files of the target file type.

[0094] In an exemplary embodiment, the compilation unit is used to:

[0095] Compile the system read code to obtain a reference read control file of the target file type, wherein multiple copies of the reference system code include the system read code, the system read code is obtained by adding the read control code to the target function code of the system source code, multiple sections of the control code include the read control code, the read control code records the status read operation of the log control option, the status read operation is used to read the current status of the log control option, the target function code is the code in the system source code that is allowed to be modified, and the reference control file includes the reference read control file; and / or compile the system enable code to obtain a reference enable control file of the target file type, wherein multiple copies of the reference system code include the system enable code, the system enable code is obtained by adding the enable control code to the target function code of the system source code, multiple sections of the control code include the enable control code, The opening control code records the state opening operation of the log control option, and the state opening operation is used to switch the log control option from the current state to the opening state. The target function code is the code that is allowed to be modified in the system source code, and the reference control file includes the reference opening control file; and / or compiles the system closing code to obtain the reference closing control file of the target file type, wherein multiple copies of the reference system code include the system closing code, and the system closing code is obtained by adding the closing control code to the target function code of the system source code, and multiple sections of the control code include the closing control code, and the closing control code records the state closing operation of the log control option, and the state closing operation is used to switch the log control option from the current state to the closing state. The target function code is the code that is allowed to be modified in the system source code, and the reference control file includes the reference closing control file.

[0096] In an exemplary embodiment, the screening module comprises:

[0097] A first determining unit is used to determine the reference closing control file and the reference reading control file among the multiple reference control files as the target control file when the resource load state is a first load state, wherein the first load state is used to indicate that the occupation parameter of the current server resource in the server is greater than the target parameter threshold, the reference closing control file is used to perform the state closing operation, and the reference reading control file is used to perform the state reading operation after the state closing operation is completed;

[0098] A second determination unit is used to determine the reference start control file and the reference read control file among the multiple reference control files as the target control files when the resource load state is a second load state, wherein the second load state is used to indicate that the occupancy parameter of the current server resource in the server is less than or equal to the target parameter threshold, the reference start control file is used to execute the state start operation, and the reference read control file is used to execute the state read operation after the state start operation is completed.

[0099] In an exemplary embodiment, the apparatus further comprises:

[0100] A detection module, used for detecting the current resource load rate of the server before selecting a target control file matching the current resource load state of the server from the multiple reference control files; determining that the current resource load state of the server is a first load state when the resource load rate is greater than a target load rate threshold; determining that the current resource load state of the server is a second load state when the resource load rate is less than or equal to the target load rate threshold; or a receiving module, used for receiving a control instruction currently input by a target account; determining that the current resource load state of the server is a first load state when the first control instruction is detected; determining that the current resource load state of the server is a second load state when the second control instruction is detected, wherein the first control instruction is used to instruct the execution of the state closing operation on the log control option, and the second control instruction is used to instruct the execution of the state opening operation on the log control option.

[0101] 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.

[0102] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method described in each embodiment of the present application; the computer program product also includes a non-volatile computer-readable storage medium, which stores the computer program, and when executed by a processor, implements the steps of the method described in each embodiment of the present application.

[0103] 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.

[0104] 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.

[0105] An embodiment of the present application further provides an electronic device, Figure 7 is a schematic diagram of an electronic device according to an embodiment of the present application, such as Figure 7 As shown, the electronic device includes a memory and a processor, 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.

[0106] 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.

[0107] 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.

[0108] 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.

[0109] 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 controlling the reporting of server logs, characterized in that: A target storage is deployed in a server, an operating system and a basic input / output system are run in the server, the basic input / output system is used to execute files in the target storage, and the method is applied to the operating system, including: When the server runs a server service, multiple control codes are added to the system source code of the basic input and output system to obtain multiple reference system codes, wherein each control code records a control operation of a log control option in the basic input and output system; Compile multiple copies of the reference system code to obtain multiple reference control files of target file types, wherein the target file type is a file that the basic input and output system allows to be executed, and each of the multiple reference control files is used to indicate the execution of a corresponding control operation on the log control option, and the log control option is used to indicate whether the server calls the server resource to report the server log; Filtering out a target control file that matches the current resource load status of the server from the plurality of reference control files, wherein the resource load status is used to indicate the current occupation of server resources in the server; The target control file is written into the target storage.

2. The method according to claim 1, characterized in that The multiple control codes are added to the system source code of the basic input and output system to obtain multiple reference system codes, including: Locating a target function code for implementing a target function from the system source code, wherein the target function is an independently executed function that allows independent execution of system management tasks, and the target function code is a code in the system source code that is allowed to be modified; Adding multiple sections of the control code to the target function code of the system source code respectively, to obtain multiple copies of the reference system code.

3. The method according to claim 2, characterized in that The step of adding the plurality of control codes to the target function code of the system source code to obtain a plurality of reference system codes comprises: Adding a read control code to the target function code of the system source code to obtain a system read code, wherein the multiple control codes include the read control code, the read control code records a status read operation of the log control option, the status read operation is used to read the current status of the log control option, and the multiple reference system codes include the system read code; and / or Adding an enable control code to the target function code of the system source code to obtain a system enable code, wherein a plurality of sections of the control code include the enable control code, the enable control code records the state enable operation of the log control option, the state enable operation is used to switch the log control option from the current state to the enable state, the log control option in the enable state is used to instruct the server to call server resources to report server logs, and a plurality of reference system codes include the system enable code; and / or Add a shutdown control code to the target function code of the system source code to obtain a system shutdown code, wherein multiple sections of the control code include the shutdown control code, the shutdown control code records the state shutdown operation of the log control option, the state shutdown operation is used to switch the log control option from the current state to the closed state, the log control option in the closed state is used to instruct the server to prohibit calling server resources to report server logs, and multiple copies of the reference system code include the system shutdown code.

4. The method according to claim 1, characterized in that: The compiling of the plurality of reference system codes to obtain reference control files of a plurality of target file types includes: Compiling a plurality of copies of the reference system code to obtain a plurality of initial control files of reference file types, wherein the files of the reference file type are files that the operating system allows to be executed; A type conversion script is called to convert the plurality of initial control files into the target file type, thereby obtaining the plurality of reference control files of the target file type.

5. The method according to claim 1, characterized in that The compiling of the plurality of reference system codes to obtain reference control files of a plurality of target file types includes: Compile the system read code to obtain a reference read control file of the target file type, wherein a plurality of the reference system codes include the system read code, the system read code is obtained by adding the read control code to the target function code of the system source code, a plurality of sections of the control code include the read control code, the read control code records the status read operation of the log control option, the status read operation is used to read the current status of the log control option, the target function code is the code in the system source code that is allowed to be modified, and the reference control file includes the reference read control file; and / or Compile the system enable code to obtain a reference enable control file of the target file type, wherein a plurality of the reference system codes include the system enable code, the system enable code is obtained by adding the enable control code to the target function code of the system source code, a plurality of the control codes include the enable control code, the enable control code records the state enable operation of the log control option, the state enable operation is used to switch the log control option from the current state to the enable state, the target function code is the code in the system source code that is allowed to be modified, and the reference control file includes the reference enable control file; and / or Compile the system shutdown code to obtain a reference shutdown control file of the target file type, wherein a plurality of the reference system codes include the system shutdown code, the system shutdown code is obtained by adding the shutdown control code to the target function code of the system source code, a plurality of sections of the control code include the shutdown control code, the shutdown control code records the state shutdown operation of the log control option, the state shutdown operation is used to switch the log control option from the current state to the closed state, the target function code is the code in the system source code that is allowed to be modified, and the reference control file includes the reference shutdown control file.

6. The method according to claim 5, characterized in that The step of selecting a target control file that matches the current resource load status of the server from the plurality of reference control files includes: In the case where the resource load state is a first load state, the reference close control file and the reference read control file among the multiple reference control files are determined as the target control files, wherein the first load state is used to indicate that the occupation parameter of the current server resource in the server is greater than the target parameter threshold, the reference close control file is used to perform the state close operation, and the reference read control file is used to perform the state read operation after the state close operation is completed; When the resource load state is the second load state, the reference open control file and the reference read control file among the multiple reference control files are determined as the target control files, wherein the second load state is used to indicate that the occupancy parameter of the current server resources in the server is less than or equal to the target parameter threshold, the reference open control file is used to execute the state open operation, and the reference read control file is used to execute the state read operation after the state open operation is completed.

7. The method according to claim 6, characterized in that Before selecting a target control file that matches the current resource load status of the server from the plurality of reference control files, the method further includes: Detecting the current resource load rate of the server; when the resource load rate is greater than a target load rate threshold, determining that the current resource load state of the server is a first load state; when the resource load rate is less than or equal to the target load rate threshold, determining that the current resource load state of the server is a second load state; or Receive the control instruction currently input by the target account; when a first control instruction is detected, determine that the current resource load state of the server is a first load state; when a second control instruction is detected, determine that the current resource load state of the server is a second load state, wherein the first control instruction is used to instruct the execution of the state closing operation on the log control option, and the second control instruction is used to instruct the execution of the state opening operation on the log control option.

8. A server log reporting control device, characterized in that: A target storage is deployed in a server, an operating system and a basic input / output system are run in the server, the basic input / output system is used to execute files in the target storage, and the device is applied to the operating system, including: An adding module, used for adding a plurality of control codes to the system source code of the basic input and output system respectively when the server runs the server service, so as to obtain a plurality of reference system codes, wherein each control code records a control operation of a log control option in the basic input and output system; A compiling module, used for compiling a plurality of the reference system codes to obtain a plurality of reference control files of target file types, wherein the files of the target file types are files that the basic input and output system allows to execute, and each of the plurality of the reference control files is used for indicating the execution of a corresponding control operation on the log control option, and the log control option is used for indicating whether the server calls the server resources to report the server log; A screening module is used to screen out a target control file that matches the current resource load status of the server from the multiple reference control files, wherein the resource load status is used to indicate the current occupancy of server resources in the server; a writing module is used to write the target control file into the target memory.

9. 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 7 when executed by a processor.

10. 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 7 are implemented.

Citation Information

Patent Citations

  • Client log processing method and device and computer equipment

    CN113687974A

  • Intelligent log collecting and processing method and device, electronic equipment and storage medium

    CN114020565A

  • Distributed file system log improvement method, system and equipment and storage medium

    CN114443584A

  • Autobuild log anomaly detection methods and systems

    US20210342313A1