Vehicle control instruction processing method, device, equipment and medium
By using a combination of index arrays and doubly linked lists in the new energy vehicle body control system, the problems of low command processing efficiency and slow response speed are solved, efficient and fast command processing and load capacity improvement are achieved, and the stability of the system is ensured. and logical correctness.
Patent Information
- Application Number
- CN202411002034.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology has low instruction processing efficiency and slow response speed in handling new energy vehicle body control systems, making it difficult to meet high load requirements, and the data structure lacks scalability and maintainability.
The structure of an index array combined with a doubly linked list is used to assign a unique index to each instruction through the index array, and instructions are processed in the doubly linked list to achieve rapid addition, deletion and priority judgment, ensuring efficient and fast instruction response and processing.
It improves the processing efficiency and response speed of the body controller, enhances the load capacity of the system, ensures the correctness and stability of the logic, and optimizes the driving experience.
Smart Images

Figure CN118535226A
Abstract
Description
Technical Field
[0001] The present application relates to the field of automotive electronic technology, and more specifically, to a vehicle control instruction processing method, device, equipment and medium. Background Art
[0002] With the rapid development of automobile technology and the improvement of intelligence, the software applications in body control systems have become increasingly complex. As the hub for coordinating various functional components of the vehicle, the body controller needs to efficiently process data from different sensors and execute various control commands. In the field of body control, the logical processing and judgment of complex commands has become a core challenge, especially in the field of new energy, where command interactions are more frequent and the challenges are more arduous.
[0003] Traditional instruction processing solutions, such as queue mechanisms based on arrays or simple linked lists, often face problems such as low processing efficiency and slow response speed when processing frequent and diverse instruction requests. This can no longer meet the urgent needs of new energy vehicle body control systems for efficient and fast response to instructions.
[0004] The instruction processing solutions in the prior art have significant limitations. First, whether it is an array, stack or queue, its fixed storage structure is difficult to adapt to the rapid changes in the number and type of instructions. The expansion operation not only increases the complexity and cost of the system, but may also affect the real-time and accuracy of instruction processing. Secondly, the existing data structures are unable to handle instructions of different priorities, and the complex algorithms developed based on these structures face the problems of high complexity and difficult maintenance. In addition, these solutions are often closely related to specific application scenarios, lack sufficient scalability and maintainability, and are difficult to adapt to the changing needs of different vehicle models and control systems.
[0005] Specifically, low processing efficiency and slow response speed are the two major pain points of the existing technology. The array-based instruction queue needs to shift elements when deleting or inserting instructions, which leads to a decrease in processing speed; and although the linked list-based queue has faster insertion and deletion operations, it is necessary to traverse the linked list when querying instructions, which also affects efficiency. In the body control system of new energy vehicles, these problems directly affect the response speed and driving experience of the vehicle. At the same time, the limited system load capacity is also an issue that cannot be ignored. The number of instructions in the body control system of new energy vehicles is large and diverse, which puts higher requirements on the system load capacity. The existing technology is limited by the characteristics of its data structure and it is difficult to meet such high load requirements.
[0006] In summary, the instruction processing scheme in the prior art has some problems in the application of new energy vehicle body controller. Therefore, in view of the efficient and fast instruction processing requirements of the new energy vehicle body control system, it is urgent to develop a new instruction processing scheme to solve the limitations of the existing technology and improve the system's processing efficiency, response speed and load capacity. In order to solve these problems, a new instruction processing scheme is needed, and for this purpose, we have invented a new vehicle control instruction processing method. Summary of the invention
[0007] The purpose of this application is to provide a vehicle control command processing method, device, equipment and medium, which can solve at least one of the technical problems mentioned above. The specific solution is as follows: According to a specific implementation of the present application, in a first aspect, the present application provides a vehicle control instruction processing method, including: An index array is created for one or more instructions to be executed by the vehicle; wherein the index array is composed of array elements, and each array element stores a first instruction, an index of a previous instruction of the first instruction, and an index of a subsequent instruction of the first instruction; the index is a unique identifier of the array element where the instruction is located in the index array; wherein different first instructions have different indexes, and different array elements store different first instructions; the one or more instructions are processed in the form of a bidirectional linked list, wherein, for each array element of the index array, the stored first instruction is used as a node instruction of a linked list node, the index of the stored previous instruction is used as a pointer to a predecessor node pointer of the linked list node, and the index of the stored subsequent instruction is used as a pointer to a successor node pointer of the linked list node.
[0008] According to a specific implementation of the present application, in a second aspect, the present application provides a vehicle control instruction processing device, including: A generation unit is used to create an index array for one or more instructions to be executed by the vehicle; wherein the index array is composed of array elements, each of which stores a first instruction, an index of a previous instruction of the first instruction, and an index of a subsequent instruction of the first instruction; the index is a unique identifier of the array element where the instruction is located in the index array; wherein different first instructions have different indexes, and different array elements store different first instructions; a processing unit is used to process the one or more instructions in the form of a bidirectional linked list, wherein, for each array element of the index array, the stored first instruction is used as a node instruction of a linked list node, the index of the stored previous instruction is used as a pointer to a predecessor node pointer of the linked list node, and the index of the stored subsequent instruction is used as a pointer to a successor node pointer of the linked list node.
[0009] According to a specific implementation of the present application, in a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement any one of the methods described in the first aspect.
[0010] According to the specific implementation of the present application, in a fourth aspect, the present application provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the method described in any one of the first aspects.
[0011] Compared with the prior art, the above solution of the embodiment of the present application has at least the following beneficial effects: This application is modified and upgraded based on the index array so that the index array has the structural function of a bidirectional linked list, so that the overall processing logic has the advantages of both the index array and the linked list, achieving efficient and fast command response and processing, while ensuring the correctness of the logic, improving the performance and reliability of the body controller, and meeting the requirements of the automobile body control system for command processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 A flow chart of a vehicle control instruction processing method according to an embodiment of the present application is shown; Figure 2 A flow chart of a method for deleting instructions according to an embodiment of the present application is shown; Figure 3 An array structure schematic diagram of the present application is exemplarily shown; Figure 4 A flow chart of a method for querying and deleting instructions according to an embodiment of the present application is shown; Figure 5 A flow chart of a method for instruction insertion according to an embodiment of the present application is shown; Figure 6 A flow chart of a method for determining an instruction insertion position based on instruction priority according to an embodiment of the present application is shown; Figure 7 A schematic diagram of command processing for wiper control according to the present application is shown; Figure 8 Shows a unit block diagram of a vehicle control instruction processing device according to an embodiment of the present application; Fig. 9 The present invention is a block diagram of an electronic device for vehicle control command processing according to an exemplary embodiment. DETAILED DESCRIPTION
[0013] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0014] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.
[0015] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0016] It should be understood that although the terms first, second, third, etc. may be used to describe in the embodiments of the present application, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions. For example, without departing from the scope of the embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0017] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0018] It should also be noted that the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the commodity or device including the elements.
[0019] It should be particularly noted that any symbols and / or numbers in the specification that are not marked in the accompanying drawings are not drawing marks.
[0020] With the rapid development of automobile technology and the improvement of intelligence, software applications in body control systems have become increasingly complex. As the hub for coordinating the various functional components of the vehicle, the body controller needs to efficiently process data from different sensors and execute a variety of control instructions. In the field of body control, the logical processing and judgment of complex instructions has become a core challenge. Traditional instruction processing solutions, such as queue mechanisms based on arrays or simple linked lists, often face problems such as low processing efficiency and slow response speed when processing frequent and diverse instruction requests. This can no longer meet the urgent needs of automobile body control systems for efficient and fast response to instructions. The instruction processing solutions in the prior art have significant limitations. Specifically, low processing efficiency and slow response speed are the two major pain points of the prior art.
[0021] In one solution of the related art, an instruction queue based on an index array is used to process instructions. However, this solution requires element shifting when deleting or inserting instructions, which has the problem of slow processing speed.
[0022] In another solution of the related technology, a linked list-based instruction queue is used to process instructions. Although this solution is faster when inserting and deleting instructions, it needs to traverse the linked list when querying instructions, which also affects efficiency.
[0023] In automobile body control systems, the above problems directly affect the vehicle's response speed and driving experience.
[0024] At the same time, the limited system load capacity is also an issue that cannot be ignored. The number of instructions in the automobile body control system is huge and diverse, which puts higher requirements on the system load capacity. The existing technology is limited by the characteristics of its data structure. On the basis of low processing efficiency for a single instruction, it is difficult to meet the high load requirements in the face of the huge amount of instruction processing in the automobile body control system.
[0025] Therefore, in response to the demand for efficient and fast command processing in automobile body control systems, it is urgent to develop new command processing solutions to address the limitations of existing technologies and improve the system's processing efficiency, response speed and load capacity.
[0026] In summary, the instruction processing scheme in the prior art has some problems in the application of automobile body controller. In order to solve these problems, a new instruction processing scheme is needed, which can combine the advantages of arrays and linked lists to achieve efficient and fast instruction response and processing, while ensuring the correctness of logic. The instruction fast response and processing system proposed in this application, which combines arrays and linked lists, is designed to address these problems, aiming to improve the performance and reliability of the body controller and meet the requirements of the automobile body control system for instruction processing. The optional embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0027] The embodiment provided in this application is an embodiment of a vehicle control instruction processing method.
[0028] Combine the following Figure 1 The embodiments of the present application are described in detail.
[0029] Figure 1 A flow chart of a vehicle control instruction processing method according to an embodiment of the present application is shown. Figure 1 As shown, the process includes the following steps S101 and S102.
[0030] In step S101 , an index array is created for one or more instructions to be executed by the vehicle.
[0031] The index array is composed of array elements, and each array element stores an index of a previous instruction of a first instruction, an index of a subsequent instruction of the first instruction, and the first instruction.
[0032] The first instruction is any instruction among one or more instructions, different array elements store different first instructions, and different first instructions have different indexes. The index is a unique identifier of the array element where the instruction is located in the index array.
[0033] In this application, the index array is used after initialization, wherein the array initialization includes assigning a unique index to each vehicle control instruction and constructing the index array.
[0034] In step S102, one or more instructions are processed in a doubly linked list format.
[0035] Among them, for each array element of the index array, the stored first instruction is used as the node instruction of the linked list node, the index of the stored previous instruction is used as the pointer of the predecessor node pointer of the linked list node, and the index of the stored subsequent instruction is used as the pointer of the successor node pointer of the linked list node.
[0036] The bidirectional linked list is composed of linked list nodes, each of which contains instruction data, a predecessor node pointer and a successor node pointer. The instruction data contained in the node is obtained based on the first instruction stored in the array element, and is used to indicate information such as instruction type, parameters, priority, etc.
[0037] The bidirectional linked list is used after initialization. The bidirectional linked list initialization includes creating a head node Head as the starting point of the instruction set, and using the indicator pointer Cur to point to the currently executed instruction node. If no instruction is executed, the indicator pointer Cur points to the head node Head.
[0038] The method provided in the present application can be used for instruction processing and execution of a vehicle body control system. By constructing a dynamically updated index array, efficient management, sorting, selection and execution of instructions can be achieved.
[0039] In the present application, the first instruction is any instruction among one or more instructions, different first instructions have different indexes, and different array elements store different first instructions.
[0040] For example, each array element is identified by the index of the first instruction stored. For example, the first instructions include A1, A2, and A3, the index of the first instruction A1 is M1, the index of the first instruction A2 is M2, and the index of the first instruction A2 is M2, and the array element storing the first instruction A1 is Y1, the array element storing the first instruction A2 is Y2, and the array element storing the first instruction A3 is Y3. On this basis, the array element Y1 is identified by the index M1, the array element Y2 is identified by the index M2, and the array element Y3 is identified by the index M3.
[0041] In this application, in the early stage of index array construction, that is, for the situation that there is no instruction in the instruction queue, an empty node will be created at the first element position of the array as the head node. Whenever the system responds to the need to add a new instruction in the instruction queue, the corresponding position in the array is found according to the subscript (i.e., the index of the first instruction mentioned in the embodiment described in this application) to store the instruction. Assuming that the instruction is the first instruction in one or more instructions in the instruction queue, the value of the head node needs to be updated to the index value of the new request instruction every time a new instruction comes. After the instruction is stored in the new node, the value of the successor node pointer next of the head node is assigned to the index of the new instruction, and the predecessor node pointer pre of the new instruction points to the index of the head node. In addition, since the instruction is the only instruction currently in the instruction queue, the value of the successor node pointer next of the new instruction is assigned to 0, that is, empty. So far, the mutual indication between the new node and the head node is completed. On this basis, an indication pointer Cur is also required to point to the currently executed instruction as the feedback value of the current state. When the indication pointer Cur points to the new node, the system starts to execute the new instruction.
[0042] The index array of the present application has the form of a doubly linked list. When instructions already exist in the index array, if the system response requires adding new instructions therein, then for new nodes that are not added at the head or end of the chain, the value of the predecessor node pointer pre is assigned to the index value of the previous node, and the value of the successor node pointer next is assigned to the index value of the next node, and neither is empty.
[0043] The index array of the present application specifies the position of each instruction in the array by creating an index index for each instruction. Each array element is represented by a linked list node structure, which can store an instruction, the index of the previous instruction of the instruction, and the index of the next instruction of the instruction.
[0044] In the field of automobile body control, especially in the field of new energy vehicles, with the continuous development of technology and the improvement of intelligence, the body control system needs to process frequent instructions from multiple devices, which puts higher requirements on the stability, response speed and instruction management capabilities of the system. In view of the shortcomings of the prior art, the technical solution of this application proposes a fast instruction response and processing system that combines the advantages of index arrays and bidirectional linked lists, aiming to solve the problem of body controller instruction processing in scenarios with multiple instructions and frequent requests. The application of this technical solution will bring the following significant beneficial effects: combining the advantages of bidirectional linked lists and arrays, it realizes the rapid addition, deletion and priority judgment operations of instructions. The instructions are sorted by the priority field to ensure the priority processing of high-priority instructions. The processing efficiency and response speed of the body controller in complex situations and frequent multi-instruction request scenarios are improved.
[0045] The technical solution of this application significantly improves the efficiency and performance of instruction processing in the body control system of new energy vehicles by combining the advantages of bidirectional linked lists and arrays. The bidirectional linked list structure allows the rapid addition and deletion of instructions without complex element shift operations, thereby maintaining an efficient processing speed. At the same time, the array implementation ensures the ability to quickly query instructions according to the index, further enhancing the flexibility and accuracy of instruction processing. The response time of the instruction is shortened, the real-time performance of the body control system is improved, and the driving experience is optimized. In the face of a large number of frequent instruction requests, the system can maintain stable performance and effectively enhance the load capacity of the system. Through accurate priority judgment and logical processing mechanisms, high-priority instructions are ensured to be processed first, avoiding logical errors caused by improper instruction processing order. At the same time, the structure of the bidirectional linked list ensures the reliability of the priority order, avoids potential logical problems, and ensures the stable operation of the system. In terms of implementation, this technical solution implements the linked list through an array, optimizes the instruction processing flow, reduces the software-level overhead, and improves the overall efficiency of the system.
[0046] This application provides detailed explanations of the execution logic of instruction deletion, query, and addition below.
[0047] For example, in the present application, instruction processing is performed in the form of a bidirectional linked list, including instruction deletion in the form of a bidirectional linked list.
[0048] Figure 2 A flow chart of a method for deleting instructions according to an embodiment of the present application is shown. Figure 2As shown, the process includes the following steps S201 to S203.
[0049] In step S201, in response to a request to delete a target instruction triggered by the vehicle, a target array element storing the target instruction is searched for in each array element of the index array.
[0050] The target instruction is an instruction that is taken as a deletion object among one or more instructions, and the target array element is used to store the target instruction.
[0051] In step S202, a first array element and a second array element that respectively indicate the target array element are determined.
[0052] Among them, the target array element and the first array element index each other, and the target array element and the second array element index each other.
[0053] In step S203, the indexes stored in the first array element and the second array element are updated respectively, and the index stored in the target array element is deleted, so that the first array element and the second array element indicate each other based on the updated indexes.
[0054] For example, Figure 3 For example, in the array element with index 1, the index of the array element where the previous instruction is located is 0, and the index of the array element where the next instruction is located is 3. Therefore, the "array element with index 0" and the "array element with index 1" can be considered to indicate each other, and the "array element with index 3" and the "array element with index 1" can also be considered to indicate each other.
[0055] In this application, the processing logic of the index array and the bidirectional linked list for deleting instructions is as follows.
[0056] In the present application, when deleting instructions, the time required to traverse the instructions in the bidirectional linked list can be saved to increase the speed. The node position can be directly located according to the characteristics of the array based on the index of the set target instruction, the node composed of the target array elements can be deleted, and the two nodes adjacent to the node can be interconnected to restore the structure of the bidirectional linked list.
[0057] In one implementation, when the target instruction is not the currently executed instruction, it is necessary to determine whether the index value of the head node Head is the index of the target instruction, and perform corresponding processing according to the determination result.
[0058] If so, it means that the target instruction to be deleted is currently in a single-head connection state. The target instruction can be deleted directly, and the indicator pointer Cur points to the previous instruction of the target instruction without clearing the data. The structure of the bidirectional linked list can ensure that the position will not be read. When the next instruction arrives, the data at this position will be overwritten by the new instruction.
[0059] If not, it means that the target instruction to be deleted is currently in a double-headed connection state. The corresponding position can be directly located according to the index of the target instruction, and the position can be removed from the bidirectional linked list through an auxiliary variable, that is, the index of the target array element stored in the embodiment is deleted. At the same time, the two nodes before and after the node are connected to each other, that is, the index of the first array element and the second array element stored in each other is updated as mentioned in the embodiment, so that the first array element and the second array element indicate each other based on the updated index. On this basis, for the node where the target instruction is located, the previous node adjacent to it points to the next node adjacent to it, and the action of deleting the instruction is completed in sequence.
[0060] In another embodiment, when the target instruction is the currently executed instruction, it means that the target instruction to be deleted is currently in a single-head connection state. The instruction can be directly indexed and deleted by the index value of the node where the pointer Cur is located, that is, it can be deleted at the end of the linked list.
[0061] In this application, when the instruction is executed or needs to be overwritten by a new instruction, the system deletes the instruction node from the array. For example, the instruction deletion logic of the bidirectional linked list is as follows.
[0062] (1) Traverse the linked list and find the instruction node that needs to be deleted.
[0063] (2) Modify the pointers of the node’s predecessor and successor nodes to restore the linked list structure.
[0064] (3) Release the memory space occupied by the node.
[0065] (4) If the node to be deleted is the currently executed instruction node (i.e. the node pointed to by the indicator pointer Cur), the indicator pointer Cur will point to the previous node (if the linked list is empty, it will point to the Head node).
[0066] In the present application, the query for the instruction can be directly queried by using the index identified by each array element in the index array.
[0067] Figure 4 A flow chart of a method for querying and deleting instructions according to an embodiment of the present application is shown. Figure 4 As shown, the process includes the following steps S301 to S303.
[0068] In step S301, in response to the vehicle being triggered to delete a target instruction in one or more instructions, a unique identifier of an array element storing the target instruction is searched to obtain a target array element.
[0069] The target instruction is an instruction that is taken as a deletion object among one or more instructions, and the target array element is used to store the target instruction.
[0070] In step S302, based on the index stored in the target array element, the first array element and the second array element are searched and obtained.
[0071] Among them, the target array element and the first array element index each other, and the target array element and the second array element index each other.
[0072] In step S303, the indexes stored in the first array element and the second array element are updated respectively, and the index stored in the target array element is deleted, so that the first array element and the second array element indicate each other based on the updated indexes.
[0073] For example, in the present application, instruction processing is performed in the form of a bidirectional linked list, including instruction insertion in the form of a bidirectional linked list.
[0074] Figure 5 A flow chart of a method for inserting instructions according to an embodiment of the present application is shown. Figure 5 As shown, the process includes the following steps S401 to S403.
[0075] In step S401 , in response to a request for inserting a second instruction triggered by a vehicle, adjacent instructions of the second instruction are determined.
[0076] The second instruction refers to a newly added instruction to be inserted, and the adjacent instructions of the second instruction include a previous instruction adjacent to the second instruction and a subsequent instruction adjacent to the second instruction.
[0077] In step S402, the index of the second instruction is determined.
[0078] In step S403, a third array element identified by the index of the second instruction is determined, and the index of the adjacent instruction and the second instruction are stored in the third array element.
[0079] In the present application, instruction insertion relies on the advantages of a bidirectional linked list. When the insertion position is determined, instruction insertion is completed according to the linked list structure by storing the instruction to be inserted and the index of the adjacent instructions in the array elements. This process does not require the displacement of the array elements, thereby ensuring the efficiency of the instruction insertion operation.
[0080] For example, two instructions being adjacent means that in an instruction queue consisting of multiple instructions, the two instructions are arranged adjacently, which does not mean that the array elements where the two instructions are located are necessarily adjacent. For example, two adjacent instructions may be that the two array elements where the two instructions are located are adjacent, or the two array elements where the two instructions are located are not adjacent.
[0081] For example, Figure 3 For example, in the array element with index 1, the instruction is "ADS request", and the index of the next instruction stored therein is 3, which means that from the perspective of instruction sorting, the instruction "manual request" and the instruction "ADS request" are adjacent instructions. At the same time, array element [1] and array element [3] are separated by array element [2], indicating that the array elements where these two adjacent instructions are located are not adjacent. In the present application, the second instruction and each first instruction have a preset priority, and the multiple instructions to be executed are sorted based on the preset priority.
[0082] For example, the adjacent instructions of the second instruction are determined based on a preset priority. For example, before inserting the second instruction, the first instructions and the second instructions are sorted according to the priority relationship between them, and then the insertion position of the second instruction in one or more instructions is determined. Further, the adjacent instructions can be determined according to the insertion position.
[0083] The present application exemplifies an implementation of determining the insertion position of the second instruction in one or more instructions. In the example, the preset priority of the first instruction is stored in the corresponding array element.
[0084] Figure 6 A flow chart of a method for determining an instruction insertion position based on instruction priority according to an embodiment of the present application is shown. Figure 6 As shown, the process includes the following steps S501 to S503.
[0085] In step S501, for a currently executed instruction among one or more instructions, a first preset priority stored in an array element where the currently executed instruction is located is obtained, and a second preset priority configured for a second instruction is determined.
[0086] In step S502, the first preset priority is compared with the second preset priority.
[0087] In step S503a, if the first preset priority is higher than or equal to the second preset priority, the insertion position of the second instruction in the one or more instructions is determined according to the priority ranking between the second instruction and other instructions in the one or more instructions.
[0088] In step S503b, if the first preset priority is lower than the second preset priority, the position of the currently executed instruction in the one or more instructions is used as the insertion position of the target instruction in the one or more instructions.
[0089] In this application, for instructions with different priorities, this application makes a judgment when adding a new instruction. If the priority of the new instruction is higher than the priority of the currently executed instruction, it is directly added to the end of the linked list and the indicator pointer Cur is updated, the new instruction with higher priority is executed, and the currently executed instruction is interrupted.
[0090] If the priority of the new instruction is lower than the priority of the currently executed instruction, the instruction can be directly discarded according to the needs, or the instruction can be stored and executed after all instructions with higher priority than itself are executed. Of course, the specific implementation method can be implemented according to the structure of the linked list, and this application does not limit this.
[0091] In this application, high-priority instructions in the linked list are placed at the end of the linked list. This method ensures that the priority of the linked list is not strictly increasing. If the priority of the new instruction is lower than the instruction being executed, then according to the characteristics of the bidirectional linked list, the linked list is traversed from back to front, and the priority of the new instruction is compared with that of the instructions stored in each traversed linked list. If it is greater than or equal, the instruction is inserted at this position.
[0092] In the present application, the index of the second instruction is determined, for example, by determining the index of the second instruction in the indexes respectively identified by the fourth array element and / or the fifth array element.
[0093] Among them, the fourth array element is an array element storing a null value, that is, an unused array element.
[0094] The fifth array element is the array element whose stored index is deleted, that is, the target array element deleted by the executed instruction in the previous instruction processing.
[0095] For example, the fifth array element can have two forms. One is that all the contents stored in the array element are deleted, that is, the stored first instruction, the index of the previous instruction, and the index of the next instruction are deleted at the same time. The other is that among the contents stored in the array element, only the index is deleted and the instruction data is retained, that is, the index of the previous instruction and the index of the next instruction are deleted, and the stored first instruction is retained.
[0096] In the case where only the stored index of the fifth array element is deleted and the instruction data is still retained, in one implementation, the index of the adjacent instruction and the second instruction can be stored in the third array element by data overwriting.
[0097] In the present application, the first command that has been listed or the second command that is to be listed includes a vehicle control command for setting or switching a wiper mode. In one implementation, the second command includes a vehicle control command for setting or switching a wiper mode.
[0098] For example, Figure 7 As shown, the present application takes the vehicle control command of the wiper as an example to describe the process of command processing.
[0099] When the system starts, based on the initialization of the index array, the initialization of the bidirectional linked list represented by the index array is realized, and the wiper control state is initialized at the same time. In the index array, each array element is constructed in the form of a linked list node. For example, the first instruction stored in the array element can be used as the node instruction of the linked list node, the index of the previous instruction stored can be used as the pointer of the predecessor node pointer of the linked list node, and the index of the next instruction stored can be used as the pointer of the successor node pointer of the linked list node. When each element of the prime group is constructed, it is equivalent to creating a new linked list node in the bidirectional linked list. On this basis, a jump can be made according to the index of the next instruction stored in the array element, so that the index array can traverse the linked list in the form of a bidirectional linked list to find the next instruction node to be executed. Set the head node Head and the indicator pointer Cur to ensure that the system is in a ready state. For instruction insertion: when an instruction representing the wiper A mode is received, a node containing the A mode instruction is created and added to the end of the bidirectional linked list. Update the indicator pointer Cur to point to the newly added node. Subsequently, when control requests for modes B, C, D, etc. are received, they are sorted from the head of the chain to the end in order of priority from low to high, and processed in the same way. For instruction execution, the system executes the corresponding instruction according to the node pointed to by the indicator pointer Cur. For example, when the indicator pointer Cur points to the A mode node, the system controls the wiper to work in A mode. When the A mode is executed, the system traverses the linked list to find the next instruction node to be executed (ie, the B mode node) and updates the indicator pointer Cur. And so on, until all instructions are executed. For instruction deletion, when the response time of a mode ends or needs to be closed, the system finds the node of the mode and deletes it from the bidirectional linked list. If the instruction node currently being executed (ie, the node pointed to by the indicator pointer Cur) is deleted, the indicator pointer Cur is updated after deletion to point to the previous node in the linked list.
[0100] Figure 3 An exemplary schematic diagram of an array structure of the present application is shown as above. Figure 3As shown, the array reflects the structure of a bidirectional linked list, which can quickly insert and delete arrays according to pre-set indexes, and can also use the characteristics of arrays to locate through indexes, which not only avoids the problem that array deletion request instructions need to be shifted in the array, but also solves the problem that linked list search instructions need to be traversed. The solution in the form of an array combined with a linked list is more suitable for a variety of scenarios, including but not limited to various multi-instruction logical judgments in body applications. For example, assuming that the ADS request instruction is received first, the instruction is placed at the position of array index 1 according to the pre-set index 1, and the head node points to the instruction to establish a bidirectional linked list structure. When the second instruction comes, it is directly compared with the priority of the current node of the indicator pointer Cur. If the manual request priority is higher than ADS or the same priority, it is placed behind the ADS request instruction, and Cur points to the instruction and executes it. If the priority of the new instruction is low, search for positions less than or equal to the current instruction priority from back to front, and insert it behind the instruction less than or equal to the current instruction.
[0101] Specifically, the technical solution of the present application includes: constructing an instruction set in the form of a doubly linked list, and realizing fast insertion and deletion of instructions through the head node and the currently executed instruction node. Based on the doubly linked list, an array is used to assign a unique index to each instruction to realize fast query of the instruction. A priority field is added to the instruction node structure to sort and process the instructions according to the priority.
[0102] The body controller instruction rapid response and processing system described in this application realizes the rapid addition, deletion and priority judgment operations of instructions by combining the bidirectional linked list and array implementation method, and sorts the instructions in the array in the form of a linked list through the priority field, ensuring the priority processing of high-priority instructions. At the same time, the use of arrays to implement bidirectional linked lists is more friendly to the model development work of vehicle control, and can be directly implemented through a state machine, which is simpler and more efficient. The system has broad application prospects and important practical value in the field of new energy vehicle body control.
[0103] This solution can respond to instructions quickly while also being able to handle a large number of instructions. It can quickly delete instructions, and in extreme cases where a large number of requests occur frequently, it can quickly insert and delete without the need for array shifting, which increases software efficiency and effectively reduces the load increase caused by shifting each time a value is deleted.
[0104] The core technical point of the new energy vehicle body control system instruction processing solution proposed in this application is to realize an efficient and accurate instruction processing mechanism by combining the advantages of a bidirectional linked list and an array, which is particularly suitable for the multi-instruction and high-frequency processing requirements in the new energy vehicle body control system.
[0105] This application uses a bidirectional linked list as the basic structure for instruction storage. Each node contains instruction data, priority information, and pointers to predecessor and successor nodes, allowing the system to quickly locate, add, delete, and traverse nodes. At the same time, combined with the advantages of arrays, by creating an index for each instruction, the instructions are stored in the array in the form of linked list nodes, realizing index-based fast query capabilities. The design of this data structure not only retains the characteristics of fast linked list deletion and unlimited capacity, but also has the advantages of fast array query, significantly improving the efficiency of instruction processing.
[0106] Priority determination is a crucial part of instruction processing. This application adds a priority state to the node structure to implement the function of sorting instructions according to priority. When a new instruction arrives, the system compares its priority with the priority of the currently executed instruction to decide whether to respond to the instruction. This design ensures that high-priority instructions are processed first, further improving the accuracy and efficiency of instruction processing.
[0107] By setting up the head node and the currently executed instruction pointer, this application realizes the rapid addition and deletion of instructions. New instructions can be easily inserted after the currently executed instruction according to the rules of the bidirectional linked list without the need for complex element shifting. At the same time, by traversing the linked list, the system can quickly find and delete the executed or overwritten instructions, thereby restoring the linked list structure. This design not only improves the speed of instruction processing, but also ensures the correctness of the logic.
[0108] Due to the use of an array-based two-way linked list instruction processing solution, this system can quickly locate and process instructions when processing a large number of instruction requests, effectively improving the system's load capacity. This design enables the system to maintain an efficient and stable operating state when facing a complex and changing environment.
[0109] In summary, the core technical point of this application is to combine a bidirectional linked list with an array to build an efficient and flexible instruction processing solution. Through key technical points such as intelligent priority processing mechanism, fast instruction addition and deletion, and high load capacity, this application provides strong technical support for the design and application of new energy vehicle body control systems. By adopting a fast instruction response and processing system based on a bidirectional linked list and its array, the instruction processing efficiency is effectively improved, the instruction response time is shortened, the system load capacity is enhanced, the logical correctness is ensured, and the software level performance is improved. These beneficial effects will bring revolutionary changes to the design and application of new energy vehicle body control systems and promote the further development of new energy vehicle technology.
[0110] This application is constructed by referring to the storage methods of bidirectional linked lists and arrays. First of all, the form of linked lists has certain difficulties for the development of the current vehicle control domain. The current mainstream development method relies on Simulink modeling, which implements logic based on state machines, and linked lists are difficult to apply to modeling. Therefore, combining the characteristics of arrays and linked lists is a solution that must be considered. The storage solution of the array method requires the operation of shifting all the subsequent data forward after deleting the middle data, which will consume computing time and resources. There may be no problem when there are fewer system instructions, but if the number of instructions increases or in extreme cases, the load will increase. The characteristics of linked lists are fast deletion, no shift operation is required, and the capacity size is not limited, but the query speed will be slower; the characteristics of arrays are that they can be queried according to the index, but the deletion requires a shift operation, and the capacity size is limited. Combining the characteristics of these two data structures, we can also use a bidirectional linked list implemented by an array to construct this solution. This method has certain limitations on capacity, but has the advantages of search speed, no shift operation, and fast deletion.
[0111] The present application also provides an apparatus embodiment that is consistent with the embodiment, and is used to implement the method steps described in the above embodiment. The explanation based on the same name meaning is the same as the above embodiment, and has the same technical effect as the above embodiment, and will not be repeated here.
[0112] like Figure 8 As shown, the present application provides a vehicle control instruction processing device 800, comprising: The generation unit 801 is used to create an index array for one or more instructions to be executed by the vehicle. The index array is composed of array elements, and each array element stores a first instruction, an index of a previous instruction of the first instruction, and an index of a subsequent instruction of the first instruction. The first instruction is any instruction among one or more instructions, and different first instructions have different indexes, and different array elements store different first instructions. The processing unit 802 is used to, for each array element of the index array, use the stored first instruction as the node instruction of the linked list node, use the index of the stored previous instruction as the pointer of the predecessor node of the linked list node, use the index of the stored subsequent instruction as the pointer of the successor node pointer of the linked list node, and process the instructions in the form of a bidirectional linked list.
[0113] In one embodiment, the instruction processing includes instruction deletion. The processing unit 802 performs instruction processing in the form of a bidirectional linked list in the following manner: in response to the vehicle being triggered to delete a target instruction in one or more instructions, a target array element storing the target instruction is searched in each array element of the index array. A first array element and a second array element that indicate each other with the target array element are determined. The indexes stored in the first array element and the second array element are updated, and the index stored in the target array element is deleted, so that the first array element and the second array element indicate each other based on the updated index.
[0114] In one embodiment, the instruction processing includes instruction deletion. The processing unit 802 searches for a target array element storing a target instruction in each array element of the index array in the following manner: searching for an array element with an index of the target instruction to obtain the target array element. The processing unit 802 determines a first array element and a second array element that are respectively indicative of the target array element in the following manner: searching for the first array element and the second array element based on the index stored in the target array element.
[0115] In one embodiment, instruction processing includes instruction deletion. Instruction processing includes instruction insertion. The processing unit 802 performs instruction processing in a bidirectional linked list format in the following manner: inserting a second instruction into one or more instructions in response to the vehicle being triggered, determining an insertion position of the second instruction in the one or more instructions, and determining adjacent instructions of the second instruction based on the insertion position. Determine an index of the second instruction. Determine a third array element identified by the index of the second instruction, and store the index of the adjacent instruction and the second instruction in the third array element.
[0116] In one embodiment, instruction processing includes instruction deletion. Each array element also stores a preset priority of the stored first instruction. The processing unit 802 determines the insertion position of the second instruction in one or more instructions in the following manner: for the currently executed instruction in one or more instructions, obtain the first preset priority stored in the array element where the currently executed instruction is located, and determine the second preset priority configured for the second instruction. Compare the first preset priority with the second preset priority. If the first preset priority is higher than or equal to the second preset priority, determine the insertion position of the second instruction in the one or more instructions based on the priority ranking between the second instruction and other instructions in the one or more instructions. If the first preset priority is lower than the second preset priority, the position of the currently executed instruction in the one or more instructions is used as the insertion position of the second instruction in the one or more instructions.
[0117] In one embodiment, instruction processing includes instruction deletion. The processing unit 802 determines the index of the second instruction in the following manner: determine the index of the second instruction in the indexes respectively identified by the fourth array element and / or the fifth array element. The fourth array element is an array element storing a null value, and the fifth array element is an array element whose stored index is deleted. The processing unit 802 is also used for: in response to determining the index of the second instruction in the indexes respectively identified by the fourth array element, before storing the indexes of the adjacent instructions and the second instruction in the third array element, clearing the data stored in the third array element.
[0118] In one embodiment, the second instruction includes a vehicle control instruction for setting or switching a wiper mode.
[0119] Fig. 9 1 is a block diagram of an electronic device 900 for vehicle control command processing according to an exemplary embodiment. In some embodiments of the present application, the electronic device for vehicle control command processing is a vehicle body controller.
[0120] like Fig. 9 As shown, one embodiment of the present application provides an electronic device 900. The electronic device 900 includes a memory 901, a processor 902, and an I / O interface 903. The memory 901 is used to store instructions. The processor 902 is used to call the instructions stored in the memory 901 to execute the vehicle control instruction processing method of the embodiment of the present application. The processor 902 is connected to the memory 901 and the I / O interface 903, respectively, for example, through a bus system and / or other forms of connection mechanisms (not shown). The memory 901 can be used to store programs and data, including the program of the vehicle control instruction processing method involved in the embodiment of the present application. The processor 902 executes various functional applications and data processing of the electronic device 900 by running the program stored in the memory 901.
[0121] In the embodiment of the present application, the processor 902 can be implemented in at least one hardware form of a digital signal processor (Digital Signal Processing, DSP), a field programmable gate array (Field Programmable Gate Array, FPGA), and a programmable logic array (Programmable Logic Array, PLA). The processor 902 can be a central processing unit (Central Processing Unit, CPU) or one or a combination of other forms of processing units with data processing capabilities and / or instruction execution capabilities.
[0122] The memory 901 in the embodiment of the present application may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD), etc.
[0123] In the embodiment of the present application, the I / O interface 903 may be used to receive input instructions (such as digital or character information, and key signal input related to user settings and function control of the electronic device 900), and may also output various information to the outside (such as images or sounds). In the embodiment of the present application, the I / O interface 903 may include one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a mouse, a joystick, a trackball, a microphone, a speaker, and a touch panel.
[0124] In some embodiments, the present application provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, any of the methods described above is performed.
[0125] Regarding the device in the embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0126] Although operations are described in a particular order in the drawings, this should not be understood as requiring that the operations be performed in the particular order shown or in serial order, or that all shown operations be performed to achieve desired results. In certain circumstances, multitasking and parallel processing may be advantageous.
[0127] The methods and devices of the present application can be implemented using standard programming techniques, using rule-based logic or other logic to implement various method steps. It should also be noted that the words "device" and "module" used herein and in the claims are intended to include implementations using one or more lines of software code and / or hardware implementations and / or devices for receiving input.
[0128] Any steps, operations or procedures described herein may be performed or implemented using one or more hardware or software modules, either alone or in combination with other devices. In one embodiment, the software module is implemented using a computer program product including a computer-readable medium containing computer program code, which can be executed by a computer processor to perform any or all of the described steps, operations or procedures.
[0129] The foregoing description of the implementation of the present application has been given for the purpose of illustration and description. The foregoing description is not exhaustive nor is it intended to limit the present application to the exact form disclosed, and various variations and modifications may exist according to the teachings described, or may be obtained from the practice of the present application. These embodiments are selected and described in order to illustrate the principles of the present application and its practical application, so that those skilled in the art can utilize the present application in various embodiments and various modifications suitable for the specific use contemplated.
[0130] Regarding the device in the embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0131] It can be further understood that, unless otherwise specified, “connection” includes a direct connection without other components between the two, and also includes an indirect connection with other components between the two.
[0132] It is further understood that, although the operations are described in a specific order in the drawings in the embodiments of the present application, it should not be understood as requiring the operations to be performed in the specific order or serial order shown, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.
[0133] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to encompass any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the field of the present application that are not disclosed in the present application. The specification and embodiments are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following scope of rights.
[0134] It should be understood that the present application is not limited to the precise structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the scope of the appended claims.
[0135] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A vehicle control instruction processing method, characterized in that: The steps include: For one or more instructions to be executed by the vehicle, an index array is created; wherein the index array is composed of array elements, each of which stores a first instruction, an index of an instruction preceding the first instruction, and an index of an instruction following the first instruction; the index is a unique identifier of the array element where the instruction is located in the index array; Wherein, different first instructions have different indexes, and different array elements store different first instructions; The one or more instructions are processed in the form of a bidirectional linked list, wherein, for each array element of the index array, the stored first instruction is used as the node instruction of the linked list node, the index of the stored previous instruction is used as the pointer of the predecessor node pointer of the linked list node, and the index of the stored subsequent instruction is used as the pointer of the successor node pointer of the linked list node.
2. The method according to claim 1, characterized in that The processing of the one or more instructions in a bidirectional linked list form includes: In response to a request for deleting a target instruction triggered by the vehicle, searching for a target array element storing the target instruction in each array element of the index array; Determine a first array element and a second array element that respectively indicate the target array element; The indexes stored in the first array element and the second array element are updated respectively, and the index stored in the target array element is deleted, so that the first array element and the second array element indicate each other based on the updated indexes.
3. The method according to claim 2, characterized in that The step of searching, among the array elements of the index array, the target array element storing the target instruction comprises: Searching for the unique identifier of the array element storing the target instruction to obtain the target array element; The determining of the first array element and the second array element respectively indicating the target array element comprises: Based on the index where the target array element is stored, the first array element and the second array element are searched and obtained.
4. The method according to claim 1, characterized in that: The processing of the one or more instructions in a bidirectional linked list form includes: In response to a request for inserting a second instruction triggered by the vehicle, determining an adjacent instruction of the second instruction; determining an index of the second instruction; A third array element identified by the index of the second instruction is determined, and the index of the adjacent instruction and the second instruction are stored in the third array element.
5. The method according to claim 4, characterized in that The instruction has a preset priority, a plurality of instructions to be executed are sorted based on the preset priority, and adjacent instructions of the second instruction are determined based on the preset priority.
6. The method according to claim 4, characterized in that The determining the index of the second instruction comprises: The index of the second instruction is determined in the indexes respectively identified by the fourth array element and / or the fifth array element, wherein the fourth array element is an array element storing a null value, and the fifth array element is an array element whose stored index is deleted.
7. The method according to claim 4, characterized in that The second instruction includes a vehicle control instruction for setting or switching a wiper mode.
8. A vehicle control command processing device, characterized in that: include: A generating unit, for creating an index array for one or more instructions to be executed by the vehicle; wherein the index array is composed of array elements, each of which stores a first instruction, an index of an instruction preceding the first instruction, and an index of an instruction following the first instruction; the index is a unique identifier of the array element where the instruction is located in the index array; wherein different first instructions have different indexes, and different array elements store different first instructions; A processing unit is used to process the one or more instructions in the form of a bidirectional linked list, wherein, for each array element of the index array, the stored first instruction is used as the node instruction of the linked list node, the index of the stored previous instruction is used as the pointer of the predecessor node of the linked list node, and the index of the stored subsequent instruction is used as the pointer of the successor node pointer of the linked list node.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method for real time bookbinding and processing navigating point for unmanned aerial vehicle
CN101251385A
Linked list implementing method for quickly searching data
CN101276334A
Multi-waveform envelope extraction method based on chain table array
CN106597049A
Memory management method, device and equipment and storage medium
CN111352863A
Data storage structure, use method, storage method and related equipment
CN114064983A
Cited By
Data relationship storage method, device and system and readable storage medium
CN119248793A
