Software configuration management method, electronic device, vehicle, and storage medium
By caching and sorting the vehicle configuration codes, the problem of wasted processing resources and performance bottlenecks caused by frequent reading of configuration codes is solved, thereby improving query efficiency and reducing system load.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU AUTOMOBILE GROUP CO LTD
- Filing Date
- 2026-03-03
- Publication Date
- 2026-06-09
AI Technical Summary
Frequent reading of configuration codes during vehicle startup or driving can waste processing resources, especially in high-concurrency scenarios where performance bottlenecks are likely to occur.
By pre-caching configuration codes and using an insertion sort algorithm to sort the cached configuration code queue, the system ensures that frequently accessed configuration codes are located at the beginning of the query loop, thereby improving query efficiency.
It shortens the configuration code query time, improves the configuration code query efficiency, avoids performance bottlenecks in high-concurrency scenarios, and reduces system load and hardware costs.
Smart Images

Figure CN122173158A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle software technology, and more particularly to a software configuration management method, electronic device, vehicle, and storage medium. Background Technology
[0002] With the development of vehicle electronic control technology, the application of vehicle controllers or electronic control units (ECUs) is becoming increasingly widespread, and they can be installed in various configurations of multiple vehicle models. ECUs can enable various functions or adjust function parameters through configuration codes. These configuration codes can be set as needed during vehicle production, and some configuration codes can be adjusted and modified by drivers and passengers after the vehicle leaves the factory and is delivered.
[0003] During vehicle startup or operation, the electronic control unit reads configuration codes from the storage device and determines the functions to be executed and the parameters for those functions based on these codes. Various functional modules of the vehicle also need to query the configuration codes in real time. However, frequently reading the same data wastes processing resources and can easily lead to performance bottlenecks in high-concurrency scenarios. Summary of the Invention
[0004] In view of the above, it is necessary to provide a software configuration management method, electronic device and storage medium to solve the problem that frequent reading of configuration codes during vehicle startup or driving will waste processing resources and easily lead to performance bottlenecks in high-concurrency scenarios.
[0005] In a first aspect, embodiments of this application provide a software configuration management method, the method comprising: In response to a configuration code read request from an application system, determine the target configuration code corresponding to the configuration code read request; If the target configuration code is not stored in the cache of the electronic control unit, the target configuration code is retrieved from the memory, wherein the cache stores a configuration code queue, and multiple configuration codes in the configuration code queue are sorted based on access frequency; The target configuration code is sent to the application system and stored in the cache; The configuration code queue is updated by using the insertion sort algorithm to sort multiple configuration codes, including the target configuration code, in descending order according to their access frequency.
[0006] In one possible implementation, the method further includes: If the target configuration code is stored in the cache, the target configuration code is sent to the application system, and the access frequency of the target configuration code is increased.
[0007] In one possible implementation, storing the target configuration code in the cache includes: If the cache includes at least one free storage location, the target configuration code is stored in the free storage location, and the access frequency of the target configuration code is set to a preset value.
[0008] In one possible implementation, storing the target configuration code in the cache further includes: If the cache does not contain the free storage location, delete the configuration code with the lowest access frequency in the cache; The target configuration code is stored in the corresponding storage location, and the access frequency of the target configuration code is set to the preset value.
[0009] In one possible implementation, the step of using an insertion sort algorithm to sort multiple configuration codes, including the target configuration code, in descending order according to their access frequency includes: Set the first configuration code in the configuration code queue as a sorted sequence, and set the other configuration codes as an unsorted sequence; The first configuration code in the unsorted sequence is determined as the configuration code to be inserted; The access frequency of the configuration code to be inserted is compared with the access frequency of the last configuration code in the sorted sequence; If the access frequency of the configuration code to be inserted is greater than or equal to the access frequency of the last configuration code in the sorted sequence, then the last configuration code in the sorted sequence is shifted one position to the right.
[0010] In one possible implementation, the step of using the insertion sort algorithm to sort multiple configuration codes, including the target configuration code, in descending order according to their access frequency further includes: In reverse order, the access frequency of the configuration code to be inserted is compared with the access frequency of another configuration code in the sorted sequence until a configuration code with a higher access frequency is found, or the configuration codes in the sorted sequence are compared. Then the configuration code to be inserted is inserted after the configuration code with a higher access frequency, or the configuration code to be inserted is inserted at the first position in the sorted sequence. Increase the length of the sorted sequence by 1, and decrease the length of the unsorted sequence by 1.
[0011] In one possible implementation, the method further includes: The access frequency of all configuration codes in the cache is traversed. If the access frequency of a configuration code is greater than a preset threshold, the access frequency of the configuration code is reduced. If the access frequency of the configuration code is less than or equal to a preset threshold, the access frequency of the configuration code will remain unchanged.
[0012] Secondly, embodiments of this application provide an electronic device, the electronic device including a memory and a processor; wherein, the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the electronic device performs the above-described software configuration management method.
[0013] Thirdly, embodiments of this application provide a vehicle, the vehicle including a memory and a processor; wherein the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the vehicle performs the above-described software configuration management method.
[0014] Fourthly, embodiments of this application provide a software configuration management device, the device comprising: a determining module, configured to determine a target configuration code corresponding to a configuration code reading request from an application system; an acquiring module, configured to acquire the target configuration code from a memory when the target configuration code is not stored in the cache of an electronic control unit, wherein the cache stores a configuration code queue, and multiple configuration codes in the configuration code queue are sorted based on access frequency; a caching module, configured to send the target configuration code to the application system and store the target configuration code in the cache; and a sorting module, configured to use an insertion sort algorithm to sort multiple configuration codes, including the target configuration code, in descending order according to access frequency, and update the configuration code queue.
[0015] Fifthly, embodiments of this application provide a computer storage medium that, when the program instructions are run on an electronic device or a vehicle, causes the processor of the electronic device or the vehicle to execute the above-described software configuration management method.
[0016] The software configuration management method, device, electronic device, vehicle, and storage medium provided in this application embodiment can pre-cache configuration codes, thereby shortening the function call chain of the configuration code query process under various operating conditions, shortening the configuration code query time, and effectively improving the configuration code query efficiency. Furthermore, the insertion sort algorithm can be used to sort multiple pre-cached configuration codes according to their access frequency, thereby placing the configuration codes with higher access frequencies at the beginning of the query loop, increasing the probability of finding the actually needed configuration code, and further improving the configuration code query efficiency. Attached Figure Description
[0017] 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.
[0018] Figure 1 This is a schematic diagram illustrating an application scenario of the software configuration management method provided in an embodiment of this application.
[0019] Figure 2 This is a flowchart of a software configuration management method provided in an embodiment of this application.
[0020] Figure 3 This is a flowchart of sorting configuration codes provided in one embodiment of this application.
[0021] Figure 4 This is a flowchart of a software configuration management method provided in another embodiment of this application.
[0022] Figure 5 This is a schematic diagram of the structure of a software configuration management device provided in an embodiment of this application.
[0023] Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.
[0024] Figure 7 This is a schematic diagram of the hardware structure of a vehicle provided in one embodiment of this application. Detailed Implementation
[0025] The terms "first" and "second" used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application's specification is for the purpose of describing particular embodiments only and is not intended to limit the application. It should be understood that, unless otherwise stated, " / " in this application means "or". For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. "At least one" refers to one or more. "More than one" refers to two or more. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, and a, b, and c. Where there is no conflict, the following embodiments and features described herein can be combined with each other.
[0027] With the development of vehicle electronic control technology, the application of vehicle controllers or electronic control units (ECUs) is becoming increasingly widespread, and they can be installed in various configurations of multiple vehicle models. ECUs can enable various functions or adjust function parameters through configuration codes. These configuration codes can be set as needed during vehicle production, and some configuration codes can be adjusted and modified by drivers and passengers after the vehicle leaves the factory and is delivered.
[0028] When the vehicle starts, the electronic control unit (ECU) reads the configuration code from the storage module and selects whether to execute a function and with what parameters based on the configuration code. During vehicle operation, the ECU also needs to read the configuration code from the storage module to select whether to execute a function and with what parameters. Therefore, various application subsystems of the vehicle need to query the configuration code in real time and select parameters to execute or disable functions accordingly. However, frequently reading the same data wastes processing resources and can easily lead to performance bottlenecks in high-concurrency scenarios.
[0029] To address the issue that frequent reading of configuration codes during vehicle startup or operation wastes processing resources and can lead to performance bottlenecks in high-concurrency scenarios, this application provides a software configuration management method. This method pre-caches configuration codes, thereby shortening the function call chain during configuration code lookup under various operating conditions, reducing lookup time, and effectively improving lookup efficiency. Furthermore, it utilizes an insertion sort algorithm to sort the pre-cached configuration codes according to their access frequency, placing frequently accessed configuration codes at the beginning of the query loop, increasing the probability of finding the required configuration code, and further improving lookup efficiency.
[0030] See Figure 1The diagram shown illustrates an application scenario of a software configuration management method provided in an embodiment of this application. The software configuration management method in this embodiment is applied to a software configuration management system 100, which includes, but is not limited to, at least one application system 101, at least one electronic control unit 102, and a memory 103. The application system 101 is used to implement vehicle control functions, such as body control, battery management, and central control functions. Each application system 101 is communicatively connected to its corresponding electronic control unit 102, which configures the functions of the application system 101 based on configuration codes. The memory 103 stores multiple configuration codes, which are used to enable the functions of the application system 101 or adjust its function parameters. The electronic control unit 102 includes a cache 104 for temporarily storing the configuration codes read by the application system 101.
[0031] See Figure 2 The diagram shown is a flowchart of a software configuration management method provided in an embodiment of this application. The method is applied to an electronic device or vehicle and includes: S101, in response to the configuration code reading request from the application system, determine the target configuration code corresponding to the configuration code reading request.
[0032] In one embodiment of this application, the memory pre-stores the correspondence between application systems and configuration codes. When an application system decides on the function to be executed or the parameters of the function to be executed, it sends a configuration code read request to the electronic control unit. When the electronic control unit receives the configuration code read request sent by the application system, it determines the target configuration code corresponding to the application system based on the application system and the correspondence between the application system and the configuration code.
[0033] S102, determine whether the target configuration code is stored in the cache of the electronic control unit. If the target configuration code is not stored in the cache, proceed to S103; if the target configuration code is stored in the cache, proceed to S105.
[0034] In one embodiment of this application, the cache stores a configuration code queue, and the multiple configuration codes in the configuration code queue are sorted in descending order based on access frequency; that is, each configuration code has a corresponding access frequency. The target configuration code is compared one by one with the multiple configuration codes. If the target configuration code is the same as any configuration code in the cache, it is determined that the target configuration code is stored in the cache. If the target configuration code is different from all configuration codes in the cache, it is determined that the target configuration code is not stored in the cache.
[0035] S103: Obtain the target configuration code from the memory, send the target configuration code to the application system, and store the target configuration code in the cache.
[0036] In one embodiment of this application, if the target configuration code is not stored in the cache, the target configuration code is retrieved from the memory, returned to the application system, and stored in the cache.
[0037] In one embodiment of this application, the cache includes multiple storage locations for temporarily storing configuration codes. After the target configuration code is returned to the application system, it is determined whether the cache includes any free storage locations. If the cache includes at least one free storage location, the target configuration code is stored in the free storage location, and the access frequency of the target configuration code is set to a first preset value. If the cache does not include any free storage locations, the configuration code with the lowest access frequency in the cache is deleted, the target configuration code is stored in the storage location corresponding to the configuration code with the lowest access frequency, and the access frequency of the target configuration code is set to the first preset value. For example, the first preset value is 1.
[0038] S104: Use the insertion sort algorithm to sort multiple configuration codes, including the target configuration code, in descending order according to their access frequency, and update the configuration code queue.
[0039] In one embodiment of this application, multiple configuration codes in the cache are sorted in descending order according to their access frequency at preset intervals, thereby updating the configuration code queue in real time. Thus, after the target configuration code is stored in the cache, it also participates in the sorting process. Before re-sorting, the target configuration code is stored in any previously empty storage location or in the storage location of the most recently deleted configuration code.
[0040] See Figure 3 The diagram shown is a flowchart of sorting configuration codes according to an embodiment of this application.
[0041] S201, set the first configuration code in the configuration code queue to the sorted sequence.
[0042] For example, if the current configuration code queue is [APF2, S322A, 00235, 0YC25, 681G3], and 0YC25 is the target configuration code, then [APF2] will be set as the sorted sequence.
[0043] S202, set other configuration codes to an unsorted sequence.
[0044] Based on the example of the configuration code queue above, [S322A, 00235, 0YC25, 681G3] is set as an unsorted sequence.
[0045] S203, determine the first configuration code in the unsorted sequence as the configuration code to be inserted.
[0046] Based on the example of the configuration code queue above, S322A is identified as the configuration code to be inserted.
[0047] S204: Compare the access frequency of the configuration code to be inserted with the access frequency of the last configuration code in the sorted sequence to determine whether the access frequency of the configuration code to be inserted is greater than or equal to the access frequency of the last configuration code in the sorted sequence. If the access frequency of the configuration code to be inserted is greater than or equal to the access frequency of the last configuration code in the sorted sequence, the process proceeds to S205; if the access frequency of the configuration code to be inserted is less than the access frequency of the last configuration code in the sorted sequence, the process proceeds to S206.
[0048] Based on the example of the configuration code queue above, the access frequency of S322A is compared with the access frequency of APF2.
[0049] S205, shift the last configuration code in the sorted sequence one position to the right.
[0050] Based on the example of the configuration code queue above, if the access frequency of S322A is greater than or equal to the access frequency of APF2, then APF2 will be shifted one position to the right.
[0051] S206, insert the configuration code to be inserted after the last configuration code.
[0052] Based on the example of the configuration code queue above, if the access frequency of S322A is less than the access frequency of APF2, then S322A is inserted after APF2.
[0053] S207, increase the length of the sorted sequence by 1, and decrease the length of the unsorted sequence by 1.
[0054] S208, determine if there is a configuration code before the last configuration code in the sorted sequence. If there is a configuration code before the last configuration code in the sorted sequence, proceed to S211; if there is no configuration code before the last configuration code in the sorted sequence, proceed to S209.
[0055] S209, insert the configuration code to be inserted before the last configuration code.
[0056] Based on the example of the configuration code queue above, if there is no configuration code before the last configuration code in the sorted sequence, then S322A is inserted before APF2.
[0057] S210, increase the length of the sorted sequence by 1, and decrease the length of the unsorted sequence by 1.
[0058] S211, following a reverse order, compare the access frequency of the configuration code to be inserted with the access frequency of another configuration code in the sorted sequence to determine whether the access frequency of the configuration code to be inserted is greater than or equal to the access frequency of the other configuration code. If the access frequency of the configuration code to be inserted is greater than or equal to the access frequency of the other configuration code, the process proceeds to S212; if the access frequency of the configuration code to be inserted is less than the access frequency of the other configuration code, the process proceeds to S213.
[0059] Based on the example of the configuration code queue above, if there is a configuration code before the last configuration code in the sorted sequence, the access frequency of S322A is compared with the access frequency of the configuration codes before APF2.
[0060] S212, shift another configuration code one position to the right.
[0061] S213, insert the configuration code to be inserted after another configuration code.
[0062] S214, increase the length of the sorted sequence by 1, and decrease the length of the unsorted sequence by 1.
[0063] S215, determine if a configuration code exists before the other configuration code. If a configuration code exists before the other configuration code, proceed to S211; if no configuration code exists before the other configuration code, proceed to S216.
[0064] S216, insert the configuration code to be inserted before another configuration code.
[0065] In step S217, the length of the sorted sequence is increased by 1, and the length of the unsorted sequence is decreased by 1. Then, the process returns to S203 and loops through S203-S217 until all configuration codes in the unsorted queue are sorted.
[0066] In other words, the access frequency of the configuration code to be inserted is compared with the access frequency of another configuration code in the sorted sequence in reverse order, until a configuration code with a higher access frequency is found, or the configuration codes in the sorted sequence are compared. Then the configuration code to be inserted is inserted after the configuration code with a higher access frequency, or the configuration code to be inserted is inserted at the first position in the sorted sequence.
[0067] S105, send the target configuration code to the application system and increase the access frequency of the target configuration code.
[0068] In one embodiment of this application, if the target configuration code is stored in the cache, the target configuration code is directly returned to the application system, and the access frequency of the target configuration code is increased. For example, the access frequency of the target configuration code is increased by a second preset value, where the second preset value is 1, 2, or other values.
[0069] The embodiments described above in this application shorten the function call chain in the process of querying configuration codes under various operating conditions by pre-caching configuration codes. Only the configuration management system needs to be called, instead of the storage management system every time, thus shortening the query time and effectively improving the query efficiency. Furthermore, the insertion sort algorithm can be used to sort the pre-cached configuration codes according to their access frequency, thereby placing the configuration codes with higher access frequencies at the beginning of the query loop, increasing the probability of finding the actually needed configuration code, further improving the query efficiency, and thus avoiding performance bottlenecks in the control unit under high concurrency scenarios.
[0070] This application embodiment reduces system load and runtime of configuration management functions through efficient dynamic management methods, achieving the original functions with lower performance and reducing hardware costs. At the same time, it maintains system flexibility and minimizes coupling between modules.
[0071] See Figure 4 The diagram shown is a flowchart of a software configuration management method provided in another embodiment of this application. The method is applied to an electronic device or vehicle and includes: S301, in response to the configuration code read request from the application system, determines the target configuration code corresponding to the configuration code read request.
[0072] S302, determine whether the target configuration code is stored in the cache of the electronic control unit. If the target configuration code is not stored in the cache, proceed to S303; if the target configuration code is stored in the cache, proceed to S305.
[0073] S303: Obtain the target configuration code from the memory, send the target configuration code to the application system, and store the target configuration code in the cache.
[0074] S304: The insertion sort algorithm is used to sort multiple configuration codes, including the target configuration code, in descending order according to their access frequency, and the configuration code queue is updated.
[0075] S305, send the target configuration code to the application system and increase the access frequency of the target configuration code.
[0076] The specific implementation methods of S301-S305 are the same as those of S101-S105, and will not be described in detail here.
[0077] S306, iterate through the storage locations in the cache.
[0078] S307, determine whether the currently traversed storage location stores a configuration code. If the currently traversed storage location stores a configuration code, the process proceeds to S308; if the currently traversed storage location does not store a configuration code, the process returns to S306.
[0079] S308, determine whether the access frequency of the configuration code is greater than a preset threshold. If the access frequency of the configuration code is greater than the preset threshold, the process proceeds to S309; if the access frequency of the configuration code is less than or equal to the preset threshold, the process proceeds to S310. For example, the preset threshold is 1, 2, or other values.
[0080] S309 reduces the frequency of accessing configuration codes.
[0081] In one embodiment of this application, if the access frequency of the configuration code is greater than a preset threshold, the access frequency of the configuration code is reduced. For example, the access frequency of the configuration code is reduced by a third preset value, which can be 1.
[0082] S310 maintains the same access frequency for configuration codes.
[0083] In one embodiment of this application, if the access frequency of the configuration code is less than or equal to a preset threshold, the access frequency of the configuration code is kept unchanged.
[0084] In one embodiment of this application, after each traversal of a storage location is completed, it is determined whether all storage locations in the cache have been traversed. If all storage locations in the cache have been traversed, the process ends. If there are untraversed storage locations in the cache, the process returns to S306.
[0085] The above embodiments of this application reduce cache pollution by actively reducing access frequency, thus avoiding the situation where data that is frequently accessed in the early stages but no longer used later occupies the cache for a long time.
[0086] See Figure 5 The diagram shown is a structural schematic of a software configuration management device provided in one embodiment of this application. In one embodiment of this application, the software configuration management device 200 may include multiple functional modules composed of computer program segments. The computer program segments in the software configuration management device 200 may be stored in the memory of an electronic device and executed by at least one processor to perform the software configuration management method function.
[0087] In one embodiment of this application, the software configuration management device 200 can be divided into multiple functional modules according to the functions it performs. The functional modules of the software configuration management device 200 may include: a determination module 201, an acquisition module 202, a caching module 203, and a sorting module 204. In this embodiment, a module refers to a series of computer program segments that can be executed by at least one processor and perform a fixed function, and which are stored in memory.
[0088] The determination module 201 is used to determine the target configuration code corresponding to the configuration code reading request in response to the configuration code reading request of the application system.
[0089] The acquisition module 202 is used to acquire the target configuration code from the memory when the target configuration code is not stored in the cache of the electronic control unit, wherein the cache stores a configuration code queue, and the multiple configuration codes in the configuration code queue are sorted based on the access frequency.
[0090] The caching module 203 is used to send the target configuration code to the application system and store the target configuration code in the cache.
[0091] The sorting module 204 is used to sort multiple configuration codes, including the target configuration code, in descending order according to their access frequency using the insertion sort algorithm, and to update the configuration code queue.
[0092] See Figure 6 The diagram shown is a hardware structure schematic of an electronic device according to an embodiment of this application. The software configuration management method provided in this embodiment can be applied to electronic device 1, which can be a personal computer, server, or other terminal device. Electronic device 1 includes, but is not limited to, a processor 110 and a memory 120 connected via a communication bus 130. Figure 6 This is merely an example of an electronic device and does not constitute a limitation thereof. In other embodiments, the electronic device may include more components than those shown in the figure.
[0093] See Figure 7 The diagram shown is a schematic of the hardware structure of a vehicle according to an embodiment of this application. The software configuration management method provided in this embodiment can also be applied to vehicle 2, which includes, but is not limited to, a processor 210 and a memory 220 connected via a communication bus 230. Figure 7 This is merely an example of a vehicle and does not constitute a limitation thereof. In other embodiments, the vehicle may include more components than those shown in the figure.
[0094] Memory may include one or more Random Access Memory (RAM) and one or more Non-Volatile Memory (NVM). RAM can be directly read and written by the processor and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data. RAM may include Static Random-Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), and Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM), etc.
[0095] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct read and write operations by the processor. Non-volatile memory can include disk storage devices and flash memory.
[0096] The memory is used to store one or more computer programs. These one or more computer programs are configured to be executed by a processor. The one or more computer programs include multiple instructions that, when executed by the processor, enable a software configuration management method for execution on or on an electronic device.
[0097] In other embodiments, the electronic device or vehicle also includes an external memory interface for connecting to an external memory to expand the storage capacity of the electronic device or the electronic device.
[0098] A processor may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0099] The processor provides computing and control capabilities; for example, the processor is used to execute computer programs stored in memory to implement the software configuration management methods described above.
[0100] A communication bus is used at least to provide a channel for communication between memory and processor in electronic devices or vehicles.
[0101] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device or vehicle. In other embodiments of this application, the electronic device or vehicle may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0102] This application also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device or vehicle, the electronic device or vehicle performs the aforementioned related method steps to implement the software configuration management method in the above embodiments.
[0103] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the software configuration management method described in the above embodiments.
[0104] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the software configuration management method in the above method embodiments.
[0105] In this application, the electronic devices, vehicles, computer storage media, computer program products or chips provided in the embodiments are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0106] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0107] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0108] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0109] Furthermore, the functional units in the various embodiments of this application 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 integrated unit can be implemented in hardware or as a software functional unit.
[0110] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts or all or part of the technical solutions that contribute to the prior art, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application.
Claims
1. A software configuration management method, characterized in that, The method includes: In response to a configuration code read request from an application system, determine the target configuration code corresponding to the configuration code read request; If the target configuration code is not stored in the cache of the electronic control unit, the target configuration code is retrieved from the memory, wherein the cache stores a configuration code queue, and multiple configuration codes in the configuration code queue are sorted based on access frequency; The target configuration code is sent to the application system and stored in the cache; The configuration code queue is updated by using the insertion sort algorithm to sort multiple configuration codes, including the target configuration code, in descending order according to their access frequency.
2. The software configuration management method according to claim 1, characterized in that, The method further includes: If the target configuration code is stored in the cache, the target configuration code is sent to the application system, and the access frequency of the target configuration code is increased.
3. The software configuration management method according to claim 1, characterized in that, The step of storing the target configuration code in the cache includes: If the cache includes at least one free storage location, the target configuration code is stored in the free storage location, and the access frequency of the target configuration code is set to a preset value.
4. The software configuration management method according to claim 3, characterized in that, The step of storing the target configuration code in the cache further includes: If the cache does not contain the free storage location, delete the configuration code with the lowest access frequency in the cache; The target configuration code is stored in the corresponding storage location, and the access frequency of the target configuration code is set to the preset value.
5. The software configuration management method according to claim 1, characterized in that, The step of sorting multiple configuration codes, including the target configuration code, in descending order according to access frequency using the insertion sort algorithm includes: Set the first configuration code in the configuration code queue as a sorted sequence, and set the other configuration codes as an unsorted sequence; The first configuration code in the unsorted sequence is determined as the configuration code to be inserted; The access frequency of the configuration code to be inserted is compared with the access frequency of the last configuration code in the sorted sequence; If the access frequency of the configuration code to be inserted is greater than or equal to the access frequency of the last configuration code in the sorted sequence, then the last configuration code in the sorted sequence is shifted one position to the right.
6. The software configuration management method according to claim 5, characterized in that, The step of sorting multiple configuration codes, including the target configuration code, in descending order according to access frequency using the insertion sort algorithm also includes: In reverse order, the access frequency of the configuration code to be inserted is compared with the access frequency of another configuration code in the sorted sequence until a configuration code with a higher access frequency is found, or the configuration codes in the sorted sequence are compared. Then the configuration code to be inserted is inserted after the configuration code with a higher access frequency, or the configuration code to be inserted is inserted at the first position in the sorted sequence. Increase the length of the sorted sequence by 1, and decrease the length of the unsorted sequence by 1.
7. The software configuration management method according to claim 1, characterized in that, The method further includes: The access frequency of all configuration codes in the cache is traversed. If the access frequency of a configuration code is greater than a preset threshold, the access frequency of the configuration code is reduced. If the access frequency of the configuration code is less than or equal to a preset threshold, the access frequency of the configuration code will remain unchanged.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor: The memory is used to store program instructions; The processor is configured to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the electronic device performs the software configuration management method as described in any one of claims 1 to 7.
9. A vehicle, characterized in that, The vehicle includes a memory and a processor: The memory is used to store program instructions; The processor is configured to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, cause the vehicle to perform the software configuration management method as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that, The computer storage medium stores program instructions that, when executed on an electronic device or vehicle, cause the processor of the electronic device or vehicle to perform the software configuration management method as described in any one of claims 1 to 7.