Scene log acquisition method, electronic equipment and storage medium

By obtaining and matching TBox's scene logs in real time, automatically saving the logs of specific scenarios and uploading them to the server, the problem of TBox relying on manual scene log collection in specific situations is solved, and efficient and accurate log collection and maintenance is achieved.

CN120200900APending Publication Date: 2025-06-24SHANGHAI YIKE COMM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510211317.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

In the prior art, when TBox encounters a specific situation, the collection of scene logs relies on manual intervention, resulting in the possible missed data at critical moments, affecting maintenance and problem diagnosis.

Method used

By obtaining scene logs recorded by multiple log systems in real time and matching them with the rules in the rule base, the target log system is controlled to perform logging operations, automatically save logs for specific scenarios, and upload the collection results to the server.

Benefits of technology

It realizes accurate acquisition of scene logs when a specific scene occurs in TBox without manual participation, avoiding the omission of key log information, and ensuring the accurate maintenance and problem diagnosis of TBox by maintenance personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120200900A_ABST
    Figure CN120200900A_ABST
Patent Text Reader

Abstract

The invention provides a scene log acquisition method, electronic equipment and a storage medium, the method is applied to a TBox, and a plurality of log systems run on the TBox; the method comprises the following steps: acquiring scene logs recorded by a plurality of log systems in real time; the scene logs are matched with rules in a rule base, the rule base comprises at least one rule, for each rule, feature logs corresponding to at least part of log systems are recorded in the rule, and when the scene logs recorded in at least part of log systems comprise the corresponding feature logs, the scene logs are matched with the corresponding feature logs. Log recording operation corresponding to each target log system; when the scene log is matched with the rule in the rule base, controlling the target log system to execute a log recording operation so as to store the scene log; the log collection result is uploaded to a server, and the server sends a scene notice after receiving the log collection result. According to the method, the scene log of the TBox in the specific scene can be automatically obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle communication, and more particularly to a method for obtaining scenario logs, an electronic device, and a storage medium. Background Art

[0002] A TBox is a communication box with a wireless chip at its bottom layer. The wireless chip can use the 2G / 3G / 4G / 5G (including but not limited to 5G RedCap) of a telecom operator to provide communication services for the upper layer. Multiple log systems are simultaneously running on the TBox to record the daily operation of the TBox. These scenario logs are stored in a circular manner.

[0003] When the TBox encounters a specific situation (such as an anomaly), the collection of its scenario logs becomes particularly important. Currently, the collection process of scenario logs often relies on manual intervention. However, due to the unpredictability of the time when these specific situations occur in the TBox, the scenario logs collected by maintenance personnel manually may exactly miss the data at critical moments. In this case, the missing scenario logs will directly affect the accurate maintenance and problem diagnosis of the TBox by maintenance personnel.

[0004] In view of this, the present invention is specifically proposed. Summary of the Invention

[0005] In consideration of the above problems, the present invention is proposed. According to one aspect of the present invention, there is provided a method for obtaining scenario logs, which is applied to a TBox on which multiple log systems are running; the method includes: Obtaining in real time the scenario logs respectively recorded by the multiple log systems; Matching the obtained scenario logs with the rules in a rule library, where the rule library includes at least one rule. For each rule in the at least one rule, the rule records the characteristic logs respectively corresponding to at least some of the multiple log systems, and the log recording operations respectively corresponding to the target log systems when the scenario logs recorded in the at least some log systems include the corresponding characteristic logs; When the obtained scenario logs match any one of the rules in the rule library, controlling the target log systems corresponding to the rule to execute their respective corresponding log recording operations to save the scenario logs recorded by each log system in the target log systems; Uploading the log collection result to a server, and the server issues a scenario notification after receiving the log collection result.

[0006] Exemplarily, for each rule in the at least one rule, the rule also records the preset system configurations respectively corresponding to the target log systems; Before controlling the target log systems corresponding to the rule to perform their respective corresponding log recording operations, the method further includes: For each log system in the target log systems, determine whether the log system is enabled according to the preset system configuration recorded in the rule; When the configurations of each log system in the target log systems are all enabled according to the preset system configuration recorded in the rule, perform the step of controlling the target log systems corresponding to the rule to perform their respective corresponding log recording operations.

[0007] Exemplarily, the method further includes: When there is at least one log system in the target log systems that is not enabled according to the preset system configuration recorded in the rule, for each log system that is not enabled according to the preset system configuration recorded in the rule, control the log system to be enabled according to the preset system configuration recorded in the rule; When the obtained scenario logs match the rule again, perform the step of controlling the target log systems corresponding to the rule to perform their respective corresponding log recording operations.

[0008] Exemplarily, the preset system configuration includes the number of preset buffer areas, the size of the preset buffer areas, and the preset printing level; Controlling the log system to be enabled according to the preset system configuration recorded in the rule includes: Setting the number of buffer areas of the log system to the number of preset buffer areas; Setting the size of each buffer area of the log system to the size of the preset buffer areas; Setting the log printing level of the log system to the preset printing level.

[0009] Exemplarily, after uploading the log collection result to the server, the method further includes: Restoring the target log systems.

[0010] Exemplarily, for any target log system corresponding to the rule, the log recording operation is: stopping recording scenario logs; or, copying the recorded scenario logs to a target location; or, uploading the recorded scenario logs to the server.

[0011] Exemplarily, the step of uploading the log collection result to the server is performed when operation completion notifications sent by all the target log systems are received; the operation completion notifications are generated when the corresponding log recording operations are completed by the target log systems.

[0012] Exemplarily, before uploading the log collection result to the server, the method further includes: Query the execution status of the log recording operation of the target log system; Among them, the step of uploading the log collection result to the server is executed when the corresponding log recording operations are all completed in all the target log systems.

[0013] According to another aspect of the present invention, there is provided an electronic device, including a processor and a memory. A computer program is stored in the memory, and the processor is configured to execute the computer program to implement the method as described above.

[0014] According to still another aspect of the present invention, there is provided a computer-readable storage medium storing a computer program / instructions, and when the computer program / instructions are executed by a processor, the method as described above is implemented.

[0015] In the above technical solution, the acquired scenario log can be matched with the feature logs included in the rules in the rule library to determine whether a specific scenario occurs in the TBox. And when a specific scenario occurs in the TBox, the target log system is controlled to execute the corresponding log recording operation, so as to save the log collected when the specific scenario occurs in the TBox. Thus, this solution can accurately obtain the scenario log when a specific scenario occurs in the TBox without manual participation, which is convenient for maintenance personnel to accurately maintain and diagnose problems of the TBox.

[0016] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other objects, features and advantages of the present invention more obvious and understandable, the following specifically illustrates the specific embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] By describing the embodiments of the present invention in more detail in conjunction with the drawings, the above and other objects, features and advantages of the present invention will become more obvious. The drawings are used to provide a further understanding of the embodiments of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. In the drawings, the same reference numerals generally represent the same components or steps.

[0018] Figure 1 Show a cyclic storage schematic diagram of a log system in a related art embodiment; Figure 2 Show a schematic flowchart of a scenario log acquisition method according to an embodiment of the present invention; Figure 3 Show a schematic diagram of the control relationship between a service and a log system according to an embodiment of the present invention; Figure 4Schematic diagram showing the relationship between a server, a service, and a log system according to an embodiment of the present invention; Figure 5 Schematic flowchart showing a method for obtaining scenario logs according to another specific embodiment of the present invention; Figure 6 Schematic block diagram showing an electronic device according to an embodiment of the present invention. Detailed implementation manners

[0019] In order to make the objectives, technical solutions, and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments of the present invention. It should be understood that the present invention is not limited by the exemplary embodiments described herein. Based on the embodiments of the present invention described herein, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.

[0020] According to the above description, multiple log systems are simultaneously running on the TBox, and the multiple log systems work together. By recording logs, the daily operating status and activities of the TBox are detailedly recorded. The scenario logs recorded therein are stored in a circular storage manner within the log system. Figure 1 Schematic diagram of circular storage of a log system showing an embodiment in the related art. As Figure 1As shown in the figure, the log system includes storage area 1, storage area 2, storage area 3... storage area g... storage area k. When recording scenario logs, they are sequentially recorded into each storage area in the order of the storage areas. After recording to storage area k, the next time scenario logs are recorded, they will be recorded into storage area 1, and the scenario logs previously recorded in storage area 1 will be overwritten. Therefore, if the time interval between when the maintenance staff manually collects scenario logs and the time when the TBox encounters a specific situation is relatively large, the logs recorded when the TBox encounters the specific situation may have been overwritten. For example, if the time when the TBox encounters a specific situation is late at night, by the time the maintenance staff obtains the scenario logs through the TBox the next day, the logs recorded when the TBox encountered the specific situation may have long been overwritten. Moreover, since the TBox is installed in the customer's vehicle, if the customer does not agree, the maintenance staff cannot obtain the scenario logs through the TBox either. These factors will all cause the maintenance staff to be unable to accurately obtain the scenario logs when the TBox encounters a specific situation, thereby affecting the accurate maintenance and problem diagnosis of the TBox by the maintenance staff. In view of this, the present invention provides a method for obtaining scenario logs, an electronic device, and a storage medium. This technical solution can automatically capture relevant scenario logs when the TBox faces a specific situation, without relying on manual intervention, effectively preventing the omission of key log information, and ensuring that the maintenance team can accurately maintain and perform fault analysis on the TBox. This method, electronic device, and storage medium will be described in detail below.

[0021] According to one aspect of an embodiment of the present invention, a method for obtaining scenario logs is provided. This method is applied to a TBox, and multiple log systems are running on the TBox.

[0022] Figure 2 The schematic flowchart of the method for obtaining scenario logs according to an embodiment of the present invention is shown. As Figure 2 shown, the method may include the following steps S210, step S220, step S230, and step S240.

[0023] In step S210, obtain the scenario logs recorded by each of the multiple log systems in real time.

[0024] In some embodiments, one or more services are running on the TBox, which can read the scenario logs of some or all of the log systems in real time and can control some or all of the log systems (such as starting, stopping, configuring parameters, etc.). Figure 3A schematic diagram showing the control relationship between a service and a log system according to an embodiment of the present invention is shown. In the figure, the green line indicates that the upper-layer service can read the scenario logs recorded by the lower-layer log system and can also control the log system, and the red line indicates that the upper-layer service can only control the log system. In this embodiment, the following services are running on the TBox: ServiceA, ServiceB, and multiple log systems include Log1, Log2, Log3, Log4... Logm... Logn. These services can provide an interactive interface for maintenance personnel, and the maintenance personnel can start, stop, and configure the corresponding log systems through the services, and can also use the services to extract the scenario logs recorded by the log systems. In the solution of this article, the scenario logs recorded by multiple log systems can be obtained in real time by using the services running on the TBox.

[0025] In some other embodiments, a specific log system among multiple log systems can read the scenario logs recorded by other log systems and can also control other log systems. In this embodiment, the scenario logs recorded by multiple log systems can be obtained in real time through the specific log system.

[0026] In step S220, the obtained scenario logs are matched with the rules in the rule library, where the rule library includes at least one rule. For each rule in the at least one rule, the rule records the characteristic logs corresponding to at least some of the multiple log systems respectively, and the log recording operations corresponding to the target log systems when the scenario logs recorded in at least some of the log systems include the corresponding characteristic logs.

[0027] It can be understood that the obtained scenario logs matching the rules in the rule library means that at least some of the characteristic logs corresponding to the multiple log systems included in the rules in the rule library appear in the obtained scenario logs. For example, the rule library can record the following rules: the first characteristic log (Fenture-log1) appears in Log1, and at the same time the second characteristic log (Fenture-log2) appears in Log2. In the solution of this example, if in the obtained scenario logs, the first characteristic log appears in Log1 and at the same time the second characteristic log appears in Log2, then the obtained scenario logs match the above rules in the rule library.

[0028] Optionally, the rules in the rule library can be locally configured rules or rules remotely configured by maintenance personnel through a server. It can be understood that when a specific scenario occurs in the TBox, some log systems of the TBox can record specific scenario logs (i.e., characteristic logs). In the solution of this example, the rules in the rule library can be configured according to the characteristic logs corresponding to each specific scenario respectively. In this case, each rule corresponds to a specific scenario.

[0029] In step S230, when any one of the rules in the obtained scenario log matches the rule library, control the target log systems corresponding to the rules to perform their respective corresponding log recording operations, so as to save the scenario logs recorded by each log system in the target log systems.

[0030] In this article, the target log systems may include one or more log systems. The target log systems and at least some of the log systems may be exactly the same, completely different, or partially the same.

[0031] For example, the following rules may be recorded in the rule library: When the first characteristic log appears in Log1 and the second characteristic log appears in Log2 at the same time - the log recording operations corresponding to Log1, Log2, and Log3 respectively. In this embodiment, Log1, Log2, and Log3 are all target log systems corresponding to this rule. In this embodiment, when the first characteristic log appears in Log1 and the second characteristic log appears in Log2 in the obtained scenario log, Log1, Log2, and Log3 can be controlled to perform their respective corresponding log recording operations, so as to save the scenario logs currently recorded by Log1, Log2, and Log3 respectively. Since these scenario logs are collected when a specific scenario occurs, these scenario logs can provide a reference for maintenance personnel, help maintenance personnel locate problems in the TBox, and thus facilitate the maintenance of the TBox by maintenance personnel.

[0032] Optionally, the log recording operation may be any operation that can enable the log system to save the currently recorded scenario log. In some embodiments, for any target log system corresponding to this rule, the log recording operation is: stop recording scenario logs; or, copy the recorded scenario logs to a target location; or, upload the recorded scenario logs to a server. In one implementation solution of this embodiment, for a certain target log system, the target log system may stop recording scenario logs, so that the scenario logs recorded subsequently can be prevented from overwriting the currently recorded scenario logs. In another implementation solution of this embodiment, for a certain target log system, the target log system may copy the recorded scenario logs to a target location. The target location may be the memory of the TBox. In this case, since the scenario logs collected when a specific scenario occurs have been backed up to the target location in advance, even if the scenario logs recorded subsequently by the target log system overwrite the currently recorded scenario logs, the scenario logs stored at the target location can still provide an accurate reference for maintenance personnel. In still some other embodiments, for a certain target log system, the target log system may upload the recorded scenario logs to a server. In this embodiment, the TBox may establish a wired or wireless connection with the server. The target log system may directly upload the currently recorded scenario logs to the server for the user to view.

[0033] Optionally, the logging operations performed by each target log system may be the same or different. For example, the target log systems include Log1, Log2, and Log3. The logging operation corresponding to Log1 in the rule is to stop logging scenario logs; the logging operation corresponding to Log2 is to copy the logged scenario logs to a target location; the logging operation corresponding to Log3 is to upload the logged scenario logs to a server.

[0034] In step S240, the log collection result is uploaded to the server, and after receiving the log collection result, the server issues a scenario notification.

[0035] After each target log system has completed the corresponding logging operation, the log collection result may be sent to the server to notify the server that the scenario log collection is complete. In some embodiments, the log collection result may include collection sub-results corresponding one-to-one to each target log system. In this embodiment, step S240 includes: controlling each target log system to upload the collection sub-result to the server after completing the corresponding logging operation to notify the server that the target log collection system has completed the collection. The server may issue a scenario notification to the maintenance personnel after receiving all the collection sub-results to notify the maintenance personnel to view the scenario logs. In other embodiments, when using a service or a specific log system to obtain the scenario logs recorded by multiple log systems in real time, the log collection result may also be uploaded to the server by the service or the specific log system.

[0036] Optionally, the method may further include: for a target log system whose logging operation is to stop logging scenario logs or copy the logged scenario logs to a target location, while uploading the collection sub-result to the server, controlling the target log system to upload the currently logged scenario logs to the server. Through the solution of this embodiment, the scenario logs recorded by all target log collection systems can be uploaded to the server. Thus, the maintenance personnel can directly view the scenario logs recorded by the target log system when a specific scenario occurs on the server. Figure 4A schematic diagram showing the relationship between a server, services, and a log system according to an embodiment of the present invention is shown. In the figure, the green line indicates that the upper-layer service can read the scenario logs recorded by the lower-layer log system and can also control the log system. The red line indicates that the upper-layer service can only control the log system. In this embodiment, the following services are running on the TBox: ServiceA and ServiceB. The multiple log systems include Log1, Log2, Log3, Log4... Logm... Logn. In this embodiment, the server can configure the rule library. Log1, Log2, Log3, Log4... Logm... Logn can all communicate directly with the server, and ServiceA and ServiceB can also communicate with the server. ServiceA and ServiceB can read the rules in the rule library to match the obtained scenario logs with the rules in the rule library.

[0037] Optionally, the log collection result may be the scenario name corresponding to the currently saved scenario log. In this case, by uploading the log collection result, the server can be notified of the monitored scenario.

[0038] In the above technical solution, it is possible to determine whether a specific scenario occurs in the TBox by matching the obtained scenario logs with the feature logs included in the rules in the rule library. And when a specific scenario occurs in the TBox, the target log system is controlled to perform the corresponding log recording operation, so as to save the logs collected when the specific scenario occurs in the TBox. Thus, this solution can accurately obtain the scenario logs when a specific scenario occurs in the TBox without manual participation, which is convenient for maintenance personnel to accurately maintain and diagnose problems with the TBox.

[0039] Exemplarily, for each rule in at least one rule, the preset system configuration of each target log system is also recorded in the rule. Before step S230 of controlling the target log system corresponding to the rule to perform its corresponding log recording operation, the method may further include the following steps: for each log system in the target log system, determine whether the configuration of the log system is enabled according to the preset system configuration recorded in the rule; when the configuration of each log system in the target log system is enabled according to the preset system configuration recorded in the rule, perform the step of controlling the target log system corresponding to the rule to perform its corresponding log recording operation.

[0040] In some embodiments, for each rule in at least one rule, the rule includes the corresponding scenario name, the characteristic logs respectively corresponding to at least some of the log systems, the scenario logs recorded in at least some of the log systems including the corresponding characteristic logs, the preset system configurations respectively corresponding to the target log systems, and the log recording operations. For example, one of the rules in the rule library can be: Scenario 1 - the first characteristic log appears in Log1 and the second characteristic log appears in Log2 at the same time - the preset system configurations of each target log system are respectively: Log1 is opened according to the B1 printing level, has 5 buffer areas, and the size of each buffer area is 2M; Log2 is opened according to the B2 printing level, has 5 buffer areas, and the size of each buffer area is 2M; Log3 is opened according to the B3 printing level, has 5 buffer areas, and the size of each buffer area is 2M - the log recording operations respectively corresponding to Log1, Log2, and Log3: the log recording operation corresponding to Log1 is to stop recording scenario logs; the log recording operation corresponding to Log2 is to copy the recorded scenario logs to the target location; the log recording operation corresponding to Log3 is to upload the recorded scenario logs to the server.

[0041] It can be understood that different configurations of the log system will affect the detail level and the quantity of the scenario logs recorded by the log system. In the solution of this example, by enabling the target log system to be opened according to the preset system configuration recorded in the rule, it can be ensured that the quantity and detail level of the scenario logs recorded by each target log system meet the analysis requirements of the maintenance personnel.

[0042] In the solution of this example, the preset system configurations corresponding to different target log systems can be the same or different, and the preset system configuration corresponding to each target log system can be set according to actual work needs, which will not be elaborated.

[0043] Optionally, determining whether the configuration of the log system is opened according to the preset system configuration recorded in the rule includes: determining whether the log system is opened; when the log system is opened, determining whether the configuration of the log system is the same as the preset system configuration recorded in the rule.

[0044] In the related art, when maintenance personnel manually obtain logs, since some log systems are in a closed state, the maintenance personnel need to first turn on these log systems. Although some log systems are in an open state, the system configurations used by them to record logs do not meet the requirements. In this case, the maintenance personnel also need to manually configure each log system. As mentioned above, some customers may not allow the maintenance personnel to enter the vehicle to set the TBox, which increases the difficulty for the maintenance personnel to obtain logs. In the solution of this example, by executing the step of controlling the target log systems corresponding to the rule to perform their respective corresponding log recording operations when the configuration of each log system in the target log system is turned on according to the preset system configuration recorded in the rule, it can be ensured that the saved scenario logs are collected by all the target log systems under the preset system configuration. Thus, it can provide an accurate basis for the maintenance personnel to accurately maintain and diagnose problems with the TBox.

[0045] Exemplarily, the method may further include the following steps: when there is at least one log system in the target log system that is not turned on according to the preset system configuration recorded in the rule, for each log system that is not turned on according to the preset system configuration recorded in the rule, control the log system to be turned on according to the preset system configuration recorded in the rule (the preset system configuration is the preset system configuration corresponding to the log system recorded in the rule); when the obtained scenario logs match the rule again, execute the step of controlling the target log systems corresponding to the rule to perform their respective corresponding log recording operations.

[0046] Optionally, for each log system that is not turned on according to the preset system configuration recorded in the rule, controlling the log system to be turned on according to the preset system configuration recorded in the rule includes: for a log system in the target log system whose system configuration is the preset system configuration but is not turned on, controlling the log system to be turned on; for a log system in the target log system that is already turned on but whose system configuration is different from the preset system configuration in the rule, configuring the log system according to the preset system configuration; for a log system in the target log system whose system configuration is different from the preset system configuration and is not turned on, controlling the log system to be turned on and configuring the log system according to the preset system configuration.

[0047] It can be understood that when there is at least one log system in the target log systems that is not enabled according to the preset system configuration recorded in this rule, the current scenario logs are not all collected from the target log systems under the preset system configuration (for example, some target log systems may not be opened; or, for another example, the configurations of some target log systems are not the preset system configuration). In the solution of this example, when the above situation occurs, first, all target log systems are enabled according to the preset system configuration recorded in this rule, and then when the obtained scenario logs match this rule again, the step of controlling the target log systems corresponding to this rule to perform their respective corresponding log recording operations is executed. Thus, it can be ensured that the saved scenario logs are collected from all target log systems under the preset system configuration, which can provide an accurate basis for maintenance personnel to accurately maintain and diagnose problems of the TBox.

[0048] Exemplarily, the preset system configuration includes the number of preset buffer areas, the size of the preset buffer area, and the preset printing level; controlling the log system to be enabled according to the preset system configuration recorded in this rule includes: setting the number of buffer areas of the log system to the number of preset buffer areas; setting the size of each buffer area of the log system to the size of the preset buffer area; setting the log printing level of the log system to the preset printing level.

[0049] It can be understood that the details of the scenario logs recorded by the log system at different printing levels are different. In one embodiment, according to the level of detail from low to high, the printing levels may include levels A1, A2, B1, and B2. Under normal circumstances, some target log systems may only need to remain at a lower printing level (such as A1). When it is necessary to record the scenario logs when a specific scenario occurs, the target log systems need to remain at a higher printing level to ensure that the details of the recorded scenario logs can meet the needs of the maintenance personnel.

[0050] The above technical solution can ensure that the quantity and details of the obtained scenario logs meet the needs of the maintenance personnel by configuring the target log systems according to the number of preset buffer areas, the size of the preset buffer area, and the preset printing level, which helps the maintenance personnel to more accurately detect and maintain the TBox.

[0051] Exemplarily, after uploading the log collection result to the server, the method further includes: restoring the target log system.

[0052] It can be understood that the states (switch states or configuration states) of some logging systems are different in the normal state and when recording scenario logs for specific scenarios. For example, in the normal state, Log1 has 3 buffer areas, each with a size of 1M, and the printing level is A1. When recording scenario logs for a specific scenario, Log1 has 5 buffer areas, each with a size of 2M, and the printing level is B1. Log3 is in the closed state in the normal state and is opened at the printing level of B3 when recording specific scenarios. At this time, the number of buffer areas is 5, and the size of each buffer area is 2M. In the solution of this example, by restoring the target logging system after uploading the log collection result to the server, the logging system with different states in the normal state and when recording scenario logs for specific scenarios in the target logging system can be restored. This can not only ensure that the obtained scenario logs can meet the needs of maintenance personnel but also save computing resources.

[0053] Exemplarily, the step of uploading the log collection result to the server is executed when an operation completion notification sent by all target logging systems is received; the operation completion notification is generated when the target logging system completes the corresponding log recording operation.

[0054] In the solution of this example, the log collection result is uploaded to the server by the service or a specific logging system. For any target logging system, after the target logging system completes the corresponding log recording operation, it generates and sends an operation completion notification. When the service or a specific logging system receives the operation completion notifications sent by all target logging systems, it can generate the log collection result and upload it to the server.

[0055] By making the step of uploading the log collection result to the server be executed when an operation completion notification sent by all target logging systems is received, the above technical solution can notify the server after each target logging system has saved the recorded logs. Thus, the complete scenario logs when a specific scenario occurs in the TBox can be obtained, which helps maintenance personnel accurately maintain and diagnose problems with the TBox.

[0056] Exemplarily, the step of uploading the log collection result to the server is performed when an operation completion notification sent by some of the target log systems is received; wherein, some of the target log systems are the target log systems that generate an operation completion notification when the corresponding log recording operation is completed, and the other target log systems except these some target log systems directly upload the collection sub-result to the server when the corresponding log recording operation is completed. In the solution of this example, some of the target log systems can generate and send an operation completion notification when the corresponding log recording operation is completed, and the remaining target log systems can directly upload the collection sub-result to the server when the corresponding log recording operation is completed. For example, when the target log systems include Log1, Log2, and Log3, Log1 and Log2 can notify ServiceA when the corresponding log recording operation is completed (i.e., send an operation completion notification to ServiceA), and Log3 can directly notify the server when the corresponding log recording operation is completed (i.e., send the collection sub-result to the server). The server can issue a scenario notification after receiving the collection sub-result sent by Log3 and the log collection result sent by ServiceA to notify the user that the collection of all scenario logs corresponding to the current scenario is completed.

[0057] Exemplarily, before uploading the log collection result to the server, the method further includes: querying the execution status of the log recording operation of the target log system; wherein, the step of uploading the log collection result to the server is performed when all the target log systems have completed the corresponding log recording operations.

[0058] In the solution of this example, the log collection result can be uploaded to the server by a service or a specific log system. The service or the specific log system can query the execution status of the log recording operation of each target log system in real time, and upload the log collection result to the server when it is queried that all the target log systems have completed the corresponding log recording operations.

[0059] By making the step of uploading the log collection result to the server be performed when all the target log systems have completed the corresponding log recording operations, the above technical solution can notify the server after all the target log systems have saved the recorded logs, thereby obtaining the complete scenario logs when a specific scenario occurs in the TBox, which helps the maintenance personnel to accurately maintain and diagnose problems with the TBox.

[0060] To further understand this solution, a specific embodiment is used below to describe an implementation solution of the present invention in detail. In this embodiment, the rules of the rule library are shown in Table 1.

[0061] Table 1 Rules in the Rule Library

[0062] In the above table, Service-X is the service in the server for executing steps S210 - S240. In Scenario 1 of the above table, Service-X is Service1. In the above embodiment, Service1 running on the server can obtain the scenario logs recorded in Log1 and Log2 in real time, and match the obtained scenario logs with the rule with scenario number 1 in the rule library. When Feature-log1 appears in Log1 and Feature-log2 appears in Log2 at the same time, it is judged whether Log1, Log2, and Log3 are enabled according to the preset system configuration recorded in the rule (i.e., each system configuration recorded in column G). As shown in the above table, the configurations and enabled states of Log1, Log2, and Log3 in the default state are different from the preset system configuration. In this case, first control Log1, Log2, and Log3 to be enabled according to each system configuration recorded in column G. Then, when it is detected again that Feature-log1 appears in Log1 and Feature-log2 appears in Log2 at the same time, control Log1 to upload the recorded scenario log to the server, control Log2 to copy the current scenario log to the / backup directory, control Log3 to stop tracking (i.e., stop recording scenario logs), and notify the server that the scenario log recorded by Log3 in Scenario 1 has been saved. Then, after receiving the notification that the actions in column H of Log1, Log2, and Log3 have been completed, Service1 can report to the server that the logs Log-1 and Log2 in Scenario 1 have been collected, and notify Log1, Log2, and Log3 to restore to the default state. The server can notify the maintenance personnel that the log of Scenario 1 has been collected when the scenario logs of Log1, Log2, and Log3 in Scenario 1 have all been collected.

[0063] Figure 5 A schematic flowchart showing a method for obtaining scenario logs according to another specific embodiment of the present invention is shown. In this embodiment, the rule library shown in Table 1 is adopted. As Figure 5As shown in the figure, the server can access the rule library through 5G Red cap, and the maintenance personnel can configure the rules in the rule library through the server. Service-A can read the rule library. Log1 records logs at level A1 by default. At this time, the number of buffer areas is 3, each with a size of 1M. Log2 records logs at level A2 by default. At this time, the number of buffer areas is 3, each with a size of 1M. ServiceA can monitor the scenario logs in Log-1 and Log-2 (that is, obtain the scenario logs recorded by the two log systems) and match them with the rules recorded in the rule library. When Feature-log1 is found in the scenario log log-1 recorded in Log-1 and Feature-log2 is found in the scenario log log-2 recorded in Log-2 (that is, the obtained scenario logs match the rules in the rule library), it can be checked whether all relevant logs (that is, the target log systems) are started according to the rule requirements. In this embodiment, the rules in the rule library require that Log-1 record logs at level B1, with 5 buffer areas, each with a size of 2M; Log-2 record logs at level B2, with 5 buffer areas, each with a size of 2M; Log-3 record logs at level B3, with 5 buffer areas, each with a size of 2M. However, at this time, Log1, Log2, and Log3 are all in the default state and do not meet the requirements in the rules, that is, each target log system is not started according to the rule requirements. In this case, notify Log-1 to record logs at level B1, set the number of buffer areas to 5, each with a size of 2M; notify Log-2 to record logs at level B2, set the number of buffer areas to 5, each with a size of 2M; notify Log-3 to record logs at level B3, set the number of buffer areas to 5, each with a size of 2M. After the configuration of each target log system is successful, continue to monitor each log system. When Feature-log1 is found again in the scenario log log-1 recorded in Log-1 and Feature-log2 is found in the scenario log log-2 recorded in Log-2, at this time, all relevant logs are started according to the rule requirements. In this case, the following actions can be performed: control Log-1 to upload the recorded scenario logs to the server. Specifically, Log-1 can upload the logs to the server through 5G Red cap; control Log-2 to copy the recorded scenario logs to the / backup directory, and Service-A can confirm the completion of the copy action of Log-2 by checking the status of the / backup directory; control Log-3 to stop tracking and report to the server. Specifically, Log-3 can report the scenario log log-3 of tracking scenario 1 to the server through 5G Red cap. Service-A can report the scenario logs corresponding to scenario 1 to the server through 5G Red cap.After that, it is possible to control Log-1, Log-2, and Log-3 to all return to the default state. After receiving the notification sent by Service-A, the server can notify the maintenance personnel to track the scenario logs corresponding to Scenario 1 and inform the maintenance personnel of the storage locations of each scenario log, that is, log-1 is stored on the server, log-2 is stored in the / backup directory of the Tbox, and log-3 is on the Tbox and the logging has stopped.

[0064] According to another aspect of the embodiments of the present invention, there is also provided an electronic device. Figure 6 The schematic block diagram of an electronic device according to an embodiment of the present invention is shown. As Figure 6 shown, the electronic device 600 includes: a processor 610 and a memory 620. A computer program is stored in the memory 620, and the processor 610 is configured to execute the computer program to implement the above method.

[0065] According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium. A computer program / instructions is stored in the storage medium, and when the computer program / instructions is executed by a processor, the above method is implemented. The storage medium may include, for example, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media.

[0066] Those of ordinary skill in the art can easily understand the implementation structure, working principle, and beneficial effects of the electronic device and the computer-readable storage medium by reading the above method. For the sake of brevity, they will not be elaborated here.

[0067] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present invention thereto. Those of ordinary skill in the art can make various changes and modifications therein without departing from the scope and spirit of the present invention. All such changes and modifications are intended to be included within the scope of the present invention as claimed in the appended claims.

[0068] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled artisans can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present invention.

[0069] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.

[0070] In the specification provided herein, a large number of specific details are set forth. However, it can be understood that the embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and technologies have not been shown in detail so as not to obscure the understanding of this specification.

[0071] Similarly, it should be understood that, in order to streamline the present invention and assist in understanding one or more of the various inventive aspects, in the description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the method of the present invention should not be construed as reflecting the intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected by the corresponding claims, the inventive point lies in that the corresponding technical problems can be solved with features less than all the features of a single disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into the detailed description, where each claim itself serves as a separate embodiment of the present invention.

[0072] Those skilled in the art can understand that, except for features that are mutually exclusive, any combination can be used for all the features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) can be replaced by an alternative feature that provides the same, equivalent, or similar purpose.

[0073] In addition, those skilled in the art can understand that, although some of the embodiments described herein include certain features included in other embodiments rather than other features, the combination of features of different embodiments means that it is within the scope of the present invention and forms different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.

[0074] Each component embodiment of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some modules in the electronic device according to the embodiments of the present invention. The present invention can also be implemented as a device program (for example, a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0075] It should be noted that the above embodiments illustrate the present invention rather than limit the present invention, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim listing several devices, several of these devices can be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words can be interpreted as names.

[0076] As described above, it is only the specific implementation manner of the present invention or the description of the specific implementation manner. The protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, and all of them should be covered by the protection scope of the present invention. The protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A scene log acquisition method, characterized in that: Applied to a TBox, where multiple log systems are running on the TBox; the method includes: Acquire the scene logs recorded by each of the multiple log systems in real time; Matching the acquired scenario log with a rule in a rule base, wherein the rule base includes at least one rule, and for each of the at least one rule, the rule records feature logs corresponding to at least some of the multiple log systems, and when the scenario logs recorded in at least some of the log systems include corresponding feature logs, the target log system's corresponding log recording operations; When the acquired scene log matches any one of the rules in the rule base, the target log system corresponding to the rule is controlled to perform the corresponding log recording operation to save the scene log recorded by each log system in the target log system; The log collection result is uploaded to the server, and the server issues a scenario notification after receiving the log collection result.

2. The scene log acquisition method according to claim 1, characterized in that: For each of the at least one rule, the rule also records the respective preset system configuration of the target log system; Before controlling the target log system corresponding to the rule to perform the corresponding log recording operation, the method further includes: For each log system in the target log system, determining whether the log system is enabled according to the preset system configuration recorded in the rule; When the configuration of each log system in the target log system is turned on according to the preset system configuration recorded in the rule, the step of controlling the target log system corresponding to the rule to perform the corresponding log recording operation is performed.

3. The scene log acquisition method according to claim 2, characterized in that: The method further comprises: When there is at least one log system in the target log system that is not turned on according to the preset system configuration recorded in the rule, for each log system that is not turned on according to the preset system configuration recorded in the rule, control the log system to be turned on according to the preset system configuration recorded in the rule; When the acquired scene log matches the rule again, the step of controlling the target log system corresponding to the rule to perform the corresponding log recording operation is performed.

4. The scene log acquisition method according to claim 3, characterized in that: The preset system configuration includes a preset number of buffers, a preset buffer size, and a preset printing level; The controlling the log system to start according to the preset system configuration recorded in the rule includes: Set the number of buffers of the log system to the preset number of buffers; The size of each buffer of the log system is set to a preset buffer size; Set the log printing level of the log system to the preset printing level.

5. The scene log acquisition method according to claim 2, characterized in that: After uploading the log collection result to the server, the method further includes: Restore the target log system.

6. The scene log acquisition method according to any one of claims 1 to 5, characterized in that: For any target log system corresponding to the rule, the log recording operation is: stop recording the scene log; or copy the recorded scene log to the target location; or upload the recorded scene log to the server.

7. The scene log acquisition method according to any one of claims 1 to 5, characterized in that: The step of uploading the log collection result to the server is performed when the operation completion notification sent by all the target log systems is received; the operation completion notification is generated when the target log system completes the corresponding log recording operation.

8. The scene log acquisition method according to any one of claims 1 to 5, characterized in that: Before uploading the log collection result to the server, the method further includes: Query the target log system for the execution status of the log record operation; The step of uploading the log collection results to the server is performed when all the target log systems have completed the corresponding log recording operations.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: A computer program / instruction is stored, and when the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 8 is implemented.