Vehicle control command execution method, device, electronic device and storage medium
By constructing and managing the corresponding levels of each business scenario of the vehicle, the problem of inefficient execution of vehicle control commands in the existing technology is solved, and the rapid and flexible execution of vehicle control commands is achieved, which improves the user experience.
Patent Information
- Application Number
- CN202410378948.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-03-29
AI Technical Summary
The execution efficiency of vehicle control instructions in the prior art is low, and it is difficult to effectively organize and manage the detailed and repetitive logic of the client, resulting in maintenance difficulties and low execution efficiency.
By constructing the corresponding levels of each business scenario of the vehicle and saving them in the hierarchical memory, each business scenario corresponds to a vehicle control instruction. After receiving the vehicle control instruction, determine its corresponding business scenario, obtain the level of the business scenario, and determine the target nodes and their execution order from the level, and execute each node in the determined order to complete the execution of the vehicle control instruction.
It realizes the execution steps of quickly calling vehicle control instructions, and flexibly manages and combines the execution steps of different vehicle control instructions, which improves execution efficiency, reduces resource usage, and improves user experience.
Smart Images

Figure CN118611879B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle control technology, and in particular to a vehicle control instruction execution method, device, electronic equipment and storage medium. Background Art
[0002] In the development of vehicle control business logic, the client involves a lot of fragmented and repetitive logic. For client applications or server development, how to effectively organize these logics to make them efficient and reusable modules while maintaining their flexibility and maintainability is a challenging task.
[0003] In related technologies, there are mainly the following processing methods when organizing these logics:
[0004] 1) These logics are not divided into modules, and the specific logic is handled in a specific implementation manner. Although this processing method is easy to implement, it is full of repeated and similar code segments. If modifications are required, multiple places must be modified, which is difficult to maintain and prone to errors.
[0005] 2) Selectively abstract some common logic. However, due to the differences in page or business logic, different logics are scattered throughout the project in a fragmented and disordered state, with a high repetition rate and similarity. The disadvantages are the same as above, making maintenance difficult and prone to errors.
[0006] 3) Using some ideas of design pattern class inheritance, common logic and different logic fragments are unified and integrated. The first disadvantage of this implementation method is excessive encapsulation, which makes it difficult for people to understand, because it requires certain design skills to make people think about a streamlined execution logic process and understand it as objects one by one. When reading, it also requires certain comprehension skills. The second disadvantage is that it is not flexible enough. If combination or inheritance is used to shield differences, the readability will drop significantly after there are too many subclasses (i.e., combined functions), and the efficiency of use will even be lower than the first and second methods. Summary of the invention
[0007] In view of this, the embodiments of the present application provide a vehicle control command execution method, device, electronic device and storage medium to solve the problem of low vehicle control command execution efficiency in the prior art.
[0008] According to a first aspect of an embodiment of the present application, a vehicle control instruction execution method is provided, comprising:
[0009] Construct a hierarchy corresponding to each vehicle business scenario, and save the constructed hierarchy in a hierarchy memory, where each business scenario corresponds to a vehicle control instruction;
[0010] In response to receiving the vehicle control command, determining a business scenario corresponding to the vehicle control command;
[0011] Obtain the level corresponding to the business scenario from the level memory. The level consists of N nodes, which are distributed in a heap manner. Each node corresponds to one or more vehicle control instruction execution steps, and N is a positive integer greater than 1.
[0012] Determine K target nodes corresponding to the business scenario from N nodes, and the execution order of the K target nodes, where K is a positive integer less than or equal to N;
[0013] Execute the K target nodes in the determined execution order.
[0014] A second aspect of an embodiment of the present application provides a vehicle control instruction execution device, including:
[0015] A construction module is configured to construct a hierarchy corresponding to each business scenario of the vehicle and store the constructed hierarchy in a hierarchy memory, wherein each business scenario corresponds to a vehicle control instruction;
[0016] A determination module, configured to determine a business scenario corresponding to the vehicle control instruction in response to receiving the vehicle control instruction;
[0017] An acquisition module is configured to acquire a hierarchy corresponding to a business scenario from a hierarchy memory, where the hierarchy consists of N nodes, and the N nodes are distributed in a heap manner, each node corresponds to one or more vehicle control instruction execution steps, and N is a positive integer greater than 1;
[0018] The determination module is further configured to determine K target nodes corresponding to the business scenario from the N nodes, and an execution order of the K target nodes, where K is a positive integer less than or equal to N;
[0019] The execution module is configured to execute the K target nodes according to a determined execution order.
[0020] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0021] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0022] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the embodiments of the present application pre-construct and save the hierarchy corresponding to each business scenario. When receiving a vehicle control instruction, the business scenario corresponding to the vehicle control instruction is first determined, and then the hierarchy of the business scenario is obtained, and the nodes and node execution order corresponding to the business scenario and the vehicle control instruction execution steps are determined from the hierarchy. Finally, each node is executed according to the determined execution order to complete the execution of the vehicle control instruction. This method can quickly call each execution step of the vehicle control instruction, and the execution step combination of different vehicle control instructions is distributed in a heap in the hierarchy. Calling and modification are flexible and convenient. Under the premise of meeting the execution speed of the vehicle control instruction, it can minimize resource usage and improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 It is a flow chart of a vehicle control instruction execution method provided in an embodiment of the present application.
[0025] Figure 2 It is a schematic diagram of the execution steps of three business scenarios included in the login function module provided in the embodiment of the present application.
[0026] Figure 3 It is a schematic diagram of a method for constructing a simple combination hierarchy for a login module provided in an embodiment of the present application.
[0027] Figure 4 It is a flow chart of a method for constructing a composite hierarchy corresponding to various vehicle business scenarios provided in an embodiment of the present application.
[0028] Figure 5 It is a schematic diagram of a method for constructing a composite hierarchy for a login module provided in an embodiment of the present application.
[0029] Figure 6 It is a flowchart of another method for constructing a composite hierarchy corresponding to various vehicle business scenarios provided in an embodiment of the present application.
[0030] Figure 7 It is a schematic diagram of a method for constructing a composite hierarchy for a remote control module provided in an embodiment of the present application.
[0031] Figure 8 It is a schematic diagram of a method for merging similar levels into sub-levels provided in an embodiment of the present application.
[0032] Fig. 9 It is a flowchart of a method for determining K target nodes corresponding to a business scenario from N nodes provided in an embodiment of the present application.
[0033] Fig.10 It is a flow chart of a vehicle control instruction execution method provided in an embodiment of the present application.
[0034] Fig.11 It is a flow chart of another vehicle control instruction execution method provided in an embodiment of the present application.
[0035] Fig.12 It is a schematic diagram of a vehicle control instruction execution device provided in an embodiment of the present application.
[0036] Fig.13 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0038] A vehicle control instruction execution method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0039] As mentioned above, in the development of vehicle control business logic, the client involves a lot of fragmented and repetitive logic. For client applications or server development, how to effectively organize these logics to make them efficient and reusable modules while maintaining their flexibility and maintainability is a challenging task.
[0040] For example, in a business scenario where the server gives the status of all vehicle control buttons of a vehicle through an interface, all vehicle control buttons given by the server may include the current open / closed status of the car locks, the current open / closed status of the car windows, and the current open / closed status of the air conditioner, etc. At this time, the client will batch update the status of all local vehicle control buttons. However, when Bluetooth reports the status of one or several vehicle control buttons, the client will update the status of all local vehicle control buttons individually. This update logic can be abstracted as: A: update logic of car locks; B: update logic of car windows; C: update logic of air conditioners; ...
[0041] For logics such as A, B, C, D, E and F, depending on the business scenario, they can be the following combinations: execute A, B, C, D, E, F... in series; execute A alone; execute D, E, F... in parallel; execute A, C, D, or execute B, C, E, etc.
[0042] For example, when the vehicle control page is initialized, three steps need to be executed: pulling server data, creating all vehicle control buttons, and updating the vehicle control button status. When the vehicle control button status is subsequently refreshed, only two steps need to be executed: pulling server data and updating the vehicle control button status. Furthermore, if the vehicle control buttons are customized by the user, it may be necessary to execute the step of pulling server data to determine whether it is necessary to delete all vehicle control buttons or reuse vehicle control buttons, and to execute the steps of deleting all vehicle control buttons, creating all vehicle control buttons, or updating the vehicle control button status.
[0043] These logics can be abstracted as: X: pull server data; Y: delete all car control buttons; Z: create all car control buttons; W: update the car control button status; Alpha: determine whether to delete all car control buttons or reuse car control buttons. For X, Y, Z, W, and Alpha, depending on the business scenario, they can be the following combinations: serial execution of X, W; serial execution of X, Z, W; serial execution of X, Alpha, Y, Z, W, where W can include A, B, C, D, E, F in the previous example.
[0044] For example, the car control, air conditioning, and seat pages on the full car control page and the car control application home page have roughly the same car control control click logic, which can be summarized as: H: respond to click events; I: pass to the logic bus for permission judgment; J: if Bluetooth permission is available, Bluetooth car control is used, and after success or failure, the car control application obtains the result reported by the Bluetooth protocol; K: if Bluetooth permission is not available, remote control is used, and after success or failure, the car control obtains the result from the server; L: the page updates the corresponding status of the button based on the result; M: other pages synchronize the corresponding status of the button. Among them, L and M can include X, Y, Z, and W in the above examples.
[0045] For the similar logic mentioned above, if a car control button is set for each page, the same logic needs to be deployed in the settings corresponding to each page. When the logic changes, the settings of each page need to be modified. If these similar logics are summarized into a common logic, due to the special layout and type of each page, many conditional branches need to be set to distinguish them, resulting in redundant settings that are not conducive to maintenance.
[0046] Furthermore, in the above examples, A, B, C, D, etc. are all relatively large logic modules. In practice, they can also be smaller logic, such as a sentence of code. Therefore, based on the characteristics of cumbersome vehicle control logic and certain similarities among different vehicle control logics, it is urgent to design an efficient vehicle control logic processing solution to be compatible with business needs.
[0047] In view of this, an embodiment of the present application provides a vehicle control instruction execution method that can effectively manage the above logics and flexibly deploy these logics, so that different logics can be freely deployed and combined according to business needs in different scenarios. Among them, for the fragmented difference logic, it does not affect its position under the large logic module, ensuring its business scope, so that for the caller, no matter how the business changes, the code in the business scenario is unified and unchanged, and no modification is required. At the same time, the changes in the business are reflected in the hierarchy or node, which is easy to modify. This method not only maintains the integrity of the node under the large business module, but also performs architectural decoupling. The executor that executes the vehicle control instruction, the storage hierarchy, and the node memory can be independently deployed and updated without affecting each other.
[0048] Furthermore, the embodiment of the present application also provides a method for executing vehicle control instructions. By pre-building and saving the hierarchy corresponding to each business scenario, when receiving a vehicle control instruction, the business scenario corresponding to the vehicle control instruction is first determined, and then the hierarchy of the business scenario is obtained, and the nodes corresponding to the business scenario and the node execution order are determined from the hierarchy, and finally each node is executed according to the determined execution order to complete the execution of the vehicle control instruction. This method can quickly call each execution step of the vehicle control instruction, and the execution step combination of different vehicle control instructions is distributed in a heap manner in the hierarchy. Calling and modification are flexible and convenient. Under the premise of meeting the execution speed of the vehicle control instruction, it can minimize resource usage and improve user experience.
[0049] Figure 1 FIG. 1 is a flow chart of a vehicle control command execution method provided in an embodiment of the present application. Figure 1 As shown, the vehicle control instruction execution method includes the following steps:
[0050] In step S101, a hierarchy corresponding to each vehicle business scenario is constructed, and the constructed hierarchy is stored in a hierarchy memory.
[0051] Among them, each business scenario corresponds to a vehicle control command.
[0052] In step S102, in response to receiving the vehicle control command, a business scenario corresponding to the vehicle control command is determined.
[0053] In step S103, the level corresponding to the business scenario is obtained from the level storage.
[0054] Among them, the level is composed of N nodes, and the N nodes are distributed in a heap manner. Each node corresponds to one or more vehicle control instruction execution steps, and N is a positive integer greater than 1.
[0055] In step S104, K target nodes corresponding to the business scenario and the execution order of the K target nodes are determined from the N nodes.
[0056] Wherein, K is a positive integer less than or equal to N.
[0057] In step S105, K target nodes are executed according to the determined execution order.
[0058] In the embodiment of the present application, the vehicle control command execution method can be executed by a server or by a client. For the convenience of explanation and description, the following description is given by taking the client executing the method as an example.
[0059] In an embodiment of the present application, the hierarchy corresponding to each business scenario of the vehicle can be pre-constructed, and the constructed hierarchy can be saved in a hierarchical memory. Among them, the hierarchical memory can be located in the cloud to form a service for the client to call, or it can be located locally on the server or client to provide services in the form of files, cache or memory for the client to call. Among them, each business scenario corresponds to a vehicle control instruction. Furthermore, each business scenario corresponds to a hierarchy, but each hierarchy can correspond to one or more business scenarios. In other words, each business scenario has its corresponding hierarchy, and the same hierarchy can correspond to the same or different business scenarios. The method of constructing the hierarchy corresponding to each business scenario is described in detail below and will not be repeated here.
[0060] In the embodiment of the present application, when the client receives a vehicle control command issued by a user through a vehicle control application, the application scenario corresponding to the vehicle control command can be determined first. Specifically, the correspondence between the vehicle control command and the application scenario can be stored on the client or in the cloud, and the client determines the application scenario corresponding to the vehicle control command by querying the correspondence. Furthermore, the client can also determine the application scenario corresponding to the vehicle control command in other ways, which are not limited here.
[0061] In an embodiment of the present application, after the client obtains the business scenario corresponding to the vehicle control instruction, it can obtain the level corresponding to the business scenario from the hierarchical memory. Specifically, each business scenario includes a unique business scenario identifier, and the hierarchical memory stores the unique identifier of each business scenario and the level of each business scenario. Among them, each level is composed of N nodes, and the N nodes are distributed in a heap manner, and each node corresponds to one or more vehicle control instruction execution steps. In other words, the level corresponding to the acquired business scenario may include N nodes, each node includes one or more vehicle control instruction execution steps, and different business scenarios can execute the vehicle control instructions corresponding to the business scenario by calling different nodes in the level.
[0062] In the embodiment of the present application, K target nodes corresponding to the business scenario and the execution order of the K target nodes can be determined from the N nodes. As mentioned above, different business scenarios can execute the vehicle control instructions corresponding to the business scenario by calling different nodes in the hierarchy. Therefore, it is necessary to determine the K target nodes required to execute the vehicle control instructions corresponding to the current business scenario from the N nodes contained in the acquired hierarchy, and the execution order of the K target nodes, so that the client can execute the K target nodes based on the acquired execution order, thereby completing the execution of the vehicle control instructions.
[0063] According to the technical solution provided by the embodiment of the present application, by pre-building and saving the hierarchy corresponding to each business scenario, when receiving a vehicle control instruction, first determine the business scenario corresponding to the vehicle control instruction, then obtain the hierarchy of the business scenario, and determine from the hierarchy each node containing the vehicle control instruction execution steps corresponding to the business scenario and the node execution order, and finally execute each node according to the determined execution order to complete the execution of the vehicle control instruction. This method can quickly call each execution step of the vehicle control instruction, and the execution step combination of different vehicle control instructions is distributed in a heap manner in the hierarchy, and the calling and modification are flexible and convenient. It can minimize resource usage and improve user experience while meeting the execution speed of the vehicle control instruction.
[0064] In the embodiment of the present application, the hierarchy can be divided into a simple combination hierarchy and a composite hierarchy, wherein the simple combination hierarchy is a hierarchy used only to execute one business scenario, and the composite hierarchy is a hierarchy that can be used to execute multiple business scenarios.
[0065] For a simple combination level, you can first divide the execution steps of all vehicle control instructions into nodes, and then select the nodes required for each business scenario according to the needs of the business scenario, and combine the nodes in the order of in-order traversal.
[0066] Figure 2 Schematic diagram of the execution steps of three business scenarios included in the login function module provided in the embodiment of the present application. Figure 2As shown, the login function module includes three business scenarios, which are verification code login, user name login and forgotten password login from left to right. Among them, the verification code login business scenario includes the following execution steps: user enters mobile phone number and verification code, verifies input validity, uploads to server and jumps to corresponding page; the user name login business scenario includes the following execution steps: user enters user name, user enters password, verifies input validity, uploads to server and jumps to corresponding page; the forgotten password login business scenario includes the following execution steps: user clicks forget password, user enters user name, user enters mobile phone number and verification code, user enters password, verifies input validity, uploads to server and reports success.
[0067] Figure 3 Schematic diagram of a method for constructing a simple combination hierarchy for a login module provided by an embodiment of the present application. Figure 3 As shown, the reusable execution steps in the above three business scenarios are combined into one node, and the non-reusable execution steps are treated as a single node, and the following can be obtained: Figure 3 The three business scenarios shown correspond to simple combination levels. The three simple combination levels correspond to the verification code login business scenario, the user name login business scenario and the forgotten password login business scenario from left to right.
[0068] Among them, the simple combination level on the far left includes three nodes, namely Node 1: user enters mobile phone number and verification code, Node 2: verify input validity + upload to server and Node 3: jump to the corresponding page. Node 1 is the parent node of Node 2, and Node 2 is the parent node of Node 3.
[0069] The simple combination level in the middle includes four nodes, namely Node 2: Verify input validity + upload to server, Node 3: Jump to corresponding page, Node 4: User enters password and Node 5: User enters username, where Node 5 is the parent node of Node 2 and Node 4, Node 2 and Node 4 are sibling nodes, and since the number of occurrences of Node 4 is less than that of Node 2, Node 4 is arranged on the left side of this layer, and Node 2 is the parent node of Node 3.
[0070] The simple combination hierarchy on the right includes six nodes, namely Node 1: user enters mobile phone number and verification code, Node 2: check input validity + upload to server, Node 3: jump to corresponding page, Node 4: user enters password, Node 5: user enters username, Node 6: user clicks "forgot password" and Node 7: report success, where Node 6 is the parent node of Node 5, Node 5 is the parent node of Node 1, Node 2 and Node 4, Node 1, Node 2 and Node 4 are sibling nodes, and since the number of occurrences of Node 1 is less than that of Node 2 and Node 4, and the number of occurrences of Node 4 is less than that of Node 2, Node 1 is arranged on the left side of this layer, Node 4 is on the right side of Node 1, Node 2 is on the right side of Node 4, and Node 2 is the parent node of Node 7.
[0071] Depend on Figure 3 It can be seen that in the simple combination hierarchy, the nodes are distributed in the way of a heap in a computer data structure, and the execution order of the nodes can be regarded as a large heap (the value of each node is greater than the values of its left and right nodes). Therefore, in order to simplify the hierarchy, you can also extract the following reusable branches from the simple combination hierarchy, and then construct a composite hierarchy.
[0072] Figure 4 1 is a flow chart of a method for constructing a composite hierarchy corresponding to each vehicle business scenario provided by an embodiment of the present application. Figure 4 As shown, the method comprises the following steps:
[0073] In step S401, the associated business scenarios of the target business scenario are obtained.
[0074] Among them, the target business scenario is the current business scenario of the level to be built.
[0075] In step S402, all vehicle control instruction execution steps in the vehicle control instruction corresponding to the target business scenario and all vehicle control instruction execution steps in the vehicle control instruction corresponding to the associated business scenario are obtained.
[0076] In step S403, the vehicle control instruction execution steps in the target business scenario and the associated business scenario are arranged in layers according to the execution order.
[0077] Among them, one execution step in each business scenario corresponds to one layer, and the same execution steps in different business scenarios are arranged in the same layer.
[0078] In step S404, starting from the layer corresponding to the first execution step, the execution steps of each layer are arranged in sequence according to the execution order to obtain the nodes of each layer and the arrangement relationship between the nodes.
[0079] In step S405, the nodes are combined according to the arrangement relationship between the nodes to obtain the hierarchy corresponding to the target business scenario and its associated business scenarios.
[0080] In step S406, all business scenarios of the vehicle are traversed to obtain the levels corresponding to each business scenario of the vehicle.
[0081] In the embodiment of the present application, when constructing a composite hierarchy, the associated business scenario of the target business scenario may be first obtained. The business scenario associated with the target business scenario may be a business scenario that belongs to the same functional module as the target business scenario, or a business scenario whose execution logic is more similar to that of the target business scenario than a preset threshold.
[0082] Next, all vehicle control instruction execution steps in the vehicle control instructions corresponding to the target business scenario and all vehicle control instruction execution steps in the vehicle control instructions corresponding to the associated business scenario can be obtained, and the vehicle control instruction execution steps in the target business scenario and the associated business scenario are arranged in layers according to the execution order. Among them, one execution step in each business scenario corresponds to one layer, and the same execution steps in different business scenarios are arranged in the same layer.
[0083] In an embodiment of the present application, after completing the hierarchical arrangement of each execution step, the execution steps of each layer can be arranged in sequence according to the execution order starting from the layer corresponding to the first execution step to obtain the arrangement relationship between the nodes of each layer and the nodes.
[0084] The first execution step refers to the first step of the execution steps of all business scenarios. For example, if the execution steps are arranged in a hierarchical manner from top to bottom, the first execution step may be the topmost execution step. For another example, if the execution steps are arranged in a hierarchical manner from left to right, the first execution step may be the leftmost execution step.
[0085] Further, the execution steps of each layer are arranged in sequence according to the execution order, and the arrangement relationship between nodes at each level and the nodes can be obtained by determining the execution step corresponding to each layer as the node of the layer. When a specific layer includes multiple nodes, the multiple nodes are arranged from left to right in the order of the number of occurrences in the target business scenario and its associated business scenarios from small to large.
[0086] Then, the nodes can be combined according to the arrangement relationship between the nodes to obtain the hierarchy corresponding to the target business scenario and its associated business scenarios. Finally, all business scenarios of the vehicle are traversed to obtain the hierarchy corresponding to each business scenario of the vehicle.
[0087] Figure 5 Schematic diagram of a method for constructing a composite hierarchy for a login module provided by an embodiment of the present application. Figure 5As shown in the figure on the left, we can first integrate all the execution steps in the three business scenarios included in the login module into one place, and try to arrange the same execution steps at the same level. Then combine them from top to bottom. If there is only one execution step in a layer, add the execution step to the layer as a node in the layer; if there are multiple execution steps in a layer, arrange them from right to left according to the number of occurrences of each execution step, with the most frequent execution steps arranged on the far right and the least frequent execution steps arranged on the far left, so as to obtain the following: Figure 5 The composite hierarchy corresponding to the three business scenarios in the login module is shown in the figure on the right.
[0088] Figure 6 FIG. 1 is a flow chart of another method for constructing a composite hierarchy corresponding to each vehicle business scenario provided by an embodiment of the present application. Figure 6 As shown, the method comprises the following steps:
[0089] In step S601, the associated business scenarios of the target business scenario are obtained.
[0090] Among them, the target business scenario is the current business scenario of the level to be built.
[0091] In step S602, all vehicle control instruction execution steps in the vehicle control instructions corresponding to the target business scenario and all vehicle control instruction execution steps in the vehicle control instructions corresponding to the associated business scenario are obtained.
[0092] In step S603, each group of steps in the target business scenario and its associated business scenarios with the same or similar execution logic is determined as a node, and each independent step in the target business scenario and its associated business scenarios is determined as a node, so as to obtain N nodes.
[0093] In step S604, the parent node information, sibling node information and child node information of each of the N nodes are obtained.
[0094] In step S605, N nodes are arranged based on the parent node information, sibling node information and child node information of each node to obtain a hierarchy corresponding to the target business scenario.
[0095] In step S606, all business scenarios of the vehicle are traversed to obtain the levels corresponding to each business scenario of the vehicle.
[0096] In an embodiment of the present application, when constructing a composite hierarchy, you can first obtain the associated business scenarios of the target business scenarios, and obtain all the vehicle control instruction execution steps in the vehicle control instructions corresponding to the target business scenarios, as well as all the vehicle control instruction execution steps in the vehicle control instructions corresponding to the associated business scenarios.
[0097] In an embodiment of the present application, each group of steps in the target business scenario with the same or similar execution logic as that in the associated business scenario can be determined as a node, and each independent step in the target business scenario can be determined as a node, and N nodes are obtained, wherein each node includes its parent node information, sibling node information, and child node information. In other words, each node includes the following information: whether the node has a parent node, whether the node has a sibling node, and whether the node has a child node. Further, when the node has a parent node, its parent node identifier is also required to determine which node its parent node is. When the node has a sibling node, its sibling node identifier and priority information between the sibling nodes are also required to determine which node or nodes its sibling node is, and how the node and the sibling node should be arranged. When the node has a child node, its child node identifier is also required to determine which node or nodes its child node is.
[0098] It should be noted that the determined N nodes may include or not include repeated nodes. In other words, nodes may be added repeatedly in different branches or not, which can be set according to actual needs.
[0099] In an embodiment of the present application, N nodes are arranged based on the parent node information, sibling node information and child node information of each node to obtain the hierarchy corresponding to the target business scenario. Specifically, you can start with the nodes composed of the same or similar execution logic, establish the hierarchy upwards based on the parent node information, and establish the hierarchy downwards based on the child node information. Furthermore, if the node composed of the same or similar execution logic also includes a sibling node, it is also necessary to determine the arrangement relationship between the node and the sibling node based on its sibling node information. After the arrangement of N nodes is completed, the hierarchy corresponding to the target business scenario can be obtained. Finally, by traversing all the business scenarios of the vehicle, you can get the hierarchy corresponding to each business scenario of the vehicle.
[0100] Figure 7 Schematic diagram of a method for constructing a composite hierarchy for a remote control module provided by an embodiment of the present application. Figure 7As shown in the legend on the left, we can first determine that the target business scenario is the remote control of the air conditioner, and obtain its associated business scenarios, that is, the remote control of other vehicle controls. Among them, the remote control business scenario of the air conditioner includes the following execution steps: determine the type of air conditioner button, respond to click events, pass to the bus, remote control, update button status, and update air conditioner temperature status; the remote control business scenario of other vehicle controls includes the following execution steps: respond to click events, pass to the bus, authority judgment, Bluetooth control, and update button status. When constructing a composite hierarchy, we can first determine that the remote control business scenario of the air conditioner has the same execution steps as the remote control business scenarios of other vehicle controls, that is, respond to click events and pass to the bus. At this time, we can set the response to click events + pass to the bus as a node, and set the other independent execution steps as a node respectively. Finally, we combine and arrange each node according to the parent node information, brother node information, and child node information of each node to obtain Figure 7 The composite hierarchy shown on the right side of the figure. In order to obtain a reasonable hierarchical structure, an empty node can be added as the first node of the hierarchy corresponding to the remote control business scenarios of other vehicle controls, so as to avoid the need to query the nodes in the hierarchy corresponding to the remote control business scenario of the air conditioner when executing the vehicle control instructions corresponding to the remote control business scenarios of other vehicle controls.
[0101] In an embodiment of the present application, after determining the level corresponding to each business scenario of the vehicle, sub-levels may be extracted again for the level corresponding to some business scenarios, and merged to obtain a more general level. Specifically, if it is determined that the levels corresponding to M business scenarios include the same or similar sub-levels, the levels corresponding to the M business scenarios may be merged, and the merged level may be determined to be the level corresponding to the M business scenarios. M is a positive integer greater than 1. The merged level may include more complex logic, such as recursion and loops. Encapsulating these logics as sub-levels is equivalent to a "big node", which can further improve processing efficiency.
[0102] Among them, merging the levels corresponding to the M business scenarios may be to merge the same sub-levels in the M business scenarios into one node, and arrange the nodes corresponding to the same level in each upper node and lower node of the same sub-level in the M business scenarios as brother nodes in the merged level. Alternatively, merging the levels corresponding to the M business scenarios may be to merge similar sub-levels in the M business scenarios into one sub-level, wherein the same sub-levels in similar sub-levels are merged into one node, and the independent nodes in the similar sub-levels are arranged on the left side of the node after the corresponding layers are merged; and the nodes corresponding to the same level in each upper node and lower node of similar sub-levels in the M business scenarios are arranged as brother nodes in the merged level.
[0103] Figure 8FIG. 1 is a schematic diagram of a method for merging similar levels into sub-levels provided in an embodiment of the present application. Figure 8 As shown in the legend on the left, the first level includes the user input username, user input password and verification input validity + upload to the server node arranged layer by layer, and the second level includes the user input username, user input mobile phone number and verification code, user input password and verification input validity + upload to the server node arranged layer by layer, and this part of the sub-levels of the two levels constitute similar sub-levels. At this time, the sub-level user input username, user input password and verification input validity + upload to the server node can be extracted as a sub-level in the first and second levels, and the extra nodes user input mobile phone number and verification code in the second level are arranged on the left side of the node after the corresponding layer is merged. Among them, since the node user input mobile phone number and verification code are sub-nodes of the node user input username, and in the merged sub-level, the node user input password is also a sub-node of the node user input username, the node user input mobile phone number and verification code can be arranged on the left side of the node user input password.
[0104] In an embodiment of the present application, a node may include a response test function and an execution function. The response test function includes information on whether the node responds to each business scenario. Specifically, a return value may be stored in the response test function, and the return value is response information for each business scenario, and the response information includes one of the following: the node responds to the business scenario, the subnode of the node responds to the business scenario, the node and the subnode of the node respond to the business scenario, and the node does not respond to the business scenario. Furthermore, the subnode of the node responds to the business scenario information and may also include the identifier of the subnode.
[0105] Fig. 9 1 is a flow chart of a method for determining K target nodes corresponding to a business scenario from N nodes provided in an embodiment of the present application. Fig. 9 As shown, the method comprises the following steps:
[0106] In step S901, N nodes are queried in order according to the hierarchical order to obtain the response test function return value of each node.
[0107] The response test function return value includes the identifier of the node, the identifier of the child node of the node, the identifier of the node and the identifier of the child node of the node, and one item in the air.
[0108] In step S902, K nodes whose response test function return values are the identifier of the current node and the identifier of the child node of the current node are determined as K target nodes.
[0109] In an embodiment of the present application, an executor may be configured in a client or a server. When a business scenario is triggered, the executor may call the response test function of each node in the hierarchy corresponding to the business scenario from top to bottom, and inquire each node. After the node receives the inquiry information, the response test function returns the return value of the node to the executor. Among them, the return value is the K nodes of the business scenario responded by the node or the business scenario responded by the node and its subnodes are the K target nodes.
[0110] That is to say, when a business scenario is triggered, the executor will query the nodes corresponding to the business scenario one by one in the hierarchical order from top to bottom. If a node is willing to respond to this scenario, it will answer the executor: this node responds to this business scenario; if the node is unwilling to respond to this scenario, it will answer the executor: this node does not respond to this business scenario. After the executor has traversed all the nodes under the business scenario, the executor has already understood which nodes need to be executed in this business scenario, and has also excluded those nodes that do not need to be executed.
[0111] Furthermore, the response of this node in the response information to the business scenario can be indicated by the return value "this node identifier", the non-response of this node in the response information to the business scenario can be indicated by the return value "empty", the response of the child node of this node in the response information to the business scenario can be indicated by the return value "child node identifier", and the response of this node and its child nodes in the response information to the business scenario can be indicated by the return value "this node identifier + child node identifier".
[0112] In such Figure 5 In the hierarchy shown, when the client determines that the business scenario corresponding to the received vehicle control command is the verification code login business scenario, the executor can query each node in the hierarchy in sequence. At this time, the user clicks the "Forgot Password" node to return the ID of the user input user name node, the user input user name node returns the ID of the user input mobile phone number and verification code node, the user input mobile phone number and verification code node returns its own ID, and the ID of the user input password node, the user input password node returns the ID of the check input validity + upload to the server node, the check input validity + upload to the server node returns its own ID, and the ID of the jump to the corresponding page node, and the jump to the corresponding page node returns its own ID. It can be determined that in the verification code login business scenario, the nodes that need to be executed sequentially include the user input mobile phone number and verification code node, the check input validity + upload to the server node, and the jump to the corresponding page node.
[0113] Alternatively, when the client determines that the business scenario corresponding to the received vehicle control command is a username and password login business scenario, the executor can query each node in the hierarchy in sequence. At this time, the user clicks the Forgot Password node to return the ID of the user input username node, the user input username node returns its own ID, and the user inputs the mobile phone number and verification code node ID, the user inputs the mobile phone number and verification code node returns the user input password node ID, the user input password node returns its own ID, and the verification input validity + upload to the server node ID, the verification input validity + upload to the server node returns its own ID, and the jump to the corresponding page node ID, the jump to the corresponding page node returns its own ID. It can be determined that in the username and password login business scenario, the nodes that need to be executed sequentially include the user input username node, the user input password node, the verification input validity + upload to the server node, and the jump to the corresponding page node.
[0114] Alternatively, when the client determines that the business scenario corresponding to the received vehicle control command is a forgotten password login business scenario, the executor can query each node in the hierarchy in sequence. At this time, the user clicks the Forgot Password node to return his own identity, as well as the identity of the user input username node, the user input username node returns its own identity, and the identity of the user input mobile phone number and verification code node, the user input mobile phone number and verification code node returns its own identity, and the user input password node identity, the user input password node returns its own identity, and the verification input validity + upload to the server node identity, the verification input validity + upload to the server node returns its own identity, and the report success node identity, the report success node returns its own identity. It can be determined that in the forgotten password login business scenario, the nodes that need to be executed sequentially include the user clicks the Forgot Password node, the user inputs the username node, the user inputs the mobile phone number and verification code node, the user inputs the password node, the verification input validity + upload to the server node, and the report success node.
[0115] In the embodiment of the present application, each node in the hierarchy can be distributed in a big-top heap. The executor may query each node in the hierarchy order in sequence, and query the N nodes in the hierarchy one by one in the execution order of the in-order traversal. The in-order traversal order means that the execution order of the nodes in the hierarchy is: from left to right, from top to bottom, and after the left branch is executed to the end, the next branch is traversed.
[0116] In the embodiment of the present application, the execution function of the node may include the execution logic of one or more vehicle control instructions corresponding to the node, and the response test function and execution function of each node may be stored in the node memory. Among them, executing K target nodes in a determined execution order may be to obtain the execution function of each target node in the K target nodes from the node memory; and execute the execution functions of the K target nodes in a determined execution order.
[0117] That is to say, after receiving the return value of each node, the executor still calls the execution function of each node in sequence according to the order of in-order traversal for the K nodes whose response test function return value is the identifier of this node or the identifier of this node and the identifier of its child node, thereby completing the execution of the vehicle control command.
[0118] In an embodiment of the present application, a node can be implemented by inheriting from a parent node, and a parent node can be implemented by a created class. A node may include two core attributes: a parent node and a child node, wherein a node has only one parent node. When it is empty, it means that the node has no parent node, that is, the node is the first node of the business scenario; when the parent node of the node is another node, the other node is the parent node of the node. A node may have multiple child nodes, and each child node is stored in an array, a linked list, or other ordered form. This ordered relationship represents the priority between child nodes. For example: if each child node is stored in the form of an array [A, B, C, D], the priority is A>B>C>D. Furthermore, the node includes two core methods: a response test function and an execution function, which are overridden and implemented by subclasses.
[0119] At the same time, nodes can also be split, merged, added or deleted. For example, as the business develops, if the nodes required by two business scenarios at the same level are inconsistent, the nodes need to be updated. The different parts of the old node in the two business scenarios can be split out separately to form three parts. The unique part and the common part of the first business scenario are combined into a new node, and the unique part and the common part of the second business scenario are combined into another new node B, and they are updated to the corresponding positions of the hierarchical storage and the node storage.
[0120] For example, as the business develops, two adjacent nodes (parent-child nodes or sibling nodes) may be merged into one node. When merging, you need to pay attention to the order between the two child nodes, and the node with the earlier execution order must be merged first.
[0121] For another example, you can add a node by creating a new node, and then specifying the node's parent and child nodes as the original nodes in the hierarchy according to the business logic. You can also delete a node by setting the node's parent and child nodes to other nodes according to the business logic, and then deleting the node from the hierarchy. It should be noted that the deleted node is only deleted from the hierarchy, and in actual operation, a real storage can be retained for next backup. Furthermore, a life countdown can be performed for each deleted node that has no references at any level, and the actual deletion operation is performed when the countdown ends to save storage overhead.
[0122] Fig.10 : is a flow chart of a vehicle control command execution method provided in an embodiment of the present application. Fig.10 Steps S1001 to S1005 in the embodiment shown are Figure 1 Steps S101 to S105 in the illustrated embodiment are substantially the same and will not be described in detail herein. Fig.10 As shown, the vehicle control instruction execution method also includes the following steps:
[0123] In step S1006, the execution feedback parameter of the vehicle control command is obtained.
[0124] In step S1007, in response to determining that the execution feedback parameter meets the preset condition, or receiving a level switching instruction, the level of the business scenario corresponding to the vehicle control instruction is modified, and the modified level is saved in the level memory.
[0125] In the embodiment of the present application, since nodes and sub-levels can be flexibly set, a business scenario may include multiple levels, but only one is saved in the level memory, that is, each business scenario has only one current level implementation scheme. After the current scheme is deployed, that is, after the corresponding level is saved for the business scenario in the level memory, the execution feedback parameters of the vehicle control instructions can be obtained to statistically analyze the execution of the vehicle control instructions based on the level of the business scenario. If it is determined that the execution feedback parameters meet the preset conditions, such as slow execution speed, more resources occupied during execution, etc., the level corresponding to the business scenario can be modified. Alternatively, when the business needs change and the execution steps in the business scenario need to be modified, the client will receive a level switching instruction, and the level corresponding to the business scenario can also be modified at this time.
[0126] Among them, modifying the level corresponding to the business scenario may be to modify part of the content in the level, or to replace the old level with a new level. Modifying part of the content in the level may be to modify the distribution of each node and the relationship between nodes in the level of the business scenario corresponding to the vehicle control instruction. Replacing the old level with a new level may be to redetermine the N nodes of the business scenario corresponding to the vehicle control instruction; and use the redetermined N nodes to construct the level of the business scenario corresponding to the vehicle control instruction. Among them, the method of redetermining the nodes includes at least one of adding new nodes, deleting existing nodes, splitting existing nodes, and merging existing nodes.
[0127] Fig.11 is a flow chart of another vehicle control command execution method provided in an embodiment of the present application. Fig.11 Step S1101 in the embodiment shown is Figure 1 Step S101 in the embodiment shown is substantially the same, and steps S1104 to S1007 are substantially the same as those in the embodiment shown. Figure 1 Steps S102 to S105 in the illustrated embodiment are substantially the same and will not be described in detail herein. Fig.11 As shown, the vehicle control instruction execution method also includes the following steps:
[0128] In step S1102, in response to a change in the target business scenario, all business scenarios after the change are determined.
[0129] In step S1103, the hierarchy corresponding to the target business scenario is modified to obtain the changed hierarchy corresponding to each business scenario, and the changed hierarchy is stored in the hierarchy storage.
[0130] In the embodiment of the present application, as business needs develop, some business scenarios may change. When the target business scenario changes, all business scenarios after the target business scenario changes can be first determined, and then the hierarchy corresponding to the target business scenario is modified to obtain the hierarchy corresponding to each business scenario after the change, and the changed hierarchy is stored in the hierarchy storage.
[0131] Among them, the change of the business scenario may be the addition of control logic. At this time, the modification of the level corresponding to the target business scenario may be to add an empty node to the root node of the level corresponding to the target business scenario; add the member attributes of the newly added control logic corresponding node to the empty node, write the logic for controlling the newly added control logic corresponding node in the response test function of the empty node, and set the execution function of the empty node to empty. Alternatively, the modification of the level corresponding to the target business scenario may be to add the member attributes of the newly added control logic corresponding node to the root node of the level corresponding to the target business scenario, and write the logic for controlling the newly added control logic corresponding node in the response test function of the root node of the level corresponding to the target business scenario.
[0132] In one example, as business needs develop, a specific car model may have a new one-button start function, which includes three states: when the function is enabled, all air-conditioning buttons can directly start the Bluetooth function without remote control logic; when the function is invalid, all air-conditioning buttons do not perform any operation, including Bluetooth and remote control; when the function is turned off, all air-conditioning execute the original logic.
[0133] Therefore, three new business scenarios need to be added at this time. The execution logic of the first new business scenario is: if the current state is enabled, all air conditioning buttons directly jump to the "Bluetooth Control" node; the execution logic of the second new business scenario is: if the current state is invalid, no operation is performed; the execution logic of the third new business scenario is: if the current state is off, all air conditioning buttons execute the original logic.
[0134] At this time, you can add a child node to the root empty node to modify the level corresponding to the original business scenario and obtain the level corresponding to the new business scenario; you can also directly modify the root empty node to modify the level corresponding to the original business scenario and obtain the level corresponding to the new business scenario; you can also modify the response of each child node layer by layer, but this method is too inefficient and is generally not recommended.
[0135] Among them, adding a child node to the root empty node can be implemented in the following way: add a child node to the root empty node, the child node is the parent node of the root empty node, and can be called a new root empty node; add a member attribute to the new root empty node, that is, the "Bluetooth Control" node; write the logic in the response test function of the new root empty child node as follows: if the business scenario is the first business scenario, return the "Bluetooth Control" node; if the business scenario is the second business scenario, return to itself. At this time, since the new root empty node is an empty node, its execution function is not to perform any operation, so returning to itself means not performing any operation; if the business scenario is the third business scenario, return to the original root empty node.
[0136] After running for a period of time, if the function is cancelled, that is, the first business scenario disappears, then the new root empty child node can be directly deleted, and the original logical hierarchy does not need to be changed.
[0137] Directly modifying the root empty node can be achieved as follows: add a member attribute in the root empty node, namely the "Bluetooth Control" node; write the following logic in the response test function of the root empty node: if the business scenario is the first business scenario, return the "Bluetooth Control" node; if the business scenario is the second business scenario, return to itself. At this time, since the new root empty node is an empty node, its execution function does not perform any operation, so returning to itself means not performing any operation; if the business scenario is the third business scenario, maintain the original logic of the root empty node.
[0138] By adopting the technical solution of the embodiment of the present application, the execution steps in the business scenario are decomposed into nodes, and the nodes are distributed in a heap manner to form a hierarchy corresponding to the business scenario. The execution of the vehicle control instructions can be realized by sequentially executing the execution functions of the corresponding nodes in the hierarchy. The advantages of the heap data structure, in which the hierarchy can be adjusted arbitrarily and the nodes are visible to each other, that is, they can reference each other without being constrained by the hierarchy (for example, a grandfather can reference a great-grandson node), are fully utilized. The execution efficiency of the vehicle control instructions and the user experience are greatly improved.
[0139] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0140] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0141] Fig.12 Schematic diagram of a vehicle control instruction execution device provided in an embodiment of the present application. Fig.12 As shown, the vehicle control instruction execution device includes:
[0142] The construction module 1201 is configured to construct a hierarchy corresponding to each business scenario of the vehicle and store the constructed hierarchy in a hierarchy memory, wherein each business scenario corresponds to a vehicle control instruction.
[0143] The determination module 1202 is configured to determine the business scenario corresponding to the vehicle control instruction in response to receiving the vehicle control instruction.
[0144] The acquisition module 1203 is configured to obtain the hierarchy corresponding to the business scenario from the hierarchical memory, where the hierarchy consists of N nodes, and the N nodes are distributed in a heap manner. Each node corresponds to one or more vehicle control instruction execution steps, and N is a positive integer greater than 1.
[0145] The determination module 1202 is further configured to determine K target nodes corresponding to the business scenario from the N nodes, and the execution order of the K target nodes, where K is a positive integer less than or equal to N;
[0146] The execution module 1204 is configured to execute the K target nodes according to the determined execution order.
[0147] According to the technical solution provided by the embodiment of the present application, by pre-building and saving the hierarchy corresponding to each business scenario, when receiving a vehicle control instruction, first determine the business scenario corresponding to the vehicle control instruction, then obtain the hierarchy of the business scenario, and determine from the hierarchy each node containing the vehicle control instruction execution steps corresponding to the business scenario and the node execution order, and finally execute each node according to the determined execution order to complete the execution of the vehicle control instruction. This method can quickly call each execution step of the vehicle control instruction, and the execution step combination of different vehicle control instructions is distributed in a heap manner in the hierarchy, and the calling and modification are flexible and convenient. It can minimize resource usage and improve user experience while meeting the execution speed of the vehicle control instruction.
[0148] In an embodiment of the present application, constructing a hierarchy corresponding to each business scenario of a vehicle includes: obtaining an associated business scenario of a target business scenario, where the target business scenario is the current business scenario of the hierarchy to be constructed; obtaining all vehicle control instruction execution steps in the vehicle control instruction corresponding to the target business scenario, and all vehicle control instruction execution steps in the vehicle control instruction corresponding to the associated business scenario; arranging the vehicle control instruction execution steps in the target business scenario and the associated business scenario in layers according to the execution order, respectively, wherein an execution step in each business scenario corresponds to a layer, and the same execution steps in different business scenarios are arranged in the same layer; starting from the layer corresponding to the first execution step, arranging the execution steps of each layer in sequence according to the execution order to obtain nodes of each layer and the arrangement relationship between nodes; combining each node according to the arrangement relationship between nodes to obtain a hierarchy corresponding to the target business scenario and its associated business scenarios; traversing all business scenarios of the vehicle to obtain a hierarchy corresponding to each business scenario of the vehicle.
[0149] In an embodiment of the present application, the execution steps of each layer are arranged in sequence according to the execution order to obtain the arrangement relationship between the nodes of each layer and the nodes, including: determining that the execution steps corresponding to each layer are the nodes of that layer; in response to a specific layer including multiple nodes, arranging the multiple nodes from left to right in the specific layer in the order of the number of appearances in the target business scenario and its associated business scenarios from small to large.
[0150] In an embodiment of the present application, constructing a hierarchy corresponding to each business scenario of the vehicle includes: obtaining associated business scenarios of the target business scenario, where the target business scenario is the current business scenario of the hierarchy to be constructed; obtaining all vehicle control instruction execution steps in the vehicle control instructions corresponding to the target business scenario, and all vehicle control instruction execution steps in the vehicle control instructions corresponding to the associated business scenarios; determining each group of steps in the target business scenario and its associated business scenarios with the same or similar execution logic as a node, and determining each independent step in the target business scenario and its associated business scenarios as a node, to obtain N nodes; obtaining parent node information, sibling node information, and child node information of each of the N nodes; arranging the N nodes based on the parent node information, sibling node information, and child node information of each node to obtain the hierarchy corresponding to the target business scenario; traversing all business scenarios of the vehicle to obtain the hierarchy corresponding to each business scenario of the vehicle.
[0151] In an embodiment of the present application, after obtaining the levels corresponding to each business scenario of the vehicle, it also includes: in response to determining that the levels corresponding to M business scenarios include the same or similar sub-levels, merging the levels corresponding to the M business scenarios, where M is a positive integer greater than 1; determining the merged level as the level corresponding to the M business scenarios.
[0152] In an embodiment of the present application, the levels corresponding to M business scenarios are merged, including: merging the same sub-levels in the M business scenarios into one node; arranging the nodes corresponding to the same level in each upper node and lower node of the same sub-level in the M business scenarios as brother nodes in the merged level; or merging similar sub-levels in the M business scenarios into one sub-level, wherein the same sub-levels in similar sub-levels are merged into one node, and the independent nodes in the similar sub-levels are arranged on the left side of the node after the corresponding layers are merged; arranging the nodes corresponding to the same level in each upper node and lower node of similar sub-levels in the M business scenarios as brother nodes in the merged level.
[0153] In an embodiment of the present application, the levels corresponding to M business scenarios are merged, including: merging the same sub-levels in the M business scenarios into one node; arranging the nodes corresponding to the same level in each upper node and lower node of the same sub-level in the M business scenarios as brother nodes in the merged level; or merging similar sub-levels in the M business scenarios into one sub-level, wherein the same sub-levels in similar sub-levels are merged into one node, and the independent nodes in the similar sub-levels are arranged on the left side of the node after the corresponding layers are merged; arranging the nodes corresponding to the same level in each upper node and lower node of similar sub-levels in the M business scenarios as brother nodes in the merged level.
[0154] In the embodiment of the present application, N nodes are distributed in a max-heap manner; the N nodes are queried sequentially in hierarchical order, and the N nodes are queried one by one in the execution order of in-order traversal.
[0155] In an embodiment of the present application, each of the N nodes includes an execution function, and the execution function includes the execution logic of one or more vehicle control instructions corresponding to the node; K target nodes are executed according to a determined execution order, including: obtaining the execution function of each target node among the K target nodes from the node memory; and executing the execution functions of the K target nodes according to the determined execution order.
[0156] In an embodiment of the present application, after executing K target nodes in a determined execution order, it also includes: obtaining an execution feedback parameter of the vehicle control instruction; in response to determining that the execution feedback parameter meets a preset condition, or receiving a hierarchical switching instruction, modifying the hierarchy of the business scenario corresponding to the vehicle control instruction, and saving the modified hierarchy in a hierarchical memory.
[0157] In an embodiment of the present application, the hierarchy of the business scenario corresponding to the vehicle control instruction is modified, including: modifying the distribution of each node and the relationship between nodes in the hierarchy of the business scenario corresponding to the vehicle control instruction; or redetermining the N nodes of the business scenario corresponding to the vehicle control instruction; using the redetermined N nodes to construct the hierarchy of the business scenario corresponding to the vehicle control instruction; wherein the method of redetermining the nodes includes at least one of adding new nodes, deleting existing nodes, splitting existing nodes, and merging existing nodes.
[0158] In an embodiment of the present application, after constructing the hierarchy corresponding to each business scenario of the vehicle, it also includes: in response to a change in the target business scenario, determining all business scenarios after the change; modifying the hierarchy corresponding to the target business scenario to obtain the hierarchy corresponding to each business scenario after the change, and saving the changed hierarchy in a hierarchy memory.
[0159] In an embodiment of the present application, in response to the addition of control logic in the changed business scenario, the hierarchy corresponding to the target business scenario is modified, including: adding an empty node to the root node of the hierarchy corresponding to the target business scenario; adding member attributes of the node corresponding to the newly added control logic in the empty node, writing the logic for controlling the node corresponding to the newly added control logic in the response test function of the empty node, and setting the execution function of the empty node to empty; or adding member attributes of the node corresponding to the newly added control logic in the root node of the hierarchy corresponding to the target business scenario, writing the logic for controlling the node corresponding to the newly added control logic in the response test function of the root node of the hierarchy corresponding to the target business scenario.
[0160] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0161] Fig.13 Schematic diagram of an electronic device provided in an embodiment of the present application. Fig.13 As shown, the electronic device 13 of this embodiment includes: a processor 1301, a memory 1302, and a computer program 1303 stored in the memory 1302 and executable on the processor 1301. When the processor 1301 executes the computer program 1303, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 1301 executes the computer program 1303, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0162] The electronic device 13 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 13 may include, but is not limited to, a processor 1301 and a memory 1302. Those skilled in the art will appreciate that Fig.13 The electronic device 13 is merely an example and does not limit the electronic device 13 , and may include more or fewer components than those shown in the figure, or different components.
[0163] The processor 1301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0164] The memory 1302 may be an internal storage unit of the electronic device 13, for example, a hard disk or memory of the electronic device 13. The memory 1302 may also be an external storage device of the electronic device 13, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), etc. equipped on the electronic device 13. The memory 1302 may also include both an internal storage unit of the electronic device 13 and an external storage device. The memory 1302 is used to store computer programs and other programs and data required by the electronic device.
[0165] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0166] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0167] 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. 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, and should all be included in the protection scope of the present application.
Claims
1. A vehicle control command execution method, characterized in that: include: Constructing a hierarchy corresponding to each business scenario of the vehicle, and storing the constructed hierarchy in a hierarchy memory, wherein each business scenario corresponds to a vehicle control instruction; the hierarchy memory stores a unique identifier of each business scenario and a hierarchy of each business scenario; In response to receiving a vehicle control command, determining a business scenario corresponding to the vehicle control command; Obtaining a level corresponding to the business scenario from a level memory, where the level consists of N nodes, the N nodes are distributed in a heap manner, each node corresponds to one or more vehicle control instruction execution steps, and N is a positive integer greater than 1; Determine K target nodes corresponding to the business scenario from the N nodes, and an execution order of the K target nodes, where K is a positive integer less than or equal to N; The K target nodes are executed according to the determined execution order.
2. The method according to claim 1, characterized in that The layers corresponding to each vehicle business scenario are constructed, including: Obtaining an associated business scenario of a target business scenario, wherein the target business scenario is a current business scenario of a level to be constructed; Acquire all vehicle control instruction execution steps in the vehicle control instruction corresponding to the target business scenario, and all vehicle control instruction execution steps in the vehicle control instruction corresponding to the associated business scenario; Arrange the vehicle control command execution steps in the target business scenario and the associated business scenario in layers according to the execution order, wherein one execution step in each business scenario corresponds to one layer, and the same execution steps in different business scenarios are arranged in the same layer; Starting from the layer corresponding to the first execution step, the execution steps of each layer are arranged in sequence according to the execution order to obtain the arrangement relationship between the nodes of each layer and the nodes; Combine the nodes according to the arrangement relationship between the nodes to obtain the hierarchy corresponding to the target business scenario and its associated business scenarios; Traverse all business scenarios of the vehicle and obtain the levels corresponding to each business scenario of the vehicle.
3. The method according to claim 2, characterized in that The step of arranging the execution steps of each layer in order to obtain the nodes of each layer and the arrangement relationship between the nodes includes: Determine the execution steps corresponding to each layer as the nodes of that layer; In response to a specific layer including a plurality of nodes, the plurality of nodes are arranged from left to right in the specific layer in an ascending order of the number of occurrences in the target business scenario and its associated business scenarios.
4. The method according to claim 1, characterized in that The layers corresponding to each vehicle business scenario are constructed, including: Obtaining an associated business scenario of a target business scenario, wherein the target business scenario is a current business scenario of a level to be constructed; Acquire all vehicle control instruction execution steps in the vehicle control instruction corresponding to the target business scenario, and all vehicle control instruction execution steps in the vehicle control instruction corresponding to the associated business scenario; Determine each group of steps in the target business scenario and its associated business scenarios that have the same or similar execution logic as a node, and determine each independent step in the target business scenario and its associated business scenarios as a node, to obtain N nodes; Obtaining parent node information, sibling node information, and child node information of each of the N nodes; Arrange N nodes based on the parent node information, sibling node information, and child node information of each node to obtain the level corresponding to the target business scenario; Traverse all business scenarios of the vehicle and obtain the levels corresponding to each business scenario of the vehicle.
5. The method according to any one of claims 2 to 4, characterized in that After obtaining the levels corresponding to each vehicle business scenario, the method further includes: In response to determining that the levels corresponding to the M business scenarios include the same or similar sub-levels, merging the levels corresponding to the M business scenarios, where M is a positive integer greater than 1; Determine that the merged level is the level corresponding to the M business scenarios.
6. The method according to claim 5, characterized in that The merging of the levels corresponding to the M business scenarios includes: Merge the same sub-levels in the M business scenarios into one node; Arranging the nodes corresponding to the same level in the upper nodes and lower nodes of the same sub-level in the M business scenarios as brother nodes in the merged level; or Merge similar sub-levels in the M business scenarios into one sub-level, wherein the same sub-levels in the similar sub-levels are merged into one node, and the independent nodes in the similar sub-levels are arranged on the left side of the merged node of their corresponding layers; Among the upper nodes and lower nodes of similar sub-levels in the M business scenarios, the nodes corresponding to the same level are arranged as brother nodes in the merged level.
7. The method according to claim 1, characterized in that Each of the N nodes includes a response test function; The determining K target nodes corresponding to the business scenario from the N nodes includes: The N nodes are queried in sequence according to the hierarchical order to obtain a response test function return value of each node, wherein the response test function return value includes an identifier of the node, an identifier of a child node of the node, an identifier of the node and an identifier of a child node of the node, and an item in the air; Determine K nodes whose response test function return values are the identifier of the node or the identifier of the node and the identifier of the child node of the node as the K target nodes.
8. The method according to claim 7, characterized in that The N nodes are distributed in a max-heap manner; The querying of the N nodes in sequence according to the hierarchical order is querying the N nodes one by one in the execution order of the in-order traversal.
9. The method according to claim 1, characterized in that: Each of the N nodes includes an execution function, and the execution function includes the execution logic of one or more vehicle control instructions corresponding to the node; The executing the K target nodes according to the determined execution order includes: Obtaining an execution function of each of the K target nodes from the node storage; The execution functions of the K target nodes are executed according to the determined execution order.
10. The method according to claim 1, characterized in that After executing the K target nodes in the determined execution order, the method further includes: Obtaining execution feedback parameters of the vehicle control command; In response to determining that the execution feedback parameter meets a preset condition, or receiving a level switching instruction, the level of the business scenario corresponding to the vehicle control instruction is modified, and the modified level is saved in a level memory.
11. The method according to claim 10, characterized in that The modifying of the level of the business scenario corresponding to the vehicle control command includes: Modify the distribution of nodes and the relationship between nodes in the hierarchy of the business scenario corresponding to the vehicle control command; or Re-determine N nodes of the business scenario corresponding to the vehicle control command; Using the re-determined N nodes to construct a hierarchy of business scenarios corresponding to the vehicle control instructions; The method of re-determining the node includes at least one of adding a new node, deleting an existing node, splitting an existing node, and merging an existing node.
12. The method according to claim 1, characterized in that After constructing the hierarchy corresponding to each vehicle business scenario, the method further includes: In response to a change in a target business scenario, determining all business scenarios after the change; The hierarchy corresponding to the target business scenario is modified to obtain the changed hierarchy corresponding to each business scenario, and the changed hierarchy is stored in the hierarchy storage.
13. The method according to claim 12, characterized in that In response to the newly added control logic in the changed business scenario, the level corresponding to the target business scenario is modified, including: Add an empty node to the root node of the level corresponding to the target business scenario; Adding a member attribute of a newly added control logic corresponding node in the empty node, writing the logic for controlling the newly added control logic corresponding node in the response test function of the empty node, and setting the execution function of the empty node to empty; or Add member attributes of a newly added control logic corresponding node to the root node of the level corresponding to the target business scenario, and write logic for controlling the newly added control logic corresponding node into the response test function of the root node of the level corresponding to the target business scenario.
14. A vehicle control command execution device, characterized in that: include: A construction module is configured to construct a hierarchy corresponding to each business scenario of the vehicle, and store the constructed hierarchy in a hierarchy memory, wherein each business scenario corresponds to a vehicle control instruction; the hierarchy memory stores a unique identifier of each business scenario and a hierarchy of each business scenario; A determination module, configured to determine, in response to receiving a vehicle control instruction, a business scenario corresponding to the vehicle control instruction; An acquisition module is configured to acquire a hierarchy corresponding to the business scenario from a hierarchy memory, wherein the hierarchy consists of N nodes, the N nodes are distributed in a heap manner, each node corresponds to one or more vehicle control instruction execution steps, and N is a positive integer greater than 1; The determination module is further configured to determine K target nodes corresponding to the business scenario from the N nodes, and an execution order of the K target nodes, where K is a positive integer less than or equal to N; The execution module is configured to execute the K target nodes according to the determined execution order.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 13 are implemented.
16. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.
Citation Information
Patent Citations
Business processing method and device, equipment and storage medium
CN116166342A