Method and apparatus for matching silkscreen information
By using a camera to capture images on the server and utilizing OpenCV and Tesseract for automatic matching, the problem of low efficiency in manually matching silkscreen printing on server chassis with slots was solved, achieving efficient automated matching of silkscreen printing information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2024-12-31
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, manually matching server chassis silkscreen markings with slots is inefficient and prone to misreading, leading to low overall efficiency.
Images of the server slot positioning lights and slot silkscreen stickers are captured by a camera on the USB slot. OpenCV and Tesseract are used for image recognition to automatically match the slot positioning lights with the silkscreen information, establish a correlation, and send the results to the basic input/output system.
It improves the efficiency of matching server chassis silkscreen with slots, reduces the risk of human misreading, and realizes automated silkscreen information matching.
Smart Images

Figure CN120047930B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of server hard drive status display technology, and more specifically, to a method and apparatus for matching silkscreen information. Background Technology
[0002] Currently, in the server industry, there is no good technology for automatic matching of Peripheral Component Interconnect Express (PCIe) slot silkscreen printing. After the silkscreen printing of different models and configurations of server chassis is designed, firmware development engineers need to manually read it and write it into the firmware to achieve correspondence with the slot number. This manual operation is prone to misreading and is inefficient.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides a method and apparatus for matching silkscreen information, so as to at least solve the problem of low efficiency in manual matching of server chassis silkscreen and slots in related technologies.
[0005] According to one embodiment of this application, a method for matching silkscreen information is provided, comprising: acquiring an i-th image through a camera on the USB slot, wherein the i-th image includes a slot positioning light and a slot silkscreen sticker on the server, wherein i is an integer; identifying an i-th target slot positioning light in the i-th image, wherein the i-th target slot positioning light is in an on state in the i-th image; identifying each piece of silkscreen information in the slot silkscreen sticker, and matching the i-th target slot positioning light with each piece of silkscreen information.
[0006] In one exemplary embodiment, matching the i-th target slot positioning light with each of the silkscreen information includes: determining the position of the i-th target slot positioning light in the i-th image to obtain the i-th target position; determining the silkscreen information closest to the i-th target position among the silkscreen information as the i-th target silkscreen information; and determining the i-th target silkscreen information as the silkscreen information matching the i-th target slot, wherein the i-th target slot positioning light is disposed on the i-th target slot.
[0007] In an exemplary embodiment, after determining that the i-th target silkscreen information is silkscreen information that matches the i-th target slot, the method further includes: establishing an association between the i-th target silkscreen information and the i-th target slot number, wherein the i-th target slot number is the number of the i-th target slot.
[0008] In one exemplary embodiment, before acquiring the i-th image via the camera on the USB slot, the method further includes: receiving the i-th target slot number from the basic input / output system, and controlling the i-th target slot positioning light on the i-th target slot corresponding to the i-th target slot number to be in the on state; after establishing the association between the i-th target silkscreen information and the i-th target slot number, the method further includes: sending the association to the basic input / output system.
[0009] In one exemplary embodiment, the method further includes: sequentially controlling the slot positioning lights provided on each of the slots to be in the "on" state, and sequentially matching the slot positioning lights in the "on" state with the silkscreen information in the slot silkscreen sticker, wherein the i-th target slot positioning light is the i-th slot positioning light to perform the silkscreen information matching, the i-th target slot positioning light is in the "on" state when the i-th image is acquired, and when the i-th target slot positioning light is in the "on" state, the other slot positioning lights on the server are in the "off" state; if the i-th target slot positioning light is the last slot positioning light to perform the silkscreen information matching, after matching the i-th target slot positioning light with each piece of silkscreen information... The method further includes: sending a target mapping table to a basic input / output system, wherein the target mapping table records the association between each slot number and the corresponding silkscreen information; if the i-th target slot positioning light is not the last slot positioning light to perform silkscreen information matching, after matching the i-th target slot positioning light with each of the silkscreen information, the method further includes: acquiring the (i+1)-th image through a camera on the USB slot; identifying the (i+1)-th target slot positioning light in the (i+1)-th image, wherein the (i+1)-th target slot positioning light is in the on state in the (i+1)-th image; identifying each of the silkscreen information in the slot silkscreen sticker, and matching the (i+1)-th target slot positioning light with each of the silkscreen information.
[0010] In one exemplary embodiment, the server is provided with a first USB slot and a second USB slot. The first USB slot is located on the front window of the server chassis, and the second USB slot is located on the rear window of the server chassis. Acquiring the i-th image via a camera on the USB slot includes: acquiring the i-th image via the first camera on the first USB slot, wherein the i-th image is an image captured by the first camera of the server chassis front window, and the slot positioning light and the slot silkscreen sticker are located on the front window of the server chassis; or, acquiring the i-th image via a second camera on the second USB slot, wherein the i-th image is an image captured by the second camera of the second camera of the server chassis rear window, and the slot positioning light and the slot silkscreen sticker are located on the rear window of the server chassis.
[0011] According to another embodiment of this application, an apparatus for matching silkscreen information is provided, comprising: a capture module for capturing an i-th image via a camera on the USB slot, wherein the i-th image includes a slot positioning light and a slot silkscreen sticker on the server, wherein i is an integer; an identification module for identifying an i-th target slot positioning light in the i-th image, wherein the i-th target slot positioning light is in an on state in the i-th image; and a matching module for identifying each piece of silkscreen information in the slot silkscreen sticker and matching the i-th target slot positioning light with each piece of silkscreen information.
[0012] According to yet another embodiment of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0013] According to yet another embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0014] This application solves the problem of low efficiency in manually matching server chassis silkscreen with slots by using a camera on a USB slot. The i-th image includes slot positioning lights and slot silkscreen stickers on the server, where i is an integer. The application identifies the i-th target slot positioning light in the i-th image, where the i-th target slot positioning light is in an "on" state in the i-th image. It also identifies various silkscreen information in the slot silkscreen stickers and matches the i-th target slot positioning light with each piece of silkscreen information. Therefore, this method improves the efficiency of matching server chassis silkscreen with slots, addressing the issue of low efficiency in manual matching of server chassis silkscreen with slots in related technologies. Attached Figure Description
[0015] Figure 1 This is a hardware structure block diagram of a computer device for a method of matching silkscreen information according to an embodiment of this application;
[0016] Figure 2 This is a flowchart of a method for matching silkscreen information according to an embodiment of this application;
[0017] Figure 3 This is a structural diagram of a server chassis according to an embodiment of the present invention, showing a slot positioning light and a USB slot at the front or rear.
[0018] Figure 4 This is a schematic diagram of the slot positioning light and the slot silkscreen sticker according to an embodiment of the present invention;
[0019] Figure 5 This is a structural block diagram of a BMC controlling a camera to acquire and process images according to an embodiment of the present invention;
[0020] Figure 6 This is a flowchart of automatic matching of PCIe and hard disk slot silkscreen printing based on machine vision recognition according to an embodiment of the present invention.
[0021] Figure 7 This is a structural block diagram of an apparatus for matching silkscreen information according to an embodiment of this application. Detailed Implementation
[0022] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0024] The relevant technical background of this embodiment is as follows:
[0025] A Baseboard Management Controller (BMC) is a dedicated controller used for monitoring and managing servers. In simpler terms, the BMC is an independent system within the host server system. This independent system has its own processor and memory, and even if the host hardware or operating system fails or shuts down, the host system can still be managed by the BMC. It's like a backdoor on a server, used for server management. Typically, when a new server is installed, one method involves modifying the BMC's network configuration, configuring the Internet Protocol (IP) address and gateway, connecting a network cable through the out-of-band management port to establish communication, and then using the Intelligent Platform Management Interface (IPMI) to remotely manage the server, such as performing operations like console redirection, and subsequently remotely managing and installing operating systems.
[0026] The BMC system mainly has the following functions:
[0027] Device Information Management: Records detailed server information, including model, manufacturer, date, production and technical information of each component, chassis information, motherboard information, and BMC information itself, such as server hostname, IP address, and BMC firmware version.
[0028] Server status monitoring and management: This involves monitoring the health status of various server components (such as the CPU, memory, hard drive, fans, and chassis) including temperature and voltage. Simultaneously, it adjusts fan speeds in real-time based on temperature data collected at each monitoring point to prevent overheating and keep overall power consumption within a reasonable range. If any abnormality occurs in a single-board component, the BMC will promptly report the information to the upper-level network management system using various industry-standard protocols such as Simple Network Management Protocol (SNMP), Simple Mail Transfer Protocol (SMTP), and Redfish.
[0029] Remote control and management of servers: including server power on / off, restart, maintenance, firmware updates, system installation, and other operations.
[0030] Maintenance and management: including log management, user management, BIOS management, alarm management, etc.
[0031] BMC is typically viewed as a small operating system or dedicated management system independent of the server compute nodes, enjoying greater privileges than the host server. This allows BMC to manage and monitor business nodes in real time, ensuring separation between business nodes and management nodes, thereby preventing interference from business nodes to management nodes.
[0032] In a broad sense, BMC is a system-on-a-chip (SOP) system, which consists of two layers: the BMC chip and the BMC firmware. It does not depend on other hardware (such as the central processing unit, memory, hard drive, etc.) or software (such as the Basic Input / Output System (BIOS), Operating System (OS), Complex Programmable Logic Device (CPLD), etc.) on the system, but exists as a completely independent system.
[0033] Peripheral Component Interconnect Express (PCIe) is a high-speed serial computer expansion bus standard designed to replace older PCI, PCI-X, and Accelerated Graphics Port bus standards. PCIe features high-speed serial point-to-point dual-channel high-bandwidth transmission, where each connected device has its own dedicated channel bandwidth and does not share the bus bandwidth. It primarily supports active power management, error reporting, end-to-end reliable transmission, hot-plugging, and Quality of Service (QoS) features.
[0034] The development history of PCIe is as follows:
[0035] PCIe 1.0: Started in 2003, it introduced a transfer rate of 2.5GT / s.
[0036] PCIe 2.0: Introduced in 2007, it doubled the transfer rate to 5GT / s while maintaining backward compatibility with version 1.0.
[0037] PCIe 3.0: Released in 2010, it further increased the speed to 8GT / s and introduced a more efficient 128b / 130b encoding scheme.
[0038] PCIe 4.0: Launched in 2017, with speeds reaching 16GT / s, it brought unprecedented performance improvements to storage and networking devices.
[0039] PCIe 5.0: Released in 2019, it boosts speeds to 32GT / s, providing robust support for high-performance computing and data center applications.
[0040] PCIe 6.0: Launched in 2022, it achieved a transfer rate of 64GT / s, further driving the development of the technology.
[0041] PCIe 7.0: Starting in 2023, the PCI-SIG announced the PCI Express (PCIe) 7.0 specification, with the final version expected to be released in 2025. The maximum data rate is increased to 128 gigabit per second (GT / s), energy efficiency is improved, and backward compatibility with previous generations of specifications is retained.
[0042] PCIe 7.0 is a next-generation computer interconnect technology designed to increase data transfer speeds per pin to 128GT / s, twice that of PCIe 6.0's 64GT / s. This technological advancement marks a further step forward in computer interconnect technology, providing stronger support for future high-performance computing and data center applications.
[0043] Screen printing, also known as silkscreen printing, is a technique that uses a silkscreen as a printing plate base, employing a photosensitive plate-making method to create a screen printing plate with images and text for printing. This process involves five basic elements: the screen printing plate, the squeegee, the ink, the printing table, and the substrate. Ink can pass through the mesh openings of the image areas on the screen printing plate, while ink cannot pass through the non-image areas, thus enabling printing. During the printing process, the ink is forced through the mesh openings of the image areas of the screen printing plate onto the substrate under pressure from the squeegee.
[0044] Screen printing is characterized by its adaptability, simple process, high production efficiency, and low cost, making it particularly suitable for mass production. It is widely used for printing on various materials, including but not limited to paper. Furthermore, screen printing has important applications in PCB (Printed Circuit Board) manufacturing, where it prints text information such as circuit points, components, and circuit symbols on the PCB to facilitate circuit installation, maintenance, and identification.
[0045] Screen printing plays a crucial role in the design, production, and maintenance of PCIe devices. Screen printing, or identification information printed on the equipment, is essential for device identification, location, and troubleshooting. The relationship between device identification and screen printing information:
[0046] The method for updating PCIe silkscreen information in the System Management BIOS (SMBIOS) includes assigning slot identification (SLOTID) to the motherboard's PCIe slots, creating a slot silkscreen table, and updating the corresponding table in the SMBIOS with the collected PCIe silkscreen information. This method helps BIOS engineers easily and conveniently update PCIe silkscreen information based on hardware design, thereby enabling the identification and location of PCIe devices.
[0047] The Relationship Between Error Localization and Silkscreen Information: Silkscreen information plays a crucial role in error localization methods for PCIe devices. By pre-acquiring and sending the PCIe device's attribute information and corresponding silkscreen identifier to the BMC, the BMC can establish a correspondence between attribute information and silkscreen identifiers. When a PCIe device reports an error, the BMC acquires the identification data of the root bridge, the PCIe device, and all levels of PCI Bridges between them, and sends this data to the BMC. The BMC records an error log based on this identification data, thereby achieving error localization for the PCIe device. This method is applicable not only to directly connected PCIe devices but also to PCIe devices connected via a switch, facilitating PCIe device maintenance. In summary, silkscreen information plays a key role in the design, production, and maintenance of PCIe devices, not only aiding in device identification and localization but also playing a vital role in error localization and troubleshooting.
[0048] OpenCV is a cross-platform computer vision and machine learning software library released under the Apache 2.0 license (open source), running on Linux, Windows, Android, and Mac OS operating systems. It is lightweight and efficient—consisting of a series of C functions and a small number of C++ classes—while providing interfaces for languages such as Python, Ruby, and MATLAB, implementing many common algorithms in image processing and computer vision. Written in C++, OpenCV has interfaces for C++, Python, Java, and MATLAB, and supports Windows, Linux, Android, and Mac OS. OpenCV primarily focuses on real-time vision applications, utilizing MMX and SSE instructions where available, and now also provides support for C#, Ch, Ruby, and Go.
[0049] `imread` is a function in the OpenCV library used to read image files. It supports various image formats, such as JPEG, PNG, and BMP. The `imread` function loads the image file into memory and represents it as a multidimensional array (usually a NumPy array) for further image processing and analysis.
[0050] Tesseract is an open-source optical character recognition (OCR) engine that can convert text in images into editable text. It supports multiple languages and can output in various formats, such as plain text, HTML, and PDF. Tesseract is often used in conjunction with image processing libraries (such as OpenCV) to preprocess images and improve OCR accuracy.
[0051] Currently, in the server industry, there is no reliable technology for automatically matching PCIe slot silkscreen markings. Developing BIOS firmware adaptation to chassis silkscreen markings requires the following work: Currently, the slot number for each PCIe device is assigned by the BIOS, generally arranged sequentially from CPU0PE1 to PE4, CPU1PE1 to PE4, CPU2PE1 to PE4, and CPU3PE1 to PE4. If CPU0PE1 has two x8 devices, their slot numbers are 0 and 1 respectively; if CPU0PE2 has one x16 device, its slot number is 2, and so on. Furthermore, the physical location of each PCIe device and the corresponding CPUPE port used by the device are not fixed and depend on the specific riser card and slimline wiring method. Therefore, the physical location arrangement and the assigned slot number do not always correspond. BIOS firmware engineers need to manually create a mapping table between the silkscreen markings (for each physical slot) and the slot number (for each device) of the current model, import it into the asset information list function module in the firmware, and pass the asset information with the device silkscreen markings to the BMC and display it on the BMC web management interface to achieve accurate correspondence between each device and the slot silkscreen markings.
[0052] The method embodiments for matching silkscreen information provided in this application can be executed in a computer device or similar computing device. Taking running on a computer device as an example, Figure 1 This is a hardware structure block diagram of a computer device for a method of matching silkscreen information according to an embodiment of this application. Figure 1 As shown, a computer device may include one or more ( Figure 1Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The computer device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer device described above. For example, the computer device may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0053] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the method for matching silkscreen information in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to computer devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0054] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer equipment. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0055] This embodiment provides a method for matching silkscreen information. Figure 2 This is a flowchart of a method for matching silkscreen information according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:
[0056] Step S202: Capture the i-th image through the camera on the USB slot, wherein the i-th image includes the slot positioning light and the slot silkscreen sticker on the server, and i is an integer;
[0057] The system can iterate through the opening and closing of the slot positioning lights on the front and rear windows of the server. Only one slot positioning light is turned on each time an image is captured. Therefore, the number of images needed is equal to the number of slot positioning lights on the front and rear windows of the server. The i-th image mentioned above represents the number of times an image is captured. The image contains the slot positioning light and the slot silkscreen sticker. Figure 3 This is a structural diagram of a server chassis according to an embodiment of the present invention, showing that a slot positioning light and a USB slot are provided at the front or rear. Figure 3 As shown, the two Universal Serial Bus (USB) interfaces of the BMC chip are connected to two USB cameras, and the corresponding camera drivers are installed. These cameras are then used to capture images of the front and rear windows of the server, respectively. The USB cameras can completely capture the slot location lights and slot numbers on the exterior of the chassis. The aforementioned slot silkscreen stickers are placed on the side of the front or rear of the server chassis where the PCIe mounting slots are installed. Figure 4 This is a schematic diagram of the slot positioning light and the slot silkscreen sticker according to an embodiment of the present invention, as shown below. Figure 4 As shown, the slot silkscreen stickers use a single string recognition method. For example, slot number SLOT1 is recognized as the string S, L, O, T, 1. The slot positioning lights are installed above the PCIe device slot silkscreen stickers with the slot number printed on them. The slot silkscreen stickers display the device location information (slot number) and an indicator "Δ" icon for the corresponding PCIe device slot. A window is created above the "Δ" icon on the server chassis to form the opening for the slot positioning lights. The LED beads of the slot positioning lights display a blue light externally at the opening. The slot positioning lights are illuminated when a PCIe expansion card or other device is inserted into the PCIe slot. In this embodiment, by sequentially activating each slot positioning light and matching each light with the silkscreen information on the slot silkscreen sticker, the technical effect of ensuring that each slot on the server matches the silkscreen information and improving matching efficiency can be achieved.
[0058] Specifically, the server is equipped with a first USB slot and a second USB slot. The first USB slot is located on the front window of the server chassis, and the second USB slot is located on the rear window of the server chassis. Capturing the i-th image via a camera on the USB slot includes: capturing the i-th image via the first camera on the first USB slot, wherein the i-th image is an image captured by the first camera at the front window of the server chassis, and the slot positioning light and the slot silkscreen sticker are located on the front window of the server chassis; or, capturing the i-th image via the second camera on the second USB slot, wherein the i-th image is an image captured by the second camera at the rear window of the server chassis, and the slot positioning light and the slot silkscreen sticker are located on the rear window of the server chassis.
[0059] The first USB slot is located on the front window of the server chassis and is used to capture images of the front window of the server chassis. The second USB slot is located on the rear window of the server chassis and is used to capture images of the rear window of the server chassis, so that all PCIe device slots in the front and rear windows of the server chassis can correspond to the slot silkscreen stickers. Figure 5 This is a structural block diagram of a BMC controlling a camera to acquire and process images according to an embodiment of the present invention, such as... Figure 5 As shown, the BMC on the server motherboard has two USB connection structures and two BMC USB interface circuits. One circuit connects to the external USB physical interface (USB slot) on the front window of the server chassis, and the other connects to the external USB physical interface (USB slot) on the rear window of the server chassis. The external USB physical interface is used to connect a USB camera. The USB camera captures images from the front or rear window of the chassis and transmits the captured images of the slot positioning lights and slot numbers to the BMC. In this embodiment, by setting up USB slots on the server, a camera can be installed on the USB slot for image acquisition. The BMC uses its internally configured imread function and Tesseract algorithm to perform image analysis, thereby achieving automatic matching of the slot silkscreen printing.
[0060] Step S204: Identify the i-th target slot positioning light in the i-th image, wherein the i-th target slot positioning light is in the on state in the i-th image;
[0061] Optionally, before acquiring the i-th image through the camera on the USB slot, the method further includes: receiving the i-th target slot number from the basic input / output system and controlling the i-th target slot positioning light on the i-th target slot corresponding to the i-th target slot number to be in the on state.
[0062] When taking pictures of the front and rear windows of the server, the Basic Input / Output System (BIOS) will designate to light up the slot positioning light of the PCIe device or hard drive slot corresponding to a slot number, and display it in blue. The BMC uses a USB camera to capture the image of the current front or rear window and analyzes the image.
[0063] In this embodiment, during the server boot process, the BIOS sends the device slot number of each PCIe device, including the NVMe hard drive, automatically assigned by the BIOS to the BMC. The BMC can then sequentially control the slot positioning lights on the slots to be turned on. The USB camera takes pictures of the front and rear windows of the server, identifies the position of the turned-on slot positioning lights, finds the nearest slot silkscreen sticker, identifies the information of the slot silkscreen sticker, and realizes the correspondence between the slot and the silkscreen information.
[0064] Optionally, the slot positioning lights on each of the slots are sequentially controlled to be in the "on" state, and the slot positioning lights in the "on" state are sequentially matched with the silkscreen information in the slot silkscreen sticker. The i-th target slot positioning light is the i-th slot positioning light that performs the silkscreen information matching. When the i-th image is acquired, the i-th target slot positioning light is in the "on" state. When the i-th target slot positioning light is in the "on" state, the other slot positioning lights on the server are in the "off" state.
[0065] In the above embodiments, the BIOS can control the activation of the slot positioning lights, or the server can automatically control the slot positioning lights to activate sequentially. This allows the server to match the silkscreen information of the corresponding slots based on the BIOS instructions, or to automatically match the silkscreen information of all slots on the server sequentially.
[0066] Step S206: Identify each silkscreen information in the slot silkscreen sticker, and match the i-th target slot positioning light with each of the silkscreen information.
[0067] Specifically, the position of the i-th target slot positioning light in the i-th image is determined to obtain the i-th target position; the silkscreen information closest to the i-th target position among the various silkscreen information is determined as the i-th target silkscreen information; the i-th target silkscreen information is determined as the silkscreen information that matches the i-th target slot, wherein the i-th target slot positioning light is set on the i-th target slot.
[0068] When the aforementioned USB camera captures images of the front and rear windows of the server chassis, it will capture all the slot positioning lights and slot silkscreen stickers at the front or rear of the server. The BIOS or BMC can control only one slot positioning light to display blue at a time. The target slot positioning light is the slot positioning light that displays blue in the image captured by the USB camera. The target silkscreen information is the silkscreen information identified by the slot silkscreen sticker closest to the target slot positioning light. The silkscreen information is then matched with the target slot positioning light.
[0069] Specifically, after determining that the i-th target silkscreen information is the silkscreen information that matches the i-th target slot, the method further includes: establishing an association between the i-th target silkscreen information and the i-th target slot number, wherein the i-th target slot number is the number of the i-th target slot.
[0070] The aforementioned slot positioning lights are used to locate the position of the slots. Each slot has its own number. After matching the slot silkscreen information with the slot positioning lights, the slot silkscreen information needs to be associated with the slot number.
[0071] Specifically, after establishing the association between the i-th target silkscreen information and the i-th target slot number, the method further includes sending the association to the basic input / output system. After associating the slot silkscreen information with the slot number, it needs to be sent to the basic input / output system for storage. This achieves the goal of automatic server matching of silkscreen information, avoiding the low efficiency problem of manual matching and improving matching efficiency.
[0072] This embodiment will realize the correspondence between all slots on the front and back windows of the server and their slot silkscreen information. Therefore, it is necessary to determine whether the slot positioning light currently being matched is the last positioning light to be matched with silkscreen information in order to determine the subsequent steps.
[0073] Optionally, if the i-th target slot positioning light is the last slot positioning light to perform the silkscreen information matching, after matching the i-th target slot positioning light with each of the silkscreen information, the method further includes: sending a target mapping relationship table to a basic input / output system, wherein the target mapping relationship table records the association between each slot number and the corresponding silkscreen information.
[0074] When the aforementioned slot positioning light is the last slot positioning light to undergo silkscreen information matching, after it completes the silkscreen information matching, it indicates that the silkscreen information matching of all slot positioning lights on the front and back windows of the server has been completed. Therefore, there is no need to perform the matching operation again. The mapping relationship table that records the association between each slot number and the corresponding silkscreen information is sent to the basic input / output system for storage.
[0075] Optionally, if the i-th target slot positioning light is not the last slot positioning light to perform silkscreen information matching, after matching the i-th target slot positioning light with each of the silkscreen information, the method further includes: acquiring the (i+1)-th image through a camera on the USB slot; identifying the (i+1)-th target slot positioning light in the (i+1)-th image, wherein the (i+1)-th target slot positioning light is in an on state in the (i+1)-th image; identifying each of the silkscreen information in the slot silkscreen sticker, and matching the (i+1)-th target slot positioning light with each of the silkscreen information.
[0076] When the aforementioned slot positioning light is not the last slot positioning light to undergo silkscreen information matching, after it completes the silkscreen information matching, it indicates that the silkscreen information matching of all slot positioning lights on the front and back windows of the server has not yet been completed. Therefore, it is necessary to continue to use a USB camera to capture images of the next front and back windows of the server, find the position of the lit slot positioning light in the front image, identify the nearest slot silkscreen sticker, recognize the information of the aforementioned slot silkscreen sticker, and realize the correspondence between the slot and the silkscreen information.
[0077] Figure 6 This is a flowchart illustrating the automatic matching of PCIe and hard drive slot silkscreen printing based on machine vision recognition according to an embodiment of the present invention, such as... Figure 6 As shown, the process includes the following steps:
[0078] S601, BMC internal Linux system establishes OCR text recognition model Tesseract and OpenCV imread library function;
[0079] Specifically, this embodiment uses Tesseract in Linux to read and output each character in an image and output its position:
[0080]
[0081]
[0082] (2) Concatenate strings that are adjacent in position by checking the distance between characters:
[0083]
[0084]
[0085] The S602 connects two USB cameras to the two USB ports of the BMC chip, which are then used to take pictures of the front and rear windows of the server, respectively.
[0086] S603: During the server boot process, the BIOS will send the device slot number of each PCIe device, including NVMe hard drives, which is automatically assigned by the BIOS to the BMC.
[0087] When a PCIe expansion chip is inserted into the S604 PCIe slot, the slot positioning light will illuminate. The BMC will then use a USB camera to capture an image of the current front or rear window and analyze the image.
[0088] S605, BMC uses a color recognition algorithm to find the slot where the current positioning light is lit;
[0089] Specifically, in this embodiment, the position of the blue pixels in the image is output using imread in the Linux system:
[0090]
[0091]
[0092] S606, BMC uses the imread library function and Tesseract character recognition algorithm to recognize all silkscreen prints in the image as strings, records their positions, and updates the silkscreen prints to the corresponding PCIe device slots;
[0093] Specifically, the Tesseract character recognition algorithm operates as follows:
[0094] Associate the silkscreen position with its nearest slot number position:
[0095]
[0096]
[0097]
[0098] The path identification algorithm uses the shortest path algorithm on Neo4j.
[0099] Neo4j's shortest path algorithm assumes the base graph is undirected. The default setting can be changed by passing the parameter `direction: "OUTGOING"` or `direction: "INCOMING"`. `Outgoing` represents outgoing paths, and `Incoming` represents incoming paths.
[0100] To allow Neo4j's shortest path algorithm to ignore weights, a null value is passed as the third parameter to the procedure. This indicates that the weight attribute is not considered when executing the algorithm. The algorithm then assumes a default weight of 1.0 for each relation.
[0101] S607, repeat S601-S606 to obtain the silkscreen information for each hard drive and PCIe device slot;
[0102] During the next server boot process, the BMC will send the silkscreen information corresponding to the device slot number to the BIOS.
[0103] The above steps solve the problem of low matching efficiency between server chassis silkscreen and slots in related technologies, and improve the matching efficiency between server chassis silkscreen and slots.
[0104] This embodiment specifically relates to a server intelligent production technology and application tool based on machine vision recognition for automatic matching of PCIe and hard drive slot silkscreen printing. The BMC's internal Linux system establishes an OCR text recognition model (Tesseract) and the `imread` library function from OpenCV. During the production phase, two USB cameras are connected to the two USB ports of the BMC chip, and corresponding camera drivers are installed. These cameras are then used to capture images of the server's front and rear windows. During server startup, the BIOS automatically assigns the slot number for each PCIe device, including NVMe hard drives, to the BMC. The slot indicator light for the PCIe device or hard drive slot corresponding to a given slot number is illuminated. The BMC uses the USB cameras to capture an image of the current rear window. The BMC uses a color recognition program to locate the slot with the currently illuminated slot indicator light. The BMC uses the `imread` library function and the Tesseract character recognition algorithm to recognize all silkscreen printing in the image as strings and records their positions. Then, a path recognition algorithm is used to find the silkscreen string information closest to the illuminated indicator light and updates the silkscreen to the corresponding slot. These steps are repeated to obtain the silkscreen printing information for each hard drive and PCIe device slot. During the next server boot process, the BMC will send the silkscreen information corresponding to the device slot number to the BIOS. This solves the problems of easy misreading and inefficiency caused by manual operation. Traditional chassis silkscreen adaptation methods require the development and design of corresponding firmware versions for each model and configuration, making the firmware adaptation work for silkscreen cumbersome and inefficient.
[0105] This embodiment has the following beneficial effects:
[0106] 1. The advantages of establishing an automatic matching system for server component slot silkscreen printing in BMC are: it is independent of the server production line system, and after delivery to the customer, it is convenient for the customer to modify the server configuration themselves. In the event of changes in the slot silkscreen printing, the customer can also use a USB camera to automatically update the silkscreen printing using the automatic matching system. This avoids the drawback of the traditional chassis silkscreen printing adaptation method, which requires the development of a new firmware version for each model and configuration. The firmware adaptation work for silkscreen printing is more efficient, reduces development costs, and is more user-friendly.
[0107] 2. Reduce the risk of misreading or misinterpreting that is prone to occur during manual operation, improve the accuracy of automatic matching of PCIe and hard drive slot silkscreen, and improve matching efficiency.
[0108] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0109] This embodiment also provides a device for matching silkscreen information, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0110] Figure 7 This is a structural block diagram of a device for matching silkscreen information according to an embodiment of this application, such as... Figure 7 As shown, the device includes a data acquisition module 702 for acquiring the i-th image via a camera on the USB slot, wherein the i-th image includes a slot positioning light and a slot silkscreen sticker on the server, and i is an integer; an identification module 704 for identifying the i-th target slot positioning light in the i-th image, wherein the i-th target slot positioning light is in an on state in the i-th image; and a matching module 706 for identifying each silkscreen information in the slot silkscreen sticker and matching the i-th target slot positioning light with each of the silkscreen information.
[0111] In an exemplary embodiment, the above-described apparatus is further configured to determine the position of the i-th target slot positioning light in the i-th image to obtain the i-th target position; determine the silkscreen information closest to the i-th target position among the various silkscreen information as the i-th target silkscreen information; and determine the i-th target silkscreen information as the silkscreen information matching the i-th target slot, wherein the i-th target slot positioning light is disposed on the i-th target slot.
[0112] In an exemplary embodiment, the above-described apparatus is further configured to establish an association between the i-th target silkscreen information and the i-th target slot number, wherein the i-th target slot number is the number of the i-th target slot.
[0113] In an exemplary embodiment, the above-described apparatus is further configured to receive the i-th target slot number from the basic input / output system, and control the i-th target slot positioning light on the i-th target slot corresponding to the i-th target slot number to be in the on state; after establishing the association between the i-th target silkscreen information and the i-th target slot number, the method further includes: sending the association to the basic input / output system.
[0114] In an exemplary embodiment, the above-described device is further configured to sequentially control the slot positioning lights provided on each of the slots to be in the "on" state, and sequentially match the slot positioning lights in the "on" state with the silkscreen information in the slot silkscreen sticker, wherein the i-th target slot positioning light is the i-th slot positioning light to perform the silkscreen information matching, the i-th target slot positioning light is in the "on" state when the i-th image is acquired, and when the i-th target slot positioning light is in the "on" state, the other slot positioning lights on the server are in the "off" state; when the i-th target slot positioning light is the last slot positioning light to perform the silkscreen information matching, after matching the i-th target slot positioning light with each piece of silkscreen information, the... The method further includes: sending a target mapping table to a basic input / output system, wherein the target mapping table records the association between each slot number and the corresponding silkscreen information; if the i-th target slot positioning light is not the last slot positioning light to perform silkscreen information matching, after matching the i-th target slot positioning light with each of the silkscreen information, the method further includes: acquiring the (i+1)-th image through a camera on the USB slot; identifying the (i+1)-th target slot positioning light in the (i+1)-th image, wherein the (i+1)-th target slot positioning light is in the on state in the (i+1)-th image; identifying each of the silkscreen information in the slot silkscreen sticker, and matching the (i+1)-th target slot positioning light with each of the silkscreen information.
[0115] In one exemplary embodiment, the above-described apparatus is further configured to acquire the i-th image via a first camera on the first USB slot, wherein the i-th image is an image captured by the first camera onto the front window of the server chassis, and the slot positioning light and the slot silkscreen sticker are disposed on the front window of the server chassis; or, to acquire the i-th image via a second camera on the second USB slot, wherein the i-th image is an image captured by the second camera onto the rear window of the server chassis, and the slot positioning light and the slot silkscreen sticker are disposed on the rear window of the server chassis.
[0116] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0117] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0118] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0119] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0120] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0121] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0122] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0123] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for matching silkscreen information, characterized in that, Applied to a server, the server has multiple slots, each slot is equipped with a slot positioning light, and each slot is also equipped with a slot silkscreen sticker, which records the silkscreen information of each slot. The server also has a USB slot, including: The i-th image is captured by the camera on the USB slot, wherein the i-th image includes the slot positioning light and the slot silkscreen sticker on the server, and i is an integer; Identify the i-th target slot positioning light in the i-th image, wherein the i-th target slot positioning light is in the on state in the i-th image; Identifying each piece of silkscreen information in the slot silkscreen sticker and matching the i-th target slot positioning light with each piece of silkscreen information includes: determining the position of the i-th target slot positioning light in the i-th image to obtain the i-th target position; determining the silkscreen information closest to the i-th target position as the i-th target silkscreen information; and determining the i-th target silkscreen information as the silkscreen information that matches the i-th target slot, wherein the i-th target slot positioning light is set on the i-th target slot. The method further includes: sequentially controlling the slot positioning lights set on each of the slots to be in the "on" state, and sequentially matching the slot positioning lights in the "on" state with the silkscreen information in the slot silkscreen sticker, wherein the i-th target slot positioning light is the i-th slot positioning light that performs the silkscreen information matching, the i-th target slot positioning light is in the "on" state when the i-th image is acquired, and when the i-th target slot positioning light is in the "on" state, the other slot positioning lights on the server are in the "off" state.
2. The method according to claim 1, characterized in that, After determining that the i-th target silkscreen information is the silkscreen information that matches the i-th target slot, the method further includes: Establish the association between the i-th target silkscreen information and the i-th target slot number, wherein the i-th target slot number is the number of the i-th target slot.
3. The method according to any one of claims 1 to 2, characterized in that, Before acquiring the i-th image via the camera on the USB slot, the method further includes: Receive the i-th target slot number from the basic input / output system, and control the i-th target slot positioning light on the i-th target slot corresponding to the i-th target slot number to be in the on state; After establishing the association between the i-th target silkscreen information and the i-th target slot number, the method further includes: sending the association to the basic input / output system.
4. The method according to any one of claims 1 to 2, characterized in that, The method further includes: If the i-th target slot positioning light is the last slot positioning light to perform the silkscreen information matching, after matching the i-th target slot positioning light with each of the silkscreen information, the method further includes: The target mapping table is sent to the basic input / output system, wherein the target mapping table records the association between each slot number and the corresponding silkscreen information; If the i-th target slot positioning light is not the last slot positioning light to perform the silkscreen information matching, after matching the i-th target slot positioning light with each of the silkscreen information, the method further includes: The camera on the USB slot captures the (i+1)th image; the (i+1)th target slot positioning light in the (i+1)th image is identified, wherein the (i+1)th target slot positioning light is in the on state in the (i+1)th image; each silkscreen information in the slot silkscreen sticker is identified, and the (i+1)th target slot positioning light is matched with each of the silkscreen information.
5. The method according to any one of claims 1 to 2, characterized in that, The server is equipped with a first USB slot and a second USB slot. The first USB slot is located on the front window of the server chassis, and the second USB slot is located on the rear window of the server chassis. The i-th image is captured via the camera on the USB slot, including: The i-th image is captured by a first camera on the first USB slot, wherein the i-th image is an image taken by the first camera of the front window of the server chassis, and the slot positioning light and the slot silkscreen sticker are located on the front window of the server chassis; or, The i-th image is captured by a second camera on the second USB slot, wherein the i-th image is an image taken by the second camera of the rear window of the server chassis, and the slot positioning light and the slot silkscreen sticker are set on the rear window of the server chassis.
6. A device for matching silkscreen information, characterized in that, Applied to a server, the server has multiple slots, each slot is equipped with a slot positioning light, and each slot is also equipped with a slot silkscreen sticker, which records the silkscreen information of each slot. The server also has a USB slot, including: The acquisition module is used to acquire the i-th image through the camera on the USB slot, wherein the i-th image includes the slot positioning light and the slot silkscreen sticker on the server, and i is an integer; The identification module is used to identify the i-th target slot positioning light in the i-th image, wherein the i-th target slot positioning light is in the on state in the i-th image; The matching module is used to identify each piece of silkscreen information in the slot silkscreen sticker and match the i-th target slot positioning light with each piece of silkscreen information. The matching module is further configured to determine the position of the i-th target slot positioning light in the i-th image to obtain the i-th target position; determine the silkscreen information closest to the i-th target position among the various silkscreen information as the i-th target silkscreen information; determine the i-th target silkscreen information as the silkscreen information that matches the i-th target slot, wherein the i-th target slot positioning light is set on the i-th target slot; The device is also used to sequentially control the slot positioning lights provided on each of the slots to be in the "on" state, and sequentially match the slot positioning lights in the "on" state with the silkscreen information in the slot silkscreen sticker. The i-th target slot positioning light is the i-th slot positioning light that performs the silkscreen information matching. When the i-th image is acquired, the i-th target slot positioning light is in the "on" state. When the i-th target slot positioning light is in the "on" state, the other slot positioning lights on the server are in the "off" state.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 5.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1 to 5.