Baseline solution log control method and device, equipment, medium and program product
By assigning a unique identifier to each baseline and dynamically adjusting the log level, the problem of server performance degradation during baseline resolution and analysis was solved, achieving efficient log control and improved baseline resolution efficiency.
Patent Information
- Application Number
- CN202511440651.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-09
- Publication Date
- 2026-02-13
AI Technical Summary
In existing technologies, when baseline solution analysis requires low-level logs, the server log level must be set globally, which leads to decreased server performance and increased workload for log analysis.
Assign a unique identifier to each baseline, dynamically modify its log level based on the baseline identifier, print only the solution logs of specific baselines, and encapsulate the log printing logic using macro definitions to reduce invalid log output.
It improves baseline calculation efficiency, reduces server load, simplifies log control operations, and supports flexible adjustment and synchronization of baseline calculation logs.
Smart Images

Figure CN121523754A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of baseline solution, and in particular to a baseline solution log control method, device, equipment, medium and program product. BACKGROUND
[0002] NRTK (Network Real-Time Kinematic) is an important GNSS (Global Navigation Satellite System) positioning technology, which can be applied to map surveying, engineering surveying, unmanned aerial vehicle navigation and other fields. The core of NRTK is baseline solution, and high-precision position information can be obtained by solving the baseline formed between base stations.
[0003] When the solution effect of a certain baseline needs to be analyzed, low-level logs need to be obtained for analysis, and therefore the log level of the server running the baseline solution must be modified to make the server print low-level logs of all baselines, which will affect the server performance and reduce the solution efficiency. SUMMARY
[0004] The embodiments of the present application provide a baseline solution log control method, device, equipment, medium and program product to solve the problem that baseline solution analysis reduces solution efficiency.
[0005] In a first aspect, the embodiments of the present application provide a baseline solution log control method, which can be applied to a server, the server running a plurality of baseline solution instances and maintaining a separate log level variable for each baseline solution instance, the method comprising:
[0006] Obtaining configuration update information, the configuration update information including the identification of a target baseline and a current log level;
[0007] Setting the log level variable of the baseline solution instance corresponding to the identified baseline solution instance in the plurality of baseline solution instances to the current log level;
[0008] When the baseline solution instance generates a log, comparing the log level variable of the baseline solution instance with a preset parameter, and determining whether to print the log according to the comparison result.
[0009] In a possible implementation, the preset parameter includes a plurality of print constants, each print constant corresponding to a log level, the size of the print constant being proportional to the log level, the log level variable of the baseline solution instance being compared with the preset parameter, and whether to print the log being determined according to the comparison result, comprising:
[0010] For any baseline solving instance, the print constant is compared with the log level variable of the baseline solving instance in ascending order, and when the print constant is greater than or equal to the log level variable, the log is printed according to the log level corresponding to the print constant.
[0011] In a possible implementation, the method further comprises:
[0012] The log printing logic is encapsulated as a function through a macro definition, and the function of the macro definition is enabled when the baseline solving instance is run.
[0013] The log printing logic comprises comparing the log level variable of the baseline solving instance with a preset parameter, and determining whether to print the log according to the comparison result.
[0014] In a possible implementation, the configuration update information is obtained, comprising:
[0015] A preset configuration database is listened to, and the configuration database is used to record the identification of the baseline and the current log level.
[0016] If a new current log level is written in the configuration database, the new current log level and the identification of the corresponding baseline are obtained as the configuration update information.
[0017] In a possible implementation, the configuration database communicates with a Web server, the Web server provides a configuration management page to a Web client, and the Web server is used to update the configuration database according to the data obtained by the Web client through the configuration management page.
[0018] In a possible implementation, the Web server is further used to:
[0019] The base station number and the current log level sent by the Web client are received, and the base station number is associated with the identification of a plurality of baselines.
[0020] The identification of each baseline associated with the base station number and the current log level are taken as a group of data, and are written or updated to the configuration database in batches.
[0021] In a possible implementation, the configuration update information further comprises a validity period, and after the log level variable of the baseline solving instance corresponding to the identification in the plurality of baseline solving instances is set to the current log level, the method further comprises:
[0022] When the validity period ends, the log level variable is changed from the current log level to the original value.
[0023] In a second aspect, the embodiments of the present application provide a baseline solution log control device, which can be applied to a server, the server runs a plurality of baseline solution instances and maintains a separate log level variable for each baseline solution instance, the device comprises:
[0024] The acquisition module is configured to acquire configuration update information, the configuration update information comprising an identifier of a target baseline and a current log level;
[0025] The variable setting module is configured to set the log level variable of the baseline solution instance corresponding to the identified baseline solution instance among the plurality of baseline solution instances to the current log level;
[0026] The printing module is configured to, when the baseline solution instance generates a log, compare the log level variable of the baseline solution instance with a preset parameter, and determine whether to print the log according to a comparison result.
[0027] In a possible implementation, the printing module is further configured to, for any baseline solution instance, compare the print constants in ascending order with the log level variable of the baseline solution instance in sequence, and when a print constant is greater than or equal to the log level variable, print the log according to the log level corresponding to the print constant.
[0028] In a possible implementation, the variable setting module is further configured to encapsulate the log printing logic as a function through macro definition, and enable the function of the macro definition when running the baseline solution instance; wherein the log printing logic comprises comparing the log level variable of the baseline solution instance with a preset parameter, and determining whether to print the log according to a comparison result.
[0029] In a possible implementation, the acquisition module is further configured to listen to a preset configuration database, the configuration database being configured to record the identifier of the baseline and the current log level; and if a new current log level is written in the configuration database, acquire the new current log level and the identifier of the corresponding baseline as the configuration update information.
[0030] In a possible implementation, the configuration update information further comprises a validity period, and the variable setting module is further configured to, when the validity period ends, change the log level variable from the current log level to the original value.
[0031] In a third aspect, the embodiments of the present application provide an electronic device, comprising a memory and a processor.
[0032] The memory stores computer execution instructions;
[0033] The processor executes the computer execution instructions stored in the memory, so that the processor executes the first aspect and / or various possible implementations of the first aspect.
[0034] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores computer execution instructions. When the computer execution instructions are executed by a processor, the computer execution instructions are used to implement the first aspect and / or various possible implementation manners of the first aspect.
[0035] In a fifth aspect, an embodiment of the present application provides a computer program product, and the computer program product includes a computer program. When the computer program is executed by a processor, the computer program implements the first aspect and / or various possible implementation manners of the first aspect.
[0036] The baseline solution log control method, device, equipment, medium and program product provided by the embodiments of the present application can set the log level variable of the baseline solution instance corresponding to the target baseline identifier to the current log level by obtaining the configuration update information, and can determine whether to print the log according to the comparison result of the log level variable and the preset parameter when the baseline solution instance generates the log. The log level variable of each baseline is maintained through the baseline identifier, the log level of a specific baseline solution instance can be modified based on the variable and printed separately, without printing all baseline solution logs on the server, reducing invalid log output, reducing server load, and improving baseline solution efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0037] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.
[0038] Figure 1 A schematic diagram of an NRTK system architecture is provided as an example of the present application;
[0039] Figure 2 A baseline networking schematic diagram is provided as an example of the present application;
[0040] Figure 3 A flowchart of a baseline solution log control method is provided as an example of the embodiments of the present application;
[0041] Figure 4 A baseline solution log calling flowchart is provided as an example of the embodiments of the present application;
[0042] Figure 5 A structure diagram of a baseline solution log control device is provided as an example of the embodiments of the present application;
[0043] Figure 6 A structure diagram of an electronic device is provided as an example of the present application.
[0044] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0045] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0046] In an NRTK system, multiple CORS stations (Continuously Operating Reference Stations, also known as base stations) form a network. The relative positions between stations are calculated through baseline solution to provide high-precision real-time positioning services. Since there are numerous CORS stations and the baselines formed between them, a distributed computing architecture is typically used, with multiple servers solving different baselines in parallel.
[0047] Figure 1 This is a schematic diagram of an NRTK system architecture provided as an example in this application. Figure 1 As shown, the baseline calculation involves a network (NET) module, a preprocessing (PRE) module, an ephemeris service (EPH) module, and an atmospheric modeling (RIE) module. The network module is responsible for networking CORS stations to obtain the baseline; the preprocessing module is responsible for processing the observations; the ephemeris service module is responsible for providing navigation ephemeris; and the atmospheric modeling module is responsible for subsequent processing based on the baseline calculation results. The baseline calculation (BL) module can include multiple servers. After obtaining baseline data from upstream, it is distributed to the servers for calculation. The calculation of each baseline can be completed by a baseline calculation instance running on the server.
[0048] Figure 2 This is an exemplary baseline network diagram provided for this application. Figure 2 As shown, each baseline corresponds to two CORS stations. When there are many CORS stations, the number of baselines will also increase. The solution of these baselines will be handled by the server.
[0049] The smallest unit of the baseline solution module is a baseline. Since solving a baseline is a stateful process, meaning that the baseline solution for the current epoch needs to use some intermediate data from the epochs that have already been solved, it is necessary to check the logs of the baseline running continuously for a period of time when analyzing the effect of the baseline solution.
[0050] The log of the server running the baseline solution has multiple levels, and the lower the level, the more detailed the log content. Analyzing the baseline solution effect usually requires lower level logs, for example, when some baseline solution needs to be optimized or analyzed, debug level logs may be required.
[0051] In order to obtain the required log content, the global log level must be set (for example, set to debug level) when the server runs the baseline solution, and the number of baselines that the server needs to solve is large, which greatly increases the log amount of the server, affects the performance of the server, increases the pressure of the log collection system, and in most cases, the analysis is only for part of the baseline solution of a server, and the redundant logs also increase the workload of log analysis. Therefore, a scheme for obtaining specified baseline solution logs is urgently needed.
[0052] Based on this, the present application proposes a technical concept, which allocates a unique identifier to each baseline, decouples the log level of the baseline solution from the server, binds the log level to a single baseline according to the identifier of the baseline, and dynamically modifies the log level of a specific baseline according to the identifier, so that the server prints the solution log of the specific level of the baseline.
[0053] The technical scheme of the present application and how the technical scheme of the present application solves the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0054] Figure 3 A flowchart of a baseline solution log control method provided by an embodiment of the present application is shown in FIG. 1, which includes the following steps. Figure 3
[0055] Step S301, obtaining configuration update information.
[0056] The configuration update information includes the identifier of the target baseline and the current log level.
[0057] The baseline solution log control method of the embodiment of the present application can be applied to a server, which can run multiple baseline solution instances, each of which can solve a baseline, and each baseline can have a unique identifier.
[0058] In the embodiments of the present application, the server can maintain a separate log level variable for each baseline solving instance, and the initial value of the log level variable can be empty or a default value. For example, the server can maintain a baseline information registry, which can contain information of all the baselines solved on the server. The information can represent the mapping relationship among the identity of the baseline, the baseline solving instance, and the log level variable.
[0059] For example, the server can access a preset configuration database to obtain the identity of the baseline whose log level needs to be modified and the modified current log level from the database. If there are multiple servers responsible for baseline solving in the NRTK system, the database can record the baseline information whose log level needs to be modified on these servers, and each server can access the database to obtain the data.
[0060] In some other possible implementations, the configuration update information can also be obtained by loading a configuration file. For example, when a user needs to obtain the debug level log of a target baseline for solving, the identity of the target baseline and the debug level can be written into the configuration file as the configuration update information, and the server loads the configuration file.
[0061] Step S302, setting the log level variable of the baseline solving instance corresponding to the identity in the plurality of baseline solving instances to the current log level.
[0062] For example, after obtaining the identity of the target baseline and the current log level, the server can find the baseline solving instance corresponding to the target baseline in the maintained baseline information registry according to the identity, and issue the current log level to the baseline solving instance, and modify the value of the log level variable of the baseline solving instance to the current log level. For example, the identity of a baseline in the baseline information registry maintained by the server is 12345, and the log level variable of the baseline solving instance is empty by default, while in the configuration update information, the identity of the target baseline is 12345, and the current log level is debug. Therefore, the baseline solving instance corresponding to 12345 can be found through the baseline information registry, and the value of the log level variable of the baseline solving instance is set to debug.
[0063] Step S303, when the baseline solving instance generates a log, comparing the log level variable of the baseline solving instance with a preset parameter, and determining whether to print the log according to the comparison result.
[0064] The baseline solving instance can generate a log at runtime. The code of the baseline solving instance can be provided with a statement responsible for printing the log. When the statement is executed, the value of the log level variable can be compared with a preset parameter. According to the comparison result and a preset printing rule, it can be determined whether to print the log. The preset parameter can include a specific log level. For example, the preset parameter can be debug. For the baseline solving instance of the target baseline, the value of the log level variable is also debug. When the two are consistent, the debug level log of the baseline solving instance can be printed out for analyzing the solving effect.
[0065] In the above embodiment, by obtaining the configuration update information, the log level variable of the baseline solving instance corresponding to the target baseline identifier can be set as the current log level. When the baseline solving instance generates a log, it can be determined whether to print the log according to the comparison result of the log level variable and the preset parameter. By maintaining the log level variable of each baseline through the baseline identifier, the log level of a specific baseline solving instance can be modified based on the variable and printed separately. There is no need to print all baseline solving logs on the server, which reduces invalid log output, reduces server load, and improves baseline solving efficiency.
[0066] In addition, in the traditional way, the baseline solving log of a specific level is printed by modifying the log level of the server. If the baseline is scheduled to another server, the modified log level is invalid for the scheduled baseline, and the scheduled server must be reconfigured, which is cumbersome. In the above embodiment, the multiple servers responsible for baseline solving in the NRTK system can obtain the log level of the baseline from the configuration update information in real time and set it. After the baseline is scheduled to a new server, it does not need to be manually reconfigured, and the baseline solving log printing is not affected.
[0067] In one embodiment, the baseline solving log control method can further include:
[0068] The log printing logic is encapsulated as a function through a macro definition, and the function of the macro definition is enabled when the baseline solving instance is run.
[0069] The log printing logic includes comparing the log level variable of the baseline solving instance with a preset parameter, and determining whether to print the log according to the comparison result.
[0070] In the embodiments of the present application, the server as the running environment of the baseline solving instance can be defined in advance through a macro. The definition content can be related to the printing logic of the baseline solving log.
[0071] Exemplarily, the log printing function and the log comparison function can be generated by a macro definition. The log printing function can be used to print the log according to the log level. The log comparison function can be used to compare the log level variable of the baseline solving instance with the preset parameter, and determine whether to call the log printing function according to the comparison result.
[0072] Exemplarily, the log levels can be divided into trace, debug, info, warn, error and critical in order from low to high, and the lower the level, the more detailed the log content.
[0073] In the above embodiment, the related functions of the log printing are defined by the macro definition, so that the baseline solving instance can call the macro definition content to realize the printing of the log. Only the log printing code needs to be replaced by the macro definition content, and the solving code does not need to be greatly changed, and the runtime overhead is low.
[0074] In one embodiment, the preset parameter includes a plurality of printing constants, each printing constant corresponds to a log level, and the size of the printing constant is proportional to the log level. The log level variable of the baseline solving instance is compared with the preset parameter, and whether to print the log is determined according to the comparison result, including:
[0075] For any baseline solving instance, the printing constants are compared with the log level variable of the baseline solving instance in order from small to large. When the printing constant is greater than or equal to the log level variable, the log is printed according to the log level corresponding to the printing constant.
[0076] In the embodiment of the present application, a plurality of printing constants can be defined by a macro definition in advance, each constant corresponds to a log level, and the control of the log level is converted into the comparison of the values.
[0077] Exemplarily, the six log levels of trace, debug, info, warn, error and critical can be defined as six printing constants of 0, 1, 2, 3, 4 and 5 by a macro, and the baseline solving instance can automatically convert the log level into the corresponding value during compilation and running.
[0078] For example, in the configuration update information, the current log level of the target baseline is debug, and the baseline solving instance of the target baseline will automatically convert debug to 1 after obtaining the level. Then, the log comparison function in the macro definition is used to compare 0, 1, 2, 3, 4, 5 (printing constants) with 1 (current log level) in turn. 0 does not satisfy greater than or equal to 1, and 1 is continued to be compared. 1 satisfies greater than or equal to 1, and the log of the baseline solving instance can be printed according to the log level (debug) corresponding to 1.
[0079] The printing of the log can be implemented by calling a macro-defined log printing function.
[0080] In some possible implementation manners, the printing authority of the log printing function can be initialized as the lowest log level (i.e., the trace level), so that when the baseline solving instance runs, the log printing function has the authority to print the log according to the corresponding level regardless of the current log level obtained.
[0081] Figure 4 A baseline solving log calling flow schematic diagram provided in the embodiment of the present application is shown in FIG. 1. Figure 4 After the baseline solving instance runs, it can be detected whether the printing authority is successfully initialized as the trace level. If not, it waits for the initialization to be successful. If yes, the log is printed until the baseline solving instance ends, and the initialization is removed after the instance ends.
[0082] In some possible implementation manners, the corresponding log printing function can also be defined for each log level. For example, the LOG_DEBUG(…) function can be used to print the log according to the debug level, the LOG_INFO(…) function can be used to print the log according to the info level, and so on.
[0083] In the above embodiment, by defining the printing constant corresponding to the log level, the log control logic can be converted into a numerical comparison, further simplifying the log control of the baseline solving instance and reducing the service overhead.
[0084] In one embodiment, the configuration update information is obtained, including:
[0085] The preset configuration database is listened to. If a new current log level is written in the configuration database, the new current log level and the identifier of the corresponding baseline are obtained as the configuration update information.
[0086] The configuration database is used to record the identifier of the baseline and the current log level.
[0087] In the embodiment of the present application, the server can run a listening service to listen to the data change of the configuration database, and the data change includes new data writing and existing data updating.
[0088] For example, originally, the configuration database records a data "10001-info", which is updated to "10001-debug" based on the database instruction, indicating that the current log level of the baseline with the identifier "10001" is changed from info to debug. After the server listens to the change, "10001-debug" is read from the database as the configuration update information.
[0089] Exemplarily, a piece of data "10002-trace" is newly written in the configuration database, and the server listens to the change and reads "10002-trace" from the database as the configuration update information.
[0090] In the above embodiment, the mapping relationship between the baseline and the log level is stored in the configuration database, and multiple servers can listen to the database to realize the synchronous update and long-term maintenance of the baseline log level.
[0091] In one embodiment, the configuration database communicates with a web server, the web server provides a configuration management page to a web client, and the web server is configured to update the configuration database according to data obtained by the web client through the configuration management page.
[0092] In the embodiment of the present application, the baseline data in the configuration database can be set through a web page.
[0093] Exemplarily, the web client can run on a terminal device used by a user, the web server can provide page resources to the web client, the web client can provide a human-computer interaction interface to the user according to the page resources, the user can input the identifier of the baseline to be analyzed and the log level into the interface, the web client can transmit the data input by the user to the web server, the web server can generate a database update instruction according to the data and send the database update instruction to the configuration database, and the configuration database can execute the instruction.
[0094] In one embodiment, the web server can also be configured to:
[0095] receive the base station number and the current log level sent by the web client, associate the identifier of each baseline corresponding to the base station number with the current log level as a group of data, and write or update the group of data to the configuration database in batches.
[0096] The base station number is associated with multiple baseline identifiers.
[0097] In the embodiment of the present application, the web page can also support batch setting operation of the baseline log level. Each base station can correspond to multiple baselines, an association relationship between the base station and the baseline can be established, the number of the base station and the log level can be input in the configuration management page, and all the baselines associated with the base station can be set to the log level at one time.
[0098] For example, the identification of the baseline between base station A1 and base station B2 is 10002, the identification of the baseline between base station A1 and base station C3 is 10003, and the identification of the baseline between base station A1 and base station D4 is 10004. The user can input A1 and debug in the configuration management page. The web server can automatically generate 3 database update instructions and send them to the configuration database. After the configuration database executes these instructions, it writes new data "10002-debug", "10003-debug" and "10004-debug".
[0099] In the above embodiment, the baseline log level in the configuration database can be remotely and real-timely adjusted through the web page. The server can real-timely modify the log level of the baseline calculation instance through database change, which helps to study the baseline calculation effect online and improves the efficiency.
[0100] In one embodiment, the configuration update information further includes a validity period, and after setting the log level variable of the baseline calculation instance corresponding to the identification in the plurality of baseline calculation instances to the current log level, the method further includes:
[0101] When the validity period ends, the log level variable is changed from the current log level to the original value.
[0102] In one example, the validity period is 5 minutes, the current log level is debug, and after setting the log level variable of the baseline calculation instance to debug, the baseline calculation instance can print logs at the debug level for 5 minutes, and after 5 minutes, debug is changed back to the original value.
[0103] In the above manner, the low-level log printing duration can be set as needed without manual intervention. After the debugging ends on time, the original state is automatically restored, avoiding long-term opening of low-level logs due to forgetting and other factors, and saving log storage costs.
[0104] Figure 5 A structural schematic diagram of a baseline calculation log control device provided in the present application is shown in FIG. 1. The baseline calculation log control device 500 provided in the present embodiment includes: Figure 5
[0105] The acquisition module 501 is configured to acquire configuration update information. The configuration update information includes the identification of a target baseline and a current log level.
[0106] The variable setting module 502 is configured to set the log level variable of the baseline calculation instance corresponding to the identification in the plurality of baseline calculation instances to the current log level.
[0107] The printing module 503 is configured to compare the log level variable of the baseline solving instance with preset parameters when the baseline solving instance generates a log, and determine whether to print the log according to a comparison result.
[0108] In a possible implementation, the printing module 503 is further configured to: for any baseline solving instance, compare the printing constants in ascending order with the log level variable of the baseline solving instance, and print the log according to the log level corresponding to the printing constant when the printing constant is greater than or equal to the log level variable.
[0109] In a possible implementation, the variable setting module 502 is further configured to: encapsulate the log printing logic as a function through macro definition, and enable the function of the macro definition when running the baseline solving instance; wherein the log printing logic comprises: comparing the log level variable of the baseline solving instance with preset parameters, and determining whether to print the log according to a comparison result.
[0110] In a possible implementation, the obtaining module 501 is further configured to: listen to a preset configuration database, the configuration database being configured to record the identification of the baseline and the current log level; and if a new current log level is written in the configuration database, obtain the new current log level and the identification of the corresponding baseline as the configuration update information.
[0111] In a possible implementation, the configuration update information further comprises a validity period, and the variable setting module 502 is further configured to: change the log level variable from the current log level to the original value when the validity period ends.
[0112] The baseline solving log control apparatus provided in this embodiment can perform the method provided in the method embodiments, and has similar implementation principles and technical effects, which will not be described here again in this embodiment.
[0113] Figure 6 A structural schematic diagram of an electronic device provided in this application is shown in FIG. 6. Figure 6 As shown in FIG. 6, the electronic device 60 provided in this embodiment comprises at least one processor 601 and a memory 602. Optionally, the device 60 further comprises a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected through a bus 604.
[0114] In the specific implementation process, the at least one processor 601 executes the computer execution instructions stored in the memory 602, so that the at least one processor 601 performs the method described above.
[0115] The specific implementation process of the processor 601 can refer to the method embodiments described above, and has similar implementation principles and technical effects, which will not be described here again in this embodiment.
[0116] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.
[0117] The memory can include a random access memory (RAM), and can also include a non-volatile memory (NVM), such as at least one disk memory.
[0118] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.
[0119] The present application also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the above method.
[0120] The present application also provides a computer readable storage medium, which stores computer execution instructions, and when a processor executes the computer execution instructions, the above method is implemented.
[0121] The above readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0122] An example readable storage medium is coupled to the processor such that the processor can read information from the readable storage medium and can write information to the readable storage medium. Of course, the readable storage medium can also be a part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.
[0123] The division of units is only a logical functional division, and in actual implementation, there can be another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0124] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0125] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0126] If the functions are realized in the form of software functional units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the present application that essentially contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method of each embodiment of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0127] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a computer readable storage medium. The program executes to perform the steps of the above-mentioned method embodiments; and the foregoing storage medium includes various media capable of storing program codes, such as ROM, RAM, magnetic disk, or optical disk.
[0128] Finally, it should be noted that other embodiments of the present application will readily occur to those skilled in the art upon consideration of the specification and practice of the present application disclosed herein. The present application is intended to include all such variations as fall within the general scope of the application, and includes the generic principles disclosed and the best mode known to the inventors to be currently practiced as well as variations thereof, without departing from the scope of the present application as defined by the claims. The specification and examples give the best application of the present application as currently known, and together with the description of the application serve to best illustrate the principles of the application. The scope of the application is expressly set forth in the claims.
Claims
1. A baseline computation log control method, characterized in that, Applied to a server running multiple baseline solution instances and maintaining a separate log level variable for each baseline solution instance, the method includes: Obtain configuration update information, which includes the identifier of the target baseline and the current log level; Set the log level variable of the baseline solution instance corresponding to the identifier in the plurality of baseline solution instances to the current log level; When the baseline solution instance generates logs, the log level variable of the baseline solution instance is compared with preset parameters, and it is determined whether to print the logs based on the comparison result.
2. The method according to claim 1, characterized in that, The preset parameters include multiple printing constants, each corresponding to a log level. The magnitude of the printing constant is proportional to the log level. The step of comparing the log level variable of the baseline solution instance with the preset parameters and determining whether to print a log based on the comparison result includes: For any baseline solution instance, the printing constant is compared with the log level variable of the baseline solution instance in ascending order. When the printing constant is greater than or equal to the log level variable, the log is printed according to the log level corresponding to the printing constant.
3. The method according to claim 1 or 2, characterized in that, Also includes: The log printing logic is encapsulated into a function through macro definitions, and the macro-defined function is enabled when the baseline solution instance is run. The log printing logic includes: comparing the log level variable of the baseline solution instance with preset parameters, and determining whether to print logs based on the comparison result.
4. The method according to claim 1 or 2, characterized in that, The process of obtaining configuration update information includes: Monitor a preset configuration database, which is used to record the baseline identifier and the current log level; If a new current log level is written to the configuration database, the new current log level and the identifier of the corresponding baseline are obtained as configuration update information.
5. The method according to claim 4, characterized in that, The configuration database communicates with a web server, which provides a configuration management page to web clients. The web server updates the configuration database based on the data obtained by the web clients through the configuration management page.
6. The method according to claim 5, characterized in that, The web server is also used for: Receive the base station number and current log level sent by the web client, wherein the base station number is associated with the identifiers of multiple baselines; The identifier of each baseline associated with the base station number and the current log level are treated as a set of data and written or updated in batches to the configuration database.
7. The method according to claim 1 or 2, characterized in that, The configuration update information also includes a validity period, and after setting the log level variable of the baseline solution instance corresponding to the identified instance among the plurality of baseline solution instances to the current log level, it also includes: When the validity period expires, the log level variable will be changed back to its original value from the current log level.
8. A baseline calculation log control device, characterized in that, Applied to a server running multiple baseline solution instances and maintaining a separate log level variable for each baseline solution instance, the apparatus includes: The acquisition module is used to acquire configuration update information, which includes the identifier of the target baseline and the current log level; The variable setting module is used to set the log level variable of the baseline solution instance corresponding to the identifier in the plurality of baseline solution instances to the current log level; The printing module is used to compare the log level variable of the baseline solution instance with preset parameters when the baseline solution instance generates logs, and determine whether to print the logs based on the comparison result.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium / computer program product, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7; And / or, The computer program product includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Log printing method and device
CN113778350A
System and method for implementing a dynamic logger
US20040153878A1