Password modification method, device, computer program product, equipment and medium
By simulating the operation of the input device and using baseboard management controller address and image recognition technology, the server's BIOS password is automatically modified, which solves the problems of low efficiency and poor accuracy of BIOS password modification in the existing technology, and achieves efficient and accurate batch modification. .
Patent Information
- Application Number
- CN202410857611.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-28
AI Technical Summary
In the existing technology, the BIOS password modification process relies on manual operations, resulting in low efficiency, difficulty in ensuring accuracy, and the inability to realize automation. Especially in large-volume server modification scenarios, the labor cost and time cost are high, and the modification status cannot be traced.
By obtaining the baseboard management controller address and password configuration information of the server, simulate the login operation of the input device, display the main page of the baseboard management controller, remotely connect to the basic input and output system main page, and enter the target password on the security configuration page to automatically modify it. The server's BIOS password uses image recognition technology to simulate manual operation and achieve fully automated modification.
It greatly reduces dependence on labor, improves modification efficiency and accuracy, saves labor and time costs, and enables traceability of modifications. It is suitable for large-volume server scenarios.
Smart Images

Figure CN118410477B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a password modification method, apparatus, computer program product, device and medium. Background Art
[0002] BIOS (Basic Input Output System) is a tamper-proof startup program engraved on the motherboard ROM (Read-Only Memory) chip. It is responsible for calculating the system self-check program and the system self-start program, so it is the first program after the computer system starts. Due to its tamper-proof nature, the program is stored in the ROM chip and can still maintain the original settings after power failure. The main function of BIOS is to control the basic programs after the computer starts, including hard disk drive, keyboard settings, floppy disk drive, memory and related devices.
[0003] Customers in some important industries have special requirements for server BIOS passwords, requiring them to be changed regularly to prevent criminals from taking advantage of possible network vulnerabilities to control the BIOS and thus the server, which could lead to a large number of servers being controlled and the business being affected.
[0004] From a security perspective, the BIOS password policy is set to not allow the password to be turned off by command, interface operation, etc. once it is enabled. It must be operated at the physical level. The specific operation method is to turn off the computer and adjust the DIP switch on the motherboard to turn it off. In addition, there are no underlying commands to modify the BIOS password. It must be modified through the BIOS configuration interface. This design will also avoid the possibility of large-scale servers being illegally manipulated. When the number of machines is small, you can restart the servers one by one to enter the BIOS interface, and then manually enter the password to perform the modification. However, when there are hundreds or thousands of machines that need to modify the password, manually entering the password to modify it will generate a huge workload and extremely low efficiency. In addition, manual password entry will inevitably result in errors and omissions, and the accuracy and integrity of the work cannot be guaranteed.
[0005] Based on the above content, it can be seen that there are at least the following problems in manually modifying BIOS passwords in batches:
[0006] 1. Manual repetitive assembly line operations are prone to operational errors due to operational and visual fatigue, leading to problems such as incorrect corrections and missed corrections.
[0007] 2. The manual modification process requires switching back and forth between viewing the password and entering the password, which is cumbersome.
[0008] 3. The actual operation is highly dependent on engineers. When there are a large number of servers, a large number of manpower must be invested using a human wave tactic, which is inefficient and causes a huge waste of manpower costs and time. It is not suitable for projects that are urgently delivered.
[0009] 4. Manual modification cannot record the modification process, and the modification results cannot be traced. Summary of the invention
[0010] In view of the above problems, embodiments of the present application provide a password modification method, apparatus, computer program product, device and medium that overcome the above problems or at least partially solve the above problems.
[0011] In a first aspect, an embodiment of the present application provides a password modification method, comprising:
[0012] Acquire a configuration file including password configuration information corresponding to a plurality of servers respectively, wherein the password configuration information at least includes a baseboard management controller address and a target password of the server, and the target password is an updated basic input and output system password;
[0013] Based on the baseboard management controller address of the server and the login operation of the simulated input device, displaying a baseboard management controller main page;
[0014] Based on the remote page start mark in the baseboard management controller main page, display the basic input and output system main page, and simulate the switching operation of the input device to control the basic input and output system main page to switch to the basic input and output system security configuration page;
[0015] The input operation of the input device is simulated, and the target password is input on the BIOS security configuration page to modify the BIOS password of the server.
[0016] Optionally, displaying a baseboard management controller main page based on the baseboard management controller address of the server and a login operation of a simulated input device includes:
[0017] Opening a baseboard management controller login page on a browser according to the baseboard management controller address of the server;
[0018] Simulating a login operation of the input device in the baseboard management controller login page based on the login information, and opening the baseboard management controller main page;
[0019] The password configuration information includes the login information, and the login information includes a login account and a login password corresponding to the baseboard management controller.
[0020] Optionally, opening a baseboard management controller login page on a browser side according to the baseboard management controller address of the server includes:
[0021] After opening the browser, simulating the input operation of the input device in the browser based on the baseboard management controller address of the server, and opening the webpage corresponding to the baseboard management controller;
[0022] The web page is matched with the picture in the background picture library corresponding to the server, and the baseboard management controller login page is opened when the match is successful.
[0023] Optionally, matching the web page with a picture in a background picture library corresponding to the server and opening the baseboard management controller login page when the match is successful includes:
[0024] Matching the web page with a security page image in a backend image library corresponding to the server;
[0025] In the case where the web page successfully matches the security page image, determining that the web page is a security page, and simulating a touch operation of the input device in the security page to display the baseboard management controller login page;
[0026] If the web page and the security page image are not matched successfully, matching the web page with the login page image in the background image library corresponding to the server;
[0027] When the web page matches the login page image successfully, it is determined that the web page is the baseboard management controller login page.
[0028] Optionally, simulating a touch operation of the input device within the security page to display the baseboard management controller login page includes:
[0029] Simulate a touch operation of the input device on a target option in the security page to display a first page, wherein the target option is a page switching entry;
[0030] The first page is verified, and after successful verification, the first page is determined to be the baseboard management controller login page.
[0031] Optionally, the verifying the first page and determining that the first page is the baseboard management controller login page after successful verification includes:
[0032] Matching the first page with a login page image in a background image library corresponding to the server;
[0033] When the first page successfully matches the login page image, it is determined that the displayed first page is the baseboard management controller login page.
[0034] Optionally, simulating a login operation of the input device in the baseboard management controller login page based on the login information to open the baseboard management controller main page includes:
[0035] In response to a login operation simulated based on the login information, displaying a second page;
[0036] Matching the second page with a first main page image in a background image library corresponding to the server, wherein the first main page image is an image of a main page of an associated baseboard management controller;
[0037] When the second page successfully matches the first main page image, it is determined that the second page is the baseboard management controller main page.
[0038] Optionally, displaying a basic input / output system main page based on a remote page start identifier in the main page of the baseboard management controller includes:
[0039] Simulating a touch operation of the input device on the remote page start identifier to display a remote page associated with the server;
[0040] The remote page is matched with the picture in the background picture library corresponding to the server, and the basic input and output system main page is displayed when the match is successful.
[0041] Optionally, matching the remote page with a picture in a background picture library corresponding to the server, and displaying the basic input and output system main page when the match is successful, includes:
[0042] Matching the remote page with the password input page image in the background image library;
[0043] When the match is successful, the BIOS main page is displayed based on the BIOS initial password, and the password configuration information includes the BIOS initial password corresponding to the server;
[0044] If the match is unsuccessful, the remote page is matched with the second main page picture in the background picture library. When the match is successful, it is determined that the remote page is the basic input and output system main page, and the second main page picture is a picture associated with the basic input and output system main page.
[0045] Optionally, triggering the display of the BIOS home page based on the BIOS initial password includes:
[0046] When the remote page successfully matches the password input page image, determining that the remote page is a password input page;
[0047] Simulating the input operation of the input device in the password input page based on the basic input and output system initial password, and controlling the remote page to switch to a third page;
[0048] Matching the third page with the second main page image;
[0049] When the third page successfully matches the second main page image, it is determined that the second page is the basic input and output system main page.
[0050] Optionally, the simulating the switching operation of the input device to control the basic input and output system main page to switch to the basic input and output system security configuration page includes:
[0051] In response to the simulated switching operation, controlling the basic input and output system main page to switch to a fourth page;
[0052] Matching the fourth page with a security configuration page image in a background image library corresponding to the server;
[0053] When the fourth page successfully matches the security configuration page image, it is determined that the fourth page is the basic input / output system security configuration page.
[0054] Optionally, simulating the input operation of the input device and inputting the target password on the basic input / output system security configuration page to modify the basic input / output system password of the server includes:
[0055] In response to the simulated input operation, inputting target information in the BIOS security configuration page, wherein, when the password configuration information includes a BIOS initial password, the target information includes the BIOS initial password and the target password, and when the password configuration information does not include the BIOS initial password, the target information includes the target password;
[0056] The target information input in the BIOS security configuration page is saved and the server is restarted to modify the BIOS password of the server.
[0057] Optionally, the step of saving the target information inputted in the basic input / output system security configuration page and restarting the server to modify the basic input / output system password of the server includes:
[0058] Simulate the switching operation of the input device in the basic input and output system security configuration page to display the fifth page;
[0059] Matching the fifth page with a configuration saving page image in a background image library corresponding to the server;
[0060] When the match is successful, determining that the fifth page is a basic input and output system configuration saving page;
[0061] Simulate the save and restart operation of the input device in the basic input and output system configuration save page to control the server to restart;
[0062] Wherein, when the server is restarted successfully, the basic input and output system password of the server is modified successfully.
[0063] Optionally, the method further comprises:
[0064] Get the mapping relationship between server model and backend image library;
[0065] According to the model parameters of each server corresponding to the configuration file and the mapping relationship, the background image library corresponding to the server is determined.
[0066] Optionally, the method further comprises:
[0067] Determining at least one server model according to the multiple servers corresponding to the configuration file;
[0068] A background picture library corresponding to at least one server model is created, and a mapping relationship between the server model and the background picture library is established.
[0069] Optionally, the multiple servers corresponding to the configuration file modify the basic input and output system passwords in sequence according to a preset order, and the preset order is the arrangement order of the password configuration information corresponding to the multiple servers in the configuration file.
[0070] In a second aspect, an embodiment of the present application provides a password modification device, comprising:
[0071] A first acquisition module is used to acquire a configuration file including password configuration information corresponding to a plurality of servers, wherein the password configuration information at least includes a baseboard management controller address and a target password of the server, and the target password is an updated basic input and output system password;
[0072] A display module, configured to display a baseboard management controller main page based on the baseboard management controller address of the server and a login operation of a simulated input device;
[0073] A processing module, configured to display a basic input / output system main page based on a remote page start identifier in the baseboard management controller main page, and simulate a switching operation of the input device to control the basic input / output system main page to switch to a basic input / output system security configuration page;
[0074] The input modification module is used to simulate the input operation of the input device and input the target password on the basic input / output system security configuration page to modify the basic input / output system password of the server.
[0075] In a third aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which implements the password modification method described in the first aspect when executed by a processor.
[0076] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the password modification method described in the first aspect when executed by the processor.
[0077] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the password modification method described in the first aspect is implemented.
[0078] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0079] Based on the baseboard management controller address of the server and the login operation of the simulated input device, the baseboard management controller main page is displayed, and the baseboard management controller main page jumps to the basic input and output system main page based on the remote connection, and the basic input and output system main page is controlled to switch to the basic input and output system security configuration page according to the simulated switching operation. The target password is entered on the basic input and output system security configuration page to modify the server password. The automatic modification of the BIOS password can be achieved by simulating manual operation, which changes the current situation that the BIOS password modification of the server cannot be realized automatically, and greatly reduces the dependence of this work on manual work. The automated modification method can trace the modification while ensuring accuracy, and also provides a solution for the scenario of large-scale server modification, which greatly saves labor and time costs and improves processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 A schematic diagram of a password modification method provided in an embodiment of the present application;
[0081] Figure 2A flowchart of entering the BMC main page based on the BMC address provided in an embodiment of the present application;
[0082] Figure 3 A flowchart of switching from the BMC main page to the BIOS main page provided in an embodiment of the present application;
[0083] Figure 4 An implementation flow chart of password modification on the BIOS security configuration page provided in an embodiment of the present application;
[0084] Figure 5 An overall implementation flow chart of modifying the password of a server provided in an embodiment of the present application;
[0085] Figure 6 A schematic diagram of a password modification device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0086] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, each embodiment of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in each embodiment of the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not constitute any limitation, and the various embodiments can be combined with each other and referenced to each other without contradiction.
[0087] The embodiment of the present application provides an automatic modification strategy to address the problems of high labor and time costs, low efficiency, difficulty in ensuring modification accuracy, and inability to trace modification status when using manual processing in the scenario of batch modifying BIOS passwords of servers. The strategy simulates the entire process of manual password modification based on image recognition technology, uses a machine perspective instead of humans to identify images and complete the modification, and fully automates the entire modification process, saving labor and time costs, improving work efficiency, and at the same time ensuring the accuracy of the modification, thereby improving customer satisfaction.
[0088] The password modification method provided in the embodiment of the present application is applied to a terminal device, and a password automatic modification program is installed on the terminal device (such as a computer). The terminal device performs batch password modification on the server based on the operation of the program. Figure 1 As shown, the password modification method provided in the embodiment of the present application includes:
[0089] Step 101: Obtain a configuration file including password configuration information corresponding to a plurality of servers, wherein the password configuration information at least includes a baseboard management controller address and a target password of the server, and the target password is an updated basic input and output system password.
[0090] The configuration file in the embodiment of the present application is provided by relevant technical personnel. The configuration file includes password configuration information corresponding to multiple servers to be password-modified, and the password configuration information corresponding to the server includes at least the BMC (Baseboard Manager Controller) address and target password of the server. Among them, BMC is a small operating system independent of the server system. The server cluster generally uses BMC instructions for large-scale unattended operations, including remote management, monitoring, installation, and restart of the server. The target password is the updated basic input and output system password (BIOS password), that is, the old BIOS password corresponding to the server is updated based on the target password.
[0091] Step 102: Based on the baseboard management controller address of the server and the login operation of the simulated input device, a baseboard management controller main page is displayed.
[0092] After obtaining a configuration file including multiple password configuration information, the passwords of multiple servers are modified by running the automatic password modification program. When the password is modified for any server, the baseboard management controller login page (BMC login page) is first displayed based on the baseboard management controller address (BMC address) of the server, and the display of the baseboard management controller main page (BMC main page) is triggered based on the login operation of the running program instead of the input device.
[0093] That is, the BMC address provides an entry to the BMC login page. After entering the BMC login page, the login operation of the input device is simulated to trigger the page switch and display the BMC main page. Among them, the input device includes but is not limited to the keyboard and mouse; the BMC main page is the management page corresponding to the server. This page provides a remote entry. Based on the remote entry, a remote connection with the server can be established to display the server's screen content.
[0094] Step 103 : Based on the remote page start flag in the baseboard management controller main page, the BIOS main page is displayed, and the switching operation of the input device is simulated to control the BIOS main page to switch to the BIOS security configuration page.
[0095] The displayed BMC main page includes a remote page startup logo, which is a remote entry. Through the remote page startup logo, a remote connection with the server can be established, and the server screen content can be displayed on the display interface of the terminal device. After the remote connection is established, the display interface of the terminal device can display the operating system screen and BIOS management page corresponding to the server. The basic input and output system main page (BIOS main page) belongs to the BIOS management page, and the BIOS main page is a pre-set page that is presented after the remote connection is established.
[0096] After establishing a remote connection to display the BIOS main page, simulate the switching operation of the input device on the BIOS main page, that is, based on the running program instead of the switching operation of the input device, control the BIOS main page to switch to the BIOS security configuration page. The BIOS main page is the previous page of the BIOS security configuration page, and the BIOS security configuration page is the BIOS password modification page. In response to the simulated switching operation, the control page jumps to display the BIOS security configuration page, so as to modify the BIOS password of the server on the current page.
[0097] Step 104 , simulating an input operation of an input device, and inputting a target password on a BIOS security configuration page to modify the BIOS password of the server.
[0098] After the BIOS security configuration page is displayed, the input operation of the input device to the corresponding area of the BIOS security configuration page is simulated, and the target password is entered on the BIOS security configuration page, so as to trigger the password setting on the BIOS security configuration page based on the running program instead of the input operation of the input device, and modify the BIOS password of the server.
[0099] The multiple servers corresponding to the configuration file modify the basic input and output system passwords in sequence according to a preset order, and the preset order is the arrangement order of the password configuration information corresponding to the multiple servers in the configuration file.
[0100] Since the configuration file includes password configuration information corresponding to multiple servers, when the BIOS passwords of multiple servers are modified based on the password configuration information, the password modification order is determined based on the arrangement order of the multiple password configuration information in the configuration file, and the BIOS passwords of the adapted servers are modified in sequence based on the determined password modification order. For example, if the configuration file includes 100 password configuration information, then based on the running of the program, the BIOS passwords of the adapted servers are modified in sequence based on the password configuration information in order from front to back.
[0101] For multiple password configuration information in the configuration file, they can be arranged in order from high to low priority in the configuration file, that is, password configuration information with high priority is arranged in the front position, and password configuration information with low priority is arranged in the back position. The priority of the password configuration information can be determined based on the importance level of the server, the urgency of the BIOS password modification, the importance of the business involved in the server, and the acquisition time of the password configuration information. For example, the earlier the acquisition time, the higher the priority. Of course, it can also be determined based on other parameters. By determining the arrangement position of the password configuration information in the configuration file based on the priority of the password configuration information, the password configuration information with high priority is displayed in front, and the BIOS password of the adapted server is modified in order from front to back when the program is running, so as to ensure that the BIOS password of the server with high importance level is modified first, the BIOS password of the server with high urgency of password modification is modified first, and the BIOS password of the server with high business importance is modified first.
[0102] In the embodiment of the present application, by running the automatic password modification program, batch BIOS password modification of multiple servers is performed based on the automatic modification method, which can greatly save labor costs and time costs while ensuring the accuracy of the modification. As an example, based on past experience, it takes 4 people 7 days to complete the password modification of 1,000 servers. If the automatic modification method is adopted, the modification time for each server is about 1 and a half minutes, and the total time spent on 1,000 servers is 25 hours. If 4 computers are used at the same time, it can be completed in a total of about 6.25 hours. No human intervention is required throughout the process, which greatly improves efficiency and saves labor and time costs.
[0103] The above implementation scheme of the present application displays the main page of the baseboard management controller based on the baseboard management controller address of the server and the login operation of the simulated input device, jumps from the main page of the baseboard management controller to the main page of the basic input and output system based on the remote connection, and controls the main page of the basic input and output system to switch to the basic input and output system security configuration page according to the simulated switching operation, and inputs the target password on the basic input and output system security configuration page to modify the password of the server. The automatic modification of the BIOS password can be achieved by simulating manual operation, which changes the current situation that the modification of the BIOS password of the server cannot be realized automatically, greatly reduces the dependence of this work on manual work, and the automated modification method can trace the modification while ensuring accuracy, and also provides a solution for the scenario of large-scale server modification, which greatly saves labor costs and time costs and improves processing efficiency.
[0104] The process of displaying the baseboard management controller main page is introduced below. As an optional embodiment, based on the baseboard management controller address of the server and the login operation of the simulated input device, the baseboard management controller main page is displayed, including:
[0105] Open the BMC login page on the browser according to the BMC address of the server;
[0106] Based on the login information, a login operation of the input device in the baseboard management controller login page is simulated to open the baseboard management controller main page; wherein the password configuration information includes the login information, and the login information includes the login account and login password corresponding to the baseboard management controller.
[0107] In this embodiment, the password configuration information includes the baseboard management controller address (BMC address) of the server, the target password and the login information, and the login information includes the login account and login password corresponding to the baseboard management controller. Based on the BMC address of the server, the BMC login page corresponding to the server is opened on the browser side, and then based on the login account and login password corresponding to the BMC of the server, the login operation of the input device in the BMC login page is simulated to trigger the BMC login page to jump to the BMC main page based on the login account and login password.
[0108] When simulating the login operation of the input device in the BMC login page, the operation of inputting the login account and login password and clicking the login option on the BMC login page is actually replaced by the operation of the program, so as to automatically control the display of the BMC main page based on the login information provided by the password configuration information and the operation of the program.
[0109] Among them, when the baseboard management controller login page is opened on the browser side according to the baseboard management controller address of the server, it includes: after opening the browser, simulating the input operation of the input device in the browser based on the baseboard management controller address of the server, and opening the web page corresponding to the baseboard management controller; matching the web page with the picture in the background picture library corresponding to the server, and opening the baseboard management controller login page when the match is successful.
[0110] After calling the webbrowser library (python browser access control library) to open the browser, the input operation of the input device in the browser is simulated to enter the baseboard management controller address of the server in the browser, and the web page corresponding to the BMC is opened through the browser. The input operation of the simulated input device in the browser is actually based on the operation of the program to replace the keyboard and mouse to enter the baseboard management controller address of the server in the address input box of the browser to jump to the corresponding web page based on the input address.
[0111] After jumping to the web page based on the BMC address, the web page is matched with the image in the background image library corresponding to the server, and the baseboard management controller login page is opened when the match is successful, including:
[0112] Match the web page with the security page image in the background image library corresponding to the server; if the web page and the security page image match successfully, determine that the web page is a security page, and simulate the touch operation of the input device in the security page to display the baseboard management controller login page; if the web page and the security page image do not match successfully, match the web page with the login page image in the background image library corresponding to the server; if the web page and the login page image match successfully, determine that the web page is a baseboard management controller login page.
[0113] In this embodiment, the background image library corresponding to the server includes various images related to the server, and these images are determined by screenshots of the BMC management page and BIOS page corresponding to the server. The background image library may also include screenshots of the operating system.
[0114] After the corresponding web page is displayed through the browser based on the BMC address of the server, the web page is matched with the security page image in the background image library corresponding to the server. The security page image in the background image library corresponding to the server is determined by taking a screenshot of the previous page of the BMC login page, that is, based on the BMC address, you can jump to the security page or the BMC login page, and the security page is the previous page of the BMC login page. Matching the web page with the security page image is actually to identify the similarity of the web page and the security page image based on image recognition means. If the similarity meets the conditions (such as the similarity is greater than a set threshold), it is determined that the two are matched successfully. At this time, it can be determined that the security page is jumped based on the BMC address. After displaying the security page, simulate the touch operation of the input device in the security page, such as clicking, to replace the mouse click based on the program operation, control the security page to switch pages, and then display the BMC login page.
[0115] It should be noted that in the case of matching a web page with a security page image, one or more matches can be performed based on a custom number of attempts and waiting time. If one match is unsuccessful, a second match can be performed after waiting for a certain period of time. If the two match successfully without exceeding the number of matches (such as 3 times), it can be determined that the web page and the security page image are matched successfully.
[0116] If the web page and the security page image do not match successfully, it indicates that the current web page is not a security page. It is necessary to match the web page with the login page image in the background image library. The login page image is the image corresponding to the BMC login page. If the two match successfully, it is determined that the web page is the BMC login page. If the two do not match, that is, the web page is neither a security page nor a BMC login page, it proves that the page opening based on the BMC address fails. At this time, the password modification operation for the current server is exited, and the password modification for the adapted server continues based on the next password configuration information. And for the process of matching the web page and the login page image, at least one match can also be performed based on the custom number of attempts and waiting time.
[0117] Among them, when simulating the touch operation of the input device in the security page and displaying the baseboard management controller login page, it includes: simulating the touch operation of the input device on the target option in the security page to display the first page, and the target option is the page switching entry; verifying the first page, and determining that the first page is the baseboard management controller login page after the verification is successful.
[0118] The security page includes a target option, which is a page switching entry corresponding to the security page. Based on the page switching entry, the next level page of the security page can be switched. After the security page is displayed, the touch operation of the input device on the target option on the security page is simulated, such as a click operation, so that the mouse clicks on the target option based on the running of the program is replaced, and the page is switched on the basis of the security page to display the first page. Then the first page is verified, and after the verification is passed, it is determined that the displayed first page is the BMC login page.
[0119] When verifying the first page, it includes: matching the first page with a login page image in a background image library corresponding to the server; when the first page matches the login page image successfully, determining that the displayed first page is a baseboard management controller login page.
[0120] The process of verifying the first page is a process of comparing content similarity based on image recognition, specifically: determining the login page image in the background image library corresponding to the server, and comparing the similarity between the first page and the login page image based on image recognition. When the similarity meets the conditions, it is determined that the two are matched successfully. At this time, it is determined that the first page switched to is the BMC login page displayed based on the security page and the switching entrance.
[0121] In the process of opening a web page on the browser side based on the BMC address, the web page is matched with the security page image. When the match is successful, the touch operation of the simulated input device controls the security page to switch to the next-level BMC login page; when the match fails, the web page is matched with the login page image. When the match is successful, the web page is determined to be the BMC login page, thereby realizing the use of machine perspective instead of human perspective to perform image recognition and trigger the display of the BMC login page.
[0122] Wherein, when the login operation of the input device in the login page of the baseboard management controller is simulated based on the login information and the main page of the baseboard management controller is opened, it includes:
[0123] In response to a login operation simulated based on the login information, displaying a second page;
[0124] Matching the second page with a first main page image in a background image library corresponding to the server, where the first main page image is an image of a main page of an associated baseboard management controller;
[0125] When the second page successfully matches the first main page image, the second page is determined to be the baseboard management controller main page.
[0126] After the BMC login page is displayed, the input device is simulated to input login information in the BMC login page to enter the login operation of the BMC main page, and the second page is displayed based on the simulated login operation. The simulated login operation is actually based on the operation of inputting login information and touching the login button on the BMC login page instead of the mouse and keyboard based on the running of the program to enter the BMC main page based on the login account and login password corresponding to the BMC.
[0127] In order to verify whether the BMC main page is successfully entered based on the login information, after the second page is displayed, the second page is matched with the first main page image in the background image library corresponding to the server based on image recognition, and the first main page image is associated with the baseboard management controller main page corresponding to the server. Specifically, the first main page image is generated by taking a screenshot of the baseboard management controller main page. When it is determined based on image recognition that the similarity between the second page and the first main page image meets the conditions, it is determined that the two are matched successfully, and then it can be determined that the displayed second page is the BMC main page. If the match is unsuccessful, it means that the BMC main page is not successfully entered based on the login information. At this time, the password modification operation for the current server is exited, and the password modification for the adapted server continues based on the next password configuration information.
[0128] In the above process, by simulating the login operation of the input device in the BMC login page, the BMC login page is controlled to switch to the second page, and based on the image recognition, it is verified whether the displayed second page is the BMC main page, so as to ensure that the subsequent process can be continued after entering the correct page.
[0129] The following is an implementation flow to introduce the process of entering the BMC main page based on the BMC address. Figure 2 As shown:
[0130] Step 201: Simulate an input operation of an input device in a browser based on a baseboard management controller address to open a web page.
[0131] Step 202 , identifying whether the web page is a secure page, if the web page is a secure page, executing step 203 , otherwise executing step 204 .
[0132] Step 203 , in response to the simulated touch operation of the input device in the security page, display the switched page, and when it is determined based on the image recognition that the displayed page is a baseboard management controller login page, execute step 205 .
[0133] Step 204 , identifying whether the web page is a baseboard management controller login page, if the web page is a baseboard management controller login page, executing step 205 , otherwise executing step 208 .
[0134] Step 205 : In response to a login operation in the baseboard management controller login page by an input device simulated based on the login information, display a second page.
[0135] Step 206 , identifying whether the second page is a baseboard management controller main page, if so, executing step 207 , otherwise executing step 208 .
[0136] Step 207: Continue the subsequent process for the current server.
[0137] Step 208: exit the password modification operation of the current server, and continue to modify the password of the adapted server based on the next password configuration information.
[0138] Figure 2 In the process shown, the displayed content is verified based on the image recognition technology to identify whether the current page is a security page to be displayed, a baseboard management controller login page, or a baseboard management controller main page, so as to ensure the accuracy of the page display.
[0139] The following describes the process of switching from the baseboard management controller main page to the basic input and output system main page. When the basic input and output system main page is displayed based on the remote page start mark in the baseboard management controller main page, it includes:
[0140] The touch operation of the remote page start mark by the simulated input device is displayed, and the remote page associated with the server is displayed; the remote page is matched with the picture in the background picture library corresponding to the server, and the main page of the basic input and output system is displayed when the match is successful.
[0141] The BMC main page includes a remote page startup logo as a remote entrance. By simulating the touch operation of the remote page startup logo by an input device, such as replacing the click operation of the remote page startup logo by a mouse based on the running of a program, a remote connection with the server is established, the server is remotely controlled, and the remote page associated with the server is displayed.
[0142] After displaying the remote page associated with the server, the remote page is matched with the picture in the background picture library corresponding to the server based on picture recognition. When the screen matching is performed based on picture recognition, the similarity between the remote page and the corresponding picture is actually compared based on picture recognition. When the similarity meets the conditions, it is determined that the remote page and the picture are matched successfully, thereby triggering the display of the BIOS main page.
[0143] It should be noted that after establishing a remote connection with the server, the page associated with the server that is displayed is a pre-set page, and when setting the page that is displayed by default after the remote connection is set, it is necessary to consider whether the server is set with a BIOS initial password. If the server is set with a BIOS initial password, the default displayed page is set to the password input page, which is used to enter the BIOS initial password, and this page is the previous page of the BIOS main page; if the server is not set with a BIOS initial password, the default displayed page is set to the BIOS main page. By setting the default displayed page after the remote connection based on the server's BIOS initial password setting, the page displayed by default based on the remote connection can be a remote page adapted to the server.
[0144] Wherein, when matching the remote page with the picture in the background picture library corresponding to the server and displaying the basic input and output system main page when the match is successful, it includes:
[0145] Match the remote page with the password input page image in the background image library;
[0146] When the match is successful, the BIOS main page is displayed based on the BIOS initial password, and the password configuration information includes the BIOS initial password corresponding to the server;
[0147] If the match is unsuccessful, the remote page is matched with the second main page image in the background image library. When the match is successful, the remote page is determined to be the basic input and output system main page, and the second main page image is the image associated with the basic input and output system main page.
[0148] In the case of displaying the remote page of the associated server based on the remote connection, the remote page is matched with the password input page image in the background image library, and the password input page image is the image determined by taking a screenshot of the password input page. When it is determined based on image recognition that the similarity between the remote page and the password input page image meets the conditions, it is determined that the two are matched successfully, and then the remote page is determined to be the password input page. In this case, the server is set with a BIOS initial password, and the password input page is entered by default based on the remote connection, and then the password input page jumps to the BIOS main page. When entering the BIOS main page, the input operation of the input device (such as a keyboard) in the password input page is simulated based on the BIOS initial password to trigger the display of the BIOS main page.
[0149] If the remote page fails to match the password input page image, it indicates that the remote page does not belong to the password input page, and the remote page continues to be matched with the second main page image in the background image library corresponding to the server. The second main page image is a picture associated with the BIOS main page, specifically a picture determined by a screenshot of the BIOS main page. If the remote page matches the second main page image successfully, that is, based on image recognition, it is determined that the similarity between the two meets the conditions, then it indicates that the remote page is the BIOS main page; in this case, the server is not set with a BIOS initial password, and enters the BIOS main page by default based on the remote connection. If the remote page fails to match the second main page image, exit the password modification operation of the current server, and continue to modify the password of the adapted server based on the next password configuration information.
[0150] To trigger the BIOS main page display based on the BIOS initial password, the following steps are included:
[0151] When the remote page successfully matches the password input page image, the remote page is determined to be the password input page;
[0152] Based on the basic input and output system initial password, the input device simulates the input operation in the password input page, and controls the remote page to switch to the third page;
[0153] Match the third page with the second main page image;
[0154] When the third page successfully matches the second main page image, the third page is determined to be the basic input and output system main page.
[0155] After determining that the remote page is a password input page, the input operation of inputting the BIOS initial password in the password input page by using an input device (keyboard) is simulated based on the BIOS initial password, that is, the operation of inputting the BIOS initial password in the password input page is replaced by the keyboard based on the running of the program. In response to the simulated input operation, the remote page is controlled to switch from the password input page to the third page, and then the third page is matched with the second main page image of the associated BIOS main page to verify the similarity between the third page and the second main page image based on image recognition. When the similarity between the two meets the condition, it is determined that the third page successfully matches the second main page image, and since the second main page image is the image of the associated BIOS main page, at this time, the third page can be directly determined to be the BIOS main page.
[0156] The following is an introduction to the process of switching from the BMC main page to the BIOS main page through an implementation process. Figure 3 As shown:
[0157] Step 301: In response to a simulated touch operation on a remote page start mark, a remote page associated with a server is displayed.
[0158] Step 302 , identify whether the remote page is a password input page, if so, execute step 303 , otherwise execute step 305 .
[0159] Step 303: Based on the basic input and output system initial password, the input device simulates the input operation in the password input page, and controls the remote page to switch to the third page.
[0160] Step 304 , identifying whether the third page is a BIOS main page, if so, executing step 306 , otherwise executing step 307 .
[0161] Step 305 , identifying whether the remote page is a BIOS main page, if so, executing step 306 , otherwise executing step 307 .
[0162] Step 306: Continue the subsequent process for the current server.
[0163] Step 307: exit the password modification operation of the current server, and continue to modify the password of the adapted server based on the next password configuration information.
[0164] Figure 3 In the process shown, the displayed content is verified based on the image recognition technology to identify whether the current page is a password input page or a basic input and output system main page to ensure the accuracy of the page display.
[0165] In the above process of switching to the BIOS main page based on the BMC main page, the displayed page is matched with the picture in the background picture library. When the match is successful, the page type is determined to determine whether the current page is the password input page to be displayed or the basic input and output system main page based on image recognition, so as to ensure the accuracy of the page display and continue the subsequent process of modifying the BIOS password based on the correctly displayed page.
[0166] The following is an introduction to the process of switching to the BIOS security configuration page and changing the password on the BIOS security configuration page. When the switching operation of the analog input device controls the basic input and output system main page to switch to the basic input and output system security configuration page, it includes:
[0167] In response to the simulated switching operation, controlling the basic input and output system main page to switch to the fourth page;
[0168] Match the fourth page with the security configuration page image in the backend image library corresponding to the server;
[0169] When the fourth page successfully matches the security configuration page image, it is determined that the fourth page is a basic input / output system security configuration page.
[0170] After displaying the BIOS main page, the switching operation of the input device (keyboard) on the BIOS main page is simulated, and the BIOS main page is controlled to switch to the fourth page in response to the simulated switching operation, that is, the running of the program replaces the switching operation of the keyboard on the BIOS main page to display the fourth page.
[0171] After the fourth page is displayed, the fourth page is matched with the security configuration page image in the background image library. The security configuration page image is an image associated with the BIOS security configuration page, specifically determined by taking a screenshot of the BIOS security configuration page. The process of matching the two is actually based on image recognition to compare the similarity between the two. When the similarity meets the conditions, it is determined that the two are matched successfully. At this time, it can be determined that the fourth page switched from the BIOS main page is the BIOS security configuration page. If the two do not match successfully, it indicates that the page switched to is not the BIOS security configuration page, exit the password modification process of the current server, and continue to modify the password of the adapted server based on the next password configuration information.
[0172] When it is determined that the BIOS security configuration page has been successfully displayed, simulate the input operation of the input device and enter the target password on the BIOS security configuration page to modify the basic input and output system password of the server. The process includes the following steps:
[0173] In response to the simulated input operation, inputting target information in the BIOS security configuration page, wherein, when the password configuration information includes the BIOS initial password, the target information includes the BIOS initial password and the target password, and when the password configuration information does not include the BIOS initial password, the target information includes the target password;
[0174] Save the target information entered in the BIOS Security Configuration page and restart the server to change the server's BIOS password.
[0175] In the case of setting the BIOS initial password for the server, the password configuration information includes the basic input and output system initial password. When setting the password on the BIOS security configuration page, the input device (keyboard) is simulated to input the BIOS initial password and the target password on the BIOS security configuration page. In response to the simulated input operation, the BIOS initial password and the target password are displayed on the BIOS security configuration page to replace the BIOS initial password with the target password. The input operation of the simulated input device is actually based on the running of the program to replace the keyboard to input the BIOS initial password and the target password on the BIOS security configuration page.
[0176] In the case where the initial BIOS password is not set for the server, when setting the password on the BIOS security configuration page, the input operation of the input device (keyboard) is simulated to enter the target password on the BIOS security configuration page. In response to the simulated input operation, the target password is displayed on the BIOS security configuration page, and the password of the server is modified based on the target password. The modification at this time can be understood as: changing the server's password-free setting to a server corresponding to the target password.
[0177] After completing the target information input on the BIOS security configuration page, save the target information entered on the BIOS security configuration page and restart the server. The process includes the following steps:
[0178] The switching operation of the analog input device in the basic input and output system security configuration page is displayed, and the fifth page is displayed;
[0179] Match the fifth page with the configuration saving page image in the background image library corresponding to the server;
[0180] When the match is successful, determining the fifth page as a basic input and output system configuration saving page;
[0181] The save and restart operation of the input device in the basic input and output system configuration save page is simulated to control the server restart; wherein, when the server restarts successfully, the basic input and output system password of the server is successfully modified.
[0182] After inputting the target information on the BIOS security configuration page, the switching operation of the input device in the BIOS security configuration page is simulated to trigger the display of the fifth page. The simulated switching operation is based on the running of the program instead of the page switching performed by the keyboard on the BIOS security configuration page. For example, if the right arrow on the keyboard indicates the next level page switching, the BIOS security configuration page is switched to the fifth page by replacing the right arrow on the keyboard.
[0183] Then, based on image recognition, the fifth page is compared with the configuration save page image in the background image library corresponding to the server for similarity. The configuration save page image is an image of the associated BIOS configuration save page, which can be determined by taking a screenshot of the BIOS configuration save page. When the similarity comparison based on image recognition is determined to meet the conditions, it indicates that the two are matched successfully, and the fifth page can be determined to be the BIOS configuration save page. If the two are not matched successfully, the password modification for the current server is exited, and the password modification for the adapted server continues based on the next password configuration information.
[0184] After the BIOS configuration save page is successfully displayed, the save and restart operation of the input device in the BIOS configuration save page is simulated to save the target information and control the restart of the server. After the server restarts successfully, the BIOS password of the server is successfully modified.
[0185] Among them, the BIOS configuration save page includes a save option and a restart option. The input target information is saved by simulating the confirmation operation of the input device for the save option, and the server restart is controlled by simulating the confirmation operation of the input device for the restart option. The save option and the restart option can also be combined into one option. The target information is saved and the server restart is controlled by simulating the confirmation operation of the input device for the option. The simulated confirmation operation is based on the program running instead of the keyboard saving operation for the BIOS configuration save page, and based on the program running instead of the keyboard controlling the restart of the server. For example, if the keyboard's Enter key indicates saving, the saving of the target information is controlled by replacing the click of the Enter key on the keyboard. The keyboard's Enter key also indicates restarting, and the server restart is controlled by replacing the click of the Enter key on the keyboard.
[0186] The following is an introduction to the implementation process of password modification on the BIOS security configuration page. Figure 4 As shown:
[0187] Step 401: In response to a simulated switching operation on a BIOS main page, display a fourth page.
[0188] Step 402 , identifying whether the fourth page is a basic input / output system security configuration page, if so, executing step 403 , otherwise executing step 409 .
[0189] Step 403: In response to the simulated input operation, input target information in the BIOS security configuration page, where the target information includes the BIOS initial password and the target password, or the target information includes the target password.
[0190] Step 404 : In response to the simulated switching operation on the BIOS security configuration page, display the fifth page.
[0191] Step 405 , identifying whether the fifth page is a basic input / output system configuration saving page, if so, executing step 406 , otherwise executing step 409 .
[0192] Step 406: In response to the simulated save and restart operation, control the server to restart.
[0193] Step 407 , identify whether the server is restarted, if the server is restarted, execute step 408 , otherwise execute step 409 .
[0194] Step 408: Determine whether the basic input / output system password of the current server has been modified successfully.
[0195] Step 409: exit the password modification operation of the current server, and continue to modify the password of the adapted server based on the next password configuration information.
[0196] Figure 4 In the process shown, the displayed content is verified based on image recognition technology to identify whether the current page is the page to be displayed to ensure the accuracy of the page display; when it is determined that the page is the page to be displayed, based on the simulated operation, information is entered on the page or the server is controlled to restart to achieve password modification of the server.
[0197] The above implementation process of modifying the BIOS password on the BIOS security configuration page simulates the human modification of the password based on image recognition, uses a machine perspective instead of a human to recognize the image and complete the password modification, and realizes efficient and low-cost password modification of the server based on program operation.
[0198] As an optional embodiment of the present application, the method also includes: creating a background image library corresponding to at least one server model, establishing a mapping relationship between the server model and the background image library, and after obtaining the mapping relationship, determining the background image library corresponding to the server based on the model parameters and mapping relationship of each server corresponding to the configuration file.
[0199] When the present application performs similarity comparison between pages and images based on image recognition, it is necessary to base it on the images in the background image library corresponding to the server. Therefore, it is necessary to determine the corresponding background image library for the server whose BIOS password is to be modified. The specific implementation process is: obtain at least one server model corresponding to the configuration file, create an adapted background image library for each server model, and form a mapping relationship between the server model and the background image library. For configuration files corresponding to multiple servers whose BIOS passwords are to be modified, traverse the configuration files to obtain the model parameters corresponding to each server. For a server, based on the model parameters corresponding to the server and the established mapping relationship between the server model and the background image library, determine the background image library corresponding to the server, so as to provide images for image recognition based on the background image library corresponding to the server.
[0200] Among them, at least one server model obtained is all models corresponding to all servers (all servers corresponding to the configuration file) whose passwords are to be modified; when obtaining the server model and creating an adapted background image library for the server model, a suitable strategy can be adopted based on whether the running program supports the passing of model parameters.
[0201] If the running program supports passing model parameters, it indicates that all servers corresponding to the configuration file correspond to the same model. Based on the model parameters, it is detected whether the corresponding model is a compatible model. If not, a corresponding error is prompted; if it is compatible, a corresponding background image library is created for the model. At this time, all servers corresponding to the configuration file correspond to the same background image library.
[0202] In the case that the running program does not support the transmission of model parameters, it is necessary to further determine the model of each server corresponding to the configuration file. The following takes a server as an example to introduce the process of determining the model and determining the background image library. For a server, call the BMC detection module to detect whether the BMC address can be connected. If it is not connected, call the log module to record that the current BMC address cannot be connected, and continue to detect the next server. If it can be connected, call the IPMI (Intelligent Platform Management Interface) tool to obtain FRU (Field Replace Unit) information to query the model parameters. If the model parameter query fails, call the log module to record the failure of the current server to obtain the model parameters and continue to detect the next one. If the model parameter query is successful, check whether the model is in the compatible list. If it is not in the compatible list, call the log module to record the corresponding error and continue to the next one. If the model is already compatible, define the background image library corresponding to the model.
[0203] By adopting a suitable strategy to determine the background image library corresponding to the server based on whether the program supports the passing of model parameters, the accuracy of the creation of the background image library can be guaranteed.
[0204] The above implementation process, by creating a corresponding background image library based on the server model, can provide an adapted image as a comparison basis when modifying the BIOS password of the server to ensure accurate verification of the displayed page.
[0205] It should be noted that the page involved in the embodiment of the present application and the picture in the background picture library can be matched at least once based on the custom number of attempts and waiting time. If the two are successfully matched without exceeding the number of matches, it can be determined that the page and the picture are successfully matched. And the present application can track and record logs to ensure the traceability of password modification. The simulation of the input device on the BIOS page refers to the simulation of the keyboard.
[0206] The automatic password modification program run by the embodiment of the present application is developed in the python development language. By calling the pyautogui library (GUI automation tool library for image recognition and keyboard and mouse operations), it realizes the recognition of predefined images and simulates keyboard and mouse operations to replace all actions requiring human intervention. The webbrowser library is called to realize automatic opening of the browser to log in to the BMC webpage, and other related libraries such as the time library, the logging library, the excel table processing library, etc. are called to complete the development of the program, thereby realizing the writing of a practical and usable automation tool by using the image recognition function of the python code and the python native function library.
[0207] Moreover, the automatic password modification program of the embodiment of the present application runs under the Windows operating system and is applied to the scenarios of batch setting and batch modification of BIOS passwords in server delivery and operation and maintenance scenarios, realizing the function of automatically setting or modifying the BIOS password of the server with one click.
[0208] As an example, the following is a successful password change based on the automatic password change program:
[0209] 2024-04-15 18:45:08, 344 - INFO - BMCIP: 10.49.32.80 Product Name: NF5280M6 Product Serial: 24A807074
[0210] 2024-04-15 18:45:14, 358 - INFO - Open safe page page success
[0211] 2024-04-15 18:45:22, 360 - INFO - Open login page page success
[0212] 2024-04-15 18:45:35, 342 - INFO - Open management page success
[0213] 2024-04-15 18:46:07,023 - INFO - Open enter password page success
[0214] As another example, the situation where the password modification based on the automatic password modification program fails is as follows:
[0215] 2024-04-19 22:37:18,493 - INFO - BMCIP: 10.49.32.163 Product Name: NF5280M5 Product Serial: 218499215
[0216] 2024-04-19 22:37:23, 262 - ERROR - The 1 times Open safe page pagefailed, errcode: ImageNotFoundException
[0217] 2024-04-19 22:37:27, 846 - ERROR - The 1 times Open login page pagefailed, errcode: ImageNotFoundException
[0218] 2024-04-19 22:37:32, 408 - ERROR - The 2 times Open safe page pagefailed, errcode: ImageNotFoundException
[0219] 2024-04-19 22:37:37,030 - ERROR - The 2 times Open login page pagefailed, errcode: ImageNotFoundException
[0220] The following is an introduction to the process of changing the password for a server through an overall implementation process. Figure 5 As shown:
[0221] Step 501: Open the baseboard management controller address of the server on the browser side.
[0222] Step 502: Identify a security page or a baseboard management controller login page.
[0223] Step 503: When the baseboard management controller login page is displayed, a login operation of an input device is simulated to open a next level page.
[0224] Step 504: When it is determined that the displayed page is the baseboard management controller main page, a touch operation of an input device on a remote page start mark is simulated to display the remote page.
[0225] Step 505: Match the remote page with the picture in the background picture library, and display the basic input and output system main page when the match is successful.
[0226] Step 506: Simulate the switching operation of the input device on the basic input and output system main page to display the next level page.
[0227] Step 507: When it is determined that the displayed page is a BIOS security configuration page, simulate the input operation of the input device and input target information in the BIOS security configuration page. The target information includes the BIOS initial password and the target password, or only includes the target password.
[0228] Step 508: Save the target information entered in the BIOS security configuration page and restart the server to modify the BIOS password of the server.
[0229] The automated password modification method provided by the above implementation process improves the efficiency and convenience of server BIOS password modification, completely liberates engineers, reduces the tediousness of work operations and the degree of dependence on engineer skills, saves manpower cost investment, and greatly shortens the overall project time.
[0230] The above is the overall implementation process of the password modification method provided in the embodiment of the present application. Based on the baseboard management controller address of the server and the login operation of the simulated input device, the baseboard management controller main page is displayed, and the baseboard management controller main page jumps to the basic input and output system main page based on the remote connection, and the basic input and output system main page is controlled to switch to the basic input and output system security configuration page according to the simulated switching operation. The target password is entered on the basic input and output system security configuration page to modify the password of the server. The automatic modification of the BIOS password can be achieved by simulating manual operation, which changes the current situation that the BIOS password modification of the server cannot be realized automatically, and greatly reduces the dependence of this work on manual work. The automated modification method can record the operation process while ensuring accuracy, ensure the traceability of the modification situation, and also provide a solution for the scenario of large-scale server modification, saving labor costs and time costs, and improving processing efficiency.
[0231] Furthermore, by simulating the human modification of passwords based on image recognition, the machine perspective is used instead of humans to identify images and complete password modification, thereby achieving efficient and low-cost password modification for the server based on program operation; by creating a corresponding background image library based on the server model, an adapted image can be provided as a comparison basis when modifying the BIOS password of the server to ensure accurate verification of the displayed page.
[0232] The present application also provides a password modification device. Figure 6 As shown, including:
[0233] A first acquisition module 601 is used to acquire a configuration file including password configuration information corresponding to a plurality of servers, wherein the password configuration information at least includes a baseboard management controller address and a target password of the server, and the target password is an updated basic input and output system password;
[0234] A display module 602 is used to display a baseboard management controller main page based on the baseboard management controller address of the server and the login operation of the simulated input device;
[0235] The processing module 603 is used to display the BIOS main page based on the remote page start identifier in the BMC main page, and simulate the switching operation of the input device to control the BIOS main page to switch to the BIOS security configuration page;
[0236] The input modification module 604 is used to simulate the input operation of the input device and input the target password on the BIOS security configuration page to modify the BIOS password of the server.
[0237] Optionally, the display module includes:
[0238] A first opening submodule, used to open a baseboard management controller login page on a browser side according to the baseboard management controller address of the server;
[0239] A second opening submodule, configured to simulate a login operation of the input device in the baseboard management controller login page based on the login information, and open the baseboard management controller main page;
[0240] The password configuration information includes the login information, and the login information includes a login account and a login password corresponding to the baseboard management controller.
[0241] Optionally, the first opening submodule includes:
[0242] An opening unit, configured to, after opening the browser, simulate an input operation of the input device in the browser based on the baseboard management controller address of the server, and open a web page corresponding to the baseboard management controller;
[0243] The matching and opening unit is used to match the web page with the picture in the background picture library corresponding to the server, and open the baseboard management controller login page when the match is successful.
[0244] Optionally, the matching start unit includes:
[0245] A first matching subunit, used for matching the web page with a security page image in a background image library corresponding to the server;
[0246] A determination display subunit is used to determine that the web page is a security page if the web page successfully matches the security page image, and simulate the touch operation of the input device in the security page to display the baseboard management controller login page;
[0247] A second matching subunit is used to match the web page with a login page image in a background image library corresponding to the server when the web page and the security page image fail to match successfully;
[0248] The first determining subunit is configured to determine that the web page is the baseboard management controller login page if the web page successfully matches the login page image.
[0249] Optionally, the determination and display subunit is further used for:
[0250] Simulate a touch operation of the input device on a target option in the security page to display a first page, wherein the target option is a page switching entry;
[0251] The first page is verified, and after successful verification, the first page is determined to be the baseboard management controller login page.
[0252] Optionally, the determination and display subunit is further used for:
[0253] Matching the first page with a login page image in a background image library corresponding to the server;
[0254] When the first page successfully matches the login page image, it is determined that the displayed first page is the baseboard management controller login page.
[0255] Optionally, the second opening submodule includes:
[0256] A first display unit, configured to display a second page in response to a login operation simulated based on the login information;
[0257] A first matching unit, configured to match the second page with a first main page image in a background image library corresponding to the server, wherein the first main page image is an image of a main page of an associated baseboard management controller;
[0258] The first determining unit is configured to determine that the second page is the baseboard management controller main page when the second page successfully matches the first main page image.
[0259] Optionally, the processing module includes:
[0260] A simulation display submodule, used for simulating the touch operation of the input device on the remote page start mark to display the remote page associated with the server;
[0261] The matching display submodule is used to match the remote page with the pictures in the background picture library corresponding to the server, and display the basic input and output system main page when the match is successful.
[0262] Optionally, the matching display submodule includes:
[0263] A second matching unit, used for matching the remote page with a password input page image in the background image library;
[0264] A second display unit, configured to trigger the display of the BIOS home page based on the BIOS initial password when the matching is successful, wherein the password configuration information includes the BIOS initial password corresponding to the server;
[0265] A matching determination unit is used to match the remote page with the second main page image in the background image library if the matching is unsuccessful, and when the matching is successful, determine that the remote page is the basic input and output system main page, and the second main page image is the image associated with the basic input and output system main page.
[0266] Optionally, the second display unit includes:
[0267] A second determination subunit is used to determine that the remote page is a password input page when the remote page successfully matches the password input page image;
[0268] A control switching subunit, configured to simulate an input operation of the input device in the password input page based on the basic input / output system initial password, and control the remote page to switch to a third page;
[0269] A third matching subunit, used for matching the third page with the second main page image;
[0270] The third determining subunit is used to determine that the third page is the basic input and output system main page when the third page successfully matches the second main page image.
[0271] Optionally, the processing module includes:
[0272] A control submodule, configured to control the basic input and output system main page to switch to a fourth page in response to the simulated switching operation;
[0273] A matching submodule, used for matching the fourth page with a security configuration page image in a background image library corresponding to the server;
[0274] The determination submodule is used to determine that the fourth page is the basic input and output system security configuration page when the fourth page successfully matches the security configuration page image.
[0275] Optionally, the input modification module includes:
[0276] an input submodule, configured to input target information in the BIOS security configuration page in response to the simulated input operation, wherein, when the password configuration information includes a BIOS initial password, the target information includes the BIOS initial password and the target password, and when the password configuration information does not include the BIOS initial password, the target information includes the target password;
[0277] The processing submodule is used to save the target information input in the basic input and output system security configuration page and restart the server to modify the basic input and output system password of the server.
[0278] Optionally, the processing submodule includes:
[0279] A simulation display unit, used for simulating the switching operation of the input device in the basic input and output system security configuration page, and displaying the fifth page;
[0280] A third matching unit, used for matching the fifth page with a configuration saving page image in a background image library corresponding to the server;
[0281] A second determining unit, configured to determine, when the matching is successful, that the fifth page is a basic input / output system configuration saving page;
[0282] A simulation control unit, used for simulating a save and restart operation of the input device in the basic input and output system configuration save page, and controlling the server to restart;
[0283] Wherein, when the server is restarted successfully, the basic input and output system password of the server is modified successfully.
[0284] Optionally, the device further comprises:
[0285] A first determination module, configured to determine at least one server model according to a plurality of servers corresponding to the configuration file;
[0286] A creation module is used to create a background image library corresponding to at least one server model, and establish a mapping relationship between the server model and the background image library;
[0287] The second acquisition module is used to obtain the mapping relationship between the server model and the background image library;
[0288] The second determination module is used to determine the background image library corresponding to the server according to the model parameters of each server corresponding to the configuration file and the mapping relationship.
[0289] Optionally, the multiple servers corresponding to the configuration file modify the basic input and output system passwords in sequence according to a preset order, and the preset order is the arrangement order of the password configuration information corresponding to the multiple servers in the configuration file.
[0290] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0291] The embodiment of the present application also provides a computer program product, including a computer program / instruction. When the computer program / instruction is executed by a processor, each process of the above-mentioned password modification method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0292] An embodiment of the present application also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned password modification method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0293] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned password modification method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0294] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0295] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, computer program products, electronic devices, and storage media. Therefore, the embodiments of the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0296] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, computer program products, electronic devices, and storage media according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing terminal device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded into a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0297] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0298] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0299] The above is an introduction to a password modification method, device, computer program product, electronic device and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for a person skilled in the art, according to the idea of the present application, 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 application.
Claims
1. A password modification method, characterized in that: include: Obtaining a configuration file including password configuration information corresponding to a plurality of servers, wherein the password configuration information includes at least a baseboard management controller address and a target password of the server, wherein the target password is an updated basic input and output system password; Displaying a baseboard management controller main page based on the baseboard management controller address of the server and the login operation of the simulated input device; Based on the remote page start identifier in the baseboard management controller main page, displaying the basic input and output system main page, and simulating the switching operation of the input device to control the basic input and output system main page to switch to the basic input and output system security configuration page; Simulating an input operation of the input device, inputting the target password on the BIOS security configuration page to modify the BIOS password of the server; The method further comprises: Obtaining a mapping relationship between a server model and a background image library, wherein the mapping relationship is established after determining at least one server model based on a plurality of servers corresponding to the configuration file and creating a background image library corresponding to at least one server model; According to the model parameters of each server corresponding to the configuration file and the mapping relationship, the background image library corresponding to the server is determined.
2. The password modification method according to claim 1, characterized in that: The displaying of the baseboard management controller main page based on the baseboard management controller address of the server and the login operation of the simulated input device includes: Opening a baseboard management controller login page on a browser according to the baseboard management controller address of the server; Simulating a login operation of the input device in the baseboard management controller login page based on the login information to open the baseboard management controller main page; The password configuration information includes the login information, and the login information includes a login account and a login password corresponding to the baseboard management controller.
3. The password modification method according to claim 2, characterized in that: The step of opening a baseboard management controller login page on a browser according to the baseboard management controller address of the server includes: After opening the browser, simulating the input operation of the input device in the browser based on the baseboard management controller address of the server, and opening a web page corresponding to the baseboard management controller; The web page is matched with the picture in the background picture library corresponding to the server, and the baseboard management controller login page is opened when the match is successful.
4. The password modification method according to claim 3, characterized in that: The step of matching the web page with a picture in a background picture library corresponding to the server and opening the baseboard management controller login page when the match is successful includes: Matching the web page with a security page image in the backend image library corresponding to the server; If the web page successfully matches the security page image, determining that the web page is a security page, simulating a touch operation of the input device within the security page, and displaying the baseboard management controller login page; If the web page and the security page image are not matched successfully, matching the web page with the login page image in the background image library corresponding to the server; If the web page successfully matches the login page image, it is determined that the web page is the baseboard management controller login page.
5. The password modification method according to claim 4, characterized in that: The simulating a touch operation of the input device within the security page to display the baseboard management controller login page includes: Simulating a touch operation of the input device on a target option in the security page to display a first page, wherein the target option is a page switching entry; The first page is verified, and after successful verification, the first page is determined to be the baseboard management controller login page.
6. The password modification method according to claim 5, characterized in that: The verifying the first page and determining that the first page is the baseboard management controller login page after successful verification includes: Matching the first page with a login page image in a backend image library corresponding to the server; If the first page successfully matches the login page image, it is determined that the displayed first page is the baseboard management controller login page.
7. The password modification method according to claim 2, characterized in that: The simulating a login operation of the input device in the baseboard management controller login page based on the login information to open the baseboard management controller main page includes: In response to a login operation simulated based on the login information, displaying a second page; Matching the second page with a first main page image in a background image library corresponding to the server, where the first main page image is an image of a main page associated with a baseboard management controller; When the second page successfully matches the first main page image, the second page is determined to be the baseboard management controller main page.
8. The password modification method according to claim 1, wherein: The displaying of the basic input / output system main page based on the remote page start identifier in the baseboard management controller main page includes: simulating a touch operation of the input device on the remote page start identifier to display a remote page associated with the server; The remote page is matched with the pictures in the background picture library corresponding to the server, and the basic input and output system main page is displayed when the match is successful.
9. The password modification method according to claim 8, characterized in that: The step of matching the remote page with a picture in a backend picture library corresponding to the server and displaying the basic input and output system main page when the match is successful includes: Matching the remote page with the password input page image in the background image library; When the match is successful, triggering the display of the BIOS home page based on the BIOS initial password, wherein the password configuration information includes the BIOS initial password corresponding to the server; If the match is unsuccessful, the remote page is matched with the second main page picture in the background picture library. When the match is successful, it is determined that the remote page is the basic input and output system main page, and the second main page picture is the picture associated with the basic input and output system main page.
10. The password modification method according to claim 9, characterized in that: The triggering of the BIOS home page display based on the BIOS initial password includes: When the remote page successfully matches the password input page image, determining that the remote page is a password input page; Simulating an input operation of the input device in the password input page based on the BIOS initial password, and controlling the remote page to switch to a third page; Matching the third page with the second main page image; When the third page successfully matches the second home page image, the third page is determined to be the basic input and output system home page.
11. The password modification method according to claim 1, wherein: The simulating the switching operation of the input device to control the basic input and output system main page to switch to the basic input and output system security configuration page includes: In response to the simulated switching operation, controlling the basic input and output system main page to switch to a fourth page; Matching the fourth page with a security configuration page image in a background image library corresponding to the server; When the fourth page successfully matches the security configuration page image, the fourth page is determined to be the basic input and output system security configuration page.
12. The password modification method according to claim 1, wherein: The simulating the input operation of the input device and inputting the target password on the basic input / output system security configuration page to modify the basic input / output system password of the server includes: In response to the simulated input operation, inputting target information on the BIOS security configuration page, wherein, if the password configuration information includes an initial BIOS password, the target information includes the initial BIOS password and the target password; and if the password configuration information does not include the initial BIOS password, the target information includes the target password; The target information entered in the BIOS security configuration page is saved and the server is restarted to modify the BIOS password of the server.
13. The password modification method according to claim 12, characterized in that: The step of saving the target information inputted in the basic input / output system security configuration page and restarting the server to modify the basic input / output system password of the server includes: Simulating a switching operation of the input device in the basic input / output system security configuration page to display a fifth page; Matching the fifth page with a configuration saving page image in a background image library corresponding to the server; When the match is successful, determining that the fifth page is a basic input and output system configuration saving page; Simulating a save and restart operation of the input device in the basic input and output system configuration save page to control the server to restart; Wherein, when the server is restarted successfully, the basic input and output system password of the server is modified successfully.
14. The password modification method according to claim 1, wherein: The multiple servers corresponding to the configuration file modify the basic input and output system passwords in sequence according to a preset order, and the preset order is the arrangement order of the password configuration information corresponding to the multiple servers in the configuration file.
15. A password modification device, characterized in that: include: A first acquisition module is configured to acquire a configuration file including password configuration information corresponding to a plurality of servers, wherein the password configuration information includes at least a baseboard management controller address and a target password of the server, wherein the target password is an updated basic input and output system password; A display module, configured to display a baseboard management controller main page based on the baseboard management controller address of the server and a login operation of a simulated input device; a processing module, configured to display a BIOS main page based on a remote page startup identifier in the baseboard management controller main page, and simulate a switching operation of the input device to control the BIOS main page to switch to a BIOS security configuration page; An input modification module, configured to simulate an input operation of the input device and input the target password on the BIOS security configuration page to modify the BIOS password of the server; Wherein, the device further includes: A second acquisition module is configured to acquire a mapping relationship between a server model and a background image library, wherein the mapping relationship is established after determining at least one server model based on a plurality of servers corresponding to the configuration file and creating a background image library corresponding to each of the at least one server model; The second determining module is configured to determine a background image library corresponding to each server according to the model parameters of each server corresponding to the configuration file and the mapping relationship.
16. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the password modification method according to any one of claims 1 to 14 is implemented.
17. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the password modification method according to any one of claims 1 to 14 is implemented.
18. 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 password modification method according to any one of claims 1 to 14 is implemented.
