Log generation method, electronic equipment, readable storage medium and program product

By establishing the relationship between tracking identifiers and components in the cloud platform and recording the tracking identifiers in the log content, the problem of low log query efficiency in the cloud computing platform is solved, and the effect of quickly locate business-related logs is achieved.

CN120295872APending Publication Date: 2025-07-11HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410045391.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-11
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

On cloud computing platforms, it is necessary to switch query information to find the behavioral logs of each component separately, which is inefficient, especially when business changes, it is difficult to quickly locate related logs.

Method used

By establishing a relationship between tracking identifiers and components in the cloud platform, the record log content includes tracking identifiers, so that users can directly query related logs, reducing the steps of switching query information.

Benefits of technology

Improve the efficiency of log query, and users can quickly locate all component logs related to business, reducing the cumbersome search process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295872A_ABST
    Figure CN120295872A_ABST
Patent Text Reader

Abstract

The invention relates to the field of cloud computing, in particular to a log generation method, electronic equipment, a readable storage medium and a program product, in the method, a client can receive a tracking identifier which can be input in a configuration interface by a user, and a server establishes a relationship among the tracking identifier, a service and a component based on the tracking identifier received from the client, and generates a log according to the relationship among the tracking identifier, the service and the component. And based on the established relationship, recording the tracking identifier into a log of a plurality of component operation related services. On the basis, the user can retrieve the log which wants to quickly search the corresponding business of the plurality of components on the basis of the tracking identifier, so that the retrieval efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing, and particularly to a log generation method, an electronic device, a readable storage medium, and a program product. Background Art

[0002] With the rapid development of cloud computing technology, cloud computing platforms such as public clouds, private clouds, and hybrid clouds (hereinafter referred to as "cloud platforms") can provide container cluster hosting services for managing container clusters. The operation and maintenance personnel of a company can purchase a container cluster hosting service on the cloud platform and then deploy their own services on the container cluster. For example, a financial company can deploy its trading service on the corresponding container cluster after purchasing the container cluster hosting service, and then can easily manage the trading service with the help of the container cluster hosting service.

[0003] Among them, the container cluster hosting service involves a large number of resource-related components. For example, there is a gateway component for accessing resources, an elastic scaling component for elastic resource scaling, etc., which are used to provide core functions and features when the container cluster runs services.

[0004] It can be understood that since the services deployed on the cloud platform involve many and complex components, when a service deployed on the cloud platform changes, when the operation and maintenance personnel want to view the behavior logs of multiple components related to a certain service change, in some cases, due to some components, such as cloud native components, being independent and having no interaction, at this time, it is necessary to separately search for the behavior logs of each component related to the service. For example, it is necessary to switch the query information to separately find the behavior logs of the corresponding components, and the efficiency is low. Summary of the Invention

[0005] To solve the above problems, embodiments of this application provide a log generation method, an electronic device, a readable storage medium, and a program product, which are used to solve the problem of low efficiency in separately finding the behavior logs of corresponding components by switching query information.

[0006] In a first aspect, an embodiment of this application provides a log query method, and the method includes: The server obtains a first trace identifier, establishes a first relationship, where the first relationship identifies the correspondence between a first service and the first trace identifier, and the first service is also associated with multiple components of the server, and the multiple components include a first component; The server records the first trace identifier in the first log content generated by the first component running the first service according to the first relationship.

[0007] It can be understood that after the server (such as the following cloud platform) obtains the first tracking identifier, it can establish a first relationship, which is the relationship between the first service (such as a transaction service) and the first tracking identifier, as well as multiple components related to the first service. The associated components are the components corresponding to the logs related to the first service that the user wants to quickly retrieve. It can be understood that the multiple components are all the components involved when the first service runs (such as changes), or it can be some of the components that the user wants to query among all the components. At this time, based on the first relationship, when each of the multiple components runs the first service, the first tracking identifier is recorded in the running log content, so as to mark the logs that the user wants to quickly retrieve, so that when the user performs log queries later, there is no need to switch query information to separately find the behavior logs of the corresponding components, improving efficiency.

[0008] In a possible implementation of the above first aspect, the server records the first tracking identifier in the first log content generated by the first component running the first service according to the first relationship, including: the server saves the first log content in a first log file, and the first log file also includes the log content generated by the first component running at least one second service.

[0009] It can be understood that the server can save the first log content including the first tracking identifier in the first log file during the log generation process. The first log file also includes other logs, for example, logs that do not include tracking identifiers, thereby saving storage resources.

[0010] In a possible implementation of the above first aspect, the server records the first tracking identifier in the first log content generated by the first component running the first service according to the first relationship, and further includes: the server saves the first log content in a second log file, and the second log file only includes the log content generated by the first component running the first service.

[0011] It can be understood that the server can save the first log content including the first tracking identifier in a second log file during the log generation process. The second log file only includes the log content generated by the first component running the first service. At this time, the original logs that do not include tracking identifiers can still be retained for other scenarios.

[0012] In a possible implementation of the above first aspect, it further includes: the client displays a first configuration interface and receives a first input from a first user in the first configuration interface to obtain first configuration information, where the first configuration information includes a first tracking identifier, the first tracking identifier includes a first service identifier and a first component identifier, and the first service identifier is used to represent the first service, and the first component identifier is used to represent multiple components associated with the first service; the server receives the first configuration information from the client.

[0013] It can be understood that the client can directly receive the input tracking identifier. The first tracking identifier includes a first service identifier and a first component identifier. The first service identifier is used to represent the first service, and the first component identifier is used to represent multiple components associated with the first service, so that the relationship among the tracking identifier, the first service, and multiple components can be reasonably established.

[0014] In a possible implementation of the first aspect above, it further includes: the client displays a second configuration interface, and receives at least one service selected by the first user in the second configuration interface, and at least one component of each service in the at least one service, to obtain second configuration information; the server receives the second configuration information from the client, and generates a first tracking identifier according to the second configuration information, where the first tracking identifier includes a second service identifier and a second component identifier, and the second service identifier is used to represent at least one service, and the second component identifier is used to represent at least one component of each service in the at least one service, the at least one service includes the first service, and the at least one component includes the first component.

[0015] It can be understood that the server generates a first tracking identifier, which includes a second service identifier and a second component identifier, and the second service identifier is used to represent at least one service, and the second component identifier is used to represent at least one component of each service in the at least one service. At this time, the relationship among the first tracking identifier, at least one service, and at least one component of each service in the at least one service can be scientifically established. And since the at least one service includes the first service and the at least one component includes the first component, the relationship among the first tracking identifier, the first service, and multiple components related to the first service is established.

[0016] In a possible implementation of the first aspect above, the server obtains the first tracking identifier and establishes a first relationship, including: the server generates multiple first service identifiers according to the first tracking identifier, where each first service identifier is used to represent the corresponding relationship between the first service and each component; the server obtains the first relationship according to the corresponding relationship between the first tracking identifier and each first service identifier.

[0017] It can be understood that the server generates multiple first service identifiers according to the first tracking identifier. Since each first service identifier is used to represent the corresponding relationship between the first service and each component, the server obtains the first relationship according to the corresponding relationship between the first tracking identifier and each first service identifier, which is scientific and reasonable.

[0018] In a possible implementation of the above first aspect, the first component identifier in the first tracking identifier is a first resource coordinate type identifier, the first service identifier includes the resource type identifier corresponding to the component, and the server generates the first service identifier in the following manner, including: when the resource corresponding to the component is a cloud-native resource, converting the first tracking identifier into the first service identifier through a cloud-native resource converter; when the resource corresponding to the component is a custom resource, converting the first tracking identifier into the first service identifier through a registration function.

[0019] It can be understood that the resource type identifier of the resource corresponding to each component will be included in the logs generated when each component implements its respective services. When the first component identifier in the first tracking identifier is the first resource coordinate type identifier and the first service identifier includes the resource type identifier corresponding to the component, at this time, the first tracking identifier can be effectively converted into the corresponding first service identifier through cloud-native resources or a registration function, thereby establishing the corresponding relationship between the first tracking identifier and each first service identifier.

[0020] In a possible implementation of the above first aspect, the server records the first tracking identifier in the first log content generated when the first component runs the first service according to the first relationship, including: determining that the log content generated when the first component runs the first service matches the first service identifier, and recording the first tracking identifier in the matching log content.

[0021] It can be understood that the log content generated when the first component runs the first service can be matched with the first service identifier, so as to quickly filter out the required log content.

[0022] In a possible implementation of the above first aspect, it further includes that the client receives a first log query instruction and instructs the server to perform a log query, where the first log query instruction includes the first tracking identifier; the server obtains a first query log according to the first tracking identifier in the first log query instruction; the client receives the first query log from the server and displays at least part of the logs in the first query log, and at least part of the logs includes content associated with the first tracking identifier.

[0023] It can be understood that when the client displays, it can be displayed in various ways, such as by scrolling, etc., so that the content displayed is at least part of the logs in the first query log.

[0024] In a possible implementation of the above first aspect, when the client receives the first log query instruction, it further includes that the client receives a first quick log query control selected by the first user and displays at least one tracking identifier; the client receives the first tracking identifier selected by the first user from at least one tracking identifier to obtain the first log query instruction of the first user.

[0025] In a possible implementation of the first aspect above, the first log query instruction is a voice instruction.

[0026] In a possible implementation of the first aspect above, it further includes: the client receives a second log query instruction, where the second query instruction includes a first retrieval identifier, and the first retrieval identifier includes at least one of the following: log level, warning information, user identifier, time information.

[0027] It can be understood that when the client receives a second log query instruction, where the second query instruction includes a first retrieval identifier, and the first retrieval identifier includes at least one of the following: log level, warning information, user identifier, time information, at this time, it is convenient for the server to find the required log from the log including the first tracking identifier according to the first retrieval identifier, that is, quickly find the required log from the narrowed log query range, improving efficiency.

[0028] In a second aspect, an embodiment of the present application provides an electronic device, including: a memory for storing instructions, and one or more processors, when the instructions are executed by the one or more processors, the processor executes any log generation method in the first aspect and various implementations of the first aspect above.

[0029] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which instructions are stored, and the instructions execute any log generation method in the first aspect and various implementations of the first aspect above on an electronic device.

[0030] In a fourth aspect, an embodiment of the present application provides a computer program product, the computer program product includes: computer program code, when the computer program code runs on a computer, it causes the computer to execute any log generation method in the first aspect and various implementations of the first aspect above.

[0031] Among them, the beneficial effects of the second aspect to the fourth aspect can refer to the beneficial effects related to the first aspect, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 According to some embodiments of the present application, a schematic diagram of a scenario for deploying services on a cloud platform is shown;

[0033] Figure 2A According to some embodiments of the present application, a schematic diagram of a cloud platform 2000 is shown;

[0034] Figure 2B According to some embodiments of the present application, a schematic diagram of interface 001 of a log platform M1 is shown;

[0035] Figure 2CAccording to some embodiments of the present application, a schematic diagram of the interface 002 of a log platform M1 is shown;

[0036] Figure 2D According to some embodiments of the present application, schematic diagrams of the interface 003a and the interface 003b of a log platform M2 are shown;

[0037] Figure 3A According to some embodiments of the present application, a schematic diagram of the interface 004 of a log platform M3 is shown;

[0038] Figure 3B According to some embodiments of the present application, a schematic diagram of the interface 005 of a log platform M3 is shown;

[0039] Figure 3C According to some embodiments of the present application, a schematic diagram of the interface 006 of a log platform M3 is shown;

[0040] Figure 3D According to some embodiments of the present application, a schematic diagram of the interface 007 of a log platform M3 is shown;

[0041] Figure 3E According to some embodiments of the present application, a schematic diagram of a configuration interface P0 is shown;

[0042] Figure 4A According to some embodiments of the present application, a schematic diagram of a framework 300 corresponding to a log generation method is shown;

[0043] Figure 4B According to some embodiments of the present application, a schematic diagram of a cloud platform 3000 is shown;

[0044] Figure 5A According to some embodiments of the present application, a schematic diagram of the process in which a cloud platform receives resource coordinates and generates a coloring set is shown;

[0045] Figure 5B According to some embodiments of the present application, a schematic diagram of a configuration interface P1 is shown;

[0046] Figure 6 According to some embodiments of the present application, a schematic diagram of the process of generating a colored log is shown;

[0047] Figure 7 According to some embodiments of the present application, a schematic diagram of the process of querying a log is shown;

[0048] Figure 8 According to some embodiments of the present application, a schematic diagram of the interaction process in which a computer 1000 and a cloud platform 3000 implement the log generation method of the present application is shown;

[0049] Figure 9 According to some embodiments of the present application, a schematic diagram of a device is shown. Detailed implementation manners

[0050] Exemplary embodiments of the present application include, but are not limited to, a log generation method, an electronic device, a readable storage medium, and a program product.

[0051] Next, embodiments of the present application will be introduced with reference to the accompanying drawings.

[0052] Figure 1 According to some embodiments of the present application, a schematic diagram of a scenario for deploying a service on a cloud platform is shown. As Figure 1 shown, user K (e.g., an operation and maintenance personnel of a company) purchases a container cluster hosting service using computer 1000 and deploys a trading service on cloud platform 2000, so that the specific trading service can be processed through the hardware resources and software resources provided on cloud platform 2000.

[0053] It can be understood that when a service deployed on cloud platform 2000 runs, it involves multiple components related to various resources. For example, as Figure 2A shown, cloud platform 2000 involves container orchestration component 10, resource deployment component 11, traffic access component 12, and elastic scaling component 13, etc.

[0054] It can be understood that the resources corresponding to each component can correspond to the specific functions of each component. Specifically, container orchestration component 10 is used to manage the containers in the container cluster; resource deployment component 11 may be involved in deploying resources and providing service deployment services; traffic access component 12 may be involved in traffic access resources and be used to provide network access traffic services to accessing users; elastic scaling component 13 may be involved in elastic scaling resources and be used to automatically increase or decrease computing resources according to the load of the application program. It can be understood that container orchestration component 10, resource deployment component 11, traffic access component 12, and elastic scaling component 13 can all be a system or a separately running toolkit. When a service is deployed on a cloud platform and runs, the components related to the service will provide their respective resources corresponding to the service, so as to implement service processing. And, one component corresponds to one resource, and thus corresponds to a resource type identifier. For example, resource deployment component 11 corresponds to deployment resources, then the resource type identifier corresponding to resource deployment component 11 is the deployment resource identifier, such as Deployment.

[0055] In some embodiments, when each service is running, behavior logs corresponding to each service will be generated on the log platform provided by the cloud platform 2000. Since each component is independent of each other, when user K wants to view all the logs of a certain service, it is necessary to separately search for the specific behavior logs of that service in the sub-platforms corresponding to the behavior logs of each component in the log platform. This process is cumbersome and inefficient.

[0056] For example, when the above-mentioned trading service undergoes a change, user K observes through the traffic monitor that the traffic access delay of the traffic access component 12 is relatively large. Since the traffic access delay of the traffic access component 12 may be related to all the components involved in the operation of the trading service, user K can separately view the behavior logs of each component corresponding to the changed service on the log platform to find the cause of the anomaly.

[0057] Figure 2B An interface 001 of a log platform M1 is shown. The interface 001 shows log analysis controls corresponding to multiple components provided by the cloud platform 2000. By clicking on the log analysis control of each component, the corresponding behavior log content can be viewed. For example, assume that the trading service involves a traffic access component A1, an elastic scaling component B1, and a resource deployment component C2. If it is necessary to analyze the cause of the above-mentioned traffic delay anomaly, it is necessary to separately click on the "Traffic Access Component A1 Log Analysis" control, the "Elastic Scaling Component B1 Log Analysis" control, and the "Resource Deployment Component C2" control on the interface M1 to search for the behavior log content of the trading service. For example, when clicking on the "Traffic Access Component A1 Log Analysis" control, it will jump to the interface 002 as shown in Figure 2C User K needs to search for the specific logs of the trading service among the logs corresponding to multiple services shown in the jumped interface 002. It can be seen that the process for user K to find the behavior logs of all components involved in the trading service is rather cumbersome and inefficient.

[0058] In addition, Figure 2DThe schematic diagrams of interface 003a and interface 003b of another log platform M2 are shown. User K can first retrieve components through the search box K1 of the log platform M2. As shown in interface 003a, enter "traffic access component identifier 1" in the search box K1 first. After retrieving the logs of the traffic access components as shown in interface 003b, the user needs to filter the behavior logs related to the current transaction business from the logs of the corresponding components. For example, the user selects the log files related to the transaction business in interface 003b, and then interface 003b will jump to the log file interface of the transaction business (not shown in the figure), so as to find the required logs. Similarly, this process requires switching the query information corresponding to each component in the search box, and obtaining the behavior logs of multiple components corresponding to the transaction business according to the switched query information. This process is relatively cumbersome and inefficient.

[0059] In summary, since each component is independent of each other, user K needs to retrieve each component. And there are many running services, and it is necessary to retrieve each component separately in the log platform to view all the logs of each component related to the service that the user wants to quickly find, and it is impossible to quickly view all the logs related to this service.

[0060] To solve the above problems, the present application proposes a log generation method. In this method, the user can pre-select the log range that wants to be quickly retrieved. For example, the user can, through the configuration interface, input the services, components, etc. included in the log range that wants to be quickly retrieved, so as to determine the corresponding log range. Then set one or more tracking identifiers for the logs within the log range that the user selects for quick retrieval. Or, the user can set the tracking identifiers of the logs in the corresponding log range according to the log range that wants to be quickly retrieved in advance. For example, the user can input the tracking identifier through the configuration interface, and this tracking identifier is used to identify the logs of 3 components related to the transaction business that the user wants to query together. At this time, based on the set tracking identifier, logs including the tracking identifier can be generated. Then, use the tracking identifier set by the user as the tracking identifier of the logs within the log range that belongs to the quick retrieval of the logs. In this way, since the cloud computing platform can add the tracking identifier to the logs within the corresponding log range during the running process. When it is detected that the user performs a quick retrieval of the logs, the logs within the log range selected by the user can be quickly retrieved based on the tracking identifier.

[0061] It can be understood that at this time, according to the tracking identifier, the relationship between the tracking identifier, the service, and the component can be established. This relationship can identify the corresponding relationship between the tracking identifier and at least one service, and each service is associated with multiple components. Therefore, based on the established relationship, the tracking identifier is recorded in the logs generated by each component running the corresponding service related to the tracking identifier, so as to obtain the required logs.

[0062] Specifically, the user can input the first tracking identifier on the configuration page provided by the computer 1000 and then send the first tracking identifier to the cloud platform. After obtaining the first tracking identifier, the cloud platform establishes a first relationship, which identifies the correspondence between the first service (such as a transaction service) and the first tracking identifier. The first service is also associated with multiple components of the cloud platform (such as the traffic access component and the elastic scaling component among the multiple components provided by the cloud platform), and the associated components are the components corresponding to the logs related to the first service that the user wants to quickly retrieve. At this time, based on the first relationship, when each of the foregoing multiple components runs the first service, the first tracking identifier is recorded in the running log content, thereby marking the logs that the user wants to quickly retrieve, enabling subsequent fast retrieval. For example, the foregoing multiple components include a first component (such as an elastic scaling component); according to the first relationship, the first tracking identifier is recorded in the first log content generated when the first component (such as the elastic scaling component) runs the first service (such as the transaction service).

[0063] It can be understood that in some implementation manners, when the cloud platform records the first tracking identifier in the first log generated when the first component (such as an elastic scaling component) runs the first service (such as a transaction service), the first log content can be saved in the first log file. At this time, the first log file also includes the log content generated when the first component runs other services unrelated to the tracking identifier. For example, the cloud platform can still save the log with the tracking identifier in the log file corresponding to the log that did not originally have the tracking identifier.

[0064] It can be understood that in other implementation manners, when the cloud platform records the tracking identifier in the first log generated when the first component (such as an elastic scaling component) runs the first service (such as a transaction service), the first log content is saved in the second log file, and the second log file only includes the log content generated when the first component runs the first service. For example, the cloud platform can still save the log with the tracking identifier in another log file. At this time, the log with the tracking identifier will not overwrite the log without the tracking identifier originally, facilitating subsequent use by the user.

[0065] It can be understood that the user can be not only the operation and maintenance personnel of the aforementioned company, but also the operation and maintenance personnel of the cloud computing platform, or any other person who needs to query the logs.

[0066] It can be understood that when a user conducts a log query, after entering a tracking identifier on the received user log query interface (such as the log platform mentioned above), logs including the tracking identifier can be displayed according to the tracking identifier. It can be understood that the displayed logs can be all the logs corresponding to the tracking identifier, or partial logs. The partial logs include content associated with the tracking identifier. For example, in the case of screen size limitations, only partial logs can be displayed, and other logs need to be viewed by scrolling down.

[0067] In some implementation manners, the log query interface can provide one search box for the user to directly enter a specific tracking identifier for searching.

[0068] For example, Figure 3A Figure 004 of an interface of a log platform M3 is shown. After the log platform M3 on the cloud platform receives the tracking identifier J1 of "Deployment / default / test" entered by user K in the search box K31, it can determine and display the logs in the log file that match the tracking identifier J1. Assume that the tracking identifier J1 has a corresponding relationship with a transaction service, and the transaction service is associated with a resource deployment component, an elastic scaling component, and a traffic access component. At this time, refer to Figure 3BThe interface 005 shown displays the behavior logs of the resource deployment component running the transaction business, the behavior logs of the elastic scaling component running the same transaction business, and the behavior logs of the traffic access component running the same transaction business. Specifically, the behavior log of the same transaction business run by the resource deployment component is: 2023-07-25 DEBUG color.go:104 this is a deploy systeminfo level message {"Resource":{"Kind":"Deployment","Namespace":"default","Name":"test"} "MainResource": "Deployment / default / test"}; the behavior log of the same transaction business run by the elastic scaling component is: 2023-07-25 DEBUG color.go:104 this is a ingress systeminfo level message {"Resource": {"Kind": "Upstream", "Namespace": "default", "Name": "test"} "MainResource": "Deployment / default / test"}; the behavior log of the same transaction business run by the traffic access component is: 2023-07-25 ERROR color.go:104 this is a bug here in hpa system {"Resource":{"Kind":"HPA","Namespace":"default","Name":"test"} "MainResource": "Deployment / default / test"}. It can be understood that the multiple behavior logs displayed are the behavior logs of the components related to the transaction business, and the behavior log of each component includes the trace identifier J1 "Deployment / default / test".

[0069] In some other implementation manners, the log query interface may provide 1 quick log query control, and after receiving the quick log query control selected by the user, display all the set trace identifiers, receive the trace identifier selected by the user from the displayed trace identifiers, and perform a retrieval to obtain the required logs. For example, Figure 3C An interface 006 of a log platform M4 is shown. After the log platform M4 on the cloud platform receives that the user K selects the "quick log query" control K32, the interface 006 will jump to as Figure 3DThe interface 007 shown. All the set tracking identifiers will be displayed in the display box K33 on this interface, such as "Deployment / default / test", "Deployment / ue / hui", etc. shown in box K33 in the figure. At this time, user K can select the required tracking identifier J1 "Deployment / default / test" to obtain the required logs.

[0070] It can be understood that when the business changes, for example, when the business production environment changes and the business cannot be processed, and it is necessary to locate the specific problem. At this time, the cloud platform can retrieve the behavior log content of each component corresponding to the input tracking identifier in the log file according to the tracking identifier input by the user in the log query interface, so as to improve the search efficiency and reduce the losses of the user.

[0071] It can be understood that general users need to care about whether there are problems with the components involved in running a certain or certain businesses. Therefore, users usually need to care about the logs of the components involved in running a certain or certain businesses. Therefore, the above tracking identifier can be set according to the business and business-related components selected by the user, or the user can set the corresponding tracking identifier by himself. It can be understood that when setting the corresponding tracking identifier according to the business and business-related components selected by the user, the user can select the logs of all components related to the business as the logs for quick retrieval, or the logs of some of the components as the logs for quick retrieval.

[0072] For example, in the case where the tracking identifier is set for some or all of the components related to one or more businesses selected by the user, at this time, the computer 1000 can also provide a configuration interface for the user. There are selection items for components and businesses on this configuration interface. Each business selection item has a corresponding component selection item. After the user selects one or more businesses, the user can select some or all of the components corresponding to the business. The cloud platform connected to the computer 1000 generates a corresponding tracking identifier according to the user's selection. Similarly, the tracking identifier has a business identifier for identifying the business and a component identifier for identifying the components related to the business. For example, the business identifier is obtained by splicing the first 2 letters of multiple business names, and the component identifier is obtained by splicing the first 2 letters of each business and the corresponding multiple component names in sequence to obtain the tracking identifier. Then, the tracking identifier is recorded in the logs of the business and the corresponding components selected by the user. For example, for a certain test business deployed, the components related to the test business include a container orchestration component, a resource deployment component, a traffic access component, and an elastic scaling component. The user selects the container orchestration component and the resource deployment component on the configuration interface. At this time, the tracking identifier is the tracking identifier of some components corresponding to the test business. As Figure 3EA configuration interface P0 is shown. The configuration interface displays services 1,....., service n, and each of services 1 - n has a corresponding multiple components for selection. The user can select one or more services and select some or all of the corresponding components of the selected services. For example, Figure 3E In Figure 3E , the user selects service 1 and selects component D1 corresponding to service 1, selects service 2 and selects component D1 and component D3 corresponding to service 2. The cloud platform connected to computer 1000 generates a corresponding tracking identifier according to the user's selection. For example, the service identifier "JISU" is obtained by splicing the first 2 letters of the names "JIAN" and "SUAN" of services 1 and 2. According to the first 2 letters of the name "JIAN" of service 1 and the name "ZIYUAN" of the selected component D1, and the first 2 letters of the name "SUAN" of service 2, the name "FANGZHI" of the selected component D1, and the name "KELE" of component D3, they are spliced in order to obtain the component identifier "JIZISUFAKE", and the tracking identifier "JIZISUFAKE / JISU" is obtained. Then, the tracking identifier is recorded in the logs of the services and the corresponding components selected by the user.

[0073] For another example, in the case where the tracking identifier is set by the user for the logs of all components related to the service, at this time, computer 1000 can directly provide the user with a configuration interface. Parameter items corresponding to the tracking identifier are provided on this configuration interface. The cloud platform connected to computer 1000 receives 1 tracking identifier input by the user in the parameter items. This tracking identifier contains a service identifier for identifying the service and a component identifier for identifying the components related to the service. For example, for a certain test service deployed, the components related to this test service include a container orchestration component, a resource deployment component, a traffic access component, and an elastic scaling component. At this time, this tracking identifier is the tracking identifier of all components corresponding to the test service. For details, reference can be made to the introduction of configuration interface P1 below, which will not be elaborated here for the time being.

[0074] In addition, when the logs that the user is concerned about can be a certain type of business, therefore, the tracking identifier can be used to identify the logs of all components corresponding to a certain type of business selected by the user. For example, the computer 1000 can provide the user with another configuration interface, and business category options are provided on this configuration interface. Each business category corresponds to multiple businesses. For example, currently there are 100 business categories, which are transaction-based businesses, game-based businesses,...... and so on. And the user is more concerned about the transaction-based businesses among the 100 business categories. For example, the transaction-based businesses include financial transaction business 1 and shopping transaction business 2. At this time, after the user selects the transaction-based business on the configuration interface, the cloud platform connected to the computer 1000 will automatically generate a tracking identifier 1 according to the selected transaction-based business and the components involved in each transaction-based business. This tracking identifier 1 can identify the logs of all components corresponding to the financial transaction business 1, shopping transaction business 2, and other transaction-based businesses selected by the user.

[0075] It is also possible that when the logs that the user is concerned about are the logs of all businesses run by certain components, at this time, the tracking identifier can also be used to identify the entire log range of the selected set of components. It can be understood that the log ranges of different sets of components correspond to different tracking identifiers. For example, user K can set 2 tracking identifiers on the configuration interface, and each tracking identifier corresponds to a different one of the 2 components respectively. At this time, the cloud platform can automatically generate 2 tracking identifiers 1 and tracking identifier 2, and tracking identifier 1 can be recorded in the logs of all businesses run by the container orchestration component and the resource deployment component, and tracking identifier 2 can be recorded in the logs of all businesses run by the traffic access component and the elastic scaling component.

[0076] It can be understood that since the resources corresponding to each component are generally different, and the logs generated when implementing each business will include the resource type identifier of the resources corresponding to that component, the component identifier in the tracking identifier can be a certain resource type identifier, and this resource type identifier can be associated with the logs of each component involved in this business.

[0077] In summary, the above ways of setting the tracking identifier can be various and are not limited to the examples given above.

[0078] It can be understood that when the cloud platform obtains the tracking identifier, it can record the tracking identifier in the logs of the components involved in the corresponding business in various ways.

[0079] For example, when setting the tracking identifier for the logs of the corresponding log range for the above user, the cloud platform can record the tracking identifier in the log content of each component running the business corresponding to a business in the following way:

[0080] It can be understood that the logs generated by each component when implementing each service will include the resource type identifier of the resources corresponding to the component (i.e., the resource type identifier is the component identifier corresponding to the above-mentioned component), the service identifier of the specific service, and other additional information. For example, the log generated when component 1 corresponding to the traffic access resource implements service 1 includes the traffic access identifier "Upstream", the service identifier "test" corresponding to "test", and the additional information "default" corresponding to the namespace, etc.

[0081] Therefore, when the cloud platform obtains the tracking identifier, it can generate a service identifier corresponding to each component implementing the corresponding service according to the tracking identifier. At this time, each service identifier represents the relationship between the service corresponding to the tracking identifier and each component. Then, the corresponding relationship between the tracking identifier and each service identifier can be established. Based on the service identifier, the log of the component running the service is determined, so as to record the tracking identifier into the corresponding log. Specifically, the resource type identifier in the tracking identifier can be converted into the resource type of each component, so as to obtain the corresponding service identifier, so that the tracking identifier is associated with the logs of each component through the resource type. It can be understood that the service identifier of each component may include the resource type identifier corresponding to its own resource type and the service identifier corresponding to the service.

[0082] For example, the tracking identifier corresponding to the service "test" is "Deployment / default / test". Among them, "Deployment" represents a resource type identifier set by the user, "default" represents the namespace, corresponding to the user, and "test" represents the service "test". The tracking identifier J1 of this service received by the cloud platform, "Deployment / default / test", includes the resource type identifier J11 "Deployment", while the resource type identifiers corresponding to Component 1 and Component 2 are D11 "Upstream" and D22 "HPA" respectively. Among them, "Upstream" corresponds to the resource type of the traffic access resource, and "HPA" represents the resource type corresponding to the elastic scaling resource. At this time, the cloud platform can convert the resource type identifier, that is, convert the resource type identifier J11 in the tracking identifier J1 into the resource type identifiers D11 and D22 corresponding to Component 1 and Component 2 respectively, so as to generate the service identifiers corresponding to each component of the tracking identifier as Y1 "Upstream / default / test" and Y2 "HPA / default / test". The generated service identifier Y1 indicates the association between Component 1 and the service "test", and the generated service identifier Y2 indicates the association between Component 2 and the service "test". At this time, the logs of the services corresponding to the implementation of each component can be determined through different service identifiers. Then, record the tracking identifier into the behavior logs of each component running the corresponding service as the unique identifier during log query, so that the behavior logs of each component implementing this service include the tracking identifier.

[0083] In addition, when each component generates behavior logs related to multiple services, the service identifier in the tracking identifier can be associated with the selected multiple services. Since each component runs multiple services, the service identifiers corresponding to different services in the same component are different, and different behavior logs corresponding to different services can be generated according to different service identifiers. At this time, not only can the resource type identifier in the tracking identifier be converted into the resource type identifier corresponding to each component, but also the service identifier in the tracking identifier can be converted into the service identifiers of the selected multiple services, so as to obtain the service identifiers corresponding to multiple services in multiple components. Then, determine the logs that need to record the tracking identifier according to the service identifier and add the tracking identifier. At this time, when the cloud platform obtains the corresponding tracking identifier, match and display the multiple service logs in the log file according to the tracking identifier.

[0084] It can be understood that the above computer can be a client. The client includes but is not limited to mobile phones, tablet computers, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart homes, patrol robots, etc. This application does not make any restrictions here.

[0085] The cloud platform can be a server, and the server can have different architectures, such as a server cluster, a distributed server architecture, etc. No restrictions are made here.

[0086] It can be understood that in addition to the container orchestration component, resource deployment component, traffic access component, and elastic scaling component, the cloud platform can also include a database access component, a gateway component, etc., which will not be elaborated here. Among them, the database access component corresponds to the database access resource, and the gateway component corresponds to the access resource.

[0087] Still taking the example of recording the tracking identifier into the behavior logs generated by each component corresponding to one service, the following is a specific elaboration.

[0088] In some ways, when the cloud platform receives the tracking identifier input by the user, the specific format of the tracking identifier can be as follows: component identifier / attachment identifier / service identifier. Among them, the component identifier can be a resource type identifier or other identifiers representing the component, and no restrictions are made here; the "attachment identifier" can be the above-mentioned namespace and corresponds to the user. One user can correspond to one namespace, and multiple users can correspond to one namespace. Specific restrictions are not made to prevent naming conflicts. For example, when setting the same resource type identifier and service identifier for different services, naming conflicts may occur. For the convenience of elaboration, when the tracking identifier is recorded into the behavior logs generated by each component, when the tracking identifier is specifically configured in the format of "resource type identifier / namespace / service identifier", it is called a "resource coordinate". For example, the resource coordinate can be the above-mentioned tracking identifier J1 "Deployment / default / test".

[0089] It can be understood that for the convenience of elaboration, in the following description, the tracking identifier is taken as an example of "resource coordinate", and the tracking identifier is taken as an example of the tracking identifier input by the user for specific elaboration. And for the convenience of elaboration, the service for which the log needs to be quickly retrieved below is called the "quick retrieval object".

[0090] Figure 4AAccording to some embodiments of the present application, a schematic diagram of a framework 300 corresponding to a log generation method is shown.

[0091] As shown in the figure, the framework 300 includes a log tracing module 01, a message queue module 02, and a log platform 03. Among them, the log tracing module 01 includes a configuration module 30, an association module 40, an execution module 50, the message queue module 02, and the log platform 03. It can be understood that, in some implementation manners, the log tracing module 01 may be a software development kit (SDK).

[0092] Specifically, the configuration module 30 is configured to receive the configuration of the service that the user wants to search for input on the configuration interface, obtain configuration information, where the configuration information includes the resource coordinates of the service. And the configuration module 30 is further configured to load the obtained configuration information into the backend container cluster. For example, for the Kubernetes architecture (i.e., the k8s architecture), by creating a configmap configuration in the container cluster, the backend can dynamically load the configuration information through the k8s informer mechanism. It can be understood that the configuration information may include relevant configuration items for configuring resource coordinates, and may also include configuration items such as log levels and coloring switches. Among them, the log level information is used to configure the level of the log, so as to prevent the log from soaring; the coloring switch is used to configure whether the process of obtaining colored logs needs to be executed. For example, the configuration interface is as Figure 4A the configuration interface P1 shown in the figure. The specific configuration process and the detailed description of the configuration interface P1 will be elaborated below and will not be elaborated here first.

[0093] The association module 40 is configured to load the configuration information sent by the configuration module 30, and associate the resource coordinates in the configuration information with each component to generate a coloring set. Among them, the coloring set includes the corresponding relationship between the resource coordinates and the service identifiers of each component.

[0094] Among them, the association module 40 includes an identifier conversion module 420 and a coloring set 430. Among them, the identifier conversion module 420 includes: a cloud native resource converter 420A and a custom resource converter 420B. It can be understood that the resources corresponding to each component may be cloud native resources (i.e., standard resources) provided by the cloud platform, or custom resources (custom resource definitions, crd) created by the user himself.

[0095] The cloud-native resource converter 420a can be used to obtain the service identifiers corresponding to the quick retrieval objects in each component according to the input resource coordinates corresponding to the quick retrieval objects. Among them, the resource types configured in the corresponding resource coordinates belong to cloud-native resources, and when the resources corresponding to each component are cloud-native resources, at this time, the cloud-native resource converter 420A can convert the resource coordinates into the service identifiers corresponding to the component.

[0096] For example, when the deployed resources are cloud-native resources, when the resource type identifier in the resource coordinate M1 corresponding to the configured quick retrieval object 1 is the same as the identifier of the deployed resources, which is "Deployment", assuming the resource coordinate M1 is "Deployment / default / test", and the quick retrieval object 1 involves a gateway component whose resource type belongs to cloud-native resources, at this time, the cloud-native resource converter 420A will convert the resource coordinate M1 "Deployment / default / test" into the service identifier "Service / default / test", where "Service" is the resource type identifier corresponding to the access resources of the gateway component.

[0097] The custom resource converter 420B is used to obtain the service identifiers corresponding to the quick retrieval objects in each component according to the input resource coordinates corresponding to the quick retrieval objects. Among them, the resource types configured in the corresponding resource coordinates belong to cloud-native resources, and when the resources corresponding to each component are custom resources, at this time, the custom resource converter 420B can convert the resource coordinates into the service identifiers corresponding to the component. For example, the cloud platform can receive components created by the user himself, and configure resource types for the created components. If the configured resources belong to custom resources, after the cloud platform receives the configured resource types belonging to custom resources, for example, receives that the configured resource type belonging to custom resources is the traffic access resource "Upstream", the cloud platform will clearly know the relationship between the traffic access resource and other various resources in the cloud platform. For example, it will clearly know the relationship between the deployed resource "Deployment / " and the traffic access resource "Upstream", so that the resource coordinates can be converted into the service identifiers of each component through a preset registration function.

[0098] The coloring set 430 is used to generate a coloring set according to the resource coordinates and the service identifiers in the corresponding components, and the coloring set includes the corresponding relationships between the resource coordinates corresponding to each quick retrieval object and the service identifiers in each component.

[0099] The execution module 50 is used to determine, according to the generated coloring set, that the operation logs of each component are behavior logs that need to add resource coordinates, and mark the behavior logs generated by multiple components implementing the quick retrieval object. For example, add resource coordinates to the behavior logs corresponding to each component, so as to generate behavior logs corresponding to the resource coordinates of the quick retrieval object (for the convenience of description, hereinafter referred to as "colored logs"); it can also be used to generate ordinary logs according to the currently executed business. Specifically, the execution module 50 includes a coloring set matching module 510 and a colored log output module 520.

[0100] Among them, the coloring set matching module 510 is used to determine the component behaviors that implement the quick retrieval object.

[0101] The colored log output module 520 is used to mark the behavior logs generated by multiple components implementing the quick retrieval object. For example, add resource coordinates to the behavior logs corresponding to each component, generate colored logs and output them.

[0102] For the convenience of description, a series of processes executed by the log tracking module 01 are called "coloring functions".

[0103] The message queue module 02 is used to generate ordinary log messages and colored log messages after receiving the real-time generated ordinary logs and colored logs. In some implementation manners, the message queue module 02 is a Kafka message queue system to support real-time data processing and transmission. Among them, the behavior log messages corresponding to the same resource coordinate in the colored logs are stored in the same topic.

[0104] The log platform 03 can be used to receive the log messages of the message queue module 02 and display the corresponding log content according to the resource coordinates input by the user. For example, display the corresponding colored logs according to the resource coordinates. In some implementation manners, the colored logs corresponding to each resource coordinate can be stored in the same log file, so as to quickly retrieve the corresponding logs according to the resource coordinates.

[0105] It can be understood that the framework 300 corresponding to the above-described log generation method is only an example. In some other embodiments, it may further include other modules, and some modules may be split or combined, which is not limited herein.

[0106] Figure 4B According to the embodiments of the present application, a schematic diagram of a cloud platform 3000 is shown. In this schematic diagram, each component is deployed with a log tracking module (for example, Figure 4AThe log tracing module 01) shown, so that when each component runs to quickly retrieve an object, the resource coordinates can be recorded in the behavior logs of each component, enabling the cloud platform to retrieve the behavior logs of each component corresponding to the quickly retrieved object in the log platform according to the resource coordinates.

[0107] Reference Figure 4B , in the cloud platform 3000, there are container orchestration components 100, resource deployment components 110, gateway components 120, traffic access components 130, elastic scaling components 140, and so on. As shown in the figure, each component can integrate a log tracing module (for example, Figure 4A the log tracing module 01) shown. After each component integrates the log tracing module 01, each component can use the log tracing module by importing the sdk, where sdk is the name of the toolkit corresponding to the log tracing module. It can be understood that at this time, the original ordinary logs in each component remain unchanged, and at this time, log files corresponding to the dyed logs can be newly generated.

[0108] In some implementation methods, each component can integrate the log tracing module in the following way. Specifically, when each component integrates, it can register its own resource type in the integrated log tracing module. For example, each component passes the resources in its own component that involve quickly retrieved objects (for example, the business that changes at this time) to the log tracing module by using color.Regedit inside the log tracing module. The component can also register the decision-making method of relevant resources and pass the relationship between its own defined custom resources and cloud-native resources to the log tracing module by using color.RegeditDecision inside the log tracing module. For example, for the business with the change of "test", at this time, the relationship between the custom resource "Service / default / test" and the native resource "Deployment / default / test" for the changed business "test" can be passed to the log tracing module. It can be understood that in some implementation methods, after each component integrates the log tracing module, at this time, the log tracing module will automatically determine whether a certain business change process needs to be marked as a dyed log.

[0109] The following shows the pseudo-code for integrating the log tracing module through color.Regedit:

[0110] {color.Regedit(Resoure{

[0111] Kind: "Pod",

[0112] Namespace: "default",

[0113] Name: "test",

[0114] }

[0115] Among them, "Kind" represents the resource type, "Pod" represents the specific container resource, "Namespace" represents the namespace, and "default" represents the specific namespace; "Name" represents the business name, and "test" represents the specific business name.

[0116] It can be understood that when each component implements the changed business, it can determine whether the generated behavior log is a behavior log that needs to add resource coordinates according to the coloring set. After determining that the generated behavior log is a behavior log that needs to add resource coordinates, record the resource coordinates in the behavior log and print it as a coloring log. For example, when each component detects that there are fields in the generated log that respectively correspond to the resource coordinates, namespace, and business identifier in the service identifier in the coloring set, record the resource coordinate tracking identifier in this log at this time to obtain the coloring log.

[0117] It can be understood that when the log is output, there will be different log levels. For example, the DEBUG level is used when debugging bugs in the program; the INFO level is used when the program is running normally; the WARNING level is used when the program does not run as expected; the ERROR level is used when the program encounters an error. The following shows the exemplary code for each component to output 4 log messages corresponding to the INFO, DEBUG, WARNING, and ERROR levels respectively.

[0118] log.Info("This is a info level message")

[0119] log.Debug("This is a debug level message")

[0120] log.Warn("This is a warn level message")

[0121] log.Error("This is a error level message").

[0122] The following briefly introduces each component in the cloud platform 3000. The container orchestration component 100 is used to provide services and management for the container cluster. The resource deployment component 110 is used for business deployment. Specifically, the resource deployment component 110 can deploy microservice resources into the container cluster. The gateway component 120 is used to configure the gateway entry. Specifically, the gateway component 120 can configure the corresponding gateway entry for the newly created and deployed microservice resources. The traffic access component 130 is used to access traffic. Specifically, the traffic access component 130 can access the traffic of the deployed container resources. The elastic scaling component 140 is used to achieve elastic expansion. Specifically, the elastic scaling component 140 can dynamically scale the business container workload according to the growth of traffic.

[0123] It can be understood that Figure 4B According to the embodiments of the present application, the shown cloud platform 3000 may further include more other components, which will not be elaborated here.

[0124] It can be understood that after introducing the corresponding framework 300 of the log generation method as described above, and in combination with Figure 4A After introducing the cloud platform 3000 including each component associated with the log tracing module, the following will specifically introduce a process schematic diagram of a log generation method in combination with the framework 300 and the shown cloud platform 3000. Among them, for the convenience of understanding, the process of the user configuring the resource coordinates and associating the resource coordinates with each component will be described first (as Figure 4B shown); then, taking the process of the cloud platform generating the behavior logs of multiple components corresponding to a specific fast retrieval object (such as the fast retrieval object "test" below) as an example to elaborate the generation process (as Figure 5A shown); finally, the process of the user querying the behavior logs corresponding to the implementation of the fast retrieval object by each component at once according to the fast retrieval object will be elaborated (as Figure 6 shown). Figure 7 shown).

[0125] Figure 5A This is a process schematic diagram of a cloud platform receiving resource coordinates and generating a coloring set provided by the embodiments of the present application. Figure 5A Taking the cloud platform 3000 as the execution subject as an example, the configuration method included in the log generation method of the present application is shown. However, the present application does not limit the execution subject of this process schematic. Figure 5A The cloud platform in can also be an electronic device or a chip, chip system or processor on the electronic device that supports the cloud platform to implement this method. And the following will be combined with Figure 4A , Figure 4B and Figure 5B to Figure 5A be introduced.

[0126] S101. Receive the input from the user on the configuration interface to obtain configuration information, where the configuration information includes the resource coordinates of the quick search object.

[0127] In some embodiments, the computer 1000 may display the configuration interface provided by the cloud platform to the user. The configuration interface includes multiple configuration items, and the user can configure the resource coordinates in the configuration item corresponding to the resource coordinates on the configuration interface. The cloud platform receives the input from the user for the quick search object to obtain configuration information, where the configuration information includes the resource coordinates of the quick search object, and then loads and saves the received configuration information into the database. For example, through the configuration module 30 shown above Figure 4A accepts and loads the configuration information, so as to realize sending the configuration information from the front end to the back-end container cluster.

[0128] It can be understood that in some embodiments, the resource type identifier corresponding to the configured resource coordinates is a resource type identifier belonging to cloud-native resources.

[0129] Exemplarily, Figure 5B shows a schematic diagram of a configuration interface P1 provided by a cloud platform to the user. The configuration interface P1 includes a configuration item X41 "context type", a configuration item X42 "context information", a configuration item X43 "log level", and a configuration item X44 "whether to open".

[0130] Specifically, for the configuration item X41 "context type": This configuration item provides the user with multiple configuration functions. For example, configuring the parameters corresponding to "resource coordinates", configuring the parameters corresponding to "link coordinates", and configuring the parameters corresponding to "time coordinates", etc. In the embodiments of the present application, when the user needs to configure the resource coordinates of the quick search object, at this time, the user can select the "resource coordinates" control K41, and the user configures the resource coordinates to implement log tracking.

[0131] For the configuration item X42 "context information": It is used to receive the detailed content of the resource coordinates. When the user selects the "resource coordinates" control K41, the user can enter the specific information corresponding to the "resource coordinates" in the filling box K42 corresponding to the configuration item X42 "context information". For example, the user enters the specific resource coordinates "Deployment / default / test" of the quick search object 1 as shown in the figure in the filling box K42, where "Deployment" is the deployment resource identifier corresponding to the resource deployment component, "default" is the namespace, and "test" is the service name, so as to realize the configuration of the resource coordinates of the quick search object.

[0132] For the configuration item X43 "Log Level": It is used to select the logs to be collected. The "Log Level" options shown in the figure are "DEBUG" and "INFO". In some embodiments of the present application, when the user selects "INFO", it indicates that DEBUG logs will not be collected and printed to the log file. When the user selects "DEBUG", it indicates that logs of all levels need to be collected. For example, when each component determines the generated coloring logs, the logs output in the INFO, DEBUG, WARNING, and ERROR level formats can all be output.

[0133] For the configuration item X44 "Whether to Open": It is used to configure whether to enable the coloring function, that is, the coloring switch. "Yes" shown in the figure indicates that the coloring function is turned on. "No" indicates that the coloring function is not used. For example, the user selects the "Yes" control K44.

[0134] Exemplarily, when the user inputs the configuration parameters as Figure 5B shown, the cloud platform obtains the configuration information, including "log_path" indicating the stored log path, specifically " / home / logs / dye.log"; "level" indicating the log level, specifically "debug"; "type" indicating the context type, "resource" indicating that the context type is the resource coordinate; "content" indicating the context content, "switch" indicating the coloring switch, specifically "true" indicating that the coloring function is turned on, and "Deployment / default / test" indicating the specific resource coordinate.

[0135] The specific code example is as follows:

[0136]

[0137] S102, associate the resource coordinates of the quick retrieval object with each component to obtain a coloring set.

[0138] In some embodiments, the resource coordinates of the quick retrieval object include the resource type identifier configured by the user and the service identifier corresponding to the quick retrieval object. At this time, the cloud platform associates the resource coordinates of the quick retrieval object with the resources corresponding to the quick retrieval object in each component through the resource type to obtain a coloring set.

[0139] In some implementation manners, the cloud platform converts the resource coordinates of the quick retrieval object into the service identifiers corresponding to the quick retrieval object in each component through a cloud native converter or a registration function, and moreover, the mapping relationship between the resource coordinates and the service identifiers of each component can be determined, and then the corresponding mapping relationship can be stored in a set, thereby obtaining a coloring set, that is, the relationship between the resource coordinates and the service identifiers is stored in this coloring set.

[0140] For example, it can be understood that the user can deploy the resources corresponding to the quick retrieval object 1 in the resource deployment component 110 in advance. At this time, it can be known that the service identifier corresponding to this resource deployment component is "Deployment / default / test". For the sake of convenience, the user can configure the resource coordinate M1 corresponding to the quick retrieval object 1 as "Deployment / default / test". The resource type involved in the resource coordinate M1 is the deployment resource "Deployment". Moreover, the resource coordinate M1 is the same as the service identifier D1 "Deployment / default / test" corresponding to the quick retrieval object 1 in the resource deployment component 110. At this time, the resource coordinate M1 is the same as the service identifier D1. When the cloud platform 3000 receives the resource coordinate and determines that the quick retrieval object 1 involves the gateway component 120, the traffic access component 130, and the elastic scaling component 140, at this time, the cloud native resource converter corresponding to the cloud native resource and the registration function corresponding to the custom resource will be used to convert the resource coordinate into the service identifier corresponding to the resource type of each component respectively.

[0141] For example, the cloud platform 3000 converts the resource coordinate M1 into the service identifier D2 "Service / default / test" corresponding to the quick retrieval object 1 in the gateway component 120, where "Service" in the service identifier D2 is the gateway resource; converts the resource coordinate M1 into the service identifier D3 corresponding to the quick retrieval object 1 in the traffic access component 130 as "Upstream / default / test", where "Upstream" in the service identifier D3 is the traffic access resource; converts the resource coordinate M1 into the service identifier D4 corresponding to the quick retrieval object 1 in the elastic scaling component 140 as "HPA / default / test", where "HPA" in the service identifier D4 is the elastic scaling resource. At this time, it can be determined that the resource coordinate M1 "Deployment / default / test" has a mapping relationship with the service identifier D1 "Deployment / default / test", the service identifier D2 "Service / default / test", the service identifier D3 "Upstream / default / test", and the service identifier D4 "HPA / default / test" respectively. Store the foregoing mapping relationship in the coloring set as a subset of the coloring set.

[0142] It can be understood that the execution order of the above steps S101 to S102 is only an example. In some other embodiments, other execution orders can also be adopted, and some steps can also be split or combined, which is not limited herein.

[0143] Understandably, when the cloud platform receives the configuration information input by the user, where the configuration information includes resource coordinate content, it can quickly retrieve the resource associations of the object according to the resource coordinates corresponding to each component. Thus, in the cloud platform, the resource coordinates are recorded in the log content of the corresponding quick retrieval object generated by each component.

[0144] Taking the quick retrieval object as Service 1 as an example below, the process of the cloud platform components generating the coloring logs corresponding to Service 1 during the change process of Service 1 is described. Understandably, before the change, the user will deploy Service 1 in the resource deployment component 110 in advance. At this time, the cloud platform detects Service 1 deployed in the resource deployment component 110 and determines the resources of the components that need to be monitored in the case of changes to Service 1. Assume that it is necessary to monitor the specific situations of the resource deployment component 110, gateway component 120, traffic access component 130, and elastic scaling component 140 for the changed Service 1 as shown in Figure 4B When the user inputs the resource coordinates corresponding to Service 1 on the configuration interface, the cloud platform will establish the relationship between the resource coordinates, Service 1, and the resource deployment component 110, gateway component 120, traffic access component 130, and elastic scaling component 140 related to Service 1 according to the process shown in Figure 5A above, so as to determine the coloring set. At this time, in some cases, when Service 1 changes, when the resource deployment component 110, gateway component 120, traffic access component 130, and elastic scaling component 140 are running Service 1, they will run in a certain order, and each component will record the coloring log, and then each component will push the coloring log to the log platform. For example, the following Figure 6 According to some embodiments of the present application, a schematic diagram of the process of the resource deployment component 110, gateway component 120, traffic access component 130, and elastic scaling component 140 recording the resource coordinates into the behavior logs of the corresponding components when Service 1 is used as the quick retrieval object is shown.

[0145] The specific process is as follows:

[0146] S201, according to the coloring set, obtain the coloring log generated by the resource deployment component 110 running Service 1, where the coloring log corresponding to the resource deployment component 110 includes the resource coordinates corresponding to Service 1.

[0147] For example, the resource deployment component 110 on the cloud platform determines, according to the coloring set, that the log generated when the resources corresponding to Service 1 in the resource deployment component 110 are running is the log that needs to record the resource coordinates, records the resource coordinates into the corresponding log, obtains the coloring log, and stores it in the coloring log file corresponding to the current component.

[0148] Exemplarily, the cloud platform can detect the resources corresponding to the deployment of Service 1 (e.g., the service identifier of Service 1 is test) in the resource deployment component 110, and determine that the service identifier D1 corresponding to the deployed resources is "Deployment / default / test". It can be understood that the service identifier D1 "Deployment / default / test" is also the resource coordinate "Deployment / default / test" corresponding to Service 1 input by the user on the configuration interface, and the resources deployed for Service 1 in the resource deployment component 110 are cloud-native resources. When Service 1 changes, if it is determined according to the coloring set that there is a field corresponding to the service identifier in the coloring set in the log generated in the resource deployment component 110 corresponding to the changed Service 1, then this log is the log that needs to record the resource coordinates. At this time, all the behavior logs related to the deployment of Service 1 in the resource deployment component 110 will be added with the resource coordinates to obtain the colored log, and all will be recorded in the colored log file of the resource deployment component 110.

[0149] For example, a log corresponding to the resource deployment component 110 is as follows:

[0150] 2023-07xxx DEBUG color.go:104this is a info level message

[0151] {"Resource":{"Kind":"Deployment","Namespace":"default","Name":"test"},"MainResource":"Deployment / default / test"}

[0152] Among them, "Deployment / default / test" is the resource coordinate.

[0153] S202, according to the coloring set, obtain the colored log generated by the gateway component 120 when running Service 1, where the colored log corresponding to the gateway component 120 includes the resource coordinates corresponding to Service 1.

[0154] In some embodiments, when Service 1 changes, the gateway component 120 on the cloud platform determines, according to the coloring set, that the log generated during the runtime of the resources corresponding to Service 1 in the gateway component 120 is the log that needs to record the resource coordinates, records the resource coordinates in the corresponding log to obtain the colored log, and stores it in the colored log file of the resource deployment component 110.

[0155] It is understandable that after the resources for Service 1 are deployed, the user needs to access the gateway. At this time, the gateway component 120 provides the gateway entrance for accessing this service.

[0156] Exemplarily, the service identifier corresponding to the access resources used by Service 1 in the gateway component is "Service / default / test". The resource type of the gateway service implemented by the gateway component 120 (for example, the gateway component 120 is an ingress system) is "Service". According to the generated log matching the service identifier "Service / default / test" in the coloring set, the resource identifier is added to the behavior log of the gateway component 120 using the access resources corresponding to Service 1, and then it is used as the colored log and recorded in the colored log file of the current component.

[0157] For example, the log content in the gateway component 120 is as follows:

[0158] 2023-07xxx DEBUG color.go:104this is a gateway systeminfo levelmessage

[0159] {"Resource":{"Kind":"Service","Namespace":"default","Name":"test"},"MainResource":"Deployment / default / test"}

[0160] Among them, "Deployment / default / test" is the resource coordinate.

[0161] S203. According to the coloring set, obtain the colored log generated by the traffic access component 130 running Service 1. Among them, the colored log corresponding to the traffic access component 130 includes the resource coordinates corresponding to Service 1.

[0162] In some embodiments, when Service 1 changes, the traffic access component 130 on the cloud platform determines, according to the coloring set, that the log generated during the resource operation corresponding to Service 1 in the traffic access component 130 is the log for which the resource coordinates need to be recorded. The resource coordinates are recorded in the behavior log to obtain the colored log, and it is stored in the colored log file of the traffic access component 130.

[0163] It can be understood that after the service access entry is opened through the gateway component 120. At this time, Service 1 will be connected to the traffic access component 130. At this time, the traffic access component 130 will cause the workload corresponding to Service 1 to be automatically registered on the gateway. In this way, when the user switches the traffic in, they will access the workload of Service 1 deployed on the cloud platform. The traffic access component is an ability built by the cloud platform. In this process, the traffic access component 130 determines that the logs generated by the resources corresponding to the currently running Service 1 are logs that match the coloring set, records the resource coordinates in the corresponding behavior logs to obtain colored logs, and stores them in the colored log file of the traffic access component 130.

[0164] Exemplarily, the service identifier of the traffic access resources used by Service 1 in the traffic access component 130 is "Upstream / default / test", where the traffic access resources are user-defined resources. At this time, since the logs generated when Service 1 uses the traffic access resources are logs that match the coloring set, the logs corresponding to the behavior of Service 1 in the traffic access component need to add resource coordinates and then be recorded as colored logs in the colored log file of the traffic access component 130.

[0165] For example, the log content in the traffic access component 130 is as follows:

[0166] 2023-07xxx DEBUG color.go:104this is a ingress systeminfo levelmessage

[0167] {"Resource":{"Kind":"Upstream","Namespace":"default","Name":"test"},"MainResource":"Deployment / default / test"}

[0168] Among them, "Deployment / default / test" is the resource coordinate.

[0169] S204, obtain the colored logs generated by the elastic scaling component 140 when running Service 1 according to the coloring set, where the colored logs corresponding to the elastic scaling component 140 include the resource coordinates corresponding to Service 1.

[0170] In some embodiments, when Service 1 changes, the elastic scaling component 140 determines, according to the coloring set, that the logs generated during the runtime of the resources of Service 1 in the elastic scaling component 140 are the logs for which resource coordinates need to be recorded. The resource coordinates are recorded in the corresponding logs to obtain colored logs, which are then stored in the colored log file of the elastic scaling component 140.

[0171] It can be understood that after the traffic access, the elastic scaling component 140 will cause the number of replicas of the scaling object (POP) of the workload of Service 1 to scale elastically according to the size of the traffic. That is, the elastic scaling component 140 runs the resources corresponding to Service 1, determines that the generated logs match the coloring set, records the resource coordinates in the behavior logs to obtain colored logs, and stores them in the colored log file of the elastic scaling component 140.

[0172] Exemplarily, the service identifier corresponding to the elastic scaling resources used by Service 1 in the elastic scaling component 140 is "HPA / default / test", where the traffic access resources are cloud-native resources. At this time, since the logs generated by the elastic scaling resources used by Service 1 are logs that match the coloring set, the logs corresponding to the behavior changes of Service 1 in the elastic scaling component 140 need to add resource coordinates and will be recorded as colored logs in the colored log file of the elastic scaling component 140.

[0173] For example, the log content in the elastic scaling component 140 is as follows:

[0174] 2023-07xxx DEBUG color.go:104this is abughere inhpa system

[0175] {"Resource":{"Kind":"HPA","Namespace":"default","Name":"test"},"MainResource":"Deployment / default / test"}

[0176] Among them, "Deployment / default / test" is the resource coordinate.

[0177] S205, obtain the colored logs generated by each component corresponding to Service 1.

[0178] It can be understood that in some embodiments, the coloring logs in each component will be in the corresponding component. At this time, each component can be docked with the log platform. And after the docking, each component will push its respective coloring logs to a coloring log file on the log platform 03 according to the same resource coordinates. At this time, the coloring logs of each component corresponding to service 1 will be aggregated together. At this time, the log platform 03 can obtain the coloring logs generated by each component corresponding to service 1. It can be understood that since the amount of coloring logs is small, for example, only all the behavior log information of a certain change in service 1 is recorded, and the amount of logs is very small, the coloring logs of each component corresponding to service 1 are aggregated together.

[0179] It can be understood that the execution order of the above steps S201 to S205 is only an example. In some other embodiments, other execution orders can also be adopted, and some steps can also be split or combined, which will not be limited here. For example, when service 1 changes, it may only involve the operation of the gateway component 120, the traffic access component 130, and the elastic scaling component 140. At this time, the coloring logs only include the coloring logs of the gateway component 120, the traffic access component 130, and the elastic scaling component 140.

[0180] It can be understood that during the implementation of service 1 by each component, the cloud platform collects and pushes the log information related to the resource coordinates corresponding to service 1 in each component to the log platform, so that the log platform can find the behavior logs of all related components by retrieving the resource coordinates. Different from the traditional one that only supports microservice synchronous serial link tracing, this solution can support multiple scenarios such as synchronous, asynchronous, serial, and parallel, greatly improving the positioning efficiency of the log call link in the cloud platform (for example, cloud native) scenario.

[0181] Figure 7 According to some embodiments of the present application, a schematic diagram of the process for a user to query the behavior logs corresponding to each component according to resource coordinates is shown.

[0182] S301, receive the query instruction input by the user, and the query instruction includes the resource coordinates corresponding to service 1.

[0183] In some embodiments, the user inputs a query instruction on the log query interface displayed on the computer 1000, and the query instruction includes the resource coordinates corresponding to service 1.

[0184] For example, the user inputs a query instruction on the log query interface displayed on the computer 1000, and the query instruction includes the resource coordinate M1 as "Deployment / default / test".

[0185] Understandably, the log query can be a text command or a voice command. Understandably, the specific query method has been elaborated above, and reference can be made to the above Figures 3A - 3D description and will not be elaborated here.

[0186] S302. Display the logs including resource coordinates, where the logs including resource coordinates include the behavior logs of multiple components involved in Service 1.

[0187] In some embodiments, the log platform on the cloud platform 3000 will, according to the resource coordinate M1 "Deployment / default / test" in the query instruction received from the computer 1000, find the corresponding logs from the corresponding colored log folder, and the found logs include resource coordinates, and thus the found logs include the behavior logs (i.e., colored logs) generated when each component runs Service 1 respectively. The log platform sends the found logs to the computer 1000, and the computer 1000 displays the received logs.

[0188] For example, the following shows the logs of each component corresponding to the resource coordinate M1,

[0189] / / Colored log of the resource deployment component

[0190] 2023-07xxx DEBUG color.go:104this is a info level message

[0191] {"Resource":{"Kind":"Deployment","Namespace":"default","Name":"test"},"MainResource":"Deployment / default / test"}

[0192] / / Colored log of the gateway component

[0193] 2023-07xxx DEBUG color.go:104this is a gateway systeminfo levelmessage

[0194] {"Resource":{"Kind":"Service","Namespace":"default","Name":"test"},"MainResource":"Deployment / default / test"}

[0195] / / Colored log of the traffic access component

[0196] 2023-07xxx DEBUG color.go:104 This is a ingress systeminfo level message

[0197] {"Resource": {"Kind": "Upstream", "Namespace": "default", "Name": "test"}, "MainResource": "Deployment / default / test"}

[0198] / / Dyeing logs of the elastic scaling component

[0199] 2023-07xxx DEBUG color.go:104 This is a bug here in hpa system

[0200] {"Resource": {"Kind": "HPA", "Namespace": "default", "Name": "test"}, "MainResource": "Deployment / default / test"}

[0201] It can be understood that the above 4 behavior logs all include the resource coordinate M1 "Deployment / default / test".

[0202] It can be understood that the execution order of the above steps S301 to S302 is only an example. In some other embodiments, other execution orders can also be adopted, and some steps can also be split or combined, which are not limited herein.

[0203] It can be understood that when the business changes, at this time, the cloud platform can obtain the behavior logs of the components of the changed business, and each behavior log has the same resource coordinate, so that the cloud platform can quickly find the behavior logs of the components of the quick retrieval object according to the resource coordinate input by the user, so as to quickly locate the problems of the changed business.

[0204] Figure 8 According to some embodiments of the present application, a schematic diagram of the interaction process of the computer 1000 and the cloud platform 3000 for implementing the query method of the present application is shown. Among them, the cloud platform 3000 includes a log platform 03 and multiple components (such as components 1-n shown in the figure), and each component includes a log tracking module 001. The specific interaction process is as follows:

[0205] S401. The computer 1000 sends configuration information to components 1-n. The configuration information includes the resource coordinates of the quick retrieval object.

[0206] It can be understood that the computer 1000 will receive the user's input, obtain the configuration information, and then send the configuration information to components 1-n. It can be understood that the log tracking module 001 is integrated in components 1-n. For example, the log tracking module 01 can be integrated in components 1-n as a software development kit, i.e., SDK.

[0207] In some embodiments, the computer 1000 sends configuration information to the log tracking module 001 in components 1-n, and the configuration information includes resource coordinates.

[0208] S402. Components 1-n associate the resource coordinates of the quick retrieval object with each component to obtain a coloring set.

[0209] In some embodiments, the log tracking module 001 integrated in components 1-n associates the resource coordinates with each component related to the quick retrieval object to obtain a coloring set. Among them, the specific association method is substantially the same as the description in the above step S102, and will not be elaborated here.

[0210] S403. During the operation of components 1-n, a coloring log is generated based on the coloring set and sent to the log platform 03.

[0211] In some embodiments, during the operation of components 1-n, the running services are compared with the services in the coloring set. For example, it is checked whether the logs generated by the running services are the logs matching the coloring set. If the determined log is a log matching the coloring set, the corresponding resource identifier is recorded in the log to generate a coloring log, and then sent to the log platform 03.

[0212] It can be understood that specific examples can refer to the above Figure 6 shown process, and will not be elaborated here.

[0213] S404. The log platform 03 stores the coloring log.

[0214] In some embodiments, the log platform 03 can store the coloring logs corresponding to the same resource coordinates received in the same log file or in different log files. The detailed elaboration of this step can refer to the above S205, and will not be elaborated here.

[0215] S405. The computer 1000 sends a log query request to the log platform 03, and the request includes resource coordinates.

[0216] Understandably, the computer 1000 receives a query instruction input by the user and sends a log query request to the log platform 03. The request includes resource coordinates. The specific description is substantially the same as that of step S301 above and will not be elaborated here.

[0217] S406, the log platform 03 obtains the colored logs corresponding to the resource coordinates. Among them, the displayed colored logs include the behavior logs of each component.

[0218] In some embodiments, the log platform 03 responds to the user query request, determines and displays the colored logs corresponding to the resource coordinates.

[0219] Understandably, the log platform 03 locates the colored logs corresponding to the resource coordinates in the log file according to the resource coordinates. The colored logs include the behavior logs of each component. The specific description is substantially the same as that of step S301 above and will not be elaborated here.

[0220] S407, the log platform 03 sends the colored logs to the computer 1000.

[0221] S408, the computer 1000 displays the colored logs.

[0222] In some embodiments, the computer 1000 receives the colored logs and can display at least a part of the logs on the screen. At least part of the logs includes content associated with the resource coordinates.

[0223] Understandably, the execution order of the above steps S401 to S406 is only an example. In some other embodiments, other execution orders can also be adopted, and some steps can also be split or combined. This is not limited here.

[0224] Understandably, in some other embodiments, after each component generates the colored logs, the colored logs may not be sent to the log platform. When the cloud platform receives the query request from the computer 1000, it can query the logs corresponding to the tracking identifier (for example, resource coordinates) from the logs of each component based on the tracking identifier and send them to the computer 1000 for display to the user.

[0225] In addition, the user can also continue to enter a first retrieval identifier in the search box of the query interface displayed on the computer 1000 to receive a second log query instruction. Among them, the second query instruction includes the first retrieval identifier. Among them, the first retrieval identifier includes at least one of the following: log level information, warning information, user identifier, time information. At this time, since the cloud platform has obtained the colored logs based on the tracking identifier, and each log can also include content such as log level information, warning information, user identifier, time information, etc., at this time, the required content can be further retrieved from the colored logs according to the first retrieval identifier, thereby improving the retrieval efficiency.

[0226] It is understandable that the above container orchestration component 100 can be, but is not limited to, systems such as Kubernetes, Docker Swarm, Rancher, OpenShift, Mesos, etc.

[0227] The resource deployment component 110 can be, but is not limited to, systems such as OpenStack, CloudStack, VMware vSphere, Amazon Web Services, Microsoft Azure, Google Cloud Platform, etc.

[0228] In some embodiments, the traffic access component 130 can be, but is not limited to, systems such as a load balancer, a firewall, a VPN (Virtual Private Network), a router, etc.

[0229] In some embodiments, the elastic scaling component 140 can be, but is not limited to, systems such as auto scaling, dynamic scaling, elastic compute, container auto scaling, database auto scaling, etc.

[0230] The gateway component 120 can be, but is not limited to, systems such as an API gateway, a VPN gateway, a network gateway, a cloud storage gateway, and a container gateway, etc.

[0231] It is understandable that the above computer 1000 can be any other electronic device, including but not limited to mobile phones, tablet computers, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, ultra-mobile personal computers (UMPCs), personal digital assistants (PDAs), etc., which are not limited herein.

[0232] Figure 9 A schematic structural diagram of a device is shown according to an embodiment of the present application.

[0233] It can be understood that the device 800 can be any electronic device running a cloud platform. For example, it can include but is not limited to mobile phones, tablet computers, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), servers, server clusters, etc., which are not restricted herein.

[0234] As Figure 9 shown, the device 800 may include one or more processors 801. The processor 801, also known as a processing unit, can implement certain control functions. The processor 801 can be a general-purpose processor or a dedicated processor, etc. For example, it can be a baseband processor or a central processing unit. The baseband processor can be used to process communication protocols and communication data, and the central processing unit can be used to control communication devices, such as base stations, baseband chips, terminals, terminal chips, DUs or CUs, etc., execute software programs, and process the data of software programs.

[0235] In an alternative design, the processor 801 may also store instructions and / or data 803, and the instructions and / or data 803 can be run by the processor, enabling the device 800 to execute the methods described in the foregoing method embodiments.

[0236] In another alternative design, the processor 801 may include a transceiver unit for implementing receiving and sending functions. For example, the transceiver unit can be a transceiver circuit, or an interface, or an interface circuit. The transceiver circuit, interface, or interface circuit for implementing receiving and sending functions can be separate or integrated together. The foregoing transceiver circuit, interface, or interface circuit can be used for reading and writing code / data, or the foregoing transceiver circuit, interface, or interface circuit can be used for signal transmission or transfer.

[0237] In yet another possible design, the device 800 may include a circuit that can implement the function of log query in the foregoing method embodiments.

[0238] Optionally, the device 800 may include one or more memories 802, on which instructions / data 804 may be stored. The instructions can be run on the processor, enabling the device 800 to execute the methods described in the foregoing method embodiments. Optionally, data may also be stored in the memory. Optionally, instructions and / or data may also be stored in the processor. The processor and the memory can be set separately or integrated together. For example, the corresponding relationships described in the foregoing method embodiments can be stored in the memory or in the processor.

[0239] Optionally, the apparatus 800 may further include a transceiver 805 and / or an antenna 806. The processor 801 may be referred to as a processing unit and controls the apparatus 800. The transceiver 805 may be referred to as a transceiver unit, transceiver, transceiver circuit, transceiver apparatus, interface, interface circuit, or transceiver module, etc., and is used to implement the transceiver function.

[0240] Optionally, the apparatus 800 in the embodiments of the present application may be used to execute the Figure 5A , Figure 6 and Figure 7 log generation method described in.

[0241] According to the method provided in the embodiments of the present application, the present application further provides a computer program product, which includes: computer program code, when the computer program code runs on a computer, enabling the computer to implement the steps executed by the apparatus 800 in any one of the above embodiments.

[0242] According to the method provided in the embodiments of the present application, the present application further provides a computer-readable medium, which stores program code, when the program code runs on a computer, enabling the computer to implement the steps executed by the apparatus 800 in any one of the above embodiments.

[0243] The embodiments disclosed in the present application may be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application may be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memories and / or storage elements), at least one input device, and at least one output device.

[0244] The program code may be applied to the input instructions to execute the various functions described in the present application and generate output information. The output information may be applied to one or more output devices in a known manner. For the purposes of the present application, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0245] The program code may be implemented in a high-level procedural language or an object-oriented programming language to communicate with the processing system. When needed, the program code may also be implemented in assembly language or machine language. In fact, the mechanisms described in the present application are not limited to the scope of any specific programming language. In any case, the language may be a compiled language or an interpreted language.

[0246] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may be implemented as instructions carried or stored on one or more transient or non-transitory machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or via other computer-readable media. Thus, machine-readable media may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to, floppy disks, optical disks, optical discs, CD-ROMs, magneto-optical discs, ROMs, RAMs, EPROMs, EEPROMs, magnetic or optical cards, flash memory, or tangible machine-readable memories for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) in electrical, optical, acoustic, or other forms of propagated signals using the Internet. Thus, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).

[0247] In the drawings, some structural or method features are shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or ordering may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Additionally, the inclusion of a structural or method feature in a particular figure does not imply that such a feature is required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.

[0248] It should be noted that each unit / module mentioned in the device embodiments of the present application is a logical unit / module. Physically, a logical unit / module may be a physical unit / module, a part of a physical unit / module, or may be implemented as a combination of multiple physical units / module. The physical implementation manner of these logical units / module themselves is not the most important. The combination of the functions implemented by these logical units / module is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above device embodiments.

[0249] It should be noted that in the examples and description of this patent, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one" does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element. Although this application has been illustrated and described by reference to certain preferred embodiments of the present application, those of ordinary skill in the art should understand that various changes can be made to it in form and detail without departing from the scope of the present application.

Claims

1. A log generation method, characterized in that, The method includes: The server obtains a first tracking identifier and establishes a first relationship, where the first relationship identifies the correspondence between a first service and the first tracking identifier. The first service is also associated with multiple components of the server, and the multiple components include a first component; The server records the first tracking identifier in first log content generated when the first component runs the first service according to the first relationship.

2. The method according to claim 1, characterized in that The server records the first tracking identifier in first log content generated when the first component runs the first service according to the first relationship, including: The server saves the first log content in a first log file, and the first log file also includes log content generated when the first component runs at least one second service.

3. The method according to claim 1, wherein The server records the first tracking identifier in first log content generated when the first component runs the first service according to the first relationship, and further includes: The server saves the first log content in a second log file, and the second log file only includes log content generated when the first component runs the first service.

4. The method according to any one of claims 1 to 3, characterized in that It further includes: The client displays a first configuration interface and receives a first input from a first user in the first configuration interface to obtain first configuration information, where the first configuration information includes the first tracking identifier. The first tracking identifier includes a first service identifier and a first component identifier, and the first service identifier is used to represent the first service, and the first component identifier is used to represent the multiple components associated with the first service; The server receives the first configuration information from the client.

5. The method according to any one of claims 1 to 3, characterized in that, It further includes: The client displays a second configuration interface and receives at least one service selected by the first user in the second configuration interface, and at least one component of each service in the at least one service, to obtain the second configuration information; The server receives the second configuration information from the client and generates the first tracking identifier according to the second configuration information, where the first tracking identifier includes a second service identifier and a second component identifier, and the second service identifier is used to represent the at least one service, and the second component identifier is used to represent at least one component of each service in the at least one service. The at least one service includes the first service, and the at least one component includes the first component.

6. The method according to claim 4, characterized in that, The server obtains the first tracking identifier and establishes the first relationship, including: The server generates multiple first service identifiers according to the first tracking identifier, where each first service identifier is used to represent the correspondence between the first service and each component; The server obtains the first relationship according to the correspondence between the first tracking identifier and each first service identifier.

7. The method according to claim 6, wherein The first component identifier in the first tracking identifier is a first resource coordinate type identifier, and the first service identifier includes a resource type identifier corresponding to the component, and, The server generates the first service identifier in the following manner, including: The resources corresponding to the component belong to cloud-native resources, and the first tracking identifier is converted into the first service identifier through a cloud-native resource converter; The resources corresponding to the component belong to custom resources, and the first tracking identifier is converted into the first service identifier through a registration function.

8. The method according to claim 6, wherein The server records the first tracking identifier in the first log content generated by the first component running the first service according to the first relationship, including: Determining that the log content generated by the first component running the first service matches the first service identifier, and recording the first tracking identifier in the matching log content.

9. The method according to any one of claims 1-8, characterized in that, It further includes, The client receives a first log query instruction and instructs the server to perform log query, where the first log query instruction includes the first tracking identifier; The server obtains a first query log according to the first tracking identifier in the first log query instruction; The client receives the first query log from the server and displays at least part of the logs in the first query log, and the at least part of the logs includes content associated with the first tracking identifier.

10. The method according to claim 9, wherein The client receiving the first log query instruction further includes, The client receives a first quick log query control selected by a first user and displays at least one tracking identifier; The client receives the first tracking identifier selected by the first user from the at least one tracking identifier to obtain a first log query instruction of the first user.

11. The method according to claim 9, wherein The first log query instruction is a voice instruction.

12. The method according to claim 9, wherein It further includes: The client receives a second log query instruction, where the second query instruction includes a first retrieval identifier, and the first retrieval identifier includes at least one of the following: log level, warning information, user identifier, time information.

13. An electronic device, characterized in that, It includes: a memory for storing instructions; A processor for executing the instructions to implement the log generation method according to any one of claims 1-12.

14. A readable storage medium, characterized in that, Instructions are stored on the readable medium, and when the instructions are executed on an electronic device, the electronic device is caused to execute the log generation method according to any one of claims 1-12.

15. A computer program product, characterized in that, The computer program product includes: computer program code, and when the computer program code runs on a computer, the computer is caused to execute the log generation method according to any one of claims 1-12.