Log processing method, device, equipment, system and chip

Through the collaborative work of log storage, query and translation modules, the problem of insufficient flexibility of cloud computing operation log system in multilingual translation is solved, efficient and stable multilingual log processing is achieved, and international support capabilities and user experience are improved.

CN120371794APending Publication Date: 2025-07-25SICHUAN DETUO INFORMATION TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510501400.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing cloud computing operation log system needs to manually update the code when supporting multilingual translation, resulting in insufficient flexibility and lack of dynamic translation capabilities, which affects system stability and international application efficiency.

Method used

Through the collaborative work of the log storage module, query module and translation module, the log storage, query and translation are realized, real-time translation is used to use the translation model, support multilingual dynamic adaptation, and dynamically load new languages through i18n translation files.

Benefits of technology

It improves the automation level and user experience of log processing, enhances the international support capabilities of the system, reduces development and maintenance costs, and is suitable for multi-language and multi-user high-concurrent cloud computing environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371794A_ABST
    Figure CN120371794A_ABST
Patent Text Reader

Abstract

The invention provides a log processing method, device, equipment, system and chip. The method comprises the following steps: updating and storing a log by utilizing a log storage module; querying the updated log by using a log query module to obtain a translation model; based on the translation model, translating the updated log by using a log translation module; and returning the translated log to the user side by using the transmission equipment. According to the method, the cooperative work of storage, query and translation is realized, the automation level of log processing and the user experience are remarkably improved, and the method is particularly suitable for a multi-language and multi-user high-concurrency cloud computing environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and particularly to a log processing method, apparatus, device, system, and chip. Background Art

[0002] Cloud computing technology provides computing resources and services through the Internet, enabling users to access data, software, and hardware resources on the cloud platform anytime and anywhere. With the wide application of cloud computing, operation logs have become an important tool for recording users' operations on cloud computing resources, used to track the operations performed during the life cycle of resources. Operation logs usually need to support multilingual translation to meet the needs of global users. However, in the prior art, when adding a new language translation, it often requires modifying the code of the operation log system, resulting in a long adaptation period for the new language and insufficient flexibility.

[0003] For example, in the existing operation log system, when a new language needs to be supported, developers need to manually update the translation configuration file or modify the code logic, recompile, and deploy the system. This approach not only increases the development and maintenance costs but also may introduce errors due to code modifications, affecting the stability of the system. In addition, the existing system lacks the ability to dynamically load translation files when processing multilingual translation and cannot quickly respond to new language requirements, restricting the application efficiency in internationalization scenarios.

[0004] Therefore, developing an operation log system that supports internationalization translation has become an urgent problem to be solved.

[0005] Patent CN119201853A discloses a method for querying log data, including: obtaining a log query request sent by a client for a target group, where the log query request includes event description information; performing word segmentation on the event description information to obtain a plurality of target keywords, and performing word segmentation on the target log data corresponding to the target group to obtain a plurality of data segments, where the target log data is filtered from the historical log data of the target group; using the target keywords to match with the data segments to obtain the target data segments hit by the target keywords; and querying the corresponding group log data from the target data segments using the target keywords. This method can only implement the query of log data and does not have the function of dynamically translating log data.

[0006] Based on this, this application provides a log processing method, apparatus, device, system, and chip to improve the prior art. Summary of the Invention

[0007] The purpose of this application is to provide a log processing method, apparatus, device, system, and chip. This method realizes the collaborative work of storage, query, and translation, significantly improves the automation level of log processing and the user experience, and is particularly suitable for high-concurrency cloud computing environments with multiple languages and multiple users.

[0008] The object of the present application is achieved by the following technical solutions:

[0009] In a first aspect, the present application provides a log processing method for storing, updating, and translating logs. The method includes:

[0010] Using a log storage module to update and store the logs;

[0011] Using a log query module to query the updated logs to obtain a translation model;

[0012] Based on the translation model, using a log translation module to translate the updated logs;

[0013] Using a transmission device to return the translated logs to the user side.

[0014] The beneficial effects of this technical solution are as follows: By integrating the functions of log storage, query, and translation, an efficient log processing method is provided, significantly improving the management and internationalization support capabilities of the operation logs in the cloud computing platform. The log storage module ensures that the life cycle (start, success, failure) of user operations is accurately recorded and updated, providing a reliable data basis for subsequent queries. The log query module realizes the dynamic language adaptation of log content by obtaining the translation model, enabling users to view log content in the target language and meeting the diverse needs of global users. The log translation module performs real-time translation based on the translation model, ensuring the accuracy and consistency of the translation results, while the transmission device ensures that the translated logs are quickly returned to the user side, improving the system's response speed. This log processing process reduces the system complexity through modular design, enhancing the independence and maintainability of each functional module. Compared with the inefficient way of separately processing storage and translation in traditional log systems, this method realizes the collaborative work of storage, query, and translation, significantly improving the automation level and user experience of log processing, especially suitable for high-concurrency cloud computing environments with multiple languages and multiple users, providing strong technical support for international operations.

[0015] In some optional embodiments, the using a log storage module to update and store the logs includes:

[0016] Using a receiving device to receive a resource request from the user side;

[0017] Obtaining an operation event corresponding to the resource request, and using a message notification program to send the operation event to a message queue. The operation event includes a start event and an end event, and the end event includes a success event and a failure event;

[0018] Using a log storage module to monitor the message queue to obtain a monitoring result;

[0019] Update and store the log based on the monitoring result.

[0020] The beneficial effects of this technical solution are as follows: By defining the detailed operation process of the log storage module, accurate capture and efficient storage of user operation events are achieved, significantly improving the reliability and real-time performance of the log system. The receiving device captures the resource request of the user side, triggers the message notification program to generate operation events (start events and end events, including success and failure events), and stores and transmits them through the message queue, ensuring the stability of event processing in high-concurrency scenarios. The log storage module continuously monitors the message queue, obtains events in real time, and updates or stores the log according to the monitoring result. This processing mechanism effectively avoids the performance bottleneck of the traditional synchronous storage method and improves the throughput of the system. In addition, the classification of operation events (start, success, failure) provides a clear semantic structure for the log, facilitating subsequent query and analysis. Compared with the defect of the traditional log system that is prone to event loss due to high concurrency, the asynchronous message queue and event monitoring mechanism of this claim significantly enhance the integrity and fault tolerance of log records.

[0021] In some alternative embodiments, obtaining the operation event corresponding to the resource request and sending the operation event to the message queue by using the message notification program includes:

[0022] Obtain the start event and send the start event to the message queue by using the message notification program;

[0023] After a preset time, obtain the end event and send the operation end event to the message queue by using the message notification program.

[0024] The beneficial effects of this technical solution are as follows: First, obtain the start event and send the start event to the message queue by using the message notification program; after a preset time, obtain the end event and send the operation end event to the message queue by using the message notification program. By clarifying the timing logic of operation event generation and sending, the event processing efficiency of the log system is optimized, significantly improving the accuracy and orderliness of operation log records. The method stipulates that the start event is first obtained and sent to the message queue through the message notification program to mark the starting point of the operation; after a preset time, the end event is obtained and sent, ensuring the timing consistency of the operation start and end. This step-by-step processing mechanism effectively avoids the problem of event disorder caused by complex operations or network delays, ensuring the logical integrity of log records. The introduction of the preset time provides a flexible buffer window for the system, adapting to the execution duration of different operations and enhancing the adaptability of the method to diverse operation scenarios. Compared with the disadvantage of the traditional log system lacking clear timing control, the timing management mechanism of this claim significantly improves the reliability of event processing and provides a high-quality data basis for subsequent log update and query.

[0025] In some alternative embodiments, updating and storing the log based on the monitoring result includes:

[0026] When the monitoring result is a start event, recreate the operation start log corresponding to the start event;

[0027] When the monitoring result is an end event, detect the end event to obtain a detection result;

[0028] If the detection result is a success event, store the log corresponding to the success event;

[0029] If the detection result is a failure event, query the original operation start log corresponding to the failure event;

[0030] Obtain the exception information of the original operation start log and update the operation start log to obtain an updated log.

[0031] The beneficial effects of this technical solution are as follows: When the monitoring result is a start event, the system creates a new operation start log; when it is an end event, it distinguishes success and failure events through detection and performs different storage or update operations respectively. For success events, the corresponding logs are directly stored to ensure the quick recording of operation results; for failure events, the original start log is queried, the exception information is extracted and updated to ensure that the log contains the complete error context. This differential processing mechanism effectively improves the richness and accuracy of the log content, facilitating administrators to quickly locate the cause of operation failures. Compared with the defect of insufficient recording of failure events in traditional log systems, the exception information update mechanism of this claim significantly enhances the diagnostic ability of the log and provides key support for troubleshooting. In addition, the dynamic processing based on the monitoring result reduces the resource consumption of invalid operations and optimizes the system performance.

[0032] In some alternative embodiments, querying the updated log using the log query module to obtain a translation model includes:

[0033] Use the API module to receive a log query request;

[0034] Based on the log query request, obtain the required language type of the updated log;

[0035] Call the internationalization module to detect whether the required language type is supported;

[0036] If the required language type is supported, do nothing;

[0037] If the required language type is not supported, use the preset language type as the required language type;

[0038] Based on the required language type, use the log query module to obtain a translation model.

[0039] The beneficial effects of this technical solution are as follows: By defining the process of obtaining the log query and translation model, the multi-language dynamic adaptation of logs is achieved, significantly enhancing the system's internationalization support ability and user experience. The API module efficiently receives log query requests, extracts the required language type, and ensures accurate identification of the user's language preference. The internationalization module flexibly handles unsupported language scenarios by detecting the support status of the required language, automatically falling back to a preset language (such as en_US), ensuring the continuity of the translation service. This intelligent language switching mechanism avoids query failures caused by unsupported languages and improves the robustness of the system. The step of obtaining the translation model based on the required language type ensures the real-time and accuracy of log translation by dynamically loading the corresponding model. Compared with the inefficient way of pre-configuring all language templates in traditional log systems, the dynamic query and language adaptation mechanism of this claim significantly improves the flexibility and efficiency of translation processing, providing a seamless multi-language log access experience for global users. This method is particularly suitable for multinational cloud computing platforms, enabling rapid response to diverse language requirements and enhancing market competitiveness.

[0040] In some alternative embodiments, the method further includes:

[0041] Based on the i18n translation file, dynamically add the language corresponding to the required language type.

[0042] The beneficial effects of this technical solution are as follows: By introducing the i18n translation file and the dynamic language addition mechanism, it provides the log system with efficient new language extension capabilities, significantly reducing the development cost and maintenance difficulty of internationalization adaptation. When traditional log systems support new languages, they usually need to modify core code or redeploy, which is time-consuming and error-prone. By adding an i18n translation file (such as in MO or PO format), the system can dynamically load translation resources for new languages without changing the code or restarting the service. This design shortens the new language adaptation cycle from weeks to hours, greatly enhancing the system's response speed and scalability. The independent management of the i18n translation file reduces the risk of system updates and ensures the stability of core functions, especially suitable for rapidly iterative cloud computing environments. In addition, this mechanism supports the parallel maintenance of multiple languages, and administrators can flexibly expand language support according to market demands to meet the diverse needs of global users. Compared with the limitations of hard-coded translation methods, the dynamic language addition mechanism of this claim significantly improves the scalability and operation and maintenance efficiency of the system.

[0043] In a second aspect, the present application provides a log processing device, which includes a processor configured to implement the following steps:

[0044] A log storage module for updating and storing logs;

[0045] A log query module, which is used to query the updated log to obtain a translation model;

[0046] A log translation module, which is used to translate the updated log based on the translation model by using the log translation module;

[0047] A log return module, which is used to return the translated log to the client by using a transmission device.

[0048] In some alternative embodiments, the processor is further configured to obtain an operation event corresponding to a resource request in the following manner and send the operation event to a message queue by using a message notification program:

[0049] Obtain the start event and send the start event to the message queue by using a message notification program;

[0050] After a preset time, obtain the end event and send the operation end event to the message queue by using a message notification program.

[0051] In some alternative embodiments, the processor is configured to update and store the log based on the listening result in the following manner, including:

[0052] When the listening result is a start event, recreate the operation start log corresponding to the start event;

[0053] When the listening result is an end event, detect the end event to obtain a detection result;

[0054] If the detection result is a success event, store the log corresponding to the success event;

[0055] If the detection result is a failure event, query the original operation start log corresponding to the failure event;

[0056] Obtain the exception information of the original operation start log and update the operation start log to obtain an updated log.

[0057] In some alternative embodiments, the processor is configured to update and store the log based on the listening result in the following manner, including:

[0058] When the listening result is a start event, recreate the operation start log corresponding to the start event;

[0059] When the listening result is an end event, detect the end event to obtain a detection result;

[0060] If the detection result is a success event, store the log corresponding to the success event;

[0061] If the detection result is a failure event, query the original operation start log corresponding to the failure event;

[0062] Obtain the exception information of the original operation start log and update the operation start log to obtain the updated log.

[0063] In some alternative embodiments, the processor is configured to query the updated log using the log query module in the following manner to obtain a translation model, including:

[0064] Receive a log query request using the API module;

[0065] Based on the log query request, obtain the required language type of the updated log;

[0066] Call the internationalization module to detect whether the required language type is supported;

[0067] If the required language type is supported, do nothing;

[0068] If the required language type is not supported, use the preset language type as the required language type;

[0069] Based on the required language type, obtain the translation model using the log query module.

[0070] In some alternative embodiments, the processor is configured to perform the following operations:

[0071] Based on the i18n translation file, dynamically add the language corresponding to the required language type.

[0072] In a third aspect, the present application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of any of the above methods are implemented.

[0073] In a fourth aspect, the present application provides a log processing system, which includes:

[0074] The above electronic device.

[0075] In a fifth aspect, the present application provides a chip, which stores a computer program, and when the computer program is executed by a processor, the steps of any of the above methods are implemented. Description of the Drawings

[0076] The present application will be further described below with reference to the drawings and embodiments.

[0077] Figure 1 A flowchart showing a log processing method provided by an embodiment of the present application is shown.

[0078] Figure 2 The figure shows a schematic flowchart of a log update storage method provided by an embodiment of the present application.

[0079] Figure 3 The figure shows a schematic flowchart of a process for obtaining a translation model provided by an embodiment of the present application.

[0080] Figure 4 The figure shows a structural block diagram of a log processing device provided by an embodiment of the present application.

[0081] Figure 5 The figure shows a structural framework diagram of an electronic device provided by an embodiment of the present application.

[0082] Figure 6 The figure shows a schematic structural diagram of a log processing system provided by an embodiment of the present application.

[0083] Figure 7 The figure shows a schematic structural diagram of a program product provided by an embodiment of the present application. Detailed implementation manners

[0084] Next, in combination with the accompanying drawings and specific implementation manners, embodiments of the present application will be further described. It should be noted that, on the premise of no conflict, any combination can be formed among the following-described embodiments or technical features.

[0085] In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B may be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one (item)" or its similar expression refers to any combination of these items, including any combination of single item (item) or multiple items (items). For example, at least one (item) of a, b, or c may represent: a, b, c, a and b, a and c, b and c, a and b and c, where a, b, and c may be single or multiple. It should be noted that "at least one (item)" can also be interpreted as "one (item) or more items (items)".

[0086] It should also be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to give examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplary" or "for example" aims to present relevant concepts in a specific manner.

[0087] Method Embodiment

[0088] See Figure 1 , Figure 1 which shows a schematic flowchart of a log processing method provided by an embodiment of the present application.

[0089] An embodiment of the present application provides a log processing method for storing, updating, and translating logs. The method includes:

[0090] Step S101: Use the log storage module to update and store the logs;

[0091] Step S102: Use the log query module to query the updated logs to obtain a translation model;

[0092] Step S103: Based on the translation model, use the log translation module to translate the updated logs;

[0093] Step S104: Use the transmission device to return the translated logs to the client.

[0094] Thus, by integrating log storage, query, and translation functions, an efficient log processing method is provided, significantly improving the management and internationalization support capabilities of operation logs in the cloud computing platform. The log storage module ensures that the life cycle of user operations (start, success, failure) is accurately recorded and updated, providing a reliable data basis for subsequent queries.

[0095] The log query module realizes dynamic language adaptation of log content by obtaining the translation model, enabling users to view log content in the target language and meeting the diverse needs of global users. The log translation module performs real-time translation based on the translation model, ensuring the accuracy and consistency of the translation results, while the transmission device ensures that the translated logs are quickly returned to the client, improving the system's response speed.

[0096] This log processing flow reduces system complexity through modular design, enhancing the independence and maintainability of each functional module. Compared with the inefficient method of separately processing storage and translation in traditional log systems, this method realizes the collaborative work of storage, query, and translation, significantly improving the automation level of log processing and the user experience, and is especially suitable for high-concurrency cloud computing environments with multiple languages and multiple users, providing strong technical support for international operations.

[0097] In some alternative embodiments, a log storage module is utilized to receive event data related to user operations, create or update log records according to the event content, so as to ensure the complete recording of operation information. A log query module is used to initiate a query request for the updated log data, and by parsing the language requirements in the query request, a translation model corresponding to the log content is obtained. Based on the obtained translation model, a log translation module is used to perform language conversion on the log content, translating the log from the default language to the target language specified by the user, ensuring the accuracy and consistency of the translation result. Finally, a transmission device is used to return the translated log data to the user side through an appropriate communication interface for the user to view or further process.

[0098] See Figure 2 , Figure 2 which shows a schematic flowchart of a log update and storage method provided by an embodiment of the present application.

[0099] In some alternative implementation manners, the updating and storing of the log by using the log storage module includes:

[0100] Step S201: Use a receiving device to receive a resource request from the user side;

[0101] Step S202: Obtain an operation event corresponding to the resource request, and use a message notification program to send the operation event to a message queue. The operation event includes a start event and an end event, and the end event includes a success event and a failure event;

[0102] Step S203: Use the log storage module to monitor the message queue to obtain a monitoring result;

[0103] Step S204: Update and store the log based on the monitoring result.

[0104] Thus, by defining the detailed operation process of the log storage module, accurate capture and efficient storage of user operation events are achieved, significantly improving the reliability and real-time performance of the log system. The receiving device captures the resource request from the user side, triggers the message notification program to generate operation events (start event and end event, including success and failure events), and stores and transmits them through the message queue, ensuring the stability of event processing in high-concurrency scenarios.

[0105] The log storage module continuously listens to the message queue, obtains events in real time, and updates or stores logs according to the listening results. This processing mechanism effectively avoids the performance bottleneck of traditional synchronous storage methods and improves the throughput of the system. In addition, the classification of operation events (start, success, failure) provides a clear semantic structure for the logs, facilitating subsequent query and analysis. Compared with the defect of traditional log systems that are prone to event loss due to high concurrency, the message queue and event listening mechanism significantly enhance the integrity and fault tolerance of log records.

[0106] In some alternative embodiments, first, a receiving device is used to obtain a resource request initiated by a user terminal, and the request contains information related to the triggering operation. Based on the resource request, a corresponding operation event is generated. The operation events are divided into start events and end events, where the end events further include success events indicating successful operations and failure events indicating failed operations. The generated operation events are sent to the message queue using a message notification program to achieve asynchronous transmission of events. The log storage module continuously listens to the message queue to obtain the listening results containing event information. According to the listening results, log update or storage operations are performed, such as creating a new log record or updating the status and content of an existing log.

[0107] In some alternative embodiments, obtaining the operation event corresponding to the resource request and sending the operation event to the message queue using a message notification program includes:

[0108] Obtaining the start event and sending the start event to the message queue using a message notification program;

[0109] After a preset time, obtaining the end event and sending the operation end event to the message queue using a message notification program.

[0110] Thus, first, the start event is obtained and sent to the message queue using a message notification program; after a preset time, the end event is obtained and the operation end event is sent to the message queue. By clarifying the timing logic of operation event generation and sending, the event processing efficiency of the log system is optimized, and the accuracy and orderliness of operation log records are significantly improved.

[0111] The method stipulates that the start event is first obtained and sent to the message queue through a message notification program to mark the starting point of the operation; after a preset time, the end event is obtained and sent to ensure the timing consistency of the start and end of the operation. This step-by-step processing mechanism effectively avoids the problem of event disorder caused by complex operations or network delays, and ensures the logical integrity of log records. The introduction of the preset time provides a flexible buffer window for the system, adapts to the execution duration of different operations, and enhances the adaptability of the method to diverse operation scenarios.

[0112] Compared with the disadvantages of the traditional logging system lacking clear timing control, the timing management mechanism of this claim significantly improves the reliability of event processing and provides a high-quality data foundation for subsequent log updates and queries.

[0113] In some alternative embodiments, first, a start event representing the start of an operation is generated based on a resource request, and the start event is sent to a message queue using a message notification program to mark the start of the operation. Subsequently, after a preset time interval, wait for the operation to complete, and generate an end event representing the end of the operation. The end event is divided into a success event or a failure event according to the operation result. Using the message notification program, the end event is sent to the message queue to ensure the logical association in time between the start event and the end event.

[0114] In some alternative embodiments, the messages sent by the message notification program are called events, and events can be used to refer to specific user operations. For example, it can represent that a user deleted a resource. The event structure is as follows:

[0115] {

[0116] event_type: Event type

[0117] user_id: The user who performs the operation

[0118] project_id: The project to which the operating user belongs

[0119] request_id: The unique identifier of a user operation

[0120] error_message: The error message when the operation fails

[0121] Parameter: Parameter information required for edit operations

[0122] }

[0123] Among them, event_type is used to extract the specific user operation. Its structure is A.B.C, where A represents the object of the operation; B represents the type of the operation; C represents the result of the operation, including start, end, and error. According to the different operation results, events are divided into start events, success events, and failure events. Among them, success and failure events can both be collectively referred to as end events. For example, user.login.start means the start of user login, user.login.end means the success of user login, and user.login.error means the failure of user login.

[0124] In some alternative implementation manners, the updating and storing of the log based on the listening result include:

[0125] When the monitoring result is a start event, recreate the operation start log corresponding to the start event;

[0126] When the monitoring result is an end event, detect the end event to obtain a detection result;

[0127] If the detection result is a success event, store the log corresponding to the success event;

[0128] If the detection result is a failure event, query the original operation start log corresponding to the failure event;

[0129] Obtain the exception information of the original operation start log and update the operation start log to obtain an updated log.

[0130] Thus, when the monitoring result is a start event, the system creates a new operation start log; when it is an end event, by detecting, it distinguishes success and failure events and performs different storage or update operations respectively.

[0131] The success event directly stores the corresponding log to ensure the rapid recording of the operation result; for the failure event, the original start log is queried, the exception information is extracted and updated to ensure that the log contains the complete error context.

[0132] This differential processing mechanism effectively improves the richness and accuracy of the log content, facilitating the administrator to quickly locate the cause of the operation failure. Compared with the defect of the traditional log system that the failure event record is insufficient, the exception information update mechanism of this claim significantly enhances the diagnostic ability of the log and provides key support for troubleshooting. In addition, the dynamic processing based on the monitoring result reduces the resource consumption of invalid operations and optimizes the system performance.

[0133] In some alternative embodiments, when the log storage module monitors a start event in the message queue, it creates an operation start log corresponding to the event and records the initial state of the operation. When it monitors an end event, it further detects the type of the end event to determine whether it is a success event or a failure event. If the detection result is a success event, directly store the log corresponding to the success event and record the completion state of the operation. If the detection result is a failure event, query the original operation start log associated with the failure event, extract the exception information therein, and update the original log by adding the failure status and exception details to generate an updated log.

[0134] See Figure 3 , Figure 3 shows a schematic flowchart of a process for obtaining a translation model provided by an embodiment of the present application.

[0135] In some alternative implementation manners, the querying the updated log by using the log query module to obtain a translation model includes:

[0136] Step S301: Receive a log query request using the API module;

[0137] Step S302: Based on the log query request, obtain the required language type of the updated log;

[0138] Step S303: Invoke the internationalization module to detect whether the required language type is supported;

[0139] Step S304: If the required language type is supported, do nothing;

[0140] Step S305: If the required language type is not supported, use the preset language type as the required language type;

[0141] Step S306: Based on the required language type, use the log query module to obtain a translation model.

[0142] Thus, by defining the process of obtaining log queries and translation models, multi-language dynamic adaptation of logs is achieved, significantly enhancing the system's internationalization support capabilities and user experience. The API module efficiently receives log query requests, extracts the required language type, and ensures that the user's language preferences are accurately recognized.

[0143] The internationalization module flexibly handles unsupported language scenarios by detecting the support for the required language, automatically falling back to the preset language (such as en_US), ensuring the continuity of the translation service. This intelligent language switching mechanism avoids query failures caused by unsupported languages and enhances the system's robustness.

[0144] The step of obtaining a translation model based on the required language type ensures the real-time and accuracy of log translation by dynamically loading the corresponding model. Compared with the inefficient method of pre-configuring all language templates in traditional log systems, the dynamic query and language adaptation mechanism significantly improves the flexibility and efficiency of translation processing, providing a seamless multi-language log access experience for global users. This method is particularly suitable for multinational cloud computing platforms, enabling rapid response to diverse language requirements and enhancing market competitiveness.

[0145] In some alternative embodiments, the API module receives and processes restful requests in a load-balanced manner, providing a log data query function. The internationalization module is developed based on the i18n module, which maintains a default language translation model built on event_type, and then realizes dynamic translation in multiple languages through i18n translation files. When the api extracts log data, it will invoke the internationalization module, determine the translation language through the request header Content-Language of the request, and use the translation model corresponding to the log event_type.

[0146] In some alternative embodiments, the API module is utilized to receive a log query request sent by the client, and the request includes the identification information of the required log and the language preference. Based on the query request, the required language type of the updated log is extracted, indicating the translation language expected by the user. The internationalization module is called to detect whether the system supports this required language type. If the required language type is supported, it is directly used for subsequent processing; if not supported, the preset language type is used as the alternative required language type to ensure the continuity of the translation process. Based on the determined required language type, the log query module is used to obtain the translation model corresponding to the log content for subsequent translation operations.

[0147] In some alternative embodiments, the method further includes:

[0148] Based on the i18n translation file, the language corresponding to the required language type is dynamically added.

[0149] Thus, by introducing the i18n translation file and the dynamic language addition mechanism, an efficient new language extension ability is provided for the log system, significantly reducing the development cost and maintenance difficulty of internationalization adaptation. When traditional log systems support new languages, they usually need to modify the core code or redeploy, which takes a long time and is prone to introducing errors. However, by adding an i18n translation file (such as in MO or PO format), the system can dynamically load the translation resources of the new language without changing the code or restarting the service. This design shortens the new language adaptation cycle from weeks to hours, greatly improving the system's response speed and scalability.

[0150] The independent management of the i18n translation file reduces the risk of system updates and ensures the stability of core functions, which is particularly suitable for the rapidly iterative cloud computing environment. In addition, this mechanism supports the parallel maintenance of multiple languages, and administrators can flexibly expand language support according to market demands to meet the diverse needs of global users. Compared with the limitations of the hard-coded translation method, the dynamic language addition mechanism of this claim significantly improves the system's scalability and operation and maintenance efficiency.

[0151] In some alternative embodiments, in a cloud computing platform, the administrator needs to add German (de_DE) support to the system. The internationalization module uses the i18n MO file to manage translation resources, and the system runs on a Linux server. Add the i18n translation file: The administrator creates a de_DE.mo file, which contains the translation entries:

[0152] "vm.create.end":"Virtuelle Maschine erfolgreich erstellt",

[0153] "user.login.end": "User login successful", the file is uploaded to the system configuration directory ( / i18n / translations).

[0154] Dynamic loading: The internationalization module detects a new file, dynamically loads de_DE.mo, updates the translation model, and does not require restarting the system.

[0155] Verification: The user sends a query request (Content-Language: de_DE), the API module loads the de_DE translation model, and returns a German log ("Virtual machine successfully created").

[0156] In a specific embodiment, a receiving device is used to receive a resource request from a user terminal. For example, an operation instruction confirmed by the user through an interface triggers an operation process. Based on this resource request, a corresponding operation event is obtained. The operation event, referred to as an event, is used to represent the specific operation of the user. For example, when the user deletes a resource, the event structure includes an event type (event_type, using the A.B.C structure, where A represents the operation object, B represents the operation type, and C represents the operation result: start, end, error), the operating user (user_id), the project to which the operating user belongs (project_id), the unique identifier of a single user operation (request_id), the error message when the operation fails (error_message), and the parameter information required for edit operations (Parameter). Events are divided into start events and end events. End events include success events and failure events. A message notification program is used to obtain the start event and push it to the message queue, indicating the start of the user operation. After a preset time, the end event (success event or failure event) is obtained, and the message notification program is used to push the end event to the message queue to ensure the timing consistency between the start and end of the operation. A log storage module is used to monitor the message queue and obtain the pushed event message at any time as the monitoring result (; when the monitoring result is a start event, a new operation start log is created to record the initial state of the operation; when the monitoring result is an end event, the end event type is detected to obtain the detection result. If it is a success event, the log corresponding to the success event is stored to record the operation result. If it is a failure event, the corresponding original operation start log is queried according to event_type and request_id, its exception information is obtained, and the log is updated to modify the operation result and exception information to generate an updated log (according to claim 4). Subsequently, an API module is used to receive a log query request. Based on this request, the request header Content-Language is identified to obtain the language to be translated. The internationalization module is called to determine whether the language is supported. If it is supported, no operation is performed. If it is not supported, the default language (such as en_US) is used and a prompt message is recorded. Based on the required language type, a log query module is used to query the log database, extract operation log data, and obtain the translation model corresponding to event_type. Based on this translation model, a log translation module is used to traverse the log data, extract the corresponding translation content from the translation model according to event_type, and translate the updated log into the target language. When a new language needs to be adapted, based on the i18n translation file, the language type required is dynamically added, and by configuring the translation content related to event_type, the system loads this file to achieve multi-language dynamic translation. Finally, a transmission device is used to return the translated log to the response and present it to the user terminal through a communication interface, completing the entire process of log processing.

[0157] Device Embodiment

[0158] See Figure 4 , Figure 4 which shows a structural block diagram of a log processing device provided by an embodiment of the present application.

[0159] An embodiment of the present application also provides a log processing device, the specific implementation manner of which is consistent with the implementation manner and the achieved technical effect described in the above method embodiment, and some contents will not be repeated.

[0160] The present application provides a log processing device, the device includes a processor, and the processor is configured to implement the following steps:

[0161] A log storage module 101, configured to update and store logs;

[0162] A log query module 102, configured to query the updated logs to obtain a translation model;

[0163] A log translation module 103, configured to translate the updated logs based on the translation model by using the log translation module;

[0164] A log return module 104, configured to return the translated logs to the client by using a transmission device.

[0165] In some optional implementation manners, the processor is further configured to obtain an operation event corresponding to a resource request in the following manner, and send the operation event to a message queue by using a message notification program:

[0166] Obtain the start event and send the start event to the message queue by using a message notification program;

[0167] After a preset time, obtain the end event, and send the operation end event to the message queue by using a message notification program.

[0168] In some optional implementation manners, the processor is configured to update and store logs based on a listening result in the following manner, including:

[0169] When the listening result is a start event, recreate an operation start log corresponding to the start event;

[0170] When the listening result is an end event, detect the end event to obtain a detection result;

[0171] If the detection result is a success event, store the log corresponding to the success event;

[0172] If the detection result is a failure event, query the original operation start log corresponding to the failure event;

[0173] Obtain the exception information of the original operation start log and update the operation start log to obtain the updated log.

[0174] In some alternative embodiments, the processor is configured to update and store the log based on the listening result in the following manner, including:

[0175] When the listening result is a start event, recreate the operation start log corresponding to the start event;

[0176] When the listening result is an end event, detect the end event to obtain a detection result;

[0177] If the detection result is a success event, store the log corresponding to the success event;

[0178] If the detection result is a failure event, query the original operation start log corresponding to the failure event;

[0179] Obtain the exception information of the original operation start log and update the operation start log to obtain the updated log.

[0180] In some alternative embodiments, the processor is configured to query the updated log using a log query module in the following manner to obtain a translation model, including:

[0181] Use the API module to receive a log query request;

[0182] Based on the log query request, obtain the required language type of the updated log;

[0183] Call the internationalization module to detect whether the required language type is supported;

[0184] If the required language type is supported, do nothing;

[0185] If the required language type is not supported, use the preset language type as the required language type;

[0186] Based on the required language type, use the log query module to obtain a translation model.

[0187] In some alternative embodiments, the processor is configured to implement the following operations:

[0188] Based on the i18n translation file, dynamically add the language corresponding to the required language type.

[0189] Device embodiment

[0190] An embodiment of the present application further provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of any of the above methods are implemented. The specific implementation manners are the same as those described in the above method embodiments and achieve the same technical effects, and some contents will not be repeated here.

[0191] See Figure 5 , Figure 5 which shows a structural framework diagram of an electronic device provided by an embodiment of the present application.

[0192] The electronic device includes at least one memory 210, at least one processor 220, and a bus 230 connecting different platform systems.

[0193] The memory 210 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 211 and / or a cache memory 212, and may further include a read-only memory (ROM) 213.

[0194] Among them, the memory 210 also stores a computer program, and the computer program can be executed by the processor 220, so that the processor 220 implements the steps of any of the above methods.

[0195] The memory 210 may further include a utility 214 having at least one program module 215. Such program modules 215 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples.

[0196] Correspondingly, the processor 220 can execute the above computer program and can also execute the utility 214.

[0197] The processor 220 may employ one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0198] The bus 230 may represent one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure of multiple bus structures.

[0199] The electronic device can also communicate with one or more external devices 240 such as a keyboard, a pointing device, a Bluetooth device, etc., and can also communicate with one or more devices capable of interacting with the electronic device, and / or communicate with any device (such as a router, a modem, etc.) that enables the electronic device to communicate with one or more other computing devices. Such communication can be carried out through the input / output interface 250. Moreover, the electronic device can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 260. The network adapter 260 can communicate with other modules of the electronic device through the bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, etc.

[0200] System embodiments

[0201] See Figure 6 , Figure 6 shows a schematic structural diagram of a log processing system provided by an embodiment of the present application.

[0202] The embodiment of the present application also provides a log processing system, and the system includes:

[0203] The above-mentioned electronic device.

[0204] Medium embodiments

[0205] The embodiment of the present application also provides a chip, and the chip stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above methods are implemented, and its specific implementation manners are consistent with the implementation manners and the achieved technical effects recorded in the above method embodiments, and some contents will not be repeated.

[0206] See Figure 7 , Figure 7 shows a schematic structural diagram of a program product provided by an embodiment of the present application.

[0207] The program product is used to implement any of the above methods. The program product may be a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In the embodiments of the present application, the readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in conjunction with an instruction execution system, apparatus, or device. The program product may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0208] The chip may include data signals that are included in the baseband or propagated as part of a carrier wave, which carry the readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium may also be any readable medium that can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination of the above. The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as C language, Python language, or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, executed as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., by using an Internet service provider to connect through the Internet).

[0209] This application is described from the perspectives of purpose of use, effectiveness, progress, and novelty, and has met the functional enhancement and usage requirements emphasized by the patent law. The above description and accompanying drawings of this application are only preferred embodiments of this application and do not limit this application thereby. Therefore, all those that are similar or identical to the structure, device, features, etc. of this application, that is, all equivalent substitutions or modifications made according to the scope of the patent application of this application, shall fall within the scope of protection of the patent application of this application.

Claims

1. A log processing method, characterized in that, Perform storage, update, and translation operations on logs. The method includes: Use the log storage module to update and store logs; Use the log query module to query the updated logs to obtain a translation model; Based on the translation model, use the log translation module to translate the updated logs; Use the transmission device to return the translated logs to the client.

2. The log processing method according to claim 1, wherein The use of the log storage module to update and store logs includes: Use the receiving device to receive a resource request from the client; Obtain the operation event corresponding to the resource request, and use the message notification program to send the operation event to the message queue. The operation event includes a start event and an end event, and the end event includes a success event and a failure event; Use the log storage module to listen to the message queue to obtain a listening result; Update and store the logs based on the listening result.

3. The log processing method according to claim 2, wherein The obtaining of the operation event corresponding to the resource request and the use of the message notification program to send the operation event to the message queue include: Obtain the start event and use the message notification program to send the start event to the message queue; After a preset time, obtain the end event, and use the message notification program to send the operation end event to the message queue.

4. The log processing method according to claim 2, wherein The updating and storing of the logs based on the listening result includes: When the listening result is a start event, recreate the operation start log corresponding to the start event; When the listening result is an end event, detect the end event to obtain a detection result; If the detection result is a success event, store the log corresponding to the success event; If the detection result is a failure event, query the original operation start log corresponding to the failure event; Obtain the exception information of the original operation start log and update the operation start log to obtain an updated log.

5. The log processing method according to claim 1, wherein The use of the log query module to query the updated logs to obtain a translation model includes: Use the API module to receive a log query request; Based on the log query request, obtain the required language type of the updated logs; Call the internationalization module to detect whether the required language type is supported; If the required language type is supported, do nothing; If the required language type is not supported, use the preset language type as the required language type; Based on the required language type, use the log query module to obtain a translation model.

6. The log processing method according to claim 1, wherein The method further includes: Dynamically add the language corresponding to the required language type based on the i18n translation file.

7. A log processing device, characterized in that, The log processing device includes: A log storage module for updating and storing logs; A log query module for querying the updated logs to obtain a translation model; A log translation module for translating the updated logs based on the translation model using the log translation module; A log return module for returning the translated logs to the client using the transmission device.

8. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and the processor is configured to execute the steps of the method according to any one of claims 1-6.

9. A log processing system, characterized in that, The log processing system includes: The electronic device according to claim 8.

10. A chip, characterized in that, The chip stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1-6 are implemented.

Citation Information

Patent Citations

  • Log data query method and device, computer equipment and storage medium

    CN119201853A