Vehicle type function configuration method, device and equipment and storage medium
By obtaining and processing vehicle model configuration items when the application is started, the separate maintenance of configuration files and information is solved, and the problems of low code robustness and development pressure caused by model judgment in the existing technology are improved, and the efficiency of vehicle model function configuration and Experience.
Patent Information
- Application Number
- CN202411149681.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-06
AI Technical Summary
The difference in model judgment in the prior art leads to low code robustness, high development and testing pressure, and low model function R&D efficiency and resource utilization rate, and cumbersome operation steps, so it is impossible to quickly and simply customize model functions.
By responding to application startup, obtain the configuration items of the current model and lazy load it, read the configuration files and data object files, perform key-value mapping and storage into memory, obtain configuration information and store it in configuration cache, and realize the separation of configuration files and information. Maintenance, finally synchronously return the configuration value to the application, and complete the function configuration.
It improves the code robustness, reduces the pressure of development and testing, improves the resource utilization rate and the user experience of model functional configuration, avoids business logic differences when there are too many models, and turns to function-oriented development.
Smart Images

Figure CN119088441A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle configuration technology, and in particular to a vehicle model function configuration method, device, equipment and storage medium. Background Art
[0002] At present, there are many vehicle model judgment businesses in the business codes of the existing technology, that is, every time a car is added or a minor modification is made to the vehicle model, more code modifications and testing investments will be introduced to configure and test the vehicle functions. At the same time, the differences in vehicle model judgments are not summarized, resulting in the inability to fully cover and verify the functions of a single vehicle model. Separate code modifications are required for different vehicle models, resulting in low code robustness and high development and testing pressure. At the same time, it also reduces the efficiency and resource utilization of vehicle model function research and development. The operation steps are cumbersome, making it impossible to quickly and easily customize vehicle model functions. Summary of the invention
[0003] The present invention provides a vehicle function configuration method, device, equipment and storage medium to solve the technical problems in the prior art that the code robustness is low, the development and testing pressure is high, the efficiency and resource utilization of vehicle function research and development are reduced, the operation steps are cumbersome, and the vehicle function cannot be customized quickly and easily.
[0004] In order to solve the above technical problems, an embodiment of the present invention provides a vehicle function configuration method, comprising:
[0005] In response to the start of the application, a configuration item corresponding to any function in the current vehicle model is obtained, and the configuration item is loaded to obtain a corresponding configuration file;
[0006] Reading a corresponding data object file according to the configuration file, and storing the data object file in a key-value mapping form in a memory according to a preset key-value pair;
[0007] Obtaining corresponding configuration information according to the key value corresponding to the configuration file, obtaining a configuration value according to the configuration information, and storing the configuration value in a configuration cache;
[0008] Synchronously return the configuration value to the application, thereby completing the configuration of the function.
[0009] As a preferred solution, in response to the startup of the application, the configuration item corresponding to any function in the current vehicle model is obtained, and the configuration item is loaded to obtain the corresponding configuration file, which specifically includes:
[0010] In response to the user adding several functions to any vehicle model in the application and starting them, reading the configuration items corresponding to any function in the current vehicle model;
[0011] The read configuration items are lazily loaded, and the configuration files and system variables corresponding to the loaded configuration items are initialized, so as to obtain the configuration files corresponding to the configuration items.
[0012] As a preferred solution, the step of reading the corresponding data object file according to the configuration file and storing the data object file in the memory in the form of key-value mapping according to a preset key-value pair specifically includes:
[0013] According to the configuration file, read the data object file in the directory corresponding to the vehicle model, and convert the data object file into a marked data object;
[0014] According to the preset key-value pairs, the data object files converted into labeled data objects are stored in the memory in the form of key-value mapping.
[0015] As a preferred solution, the step of obtaining corresponding configuration information according to the key value corresponding to the configuration file, obtaining a configuration value according to the configuration information, and storing the configuration value in a configuration cache specifically includes:
[0016] According to the preset key-value pair, obtain the key-value information corresponding to the configuration file, and obtain the corresponding configuration information from the local according to the key-value information; wherein the configuration information includes a configuration strategy;
[0017] The configuration strategy is parsed and executed, a configuration value is obtained, and the configuration value is stored in a configuration cache.
[0018] As a preferred solution, after storing the configuration value in the configuration cache, the method further includes:
[0019] Obtain the local version number corresponding to the configuration file in the corresponding vehicle model directory;
[0020] Connect to cloud server;
[0021] When the cloud server sends a resource update, the latest configuration information and the corresponding cloud version number are obtained from the cloud server;
[0022] When the cloud version number is greater than the local version number, the original configuration information is updated according to the latest configuration information, and the configuration file corresponding to the updated configuration information is notified, so that the local version number corresponding to the configuration file is updated to the cloud version number.
[0023] As a preferred solution, obtaining the latest configuration information and the corresponding cloud version number from the cloud server specifically includes:
[0024] According to the resource update issued by the cloud server, the latest configuration information and the corresponding cloud version number are downloaded to the preset path;
[0025] After the download is complete, an update notification is generated, and according to the update notification, the latest configuration information and the corresponding cloud version number are obtained from the preset path.
[0026] As a preferred solution, the step of obtaining corresponding configuration information according to the key value corresponding to the configuration file, obtaining a configuration value according to the configuration information, and storing the configuration value in a configuration cache specifically includes:
[0027] According to the preset key-value pairs, key-value information corresponding to the configuration file is obtained, and the key-value information is sent to the cloud server, so as to obtain corresponding configuration information; wherein the configuration information includes a configuration strategy;
[0028] The cloud server parses and executes the configuration strategy to obtain the configuration value, and stores the configuration value in the configuration cache.
[0029] Accordingly, the present invention also provides a vehicle function configuration device, comprising: a loading module, a memory module, a cache module and a synchronization module;
[0030] The loading module is used to obtain a configuration item corresponding to any function in the current vehicle model in response to the start of the application, and load the configuration item to obtain a corresponding configuration file;
[0031] The memory module is used to read the corresponding data object file according to the configuration file, and store the data object file in the memory in the form of key-value mapping according to the preset key-value pair;
[0032] The cache module is used to obtain corresponding configuration information according to the key value corresponding to the configuration file, obtain configuration values according to the configuration information, and store the configuration values in the configuration cache;
[0033] The synchronization module is used to synchronously return the configuration value to the application program, thereby completing the configuration of the function.
[0034] Correspondingly, the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the vehicle function configuration method described in any one of the above.
[0035] Correspondingly, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the vehicle function configuration methods described above.
[0036] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0037] The technical solution of the present invention obtains the configuration item corresponding to any function in the current vehicle model by responding to the startup of the application, and then obtains the corresponding configuration file after lazy loading, so as to read the corresponding data object file through the configuration file and store it in the memory through key-value mapping, and obtains the corresponding configuration information through the key value corresponding to the configuration file, and then obtains the corresponding configuration value and stores it in the configuration cache, thereby realizing the separate maintenance of the configuration file and the configuration information, and finally completing the configuration of the function after returning the configuration value to the application. At the same time, it converts vehicle model-oriented development into function-oriented development, avoiding the situation when there are too many vehicle models and the business decides whether to configure the function by judging the vehicle model, thereby smoothing the logical differences of the business code, improving the robustness of the code, reducing the pressure of development and testing, and improving resource utilization, and also improving the user experience of vehicle model function configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 : A flow chart of the steps of a vehicle function configuration method provided by an embodiment of the present invention;
[0039] Figure 2 : A technical framework provided for the embodiments of the present invention;
[0040] Figure 3 : A logical timing diagram of the service end corresponding to the configuration framework provided in the embodiment of the present invention;
[0041] Figure 4 : A structural diagram of a vehicle function configuration device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Embodiment 1
[0044] Please refer to Figure 1 , a vehicle function configuration method provided by an embodiment of the present invention, comprising the following steps S101-S104:
[0045] Step S101: In response to the start of the application, a configuration item corresponding to any function in the current vehicle model is obtained, and the configuration item is loaded to obtain a corresponding configuration file.
[0046] As a preferred solution of this embodiment, in response to starting the application, obtaining a configuration item corresponding to any function in the current vehicle model, loading the configuration item, and obtaining a corresponding configuration file specifically includes:
[0047] In response to the user adding several functions to any vehicle model in the application and starting them, the configuration items corresponding to any function in the current vehicle model are read; the read configuration items are lazily loaded, and the configuration files and system variables corresponding to the loaded configuration items are initialized, thereby obtaining the configuration files corresponding to the configuration items.
[0048] In this embodiment, configuration is the basis of vehicle model platformization. Ideally, users can quickly customize a vehicle model by simple operations through the operation platform application; and for the back-end administrator, they only need to maintain a full set of functional configurations for product selection. Therefore, by converting vehicle model-oriented development to function-oriented development, users can add several functions to any vehicle model in the application, so that the configuration business can realize the specific configuration of the function without having to judge whether to configure the function for the vehicle model.
[0049] In this embodiment, the overall technical framework is as follows Figure 2 As shown in the figure, the technical framework consists of two parts: a static configuration management platform and a configuration framework. The business side integrates the configuration framework through Maven. Maven is a cross-platform project management tool that is mainly used for project construction, dependency management, and project information management based on the Java platform. The core of the configuration framework lies in the configuration protocol, which corresponds to the configuration strategy. The flexible protocol can support continuous horizontal and vertical extension of the configuration. At the same time, the configuration library supports cloud settings and incremental updates.
[0050] In this embodiment, after the user adds several functions to any vehicle model in the application and starts it, the configuration items corresponding to any function in the current vehicle model can be read, and then the read configuration items are lazily loaded, and the configuration files and system variables corresponding to the loaded configuration items are initialized, so as to obtain the configuration files according to the meta-data configured in the man i fest file. The man i fest file is used to define extension or archive packaging related data. It is a metadata file, which contains the loaded configuration items and their corresponding configuration files and system variables; wherein, lazy loading is a delayed loading method. Since a vehicle model has multiple functions, different functions correspond to different configuration items, wherein one configuration item corresponds to one function. Therefore, when a certain function needs to be configured, the corresponding configuration item is loaded to improve the efficiency of the configuration response.
[0051] In this embodiment, the configuration file can be an independent Maven repository, which consists of JSON files corresponding to vehicle models. When the system packages the version, it will obtain the configuration file from the Maven repository and copy it to the / system / etc / xpfeature directory, where there are directories corresponding to each vehicle model.
[0052] Step S102: Read the corresponding data object file according to the configuration file, and store the data object file in the form of key-value mapping in the memory according to the preset key-value pair.
[0053] As a preferred solution of this embodiment, the step of reading the corresponding data object file according to the configuration file and storing the data object file in the memory in the form of key-value mapping according to a preset key-value pair specifically includes:
[0054] According to the configuration file, the data object file in the directory corresponding to the vehicle model is read and converted into a marked data object; according to the preset key-value pair, the data object file converted into the marked data object is stored in the memory in the form of key-value mapping.
[0055] In this embodiment, according to the configuration file, the data object file corresponding to the vehicle model system directory is read, preferably a json file, and the json file is converted into a json object, and the json object is stored in the memory in the form of a map dictionary in the form of a key-value pair, wherein the map dictionary object saves the key-value pair and can remember the original insertion order of the key, so the json object can be stored in the memory according to the corresponding key-value pair based on the preset key-value pair.
[0056] In this embodiment, by reading the json file in the corresponding directory of the system and selecting the json parsing library, the json file is parsed into a json object, and then a map dictionary is created according to the preset key-value pairs to store the parsed key-value pairs, and the json objects parsed before are traversed, and all key-value pairs are stored in the map. After the storage is completed, the map content is verified, and finally the json object is stored in the map in the form of key-value pairs.
[0057] Step S103: Obtain corresponding configuration information according to the key value corresponding to the configuration file, obtain a configuration value according to the configuration information, and store the configuration value in a configuration cache.
[0058] As a preferred solution of this embodiment, the step of obtaining corresponding configuration information according to the key value corresponding to the configuration file, obtaining a configuration value according to the configuration information, and storing the configuration value in the configuration cache specifically includes:
[0059] According to the preset key-value pair, the key-value information corresponding to the configuration file is obtained, and the corresponding configuration information is obtained locally according to the key-value information; wherein the configuration information includes a configuration strategy; the configuration strategy is parsed and executed, the configuration value is obtained, and the configuration value is stored in the configuration cache.
[0060] In this embodiment, configuration information is obtained from the map dictionary according to the key corresponding to the configuration file, wherein the configuration information includes a configuration strategy, and there are multiple configuration strategies, including but not limited to directly returning software calibration and obtaining and reading system properties, etc., and then according to the execution of the configuration strategy, the corresponding configuration value is obtained, and the obtained configuration value is stored in the configuration cache.
[0061] In this embodiment, configuration information is obtained from the map, and the corresponding value is directly obtained from the map after traversing the map through the key of the corresponding configuration file. When obtaining the configuration information, the Key may not exist, so exception handling is required. After trying to obtain the value, a null value check can be performed. Then, according to the corresponding configuration information, the configuration strategy is executed, so that the obtained configuration value needs to be converted into a specific data type, and finally the obtained and processed configuration value is stored in the cache.
[0062] As a preferred solution of this embodiment, after storing the configuration value in the configuration cache, the method further includes:
[0063] Obtain the local version number corresponding to the configuration file under the corresponding vehicle model directory; connect to the cloud server; when the cloud server sends a resource update, obtain the latest configuration information and the corresponding cloud version number from the cloud server; when the cloud version number is greater than the local version number, update the original configuration information according to the latest configuration information, and notify the configuration file corresponding to the configuration information update, so as to update the local version number corresponding to the configuration file to the cloud version number.
[0064] In this embodiment, the configuration file under the system directory of the corresponding vehicle model has a corresponding version number, which serves as its version identifier. By connecting to the cloud server, when there is an update on the cloud, the latest configuration information will be obtained from the cloud, and the configuration corresponds to the version number. When it is detected that the cloud version number is greater than the local configuration version number, the configuration is updated, and the key with the configuration change is notified to the business side, and the corresponding configuration information and the corresponding version number are updated.
[0065] As a preferred solution of this embodiment, obtaining the latest configuration information and the corresponding cloud version number from the cloud server specifically includes:
[0066] According to the resource update issued by the cloud server, the latest configuration information and the corresponding cloud version number are downloaded to the preset path; after the download is complete, an update notification is generated, and according to the update notification, the latest configuration information and the corresponding cloud version number are obtained from the preset path.
[0067] In this embodiment, the resource updates sent by the cloud server can be used to download the corresponding resources according to the preset path, and an update notification can be generated after the download is completed to achieve incremental updates. Dynamic updates are also supported. Once a problem occurs, the update configuration policy can be directly sent through the service. Hot updates are also supported, and functions can be preset in advance to improve the robustness of the program.
[0068] Step S104: Synchronously return the configuration value to the application, thereby completing the configuration of the function.
[0069] In this embodiment, the configuration value obtained after the configuration strategy is executed is returned to the application, and the configuration strategy, the configuration value stored in the configuration cache and the configuration file (json object) stored in the memory are combined to complete the configuration of the corresponding function, thereby realizing an automated vehicle function configuration solution without intruding the code. The logical differences in the business code are smoothed through architectural ideas and platform capabilities, thereby improving the robustness of the code and reducing the pressure of development and testing.
[0070] As another preferred solution of this embodiment, the step of obtaining corresponding configuration information according to the key value corresponding to the configuration file, obtaining a configuration value according to the configuration information, and storing the configuration value in a configuration cache specifically includes:
[0071] According to the preset key-value pairs, the key-value information corresponding to the configuration file is obtained, and the key-value information is sent to the cloud server to obtain the corresponding configuration information; wherein the configuration information includes a configuration strategy; the cloud server parses and executes the configuration strategy to obtain the configuration value, and stores the configuration value in the configuration cache.
[0072] In this embodiment, the cloud server can also be directly connected to the business logic, and all steps on the business side can be executed by the cloud, including obtaining the corresponding configuration information by the cloud server, and then parsing and executing the configuration policy by the cloud server to obtain the configuration value, and storing the configuration value in the configuration cache; the cloud server can also be connected to directly send the configuration to the business side, thereby completing the cloud server sending and local policy merging logic. The configuration priority of the cloud server is higher than the local policy priority, that is, the cloud configuration is executed first, and then the local configuration is executed. This can ensure higher integration and faster iteration, but the corresponding customization and business intrusion will also be greater.
[0073] Furthermore, this embodiment implements a functional decoupling strategy, maintains configuration files and configuration information separately, corresponding to two configuration repositories respectively. The business is introduced through the Maven repository, and supports static packaging function, automatically updating the configuration files from the configuration library to the system directory. In addition, it also supports cloud distribution and quickly changes the configuration through requests.
[0074] Implementing the above embodiments has the following effects:
[0075] The technical solution of the present invention obtains the configuration item corresponding to any function in the current vehicle model by responding to the startup of the application, and then obtains the corresponding configuration file after lazy loading, so as to read the corresponding data object file through the configuration file and store it in the memory through key-value mapping, and obtains the corresponding configuration information through the key value corresponding to the configuration file, and then obtains the corresponding configuration value and stores it in the configuration cache, thereby realizing the separate maintenance of the configuration file and the configuration information, and finally completing the configuration of the function after returning the configuration value to the application. At the same time, it converts vehicle model-oriented development into function-oriented development, avoiding the situation when there are too many vehicle models and the business decides whether to configure the function by judging the vehicle model, thereby smoothing the logical differences of the business code, improving the robustness of the code, reducing the pressure of development and testing, and improving resource utilization, and also improving the user experience of vehicle model function configuration.
[0076] Embodiment 2
[0077] See also Figure 3 , which is a business-end logical timing diagram corresponding to the configuration framework provided by the present invention, that is, a configuration strategy warehouse.
[0078] Developers add configuration items for a certain vehicle model in the app, where one configuration item corresponds to one function. AppXpFeature reads the corresponding configuration items, and then lazily loads each configuration item, and initializes the configuration files and system variables corresponding to the currently loaded configuration items, thereby loading the corresponding front-end business and system configurations and executing the configuration functions. AppXpFeature is a specific function or service at the application level, which is initialized and configured when the application starts.
[0079] When the app process is started, when the first configuration is obtained, the configuration file name is obtained according to the meta-data data configured in the manifest, which is the lazy loading process mentioned above.
[0080] Read the json file in the corresponding directory of the system according to the configuration file name, convert it into a json object, and store it in the memory in the form of a map using a key-value pair. Then, get the configuration information from the map according to the configuration key. The configuration information includes the configuration strategy. The business gets the configuration value according to the configuration strategy, and then executes the business logic. After the configuration value is obtained, it will be stored in the result cache.
[0081] Then, the configuration files and policies stored in the local memory are compared. If there is a new configuration, the new configuration is downloaded and the configuration value stored in the memory is updated. The configuration files in the system directory corresponding to AppXpfeature have a version number as a version identifier; AppXpfeature is connected to the cloud server. When there is an update in the cloud, the latest configuration information will be obtained from the cloud. The configuration corresponds to the version number. When it is detected that the cloud version number is greater than the local configuration version number, the configuration is updated, and the key with configuration changes is notified to the business side.
[0082] Finally, after parsing the configuration file, the configuration strategy is executed, and then the execution result is stored in the memory and returned to the business side. In addition, the configuration file is maintained separately, that is, the json file corresponding to the vehicle model, and the configuration library corresponds to AppXpfeature, that is, the Maven warehouse. The configuration file is placed independently and maintained by the product or operation user. The developer is only responsible for the configuration library, so that this embodiment can support more systematic data output, facilitate unified management, and also support rapid configuration iteration, providing cloud and incremental updates.
[0083] As for configuration updates, resource updates can also be issued through the configuration management platform (corresponding to the cloud server), and the large-screen configuration service can download the corresponding issued resources to the specified path, and then notify AppXpfeature to perform incremental configuration updates and update the configuration to the cache; in addition, when the application app is powered on again, the corresponding configuration update can be re-read to ensure that the configuration file corresponding to the function can remain updated.
[0084] Embodiment 3
[0085] See also Figure 4 , which is a vehicle function configuration device provided by the present invention, including: a loading module 201, a memory module 202, a cache module 203 and a synchronization module 204;
[0086] The loading module 201 is used to obtain a configuration item corresponding to any function in the current vehicle model in response to the start of the application, and load the configuration item to obtain a corresponding configuration file;
[0087] The memory module 202 is used to read the corresponding data object file according to the configuration file, and store the data object file in the memory in the form of key-value mapping according to the preset key-value pair;
[0088] The cache module 203 is used to obtain corresponding configuration information according to the key value corresponding to the configuration file, obtain configuration values according to the configuration information, and store the configuration values in the configuration cache;
[0089] The synchronization module 204 is used to synchronously return the configuration value to the application program, thereby completing the configuration of the function.
[0090] As a preferred solution, in response to the startup of the application, the configuration item corresponding to any function in the current vehicle model is obtained, and the configuration item is loaded to obtain the corresponding configuration file, which specifically includes:
[0091] In response to the user adding several functions to any vehicle model in the application and starting them, reading the configuration items corresponding to any function in the current vehicle model;
[0092] The read configuration items are lazily loaded, and the configuration files and system variables corresponding to the loaded configuration items are initialized, so as to obtain the configuration files corresponding to the configuration items.
[0093] As a preferred solution, the step of reading the corresponding data object file according to the configuration file and storing the data object file in the memory in the form of key-value mapping according to a preset key-value pair specifically includes:
[0094] According to the configuration file, read the data object file in the directory corresponding to the vehicle model, and convert the data object file into a marked data object;
[0095] According to the preset key-value pairs, the data object files converted into labeled data objects are stored in the memory in the form of key-value mapping.
[0096] As a preferred solution, the step of obtaining corresponding configuration information according to the key value corresponding to the configuration file, obtaining a configuration value according to the configuration information, and storing the configuration value in a configuration cache specifically includes:
[0097] According to the preset key-value pair, obtain the key-value information corresponding to the configuration file, and obtain the corresponding configuration information from the local according to the key-value information; wherein the configuration information includes a configuration strategy;
[0098] The configuration strategy is parsed and executed, a configuration value is obtained, and the configuration value is stored in a configuration cache.
[0099] As a preferred solution, it also includes: an update module;
[0100] The update module is used to obtain the local version number corresponding to the configuration file under the corresponding vehicle model directory; connect to the cloud server; when the cloud server sends a resource update, obtain the latest configuration information and the corresponding cloud version number from the cloud server; when the cloud version number is greater than the local version number, update the original configuration information according to the latest configuration information, and notify the configuration file corresponding to the configuration information update, so as to update the local version number corresponding to the configuration file to the cloud version number.
[0101] As a preferred solution, obtaining the latest configuration information and the corresponding cloud version number from the cloud server specifically includes:
[0102] According to the resource update issued by the cloud server, the latest configuration information and the corresponding cloud version number are downloaded to the preset path;
[0103] After the download is complete, an update notification is generated, and according to the update notification, the latest configuration information and the corresponding cloud version number are obtained from the preset path.
[0104] As a preferred solution, it also includes: a cloud docking module;
[0105] The cloud docking module is used to obtain key-value information corresponding to the configuration file according to a preset key-value pair, and send the key-value information to the cloud server to obtain corresponding configuration information; wherein the configuration information includes a configuration strategy; the cloud server parses and executes the configuration strategy to obtain a configuration value, and stores the configuration value in a configuration cache.
[0106] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0107] Implementing the above embodiments has the following effects:
[0108] The technical solution of the present invention obtains the configuration item corresponding to any function in the current vehicle model by responding to the startup of the application, and then obtains the corresponding configuration file after lazy loading, so as to read the corresponding data object file through the configuration file and store it in the memory through key-value mapping, and obtains the corresponding configuration information through the key value corresponding to the configuration file, and then obtains the corresponding configuration value and stores it in the configuration cache, thereby realizing the separate maintenance of the configuration file and the configuration information, and finally completing the configuration of the function after returning the configuration value to the application. At the same time, it converts vehicle model-oriented development into function-oriented development, avoiding the situation when there are too many vehicle models and the business decides whether to configure the function by judging the vehicle model, thereby smoothing the logical differences of the business code, improving the robustness of the code, reducing the pressure of development and testing, and improving resource utilization, and also improving the user experience of vehicle model function configuration.
[0109] Embodiment 4
[0110] Correspondingly, the present invention also provides a terminal device, comprising: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the vehicle function configuration method described in any one of the above embodiments is implemented.
[0111] The terminal device of this embodiment includes: a processor, a memory, and a computer program and a computer instruction stored in the memory and executable on the processor. When the processor executes the computer program, each step in the above-mentioned embodiment 1 is implemented, for example: Figure 1 Alternatively, the processor implements the functions of each module / unit in the above device embodiment, such as the cache module 203, when executing the computer program.
[0112] Exemplarily, the computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device. For example, the cache module 203 is used to obtain corresponding configuration information according to the key value corresponding to the configuration file, obtain configuration values according to the configuration information, and store the configuration values in the configuration cache.
[0113] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the schematic diagram is merely an example of a terminal device and does not constitute a limitation on the terminal device. The terminal device may include more or fewer components than shown in the diagram, or may combine certain components, or different components. For example, the terminal device may also include an input / output device, a network access device, a bus, etc.
[0114] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and various interfaces and lines are used to connect various parts of the entire terminal device.
[0115] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile terminal, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (SecureDi gita l, SD) card, a flash card (F l ash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0116] Wherein, if the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-On l yMemory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0117] Embodiment 5
[0118] Correspondingly, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the vehicle function configuration method described in any one of the above embodiments.
[0119] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A vehicle function configuration method, It is characterized in that include: In response to the start of the application, a configuration item corresponding to any function in the current vehicle model is obtained, and the configuration item is loaded to obtain a corresponding configuration file; Reading a corresponding data object file according to the configuration file, and storing the data object file in a key-value mapping form in a memory according to a preset key-value pair; Obtaining corresponding configuration information according to the key value corresponding to the configuration file, obtaining a configuration value according to the configuration information, and storing the configuration value in a configuration cache; Synchronously return the configuration value to the application, thereby completing the configuration of the function.
2. A vehicle model function configuration method as claimed in claim 1, It is characterized in that In response to the start of the application, the configuration item corresponding to any function in the current vehicle model is obtained, and the configuration item is loaded to obtain the corresponding configuration file, which specifically includes: In response to the user adding several functions to any vehicle model in the application and starting them, reading the configuration items corresponding to any function in the current vehicle model; The read configuration items are lazily loaded, and the configuration files and system variables corresponding to the loaded configuration items are initialized, so as to obtain the configuration files corresponding to the configuration items.
3. A vehicle model function configuration method as claimed in claim 1, It is characterized in that The step of reading the corresponding data object file according to the configuration file and storing the data object file in the memory in the form of key-value mapping according to a preset key-value pair specifically includes: According to the configuration file, read the data object file in the directory corresponding to the vehicle model, and convert the data object file into a marked data object; According to the preset key-value pairs, the data object files converted into labeled data objects are stored in the memory in the form of key-value mapping.
4. A vehicle model function configuration method as claimed in claim 1, It is characterized in that The step of obtaining corresponding configuration information according to the key value corresponding to the configuration file, obtaining a configuration value according to the configuration information, and storing the configuration value in the configuration cache specifically includes: According to the preset key-value pair, obtain the key-value information corresponding to the configuration file, and obtain the corresponding configuration information from the local according to the key-value information; wherein the configuration information includes a configuration strategy; The configuration strategy is parsed and executed, a configuration value is obtained, and the configuration value is stored in a configuration cache.
5. A vehicle model function configuration method according to any one of claims 1 to 4, It is characterized in that After storing the configuration value in the configuration cache, the method further includes: Obtain the local version number corresponding to the configuration file in the corresponding vehicle model directory; Connect to cloud server; When the cloud server sends a resource update, the latest configuration information and the corresponding cloud version number are obtained from the cloud server; When the cloud version number is greater than the local version number, the original configuration information is updated according to the latest configuration information, and the configuration file corresponding to the updated configuration information is notified, so that the local version number corresponding to the configuration file is updated to the cloud version number.
6. A vehicle model function configuration method as claimed in claim 5, It is characterized in that The obtaining the latest configuration information and the corresponding cloud version number from the cloud server specifically includes: According to the resource update issued by the cloud server, the latest configuration information and the corresponding cloud version number are downloaded to the preset path; After the download is complete, an update notification is generated, and according to the update notification, the latest configuration information and the corresponding cloud version number are obtained from the preset path.
7. A vehicle model function configuration method as claimed in claim 1, It is characterized in that The step of obtaining corresponding configuration information according to the key value corresponding to the configuration file, obtaining a configuration value according to the configuration information, and storing the configuration value in a configuration cache specifically includes: According to the preset key-value pairs, key-value information corresponding to the configuration file is obtained, and the key-value information is sent to the cloud server, so as to obtain corresponding configuration information; wherein the configuration information includes a configuration strategy; The cloud server parses and executes the configuration strategy to obtain the configuration value, and stores the configuration value in the configuration cache.
8. A vehicle function configuration device, It is characterized in that include: Loading module, memory module, cache module and synchronization module; The loading module is used to obtain a configuration item corresponding to any function in the current vehicle model in response to the start of the application, and load the configuration item to obtain a corresponding configuration file; The memory module is used to read the corresponding data object file according to the configuration file, and store the data object file in the memory in the form of key-value mapping according to the preset key-value pair; The cache module is used to obtain corresponding configuration information according to the key value corresponding to the configuration file, obtain configuration values according to the configuration information, and store the configuration values in the configuration cache; The synchronization module is used to synchronously return the configuration value to the application program, thereby completing the configuration of the function.
9. A terminal device, It is characterized in that The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the vehicle model function configuration method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the vehicle function configuration method according to any one of claims 1 to 7.
Citation Information
Cited By
Dynamic configuration management method and system under single-machine lightweight scene
CN120872405A
