A multi-tree vehicle business logic analysis method based on abstract components
By adopting a multi-tree vehicle business logic analysis method based on abstract components in the vehicle expert system, the problems in the existing technology of business logic calculations not being supported across vehicles, high coupling, and poor flexibility are solved, and low coupling and high flexibility are achieved. Scalable and flexible business logic calculation and fault diagnosis.
Patent Information
- Application Number
- CN202111646305.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In the prior art In the vehicle expert system, business logic computing has problems such as cross-vehicle computing not being supported, complex analysis frameworks are highly coupled with business, lack of flexibility and difficulty in modifying.
The business logic analysis method based on the abstract component is based on the abstract modular interface design to realize the separation of the analysis framework and the analysis case, and use the binary tree and the multi -fork tree structure to perform business logic calculation and fault diagnosis and positioning.
It achieves low coupling of business logic, high scalability, and convenient engineering configuration. It can support cross-vehicle calculations and complex analysis, and improves the flexibility and real-time performance of the system.
Smart Images

Figure CN114491162B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a train signal control system, and in particular to a multi-tree vehicle business logic analysis method based on abstract components. Background Art
[0002] With the advent of the era of unmanned subway, the vehicle expert system plays an important role as a component of the signal system. The vehicle expert system is a vehicle monitoring system based on CS or BS architecture, consisting of a front-end communication server, application server and workstation, and mainly collects and monitors the vehicle's traction, braking, auxiliary, door, fire protection and other systems.
[0003] The data that vehicle experts need to monitor mainly comes from three sources. The first two parts come from the vehicle or signal system itself and are collected through network transmission. The third part is based on the data from the first and second parts, and is calculated or analyzed, output and displayed according to the vehicle-specific business logic to generate an alarm.
[0004] Regarding the third part, the more common practices in the past are as follows:
[0005] The first type is that the business logic calculation is completed by the vehicle's lower computer TCMS, which then communicates with the upper computer and pushes the results. This solution has advantages such as high real-time performance and can reduce the workload of the upper computer, but it also has disadvantages such as only being able to calculate the logic of the vehicle itself, not supporting cross-vehicle calculations; not supporting complex analysis and special business analysis; and requiring support from vehicle manufacturers.
[0006] The second method is to develop an independent program for the host computer software. The simple logic calculation data part is completed by configuration, and the logic part is customized by software; complex logic is customized by software. This solution has good solution independence, and the configuration of simple logic can meet the needs of most simple calculations; however, it also has disadvantages such as the high degree of coupling between the complex calculation framework and the business, lack of flexibility, and inconvenient modification of analysis logic.
[0007] The third type is that the logic calculation is completed by the host computer based on a general script. Scripts such as Lua, VB, and Python. This solution has the advantages of making the business logic modifiable and funded based on the general script solution, and isolating the business from the framework. However, it also has the disadvantages of being too flexible, difficult to standardize management, having a large number of vehicle points, and a large number of analysis cases. When the number of scripts is large, the script interpretation process has a certain impact on the real-time calculation.
[0008] Therefore, how to combine the advantages of the above three solutions while avoiding the corresponding disadvantages is a technical problem that needs to be solved. Summary of the invention
[0009] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a multi-tree vehicle business logic analysis method based on abstract components.
[0010] The purpose of the present invention can be achieved by the following technical solutions:
[0011] According to the first aspect of the present invention, 1. a multi-branch tree vehicle business logic analysis method based on abstract components is provided. The method first realizes the separation of analysis framework and analysis cases through abstract modular interface design, so that cases and cases, cases and analysis frameworks are uncoupled and isolated from each other, which is convenient for adding, deleting and modifying analysis logic; then, the vehicle business logic calculation and vehicle fault diagnosis and positioning are realized through the designed binary tree and multi-branch tree.
[0012] As a preferred technical solution, the method specifically comprises the following steps:
[0013] Step S1, summarize each analysis case, and classify cases with similar content and business logic into the same type of components, which are called by the main program;
[0014] Step S2, the main program creates a case library instance and obtains the case library handle;
[0015] Step S3: For each case, construct a logical calculation expression as the basis for calculation;
[0016] Step S4, counting the brackets "()" and operation symbols in the expression in step S3;
[0017] Step S5, defining the data structure of the node;
[0018] Step S6, parsing the logical calculation expression to form a binary tree;
[0019] Step S7: If the parsed expression is not a memory point, a constant or an operator, it is still in the form of an expression and further parsing is performed;
[0020] Step S8, traverse from the top node of the binary tree and calculate the result of the expression;
[0021] Step S9: Analyze any form of vehicle failure based on the result of step S8;
[0022] Step S10, calculating the fault trigger expression;
[0023] Step S11, calculating the fault recovery expression.
[0024] As a preferred technical solution, the abstract interface between the main program in step S1 and each case library includes:
[0025] 101) Initialize the interface;
[0026] 102) calculation execution interface;
[0027] 103) Data subscription interface;
[0028] 104) Register several component interfaces;
[0029] 105) Several event-triggered callback interfaces for case library calls.
[0030] As a preferred technical solution, the step S2 is specifically as follows:
[0031] 201) The case library first calls the initialization interface to complete the initialization of the case library;
[0032] 202) The main program calls the data subscription interface to subscribe to the digital and analog quantities that need to participate in the logic calculation from the shared memory. The first subscription is for sending all data, and the subsequent subscription is for sending changes. After the main program of the analysis framework obtains the data, it is saved in the local memory in the form of KeyValue for subsequent calculation;
[0033] 203) The main program registers common components for use by the case library;
[0034] 204) The main program of the analysis framework periodically calls the calculation execution interface to implement the analysis of business logic.
[0035] As a preferred technical solution, the step S3 is specifically as follows:
[0036] 301) Define the points involved in the calculation, each point corresponds to a point name, and configure the type;
[0037] 302) In the expression, configure it in the form of point plus point number.
[0038] As a preferred technical solution, the step S4 is specifically as follows:
[0039] After scanning the expression, remove the spaces and tap symbols in the expression, count the number of layers of brackets layer-num, the location of the expression where each operator symbol is located, the number of layers of brackets layer-location where the operator is located, and what operator operation is.
[0040] As a preferred technical solution, the nodes in step S5 include three types, the first type is an operator, the second is a constant, and the third is a memory point that needs to participate in the calculation; the pointers of the left subtree and the right subtree of each node and the content of the node are defined.
[0041] As a preferred technical solution, the step S6 is specifically: the parsing expression is parsed from right to left, so that the elements on the right are stored in the upper layer of the binary tree so that the priority is reduced. The specific parsing process is as follows:
[0042] In a recursive way, if the node is only a memory point involved in the calculation, store the point name of the memory point in the node, then assign the left subtree pointer of the node to null, assign the right subtree pointer to null, and then exit the recursion at this level, indicating that the recursion at this level is over;
[0043] If the node is a constant, assign the node type to a constant, store the constant value in the node, assign the left subtree pointer of the node to null, assign the right subtree pointer to null, then exit the recursion at this level, and the recursion at this level ends;
[0044] If the node is just an operator, it means the configuration is wrong, then the expression is marked as illegal and the expression parsing is exited.
[0045] As a preferred technical solution, the step S7 is specifically as follows:
[0046] Starting from the right, traverse the operators that are not in parentheses, that is, the operators with layer-location equal to 0, then find the ones with location equal to 1, then find the ones with location equal to 2, and so on;
[0047] In a single layer-location loop, the operators counted in step S4 are traversed in sequence, also from right to left. In the process, each supported operator is enumerated, and the operator priority is enumerated from low to high. If it meets the requirements, the type of the node is assigned to the operator type, and the operator is assigned to the node. At the same time, the operator is marked as "already found", and then the left side of the operator is regarded as a new expression, and the right side of the operator is also regarded as a new expression. Then, two new binary tree nodes are instantiated as the left subtree and right subtree of the point. After multiple recursive calculations, the parsing expression is parsed and the binary tree is created.
[0048] As a preferred technical solution, the step S8 is specifically as follows:
[0049] 801) If the type of the node is a memory point, and the left subtree and the right subtree are empty, then based on the KeyVale value of step S3, find the corresponding real-time value through the point name stored in the node, that is, the Key value, and then return the value as the calculation result, and exit the recursion of this layer;
[0050] 802) If the type is a constant, and the left and right subtrees are empty, then the constant is returned as the calculation result, and the recursion at this level is also exited;
[0051] 803) If both the left and right subtrees are not empty, and the top node is an operation symbol, then execute step S8 again, and the binary trees recursively traversed are the left subtree and the right subtree of the node respectively, until the traversal calculation is completed;
[0052] 804) Finally, the calculation results of the left and right subtrees of the top node and the symbol of the top node are obtained, and the results are calculated and output.
[0053] As a preferred technical solution, the step S9 is specifically as follows:
[0054] For any form of vehicle failure analysis, there are three parts as follows:
[0055] 901) After a fault occurs, the calculation expression for triggering analysis;
[0056] 902) After the failure is recovered, the calculation expression for triggering the recovery analysis;
[0057] 903) The nodes of the tree trigger and restore calculation expressions. Based on the understanding of the business logic of various vehicle faults, some expressions are configured. Through the logical operation of the memory point, the result changes from false to true to trigger the start and recovery of the fault location analysis.
[0058] As a preferred technical solution, the step S10 is specifically as follows:
[0059] If the result of the calculated fault trigger expression changes from 0 to 1, it means that when the fault signal appears, if the calculated fault trigger expression is always 1 within the set time, it means that the fault is definitely not a disturbance and the fault analysis is triggered; if the expression is calculated to 0 during this period of time, it means that the fault may be a disturbance and the fault analysis is not triggered.
[0060] As a preferred technical solution, the trigger fault analysis is specifically as follows:
[0061] After the fault analysis starts, the traversal starts from the top node. If the number of child nodes is greater than 0, the output expressions of the node are calculated first. If the calculation result is true, it means that the fault meets the requirements of outputting to the child nodes. It is necessary to continue to find the cause of the corresponding child nodes, and then recursively traverse the corresponding child nodes to find the cause;
[0062] If there is no child node, but only the expression to end the search, it means that this node is already the bottom-level child node, that is, the node where the bottom-level cause is located. Then calculate the end expression of the node. If it is 1, it means that the node is the cause of the fault. Then assign 1 to the point where the alarm is triggered by the node, output the alarm, and the cause of the fault is found and located at this node.
[0063] As a preferred technical solution, the step S11 is specifically as follows:
[0064] If the result of the calculated fault recovery expression changes from 0 to 1, it means that when the fault signal is restored, if the calculated fault recovery expression is always 1 within the set time, it means that the fault recovery is not a disturbance, and the fault recovery analysis is triggered; if the expression is calculated to 0 during this period of time, it means that the fault recovery may be a disturbance, and the fault recovery analysis is not triggered.
[0065] As a preferred technical solution, the fault recovery analysis is specifically as follows:
[0066] After the fault recovery analysis starts, the traversal starts from the top node. If the number of child nodes is greater than 0, each output expression of the node is calculated first. If the calculation result is false, it means that the fault recovery meets the requirements of outputting to the child node. It is necessary to confirm whether the corresponding child node has been recovered, and then recursively traverse the corresponding child nodes for confirmation and search;
[0067] If there is no child node and only the expression for ending the search, it means that this node is already the bottom-level child node. Then calculate the end expression of the node. If it is 0, it means that the node has been restored. It is necessary to assign 0 to the point where the alarm is triggered by the node so that the alarm is restored, and a closed loop is formed by restoring the fault alarm located at the node.
[0068] According to a second aspect of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and the method described above is implemented when the processor executes the program.
[0069] According to a third aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program implements the method described above when executed by a processor.
[0070] Compared with the prior art, the present invention has the following advantages:
[0071] 1) The present invention is based on the understanding of vehicle business logic analysis itself, the implementation of engineering projects by vehicle experts, the analysis and integration of the advantages and disadvantages of the above-mentioned existing solutions, and a comprehensive consideration of development costs to arrive at a solution. Therefore, the present invention has the advantages of clear module architecture, low coupling of business logic, high scalability, and convenient engineering configuration.
[0072] 2) The present invention adopts componentization, and different case libraries implement different analysis logics. Case libraries can be increased, reduced, and modified. Case libraries are isolated from each other and do not affect each other. They are uniformly scheduled by the analysis framework. The framework only needs to configure the case library name to calculate which cases, which reduces the engineering workload and improves the efficiency of deployment.
[0073] 3) The present invention is based on a basic calculation expression calculation engine of a binary tree and a shared memory, and has the advantages of arbitrary basic four arithmetic mixed operations and configurable calculations.
[0074] 4) The vehicle fault location based on the multi-branch tree of the present invention can be analyzed based on different vehicle fault case scenarios using the same case library component, thereby realizing the generalization of vehicle fault location analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 It is a specific flow chart of the present invention;
[0076] Figure 2 A flowchart of the calculation expression analysis of the present invention;
[0077] Figure 3 This is a flow chart for diagnosing the cause of a fault when it is triggered. DETAILED DESCRIPTION
[0078] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0079] The present invention implements a multi-tree vehicle business logic analysis method based on abstract components. First, the scheme realizes the separation of the analysis framework and the analysis case through the abstract modular interface design, so that there is no coupling and mutual isolation between cases and cases and analysis frameworks, which is convenient for adding, deleting and modifying the analysis logic. At the same time, in the case analysis, a business analysis method based on binary trees and multi-trees is designed to realize the vehicle business logic calculation and vehicle fault diagnosis and positioning. The present invention is a solution based on the understanding of vehicle business logic analysis itself, the implementation of engineering projects by vehicle experts, the analysis and integration of the advantages and disadvantages of the above-mentioned existing solutions, and comprehensive consideration of development costs. The solution has the advantages of clear module architecture, low coupling of business logic, high scalability, and convenient engineering configuration.
[0080] like Figure 1 As shown, the multi-tree vehicle business logic analysis method based on abstract components of the present invention specifically includes the following steps:
[0081] Step S1:
[0082] Summarize and summarize each analysis case, and group cases with similar content and business logic into the same type of component, which will be called by the main program. The main program and each case library are summarized as the following abstract interface:
[0083] 1. Initialize the interface;
[0084] 2. Calculation execution interface;
[0085] 3. Data subscription interface;
[0086] 4. Register several component interfaces;
[0087] 5. Several events trigger callback interfaces for case library calls.
[0088] Step S2:
[0089] The main program creates a case library instance and obtains the case library handle. The case library first calls the initialization interface to complete the initialization of the case library, such as the case library reading the configuration file. Then the main program calls the data subscription interface to subscribe to the digital and analog quantities that need to participate in the logical calculation from the shared memory. The first subscription is the full data transmission, and the subsequent subscription is the change transmission. After the analysis framework main program obtains the data, it is saved in the local memory in the form of KeyValue for subsequent calculations. Then the main program registers the public component for use by the case library. The analysis framework main program periodically calls the calculation execution interface to implement the analysis of business logic.
[0090] Step S3:
[0091] For each case, construct a logical calculation expression as the basis for calculation. First, define the points involved in the calculation. Each point corresponds to a point name. For example, point1 corresponds to the specific name of a memory point "XXXX". The specific name here is the Key in step 2. And configure the type, whether it is analog or digital. In the expression, it is also configured in the form of point plus point number.
[0092] Step S4:
[0093] First, count the parentheses "()" and operators in the expression. After scanning the expression, remove the spaces and tap symbols in the expression, and count the number of layers of parentheses layer-num, the location of the expression where each operator is located, the number of layers of parentheses layer-location where the operator is located, and the operator operation.
[0094] Step S5:
[0095] Define the data structure of the node. Each node has three types. The first type is the operator, which is some common four arithmetic operators. The second type is constants, including integers and floating points. The third type is the memory point that needs to be involved in the calculation, which is the point described in step S1. Each point has a corresponding name and type (i.e. analog or digital). Then define the pointers of the left and right subtrees of the node and the content of the node (in different forms according to the three types). Any expression node will only be one of the above three types.
[0096] Step S6:
[0097] Parse the expression to form a binary tree. The expression is parsed from right to left. The purpose of this is to store the elements on the right in the upper layer of the binary tree so that the priority is reduced. Because the calculation for the expression starts from left to right, the priority of the node on the right is lower than that of the node on the left.
[0098] Using a recursive method, if the node is just a memory point involved in the calculation, store the point name of the memory point in the node, then assign the left subtree pointer of the node to null, assign the right subtree pointer to null, and then exit the recursion at this level, indicating that the recursion at this level is over.
[0099] If the node is a constant, assign the node type to a constant, store the constant value in the node, assign the left subtree pointer of the node to null, assign the right subtree pointer to null, then exit the recursion at this level, and the recursion at this level ends.
[0100] If the node is just an operator, it means the configuration is wrong, then the expression is marked as illegal and the expression parsing is exited. Figure 2 , which partially demonstrates the process.
[0101] Step S7:
[0102] If it is not a memory point, a constant, or an operator, it is still in the form of an expression and needs further analysis. First, start from the right and traverse the operators that are not in parentheses, that is, the operators with layer-location equal to 0, then find the ones with location equal to 1, and then find the ones with location equal to 2, and so on.
[0103] In a single layer-location loop, the operators counted in step S4 are traversed in sequence, also from right to left. In the process, each supported operator is enumerated, and the priority of the operators is enumerated from low to high, for example, starting from logical or calculation (||) and ending with multiplication calculation (*). If it meets the requirements, the type of the node is assigned to the operator type, and the operator is assigned to the node. At the same time, the operator is marked as "already found", and the operator at this position will not be processed next time. Then the left side of the operator is regarded as a new expression, and the right side of the operator is also regarded as a new expression, and then two new binary tree nodes are instantiated as the left subtree and right subtree of the point, and then steps S6 and S7 are executed. After multiple recursive calculations, until the parsing expression is parsed, the binary tree is created.
[0104] Step S8:
[0105] Start traversing from the top node of the binary tree and calculate the result of the expression. If the type of the node is a memory point, and the left and right subtrees are empty, then based on the KeyVale value of step S3, find the corresponding real-time value through the point name stored in the node, that is, the Key value, and then return the value as the calculation result, and exit the recursion of this layer. If the type is a constant, and the left and right subtrees are empty, then return the constant as the calculation result, and also exit the recursion of this layer. If both the left and right subtrees are not empty, and the top node is an operation symbol, then execute step S8 again, and the binary trees recursively traversed are the left and right subtrees of the node respectively. Until the traversal calculation is completed. Finally, the calculation results of the left and right subtrees of the top node and the symbol of the top node are obtained, and the results are calculated and output.
[0106] Step S9:
[0107] The above steps implement the parsing and calculation of basic expressions, which serve as the basis for vehicle fault analysis. For any form of vehicle fault analysis, it can be divided into the following three parts: 1. After the fault occurs, the calculation expression that triggers the analysis; 2. After the fault is recovered, the calculation expression that triggers the recovery analysis; 3. The nodes of the tree. The trigger and recovery calculation expressions are configured based on the understanding of the business logic of various vehicle faults. Through the logical operation of the memory point, the result changes from false to true to trigger the start and recovery of the fault location analysis.
[0108] The nodes of the tree represent the causes of the vehicle failure. From top to bottom, the intensity is from coarse to fine. The bottom child node is the root cause, which is the finest and needs to be located at the bottom child node. Each node contains the following attributes: 1. The number of child nodes outputNum, 2. The set of child node numbers, 3. The expression set for locating the child node, which corresponds to the child node number, 4. The expression for ending the search, 5. The name of the alarm trigger;
[0109] Step S10:
[0110] like Figure 3 As shown in the figure, the fault trigger expression is calculated, and the result of the expression changes from 0 to 1. This means that when a fault signal appears, within a certain period of time (configurable), if the calculated fault trigger expression is always 1, it means that the fault is definitely not a disturbance, and the fault analysis is triggered. If the expression is calculated to 0 during this period of time, it means that the fault may be a disturbance, and the fault analysis is not triggered.
[0111] After the fault analysis begins, the traversal starts from the top node. If the number of child nodes is greater than 0, first calculate each output expression of the node. If the calculation result is true, it means that the fault meets the requirements of outputting to the child node, and it is necessary to continue to find the cause of the corresponding child node, and then recursively traverse the corresponding child node to find the cause. If there is no child node, only the expression of the end search, it means that this node is already the bottom-level child node, that is, the node where the bottom-level cause is located, and then calculate the end expression of the node. If it is 1, it means that the node is the cause of the fault, and then assign 1 to the point where the node triggers the alarm, and the alarm is output. The cause of the fault is found and located at this node.
[0112] Step S11:
[0113] Calculate the fault recovery expression and the result of the expression changes from 0 to 1, which means that when the fault signal is restored, within a certain period of time (configurable), if the calculated fault recovery expression is always 1, it means that the fault recovery is not a disturbance, and the fault recovery analysis is triggered. If the expression is calculated to 0 during this period of time, it means that the fault recovery may be a disturbance, and the fault recovery analysis is not triggered.
[0114] After the fault recovery analysis starts, the traversal starts from the top node. If the number of child nodes is greater than 0, first calculate each output expression of the node. If the calculation result is false, it means that the fault recovery meets the requirements of outputting to the child node. It is necessary to confirm whether the corresponding child node has been restored, and then recursively traverse the corresponding child node for confirmation search. If there is no child node, only the expression of ending the search, it means that this node is already the bottom-level child node. Then calculate the ending expression of the node. If it is 0, it means that the node has been restored. It is necessary to assign 0 to the point where the node triggers the alarm so that the alarm is restored, and form a closed loop from restoring the fault alarm located at the node.
[0115] The above is an introduction to a method embodiment. The following further illustrates the solution of the present invention through an electronic device and a storage medium embodiment.
[0116] The electronic device of the present invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0117] Multiple components in the device are connected to the I / O interface, including: input units, such as keyboards, mice, etc.; output units, such as various types of displays, speakers, etc.; storage units, such as disks, optical disks, etc.; and communication units, such as network cards, modems, wireless communication transceivers, etc. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunication networks.
[0118] The processing unit performs the various methods and processes described above, such as methods S1 to S12. For example, in some embodiments, methods S1 to S12 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into the RAM and executed by the CPU, one or more steps of methods S1 to S12 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute methods S1 to S12 in any other appropriate manner (e.g., by means of firmware).
[0119] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0120] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0121] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0122] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A multi-tree vehicle business logic analysis method based on abstract components, characterized in that: The method firstly realizes the separation of analysis framework and analysis cases through abstract modular interface design, so that cases and cases and analysis framework are uncoupled and isolated from each other, which is convenient for adding, deleting and modifying analysis logic; then, the vehicle business logic calculation and vehicle fault diagnosis and location are realized through the designed binary tree and multi-tree; The method specifically comprises the following steps: Step S1, summarize each analysis case, and classify cases with similar content and business logic into the same type of components, which are called by the main program; Step S2, the main program creates a case library instance and obtains the case library handle; Step S3: For each case, construct a logical calculation expression as the basis for calculation; Step S4, counting the brackets "()" and operation symbols in the expression in step S3; Step S5, defining the data structure of the node; Step S6, parsing the logical calculation expression to form a binary tree; Step S7: If the parsed expression is not a memory point, a constant or an operator, it is still in the form of an expression and further parsing is performed; Step S8, traverse from the top node of the binary tree and calculate the result of the expression; Step S9: Analyze any form of vehicle failure based on the result of step S8; Step S10, calculating the fault trigger expression; Step S11, calculating the fault recovery expression; The step S10 is specifically as follows: If the result of the fault trigger expression changes from 0 to 1, it means that when the fault signal appears, if the fault trigger expression is always 1 within the set time, it means that the fault is definitely not a disturbance, and the fault analysis is triggered; if the expression is calculated to 0 during this period of time, it means that the fault may be a disturbance, and the fault analysis is not triggered; The trigger fault analysis is specifically as follows: After the fault analysis starts, the traversal starts from the top node. If the number of child nodes is greater than 0, the output expressions of the node are calculated first. If the calculation result is true, it means that the fault meets the requirements of outputting to the child nodes. It is necessary to continue to find the cause of the corresponding child nodes, and then recursively traverse the corresponding child nodes to find the cause; If there is no child node, but only the expression for ending the search, it means that this node is already the child node at the bottom level, that is, the node where the bottom-level cause is located. Then calculate the end expression of this node. If it is 1, it means that this node is the cause of the fault. Then assign 1 to the point where the alarm is triggered by this node, output the alarm, and the cause of the fault is found and located at this node. The step S11 is specifically as follows: If the result of the fault recovery expression changes from 0 to 1, it means that when the fault signal is restored, if the calculated fault recovery expression is always 1 within the set time, it means that the fault recovery is not a disturbance, and the fault recovery analysis is triggered; if the expression is calculated to 0 during this period of time, it means that the fault recovery may be a disturbance, and the fault recovery analysis is not triggered; The fault recovery analysis is specifically as follows: After the fault recovery analysis starts, the traversal starts from the top node. If the number of child nodes is greater than 0, each output expression of the node is calculated first. If the calculation result is false, it means that the fault recovery meets the requirements of outputting to the child node. It is necessary to confirm whether the corresponding child node has been recovered, and then recursively traverse the corresponding child nodes for confirmation and search; If there is no child node and only the expression for ending the search, it means that this node is already the bottom-level child node. Then calculate the end expression of the node. If it is 0, it means that the node has been restored. It is necessary to assign 0 to the point where the alarm is triggered by the node so that the alarm is restored, and a closed loop is formed by restoring the fault alarm located at the node.
2. The multi-tree vehicle business logic analysis method based on abstract components according to claim 1 is characterized in that: The abstract interface between the main program in step S1 and each case library includes: 101) Initialize the interface; 102) calculation execution interface; 103) Data subscription interface; 104) Register several component interfaces; 105) Several event-triggered callback interfaces for case library calls.
3. The multi-tree vehicle business logic analysis method based on abstract components according to claim 2 is characterized in that: The step S2 is specifically as follows: 201) The case library first calls the initialization interface to complete the initialization of the case library; 202) The main program calls the data subscription interface to subscribe to the digital and analog quantities that need to participate in the logic calculation from the shared memory. The first subscription is for sending all data, and the subsequent subscription is for sending changes. After the main program of the analysis framework obtains the data, it is saved in the local memory in the form of KeyValue for subsequent calculation; 203) The main program registers common components for use by the case library; 204) The main program of the analysis framework periodically calls the calculation execution interface to implement the analysis of business logic.
4. The multi-tree vehicle business logic analysis method based on abstract components according to claim 1 is characterized in that: The step S3 is specifically as follows: 301) Define the points involved in the calculation, each point corresponds to a point name, and configure the type; 302) In the expression, configure it in the form of point plus point number.
5. The multi-tree vehicle business logic analysis method based on abstract components according to claim 1 is characterized in that: The step S4 is specifically as follows: After scanning the expression, remove the spaces and tap symbols in the expression, count the number of layers of brackets layer-num, the location of the expression where each operator symbol is located, the number of layers of brackets layer-location where the operator is located, and what operator operation is.
6. The multi-tree vehicle business logic analysis method based on abstract components according to claim 1 is characterized in that: The nodes in step S5 include three types, the first type is an operator, the second type is a constant, and the third type is a memory point that needs to participate in the calculation; the pointers of the left subtree and the right subtree of each node and the content of the node are defined.
7. The multi-tree vehicle business logic analysis method based on abstract components according to claim 1 is characterized in that: The step S6 is specifically as follows: the parsing expression is parsed from right to left, so that the elements on the right are stored in the upper layer of the binary tree so that the priority is reduced. The specific parsing process is as follows: In a recursive way, if the node is only a memory point involved in the calculation, store the point name of the memory point in the node, then assign the left subtree pointer of the node to null, assign the right subtree pointer to null, and then exit the recursion at this level, indicating that the recursion at this level is over; If the node is a constant, assign the node type to a constant, store the constant value in the node, assign the left subtree pointer of the node to null, assign the right subtree pointer to null, then exit the recursion at this level, and the recursion at this level ends; If the node is just an operator, it means the configuration is wrong, then the expression is marked as illegal and the expression parsing is exited.
8. The multi-tree vehicle business logic analysis method based on abstract components according to claim 5 is characterized in that: The step S7 is specifically as follows: Starting from the right, traverse the operators that are not in parentheses, that is, the operators with layer-location equal to 0, then find the ones with location equal to 1, then find the ones with location equal to 2, and so on; In a single layer-location loop, the operators counted in step S4 are traversed in sequence, also from right to left. In the process, each supported operator is enumerated, and the operator priority is enumerated from low to high. If it meets the requirements, the type of the node is assigned to the operator type, and the operator is assigned to the node. At the same time, the operator is marked as "already found", and then the left side of the operator is regarded as a new expression, and the right side of the operator is also regarded as a new expression. Then, two new binary tree nodes are instantiated as the left subtree and right subtree of the point. After multiple recursive calculations, the parsing expression is parsed and the binary tree is created.
9. The multi-tree vehicle business logic analysis method based on abstract components according to claim 3 is characterized in that: The step S8 is specifically as follows: 801) If the type of the node is a memory point, and the left subtree and the right subtree are empty, then based on the KeyValue value, find the corresponding real-time value through the point name stored in the node, that is, the Key value, and then return the value as the calculation result, and exit the recursion of this layer; 802) If the type is a constant, and the left and right subtrees are empty, then the constant is returned as the calculation result, and the recursion at this level is also exited; 803) If both the left and right subtrees are not empty, and the top node is an operation symbol, then execute step S8 again, and the binary trees recursively traversed are the left subtree and the right subtree of the node respectively, until the traversal calculation is completed; 804) Finally, the calculation results of the left and right subtrees of the top node and the symbol of the top node are obtained, and the results are calculated and output.
10. The multi-tree vehicle business logic analysis method based on abstract components according to claim 1 is characterized in that: The step S9 is specifically as follows: For any form of vehicle failure analysis, there are three parts as follows: 901) After a fault occurs, the calculation expression for triggering analysis; 902) After the failure is recovered, the calculation expression for triggering the recovery analysis; 903) The nodes of the tree trigger and restore calculation expressions. Based on the understanding of the business logic of various vehicle faults, some expressions are configured. Through the logical operation of the memory point, the result changes from false to true to trigger the start and recovery of the fault location analysis.
11. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 10 is implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Train operation plan adjusting method and system based on charging station fault
CN113592256A
Implementing scalable memory allocation using identifiers that return a succinct pointer representation
US20200065012A1