Log management method and device for multiple processing units, storage medium and electronic equipment

By introducing shared memory and a log file system into the embedded processor chip, the problem of insufficient log management capabilities of the second processing unit is solved, and efficient and secure log management and debugging maintenance are achieved.

CN114116645BActive Publication Date: 2025-11-25NANJING HORIZON INFORMATION TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111467213.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-02
Publication Date
2025-11-25
Estimated Expiration
2041-12-02

AI Technical Summary

Technical Problem

In existing embedded processor chips, the second processing unit (such as Cortex-M, DSP, RISC-V, etc.) lacks log management capabilities, resulting in low debugging and maintenance efficiency. Furthermore, directly building a log management service will affect software execution efficiency and functional implementation.

Method used

By setting up shared memory in the first processing unit (such as Cortex-A), the log update status of the second processing unit is determined from the shared memory in response to preset conditions, and the update log information is stored in the log file system of the first processing unit, thereby achieving unified management and isolated storage.

Benefits of technology

It enables unified management of the logs of the second processing unit, improves debugging and maintenance efficiency, reduces hardware performance overhead, and enhances security through file system-isolated storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114116645B_ABST
    Figure CN114116645B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a log management method and device of multiple processing units, a computer readable storage medium and an electronic device, wherein the method comprises: in response to a preset log reading condition being met, determining log update conditions in a storage area corresponding to each second processing unit from a shared memory; and when there is an update log event in the storage area corresponding to each second processing unit, storing update log information corresponding to the update log event in a log file system corresponding to a first processing unit. Embodiments of the present disclosure enable the first processing unit to extract the log of the second processing unit, and the log information is transmitted by means of memory reading and writing, which has a small hardware performance overhead. In addition, the log information of each second processing unit can be physically isolated, improving the security of information storage. By storing the log information through a file system, various modes of management of the log information can be implemented, facilitating log backtracking.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a log management method and device of multiple processing units, a computer readable storage medium and an electronic device. BACKGROUND

[0002] The existing embedded processor chip structure is increasingly complex, and a typical architecture is that, in addition to a high-performance main core (such as an ARM cortex-a) processor, a cortex-m processor, a dsp processor, a risc-v processor, a cortex-r processor and the like are configured as slave cores to undertake functions such as functional safety, real-time calculation, peripheral control and data processing. A more typical cortex-a architecture generally adopts a high-level operating system such as Linux, and the slave cores generally adopt a low-level operating system or do not adopt an operating system. SUMMARY

[0003] Embodiments of the present disclosure provide a log management method and device of multiple processing units, a computer readable storage medium and an electronic device.

[0004] Embodiments of the present disclosure provide a log management method of multiple processing units, comprising a first processing unit and at least one second processing unit, and the method comprises: in response to a preset log reading condition being met, determining log update conditions in a storage area corresponding to each second processing unit in a shared memory; and when there is an update log event in the storage area corresponding to each second processing unit, storing update log information corresponding to the update log event into a log file system corresponding to the first processing unit.

[0005] According to another aspect of the embodiments of the present disclosure, a log management device of multiple processing units is provided, and the device comprises: a determination module configured to determine log update conditions in a storage area corresponding to each second processing unit in a shared memory in response to a preset log reading condition being met; and a storage module configured to, when there is an update log event in the storage area corresponding to each second processing unit, store update log information corresponding to the update log event into a log file system corresponding to the first processing unit.

[0006] According to another aspect of the embodiments of the present disclosure, an electronic device is provided, which includes a first processing unit, at least one second processing unit, a shared memory, and a memory for storing executable instructions of the first processing unit and the at least one second processing unit; each second processing unit is configured to read corresponding executable instructions from the memory and execute the read executable instructions to implement, in response to a preset log writing condition being met, generating update log information and writing the update log information into a corresponding storage area in the shared memory; and the first processing unit is configured to read corresponding executable instructions from the memory and execute the read executable instructions to implement the log management method of the multiple processing units. According to another aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which stores a computer program for implementing the log management method of the multiple processing units.

[0007] Based on the log management method of the multiple processing units, the device, the computer readable storage medium, and the electronic device provided by the above embodiments of the present disclosure, when the preset log reading condition is met, the first processing unit determines the log update in the storage area corresponding to each second processing unit in the shared memory, and when there is an update log event in the storage area corresponding to each second processing unit, the update log information corresponding to the update log event is stored in the log file system corresponding to the first processing unit, thereby realizing unified log management of the logs extracted from the second processing units by the first processing unit, and the log information is transmitted by the memory reading and writing mode, which has less hardware performance overhead. In addition, different second processing units have different storage areas in the shared memory, which can physically isolate the log information of each second processing unit and improve the security of information storage. Since the first processing unit includes a file system, the log information of the second processing unit can be stored by the functionally rich file system, which can manage the log information of the second processing unit, facilitate operations such as log backtracking, log modification, log addition, log deletion, and the like, and also can realize unified management of the log information of the at least one second processing unit by the first processing unit, thereby improving the efficiency of log management.

[0008] The technical solutions of the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0009] The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description taken in conjunction with the accompanying drawings. The drawings provided in the present disclosure serve to provide a further understanding that assists in elucidating the present disclosure, and form a part of the detailed description. The drawings provided in the present disclosure do not constitute restrictions on the present disclosure, and together with the present disclosure, serve to explain the present disclosure. In the drawings, the same reference numerals generally indicate the same components or steps.

[0010] Figure 1 is a system diagram to which the present disclosure is applicable.

[0011] Figure 2 is a flowchart of a log management method of a multi-processing unit according to an example embodiment of the present disclosure.

[0012] Figure 3 is a flowchart of a log management method of a multi-processing unit according to another example embodiment of the present disclosure.

[0013] Figure 4 is a flowchart of a log management method of a multi-processing unit according to another example embodiment of the present disclosure.

[0014] Figure 5 is a flowchart of a log management method of a multi-processing unit according to another example embodiment of the present disclosure.

[0015] Figure 6 is a structural diagram of a log management apparatus of a multi-processing unit according to an example embodiment of the present disclosure.

[0016] Figure 7 is a structural diagram of a log management apparatus of a multi-processing unit according to another example embodiment of the present disclosure.

[0017] Figure 8 is a structural diagram of an electronic device according to an example embodiment of the present disclosure.

[0018] Figure 9 is a structural diagram of a storage area included in a shared memory according to an example embodiment of the present disclosure.

[0019] Figure 10 is a structural diagram of a ring buffer according to an example embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] Hereinafter, example embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, and do not represent all the embodiments of the present disclosure. It should be understood that the present disclosure is not limited by the example embodiments described herein.

[0021] It should be noted that: unless otherwise specified, the relative arrangement, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.

[0022] Those skilled in the art can understand that the terms "first", "second" and the like in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, and do not represent any specific technical meaning, nor do they represent the inevitable logical sequence between them.

[0023] It should also be understood that, in the embodiments of the present disclosure, "multiple" can refer to two or more, and "at least one" can refer to one, two or more.

[0024] It should also be understood that, for any component, data or structure mentioned in the embodiments of the present disclosure, one or more can be generally understood without explicit limitation or in the context of the preceding and following unless the opposite is indicated.

[0025] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " in the present disclosure generally represents an "or" relationship between the front and rear associated objects.

[0026] It should also be understood that the description of the embodiments of the present disclosure emphasizes the differences between the embodiments, and the same or similar parts can be referred to each other, and for the sake of brevity, will not be repeated.

[0027] At the same time, it should be understood that, for the convenience of description, the size of each part shown in the drawings is not drawn according to the actual proportion relationship.

[0028] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application or uses.

[0029] The techniques, methods, and devices known to those of ordinary skill in the relevant art can not be discussed in detail, but should be considered as part of the specification when appropriate.

[0030] It should be noted that: similar signs and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further discussed in the subsequent drawings.

[0031] The embodiments of the present disclosure can be applied to various electronic devices such as chips, circuit boards, etc. Electronic devices can be described in the general context of computer system executable instructions such as program modules executed by a computer system. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types.

[0032] SUMMARY

[0033] In a SOC (System on Chip) system, a plurality of processing units are included, which further include a first processing unit and at least one second processing unit, wherein the first processing unit, also known as the main core, is usually a processing unit with a cortex-a architecture, which carries a high-level operating system such as Linux, has a complete log management system, and is convenient for debugging and maintenance. However, for the second processing unit, also known as the slave core, such as a cortex-m processing unit, a dsp processing unit, a risc-v processing unit, and a cortex-r processing unit, the chip architecture and design are relatively fragmented, and the operating system carried thereon is mostly lightweight, and even does not have an operating system, which results in that the second processing unit usually does not have log management capability, and it is inconvenient to debug and maintain the software running thereon, and the debugging and maintenance efficiency is low.

[0034] Since the performance and hardware resources of the second processing unit are usually limited, if a complete log management service is directly constructed on the second processing unit, it will have a great impact on the execution efficiency and function implementation of other software.

[0035] In order to manage the log information on the second processing unit, the existing scheme generally directly uses a debugger to debug the second processing unit, or directly prints the log information of the second processing unit to a serial port, which results in that the log information of the second processing unit cannot be stored, cannot be traced back, and cannot be remotely viewed through a network, and the use scenarios have great limitations.

[0036] Exemplary System

[0037] Figure 1 An exemplary system architecture 100 of a log management method of a multi-processing unit or a log management device of a multi-processing unit to which embodiments of the present disclosure can be applied is shown. The system contains Figure 1 The first processing unit 101, the at least one second processing unit 102, and the shared memory 103 are shown, wherein the first processing unit 101 and the at least one second processing unit 102 can be integrated in one chip, or can be arranged in different chips or circuit boards, and a link for data communication can be established between the chips or circuit boards.

[0038] As shown in the figure, the system architecture 100 can include a first processing unit 101, at least one second processing unit 102, and a shared memory 103. Figure 1

[0039] Among them, the first processing unit 101 is usually a high-performance processing unit, for example, an ARM cortex-a processing unit.

[0040] ​The second processing unit 102 is typically a lower-performance processing unit, such as an ARM Cortex-M processing unit, a DSP processing unit, a RISC-V processing unit, or an ARM Cortex-R processing unit. The second processing unit 102 is used for functions such as functional safety, real-time computing, peripheral control, and data processing.

[0041] The shared memory 103 is used to temporarily store the log information generated by each of the second processing units 102, so that the first processing unit 101 can extract the log information.

[0042] It should be noted that the multi-processing unit log management method provided in the embodiments of this disclosure is usually executed by the first processing unit 101, and correspondingly, the multi-processing unit log management device is usually disposed in the first processing unit 101.

[0043] Exemplary Method

[0044] Figure 2 This is a flowchart illustrating a log management method for multiple processing units provided in an exemplary embodiment of this disclosure. This embodiment can be applied to, for example... Figure 1 On the first processing unit 101 shown, as Figure 2 As shown, the method includes the following steps:

[0045] Step 201: In response to meeting the preset log reading conditions, determine the log update status in the storage area corresponding to each second processing unit from the shared memory.

[0046] In this embodiment, the first processing unit 101 can respond to a preset log reading condition, such as... Figure 1 The shared memory 103 shown determines the log update status in the storage area corresponding to each second processing unit. The log read condition is the condition used to trigger the first processing unit 101 to read log information. For example, when... Figure 1 When at least one of the second processing units 102 generates log information, it can send a prompt message to the first processing unit 101. Upon receiving the prompt message, the first processing unit determines that the log reading conditions are met. For example, when the second processing unit generates log information, it can trigger an interrupt signal. When the first processing unit detects the interrupt signal, it determines that the log reading conditions are met. For another example, when the first processing unit 101 detects a manually triggered log reading operation, it determines that the log reading conditions are met.

[0047] like Figure 1The shared memory 103 is pre-configured with a storage area corresponding to each second processing unit. The log update status of each second processing unit is determined by traversing the storage area corresponding to each second processing unit or according to a prompt message sent by the second processing unit corresponding to the generated update log information.

[0048] At step 202, when there is an update log event in the storage area corresponding to each second processing unit, the update log information corresponding to the update log event is stored in the log file system corresponding to the first processing unit.

[0049] In this embodiment, when there is an update log event in the storage area corresponding to each second processing unit 102, the first processing unit 101 can store the update log information corresponding to the update log event in the log file system corresponding to the first processing unit.

[0050] The log update event can be an update of the log information of at least one second processing unit relative to the last log reading operation of the first processing unit 101. That is, if an update of the log information of at least one second processing unit occurs within the time period between the current log reading operation and the last log reading operation, it is determined that a log update event has occurred in the second processing unit. Then, the first processing unit 101 can read the update log information from the storage area corresponding to the second processing unit in the shared memory 103 and store the update log information in the log file system. The log information is used to record the running status of the second processing unit, such as the data processing speed of the second processing unit, the CPU usage, the usage status of the peripherals of the second processing unit, etc.

[0051] Generally, the log file system can include a folder corresponding to each second processing unit, and the first processing unit 101 can store the read update log information in the folder corresponding to the second processing unit that generates the update log information, thereby facilitating the management of the log information of each second processing unit.

[0052] Optionally, the first processing unit 101 can run a log service for uniformly managing the log information generated by the at least one second processing unit 102. The log service can monitor the log update status of each second processing unit, and when it is monitored that the update log information generated by a second processing unit is stored in the corresponding storage area, the log service reads the update log information and stores the read update log information in the file system in the folder corresponding to the second processing unit that has the log update status.

[0053] Optionally, the first processing unit 101 runs a log service that is the same number as the number of second processing units and corresponds one-to-one. Each log service is used to manage logs for its corresponding second processing unit. For example, each log service can monitor the log updates of its corresponding second processing unit. When it detects that the corresponding second processing unit has stored newly generated log information into the storage area corresponding to the shared memory, the log service reads the updated log information and stores it in the folder in the file system corresponding to the second processing unit that has undergone the log update. By providing a specific log service for each second processing unit, separate log management for each second processing unit can be achieved, improving the efficiency of log management.

[0054] The method provided in the above embodiments of this disclosure, when meeting preset log reading conditions, involves a first processing unit determining the log update status in the storage areas corresponding to each second processing unit from shared memory. When update log events exist in the storage areas corresponding to each second processing unit, the update log information corresponding to the update log events is stored in the log file system corresponding to the first processing unit. This achieves unified log management of log information extracted from the second processing units through the first processing unit, and the log information is transmitted via memory read / write, resulting in low hardware performance overhead. Furthermore, different second processing units correspond to different storage areas in shared memory, which physically isolates the log information of each second processing unit, improving information storage security. Since the first processing unit includes a file system, storing the log information of the second processing units through a feature-rich file system enables management of log information from second processing units without a file system, facilitating operations such as log backtracking, log modification, log addition, and log deletion. It also allows the first processing unit to uniformly manage the log information of at least one second processing unit, improving log management efficiency.

[0055] In some alternative implementations, such as Figure 3 As shown, after step 202, the method may further include:

[0056] Step 203: In response to receiving a query request from the query terminal for querying log information of the target second processing unit, extract the log information corresponding to the query request from the folder in the log file system corresponding to the target second processing unit.

[0057] The query terminal can be a hardware terminal or a software terminal. A software terminal could be a shell terminal under a Linux operating system or a graphical user interface corresponding to the first processing unit 101. Furthermore, the query terminal can be configured for local or remote querying. For example, if the query terminal is a remote terminal, a remote query can be performed by logging into the shell port of the first processing unit 101 to remotely view the corresponding log information of each second processing unit. Alternatively, the query terminal can send a query request to the first processing unit 101 via a network, and the first processing unit 101 can then send the corresponding log information to the query terminal via the network. Typically, the query request can include an identifier of the target second processing unit. The first processing unit 101 can use this identifier to determine the target second processing unit and its corresponding folder from at least one second processing unit 102. The query request can also include specific query content, based on which the corresponding log information can be extracted from the folder.

[0058] Step 204: Send the log information corresponding to the query request to the query terminal.

[0059] Specifically, the first processing unit 101 can directly send the log information corresponding to the query request to the query terminal, or indirectly send the log information corresponding to the query request to the query terminal. As an example, when the query terminal is a remote terminal, the first processing unit 101 can send the log information corresponding to the query request to the cloud server, and then the cloud server forwards the log information corresponding to the query request to the query terminal. Alternatively, the first processing unit 101 can periodically send the log information to the cloud server, or when reading the log information from the second processing unit, and upon receiving a log query request, send a command to the cloud server instructing that the log information corresponding to the query request be sent to the query terminal, and the cloud server then sends the log information corresponding to the query request to the query terminal.

[0060] Figure 3 The method provided in the corresponding embodiment can enable the query terminal to obtain the log information corresponding to the target processing unit from the first processing unit, thereby effectively utilizing the log file system and remote network function of the first processing unit to view the log information of the target second processing unit, improving the efficiency of log viewing, and facilitating the debugging of the target second processing unit.

[0061] In some optional implementations, the log reading condition in step 201 may include: the current time has reached a preset log management period. The log management period can be any preset duration, such as 1 millisecond, 5 milliseconds, or 1 second. If the current time has reached the log management period, the first processing unit 101 can determine the log update status of each second processing unit within this period from the shared memory.

[0062] Optionally, the log information generated by the second processing unit in each log management cycle may also include information representing the corresponding log management cycle. For example, this information may include the start and end times of the current cycle.

[0063] This implementation method, by setting a log management cycle, can automatically monitor the log updates of each secondary processing unit according to the cycle, thereby helping to accurately trace log information according to time and improving the efficiency of log management.

[0064] In some alternative implementations, such as Figure 4 As shown, step 202 may include the following sub-steps:

[0065] Step 2021: Based on preset filtering conditions, filter the initial update log information to obtain the filtered update log information.

[0066] The initial update log is the unprocessed log information stored in the storage area corresponding to the second processing unit when an update log event occurs. The filtering criteria can be set arbitrarily according to actual needs.

[0067] Step 2022: Store the filtered update log information into the log file system corresponding to the first processing unit.

[0068] Specifically, for a certain second processing unit, the filtered update log information corresponding to the second processing unit can be stored in a folder in the log file system that corresponds to the name identifier of the second processing unit.

[0069] Figure 4 The method provided in the corresponding embodiment can make the update log information stored in the file system more targeted by filtering the initial log information corresponding to each second processing unit, retaining the log information with higher importance, thereby helping to save the storage space occupied by the file system.

[0070] In some alternative implementations, step 2021 may include at least one of the following sub-steps to obtain the filtered update log information:

[0071] Step 1: Filter the initial update log information according to the pre-set log information tags to obtain the filtered update log information.

[0072] The log information flag indicates whether the corresponding log information needs to be retained. For example, setting a log information flag "1" for a certain type of log information indicates that this type of log information needs to be retained. The log information flag can be set manually in advance, or it can be set automatically by the first processing unit (e.g., automatically setting the filtered updated log information corresponding to different dates based on the correspondence between the date and the source of the log information). The first processing unit can retain the log information with the corresponding log information flag.

[0073] Step 2: Filter out the initial update log information whose generation time is earlier than the preset expiration time to obtain the filtered update log information.

[0074] As an example, initial log information generated more than 30 days ago can be filtered out, and the remaining initial update log information is the filtered update log information.

[0075] Step 3: Determine the log information containing the first target keyword from the initial update log information as the filtered update log information; and / or, filter out the log information containing the second target keyword from the initial update log information, and determine the remaining update log information as the filtered update log information.

[0076] The first and second target keywords can usually be pre-set. For example, the first target keyword could include "add", then update log information containing "add" would be the filtered update log information. As another example, the second target keyword could include "delete", then update log information containing "delete" would be the log information to be filtered out, and the remaining update log information would be the filtered update log information.

[0077] It should be noted that the initial update log information can be filtered according to at least one of steps one, two, and three above. For example, all three steps can be performed on the initial update log information, and the filtered update log information obtained after processing by steps one, two, and three can be stored in the file system.

[0078] This implementation provides two methods for filtering initial update log information, which can flexibly filter the initial update log information, filter out log information that is not relevant to the current monitoring of the second processing unit, or filter out expired log information, thereby achieving more specific targeted filtering of log information.

[0079] In some alternative implementations, such as Figure 5 As shown, step 202 may include the following sub-steps:

[0080] Step 2023: Determine the log information to be encrypted from the update log information.

[0081] The method for determining the log information to be encrypted can be arbitrarily set. For example, a specific type of log information can be manually preset as the log information to be encrypted. Another example is that log information generated by a specific second processing unit can be preset as the log information to be encrypted; for instance, log information generated by a second processing unit of type DSP can be preset as the log information to be encrypted. Yet another example is that, according to the expiration time described in step two above, initial update log information whose generation time is earlier than the expiration time can be determined as the log information to be encrypted.

[0082] Step 2024: Encrypt the log information to be encrypted to obtain encrypted update log information.

[0083] The method for encrypting the log information can be set arbitrarily. For example, existing hash algorithms, SHA-1 (Secure Hash Algorithm 1), etc., can be used.

[0084] Step 2025: Store the encrypted update log information in the log file system.

[0085] Specifically, for a certain second processing unit, the encrypted update log information corresponding to that second processing unit can be stored in the corresponding folder in the log file system.

[0086] Figure 5 The method provided in the corresponding embodiment can securely store the log information of each second processing unit by encrypting the update log information, thereby improving the security of the log information of the second processing unit managed by the first processing unit.

[0087] Exemplary Apparatus

[0088] Figure 6 This is a schematic diagram of the structure of a log management device with multiple processing units provided in an exemplary embodiment of this disclosure. This embodiment can be applied to, for example... Figure 1 On the first processing unit 101 shown, as Figure 6As shown, the log management device for the multi-processing unit includes: a determination module 601, used to determine the log update status in the storage area corresponding to each second processing unit from the shared memory in response to meeting preset log reading conditions; and a storage module 602, used to store the update log information corresponding to the update log event into the log file system corresponding to the first processing unit when there is an update log event in the storage area corresponding to each second processing unit.

[0089] In this embodiment, the determining module 601 can determine the log update status in the storage area corresponding to each second processing unit from the shared memory in response to a preset log reading condition. The log reading condition is a condition used to trigger the first processing unit 101 to read log information. For example, when... Figure 1 When at least one of the second processing units 102 generates log information, it can send a prompt message to the first processing unit 101. Upon receiving the prompt message, the first processing unit determines that the log reading conditions are met. For example, when the second processing unit generates log information, it can trigger an interrupt signal. When the first processing unit detects the interrupt signal, it determines that the log reading conditions are met. For another example, when the first processing unit 101 detects a manually triggered log reading operation, it determines that the log reading conditions are met.

[0090] like Figure 1 The shared memory 103 shown has a pre-configured storage area corresponding to each second processing unit. The determination module 601 can traverse each second processing unit, or determine the current log update status of each second processing unit based on the prompt message sent by the second processing unit corresponding to the generated update log information.

[0091] In this embodiment, when there is an update log event in the storage area corresponding to each of the second processing units 102, the storage module 602 can store the update log information corresponding to the update log event into the log file system corresponding to the first processing unit.

[0092] The log update event can occur when each second processing unit performs a log read operation relative to the first processing unit 101. That is, if at least one of the second processing units updates its log information within the time interval between the current log read operation and the previous log read operation, a log update event is determined to have occurred for that second processing unit. Then, the storage module 602 can read the update log information from the storage area corresponding to the second processing unit in the shared memory 103 and store the update log information in the log file system. The log information is used to record the operating status of the second processing unit, such as the data processing speed, CPU utilization, and the usage status of the peripherals of the second processing unit.

[0093] Typically, the log file system can include folders corresponding to each second processing unit. The storage module 602 can store the read log information into the folder corresponding to the second processing unit that generated the log information, thereby facilitating the separate management of the log information of each second processing unit.

[0094] Reference Figure 7 , Figure 7 This is a schematic diagram of the structure of a log management device for multiple processing units provided in another exemplary embodiment of this disclosure.

[0095] In some optional implementations, the device further includes: a receiving module 603, configured to, in response to receiving a query request sent by a query terminal for querying log information of a target second processing unit, extract the log information corresponding to the query request from the folder in the log file system corresponding to the target second processing unit; and a sending module 604, configured to send the log information corresponding to the query request to the query terminal.

[0096] In some optional implementations, the log reading condition includes: the current time has reached the preset log management cycle.

[0097] In some optional implementations, the storage module 602 includes: a filtering unit 6021, used to filter the initial update log information based on preset filtering conditions to obtain filtered update log information; and a first storage unit 6022, used to store the filtered update log information into the log file system corresponding to the first processing unit.

[0098] In some optional implementations, the filtering unit 6021 includes at least one of the following: a first filtering subunit 60211, used to filter the initial update log information according to a pre-set log information tag to obtain filtered update log information; a second filtering subunit 60212, used to filter out the initial update log information whose generation time is earlier than a preset expiration time to obtain filtered update log information; and a third filtering subunit 60213, used to determine the log information containing the target keyword from the initial update log information as filtered update log information, and / or to filter out the log information containing the second target keyword from the initial update log information to obtain filtered update log information.

[0099] In some optional implementations, the storage module 602 includes: a determining unit 6023, used to determine the log information to be encrypted from the update log information; an encryption unit 6024, used to encrypt the log information to be encrypted to obtain encrypted update log information; and a second storage unit 6025, used to store the encrypted update log information into the log file system.

[0100] The multi-processing unit log management device provided in the above embodiments of this disclosure achieves unified log management of logs extracted from the second processing units by the first processing unit when preset log reading conditions are met. This is because the first processing unit determines the log update status in the storage areas corresponding to each second processing unit from shared memory, and when update log events exist in the storage areas corresponding to each second processing unit, the update log information corresponding to the update log events is stored in the log file system corresponding to the first processing unit. Furthermore, the log information is transmitted via memory read / write, resulting in low hardware performance overhead. In addition, different second processing units correspond to different storage areas in shared memory, which can physically isolate the log information of each second processing unit, improving the security of information storage. Since the first processing unit includes a file system, a feature-rich file system can be used to store the log information of the second processing units. This enables management of log information from second processing units without a file system, facilitating operations such as log backtracking, log modification, log addition, and log deletion. It also allows the first processing unit to uniformly manage the log information of at least one second processing unit, improving the efficiency of log management.

[0101] Exemplary Electronic Device

[0102] Below, for reference Figure 8 To describe an electronic device according to embodiments of the present disclosure. Figure 8 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0103] like Figure 8 As shown, the electronic device 800 includes a first processing unit 801, at least one second processing unit 802, shared memory 803, and a memory 804 for storing executable instructions of the first processing unit 801 and at least one second processing unit 802.

[0104] The first processing unit 801 and at least one second processing unit 802 may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 800 to perform desired functions.

[0105] Memory 804 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium.

[0106] Each second processing unit 802 is used to read the corresponding executable instruction from the memory 804 and execute the read executable instruction to implement:

[0107] In response to meeting the preset log write conditions, update log information is generated and written to the corresponding storage area in shared memory.

[0108] The log write condition is the condition used to trigger the second processing unit 802 to write log information. For example, when the second processing unit 802 detects a manually triggered log write command, it determines that the log write condition is met. As another example, when the second processing unit 802 generates an update log, it determines that the log write condition is met and then writes the update log information to the corresponding storage area in shared memory.

[0109] The first processing unit 801 can run corresponding executable instructions to implement the log management method of the multi-processing unit in the various embodiments of this disclosure above, and / or other desired functions.

[0110] In one example, the electronic device 800 may also include an input device 805 and an output device 806, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).

[0111] For example, the input device 805 can be a mouse, keyboard, or other similar device, used to input various commands and other content for managing logs. The input device 805 can also be a communication network connector, used to receive various commands and other content for managing logs from a remote location.

[0112] The output device 806 can output various information to the outside, including identified category information. The output device 806 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0113] Of course, for the sake of simplicity, Figure 8 Only some of the components of the electronic device 800 relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 800 may include any other suitable components depending on the specific application.

[0114] In some alternative implementations, in the shared memory 803, at least one storage area corresponding to the second processing unit 802 is used to store log information in a manner aligned with a preset data volume.

[0115] like Figure 9As shown, the shared memory 803 includes two storage areas, labeled Buffer1 and Buffer2, where log1-logN represents the stored log information. Each row of the table in the two storage areas represents a storage unit of the same size (i.e., a preset data amount, such as 128 bytes). It can be seen from the figure that although the actual storage space occupied by each log message is different, a storage unit of the same size is still allocated to each log message.

[0116] This implementation stores log information according to a preset data volume alignment method, ensuring that the distance between the addresses of each log message is equal. This helps to determine the address of each log message more efficiently and accurately, thereby improving the efficiency of log information reading and writing.

[0117] In some alternative implementations, at least one of the storage areas corresponding to the second processing unit 802 is configured as a circular buffer to enable the writing and reading of log information.

[0118] Here, the circular buffer is an abstract concept of a circle, not an actual circle. For example... Figure 10 As shown, each cell within the ring represents a storage unit for storing a log message. The arrows indicate the direction of writing and reading log messages, and the positions of the currently written and read log messages are marked. Cells between the positions of the written and read log messages represent storage units where log messages have already been written, while blank cells represent free storage units.

[0119] This implementation avoids frequent memory creation, cancellation, and allocation operations by setting each storage area as a circular buffer, thereby reducing hardware overhead and improving log read / write efficiency.

[0120] Exemplary Computer Program Product and Computer-Readable Storage Medium

[0121] In addition to the methods and apparatus described above, embodiments of this disclosure may also be computer program products comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps of the log management method for a multiprocessor unit according to various embodiments of this disclosure as described in the "Exemplary Methods" section above.

[0122] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this disclosure. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0123] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps in the log management method of the multiprocessor unit according to various embodiments of this disclosure as described in the "Exemplary Methods" section above.

[0124] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0125] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0126] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0127] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0128] The methods and apparatus of this disclosure may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of this disclosure are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, this disclosure may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the methods according to this disclosure. Thus, this disclosure also covers recording media storing programs for performing the methods according to this disclosure.

[0129] It should also be noted that in the apparatus, devices, and methods of this disclosure, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions to this disclosure.

[0130] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.

[0131] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A log management method for multiple processing units, characterized in that, The multi-processing unit refers to multiple processing units in an on-chip system. Each multi-processing unit includes a first processing unit and at least one second processing unit. The first processing unit has a log file system and runs a log service corresponding one-to-one with each of the at least one second processing unit. The at least one second processing unit does not have a log management system. The method is applied to the first processing unit, and the method includes: In response to meeting preset log reading conditions, the log service determines the log update status in the storage area corresponding to each of the second processing units from the shared memory; wherein, the shared memory is used to temporarily store log information generated by each of the second processing units, and in the shared memory, the storage area corresponding to each of the at least one second processing unit is used to store log information in a preset data volume alignment manner, and the shared memory is used to allocate a storage unit of the same size for each log information; the log reading condition is the condition that triggers the first processing unit to read the log information when any of the second processing units generates log information; In response to the detection of an update log event in the storage area corresponding to the second processing unit through the log service, the update log information corresponding to the update log event is read and stored in the log file system corresponding to the first processing unit and in the folder corresponding to the second processing unit where the log update event occurred.

2. The method according to claim 1, wherein, The method further includes: In response to receiving a query request from a query terminal for querying log information of a target second processing unit, the log information corresponding to the query request is extracted from the folder in the log file system corresponding to the target second processing unit; The log information corresponding to the query request is sent to the query terminal.

3. The method according to claim 1, wherein, The log reading conditions include: the current time has reached the preset log management cycle.

4. The method according to claim 1, wherein, The step of storing the update log information corresponding to the update log event into the log file system corresponding to the first processing unit includes: Based on preset filtering conditions, the initial update log information is filtered to obtain filtered update log information; The filtered update log information is stored in the log file system corresponding to the first processing unit.

5. The method according to claim 4, wherein, The initial update log information is filtered based on preset filtering conditions to obtain filtered update log information, including at least one of the following: The initial update log information is filtered according to the pre-set log information tags to obtain the filtered update log information; The initial update log information whose generation time is earlier than the preset expiration time is filtered out to obtain the filtered update log information; Log information containing the first target keyword is determined from the initial update log information and used as the filtered update log information; And / or, filter out log information containing the second target keyword from the initial update log information to obtain the filtered update log information.

6. The method according to claim 1, wherein, The step of storing the update log information corresponding to the update log event into the log file system corresponding to the first processing unit includes: The log information to be encrypted is determined from the update log information; The log information to be encrypted is encrypted to obtain encrypted update log information; The encrypted update log information is stored in the log file system.

7. A log management device with multiple processing units, characterized in that, The multi-processing unit is a plurality of processing units in an on-chip system. The multi-processing unit includes a first processing unit and at least one second processing unit. The first processing unit has a log file system and runs a log service corresponding one-to-one with the at least one second processing unit. The at least one second processing unit does not have a log management system. The device is applied to the first processing unit, and the device includes: A determination module is used to determine the log update status in the storage area corresponding to each of the second processing units from the shared memory in response to a preset log reading condition. The shared memory is used to temporarily store log information generated by each of the second processing units. Within the shared memory, the storage area corresponding to each of the at least one second processing unit is used to store log information in a preset data volume alignment manner. The shared memory is used to allocate a storage unit of the same size for each log message. The log reading condition is the condition that triggers the first processing unit to read the log information when any of the second processing units generates log information. The storage module is configured to, in response to the log service detecting an update log event in the storage area corresponding to the second processing unit, read the update log information corresponding to the update log event through the log service and store the update log information in the log file system corresponding to the first processing unit and in the folder corresponding to the second processing unit where the log update event occurred.

8. An electronic device comprising a system-on-a-chip (SoC), the SoC including a first processing unit, at least one second processing unit, shared memory, and a memory for storing executable instructions of the first processing unit and the at least one second processing unit, the first processing unit having a log file system, the first processing unit running a log service corresponding one-to-one with the at least one second processing unit, and the at least one second processing unit not having a log management system. Each of the second processing units is configured to read the corresponding executable instructions from the memory and execute the read executable instructions to generate update log information in response to meeting the preset log writing conditions, and write the update log information into the corresponding storage area in the shared memory; The first processing unit is configured to read the corresponding executable instructions from the memory and execute the read executable instructions to implement the log management method of the multi-processing unit as described in any one of claims 1-6. In the shared memory, the storage areas corresponding to the at least one second processing unit are used to store log information in a way that is aligned with a preset data volume, and the shared memory is used to allocate a storage unit of the same size for each log message.

9. The electronic device according to claim 8, wherein, The storage areas corresponding to the at least one second processing unit are configured as circular buffers to enable the writing and reading of log information.

10. A computer-readable storage medium storing a computer program for performing the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Log information reporting method and device, storage medium, ADSP (audio digital signal processor) and terminal

    CN107609120A