Software model optimization method and related equipment
By identifying and moving states with large associated parameters in the software model to make them adjacent within the framework, and generating a state machine based on their numbers, the problem of low state transition efficiency is solved, and faster state switching is achieved.
Patent Information
- Application Number
- CN202511901067.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-03-20
AI Technical Summary
The transition efficiency between states in the software model is low, especially when the functionality is rich. State A first jumps to state C and then from state C to state B, resulting in a long transition time.
Determine the association parameters between each state in the software model, move states that are greater than the association threshold to make them adjacent, and number them based on their position within the framework to generate a state machine with transition relationships, and directly switch states.
By optimizing the layout and numbering of states, the transition time between states is reduced, thereby improving the efficiency of transitions between states in the software model.
Smart Images

Figure CN121704871A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the software technical field, and in particular to a software model optimization method and related equipment. BACKGROUND
[0002] With the development of software technology, the functions in the software are more and more rich.
[0003] The functions in the software have multiple states, and each state can be jumped. For example, the function in the software is the power management function, and the power management function includes the ON (on) state, the OFF (off) state, the ON non-READY (ready) state, and the ON temporary state.
[0004] In the example technology, as the functions are more and more rich, the states contained by the functions are gradually increased. When state A needs to jump to state B, because of the large number of states embedded in the software model, state A first jumps to state C, and then jumps from state C to state B. The jump time between states is long, and there is a problem of low jump efficiency between states in the software model. SUMMARY
[0005] Based on the above technical status, the present application provides a software model optimization method and related equipment to solve the problem of low jump efficiency between states in the software model.
[0006] In order to achieve the above technical purpose, the present application specifically proposes the following technical scheme: In a first aspect, the present application provides a software model optimization method, comprising: determining the correlation parameters between each state in the software model to be optimized, the correlation parameters between the states being used to indicate the jump probability or jump frequency between the states; moving two states corresponding to the correlation parameters greater than the correlation threshold in the framework of the software model, so that the two states after moving are adjacent; numbering each state according to the position of the state after moving in the framework; generating a state machine corresponding to any two states having a jump relationship according to the number of the states, and storing the state machine, the state machine being used to switch two states meeting the jump condition.
[0007] In some embodiments, the determination of the correlation parameters between each state in the software model to be optimized comprises: determining the function to which each state belongs, wherein the function includes multiple states; According to the function to which the state belongs, determine the association parameter between any two states; wherein, when the functions to which the two states belong are the same, the association parameter between the two states is greater than the association threshold; when the functions to which the two states belong are different, the association parameter between the two states is less than or equal to the association threshold.
[0008] In some embodiments, after moving the two states corresponding to the association parameter greater than the association threshold within the framework of the software model, the method further comprises: In the case of detecting the upgrade of the software model, obtain the newly added state of the upgraded software model; Set the newly added state in the target area within the framework, wherein the target area is the area of the function to which the newly added state belongs within the framework, and the target area is arranged with each state under the function to which the newly added state belongs; Based on the number of the newly added state in the target area, generate and store the state machine corresponding to the newly added state.
[0009] In some embodiments, the method further comprises: Determine the target parameter between any two states, the target parameter being the jump frequency or the jump probability; According to the target parameter, determine the association parameter between any two states.
[0010] In some embodiments, after generating the state machine corresponding to any two states with a jump relationship according to the number of the states, the method further comprises: Obtain the running parameter of the vehicle in which the software model is located, and obtain the jump condition corresponding to the currently running state of the software model in the vehicle; In the case that the running parameter meets the jump condition, determine the target state to be jumped according to the jump condition, and determine the target state machine between the currently running state and the target state; Based on the target state machine, jump the currently running state to the target state.
[0011] In some embodiments, after determining the association parameter between each state in the software model to be optimized, the method further comprises: Within the framework of the software model, move the two states corresponding to the association parameter less than or equal to the association threshold, so that the distance between the two states after moving in the framework is greater than the distance threshold.
[0012] In a second aspect, the application provides a software model optimization device, comprising: The determination module is used to determine the correlation parameters between the states in the software model to be optimized. The correlation parameters between the states are used to indicate the transition probability or transition frequency between the states. The moving module is used to move two states corresponding to association parameters that are greater than the association threshold within the framework of the software model, so that the two states are adjacent after the move. The processing module is used to number each of the states according to the position of the frame after the state is moved; The generation module is used to generate a state machine corresponding to any two states with a transition relationship based on the state number, and to store the state machine. The state machine is used to switch between two states that meet the transition conditions.
[0013] Thirdly, this application provides a vehicle including a memory and a processor, wherein, The memory is connected to the processor and is used to store programs; The processor is used to implement the software model optimization method as described in the first aspect or any implementation thereof by running a program in the memory.
[0014] Fourthly, this application provides an electronic device, including a memory and a processor, wherein, The memory is connected to the processor and is used to store programs; The processor is used to implement the software model optimization method as described in the first aspect or any implementation thereof by running a program in the memory.
[0015] Fifthly, this application provides a computer program product, which, when executed by a processor, implements the optimization method of the software model as described in the first aspect or any implementation thereof.
[0016] In a sixth aspect, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the optimization method of the software model as described in the first aspect or any implementation thereof.
[0017] This application provides a method and related apparatus for optimizing a software model. The method determines the association parameters between states in the software model to be optimized. Within the framework of the software model, two states with association parameters greater than a threshold are moved so that the two moved states are adjacent. Based on the position of each state after the frame movement, each state is numbered. A state machine corresponding to the two states with a transition relationship is generated using the state numbers, and the state machine is stored. In this application, the association parameters between states characterize the transition probability or frequency between states. Therefore, states with association parameters greater than the association threshold are states with a higher transition probability or frequency. That is, states with a higher transition probability or frequency are adjacent in the software model. Generating a state machine based on the numbers obtained from the positions allows for direct switching between the two states with a specific transition relationship. In other words, one state does not need to transition to an intermediate state and then from the intermediate state to another state, reducing the transition time and thus improving the transition efficiency between states in the software model. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0019] Figure 1 The flowchart of a software model optimization method provided in this application embodiment Figure One .
[0020] Figure 2 This is a schematic diagram of the states in the software model involved in the embodiments of this application.
[0021] Figure 3 The flowchart of a software model optimization method provided in this application embodiment Figure Two .
[0022] Figure 4 The flowchart of a software model optimization method provided in this application embodiment Figure Three .
[0023] Figure 5 The flowchart of a software model optimization method provided in this application embodiment Figure Four .
[0024] Figure 6 This is a schematic diagram of the structure of a software model optimization device provided in an embodiment of this application.
[0025] Figure 7 This is a schematic diagram of the structure of a vehicle / electronic device provided in an embodiment of this application. Detailed Implementation
[0026] The technical solution proposed in this application is applicable to state transition scenarios and software modeling scenarios in software, aiming to solve the problem of low transition efficiency between states in software models. Using the technical solution described in this application, the association parameter between states characterizes the transition probability or frequency between states. Therefore, states with an association parameter greater than the association threshold are states with a higher transition probability or frequency. That is, states with a higher transition probability or frequency are adjacent in the software model. A state machine with two states having a transition relationship is generated based on the position-derived number. This allows for direct switching between two states with a specific transition relationship, meaning one state does not need to transition to an intermediate state and then from the intermediate state to another state, reducing the transition time and thus improving the transition efficiency between states in the software model.
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] With the development of software technology, the functions in software are becoming increasingly rich.
[0029] The functions in the software have multiple states, and these states can transition between each other. For example, the function in the software is power management, which includes ON, OFF, ON (not READY), and ON (temporary) states.
[0030] In the exemplary technology, as the functions become richer and the number of states included in the functions gradually increases, when state A needs to jump to state B, since there are many states embedded in the software model, state A first jumps to state C, and then jumps from state C to state B. The jump time between states is long, resulting in the problem of low efficiency of jump between states in the software model.
[0031] In view of this, embodiments of this application aim to provide a method and related apparatus for optimizing a software model. The method determines the association parameters between states in the software model to be optimized. Within the framework of the software model, two states with association parameters greater than a threshold are moved so that the two moved states are adjacent. Based on the position of each state after the frame movement, each state is numbered. A state machine corresponding to the two states with a transition relationship is then generated using the state numbers, and the state machine is stored. In this application, the association parameters between states characterize the transition probability or frequency between states. Therefore, states with association parameters greater than the association threshold are states with a higher transition probability or frequency. That is, states with a higher transition probability or frequency are adjacent in the software model. The state machine generated based on the position-derived numbers allows for direct switching between the two states with a specific transition relationship. In other words, one state does not need to transition to an intermediate state and then from the intermediate state to another state, reducing the transition time and thus improving the transition efficiency between states in the software model.
[0032] The software model optimization method and related equipment provided in this application embodiment can be applied to state transition scenarios and software model modeling scenarios in software.
[0033] Exemplary Method Figure 1 The flowchart of a software model optimization method provided in this application embodiment Figure One .like Figure 1 As shown, the software model optimization method provided in this embodiment includes: Step S101: Determine the correlation parameters between each state in the software model to be optimized. The correlation parameters between states are used to indicate the transition probability or transition frequency between states.
[0034] In this embodiment, the executing entity is a software model optimization device. For ease of description, the term "device" will be used to refer to the software model optimization device below. The device can be a terminal device with software development capabilities, or a vehicle or terminal device loaded with software. The software can be an in-vehicle terminal on a vehicle. The model obtained by modeling the software is defined as a software model. The software model is an embedded software model, which embeds multiple states. A state refers to a different operating state within the software's function. For example, if the function is the power management mode in a vehicle, it includes the ON (on) state, OFF (off) state, ON (not READY) state, ON (temporary) state, start state, and ON (READY) state.
[0035] The device determines the correlation parameters between the states in the software model to be optimized. The larger the correlation parameter between two states, the stronger the correlation between the two states. The correlation parameter between two states can characterize the transition probability or frequency between the two states. For example, the transition probability or frequency between each pair of states can be manually input. The transition probability or frequency is converted into a correlation parameter, and the larger the transition probability, the larger the correlation parameter; similarly, the larger the transition frequency, the larger the correlation parameter.
[0036] Step S102: Within the framework of the software model, move the two states corresponding to the association parameters that are greater than the association threshold so that the two states are adjacent after the move.
[0037] The software model has a framework, within which are embedded the various states of the software, each state having a corresponding position within the framework. After determining the association parameters between any two states, the device identifies two states corresponding to association parameters greater than a certain threshold and moves these two states within the framework, making them adjacent. In other words, the device sets two states with strong associations to be adjacent within the framework. Further, the device identifies two states corresponding to association parameters less than or equal to the threshold and moves these two states within the framework, making the distance between them greater than a certain threshold. This means that two states with weak associations are positioned further apart within the framework, ensuring that the two strongly associated states are not surrounded by other states (states with weak associations with both of them), thus reducing the probability that transitioning from one state to another requires passing through other states.
[0038] Reference Figure 2 If the correlation parameter between any two states A and B, and between A and C is greater than the correlation threshold, then A, B, and C are all adjacent within the frame. If the correlation parameter between any two states D and E, and between D and F is greater than the correlation threshold, then D, E, and F are all adjacent within the frame. If the correlation parameters between A, B, and C and D, E, and F are all less than or equal to the correlation threshold, then the distances between A, B, and C and D, E, and F are greater than the distance thresholds.
[0039] Step S103: Number each state according to its position after the frame is moved.
[0040] After completing the movement of each state within the frame, each state within the frame is numbered. For example, the device can generate the number based on the coordinates of the state within the frame. For instance, if the coordinates of state a after moving within the frame are (0,1), then the number will also be (0,1).
[0041] Step S104: Generate a state machine corresponding to any two states with a transition relationship based on the state number, and store the state machine. The state machine is used to switch between two states that meet the transition conditions.
[0042] After numbering the states, a state machine is generated based on the state numbers, corresponding to any two states with transition relationships.
[0043] For example, the software contains transition logic between states. For instance, the logic code in the software represents a transition from state A to state F. The device first extracts the transition logic between the two states, which represents a transition relationship between them. Then, based on the numbers of the two states with the transition relationship, it generates state machines corresponding to these two states. For example, if the number of state A is (0, 1), and the logic of state F is (1, 0), then (0, 1) → (1, 0) can be encapsulated as a state machine for transitioning from state A to state F. After obtaining each state machine, it stores each state machine so that the software can switch between states based on the state machines during subsequent operation.
[0044] In this embodiment, the software model is set up as two parts: state transition and action execution. Action transition refers to moving the state according to the comparison result of the associated parameters and the associated threshold. Action execution refers to the state machine performing the transition between states. In this way, the complexity of the software model can be reduced.
[0045] In this embodiment, the association parameters between the states in the software model to be optimized are determined. Within the framework of the software model, two states with association parameters greater than a threshold are moved so that the two moved states are adjacent. Based on the position of the state after the frame movement, each state is numbered. Then, a state machine corresponding to the two states with a transition relationship is generated using the state number, and the state machine is stored. In this embodiment, the association parameters between states characterize the transition probability or frequency between states. Therefore, states with association parameters greater than the association threshold are states with a higher transition probability or frequency. That is, states with a higher transition probability or frequency are adjacent in the software model. The state machine generated based on the number obtained from the position allows for direct switching between the two states with a specific transition relationship. In other words, one state does not need to transition to an intermediate state and then from the intermediate state to another state, reducing the transition time and thus improving the transition efficiency between states in the software model.
[0046] Figure 3 The flowchart of a software model optimization method provided in this application embodiment Figure Two ,based on Figure 1 In the embodiment shown, step S101 includes: Step S301: Determine the function to which each state belongs, wherein a function includes multiple states.
[0047] In this embodiment, the software has multiple functions, and each function has multiple states. The device determines the function to which each state belongs.
[0048] Step S302: Determine the association parameter between any two states based on their respective functions; wherein, when any two states belong to the same function, the association parameter between the two states is greater than the association threshold; when any two states belong to different functions, the association parameter between the two states is less than or equal to the association threshold.
[0049] The device determines the association parameter between any two states based on the function to which each state belongs. Specifically, if any two states belong to the same function, the frequency of transitions between the two states under that function is relatively high, and the probability of transitions is also relatively large. Therefore, the association parameter between these two states is set to be greater than the association threshold. If any two states belong to different functions, the frequency of transitions between the two states under different functions is relatively low, and the probability of transitions is also relatively small. Therefore, the association parameter between these two states is set to be less than or equal to the association threshold.
[0050] Furthermore, the association parameters between states belonging to the same function are greater than the association threshold. Therefore, the states under a function are adjacent in the frame, meaning they are located in the same region within the frame. When the software model is upgraded, new states are added. The device identifies the new states in the upgraded software model and sets them within the target region of the frame. The target region is the area within the frame where the function to which the new state belongs belongs, and all states under the function to which the new state belongs are deployed within the target region. The device then generates and stores the state machine corresponding to the new state based on its number in the target region. That is, it assigns a number to the new state based on its position in the target region, and generates and stores the state machine based on the number, the transition relationship between the new state and other states in the software model. This method facilitates subsequent software upgrades and iterations.
[0051] In this embodiment, the correlation parameters between any two states are accurately and quickly determined based on the function to which the state belongs.
[0052] Figure 4 The flowchart of a software model optimization method provided in this application embodiment Figure Three .based on Figure 1 In the embodiment shown, step S101 includes: Step S401: Determine the target parameter between any two states. The target parameter is the jump frequency or the jump probability.
[0053] In this embodiment, the device acquires a target parameter between any two states, where the target parameter is the jump frequency or the jump probability.
[0054] In one example, the device determines whether two states belong to the same function. If they do, the transition probability between the two states is set to a high probability threshold. If the two states belong to different functions, the transition probability between the two states is set to less than or equal to the probability threshold.
[0055] In another example, the device acquires the software's runtime logs and uses these logs to determine the number of transitions between two states. The transition frequency can then be determined from the number of transitions. The transition frequency can be obtained by using the number of transitions as the transition frequency, or by dividing the number of transitions by the target duration, where the target duration refers to the software's cumulative runtime.
[0056] Step S402: Determine the correlation parameters between any two states based on the target parameters.
[0057] Once the target parameters are determined, the correlation parameters between any two states can be determined based on these target parameters. For example, there is a transformation relationship between the target parameters and the correlation parameters; by transforming the target parameters based on this transformation relationship, the correlation parameters can be obtained.
[0058] In this embodiment, the device acquires a target parameter between any two states, thereby accurately determining the correlation parameter between the two states through the target parameter.
[0059] Figure 5 The flowchart of a software model optimization method provided in this application embodiment Figure Four .based on Figures 1 to 4 In any of the embodiments shown, after step S104, the method further includes: Step S501: Obtain the operating parameters of the vehicle where the software model is located, and obtain the jump conditions corresponding to the current operating state of the software model in the vehicle.
[0060] In this embodiment, the device is the vehicle where the software model resides. After the vehicle starts moving, the device acquires the vehicle's operating parameters and the jump conditions corresponding to the current operating state of the software model within the vehicle. For example, the device stores a database associated with the software, containing jump conditions associated with each state. The device queries and extracts the jump conditions associated with the currently operating state from this database.
[0061] Step S502: If the running parameters meet the jump conditions, determine the target state to be jumped to according to the jump conditions, and determine the target state machine between the current running state and the target state.
[0062] Step S503: Based on the target state machine, transition the current running state to the target state.
[0063] After extracting the jump conditions, it is determined whether the running parameters meet the jump conditions. If the running parameters meet the jump conditions, the target state to jump to is determined based on the jump conditions, and the target state machine between the current running state and the target state is determined. Then, the current running state is jumped to the target state based on the target state machine.
[0064] For example, the power modes in a vehicle include multiple states, namely A, F, J, K, and L, where: State A: Power mode OFF, number (0, 0); Status F: Power mode ON, not READY, number (1, 0); State J: Power mode ON temporary state, number (2, 0); State K: Power mode START, number (3, 0); L: Power mode ON READY, number (4, 0).
[0065] 1. The initial power mode is A (OFF). When the trigger condition is met and the driver's door is opened, the power mode changes to ON, and the power mode number changes to (1, 0). 2. Due to the update of the power mode number, the power mode has changed from A (OFF) to F (ON, not READY). 3. When the power mode changes to F (ON instead of READY), and the trigger condition is met to start the car by pressing the brake, the power mode becomes ON, and the power mode number changes to (2, 0). 4. Due to the update of the power mode number, the power mode changes from F (ON not READY) to J (ON temporary state). 5. The power mode changes to J (temporary ON state). When the trigger condition is met and authentication is successful, the power mode changes to START, and the power mode number changes to (3, 0). 6. Due to the update of the power mode number, the power mode changes from J (ON temporary state) to K (START).
[0066] In this embodiment, if the vehicle's operating parameters meet the transition conditions associated with the current operating state of the software model in the vehicle, the state is quickly switched using a state machine.
[0067] Exemplary Apparatus Corresponding to the above-described software model optimization method, this application also provides a software model optimization apparatus. Figure 6This is a schematic diagram of a software model optimization device provided in an embodiment of this application. The software model optimization device provided in this embodiment includes: The determination module 610 is used to determine the correlation parameters between each state in the software model to be optimized. The correlation parameters between states are used to indicate the transition probability or transition frequency between states. The moving module 620 is used to move two states corresponding to association parameters that are greater than the association threshold within the framework of the software model, so that the two states are adjacent after the move. The processing module 630 is used to number each state according to its position after the frame has moved; The generation module 640 is used to generate a state machine corresponding to any two states with a transition relationship based on the state number, and to store the state machine. The state machine is used to switch between two states that meet the transition conditions.
[0068] In some implementations, the software model optimization device 600 is also used for: Determine the function to which each state belongs, where a function includes multiple states; Based on the function to which the state belongs, determine the association parameter between any two states; where, when any two states belong to the same function, the association parameter between the two states is greater than the association threshold; when any two states belong to different functions, the association parameter between the two states is less than or equal to the association threshold.
[0069] In some implementations, the software model optimization device 600 is also used for: In the case of detecting software model upgrades, obtain the newly added status of the upgraded software model; The newly added state is set within the target area of the framework. The target area is the area within the framework where the function to which the newly added state belongs is located. Within the target area, each state under the function to which the newly added state belongs is deployed. Based on the ID of the newly added state in the target region, generate and store the state machine corresponding to the newly added state.
[0070] In some implementations, the software model optimization device 600 is also used for: Determine the target parameter between any two states, where the target parameter is the jump frequency or jump probability; Determine the correlation parameters between any two states based on the target parameters.
[0071] In some implementations, the software model optimization device 600 is also used for: Obtain the operating parameters of the vehicle in which the software model is located, and obtain the jump conditions corresponding to the current operating state of the software model in the vehicle; If the running parameters meet the jump conditions, determine the target state to jump to based on the jump conditions, and determine the target state machine between the current running state and the target state. Based on the target state machine, the current running state is transitioned to the target state.
[0072] In some implementations, the software model optimization device 600 is also used for: Within the framework of the software model, two states corresponding to association parameters that are less than or equal to the association threshold are moved so that the distance between the two moved states within the framework is greater than the distance threshold.
[0073] The software model optimization apparatus provided in this embodiment belongs to the same concept as the software model optimization method provided in the above embodiments of this application. It can execute the software model optimization method provided in any of the above embodiments of this application and has the corresponding functional modules and beneficial effects of the software model optimization method. Technical details not described in detail in this embodiment can be found in the specific processing content of the software model optimization method provided in the above embodiments of this application, and will not be repeated here.
[0074] The functions implemented by each module in the software model optimization device can be implemented by the same or different processors, and this application embodiment does not limit this.
[0075] It should be understood that the modules in the optimized device of the above software model can be implemented in the form of processor calling software. For example, the system includes a processor connected to memory, which stores instructions. The processor calls the instructions stored in memory to implement any of the above methods or to implement the functions of each module of the device. The processor can be a general-purpose processor, such as a CPU or microprocessor, and the memory can be internal to the device or external to the system. Alternatively, the modules in the system can be implemented in the form of hardware circuits. By designing the hardware circuits, some or all of the module functions can be implemented. The hardware circuit can be understood as one or more processors. For example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above modules are implemented by designing the logical relationships of the components within the circuit. In another implementation, the hardware circuit can be implemented by a PLD, taking an FPGA as an example. It can include a large number of logic gates, and the connection relationships between the logic gates are configured through configuration files to implement the functions of some or all of the above modules. All modules of the above vehicle can be implemented entirely by processor calling software, or entirely by hardware circuits, or partially by processor calling software with the remaining parts implemented by hardware circuits.
[0076] In this application embodiment, a processor is a circuit with signal processing capabilities. In one implementation, the processor can be a circuit with instruction reading and execution capabilities, such as a CPU, microprocessor, GPU, or DSP. In another implementation, the processor can implement certain functions through the logical relationships of hardware circuits. These logical relationships are fixed or reconfigurable. For example, the processor may be a hardware circuit implemented as an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document and configuring the hardware circuit can be understood as the processor loading instructions to implement the functions of some or all of the above modules. Furthermore, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, or DPU.
[0077] As can be seen, each module in the optimization device of the above software model can be one or more processors (or processing circuits) configured to implement the above methods, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor types.
[0078] Furthermore, the modules in the optimized device of the above software model can be integrated in whole or in part, or they can be implemented independently. In one implementation, these modules are integrated together and implemented in the form of a System-on-Chip (SoC). The SoC may include at least one processor for implementing any of the above methods or implementing the functions of the modules of the device. The at least one processor may be of different types, such as CPU and FPGA, CPU and artificial intelligence processor, CPU and GPU, etc.
[0079] Exemplary Electronic Device / Vehicle This application provides another structural schematic diagram of an electronic device / vehicle, see [link / reference]. Figure 7 As shown, the electronic device / vehicle includes a memory 700 and a processor 710; wherein the memory 700 is connected to the processor 710 and is used to store programs; the processor 710 is used to implement the optimization method of the software model disclosed in any of the above embodiments by running the programs stored in the memory 700.
[0080] Specifically, the aforementioned electronic device / vehicle may also include: a bus, a communication interface 720, an input device 730, and an output device 740. The electronic device / vehicle may also include a data transceiver module, an image monitoring module, and a signal monitoring module.
[0081] The processor 710, memory 700, communication interface 720, input device 730, and output device 740 are interconnected via a bus. Among them: A bus can include a pathway for transmitting information between various components in an electronic device.
[0082] The processor 710 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present invention. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0083] The processor 710 may include a main processor, as well as a baseband chip, modem, etc.
[0084] The memory 700 stores a program that executes the technical solution of this invention, and may also store an operating system and other key business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 700 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0085] Input device 730 may include a device for receiving data and information input by a user, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0086] Output device 740 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0087] The communication interface 720 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0088] The processor 710 executes the program stored in the memory 700 and calls other devices, which can be used to implement the various steps of the optimization method of any software model provided in the above embodiments of this application.
[0089] This application also proposes a chip, which includes a processor and a data interface. The processor reads and runs a program stored in the memory through the data interface to execute the software model optimization method described in any of the above embodiments. For the specific processing procedure and its beneficial effects, please refer to the embodiments of the software model optimization method described above.
[0090] Exemplary Computer Program Product and Storage Medium In addition to the methods and apparatus described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the optimization methods of the software models according to various embodiments of this application as described in any of the foregoing embodiments of this specification.
[0091] Computer program products can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the power device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0092] Furthermore, embodiments of this application may also be storage media storing computer programs, which are executed by a processor to perform the steps of the optimization method of the software model according to various embodiments of this application as described in any of the above embodiments of this specification, specifically implementing the steps of the optimization method of the software model as described above.
[0093] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0094] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0095] The steps in the methods of the various embodiments of this application can be adjusted, merged, or deleted in order according to actual needs, and the technical features described in each embodiment can be replaced or combined.
[0096] The units of the apparatus in the various embodiments of this application can be merged, divided, and deleted according to actual needs.
[0097] It should be understood that the disclosed terminals, devices, and methods can be implemented in other ways, given the several embodiments provided in this application. For example, the terminal embodiments described above are merely illustrative. For instance, the division of modules or sub-modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0098] The modules or submodules described as separate components may or may not be physically separate. The components that constitute a module or submodule may or may not be physical modules or submodules; that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules can be selected to achieve the purpose of this embodiment's solution, depending on actual needs.
[0099] Furthermore, the functional modules or sub-modules in the various embodiments of this application can be integrated into one processing module, or each module or sub-module can exist physically separately, or two or more modules or sub-modules can be integrated into one module. The integrated modules or sub-modules described above can be implemented in hardware or in the form of software functional modules or sub-modules.
[0100] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0101] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software unit executed by a processor, or a combination of both. The software unit can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0102] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0103] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for optimizing a software model, characterized in that, include: Determine the correlation parameters between the states in the software model to be optimized. The correlation parameters between the states are used to indicate the transition probability or transition frequency between the states. Within the framework of the software model, two states corresponding to association parameters that are greater than the association threshold are moved so that the two states after the move are adjacent. Each state is numbered according to its position after the frame has moved; Based on the state number, generate a state machine corresponding to any two states with a transition relationship, and store the state machine. The state machine is used to switch between two states that meet the transition conditions.
2. The software model optimization method according to claim 1, characterized in that, Determining the correlation parameters between the states in the software model to be optimized includes: Determine the function to which each state belongs, wherein the function includes multiple states; Based on the function to which the state belongs, determine the association parameters between any two states; Wherein, when any two states belong to the same function, the association parameter of the two states is greater than the association threshold; when any two states belong to different functions, the association parameter of the two states is less than or equal to the association threshold.
3. The software model optimization method according to claim 2, characterized in that, Within the framework of the software model, after shifting the two states corresponding to association parameters exceeding the association threshold, the method further includes: In the case of detecting an upgrade to the software model, obtain the newly added status of the upgraded software model; The newly added state is set within a target area of the framework, wherein the target area is the area within the framework where the function to which the newly added state belongs is located, and each state under the function to which the newly added state belongs is deployed within the target area; Based on the ID of the newly added state in the target area, generate and store the state machine corresponding to the newly added state.
4. The software model optimization method according to claim 1, characterized in that, Determining the correlation parameters between the states in the software model to be optimized includes: Determine a target parameter between any two states, wherein the target parameter is a jump frequency or a jump probability; The correlation parameter between any two states is determined based on the target parameter.
5. The software model optimization method according to claim 1, characterized in that, After generating a state machine corresponding to any two states with a transition relationship based on the state number, the method further includes: Obtain the operating parameters of the vehicle in which the software model is located, and obtain the jump conditions corresponding to the current operating state of the software model in the vehicle; If the running parameters meet the jump conditions, the target state to be jumped to is determined according to the jump conditions, and the target state machine between the current running state and the target state is determined. Based on the target state machine, the current running state is transitioned to the target state.
6. The method for optimizing a software model according to any one of claims 1-5, characterized in that, After determining the correlation parameters between the states in the software model to be optimized, the process further includes: Within the framework of the software model, two states corresponding to association parameters that are less than or equal to an association threshold are moved so that the distance between the two moved states within the framework is greater than the distance threshold.
7. An optimization device for a software model, characterized in that, include: The determination module is used to determine the correlation parameters between the states in the software model to be optimized. The correlation parameters between the states are used to indicate the transition probability or transition frequency between the states. The moving module is used to move two states corresponding to association parameters that are greater than the association threshold within the framework of the software model, so that the two states are adjacent after the move. The processing module is used to number each of the states according to the position of the frame after the state is moved; The generation module is used to generate a state machine corresponding to any two states with a transition relationship based on the state number, and to store the state machine. The state machine is used to switch between two states that meet the transition conditions.
8. A vehicle, characterized in that, Including memory and processor, among which, The memory is connected to the processor and is used to store programs; The processor is used to implement the optimization method of the software model as described in any one of claims 1-6 by running the program in the memory.
9. An electronic device, characterized in that, Including memory and processor, among which, The memory is connected to the processor and is used to store programs; The processor is used to implement the optimization method of the software model as described in any one of claims 1-6 by running the program in the memory.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the optimization method for the software model as described in any one of claims 1-6.