Fault information reading methods, devices, equipment, media, and vehicles
By setting target pointers and cursor pointers in the cache space, reading can start directly from the cache block of the latest fault information, thus solving the problem of low efficiency in fault information reading in AUTOSAR and achieving efficient fault information acquisition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-16
- Publication Date
- 2026-03-10
AI Technical Summary
In AUTOSAR's diagnostic event management, fault information reading efficiency is low because fault information of different ages is mixed in the cache space, which requires traversing the entire cache space for each read, making it impossible to efficiently obtain the latest fault information.
By setting a target pointer in the cache space to point to the cache block containing the latest fault information, and by using the cursor pointer to read fault information directly from the target cache block in the opposite order of fault occurrence, the system avoids traversing all cache blocks.
It improves the efficiency of reading fault information, enabling the full fault information to be obtained in a single read, thus avoiding the inefficient operation of traversing the cache space multiple times.
Smart Images

Figure CN119847409B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of operation and maintenance technology, and in particular relates to a fault information reading method, device, equipment, medium and vehicle. Background Technology
[0002] In the existing Diagnostic Event Manager (DEM) solution of the Automotive Open System Architecture (AUTOSAR), DEM supports the conversion of fault information into cache (Primary Memory or User Defined Memory), and the persistence of fault information into non-volatile memory through the correspondence between cache block area (Memory Entry) and non-volatile memory block (NvM Block).
[0003] Currently, in the existing Dem (Data Communication Module) operation logic, when the Data Communication Module (DCM) requests to read the full set of fault information stored in the Dem cache space, it needs to read the information in order of fault occurrence time, from newest to oldest. Since the Dem uses an array as its data cache structure, it needs to traverse the entire cache space multiple times to correctly output the fault information requested by the DCM in the order of newest to oldest. This is because the cache blocks used to store fault information of different ages are merged together in an out-of-order manner. Therefore, the device does not know which cache block stores the latest fault information. Thus, whenever the latest fault information needs to be read, the device must traverse the entire cache space once. If the fault information needs to be read in order of newest to oldest, the entire cache space needs to be traversed multiple times, resulting in low efficiency in reading fault information. Summary of the Invention
[0004] The purpose of this application is to provide a fault information reading method, apparatus, device, medium, and vehicle that can improve the efficiency of fault information reading.
[0005] In a first aspect, embodiments of this application provide a method for reading fault information, the method comprising:
[0006] Receive fault information reading command;
[0007] In response to the fault information reading instruction, the target cache block pointed to by the target pointer in the cache space is determined, wherein the target pointer is used to point to the cache block in the cache space that stores target fault information, and the target fault information is the fault information corresponding to the latest fault in the cache space;
[0008] Starting from the target cache block, the fault information stored in at least one cache block is read according to the direction indicated by the cursor pointer in at least one cache block within the cache space, wherein the direction indicated by the cursor pointer is opposite to the order in which the faults occur corresponding to the fault information stored in the at least one cache block.
[0009] In some implementations, the target pointer includes a preset cache block in the cache space that is set as the information read head node;
[0010] Determining the target cache block pointed to by the target pointer in the cache space includes:
[0011] The cache block pointed to by the cursor pointer of the preset cache block is determined as the target cache block.
[0012] In some implementations, determining the cache block pointed to by the cursor pointer of the preset cache block as the target cache block includes:
[0013] The cache block pointed to by the backward cursor of the preset cache block is determined as the target cache block;
[0014] The step of reading fault information stored in at least one cache block, starting from the target cache block and following the direction indicated by the cursor pointer in at least one cache block within the cache space, includes:
[0015] Starting from the target cache block, read the fault information stored in the at least one cache block according to the direction indicated by the backward cursor in at least one cache block within the cache space.
[0016] In some embodiments, after reading fault information stored in at least one cache block, starting from the target cache block and following the direction indicated by the backward cursor in at least one cache block within the cache space, the method further includes:
[0017] When the fault information stored in the first cache block in the cache space is updated, the forward cursor of the first cache block is updated to point to the preset cache block, and the backward cursor of the first cache block is updated to point to the target cache block. The first cache block is another cache block in the cache space other than the target cache block.
[0018] Update the backward cursor of the preset cache block to point to the first cache block, and update the forward cursor of the target cache block to point to the first cache block.
[0019] In some embodiments, before updating the forward cursor of the first cache block to point to the preset cache block and updating the backward cursor of the first cache block to point to the target cache block, the method further includes:
[0020] Determine the second cache block pointed to by the forward cursor of the first cache block and the third cache block pointed to by the backward cursor;
[0021] Update the backward cursor of the second cache block to point to the third cache block, and update the forward cursor of the third cache block to point to the second cache block.
[0022] In some embodiments, after reading fault information stored in at least one cache block, starting from the target cache block and following the direction indicated by the backward cursor in at least one cache block within the cache space, the method further includes:
[0023] When storing fault information in a free fourth cache block in the cache space, the forward cursor of the fourth cache block is pointed to the preset cache block, and the backward cursor of the fourth cache block is pointed to the target cache block.
[0024] Update the backward cursor of the preset cache block to point to the fourth cache block, and update the forward cursor of the target cache block to point to the fourth cache block.
[0025] In some implementations, determining the cache block pointed to by the cursor pointer of the preset cache block as the target cache block includes:
[0026] The cache block pointed to by the forward cursor of the preset cache block is determined as the target cache block;
[0027] The step of reading fault information stored in at least one cache block, starting from the target cache block and following the direction indicated by the cursor pointer in at least one cache block within the cache space, includes:
[0028] Starting from the target cache block, read the fault information stored in the at least one cache block according to the direction indicated by the forward cursor in at least one cache block within the cache space.
[0029] Secondly, embodiments of this application provide a fault information reading device, which includes:
[0030] The instruction receiving module is used to receive fault information reading instructions;
[0031] The target determination module is used to determine the target cache block pointed to by the target pointer in the cache space in response to the fault information reading instruction. The target pointer is used to point to the cache block in the cache space that stores target fault information, and the target fault information is the fault information corresponding to the latest fault in the cache space.
[0032] The information reading module is used to read fault information stored in at least one cache block, starting from the target cache block, according to the direction indicated by the cursor pointer in at least one cache block within the cache space, wherein the direction indicated by the cursor pointer is opposite to the order of fault occurrence corresponding to the fault information stored in the at least one cache block.
[0033] Thirdly, embodiments of this application provide an electronic device, which includes: a processor and a memory storing computer program instructions;
[0034] When the processor executes the computer program instructions, it implements the steps of the fault information reading method as described in any embodiment of the first aspect.
[0035] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the fault information reading method provided in any of the embodiments of the first aspect.
[0036] Fifthly, embodiments of this application provide a vehicle, which includes at least:
[0037] Such as the fault information reading device in the second aspect;
[0038] Such as electronic devices in the third aspect;
[0039] Such as the computer-readable storage medium in the fourth aspect.
[0040] In the fault information reading method, apparatus, device, medium, and vehicle of this application embodiment, since a target pointer is set in the cache space, and this target pointer is used to point to the cache block in the cache space that stores the fault information corresponding to the most recently occurred fault, i.e., the target cache block, when a fault information reading instruction is received, it is not necessary to traverse all cache blocks in the cache space. The target pointer can be used to quickly find the target cache block where the fault information corresponding to the most recently occurred fault is located, improving the cache block lookup efficiency and thus improving the fault information reading efficiency. In addition, by starting from the target cache block and reading the fault information stored in at least one cache block according to the direction indicated by the cursor pointer in at least one cache block in the cache space, since the direction indicated by the cursor pointer is opposite to the fault occurrence order corresponding to the fault information stored in the at least one cache block, the purpose of obtaining the full fault information from newest to oldest can be achieved in one read, without having to traverse the entire cache space multiple times, thereby improving the fault information reading efficiency. In summary, the fault information reading efficiency can be improved through the embodiments of this application. Attached Figure Description
[0041] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a flowchart illustrating a fault information reading method provided in an embodiment of this application;
[0043] Figure 2 This is a schematic diagram of the structure of a fault information reading device provided in an embodiment of this application;
[0044] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0045] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0046] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0047] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the term "comprising" or any other variations thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0048] In addition, the abbreviations and key terms in this application embodiment are defined as follows:
[0049] AUTOSAR: Automotive Open System Architecture;
[0050] Dem: The AUTOSAR module responsible for the centralized management of reporting, caching, persistence, and exporting of diagnostic faults;
[0051] DCM: Data Communication Module, refers to the network communication function module installed in the vehicle, whose function is to collect vehicle operation data and communicate with service centers and other platforms;
[0052] Primary Memory: Dem's primary cache area, which is the default supported cache area;
[0053] User Defined Memory: Dem's user-defined cache;
[0054] NvM: The AUTOSAR module responsible for managing and abstracting non-volatile memory.
[0055] Based on this, and to address the problems of the prior art, embodiments of this application provide a method, apparatus, device, medium, and vehicle for reading fault information. This fault information reading method can be applied to scenarios involving reading fault information cached in the Dem cache of a vehicle.
[0056] The fault information reading method provided in this application will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0057] Figure 1 This is a flowchart illustrating a fault information reading method provided in an embodiment of this application. This fault information reading method can be executed by Dem.
[0058] like Figure 1 As shown, the fault information reading method may specifically include the following steps:
[0059] S110, Receive fault information reading command;
[0060] S120. In response to the fault information reading instruction, determine the target cache block pointed to by the target pointer in the cache space, wherein the target pointer is used to point to the cache block in the cache space that stores the target fault information, and the target fault information is the fault information corresponding to the latest fault in the cache space.
[0061] S130. Starting from the target cache block, read the fault information stored in at least one cache block according to the direction of the cursor pointer in at least one cache block in the cache space, wherein the direction of the cursor pointer is opposite to the order of fault occurrence corresponding to the fault information stored in at least one cache block.
[0062] Therefore, by setting a target pointer in the cache space, and using this target pointer to point to the cache block containing the fault information corresponding to the most recently occurred fault (i.e., the target cache block), when a fault information read instruction is received, it is not necessary to traverse all cache blocks in the cache space. The target pointer can be used to quickly find the target cache block containing the fault information corresponding to the most recently occurred fault, improving the cache block lookup efficiency and thus improving the fault information read efficiency. Furthermore, by starting from the target cache block and reading the fault information stored in at least one cache block according to the direction indicated by the cursor pointer in at least one cache block within the cache space, since the direction of the cursor pointer is opposite to the fault occurrence order corresponding to the fault information stored in the at least one cache block, the purpose of obtaining all fault information from newest to oldest can be achieved in a single read, without having to traverse the entire cache space multiple times, thereby improving the fault information read efficiency. In summary, the embodiments of this application can improve the fault information read efficiency.
[0063] The specific implementation methods for each of the above steps are described below.
[0064] In some implementations, in S110, the fault information read instruction can be an instruction for reading fault information stored in the cache space. This fault information read instruction can be sent from Dcm to Dem to instruct Dem to read the full set of fault information requested by Dcm from the cache space.
[0065] In some implementations, in S120, the fault information stored in the cache space can be managed using a static linked list. This static linked list can be a type of linear storage structure. The implementation of the static linked list can be based on a static array, and by adding a cursor pointer, it combines the advantages of both sequential lists and linked lists. In this embodiment, the static linked list corresponding to the cursor pointer can be called the read-management linked list.
[0066] In this embodiment, the cache space may include multiple cache blocks storing fault information of different ages. That is, the fault information stored in different cache blocks in the cache space may correspond to different fault occurrence times.
[0067] Based on this, in some examples, after a failure occurs, Dem stores the corresponding failure information in a pre-allocated cache space. After writing the failure information into the cache block in the cache space, Dem sets the cursor pointer of the cache block according to the failure occurrence order from the newest to the oldest, so that the cursor pointer's pointing direction is reversed with the failure occurrence order, thereby updating the read management list.
[0068] In addition, a target pointer is set in the cache space. The target pointer can be used to point to a cache block in the cache space that stores the fault information corresponding to the most recently occurred fault. When no fault information is stored in the cache space, the values of all cursor pointers in the management list and the target pointer can be null.
[0069] In some implementations, the target pointer may include a preset cache block in the cache space that is set as the information read head node.
[0070] Based on this, the aforementioned S120 may specifically include:
[0071] Determine the cache block pointed to by the cursor pointer of the preset cache block as the target cache block.
[0072] Here, setting the target pointer in the cache space can be done by pre-setting a certain cache block in the cache space as the head node for reading information in the read management linked list, and then, when reading fault information, starting from the cache block pointed to by the cursor pointer in that pre-set cache block to read the fault information. The cursor pointer can be a forward cursor or a backward cursor.
[0073] For example, the cache block pointed to by the backward cursor of the preset cache block can be used as the starting cache block for information reading, i.e., the target cache block. Alternatively, the cache block pointed to by the forward cursor of the preset cache block can also be used as the starting cache block for information reading.
[0074] In this way, by setting an information read header node in the cache space, a target pointer can be set in the cache space to point to the cache block where the fault information corresponding to the latest fault is located. This allows the target cache block where the latest fault information is located to be found quickly without traversing all cache blocks, thus improving the cache block lookup efficiency.
[0075] In some implementations, in S130, after determining the target cache block, the target cache block can be used as the starting cache block. The fault information stored in the target cache block is read, and the fault information in the next cache block is read according to the cache block pointed to by the cursor pointer in the target cache block, and so on, until all the fault information stored in the cache space is read.
[0076] In addition, the type of cursor pointer can include both forward and backward cursors.
[0077] For example, when the cursor pointer is a backward cursor, the fault information stored in each cache block can be read backward from the target cache block according to the direction indicated by the backward cursor in the cache block; when the cursor pointer is a forward cursor, the fault information stored in each cache block can be read forward from the target cache block according to the direction indicated by the forward cursor in the cache block.
[0078] In this way, since the cursor pointers in each cache block containing fault information point in the opposite direction to the order in which the faults occurred, the fault information corresponding to a later-occurring fault (i.e., the newer fault information) is read first, and the fault information corresponding to an earlier-occurring fault (i.e., the older fault information) is read first. Therefore, the fault information read according to the cursor pointer direction in each cache block is arranged in ascending order of newest to oldest. This allows Dem to satisfy the requirement of outputting the fault information of the Dcm request in ascending order of newest to oldest without having to traverse the entire cache space multiple times.
[0079] Based on this, in the case where the cursor pointer is a backward cursor, in some embodiments, the cache block pointed to by the cursor pointer that determines the preset cache block is used as the target cache block, which may specifically include:
[0080] The cache block pointed to by the backward cursor of the preset cache block is determined as the target cache block.
[0081] Specifically, S130 mentioned above may include:
[0082] Starting from the target cache block, read the fault information stored in at least one cache block according to the direction indicated by the backward cursor in at least one cache block in the cache space, wherein the direction indicated by the backward cursor pointer is the reverse of the fault occurrence order corresponding to the fault information stored in at least one cache block.
[0083] For example, suppose the cache blocks storing fault information in the cache space include: cache block 1, cache block 2, cache block 3, cache block 4, and cache block 5. If the fault occurrence order corresponding to the fault information is: cache block 2 → cache block 1 → cache block 4 → cache block 5 → cache block 3, then the direction of the backward cursor for each cache block is: cache block 3 → cache block 5 → cache block 4 → cache block 1 → cache block 2. Based on this, cache block 3 can be determined as the target cache block through the target pointer. Then, fault information is first read from cache block 3, then from cache block 5 (pointed to by the backward cursor in cache block 3), then from cache block 4 (pointed to by the backward cursor in cache block 5), then from cache block 1 (pointed to by the backward cursor in cache block 4), and finally from cache block 2 (pointed to by the backward cursor in cache block 1).
[0084] In this way, without having to traverse the entire cache space multiple times, the full set of fault information can be read in the order of newest to oldest by reading it only once.
[0085] Furthermore, to ensure that when a fault corresponding to existing fault information in the cache space recurs, the cursor pointer's pointing direction remains reversed compared to the fault occurrence order corresponding to the fault information stored in each cache block, in some embodiments, after the aforementioned step of reading fault information stored in at least one cache block starting from the target cache block and following the backward cursor pointing direction in at least one cache block within the cache space, the fault information reading method provided in this application embodiment may further include:
[0086] If the fault information stored in the first cache block in the cache space is updated, the forward cursor of the first cache block is updated to point to the preset cache block, and the backward cursor of the first cache block is updated to point to the target cache block. The first cache block is any other cache block in the cache space other than the target cache block.
[0087] Update the backward cursor of the preset cache block to point to the first cache block, and update the forward cursor of the target cache block to point to the first cache block.
[0088] Here, when a fault corresponding to a fault that already exists in the cache space occurs again, Dem will update the cache block containing the old fault information corresponding to the same fault based on the latest fault information. At this time, the fault information stored in the cache block will be updated.
[0089] For example, if the fault information stored in the first cache block in the cache space is updated, it means that the fault corresponding to the fault information stored in the first cache block is the latest fault to occur in the cache space. Therefore, it is necessary to update the node position of the first cache block in the read management list. The update method may include: inserting the node corresponding to the first cache block in the read management list between the information read head node and the secondary node. That is, updating the forward cursor of the first cache block to point to the preset cache block, and updating the backward cursor of the first cache block to point to the target cache block. Correspondingly, it is also necessary to update the backward cursor of the preset cache block to point to the first cache block, and update the forward cursor of the target cache block to point to the first cache block.
[0090] In this way, by updating the value of the cursor pointer of the first cache block, the cache block containing the latest updated fault information can always be kept in the position of the read management chain after the head node, thus ensuring that each read always starts from the cache block containing the latest fault information.
[0091] In addition, to maintain the order and integrity of reading the management list, in some embodiments, before updating the forward cursor of the first cache block to point to the preset cache block and updating the backward cursor of the first cache block to point to the target cache block, the fault information reading method provided in this application embodiment may further include:
[0092] Determine the second cache block pointed to by the forward cursor of the first cache block and the third cache block pointed to by the backward cursor;
[0093] Update the backward cursor of the second cache block to point to the third cache block, and update the forward cursor of the third cache block to point to the second cache block.
[0094] For example, the node corresponding to the first cache block in the read management list can be extracted from its original position, and its two preceding and following nodes can be concatenated together. That is, if the cache block pointed to by the forward cursor in the first cache block is the second cache block, and the cache block pointed to by the backward cursor in the first cache block is the third cache block, the backward cursor of the second cache block is updated from pointing to the first cache block to pointing to the third cache block, and the forward cursor of the third cache block is updated from pointing to the first cache block to pointing to the second cache block.
[0095] In this way, by splicing the nodes of the two cache blocks before and after the first cache block in the read management list, the order and integrity of the read management list can still be maintained after the node position of the first cache block in the read management list is moved.
[0096] Furthermore, in order to maintain the reverse order of the cursor pointer's direction of indication and the order of fault occurrence corresponding to the fault information stored in each cache block when storing fault information corresponding to a new fault in the cache space, in some embodiments, after the above-described step of reading fault information stored in at least one cache block starting from the target cache block and following the backward cursor direction in at least one cache block within the cache space, the fault information reading method provided in this application embodiment may further include:
[0097] When storing fault information in the free fourth cache block in the cache space, the forward cursor of the fourth cache block is pointed to the preset cache block, and the backward cursor of the fourth cache block is pointed to the target cache block.
[0098] Update the backward cursor of the preset cache block to point to the fourth cache block, and update the forward cursor of the target cache block to point to the fourth cache block.
[0099] Here, when a fault that does not exist in the cache space occurs, Dem will determine that the fault is a new fault. At this time, Dem will try to find a free cache block in the cache space to store the fault information corresponding to the new fault.
[0100] For example, if Dem successfully finds a suitable cache block in the cache space, such as the fourth cache block, Dem can store the fault information corresponding to the most recently occurred fault in the fourth cache block. At this time, the fault information stored in the fourth cache block corresponds to the most recently occurred fault in the cache space. Therefore, the fourth cache block needs to be inserted into the read management list at the position second only to the information read head node. The insertion method can include: inserting the node corresponding to the fourth cache block in the read management list between the information read head node and the second node. That is, updating the forward cursor of the fourth cache block to point to the preset cache block, and updating the backward cursor of the fourth cache block to point to the target cache block. Correspondingly, it is also necessary to update the backward cursor of the preset cache block to point to the fourth cache block, and update the forward cursor of the target cache block to point to the fourth cache block.
[0101] In this way, by setting the cursor pointer of the fourth cache block, the cache block containing the latest stored fault information can always be kept in the position of the read management chain second only to the head node, thus ensuring that each read always starts from the cache block containing the latest fault information.
[0102] Furthermore, regarding the case where the cursor pointer of at least one cache block in S130 is a forward cursor, and the cursor pointer of the preset cache block is also a forward cursor, in some embodiments, the cache block pointed to by the cursor pointer of the preset cache block is determined as the target cache block, which may specifically include:
[0103] Determine the cache block pointed to by the forward cursor of the preset cache block as the target cache block.
[0104] Specifically, S130 mentioned above may include:
[0105] Starting from the target cache block, read the fault information stored in at least one cache block according to the direction indicated by the forward cursor in at least one cache block in the cache space, wherein the direction indicated by the forward cursor pointer is the reverse of the fault occurrence order corresponding to the fault information stored in at least one cache block.
[0106] For example, suppose the cache blocks storing fault information in the cache space include: cache block 1, cache block 2, cache block 3, cache block 4, and cache block 5. If the fault occurrence order corresponding to the stored fault information is: cache block 2 → cache block 1 → cache block 4 → cache block 5 → cache block 3, then the forward cursor direction for each cache block can be: cache block 2 ← cache block 1 ← cache block 4 ← cache block 5 ← cache block 3. Based on this, cache block 3 can be determined as the target cache block by the target pointer or the forward cursor pointer of the preset cache block. Then, the fault information is first read from cache block 3, then from cache block 5 pointed to by the forward cursor in cache block 3, then from cache block 4 pointed to by the forward cursor in cache block 5, then from cache block 1 pointed to by the forward cursor in cache block 4, and finally from cache block 2 pointed to by the forward cursor in cache block 1.
[0107] In this way, without having to traverse the entire cache space multiple times, the full set of fault information can be read in the order of newest to oldest by reading it only once.
[0108] In addition, in view of the above situation, similar technical means as those in the aforementioned embodiments or implementation methods can be used to update and store fault information. Therefore, based on the aforementioned embodiments or implementation methods, when there is fault information update or fault information storage, the corresponding cache block can be updated in the read management chain by adjusting the cache block pointed to by the bidirectional cursor of the corresponding cache block. This ensures that the cache block containing the fault information corresponding to the latest fault always remains at the starting read node position in the read management chain, thereby guaranteeing that each read always starts from the cache block containing the latest fault information.
[0109] It should be noted that the application scenarios described in the above embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0110] Based on the same inventive concept, this application also provides a fault information reading device. (Specifically combined with...) Figure 2 Please provide a detailed explanation.
[0111] Figure 2 This is a schematic diagram of the structure of a fault information reading device provided in one embodiment of this application.
[0112] like Figure 2 As shown, the fault information reading device 200 may include:
[0113] The instruction receiving module 201 is used to receive fault information reading instructions;
[0114] The target determination module 202 is used to determine the target cache block pointed to by the target pointer in the cache space in response to the fault information reading instruction. The target pointer is used to point to the cache block in the cache space that stores target fault information. The target fault information is the fault information corresponding to the latest fault in the cache space.
[0115] The information reading module 203 is used to read fault information stored in at least one cache block, starting from the target cache block, according to the direction indicated by the cursor pointer in at least one cache block in the cache space, wherein the direction indicated by the cursor pointer is opposite to the order of fault occurrence corresponding to the fault information stored in the at least one cache block.
[0116] The fault information reading device 300 described above will be explained in detail below:
[0117] In some embodiments, the target pointer includes a preset cache block in the cache space that is set as the information read head node;
[0118] Target determination module 202 can be specifically used for:
[0119] The cache block pointed to by the cursor pointer of the preset cache block is determined as the target cache block.
[0120] In some embodiments, the target determination module 202 may further be used for:
[0121] The cache block pointed to by the backward cursor of the preset cache block is determined as the target cache block;
[0122] The information reading module 203 can be specifically used for:
[0123] Starting from the target cache block, read the fault information stored in the at least one cache block according to the direction indicated by the backward cursor in at least one cache block within the cache space.
[0124] In some embodiments, the fault information reading device 300 may further include:
[0125] The first update module is configured to, starting from the target cache block and following the direction indicated by the backward pointer in at least one cache block within the cache space, read the fault information stored in at least one cache block. If the fault information stored in the first cache block within the cache space is updated, update the forward cursor of the first cache block to point to the preset cache block and update the backward cursor of the first cache block to point to the target cache block. The first cache block is any cache block in the cache space other than the target cache block.
[0126] The second update module is used to update the backward cursor of the preset cache block to point to the first cache block, and to update the forward cursor of the target cache block to point to the first cache block.
[0127] In some embodiments, the fault information reading device 300 may further include:
[0128] The first determining module is used to determine the second cache block pointed to by the forward cursor of the first cache block and the third cache block pointed to by the backward cursor before updating the forward cursor of the first cache block to point to the preset cache block and updating the backward cursor of the first cache block to point to the target cache block.
[0129] The third update module is used to update the backward cursor of the second cache block to point to the third cache block, and update the forward cursor of the third cache block to point to the second cache block.
[0130] In some embodiments, the fault information reading device 300 may further include:
[0131] The cursor setting module is used to, after reading the fault information stored in at least one cache block starting from the target cache block and following the direction indicated by the backward cursor in at least one cache block within the cache space, and then storing the fault information in a free fourth cache block in the cache space, point the forward cursor of the fourth cache block to the preset cache block and point the backward cursor of the fourth cache block to the target cache block.
[0132] The fourth update module is used to update the backward cursor of the preset cache block to point to the fourth cache block, and update the forward cursor of the target cache block to point to the fourth cache block.
[0133] In some embodiments, the target determination module 202 may further be used for:
[0134] The cache block pointed to by the forward cursor of the preset cache block is determined as the target cache block;
[0135] The information reading module 203 can be specifically used for:
[0136] Starting from the target cache block, read the fault information stored in the at least one cache block according to the direction indicated by the forward cursor in at least one cache block within the cache space.
[0137] Therefore, by setting a target pointer in the cache space, and using this target pointer to point to the cache block containing the fault information corresponding to the most recently occurred fault (i.e., the target cache block), when a fault information read instruction is received, it is not necessary to traverse all cache blocks in the cache space. The target pointer can be used to quickly find the target cache block containing the fault information corresponding to the most recently occurred fault, improving the cache block lookup efficiency and thus improving the fault information read efficiency. Furthermore, by starting from the target cache block and reading the fault information stored in at least one cache block according to the direction indicated by the cursor pointer in at least one cache block within the cache space, since the direction of the cursor pointer is opposite to the fault occurrence order corresponding to the fault information stored in the at least one cache block, the purpose of obtaining all fault information from newest to oldest can be achieved in a single read, without having to traverse the entire cache space multiple times, thereby improving the fault information read efficiency. In summary, the embodiments of this application can improve the fault information read efficiency.
[0138] Figure 3 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application.
[0139] The electronic device 300 may include a processor 301 and a memory 302 storing computer program instructions.
[0140] Specifically, the processor 301 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0141] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 302 is non-volatile solid-state memory.
[0142] In certain embodiments, the memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Thus, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this application.
[0143] The processor 301 implements any of the fault information reading methods in the above embodiments by reading and executing computer program instructions stored in the memory 302.
[0144] In some examples, the electronic device 300 may also include a communication interface 303 and a bus 310. For example, Figure 3 As shown, the processor 301, memory 302, and communication interface 303 are connected through bus 310 and complete communication with each other.
[0145] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0146] Bus 310 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not as a limitation, bus 310 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 310 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.
[0147] For example, the electronic device 300 can be a mobile phone, tablet computer, laptop computer, handheld computer, in-vehicle electronic device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc.
[0148] The electronic device 300 can execute the fault information reading method in the embodiments of this application, thereby achieving the combination Figure 1 and Figure 2 The method and apparatus for reading fault information are described.
[0149] Furthermore, in conjunction with the fault information reading methods in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the fault information reading methods in the above embodiments. Examples of computer-readable storage media include non-transitory computer-readable storage media, such as portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, etc.
[0150] This application also provides a computer program product in which instructions are executed by the processor of an electronic device, causing the electronic device to perform the fault information reading method provided in this application.
[0151] This application also provides a vehicle, which may include at least one of a power battery charging device, an electronic device, and a computer storage medium. The specific fault information reading device, electronic device, and computer storage medium involved are consistent with the above description and will not be repeated here.
[0152] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0153] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0154] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0155] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0156] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A failure information reading method characterized by comprising: The method comprises: receiving a fault information reading instruction; in response to the fault information reading instruction, determining a target cache block pointed to by a target pointer in the cache space, wherein the target pointer is used to point to a cache block in the cache space that stores target fault information, and the target fault information is fault information corresponding to a latest fault occurring in the cache space; starting from the target cache block, reading fault information stored in at least one cache block in the cache space in a direction indicated by a cursor pointer in the at least one cache block, wherein the direction indicated by the cursor pointer is opposite to a fault occurrence order corresponding to the fault information stored in the at least one cache block.
2. The method of claim 1, wherein, The target pointer comprises a preset cache block in the cache space that is set as an information reading head node. The determination of the target cache block pointed to by the target pointer in the cache space comprises: determining a cache block pointed to by a cursor pointer of the preset cache block as the target cache block.
3. The method of claim 2, wherein, The determination of the target cache block pointed to by the cursor pointer of the preset cache block comprises: determining a cache block pointed to by a backward cursor of the preset cache block as the target cache block. The reading of the fault information stored in the at least one cache block in the cache space in the direction indicated by the cursor pointer in the at least one cache block starting from the target cache block comprises: starting from the target cache block, reading fault information stored in at least one cache block in the cache space in a direction indicated by a backward cursor in the at least one cache block.
4. The method of claim 3, wherein, After the reading of the fault information stored in the at least one cache block in the cache space in the direction indicated by the backward cursor in the at least one cache block starting from the target cache block, the method further comprises: in a case where fault information stored in a first cache block in the cache space is updated, updating a forward cursor of the first cache block to point to the preset cache block and updating a backward cursor of the first cache block to point to the target cache block, the first cache block being a cache block other than the target cache block in the cache space; updating the backward cursor of the preset cache block to point to the first cache block and updating a forward cursor of the target cache block to point to the first cache block.
5. The method of claim 4, wherein, Before the updating of the forward cursor of the first cache block to point to the preset cache block and the updating of the backward cursor of the first cache block to point to the target cache block, the method further comprises: determining a second cache block pointed to by the forward cursor and a third cache block pointed to by the backward cursor of the first cache block; updating a backward cursor of the second cache block to point to the third cache block and updating a forward cursor of the third cache block to point to the second cache block.
6. The method of claim 3, wherein, After reading the fault information stored in the at least one cache block in the direction indicated by the backward cursor in the at least one cache block in the cache space starting from the target cache block, the method further comprises: In the case of storing the fault information in the fourth cache block which is idle in the cache space, pointing the forward cursor of the fourth cache block to the preset cache block and pointing the backward cursor of the fourth cache block to the target cache block; Updating the backward cursor of the preset cache block to point to the fourth cache block and updating the forward cursor of the target cache block to point to the fourth cache block.
7. The method of claim 2, wherein, The determination of the cache block pointed to by the cursor pointer of the preset cache block as the target cache block comprises: Determining the cache block pointed to by the forward cursor of the preset cache block as the target cache block; The reading of the fault information stored in the at least one cache block in the direction indicated by the cursor pointer in the at least one cache block in the cache space starting from the target cache block comprises: Reading the fault information stored in the at least one cache block in the direction indicated by the forward cursor in the at least one cache block in the cache space starting from the target cache block.
8. A failure information reading device characterized by comprising: Comprise: An instruction receiving module configured to receive a fault information reading instruction; A target determining module configured to determine, in response to the fault information reading instruction, a target cache block pointed to by a target pointer in a cache space, wherein the target pointer is configured to point to a cache block in which target fault information is stored in the cache space, and the target fault information is corresponding to a latest fault occurred in the cache space; An information reading module configured to read, starting from the target cache block, fault information stored in at least one cache block in the cache space in a direction indicated by a cursor pointer in the at least one cache block, wherein the direction indicated by the cursor pointer is opposite to a fault occurrence order corresponding to the fault information stored in the at least one cache block.
9. An electronic device, comprising: The electronic device comprises a processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the steps of the fault information reading method according to any one of claims 1-7.
10. A vehicle characterized by comprising: Comprise at least one of: The fault information reading apparatus according to claim 8; The electronic device according to claim 9.
Citation Information
Patent Citations
Oplogging for online recovery in direct connection client server systems
CN101133397A
Information recommendation method, device and apparatus
CN110647685A