Software configuration method and device, electronic equipment and storage medium
By automatically comparing and updating the configuration information of hardware devices, the problems of low efficiency and high error rate of software configuration when upgrading hardware devices in the embedded field are solved, and the maintainability and reusability of software configuration are improved.
Patent Information
- Application Number
- CN202411220365.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-27
AI Technical Summary
In the field of embedded, when upgrading hardware equipment of the same model of products, the existing technology requires manual changes to multiple software configurations, which consumes a lot of manpower, and mismatch in versions may cause fatal errors, resulting in low maintenance efficiency and high error rates.
By obtaining the first and second configuration information of the hardware device, using XML template processing to generate a DOM tree, automatically compare and update the software configuration, ensuring the compatibility of the software and hardware devices, and reducing manual intervention.
It improves the maintainability and reusability of software configuration code, realizes rapid software development and configuration after hardware equipment upgrade, and reduces labor costs and error rates.
Smart Images

Figure CN119201204A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of software configuration, and in particular to a software configuration method, device, electronic device and storage medium. Background Art
[0002] In the embedded field, the same model of products often have different hardware devices, and each hardware device is configured with matching software. In the process of software maintenance, the traditional approach is to make corresponding software for the configuration of each hardware device. If there are general changes or upgrade requirements for the configuration of multiple hardware devices, the software and its corresponding program documents and testing methods must change. In addition, the corresponding version of each hardware device must be recorded. Once the version of the software does not match the version of the hardware device, a fatal error will occur. It is very labor-intensive for R&D personnel to maintain multiple software.
[0003] Therefore, changing the software configuration to match the configuration of the corresponding hardware device is labor-intensive and is an existing problem.
[0004] Application Contents
[0005] In view of this, the purpose of the present application is to provide a software configuration method, device, electronic device and storage medium to solve the above-mentioned problems and realize easy and labor-saving changes to software configuration to match the configuration of corresponding hardware devices.
[0006] In a first aspect, an embodiment of the present application provides a software configuration method, which is applied to a server, and each hardware device is configured with matching software, and the method includes:
[0007] Obtain the jth first configuration information of the i-th hardware device; wherein the j-th first configuration information is the j-th configuration information set before the i-th hardware device is upgraded, and the j-th first configuration information includes: the j-th first operating system configuration information, the j-th first network card configuration information, the j-th first switch configuration information, the j-th first serial port configuration information, the j-th first 1553B configuration information and the j-th first log configuration information;
[0008] Obtain the jth second configuration information of the i-th hardware device; wherein the j-th second configuration information is the j-th configuration information set after the i-th hardware device is upgraded, and the j-th second configuration information includes: the j-th second operating system configuration information, the j-th second network card configuration information, the j-th second switch configuration information, the j-th second serial port configuration information, the j-th second 1553B configuration information and the j-th second log configuration information;
[0009] Process the j-th first configuration information based on the XML template to generate a j-th first configuration information XML file;
[0010] Generate a j-th first configuration information DOM tree according to the j-th first configuration information XML file;
[0011] If the name of the root element of the j-th first configuration information DOM tree is the same as the preset name, the j-th first configuration information is compared with the j-th second configuration information to obtain the j-th comparison result;
[0012] If the j-th comparison result is that the j-th first configuration information is different from the j-th second configuration information, the j-th software of the i-th hardware device is configured according to the j-th second configuration information.
[0013] Preferably, the jth software includes: jth operating system software;
[0014] The step of configuring the jth software of the ith hardware device according to the jth second configuration information includes:
[0015] According to the j-th second operating system configuration information, the j-th image image file corresponding to the operating system of the i-th hardware device is configured to obtain the j-th target image image file;
[0016] The jth target image file is loaded into the jth operating system software of the ith hardware device through the jth bootrom file.
[0017] Preferably, the jth second network card configuration information includes: the jth second network card type, the jth second network card IP address, the jth second network card MAC address and the jth second dual redundant network path number; the method further includes:
[0018] Generate the jth second network card driver file according to the jth second network card type;
[0019] Generate the jth second network card subnet mask according to the jth second network card IP address;
[0020] Generate a jth second network card configuration file according to the jth second network card subnet mask, the jth second dual redundant network path number, the jth second network card IP address and the jth second network card MAC address;
[0021] The jth network card software of the ith hardware device is configured according to the jth second network card configuration file and the jth second network card driver file.
[0022] Preferably, the j-th second switch value configuration information includes: the j-th second switch value type and the j-th second switch value acquisition period; the method further includes:
[0023] Generate the jth second switch quantity drive file according to the jth second switch quantity type;
[0024] Generate a j-th second switch value configuration file according to the j-th second switch value acquisition cycle;
[0025] The jth switch quantity software of the ith hardware device is configured according to the jth second switch quantity driver file and the jth second switch quantity configuration file.
[0026] Preferably, the jth second serial port configuration information includes: the jth second serial port type, the jth second serial port baud rate, the jth second serial port data bit, the jth second serial port stop bit and the jth second serial port check bit; the method further includes:
[0027] Generate the jth second serial port driver file according to the jth second serial port type;
[0028] Generate a jth second serial port configuration file according to the jth second serial port baud rate, the jth second serial port data bit, the jth second serial port stop bit and the jth second serial port check bit;
[0029] The jth serial port software of the ith hardware device is configured according to the jth second serial port driver file and the jth second serial port configuration file.
[0030] Preferably, the jth second 1553B configuration information includes: the jth second 1553B type and the jth second 1553B inspection type; the method further includes:
[0031] Generate the jth second 1553B driver file according to the jth second 1553B type;
[0032] generating a jth second 1553B configuration file according to the jth second 1553B inspection type;
[0033] The jth 1553B software of the ith hardware device is configured according to the 1553B driver file and the jth second 1553B configuration file.
[0034] Preferably, the j-th second log configuration information includes: a j-th second log storage path and a j-th second log storage number threshold; the method further includes:
[0035] Generate a j-th second log configuration file according to the j-th second log storage path and the j-th second log storage number threshold;
[0036] The j-th logging software of the ith hardware device is configured according to the j-th second log configuration file.
[0037] The software configuration method provided by this application brings the following beneficial effects:
[0038] The present application provides a software configuration method. In the method, the server can automatically compare the second configuration information with the first configuration information in the first configuration information DOM tree, and configure the software corresponding to the functions of each module after the configuration is changed according to the second configuration information. The maintainability of the software configuration code is improved, and the software corresponding to each module function updated by the upgraded hardware device can be quickly developed, thereby increasing the software reuse.
[0039] In a second aspect, the present application further provides a software configuration device, wherein each hardware device is configured with matching software, and the device comprises:
[0040] An acquisition module, used to acquire the jth first configuration information of the i-th hardware device; wherein the j-th first configuration information is the j-th configuration information set before the i-th hardware device is upgraded, and the j-th first configuration information includes: the j-th first operating system configuration information, the j-th first network card configuration information, the j-th first switch configuration information, the j-th first serial port configuration information, the j-th first 1553B configuration information and the j-th first log configuration information;
[0041] The acquisition module is further used to acquire the jth second configuration information of the i-th hardware device; wherein the j-th second configuration information is the j-th configuration information set after the i-th hardware device is upgraded, and the j-th second configuration information includes: the j-th second operating system configuration information, the j-th second network card configuration information, the j-th second switch configuration information, the j-th second serial port configuration information, the j-th second 1553B configuration information and the j-th second log configuration information;
[0042] An XML data processing module, used for processing the j-th first configuration information based on an XML template to generate a j-th first configuration information XML file;
[0043] The XML data processing module is further used to generate a j-th first configuration information DOM tree according to the j-th first configuration information XML file;
[0044] The XML data processing module is further used to compare the jth first configuration information with the jth second configuration information to obtain a jth comparison result if the name of the root element of the jth first configuration information DOM tree is the same as the preset name;
[0045] The software configuration module is used to configure the jth software of the ith hardware device according to the jth second configuration information if the jth comparison result is that the jth first configuration information is different from the jth second configuration information.
[0046] The software configuration device provided in the embodiment of the present application has the same technical features as the software configuration method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0047] In a third aspect, the present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the beneficial effects of any of the methods described above are achieved, which will not be repeated here.
[0048] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the beneficial effects of any of the methods described above are achieved, which will not be repeated here.
[0049] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application are realized and obtained by the structures particularly pointed out in the description and the drawings.
[0050] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 A flowchart of a software configuration method provided in an embodiment of the present application;
[0053] Figure 2 A schematic diagram of the structure of a software configuration device provided in an embodiment of the present application;
[0054] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0056] To facilitate understanding of this embodiment, the embodiments of the present application are described in detail below.
[0057] The present application embodiment provides a software configuration method, which is applied to a server, and each hardware device is configured with matching software, such as Figure 1 As shown, Figure 1 A flowchart of a software configuration method provided in an embodiment of the present application. The method comprises the following steps:
[0058] S101, the server obtains the jth first configuration information of the ith hardware device.
[0059] Among them, the jth first configuration information is the jth configuration information set before the i-th hardware device is upgraded, and the j-th first configuration information includes: the j-th first operating system configuration information, the j-th first network card configuration information, the j-th first switch quantity configuration information, the j-th first serial port configuration information, the j-th first 1553B configuration information and the j-th first log configuration information.
[0060] Specifically, the first configuration information of the first hardware device is taken as an example for introduction. The server obtains the first configuration information from the hardware device through a high-speed data bus to determine the specific configuration information of the operating system, network card, switch module, serial port, 1553B module and log module of the hardware device before the hardware device is upgraded.
[0061] S102: The server obtains the j-th second configuration information of the ith hardware device.
[0062] Among them, the jth second configuration information is the jth configuration information set after the i-th hardware device is upgraded, and the j-th second configuration information includes: the j-th second operating system configuration information, the j-th second network card configuration information, the j-th second switch quantity configuration information, the j-th second serial port configuration information, the j-th second 1553B configuration information and the j-th second log configuration information.
[0063] Specifically, the first second configuration information of the first hardware device is taken as an example for introduction. After the hardware device is upgraded, part or all of the configuration information of the operating system, network card, switch module, serial port, 1553B module and log module of the hardware device will change. The server obtains the second configuration information from the hardware device through the high-speed data bus to determine the specific changes of the second configuration information.
[0064] S103: The server processes the j-th first configuration information based on the XML template to generate a j-th first configuration information XML file.
[0065] Specifically, the first configuration information processing and the first configuration information XML file are taken as examples for introduction. XML template is a document for defining a data structure, which can be used to describe the first configuration information. The first configuration information XML file generated above can be adapted to the storage format of the first configuration information.
[0066] S104: The server generates a j-th first configuration information DOM tree according to the j-th first configuration information XML file.
[0067] Specifically, the first configuration information DOM tree is generated according to the first configuration information XML file as an example. The first configuration information DOM tree is used to represent the programming interface of the first configuration information XML file. The first configuration information DOM tree regards each first configuration information in the first configuration information XML file as a node, and represents the structure of the entire first configuration information XML file through the hierarchical relationship between each node.
[0068] S105: If the name of the root element of the j-th first configuration information DOM tree is the same as the preset name, the server compares the j-th first configuration information with the j-th second configuration information to obtain the j-th comparison result.
[0069] Specifically, the first configuration information DOM tree, the first configuration information and the first second configuration information are taken as examples for introduction. The above-mentioned root element is the starting identifier for traversing the first configuration information DOM tree, and the server determines whether to start traversing the nodes of the first configuration information DOM tree according to the name of the root element. If the name of the root element is the same as the preset name, for example, the preset name is syscfg, and the name of the root element is also syscfg, then the server starts to traverse the nodes of the first configuration information DOM tree. The process in which the server starts to traverse the nodes of the first configuration information DOM tree is the process of comparing the first configuration information with the second configuration information. With such a setting, the difference between the first configuration information and the second configuration information can be determined.
[0070] S106: If the j-th comparison result is that the j-th first configuration information is different from the j-th second configuration information, the server configures the j-th software of the i-th hardware device according to the j-th second configuration information.
[0071] Specifically, the first configuration information and the second configuration information are used as examples for introduction. If the comparison result is that the first configuration information is different from the second configuration information, it means that part or all of the first configuration information has changed after the hardware device is upgraded. In this case, the software in the hardware device needs to be changed according to the second configuration information so that the various functions of the hardware device can be used normally.
[0072] The embodiment of the present application provides a software configuration method, which compares the first configuration information with the second configuration information through a server. If the first configuration information is different from the second configuration information, the software in the hardware device needs to be changed according to the second configuration information. In the prior art, it is necessary to manually change the software corresponding to each module function updated by the hardware device according to the second configuration information. This process not only consumes human resources, but also is prone to change errors. Compared with the prior art, this method does not require staff to change the software of the hardware device one by one according to the second configuration information. The server can automatically compare the second configuration information with the first configuration information in the DOM tree of the first configuration information, and configure the software corresponding to the functions of each module after the configuration is changed according to the second configuration information. The maintainability of the software configuration code is improved, and the software corresponding to each module function updated by the upgraded hardware device can be quickly developed, thereby increasing the software reuse.
[0073] The configuration method of the jth operating system software is introduced below. The jth software includes: the jth operating system software. The server configures the jth image image file corresponding to the operating system of the i-th hardware device according to the j-th second operating system configuration information, obtains the j-th target image image file, and loads the j-th target image image file into the j-th operating system software of the i-th hardware device through the j-th bootrom file.
[0074] Specifically, the configuration method of the first operating system software is taken as an example for introduction. After the operating system of the hardware device is upgraded, the upgraded operating system software needs to be configured to enable the operating system of the hardware device to self-start. The second operating system configuration information includes: the model of the processor is Loongson3a7a, the number of cores of the processor is 1, and the model of the operating system corresponding to the processor is vxworks. An image image file is pre-set in the hardware device, and the image image file has all the configuration information of the operating system of the hardware device. After the operating system of the hardware device is upgraded, the server needs to configure the image image file according to the second operating system configuration information, obtain the target image image file, and load the target image image file into the RAM (Random Access Memory) of the operating system software to complete the configuration of the operating system software. Among them, the bootrom file is the boot file of the image image file, which is used to load the image image file into the RAM of the operating system software.
[0075] This method configures the target image file according to the second operating system configuration information, which can ensure the compatibility of the operating system with the upgraded hardware device and reduce performance problems caused by mismatch. In addition, when the operating system fails, the target image file can be quickly loaded through the bootrom file to achieve rapid system recovery and reduce business interruption time.
[0076] The configuration method of the jth network card software is introduced below. The jth second network card configuration information includes: the jth second network card type, the jth second network card IP address, the jth second network card MAC address and the jth second dual redundant network path. The server generates the jth second network card driver file according to the jth second network card type; generates the jth second network card subnet mask according to the jth second network card IP address; generates the jth second network card configuration file according to the jth second network card subnet mask, the jth second dual redundant network path, the jth second network card IP address and the jth second network card MAC address; configures the jth network card software of the i-th hardware device according to the jth second network card configuration file and the jth second network card driver file.
[0077] Specifically, the configuration method of the first network card software is taken as an example for introduction. After the network card of the hardware device is upgraded, the upgraded network card software needs to be configured to enable the network card of the hardware device to work normally. The second network card configuration information includes: the second network card type is gmac, the second network card IP address is 192.168.0.1, the second network card MAC address is 28-DF-EB-CF-FC-74, and the second dual redundant network paths are 1 and 2. The server generates a second network card driver file according to the second network card type. For example, if the second network card type is gmac, a second gmac network card driver file is generated; if the second network card type is Netcom, a second Netcom network card driver file is generated. The second network card driver file is used to drive the network card so that the network card starts normally. In order to distinguish the network part and the host part in the IP address of the network card of the hardware device, it is necessary to generate the second network card subnet mask according to the second network card IP address. The server performs dual-redundancy configuration on the network card software according to the second dual-redundant network route and the second network card IP address, for example, the second dual-redundant network route is 1 and 2, and the second network card IP address is 192.168.0.1. Then the configured network card software can configure the dual-redundant network routes of the network card of the upgraded hardware device to 1 and 2, and configure the dual-redundant network routes 1 and 2 of the network card of the upgraded hardware device to a unified IP address (192.168.0.1). Thus, when the upgraded hardware device receives or sends network data, it can receive or send network data through another network channel even if one network channel fails. The server loads the second network card configuration file and the second network card driver file into the network card software to complete the configuration of the network card software.
[0078] This method configures the network card software through the second network card configuration file, which can reduce errors and inconsistencies introduced by manual configuration. The second network card driver file can enable the network card to start normally. The second network card configuration file allows accurate setting of various parameters of the network card software, such as the second network card IP address and the second network card MAC address, to ensure the accuracy of the configuration of the network card software. The network card configuration file can realize automatic configuration of the network card software, greatly improving work efficiency. Configuring the network card software through the network card configuration file makes the configuration process more intuitive and convenient, without the need to manually enter complex configuration commands, saving manpower.
[0079] The configuration method of the jth switch quantity software is introduced below. The jth second switch quantity configuration information includes: the jth second switch quantity type and the jth second switch quantity acquisition cycle. The server generates the jth second switch quantity driver file according to the jth second switch quantity type; generates the jth second switch quantity configuration file according to the jth second switch quantity acquisition cycle; and configures the jth switch quantity software of the i-th hardware device according to the jth second switch quantity driver file and the jth second switch quantity configuration file.
[0080] Specifically, the configuration method of the first switch quantity software is taken as an example for introduction. After the switch quantity of the hardware device is upgraded, the upgraded switch quantity software needs to be configured to enable the switch quantity module of the hardware device to work normally. The second switch quantity configuration information includes: the second switch quantity type is typeA, and the second switch quantity acquisition period is 0.000001s. The server generates a second switch quantity driver file according to the second switch quantity type. For example, if the second switch quantity type is typeA, a second typeA switch quantity driver file is generated. The second switch quantity driver file is used to drive the switch quantity module so that the switch quantity module starts normally. The server loads the second switch quantity configuration file and the second switch quantity driver file into the switch quantity software to complete the configuration of the switch quantity module.
[0081] This method configures the switch module through the second switch configuration file, which reduces the errors and tediousness of manual configuration and improves configuration efficiency. The second switch driver file can enable the switch to start normally. When the configuration of the switch module needs to be readjusted, only the second switch configuration file needs to be modified, which is convenient for subsequent maintenance and upgrades.
[0082] The configuration method of the jth serial port software is introduced below. The jth second serial port configuration information includes: the jth second serial port type, the jth second serial port baud rate, the jth second serial port data bit, the jth second serial port stop bit and the jth second serial port check bit. The server generates the jth second serial port driver file according to the jth second serial port type; generates the jth second serial port configuration file according to the jth second serial port baud rate, the jth second serial port data bit, the jth second serial port stop bit and the jth second serial port check bit; and configures the jth serial port software of the i-th hardware device according to the jth second serial port driver file and the jth second serial port configuration file.
[0083] Specifically, the configuration method of the first serial port software is taken as an example for introduction. After the serial port of the hardware device is upgraded, the upgraded serial port software needs to be configured to enable the serial port module of the hardware device to work normally. The second serial port configuration information includes: the second serial port type is CH340, the second serial port baud rate is 19200, the second serial port data bit is 8 bits, the second serial port stop bit is 1 bit, and the second serial port check bit is 1. The server generates a second serial port driver file according to the second serial port type. For example, if the second serial port type is CH340, a second CH340 serial port driver file is generated. The second serial port driver file is used to drive the serial port module so that the serial port module starts normally. The server loads the second serial port configuration file and the second serial port driver file into the serial port software to complete the configuration of the serial port module.
[0084] This method can configure multiple serial port modules at one time by loading the second serial port configuration file, avoiding the tedious process of manual configuration one by one, thereby greatly improving the configuration efficiency. The second serial port driver file can enable the serial port to start normally. This method can prevent hardware device failure or data loss caused by misoperation to a certain extent.
[0085] The configuration method of the jth 1553B software is introduced below. The jth second 1553B configuration information includes: the jth second 1553B type and the jth second 1553B inspection type. The server generates the jth second 1553B driver file according to the jth second 1553B type; generates the jth second 1553B configuration file according to the jth second 1553B inspection type; and configures the jth 1553B software of the i-th hardware device according to the 1553B driver file and the jth second 1553B configuration file.
[0086] Specifically, the configuration method of the first 1553B software is taken as an example for introduction. After the 1553B of the hardware device is upgraded, the upgraded 1553B software needs to be configured to enable the 1553B module of the hardware device to work normally. The second 1553B configuration information includes: the second 1553B type is BT, and the second 1553B inspection type is 1188A. The server generates a second 1553B driver file according to the second 1553B type. For example, if the second 1553B type is BT, a second BT-1553B driver file is generated. The second 1553B driver file is used to drive the 1553B module so that the 1553B module starts normally. In addition, after the server configures the 1553B software according to the 1553B type, the target 1553B software is obtained. Then the target 1553B software configures the data transmission mode of the 1553B module to BT. The server loads the second 1553B configuration file and the second 1553B driver file into the 1553B software to complete the configuration of the 1553B module.
[0087] The method greatly simplifies the complexity of 1553B software configuration through the second 1553B configuration file and the second 1553B driver file. The method does not require complicated operations on the hardware device.
[0088] The configuration method of the jth log recording software is introduced below. The jth second log configuration information includes: the jth second log storage path and the jth second log storage number threshold. The server generates the jth second log configuration file according to the jth second log storage path and the jth second log storage number threshold, and configures the jth log recording software of the i-th hardware device according to the jth second log configuration file.
[0089] Specifically, the configuration method of the first log recording software is taken as an example for introduction. After the hardware device is upgraded, the log recording software corresponding to the log recording module of the hardware device also needs to be configured to enable the log recording function of the hardware device to be normally implemented. The second 1553B configuration information includes: the second log storage path is / log, and the second log storage number threshold is 1000. The server loads the second log configuration file into the log software to complete the configuration of the log recording module.
[0090] In this way, the server loads the second log configuration file into the log software, and the configuration of the log recording module can be completed without human intervention, which greatly improves the configuration efficiency. Using the second log configuration file can reduce human errors and improve the accuracy and reliability of configuration.
[0091] Based on the above method embodiment, the present application embodiment provides a software configuration device, each hardware device is configured with matching software, such as Figure 2 As shown, Figure 2 This is a schematic diagram of the structure of a software configuration device provided in an embodiment of the present application. The device includes an acquisition module 21, an XML data processing module 22 and a software configuration module 23. The functions of each module of the device are as follows:
[0092] The acquisition module 21 is used to acquire the jth first configuration information of the i-th hardware device; wherein the j-th first configuration information is the j-th configuration information set before the i-th hardware device is upgraded, and the j-th first configuration information includes: the j-th first operating system configuration information, the j-th first network card configuration information, the j-th first switch configuration information, the j-th first serial port configuration information, the j-th first 1553B configuration information and the j-th first log configuration information;
[0093] The acquisition module 21 is further used to acquire the jth second configuration information of the i-th hardware device; wherein the j-th second configuration information is the j-th configuration information set after the i-th hardware device is upgraded, and the j-th second configuration information includes: the j-th second operating system configuration information, the j-th second network card configuration information, the j-th second switch configuration information, the j-th second serial port configuration information, the j-th second 1553B configuration information and the j-th second log configuration information;
[0094] An XML data processing module 22, configured to process the j-th first configuration information based on an XML template to generate a j-th first configuration information XML file;
[0095] The XML data processing module 22 is further used to generate a j-th first configuration information DOM tree according to the j-th first configuration information XML file;
[0096] The XML data processing module 22 is further configured to compare the jth first configuration information with the jth second configuration information to obtain a jth comparison result if the name of the root element of the jth first configuration information DOM tree is the same as the preset name;
[0097] The software configuration module 23 is configured to configure the jth software of the ith hardware device according to the jth second configuration information if the jth comparison result is that the jth first configuration information is different from the jth second configuration information.
[0098] Preferably, the jth software includes: jth operating system software;
[0099] The software configuration module 23 is specifically used to configure the jth image file corresponding to the operating system of the i-th hardware device according to the jth second operating system configuration information to obtain the jth target image file;
[0100] The software configuration module 23 is specifically configured to load the jth target image file into the jth operating system software of the ith hardware device through the jth bootrom file.
[0101] Preferably, the jth second network card configuration information includes: the jth second network card type, the jth second network card IP address, the jth second network card MAC address and the jth second dual-redundant network path number;
[0102] The software configuration module 23 is further used to generate a j-th second network card driver file according to the j-th second network card type;
[0103] The software configuration module 23 is further used to generate a j-th second network card subnet mask according to the j-th second network card IP address;
[0104] The software configuration module 23 is further used to generate a jth second network card configuration file according to the jth second network card subnet mask, the jth second dual redundant network path number, the jth second network card IP address and the jth second network card MAC address;
[0105] The software configuration module 23 is further used to configure the jth network card software of the ith hardware device according to the jth second network card configuration file and the jth second network card driver file.
[0106] Preferably, the jth second switch value configuration information includes: the jth second switch value type and the jth second switch value acquisition period;
[0107] The software configuration module 23 is further used to generate a j-th second switch value driver file according to the j-th second switch value type;
[0108] The software configuration module 23 is further used to generate a j-th second switch value configuration file according to the j-th second switch value acquisition cycle;
[0109] The software configuration module 23 is further used to configure the jth switch value software of the ith hardware device according to the jth second switch value driver file and the jth second switch value configuration file.
[0110] Preferably, the jth second serial port configuration information includes: the jth second serial port type, the jth second serial port baud rate, the jth second serial port data bit, the jth second serial port stop bit and the jth second serial port check bit;
[0111] The software configuration module 23 is further used to generate a j-th second serial port driver file according to the j-th second serial port type;
[0112] The software configuration module 23 is further used to generate a jth second serial port configuration file according to the jth second serial port baud rate, the jth second serial port data bit, the jth second serial port stop bit and the jth second serial port check bit;
[0113] The software configuration module 23 is further configured to configure the jth serial port software of the ith hardware device according to the jth second serial port driver file and the jth second serial port configuration file.
[0114] Preferably, the jth second 1553B configuration information includes: the jth second 1553B type and the jth second 1553B inspection type;
[0115] The software configuration module 23 is further used to generate a j-th second 1553B driver file according to the j-th second 1553B type;
[0116] The software configuration module 23 is further used to generate a j-th second 1553B configuration file according to the j-th second 1553B inspection type;
[0117] The software configuration module 23 is further used to configure the jth 1553B software of the ith hardware device according to the 1553B driver file and the jth second 1553B configuration file.
[0118] Preferably, the j-th second log configuration information includes: a j-th second log storage path and a j-th second log storage number threshold;
[0119] The software configuration module 23 is further used to generate a j-th second log configuration file according to the j-th second log storage path and the j-th second log storage number threshold;
[0120] The software configuration module 23 is further configured to configure the jth logging software of the ith hardware device according to the jth second log configuration file.
[0121] The software configuration device provided in the embodiment of the present application has the same technical features as the software configuration method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0122] An embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned software configuration method.
[0123] See also Figure 3 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine executable instructions that can be executed by the processor 100. The processor 100 executes the machine executable instructions to implement the above software configuration method.
[0124] Further, Figure 3 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .
[0125] Among them, the memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 102 can be an ISA (Industrial Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Enhanced Industry Standard Architecture) bus, etc. The above-mentioned bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0126] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 100. The above processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the above embodiment in combination with its hardware.
[0127] This embodiment also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned software configuration method.
[0128] The computer program product of the software configuration method, device, and electronic device provided in the embodiments of the present application includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can refer to the method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the previous method embodiment, which will not be repeated here.
[0129] In addition, in the description of the embodiments of the present application, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0130] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application 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 application. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0131] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A software configuration method, characterized in that: Applied to a server, each hardware device is configured with matching software, and the method includes: Obtain the jth first configuration information of the i-th hardware device; wherein the j-th first configuration information is the j-th configuration information set before the i-th hardware device is upgraded, and the j-th first configuration information includes: the j-th first operating system configuration information, the j-th first network card configuration information, the j-th first switch configuration information, the j-th first serial port configuration information, the j-th first 1553B configuration information and the j-th first log configuration information; Obtain the jth second configuration information of the i-th hardware device; wherein the j-th second configuration information is the j-th configuration information set after the i-th hardware device is upgraded, and the j-th second configuration information includes: the j-th second operating system configuration information, the j-th second network card configuration information, the j-th second switch configuration information, the j-th second serial port configuration information, the j-th second 1553B configuration information and the j-th second log configuration information; Process the j-th first configuration information based on the XML template to generate a j-th first configuration information XML file; Generate a j-th first configuration information DOM tree according to the j-th first configuration information XML file; If the name of the root element of the j-th first configuration information DOM tree is the same as the preset name, the j-th first configuration information is compared with the j-th second configuration information to obtain the j-th comparison result; If the j-th comparison result is that the j-th first configuration information is different from the j-th second configuration information, the j-th software of the i-th hardware device is configured according to the j-th second configuration information.
2. The software configuration method according to claim 1, characterized in that: The jth software includes: the jth operating system software; The step of configuring the jth software of the ith hardware device according to the jth second configuration information includes: According to the j-th second operating system configuration information, the j-th image image file corresponding to the operating system of the i-th hardware device is configured to obtain the j-th target image image file; The jth target image file is loaded into the jth operating system software of the ith hardware device through the jth bootrom file.
3. The software configuration method according to claim 2, characterized in that: The j-th second network card configuration information includes: the j-th second network card type, the j-th second network card IP address, the j-th second network card MAC address and the j-th second dual redundant network path number; the method further includes: Generate the jth second network card driver file according to the jth second network card type; Generate the jth second network card subnet mask according to the jth second network card IP address; Generate a jth second network card configuration file according to the jth second network card subnet mask, the jth second dual redundant network path number, the jth second network card IP address and the jth second network card MAC address; The jth network card software of the ith hardware device is configured according to the jth second network card configuration file and the jth second network card driver file.
4. The software configuration method according to claim 3, characterized in that: The j-th second switch value configuration information includes: the j-th second switch value type and the j-th second switch value acquisition period; the method further includes: Generate the jth second switch quantity driver file according to the jth second switch quantity type; Generate a j-th second switch value configuration file according to the j-th second switch value acquisition cycle; The jth switch quantity software of the ith hardware device is configured according to the jth second switch quantity driver file and the jth second switch quantity configuration file.
5. The software configuration method according to claim 4, characterized in that: The jth second serial port configuration information includes: the jth second serial port type, the jth second serial port baud rate, the jth second serial port data bit, the jth second serial port stop bit and the jth second serial port check bit; the method further includes: Generate the jth second serial port driver file according to the jth second serial port type; Generate a jth second serial port configuration file according to the jth second serial port baud rate, the jth second serial port data bit, the jth second serial port stop bit and the jth second serial port check bit; The jth serial port software of the ith hardware device is configured according to the jth second serial port driver file and the jth second serial port configuration file.
6. The software configuration method according to claim 5, characterized in that: The j-th second 1553B configuration information includes: the j-th second 1553B type and the j-th second 1553B inspection type; the method further includes: Generate the jth second 1553B driver file according to the jth second 1553B type; generating a jth second 1553B configuration file according to the jth second 1553B inspection type; The jth 1553B software of the ith hardware device is configured according to the 1553B driver file and the jth second 1553B configuration file.
7. The software configuration method according to claim 6, characterized in that: The j-th second log configuration information includes: the j-th second log storage path and the j-th second log storage number threshold; the method further includes: Generate a j-th second log configuration file according to the j-th second log storage path and the j-th second log storage number threshold; The j-th logging software of the ith hardware device is configured according to the j-th second log configuration file.
8. A software configuration device, characterized in that: Each hardware device is configured with matching software, and the device includes: An acquisition module, used to acquire the jth first configuration information of the i-th hardware device; wherein the j-th first configuration information is the j-th configuration information set before the i-th hardware device is upgraded, and the j-th first configuration information includes: the j-th first operating system configuration information, the j-th first network card configuration information, the j-th first switch configuration information, the j-th first serial port configuration information, the j-th first 1553B configuration information and the j-th first log configuration information; The acquisition module is further used to acquire the jth second configuration information of the i-th hardware device; wherein the j-th second configuration information is the j-th configuration information set after the i-th hardware device is upgraded, and the j-th second configuration information includes: the j-th second operating system configuration information, the j-th second network card configuration information, the j-th second switch configuration information, the j-th second serial port configuration information, the j-th second 1553B configuration information and the j-th second log configuration information; An XML data processing module, used for processing the j-th first configuration information based on an XML template to generate a j-th first configuration information XML file; The XML data processing module is further used to generate a j-th first configuration information DOM tree according to the j-th first configuration information XML file; The XML data processing module is further used to compare the jth first configuration information with the jth second configuration information to obtain a jth comparison result if the name of the root element of the jth first configuration information DOM tree is the same as the preset name; The software configuration module is used to configure the jth software of the ith hardware device according to the jth second configuration information if the jth comparison result is that the jth first configuration information is different from the jth second configuration information.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are executed.