Log information management method and device, electronic equipment and medium
A distributed cache mechanism controls log output in the BILLING system based on user/account numbers, enhancing log analysis and maintenance efficiency by outputting only relevant logs, addressing performance and analysis challenges.
Patent Information
- Application Number
- CN202411254512.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-27
AI Technical Summary
The current BILLING system log output solutions either occupy significant system resources due to detailed log information, affecting performance and storage, or fail to provide detailed logs, making fault analysis difficult.
Implement a distributed cache mechanism to control log output range based on mobile phone number, user number, and account number, outputting only target user or account logs, using a log configuration information system to manage log levels and rules.
Improves system log analysis and fault warning capabilities without affecting performance, facilitating efficient log management and maintenance.
Smart Images

Figure CN119201875A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer software technology, and in particular to a log information management method, device, electronic device and medium. Background Art
[0002] Regarding the log output of operator services, the BILLING system needs to process tens of billions of call records every day, and the amount of system log information is very huge. In the related technology, the output interface of the log is uniformly encapsulated or the Log4X framework is used to uniformly control the output method and format of the log. When the detailed log information is output, the log information will occupy a large amount of disk IO, seriously affecting the operating speed of the system, and also requiring a large amount of storage space. Secondly, the BILLING system adopts a cloud deployment model. The log information of different processing links of the same call record is scattered on some hosts in the computing cluster of hundreds of hosts. The scattered log information is very unfavorable for problem location and fault analysis during daily operation and maintenance.
[0003] In other words, the current BILLING system log output solution either outputs detailed log information in full, which puts tremendous pressure on the system disk IO and storage space, or fails to output detailed log information at all, making it difficult for daily operation and maintenance to analyze system anomalies through log information. Summary of the invention
[0004] The present invention discloses a log information management method, device, electronic device and medium to solve the technical problem that log output has a great impact on system performance and it is difficult to analyze system abnormalities through log information. The method is based on a distributed cache mechanism to control the log output range of the BILLING system. The system is controlled by mobile phone number, user number and account number to only output detailed log information of the target user or account. Without affecting the performance of the existing system, the system log analysis capability and fault warning capability are improved, thereby improving the system operation and maintenance capability.
[0005] A first aspect of the present disclosure provides a log information management method, the method comprising:
[0006] Load the log configuration information into the distributed cache. The log configuration information includes the log output level and log output rules.
[0007] In response to the log configuration information taking effect in the distributed cache, the target level log is output according to the log output range, and the log primary key number of the target level log is generated, wherein the log output range includes at least one of the mobile phone number, account number and user number, the target level log is a log with an output level specified by the user, and the log primary key number is a unified number of the target level log in the entire log information management process.
[0008] In one embodiment of the present disclosure, in response to the log configuration information taking effect in the distributed cache, a target level log is output according to the log output range, and a log primary key number of the target level log is generated, including at least one of the following methods:
[0009] For the call record data flow, the decoding node determines whether the target call record needs to output the first-level log by the mobile phone number. If the judgment result is yes, the first-level log is output as the target-level log, the judgment result is used as the mark of the first-level log, and the log primary key number of the first-level log is generated;
[0010] For the data stream, the decoding node determines whether the target data needs to output the second-level log by the user number. If the determination result is yes, the second-level log is output as the target-level log, the determination result is used as the mark of the second-level log, and the log primary key number of the second-level log is generated;
[0011] For the fund data flow, the decoding node uses the account number to determine whether the target fund needs to output the third-level log. If the judgment result is yes, the third-level log is output as the target level log, the judgment result is used as the mark of the third-level log, and the log primary key number of the third-level log is generated.
[0012] In one embodiment of the present disclosure, before loading the log configuration information into the distributed cache, the process further includes:
[0013] Set the log output range;
[0014] Set the log output level and log output rules.
[0015] In one embodiment of the present disclosure, loading log configuration information into a distributed cache includes:
[0016] Upon receiving the first operation request, the business processing module of the BILLING system is notified to load the log configuration information, and the BILLING system is used to process the call data flow, the information data flow and the fund data flow in the distributed cache;
[0017] In response to the completion of loading the log configuration information, the log configuration information is loaded into the thread variable of the business processing module when a second operation request is received, wherein the second operation request is a request adjacent to the first operation request.
[0018] In one embodiment of the present disclosure, after outputting a target level log according to a log output range and generating a log primary key number of the target level log, the method further includes:
[0019] According to the preset log output rules, the target level log is output to the message queue and / or local log file; the message queue and / or local log file is sent to the log center for log analysis. The log center is a data center dedicated to storing log information.
[0020] In one embodiment of the present disclosure, according to a preset log output rule, a target level log is output to a message queue, including:
[0021] Use the information collection tool to load the target level logs into the message queue.
[0022] A second aspect of the present disclosure provides a log information management device, the device comprising:
[0023] The loading module is used to load the log configuration information into the distributed cache. The log configuration information includes the log output level and log output rules.
[0024] The output module is used to respond to the log configuration information taking effect in the distributed cache, output the target level log according to the log output range, and generate the log primary key number of the target level log, wherein the log output range includes at least one of the mobile phone number, account number and user number, the target level log is the log with the output level specified by the user, and the log primary key number is the unified number of the target level log in the entire process of log information management.
[0025] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the methods in the first aspect embodiment of the present disclosure.
[0026] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, characterized in that the computer instructions are used to enable a computer to execute the method in the first aspect embodiment of the present disclosure.
[0027] The fifth aspect embodiment of the present disclosure proposes a computer program product, characterized in that it includes a computer program, and when the computer program is executed by a processor, it implements any method in the first aspect embodiment of the present disclosure.
[0028] In summary, according to the log information management method proposed in this disclosure, the following technical effects can be obtained:
[0029] Load the log configuration information into the distributed cache. The log configuration information includes the log output level and log output rules, which provide a processing basis for the output of log information. In response to the log configuration information taking effect in the distributed cache, output the target level log according to the log output range, and generate the log primary key number of the target level log, where the log output range includes at least one of the mobile phone number, account number and user number. The target level log is a log with a specified output level for the user. The log primary key number is a unified number for the target level log in the entire log information management process, which keeps the same call record relevant in different processing links, and facilitates the statistics and analysis of the subsequent log information. Without affecting the performance of the existing system, the system log analysis capability and system operation and maintenance capability are improved.
[0030] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0032] Figure 1 A flow chart of a log information management method according to an embodiment of the present disclosure;
[0033] Figure 2 A flow chart of a method for outputting a target level log according to a log output range and generating a log primary key number of the target level log according to an embodiment of the present disclosure;
[0034] Figure 3 A flow chart of setting log configuration information according to an embodiment of the present disclosure;
[0035] Figure 4 A flowchart of loading log configuration information into a distributed cache according to an embodiment of the present disclosure;
[0036] Figure 5 A flow chart of log output according to an embodiment of the present disclosure;
[0037] Figure 6 A flowchart of an embodiment of the present disclosure for outputting a target level log to a message queue according to a preset log output rule;
[0038] Figure 7 A schematic diagram of a system log output level and range control according to an embodiment of the present disclosure;
[0039] Figure 8 A structural diagram of a log information management device according to an embodiment of the present disclosure;
[0040] Fig. 9 is a block diagram of an electronic device for implementing the log information management method disclosed in the present invention according to an exemplary embodiment;
[0041] Fig.10 It is a schematic diagram of the structure of the chip of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0042] The embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout identify the same or similar originals or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limitations on the present disclosure. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative efforts are within the scope of protection of the present invention.
[0043] First, a brief introduction to the relevant terms in this disclosure is given:
[0044] Billing System: In this disclosure, it refers to the name of the subsystem in the Business Operation Support System (BOSS) that supports dialog processing, expense offset, fund processing, letter control reminders, and program-controlled activation capabilities, usually referred to as the BILLING system.
[0045] Event Processing Flow: In this disclosure, it refers to the complete process of decoding, data analysis, pricing, cost calculation, aggregation, signal control, billing, and warehousing of the call record files collected by the mobile network element, which can also be called the call record data flow.
[0046] Information Processing Flow: In this disclosure, it refers to the complete process of information processing through various links and finally sent to the memory data base (MDB) after the business acceptance of the BILLING system is completed. It can also be called information data flow.
[0047] Fund Processing Flow: In this disclosure, it refers to the complete process in which the fund information is processed in various links and finally sent to the account fund MDB after the user recharges and pays. It can also be called fund data flow.
[0048] Decode: In this disclosure, it refers to the first step of call bill document preprocessing in the BILLING system. Its core capability is to parse the service usage records of different network element devices into call bill file records in a unified format.
[0049] Decode Node: in the present disclosure, refers to a call record processing link or node in the BILLING system, which is manifested as an independent program module and can run independently in the system to perform unified decoding operations on the call record files collected from the mobile network elements.
[0050] For the massive log data generated by operators, the current log output solution can meet the log output requirements of most systems, realize the control of the output file volume, and ensure the relative stability of the storage space occupied by log files; first, the log output interface is uniformly encapsulated or the Log4X open source framework of the open source community is adopted to facilitate the unified control of the log output method and format; secondly, in terms of the strategy for controlling the output log volume, the size of the log file, the number of file copies and the storage time are controlled through dimensions such as duration and file size, so as to avoid the problem of excessive log files consuming the storage space and causing system failures. However, this solution cannot properly balance information output control and daily operation and maintenance work in a system like the BILLING system that outputs massive amounts of log information every day. The BILLING system needs to process tens of billions of call records every day. Each call record will output hundreds of logs during the entire information processing process. Most of the logs contain rich information (such as processing time, product tariff selection information, discount policies, cost sharing mechanisms, and other intermediate status information of the cost calculation process). The amount of system log information is very large. If all the detailed log information is output, the log information will occupy a large amount of disk IO, seriously affecting the system's operating speed, and will also require a large amount of storage space.
[0051] In addition, in the related technologies, the BILLING system adopts a cloud deployment model. The log information of different processing links of the same call record is scattered on certain hosts in a computing cluster of hundreds or thousands of hosts. The scattered log information is very unfavorable for problem location and fault analysis during daily operation and maintenance.
[0052] In response to the above-mentioned problems existing in the related technologies, the present disclosure adopts the strategies of "controllable log information volume", "centralized storage of log information" and "business probe" to control the amount of information generated by logs, store logs specifically, and quickly locate users with tariff and calculation problems. Furthermore, the present disclosure proposes a method for controlling the output range of BILLING system logs based on a distributed cache mechanism, which controls the system to output only detailed log information of the target user or account through the mobile phone number, user number and account number, and improves the system log analysis capability and fault warning capability without affecting the performance of the existing system, thereby improving the system operation and maintenance capability.
[0053] The method proposed in this disclosure is applied to log information management tasks, and its application has a wide range of scenarios or fields, especially those involving large-scale data processing, systems that require efficient log management and fault analysis. The following are some possible application scenarios:
[0054] Telecommunications industry: For example, the BILLING system mentioned above processes a large amount of call and transaction data, which requires effective log management to quickly locate problems and perform fault analysis.
[0055] Financial services: The transaction systems of banks and financial institutions generate a large amount of data. This solution can help monitor transaction anomalies and identify and prevent fraud in a timely manner.
[0056] Cloud computing platform: Cloud service providers can use this solution to monitor and manage log information of various services and applications running on the cloud platform, improving fault response speed and service quality.
[0057] E-commerce: E-commerce platforms need to process massive amounts of user data and transaction data. Through refined log management, they can better analyze user behavior and optimize user experience.
[0058] Social media and content distribution networks: These platforms need to process a large amount of user-generated content and interaction data in real time. This solution helps monitor and analyze user activities to ensure the normal distribution of content.
[0059] Internet of Things (IoT): IoT devices generate a large amount of log data. This solution can help centrally manage the logs of these devices, facilitate monitoring of device status and timely response to device failures.
[0060] Game industry: Online game platforms need to process a large amount of player interaction data. This solution can be used to monitor the performance of game servers and promptly discover and resolve issues that may affect player experience.
[0061] Healthcare: Medical information systems store sensitive patient data. This solution can help ensure data security while monitoring and recording system operations to meet compliance requirements.
[0062] Government and public services: Government agencies can use the solution to manage data for the public services they provide, ensuring data security and integrity while improving service efficiency.
[0063] Education: Educational institutions can use this solution to monitor the logs of learning management systems in order to optimize the allocation of teaching resources and improve students’ learning experience.
[0064] In these scenarios, the implementation of this solution can improve the efficiency of log management, reduce the demand for storage space, speed up fault diagnosis and problem solving, and thus improve the overall operation and maintenance capabilities and service quality. The application scenarios are not limited in the embodiments of the present disclosure.
[0065] The log information management method provided by the present disclosure is described in detail below with reference to the accompanying drawings.
[0066] Figure 1 FIG. 1 is a flow chart of a log information management method according to an embodiment of the present disclosure. Figure 1 In the embodiment shown, the log information management method includes:
[0067] Step 101, loading log configuration information into the distributed cache, the log configuration information including log output level and log output rule.
[0068] In this embodiment, the distributed cache refers to the computer memory block of the server cluster running the BILLING system. The log configuration information refers to the rule information that needs to be set to allow the distributed cache to record the log information of the BILLING system, including the log output level and the log output rule. The log output level refers to the level division of the log information output. The log output level includes TRACE, DEBUG, INFO, WARN, ERROR, and FATAL from low to high. In software development and operation and maintenance, these levels are used to distinguish log information of different importance, helping developers and system administrators to quickly locate problems, optimize performance, and understand the operating status of the system. The TRACE level provides the most detailed log information and is usually used to track the execution process of the program, such as method calls, parameter passing, and return values. Due to its very high level of detail, it is usually only used in the debugging phase to help developers understand the internal operation of the program. The DEBUG level is used to record information that is helpful for debugging the program, such as the value of variables, program execution path, etc. It is very useful in the development process, but is usually disabled in the production environment to avoid generating too much log information. The INFO level is used to record general information of the program, such as system startup, the start and end of important operations, etc. It is a commonly used log level in production environments to provide an overview of the system's operating status without being too cumbersome. The WARN level indicates possible problems or abnormal conditions, but these problems have not yet seriously affected the operation of the system. It is usually used to prompt developers and administrators of potential errors that are about to occur and need to be paid attention to. The ERROR level records error events that occur in the system. These events may affect certain functions but will not prevent the operation of the entire system. When a problem occurs in the system, the error log is an important diagnostic tool that helps to quickly locate and fix the problem. The FATAL level indicates serious errors that affect the entire product or service and may cause the system to crash or terminate. When a fatal error occurs, immediate intervention is usually required to restore the normal operation of the system. The log output rule refers to the way to output the log as a local log file or message queue, for example, outputting the log to the log file system of the local host or to the message queue Kafka or RabbitMQ. After reading the log configuration information, the log configuration information is loaded into the memory of the distributed cache to provide a processing basis for log output.
[0069] Step 102, in response to the log configuration information taking effect in the distributed cache, output the target level log according to the log output range, and generate a log primary key number for the target level log, wherein the log output range includes at least one of the mobile phone number, the account number and the user number, the target level log is a log with an output level specified by the user, and the log primary key number is a unified number for the target level log in the entire log information management process.
[0070] In this embodiment, the log output range refers to the filter items on which the log output level depends, including at least one of the mobile phone number, account number, and user number. The target level log refers to the log for which the user specifies the output level, that is, the log determined by the user through the log output range. The log primary key number refers to the unified number of the target level log in the entire process of log information management. The log primary key number is the same number used to keep the same call record associated in different links, which is convenient for statistics and analysis in the log information. The account number refers to the number that is relied upon to obtain log information in the data flow. The user number refers to the number that is relied upon to obtain log information in the capital flow. When the log configuration information takes effect in the distributed cache, the target level log is output according to the set log output range, and the log primary key number of the target level log is generated, providing a data sample that can be easily analyzed for the analysis of the log information.
[0071] The log information management method proposed in the present disclosure loads log configuration information into a distributed cache, wherein the log configuration information includes a log output level and a log output rule, and provides a processing basis for the output of log information; in response to the log configuration information taking effect in the distributed cache, the target level log is output according to the log output range, and a log primary key number of the target level log is generated, wherein the log output range includes at least one of a mobile phone number, an account number, and a user number, the target level log is a log with an output level specified by the user, and the log primary key number is a unified number of the target level log in the entire process of log information management, which maintains the relevance of the same call sheet in different processing links, and facilitates statistics and analysis in the subsequent log information. Without affecting the performance of the existing system, the system log analysis capability and system operation and maintenance capability are improved.
[0072] Figure 2 The present invention is a flowchart of a method for outputting a target level log according to a log output range and generating a log primary key number of the target level log according to an embodiment of the present invention. Figure 2 Yes Figure 1 Further explanation of step 102 is based on Figure 2 The embodiment shown includes at least one of the following steps:
[0073] Step 201, for the call record data stream, determine at the decoding node by the mobile phone number whether the target call record needs to output the first level log. If the judgment result is yes, output the first level log as the target level log, use the judgment result as the mark of the first level log, and generate the log primary key number of the first level log.
[0074] In this embodiment, the target call sheet refers to the call sheet data currently being processed in the call sheet data stream. The first level log refers to the level of log information generated in the process of processing the target call sheet. For the call sheet data stream processed in the BILLING system, the decoding node determines whether the target call sheet needs to output the first level log by the mobile phone number. If the judgment result is yes, the first level log is output and used as the target level log, and the judgment result is used as the mark of the first level log, that is, the mark of the first level log is set to "yes" to indicate that the first level log has been output. And the log primary key number of the first level log is generated, which is used as the unique identifier of the first level log of the target call sheet in the whole process of log information management. The billing call sheet needs to be processed through many processing links in the BILLING system. If the decoding node at the entrance is marked to indicate whether the log information needs to be output, the subsequent links do not need to continue to read the configuration data to determine whether the log information needs to be output, which can save the time-consuming judgment of "whether the first level log needs to be output" in each link, which can save a lot of resource consumption for a system that processes hundreds of billions of call sheets every day.
[0075] Step 202, for the data stream, the decoding node determines whether the target data needs to output the second level log through the user number. If the determination result is yes, the second level log is output as the target level log, the determination result is used as the mark of the second level log, and the log primary key number of the second level log is generated.
[0076] In this embodiment, the target data refers to the data data currently being processed in the data data stream. The second-level log refers to the level of log information generated in the process of processing the target data. For the data data stream processed in the BILLING system, the decoding node determines whether the target data needs to output the second-level log through the user number. If the judgment result is yes, the second-level log is output and used as the target level log, and the judgment result is used as the mark of the second-level log, that is, the mark of the second-level log is set to "yes" to indicate that the second-level log has been output. And the log primary key number of the second-level log is generated, which is used as the unique identifier of the second-level log of the target data in the whole process of log information management. Consistent with the log output of the call data stream, in the subsequent links, it is not selected to continue to read the configuration data to determine whether the log information needs to be output, which can greatly save the time spent in the judgment process. For massive data streams, it can save huge resource consumption.
[0077] Step 203, for the fund data flow, determine whether the target fund needs to output the third level log by the account number at the decoding node. If the determination result is yes, output the third level log as the target level log, use the determination result as the mark of the third level log, and generate the log primary key number of the third level log.
[0078] In the present embodiment, the target funds refer to the funds data currently being processed in the funds data stream. The third level log refers to the level of log information generated in the process of processing the target funds. For the funds data stream processed in the BILLING system, the decoding node determines whether the target funds need to output the third level log by the account number. If the judgment result is yes, the third level log is output and used as the target level log, and the judgment result is used as the mark of the third level log, that is, the mark of the third level log is set to "yes" to indicate that the third level log has been output. And the log primary key number of the third level log is generated, which is used as the unique identifier of the third level log of the target funds in the whole process of log information management. Consistent with the log output of the call list data stream, it is not selected to continue to read the configuration data to determine whether the log information needs to be output in the subsequent links, which can greatly save the time consuming in the judgment process, and for massive funds data streams, it can save huge resource consumption.
[0079] Optionally, the levels of the first level log, the second level log, and the third level log may be the same or different.
[0080] Through the solution of this embodiment, the same call record is kept relevant in different processing stages, which is convenient for statistics and analysis in the subsequent log information. Without affecting the performance of the existing system, the system log analysis capability and system operation and maintenance capability are improved.
[0081] Figure 3 The present invention is a flowchart of setting log configuration information according to an embodiment of the present invention. Figure 3 Yes Figure 1 Further explanation of step 101 before, based on Figure 3 The embodiment shown comprises the following steps:
[0082] Step 301, setting the log output range.
[0083] In this embodiment, before the log configuration information is effective in the distributed cache, the log configuration information must be configured. Specifically, the log output range needs to be set to determine the variables to be used based on the mobile phone number, user number, and account number.
[0084] Step 302: Set the log output level and log output rules.
[0085] In this embodiment, before the log configuration information takes effect in the distributed cache, for the log configuration information, not only the log output range needs to be set, but also the log output level and log output rules need to be configured, so as to obtain the range of log information that the user wants to analyze, which is convenient for the user to perform log analysis.
[0086] Figure 4 The present invention is a flowchart of loading log configuration information into a distributed cache according to an embodiment of the present invention. Figure 4 Yes Figure 2 and Figure 1 The specific description of step 102 is based on Figure 4 The embodiment shown comprises the following steps:
[0087] Step 401, upon receiving the first operation request, notify the business processing module of the BILLING system to load log configuration information, the BILLING system is used to process the call data flow, the document data flow and the fund data flow in the distributed cache.
[0088] In this embodiment, the first operation request is a log configuration information loading notification. After configuring the information, the user (system operator) triggers the information synchronization action, synchronizes (loads) the configured information into the distributed cache (computer memory block), and sends a configuration information loading notification to the BILLING system business processing module. That is, the BILLING system receives the user's first operation request, and the BILLING system is used to process the call data flow, information data flow, and capital data flow in the distributed cache.
[0089] Step 402 , in response to completion of loading the log configuration information, loading the log configuration information into a thread variable of the business processing module when receiving a second operation request, wherein the second operation request is a request adjacent to the first operation request.
[0090] In this embodiment, the second operation request refers to an adjacent request immediately following the first operation request, and is used to perform operations on the variables read from the configuration information in the memory. After the log configuration information is loaded into the distributed cache, when the second operation request is received, the log configuration information is loaded into the thread variable of the business processing module and takes effect immediately.
[0091] In this embodiment, the configuration variables of the log management system are directly validated from the memory, which reduces the interaction between the business module and the distributed cache. The log configuration information takes effect immediately, which improves the processing performance of the business system module.
[0092] Figure 5 The present invention is a flow chart of log output according to an embodiment of the present invention. Figure 5 Yes Figure 1The specific description after step 102 is based on Figure 5 The embodiment shown comprises the following steps:
[0093] Step 501: Output the target level log to the message queue and / or local log file according to the preset log output rule.
[0094] In this embodiment, according to the preset log output rule, the target level log is output to the message queue and / or the local log file.
[0095] Step 502: Send the message queue and / or local log file to a log center for log analysis. The log center is a data center dedicated to storing log information.
[0096] In this embodiment, the log center refers to a data center or database specifically used to store log information. The message queue and / or local log file is sent to the log center for log analysis. For example, for provinces without a log center, the BILLING system generally only writes batch call list processing stat logs in files. These types of log files are not very detailed and do not have much analytical value. Generally, these information is directly stored in the storage of the local host and cleaned up regularly; for provinces with a log center system, it is necessary to output detailed log information of all processing of the full amount of call lists of users of the monitored number or number segment, and to save it for a relatively long time (such as one to three years). In this case, it is necessary to send it remotely to the log center subsystem through the network through the message queue through the network. For provinces with a log center built later, if it is necessary to send the log information written into the log file to the log center, it can also be loaded into the message queue by deploying an information collection tool. The log information in the message queue is sent to an external log processing center for subsequent processing. Specifically, statistical analysis can be performed, alarm information can be generated, triggered, or combined with artificial intelligence technology to analyze the root cause of the fault and perform automatic repair processing.
[0097] Figure 6 The present invention is a flowchart of an embodiment of the present invention for outputting target level logs to a message queue according to preset log output rules. Figure 6 Yes Figure 5 The specific description of step 501 is based on Figure 6 The embodiment shown comprises the following steps:
[0098] Step 601: Load the target level log into the message queue through the information collection tool.
[0099] In this embodiment, for an existing message queue, the target level log is loaded into the message queue through an information collection tool, so as to facilitate subsequent processing. Optionally, the information collection tool can use tools such as Kafka, RabbitMQ, ActiveMQ, and Fluentd.
[0100] Figure 7 FIG. 1 is a schematic diagram of a system log output level and range control according to an embodiment of the present disclosure. Figure 7 As shown in the following steps:
[0101] 1. Configure the log output rules and number list. The configuration includes: using mobile phone numbers, user numbers, and account number lists; log output level configuration; and log output rule configuration. The configuration information needs to be able to be configured at any time and take effect immediately.
[0102] 2. After the log configuration information is completed, it is mapped to the distributed cache based on the configuration information, and a loading notification is sent to the business processing module of the BILLING system.
[0103] 3. In the business processing module, the call order flow determines at the decoding node whether the currently processed call order needs to output a log of a specified level (such as TRACE level), and makes corresponding marks in the call order information for direct use by subsequent nodes. When the call order flow outputs log information, each call order needs to save a unique log primary key number to facilitate the log center to perform association analysis and statistics based on the log primary key number. During the upload process, the data flow controls which users output log information of a specified level by user number. Since the capital flow only contains account numbers in the uploaded information, the log information controls which accounts need to output log information of a specified level by account number. The call order is decoded, batched, summarized, and distributed to record the call order log information, and the log information of data management and capital management is uploaded to MDB for log storage.
[0104] 4. Save the obtained log information as a log file or message queue. For log files, when the log center is not built, the system logs are directly output to the local log file system. Ordinary log information with non-specified numbers is output to the local log file system according to the rules. For message queues, logs with specified numbers and specified levels are output to the message queue. Information can be output directly from the process to the message queue, or the log information can be written to the local storage first, and then sent to the message queue through the log collection script.
[0105] 5. Pass the log information to the log platform through the message queue.
[0106] 6. In the log center (log platform), save the log file as a log analysis library, and store important log information in the database to facilitate subsequent analysis, statistics and data precipitation. In areas or provinces where log centers have been built, you can directly connect to the existing log center. For areas or provinces where log centers have not been built, there is no need to build a log center. Just store detailed log information in a centralized manner and provide convenient query or analysis methods. For the log analysis library, rule configuration can be implemented based on this database, for example, configure log file storage rules; log file cleaning rules; alarm rules, alarm templates; artificial intelligence related thresholds and rule configuration. It can also realize alarm reminders, log queries, AI intelligence, root cause analysis and other functions. Root cause analysis can use AI technology to build an intelligent analysis model for log information, realize root cause analysis of system abnormalities and provide treatment opinions.
[0107] The log information management method proposed in the present disclosure loads log configuration information into a distributed cache, wherein the log configuration information includes a log output level and a log output rule, and provides a processing basis for the output of log information; in response to the log configuration information taking effect in the distributed cache, the target level log is output according to the log output range, and a log primary key number of the target level log is generated, wherein the log output range includes at least one of a mobile phone number, an account number, and a user number, the target level log is a log with an output level specified by the user, and the log primary key number is a unified number of the target level log in the entire process of log information management, which maintains the relevance of the same call sheet in different processing links, and facilitates statistics and analysis in the subsequent log information. Without affecting the performance of the existing system, the system log analysis capability and system operation and maintenance capability are improved.
[0108] Corresponding to the methods provided in the above-mentioned embodiments, the present disclosure also provides a log information management device. Since the device provided in the embodiment of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation method of the method is also applicable to the device provided in this embodiment and will not be described in detail in this embodiment.
[0109] Figure 8 FIG. 8 is a schematic diagram of the structure of a log information management device 800 according to an embodiment of the present disclosure. Figure 8 As shown, the log information management device includes:
[0110] A loading module 810 is used to load log configuration information into the distributed cache, where the log configuration information includes log output level and log output rule;
[0111] The output module 820 is used to respond to the log configuration information taking effect in the distributed cache, output the target level log according to the log output range, and generate the log primary key number of the target level log, wherein the log output range includes at least one of the mobile phone number, account number and user number, the target level log is a log with an output level specified by the user, and the log primary key number is a unified number of the target level log in the entire log information management process.
[0112] In some embodiments, the output module 820 is used to output the target level log according to the log output range in response to the log configuration information taking effect in the distributed cache, and generate the log primary key number of the target level log, including at least one of the following methods:
[0113] For the call record data flow, the decoding node determines whether the target call record needs to output the first-level log by the mobile phone number. If the judgment result is yes, the first-level log is output as the target-level log, the judgment result is used as the mark of the first-level log, and the log primary key number of the first-level log is generated;
[0114] For the data stream, the decoding node determines whether the target data needs to output the second-level log by the user number. If the determination result is yes, the second-level log is output as the target-level log, the determination result is used as the mark of the second-level log, and the log primary key number of the second-level log is generated;
[0115] For the fund data flow, the decoding node uses the account number to determine whether the target fund needs to output the third-level log. If the judgment result is yes, the third-level log is output as the target level log, the judgment result is used as the mark of the third-level log, and the log primary key number of the third-level log is generated.
[0116] In some embodiments, before loading the log configuration information into the distributed cache, the loading module 810 is further used to:
[0117] Set the log output range;
[0118] Set the log output level and log output rules.
[0119] In some embodiments, the loading module 810 is used to:
[0120] Upon receiving the first operation request, the business processing module of the BILLING system is notified to load the log configuration information, and the BILLING system is used to process the call data flow, the information data flow and the fund data flow in the distributed cache;
[0121] In response to the completion of loading the log configuration information, the log configuration information is loaded into the thread variable of the business processing module when a second operation request is received, wherein the second operation request is a request adjacent to the first operation request.
[0122] In some embodiments, after being used to output the target level log according to the log output range and generate the log primary key number of the target level log, the output module 820 is further used to:
[0123] According to the preset log output rules, the target level log is output to the message queue and / or local log file; the message queue and / or local log file is sent to the log center for log analysis. The log center is a data center dedicated to storing log information.
[0124] In some embodiments, the output module 820 outputs the target level log to the message queue according to the preset log output rule in the following manner, including:
[0125] Use the information collection tool to load the target level logs into the message queue.
[0126] In summary, log configuration information is loaded into the distributed cache through the log information management device, and the log configuration information includes the log output level and the log output rule; in response to the log configuration information taking effect in the distributed cache, the target level log is output according to the log output range, and the log primary key number of the target level log is generated, wherein the log output range includes at least one of the mobile phone number, the account number and the user number, the target level log is a log with an output level specified by the user, and the log primary key number is a unified number of the target level log in the whole process of log information management. This device solves the problem that the log output has a great impact on the system performance and it is difficult to analyze the system abnormality through log information, and improves the system log analysis capability and system operation and maintenance capability without affecting the performance of the existing system.
[0127] In the above embodiments provided by the present disclosure, the methods and devices provided by the embodiments of the present disclosure are introduced. In order to implement the functions in the methods provided by the above embodiments of the present disclosure, the electronic device may include a hardware structure and a software module, and implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. One of the above functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.
[0128] Fig. 9 is a block diagram of an electronic device 900 for implementing the above-mentioned log information management method according to an exemplary embodiment.
[0129] For example, the electronic device 900 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0130] Reference Fig. 9 , the electronic device 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 914 , and a communication component 916 .
[0131] The processing component 902 generally controls the overall operation of the electronic device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.
[0132] The memory 904 is configured to store various types of data to support operations on the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 900, contact data, phone book data, messages, pictures, videos, etc. The memory 904 may 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.
[0133] The power supply component 906 provides power to the various components of the electronic device 900. The power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 900.
[0134] The multimedia component 908 includes a screen that provides an output interface between the electronic device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the electronic device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0135] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the electronic device 900 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 904 or sent via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.
[0136] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0137] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the electronic device 900. For example, the sensor assembly 914 can detect the open / closed state of the electronic device 900, the relative positioning of components, such as the display and keypad of the electronic device 900, and the sensor assembly 914 can also detect the position change of the electronic device 900 or a component of the electronic device 900, the presence or absence of user contact with the electronic device 900, the orientation or acceleration / deceleration of the electronic device 900, and the temperature change of the electronic device 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0138] The communication component 916 is configured to facilitate wired or wireless communication between the electronic device 900 and other devices. The electronic device 900 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR (NewRadio) or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0139] In an exemplary embodiment, the electronic device 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0140] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, and the instructions can be executed by the processor 920 of the electronic device 900 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0141] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the log information management method described in the above embodiments of the present disclosure.
[0142] The embodiments of the present disclosure further provide a computer program product, including a computer program, which executes the log information management method described in the above embodiments of the present disclosure when a processor executes the computer program.
[0143] Fig.10 is a schematic structural diagram of a chip 1000 for implementing the above-mentioned log information management method according to an exemplary embodiment.
[0144] Reference Fig.10The chip 1000 includes at least one communication interface 1001 and a processor 1002; the communication interface 1001 is used to receive a signal input to the chip 1000 or a signal output from the chip 1000, and the processor 1002 communicates with the communication interface 1001 and implements the log information management method described in the above embodiment through a logic circuit or executing code instructions.
[0145] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0146] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0147] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.
[0148] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0149] It should be understood that the various parts of the embodiments of the present disclosure can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0150] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0151] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0152] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present disclosure.
Claims
1. A log information management method, characterized in that: The method comprises: Loading log configuration information into the distributed cache, wherein the log configuration information includes log output level and log output rules; In response to the log configuration information taking effect in the distributed cache, the target level log is output according to the log output range, and the log primary key number of the target level log is generated, wherein the log output range includes at least one of the mobile phone number, the account number and the user number, the target level log is a log with an output level specified by the user, and the log primary key number is a unified number of the target level log in the entire process of log information management.
2. The method according to claim 1, characterized in that The step of outputting a target level log according to a log output range in response to the log configuration information taking effect in the distributed cache and generating a log primary key number of the target level log includes at least one of the following methods: For the call record data flow, at the decoding node, judging whether the target call record needs to output the first level log by the mobile phone number, if the judgment result is yes, outputting the first level log as the target level log, using the judgment result as the mark of the first level log, and generating the log primary key number of the first level log; For the data stream, the decoding node determines whether the target data needs to output the second level log by using the user number. If the determination result is yes, the second level log is output as the target level log, the determination result is used as the mark of the second level log, and the log primary key number of the second level log is generated; For the fund data flow, the decoding node determines whether the target funds need to output the third-level log through the account number. If the judgment result is yes, the third-level log is output as the target level log, the judgment result is used as the mark of the third-level log, and the log primary key number of the third-level log is generated.
3. The method according to claim 1, characterized in that Before loading the log configuration information into the distributed cache, the method further includes: Set the log output range; Set the log output level and the log output rule.
4. The method according to claim 2, characterized in that: The step of loading the log configuration information into the distributed cache includes: Upon receiving the first operation request, informing the business processing module of the BILLING system to load the log configuration information, the BILLING system being used in the distributed cache to process the call data flow, the document data flow and the fund data flow; In response to the completion of loading the log configuration information, the log configuration information is loaded into the thread variable of the business processing module when a second operation request is received, wherein the second operation request is a request adjacent to the first operation request.
5. The method according to claim 1, characterized in that After outputting the target level log according to the log output range and generating the log primary key number of the target level log, the method further includes: Output the target level log to a message queue and / or a local log file according to a preset log output rule; The message queue and / or the local log file is sent to a log center for log analysis. The log center is a data center dedicated to storing log information.
6. The method according to claim 5, characterized in that Outputting the target level log to the message queue according to the preset log output rule includes: The target level log is loaded into the message queue through an information collection tool.
7. A log information management device, characterized in that: The device comprises: A loading module, used to load log configuration information into the distributed cache, wherein the log configuration information includes log output level and log output rules; An output module is used to respond to the log configuration information taking effect in the distributed cache, output a target level log according to a log output range, and generate a log primary key number for the target level log, wherein the log output range includes at least one of a mobile phone number, an account number, and a user number, the target level log is a log with an output level specified by the user, and the log primary key number is a unified number for the target level log in the entire process of log information management.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.
10. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Cited By
Log output method and device, readable storage medium and program product
CN119377181A
Log output method, device, readable storage medium and program product
CN119377181B