Equipment configuration method and device, electronic equipment and storage medium
Through the automated intelligent device configuration method, the target macro configuration is generated using preset macro databases and language models, the problem of low configuration efficiency of intelligent device is solved and efficient equipment automation configuration is achieved.
Patent Information
- Application Number
- CN202311382433.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-23
- Publication Date
- 2025-04-25
AI Technical Summary
During the smart device configuration process, engineers need to manually configure macro definitions for multiple configuration requirements, resulting in inefficient device configuration.
By obtaining the requirements configuration information of the target device, using the similarity search in the preset macro database to determine the target macro features, and input it into the language model to generate the target macro configuration, and finally automatically configure the target device.
The configuration process of macro data is automated, the efficiency of equipment configuration is improved, and the time and energy of manual configuration is reduced.
Smart Images

Figure CN119883394A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a device configuration method, apparatus, electronic device and storage medium. Background Art
[0002] As the use of smart devices becomes more and more widespread, the configuration of smart devices will also have different configuration requirements according to different regions, countries, models, etc. In related technologies, different code logics are generally bound through different programming language macros. In the actual device configuration process, engineers configure macro definitions according to different configuration requirements to obtain the code logic corresponding to the configuration requirements and implement configuration corresponding to different configuration requirements. However, when the configuration requirements of the device are large, engineers still need to spend a lot of time to configure the macro definitions corresponding to each configuration requirement, and the device configuration efficiency is low. Summary of the invention
[0003] The present application provides a device configuration method, apparatus, electronic device and storage medium, aiming to solve the problem in the related art that configuration is performed based on macro definitions and the device configuration efficiency is low, thereby improving the device configuration efficiency.
[0004] In a first aspect, the present application provides a device configuration method, comprising:
[0005] Obtain required configuration information of the target device to be configured;
[0006] Determining a target macro feature from the preset macro database according to a similarity between each preset macro feature in the preset macro database and a required configuration feature corresponding to the required configuration information;
[0007] Inputting the target macro data corresponding to the target macro feature and the required configuration information into a preset language model, and outputting the target macro configuration, wherein the target macro data includes a target macro definition and a value enumeration of the target macro definition;
[0008] The target device is configured according to the target macro configuration.
[0009] In a possible implementation of the present application, the preset macro database is updated according to the following steps:
[0010] Obtaining script code corresponding to the target device;
[0011] According to the code format in the script code, each macro data in the script code is identified, wherein the macro data includes a macro definition, and a configuration description and a value enumeration corresponding to the macro definition;
[0012] Feature extraction is performed on each of the macro data to obtain macro features, and the macro features are updated to the preset macro database.
[0013] In a possible implementation of the present application, determining the target macro feature from the preset macro database according to the similarity between each preset macro feature in the preset macro database and the required configuration feature corresponding to the required configuration information includes:
[0014] Calculating the cosine similarity between the required configuration feature and each macro feature in the preset macro database;
[0015] The macro features are sorted from large to small according to the cosine similarity, and a preset number of target macro features with top rankings are obtained.
[0016] In a possible implementation of the present application, the step of obtaining the required configuration information of the target device to be configured includes:
[0017] Obtain the configuration requirement order of the target device input by the user;
[0018] Extracting the project type in the configuration requirement order and the project type parameters corresponding to the project type;
[0019] The project type and the project type parameters corresponding to the project type are set as the required configuration information of the target device.
[0020] In a possible implementation of the present application, configuring the target device according to the target macro configuration includes:
[0021] Writing the target macro configuration into the corresponding target code;
[0022] Compiling the target code to obtain target embedded software;
[0023] The target embedded software is stored in association with the required configuration information and fed back to the target device.
[0024] In a possible implementation of the present application, the language model training step includes:
[0025] Acquire a training sample, wherein the training sample includes: sample requirement configuration information, at least two sample target macro data corresponding to the sample requirement configuration information, and a sample label including the sample target macro configuration;
[0026] The training samples are input into a training language model, and the training language model is trained to obtain a language model.
[0027] In a second aspect, the present application provides a device configuration apparatus, the device configuration apparatus comprising:
[0028] An order management module is used to obtain the required configuration information of the target device to be configured;
[0029] A scheduling processing module, configured to determine a target macro feature from the preset macro database according to a similarity between each preset macro feature in the preset macro database and a demand configuration feature corresponding to the demand configuration information;
[0030] A language processing module, used for inputting the target macro data corresponding to each of the target macro features and the required configuration information into a preset language model, and outputting the target macro configuration, wherein the target macro data includes a target macro definition and a value enumeration of the target macro definition;
[0031] The scheduling processing module is used to configure the target device according to the target macro configuration.
[0032] In one embodiment of the present application, the scheduling processing module includes a scheduling unit, a review unit and a compilation unit;
[0033] The scheduling processing module is used to configure the target device according to the target macro configuration, specifically including:
[0034] The scheduling unit is used to write the target macro configuration into the corresponding target code, send the target code to the review unit, and send a compilation instruction to the compilation unit;
[0035] The review unit is used to review and save the target code;
[0036] The compiling unit is used to receive the compiling instruction, download the target code from the review unit, compile the target code, associate the compiled target embedded software with the required configuration information, store it, and feed it back to the target device.
[0037] In a third aspect, the present application provides an electronic device, the electronic device comprising:
[0038] one or more processors;
[0039] Memory; and
[0040] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps in any one of the device configuration methods.
[0041] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is loaded by a processor to execute the steps in any one of the device configuration methods described.
[0042] The present application provides a device configuration method, apparatus, electronic device and storage medium. By acquiring the required configuration information of the target device to be configured; and according to the similarity between each preset macro feature in the preset macro database and the required configuration feature corresponding to the required configuration information, determining the target macro feature from the preset macro database; then inputting the target macro data corresponding to the target macro feature and the required configuration information into a preset language model, outputting the target macro configuration, wherein the target macro data includes a target macro definition and an enumeration of the value of the target macro definition; and configuring the target device according to the target macro configuration. In this scheme, according to the required configuration feature corresponding to the required configuration information of the target device, a similarity search is performed in the preset macro database, and the target macro feature similar to the required configuration feature is screened from the preset macro database. Further, the target macro data corresponding to the target macro feature and the required configuration information are input into a preset language model, and the target macro data is further screened in combination with the required configuration information through the language model, and the corresponding target macro configuration is output, that is, the configuration of the macro data is automatically realized, and the process of converting the required configuration information into a software macro definition is completed, and then the target device is configured according to the target macro, saving the energy of manually configuring the macro and improving the work efficiency of the device configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 It is a scenario diagram of the device configuration method provided in the embodiment of the present application;
[0045] Figure 2 It is a schematic diagram of an embodiment of the device configuration method provided in the embodiments of the present application;
[0046] Figure 3 A schematic diagram of one implementation flow of updating a preset macro database in a device configuration method provided in an implementation scheme of the present application;
[0047] Figure 4 A schematic diagram of one implementation flow of target device configuration in the device configuration method provided in the implementation scheme of the present application;
[0048] Figure 5 It is a schematic diagram of the structure of an embodiment of a device configuration apparatus provided in an embodiment of the present application;
[0049] Figure 6 is a schematic diagram of the structure of another embodiment of the device configuration apparatus provided in the embodiments of the present application;
[0050] Figure 7 It is a structural diagram of another embodiment of the device configuration apparatus provided in the embodiments of the present application;
[0051] Figure 8 It is a schematic diagram of the structure of an embodiment of an electronic device provided in the embodiments of the present application. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0053] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0054] In the embodiment of the present application, "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / ", unless otherwise specified, generally indicates that the associated objects before and after are in an "or" relationship.
[0055] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any person skilled in the art to implement and use the invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the invention can be implemented without using these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in this application.
[0056] The embodiments of the present application provide a device configuration method, an apparatus, an electronic device, and a computer-readable storage medium (the computer-readable storage medium may be referred to as a storage medium), which are described in detail below.
[0057] The device configuration method in the embodiment of the present invention is applied to a device configuration apparatus, and the device configuration apparatus is arranged in an electronic device, and the electronic device is provided with one or more processors, a memory, and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the device configuration method; the electronic device can be a terminal, for example, a mobile phone or a tablet computer, and the electronic device can also be a server, or a service cluster composed of multiple servers.
[0058] like Figure 1 As shown, Figure 1 This is a scenario diagram of the device configuration method in an embodiment of the present application. The device configuration scenario in the embodiment of the present invention includes an electronic device 100 (a device configuration device is integrated in the electronic device 100), and a computer-readable storage medium corresponding to the device configuration is run in the electronic device 100 to execute the steps of the device configuration method.
[0059] Understandably, Figure 1 The electronic devices in the scenario of the device configuration method shown, or the devices included in the electronic devices, do not constitute limitations on the embodiments of the present invention. That is, the number of devices and types of devices included in the scenario of the device configuration method, or the number of devices and types of devices included in each device, do not affect the overall implementation of the technical solution in the embodiments of the present invention, and can all be regarded as equivalent replacements or derivatives of the technical solution claimed to be protected in the embodiments of the present invention.
[0060] In the embodiment of the present invention, the electronic device 100 is mainly used to: obtain the required configuration information of the target device to be configured; determine the target macro feature from the preset macro database according to the similarity between each preset macro feature in the preset macro database and the required configuration feature corresponding to the required configuration information; input the target macro data corresponding to the target macro feature and the required configuration information into a preset language model, and output the target macro configuration, wherein the target macro data includes a target macro definition and an enumeration of the value of the target macro definition; and configure the target device according to the target macro configuration.
[0061] In the embodiment of the present invention, the electronic device 100 may be an independent electronic device, or an electronic device network or electronic device cluster composed of electronic devices. For example, the electronic device 100 described in the embodiment of the present invention includes but is not limited to a computer, a network host, a single network electronic device, a set of multiple network electronic devices, or a cloud electronic device composed of multiple electronic devices. The cloud electronic device is composed of a large number of computers or network electronic devices based on cloud computing.
[0062] Those skilled in the art will understand that Figure 1 The application environment shown in the figure is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or fewer electronic devices shown in, or electronic device network connection relationships, such as Figure 1 Only one electronic device is shown. It can be understood that the scenario of the device configuration method can also include one or more other electronic devices, which are not limited here. The electronic device 100 can also include a memory for storing data, for example, storing preset macro data, etc.
[0063] In addition, in the scenario of the device configuration method of the present application, the electronic device 100 may be provided with a display device, or the electronic device 100 may not be provided with a display device and may be communicated with an external display device 200, and the display device 200 is used to output the result of the execution of the device configuration method in the electronic device. The electronic device 100 may access a backend database 300 (the backend database may be in the local memory of the electronic device, or may be set in the cloud), and the backend database 300 stores information related to the device configuration.
[0064] It should be noted that Figure 1 The scenario diagram of the device configuration method shown is only an example. The scenario of the device configuration method described in the embodiment of the present invention is to more clearly illustrate the technical solution of the embodiment of the present invention, and does not constitute a limitation on the technical solution provided by the embodiment of the present invention.
[0065] Based on the scenario of the above device configuration method, an embodiment of the device configuration method is proposed.
[0066] like Figure 2 FIG. 2 is a flow chart of an embodiment of a device configuration method in an embodiment of the present application, wherein the device configuration method includes steps S201-S204:
[0067] S201: Obtain required configuration information of a target device to be configured.
[0068] The target device may be one device or multiple devices with the same configuration requirement. For example, during the device production process, televisions in the same batch have the same required configuration information, and all televisions in the batch are target devices.
[0069] Among them, the required configuration information may include software configuration requirements and hardware configuration requirements. For example, the software configuration requirements may include: shipping country information, language information, boot logo information, pre-installed different APK information, etc.; the hardware configuration requirements may include: selecting different Flash (Flash memory / FLASH EEPROM, also known as flash memory, flash), DDR (full name Double Data Rate SDRAM, Chinese name "double data rate SDRAM"), main chip and other hardware configuration requirement information.
[0070] Specifically, this application does not make any specific limitation on the method of obtaining the required configuration information. For example, the required configuration information can be extracted based on the order information of the target device; or, the required configuration information can also be obtained from user operation information, for example, by displaying the configurable information page of the target device to the user through an electronic device, and determining the required configuration information of the target device based on the user's trigger operation on the configurable information page. It can be understood that the trigger operation can be click information or input information for a configurable item in the configurable information page, and this application does not make any specific limitation on this.
[0071] S202: Determine a target macro feature from the preset macro database according to the similarity between each preset macro feature in the preset macro database and the required configuration feature corresponding to the required configuration information.
[0072] The preset macro database is created after feature extraction of macro data in the script code, that is, the preset macro feature is a feature vector for characterizing macro data, which can be obtained by feature extraction of macro data.
[0073] Among them, the macro data includes a macro definition, and a configuration description and a value enumeration corresponding to the macro definition. The configuration description of the macro definition is information used to explain the function of the macro definition. The macro definition and the value enumeration are code information. Exemplary: one of the macro data defining the country of shipment includes: macro definition: CVT_DEF_COUNTRY_SELECT; configuration description of the macro definition: configure the default country; macro definition value enumeration: ID_COUNTRY_GERMANY.
[0074] It is understandable that the script code at least includes the script code corresponding to the target device. It is understandable that since the target device includes multiple different functions, that is, the script code corresponding to the target device includes macro data corresponding to different functions and code logic corresponding to the macro data, that is, software engineers generally bind different code logics through different C language macro definitions to adapt to different needs. It is further understandable that a script code may correspond to a lot of macro data, so when creating a macro database, macro data can be extracted from the script code according to the preset macro data format or macro data expression content, and further feature extraction is performed on the extracted macro data to obtain macro features, which are stored in the preset macro database accordingly.
[0075] Specifically, the demand configuration features are obtained by extracting features from the demand configuration information.
[0076] Exemplarily, in one embodiment of the present application, after the user enters the demand configuration information, the demand configuration information is vectorized into a high-dimensional vector to obtain a demand configuration feature. Furthermore, the demand configuration feature is then used to retrieve the target macro feature that is most semantically similar to the demand configuration feature in a preset macro database through a similarity algorithm.
[0077] S203: Input the target macro data corresponding to the target macro feature and the required configuration information into a preset language model, and output the target macro configuration.
[0078] Among them, the target macro data includes a target macro definition and an enumeration of the value of the target macro definition, and may also include a configuration description of the macro definition in some implementation schemes. It can be understood that in some implementation schemes, the semantics of the macro definition cannot be identified only for the target macro definition, and the configuration description of the auxiliary macro definition is required for semantic judgment, that is, the target macro data includes the configuration description of the macro definition. In some other implementation schemes of the present application, the semantics of the macro definition can be identified for the target macro definition, and the configuration description of the auxiliary macro definition is not required for semantic judgment, that is, the target macro data may not include the configuration description of the macro definition, which can be specifically designed according to the macro definition configuration situation, and this application does not make any limitation.
[0079] The target macro configuration is a configured macro. It can be understood that the target configuration can be directly written into the corresponding code to obtain the code corresponding to the required configuration information.
[0080] For example, if the required configuration information is the shipping country: Germany, then the language model outputs the target macro configuration as follows:
[0081] #define CVT_DEF_COUNTRY_SELECT ID_COUNTRY_GERMANY.
[0082] Among them, the language model can be an LLM model (Large Language Model, abbreviated as LLM), a ChatGPT model, etc., which is not specifically limited in this application. The processing capability of the language model can be obtained through model training.
[0083] Specifically, in one implementation scheme of the present application, after determining the target macro feature, the target macro feature is mapped to obtain target macro data corresponding to the target macro feature, and then the target macro data and the required configuration information are input into a preset language model, and the language model further performs semantic analysis on the target macro data and the required configuration information, and outputs a target macro configuration that matches the required configuration information.
[0084] S204: Configure the target device according to the target macro configuration.
[0085] Specifically, after obtaining the target macro configuration, the target macro configuration is written into the corresponding code and compiled, and then the software corresponding to the required configuration information is obtained, so that the software matches the target device, that is, the target software corresponding to the required configuration information of the target device is obtained, and the required configuration of the target device is automatically completed.
[0086] Exemplarily, in one of the device configuration method implementation schemes of the present application, the device configuration method is applied to the configuration of the LCD driver board of a television; when an order for a LCD driver board of a television is produced, it is often necessary to configure different software according to different hardware configurations and customer software requirements, that is, to extract the required configuration information from the order. The required configuration information includes hardware configuration requirements and software configuration requirements. For example, different orders will select different Flash, DDR, and main chips, and require different terminals (hardware configuration requirements). At this time, different hardware configurations are required to configure different software to meet the production requirements of the order. In terms of software configuration requirements, different orders from customers will be configured with different shipping countries, languages, boot logos, pre-installed different APKs, etc., and different software needs to be configured to meet the requirements. That is, after obtaining the required configuration information of the target device to be configured, for each hardware configuration requirement and each software configuration requirement, the similarity between each preset macro feature in the preset macro database and the required configuration feature corresponding to the required configuration information is executed, the target macro feature is determined from the preset macro database, the target macro data corresponding to the target macro feature and the required configuration information are input into a preset language model, and the target macro configuration is output; according to the target macro configuration, the step of configuring the target device is performed to complete the configuration of the hardware configuration requirement and the software configuration requirement of the TV.
[0087] In this scheme, a macro database is preset, and first a similarity search is performed on the preset macro database for the required configuration information to obtain the most matching target macro feature, and then a preset language model is input according to the target macro data corresponding to the target macro feature and the required configuration information, and the target macro configuration is output to complete the automated macro configuration. The target macro feature is determined by a feature similarity search in the preset macro database. In the event that any detail of the target macro data in the required configuration information and the target macro data corresponding to the required configuration information changes, the corresponding target macro feature can be found through feature similarity, thereby enhancing the flexibility and accuracy of the required configuration information search, reducing the difficulty of managing the preset macro database, and reducing the update frequency requirements. At the same time, the language model is processed to directly output the corresponding target macro configuration, thereby reducing the manual configuration procedure and improving the equipment configuration efficiency.
[0088] Further, based on the above implementation scheme, see Figure 3 , Figure 3 A schematic flow chart of one implementation scheme of updating a preset macro database in a device configuration method provided in the implementation scheme of the present application, specifically including steps S301-S303:
[0089] S301: Acquire script code corresponding to the target device.
[0090] Specifically, in one embodiment of the present application, the device configuration method is applied to an electronic device, and a script code reading / import interface is provided on the electronic device, and the script code of the target device can be obtained through the reading / import interface, and the script code includes multiple code segments corresponding to different functions, and each code segment corresponds to a macro data.
[0091] S302. Identify each macro data in the script code according to the code format in the script code, wherein the macro data includes a macro definition, and a configuration description and a value enumeration corresponding to the macro definition.
[0092] It can be understood that different macro definitions can be preset to correspond to different code formats, and the code formats can include code expressions and code expression information. For example, the macro definition code format corresponding to the shipping country is: CVT_DEF_COUNTRY_SELECT, that is, after obtaining the script code, the macro definition corresponding to the shipping country in the script code can be further identified according to the macro definition code format corresponding to the shipping country. Similarly, the configuration instructions and value enumerations corresponding to the macro definitions in the script code can be identified, and finally the macro data in the script code is obtained.
[0093] S303 , extracting features from each of the macro data to obtain macro features, and updating the macro features to the preset macro database.
[0094] Furthermore, after extracting each macro data, each macro data is vectorized into a high-dimensional vector, that is, feature extraction is performed to obtain a macro feature corresponding to each macro data, and the macro feature is updated to the preset macro database.
[0095] It is understandable that the update of the preset macro database described in this solution can be updated after receiving the matching script code, or the script code corresponding to the active reading target device can be updated according to the preset update frequency, and this application does not make specific limitations.
[0096] It can be further understood that the feature extraction in this solution can be implemented through the BERT model, and the demand configuration features and macro features are obtained by inputting the macro data / demand configuration information into the BERT model for vector processing.
[0097] Furthermore, based on the above implementation scheme, the present application also provides a specific implementation scheme for determining target macro features, which specifically includes the steps of:
[0098] (1) Calculating the cosine similarity between the required configuration feature and each macro feature in the preset macro database.
[0099] The requirement configuration feature is used to characterize the requirement configuration information, and the macro feature is used to characterize the macro data corresponding to the macro feature, that is, the cosine similarity is used to characterize the semantic similarity between the requirement configuration information and the macro data corresponding to the macro feature.
[0100] Specifically, the cosine similarity can be calculated by a preset cosine similarity algorithm. After obtaining the required configuration information of the target device to be configured, the required configuration information is converted into a required configuration feature, and the preset cosine similarity algorithm is used to calculate the cosine similarity between the required configuration feature and each preset macro feature in the preset macro database.
[0101] (2) Sort the macro features from large to small according to the cosine similarity, and obtain a preset number of target macro features that are ranked top.
[0102] Further, after calculating the cosine similarity between the required configuration feature and each macro feature in the preset macro database, the macro features corresponding to each cosine similarity are sorted from large to small according to the cosine similarity, and a preset number of target macro features with a top ranking are further extracted, and the target macro features are converted into corresponding macro data, that is, the top-k target macro data with the closest semantics to the required configuration information are retrieved. Among them, the top-k is a preset number, and the preset number can be 1, 3, 5, etc., which is not specifically limited in this application.
[0103] Furthermore, based on the above implementation scheme, the present application also provides a specific implementation scheme of the demand configuration information, including the steps of:
[0104] (1) Obtaining the configuration requirement order of the target device input by the user;
[0105] Exemplarily, the user operates based on the provided display page for configuring the requirements of the target device. For example, the display page includes a project type and parameter options corresponding to the project type. The user clicks on any parameter option under the project type with the mouse or touch to configure the project type parameters. It can be understood that the project type may include project types corresponding to software configuration requirements and project types corresponding to hardware configuration requirements. For another example, the project type corresponding to the software configuration requirements may include: shipping country, and the parameter corresponding to the shipping country is: Germany, that is, the project type Germany is the project type parameter corresponding to the shipping country.
[0106] Furthermore, the user can configure multiple project types based on the display page. After the user configuration operation is completed, a configuration requirement order corresponding to the target device is generated. It can be understood that the configuration requirement order can be displayed / transmitted in the form of a table or document.
[0107] (2) Extracting the project type in the configuration requirement order and the project type parameters corresponding to the project type.
[0108] (3) The project type and the project type parameters corresponding to the project type are set as the required configuration information of the target device.
[0109] Furthermore, after obtaining the configuration requirement order, that is, extracting the project type in the configuration requirement order and the project type parameters corresponding to the project type, setting the project type and the project type parameters corresponding to the project type as the required configuration information of the target device, thereby acquiring the configuration requirement information.
[0110] Further, based on the above implementation scheme, see Figure 4 , Figure 4 A schematic diagram of one implementation flow of target device configuration in the device configuration method provided in the implementation scheme of the present application, specifically including steps S401-S403:
[0111] S401, writing the target macro configuration into the corresponding target code.
[0112] Specifically, after the language model outputs the target macro configuration, that is, the target macro configuration is written into the corresponding target code to achieve the binding of the macro definition and the code. It can be understood that in different chip solution codes, software engineers generally use different C language macro definitions to bind different code logics to adapt to different needs. Exemplarily, there will be a macro definition of the default shipping country CVT_DEF_COUNTRY_SELECT in the chip solution code to bind the code of the default shipping country. That is, when configuring according to the demand configuration information, when the demand is "shipping country: Germany", you only need to configure the code macro: #define CVT_DEF_COUNTRY_SELECT ID_COUNTRY_GERMANY" to configure the code to the target code for the shipping country such as Germany.
[0113] S402: Compile the target code to obtain target embedded software.
[0114] Specifically, after obtaining the target code, the target code is compiled using a preset code compilation module to obtain the target embedded software after the target code is compiled.
[0115] S403: associate the target embedded software with the required configuration information and store them, and feed them back to the target device.
[0116] Exemplarily, after the language model outputs the target macro configuration, the language code writes the output code configuration into the chip solution code and submits the code to the code version management system Gerrit. Furthermore, the scheduling system initiates a code compilation task, i.e., a Jenkins task. The Jenkins task downloads the target code from Gerrit and automatically compiles the target embedded software of the TV driver board according to the target code. After the Jenkins compilation task is completed, the target embedded software of the TV driver board is uploaded to the corresponding order in the order management system, and the target embedded software and the required configuration information on the order are associated and stored for production, thereby realizing the storage and feedback of the required configuration information of the target device.
[0117] Furthermore, based on the above implementation scheme, the present application also provides a method for training a language model, which specifically includes the steps of:
[0118] (1) Acquire a training sample, wherein the training sample includes: sample requirement configuration information, at least two sample target macro data corresponding to the sample requirement configuration information, and a sample label including the sample target macro configuration.
[0119] (2) Inputting the training samples into a training language model, training the training language model, and obtaining a language model.
[0120] It can be understood that the training language model can be an LLM model or a ChatGPT model, etc. Specifically, the training sample is input into a preset training language model, and the sample target macro configuration is used as a sample label to train the training language model until the similarity between the target macro configuration output by the training language model and the sample target macro configuration meets the preset convergence condition, and the training language model is set as the language model.
[0121] The device configuration method provided by the implementation scheme of the present application. By obtaining the required configuration information of the target device to be configured; and according to the similarity between each preset macro feature in the preset macro database and the required configuration feature corresponding to the required configuration information, determining the target macro feature from the preset macro database; then inputting the target macro data corresponding to the target macro feature and the required configuration information into the preset language model, outputting the target macro configuration, wherein the target macro data includes the target macro definition and the value enumeration of the target macro definition; configuring the target device according to the target macro configuration. In this scheme, according to the required configuration feature corresponding to the required configuration information of the target device, a similarity search is performed in the preset macro database, and the target macro feature corresponding to the required configuration feature is screened from the preset macro database. Further, the target macro data corresponding to the target macro feature and the required configuration information are input into the preset language model, and the target macro data is further screened in combination with the required configuration information through the language model, and the corresponding target macro configuration is output, that is, the configuration of the macro data is automatically realized, and the process of converting the required configuration information into the software macro definition is completed, and then the target device is configured according to the target macro, saving the energy of manually configuring the macro and improving the work efficiency of the device configuration.
[0122] In order to better implement the device configuration method in the embodiment of the present application, based on the device configuration method, the embodiment of the present application also provides a device configuration device, such as Figure 5 As shown, the device configuration apparatus includes modules 501-503:
[0123] The order management module 501 is used to obtain the required configuration information of the target device to be configured;
[0124] A scheduling processing module 502, configured to determine a target macro feature from the preset macro database according to a similarity between each preset macro feature in the preset macro database and a demand configuration feature corresponding to the demand configuration information;
[0125] The language processing module 503 is used to input the target macro data corresponding to each of the target macro features and the required configuration information into a preset language model, and output the target macro configuration, wherein the target macro data includes a target macro definition and a value enumeration of the target macro definition;
[0126] The scheduling processing module 502 is used to configure the target device according to the target macro configuration.
[0127] In one embodiment of the present application, the scheduling processing module 502 is used to determine the target macro feature from the preset macro database according to the similarity between each preset macro feature in the preset macro database and the demand configuration feature corresponding to the demand configuration information, specifically including:
[0128] Calculating the cosine similarity between the required configuration feature and each macro feature in the preset macro database;
[0129] The macro features are sorted from large to small according to the cosine similarity, and a preset number of target macro features with top rankings are obtained.
[0130] In one implementation of the present application, the order management module 501 is used to obtain the required configuration information of the target device to be configured, specifically including:
[0131] Obtain the configuration requirement order of the target device input by the user;
[0132] Extracting the project type in the configuration requirement order and the project type parameters corresponding to the project type;
[0133] The project type and the project type parameters corresponding to the project type are set as the required configuration information of the target device.
[0134] In one embodiment of the present application, the scheduling processing module 502 is used to configure the target software according to the target macro configuration, specifically including:
[0135] Writing the target macro configuration into the corresponding target code;
[0136] Compiling the target code to obtain target embedded software;
[0137] The target embedded software is stored in association with the required configuration information and fed back to the target device.
[0138] For further information, see Figure 6 In one embodiment of the present application, the scheduling processing module includes a scheduling unit 5020, a review unit 5021 and a compilation unit 5022;
[0139] The scheduling processing module 502 is used to configure the target device according to the target macro configuration, specifically including:
[0140] The scheduling unit 5020 is used to write the target macro configuration into the corresponding target code, send the target code to the review unit, and send a compilation instruction to the compilation unit;
[0141] The review unit 5021 is used to review and save the target code;
[0142] The compiling unit 5022 is used to receive the compiling instruction, download the target code from the review unit, compile the target code, associate the compiled target embedded software with the required configuration information, store it, and feed it back to the target device.
[0143] Specifically, in the implementation scheme of the present application, the scheduling unit 5020 is used to determine the target macro feature from the preset macro database according to the similarity between each preset macro feature in the preset macro database and the demand configuration feature corresponding to the demand configuration information.
[0144] For further information, see Figure 7 In one embodiment of the present application, the device further includes a database creation module 504, which is used to:
[0145] Obtaining script code corresponding to the target device;
[0146] According to the code format in the script code, each macro data in the script code is identified, wherein the macro data includes a macro definition, and a configuration description and a value enumeration corresponding to the macro definition;
[0147] Feature extraction is performed on each of the macro data to obtain macro features, and the macro features are updated to the preset macro database.
[0148] In one embodiment of the present application, the language processing module 503 further includes:
[0149] Acquire a training sample, wherein the training sample includes: sample requirement configuration information, at least two sample target macro data corresponding to the sample requirement configuration information, and a sample label including the sample target macro configuration;
[0150] The training samples are input into a training language model, and the training language model is trained to obtain a language model.
[0151] The embodiment of the present application provides a device configuration apparatus. An order management module is set up to obtain the required configuration information of the target device to be configured; a scheduling processing module is used to determine the target macro features from the preset macro database according to the similarity between each preset macro feature in the preset macro database and the required configuration features corresponding to the required configuration information; a language processing module is used to input the target macro data corresponding to each of the target macro features and the required configuration information into a preset language model, and output the target macro configuration, wherein the target macro data includes a target macro definition and an enumeration of the value of the target macro definition; and the scheduling processing module is used to configure the target device according to the target macro configuration. In this solution, based on the requirement configuration features corresponding to the requirement configuration information of the target device, a similarity search is performed in the preset macro database, and target macro features similar to the requirement configuration features are screened from the preset macro database. Furthermore, the target macro data corresponding to the target macro features and the requirement configuration information are input into a preset language model, and the target macro data is further screened in combination with the requirement configuration information through the language model, and the corresponding target macro configuration is output, that is, the configuration of the macro data is automatically realized, and the process of converting the requirement configuration information into a software macro definition is completed, and then the target device is configured according to the target macro, saving the energy of manually configuring the macro and improving the work efficiency of the device configuration.
[0152] Based on the above implementation scheme, the embodiment of the present invention further provides an electronic device, such as Figure 8 As shown, Figure 8 It is a schematic diagram of the structure of an embodiment of an electronic device provided in the embodiments of the present application.
[0153] Electronic equipment includes:
[0154] one or more processors;
[0155] Memory; and
[0156] One or more applications, wherein the one or more applications are stored in a memory and are configured to be executed by a processor to execute the steps of the device configuration method in any of the above device configuration method embodiments.
[0157] Specifically, the electronic device may include components such as a processor 1001 with one or more processing cores, a memory 1002 with one or more computer-readable storage media, a power supply 1003, and an input unit 1004. Those skilled in the art will appreciate that Figure 8 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0158] Among them, the processor 1001 is the configuration center of the device, which uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 1002, and calling data stored in the memory 1002, so as to monitor the electronic device as a whole. It can be understood that the processor 1001 transmits signals with the controller. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 1001.
[0159] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.
[0160] In some embodiments of the present application, the device configuration apparatus may be implemented in the form of a computer program, which may be in the form of a computer program. Figure 8 The memory of the electronic device may store various program modules constituting the device configuration method, for example, Figure 5 The order management module 601, the scheduling processing module 602, and the language processing module 603 are shown. The computer program composed of various program modules enables the processor to execute the steps in the device configuration method of each embodiment of the present application described in this specification.
[0161] For example, Figure 8 The electronic device shown can be Figure 5The order management module 601 in the device configuration method apparatus shown executes step S201. The electronic device can execute step S202 through the scheduling processing module 602. The electronic device can execute step S203 through the language processing module 603. The electronic device can execute step S204 through the language processing module 602. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external electronic device through a network connection. When the computer program is executed by the processor, a device configuration method is implemented.
[0162] The electronic device also includes a power supply 1003 for supplying power to each component. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 1003 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0163] The electronic device may further include an input unit 1004, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0164] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 1001 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 1002 according to the following instructions, and the processor 1001 will run the application programs stored in the memory 1002, thereby realizing various functions, as follows:
[0165] Obtain required configuration information of the target device to be configured;
[0166] Determining a target macro feature from the preset macro database according to a similarity between each preset macro feature in the preset macro database and a required configuration feature corresponding to the required configuration information;
[0167] Inputting the target macro data corresponding to the target macro feature and the required configuration information into a preset language model, and outputting the target macro configuration, wherein the target macro data includes a target macro definition and a value enumeration of the target macro definition;
[0168] The target device is configured according to the target macro configuration.
[0169] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0170] To this end, an embodiment of the present invention provides a computer-readable storage medium (hereinafter referred to as a storage medium), which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any device configuration method provided in an embodiment of the present invention. For example, the computer program may be loaded by a processor to execute the following steps:
[0171] Obtain required configuration information of the target device to be configured;
[0172] Determining a target macro feature from the preset macro database according to a similarity between each preset macro feature in the preset macro database and a required configuration feature corresponding to the required configuration information;
[0173] Inputting the target macro data corresponding to the target macro feature and the required configuration information into a preset language model, and outputting the target macro configuration, wherein the target macro data includes a target macro definition and a value enumeration of the target macro definition;
[0174] The target device is configured according to the target macro configuration.
[0175] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0176] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.
[0177] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0178] The above is a detailed introduction to a device configuration method, apparatus, electronic device and storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A device configuration method, characterized in that: include: Obtain required configuration information of the target device to be configured; Determining a target macro feature from the preset macro database according to a similarity between each preset macro feature in the preset macro database and a required configuration feature corresponding to the required configuration information; Inputting the target macro data corresponding to the target macro feature and the required configuration information into a preset language model, and outputting the target macro configuration, wherein the target macro data includes a target macro definition and a value enumeration of the target macro definition; The target device is configured according to the target macro configuration.
2. The device configuration method according to claim 1, characterized in that: The preset macro database is updated according to the following steps: Obtaining script code corresponding to the target device; According to the code format in the script code, each macro data in the script code is identified, wherein the macro data includes a macro definition, and a configuration description and a value enumeration corresponding to the macro definition; Feature extraction is performed on each of the macro data to obtain macro features, and the macro features are updated to the preset macro database.
3. The device configuration method according to claim 1, characterized in that: The determining the target macro feature from the preset macro database according to the similarity between each preset macro feature in the preset macro database and the required configuration feature corresponding to the required configuration information comprises: Calculating the cosine similarity between the required configuration feature and each macro feature in the preset macro database; The macro features are sorted from large to small according to the cosine similarity, and a preset number of target macro features with top rankings are obtained.
4. The device configuration method according to claim 1, characterized in that: The step of obtaining the required configuration information of the target device to be configured includes: Obtain the configuration requirement order of the target device input by the user; Extracting the project type in the configuration requirement order and the project type parameters corresponding to the project type; The project type and the project type parameters corresponding to the project type are set as the required configuration information of the target device.
5. The device configuration method according to claim 1, characterized in that: The configuring the target device according to the target macro configuration includes: Writing the target macro configuration into the corresponding target code; Compiling the target code to obtain target embedded software; The target embedded software is stored in association with the required configuration information and fed back to the target device.
6. The device configuration method according to any one of claims 1 to 5, characterized in that: The training steps of the language model include: Acquire a training sample, wherein the training sample includes: sample requirement configuration information, at least two sample target macro data corresponding to the sample requirement configuration information, and a sample label including the sample target macro configuration; The training samples are input into a training language model, and the training language model is trained to obtain a language model.
7. A device configuration apparatus, characterized in that: The device configuration device comprises: An order management module is used to obtain the required configuration information of the target device to be configured; A scheduling processing module, configured to determine a target macro feature from the preset macro database according to a similarity between each preset macro feature in the preset macro database and a demand configuration feature corresponding to the demand configuration information; A language processing module, used for inputting the target macro data corresponding to each of the target macro features and the required configuration information into a preset language model, and outputting the target macro configuration, wherein the target macro data includes a target macro definition and a value enumeration of the target macro definition; The scheduling processing module is used to configure the target device according to the target macro configuration.
8. The device configuration apparatus according to claim 7, characterized in that: The scheduling processing module includes a scheduling unit, a review unit and a compiling unit; The scheduling processing module is used to configure the target device according to the target macro configuration, specifically including: The scheduling unit is used to write the target macro configuration into the corresponding target code, send the target code to the review unit, and send a compilation instruction to the compilation unit; The review unit is used to review and save the target code; The compiling unit is used to receive the compiling instruction, download the target code from the review unit, compile the target code, associate the compiled target embedded software with the required configuration information, store it, and feed it back to the target device.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps in the device configuration method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the device configuration method according to any one of claims 1 to 7.