WO2021077740A1 - Method for querying cpld version information, device, and medium - Google Patents

Method for querying cpld version information, device, and medium Download PDF

Info

Publication number
WO2021077740A1
WO2021077740A1 PCT/CN2020/092823 CN2020092823W WO2021077740A1 WO 2021077740 A1 WO2021077740 A1 WO 2021077740A1 CN 2020092823 W CN2020092823 W CN 2020092823W WO 2021077740 A1 WO2021077740 A1 WO 2021077740A1
Authority
WO
WIPO (PCT)
Prior art keywords
cpld
version information
original data
query function
data
Prior art date
Application number
PCT/CN2020/092823
Other languages
French (fr)
Chinese (zh)
Inventor
郭美思
Original Assignee
苏州浪潮智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Publication of WO2021077740A1 publication Critical patent/WO2021077740A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/156Query results presentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1873Versioning file systems, temporal file systems, e.g. file system supporting different historic versions of files

Definitions

  • the present invention relates to the field of CPLD, and more specifically, to a method, equipment and readable medium for querying CPLD version information.
  • CPLD Complex Programmable Logic Device
  • the functions of each version are different, such as adding fan control logic to one version. Function, the CPU can be powered on only after the fan meets a specific number. Another example is the addition of delay control and register reset clearing functions in a version. Which functions of each CPLD version are determined according to the version information, but BMC There is no function to provide CPLD software version information.
  • the purpose of the embodiments of the present invention is to propose a method, equipment and medium for querying CPLD version information, which implements CPLD version information query through ipmi protocol and eeprom, provides a display interface for the web interface, and also provides users with A command line query method is provided to facilitate other users to use.
  • one aspect of the embodiments of the present invention provides a method for querying CPLD version information, which includes performing the following steps based on BMC: registering a CPLD query function based on the IPMI protocol; in response to receiving a request for querying CPLD version information, The request calls the CPLD query function; determines the file location for saving the CPLD data based on the mapping relationship between the CPLD parameters in the CPLD query function and the CPLD file; obtains the original data of the CPLD version information from the file corresponding to the file location; and The original data is processed to obtain CPLD version information.
  • the registration of the CPLD query function based on the IPMI protocol includes: registering a request message structure and a response message structure in the CPLD query function.
  • the obtaining the original data of the CPLD version information from the file corresponding to the file location includes: reading the original data of the CPLD version information based on the offset address and the data length in the message structure.
  • the processing the original data to obtain CPLD version information includes: performing an AND operation on the three sub-data in the original data with different reference values and shifting them to obtain the main version information and the sub-version information, respectively And the stage version number.
  • the processing of the original data to obtain CPLD version information further includes: separating the main version information, sub-version information, and stage version number by using identifiers to obtain CPLD version information.
  • a computer device including: at least one processor; and a memory.
  • the memory stores computer instructions that can run on the processor, and the instructions are executed by the processor to implement the following steps: Register the CPLD query function based on the IPMI protocol; in response to receiving a request for querying CPLD version information, call the CPLD query function according to the request; determine the file location for saving CPLD data based on the mapping relationship between the CPLD parameters in the CPLD query function and the CPLD file Obtain the original data of the CPLD version information from the file corresponding to the file location; and process the original data to obtain the CPLD version information.
  • the registration of the CPLD query function based on the IPMI protocol includes: registering a request message structure and a response message structure in the CPLD query function.
  • the obtaining the original data of the CPLD version information from the file corresponding to the file location includes: reading the original data of the CPLD version information based on the offset address and the data length in the message structure.
  • the processing the original data to obtain CPLD version information includes: performing an AND operation on the three sub-data in the original data with different reference values and shifting them to obtain the main version information and the sub-version information, respectively And the stage version number.
  • a computer-readable storage medium stores a computer program that implements the steps of the above method when executed by a processor.
  • the present invention has the following beneficial technical effects: the CPLD version information query is realized through the ipmi protocol and eeprom, the display interface is provided for the web interface, and the command line query mode is also provided for the user, which is convenient for other users to use.
  • Fig. 1 is a schematic diagram of an embodiment of a method for querying CPLD version information provided by the present invention
  • FIG. 2 is a flowchart of an embodiment of a method for querying CPLD version information provided by the present invention
  • FIG. 3 is a schematic diagram of the hardware structure of an embodiment of the method for querying CPLD version information provided by the present invention.
  • Figure 1 shows a schematic diagram of an embodiment of a method for querying CPLD version information provided by the present invention.
  • the embodiment of the present invention includes performing the following steps based on BMC:
  • the function for querying CPLD version information can be named ipmiReadCPLDEEPROM.
  • the registration of the CPLD query function based on the IPMI protocol includes: registering a request message structure and a response message structure in the CPLD query function. The parameters of this function are the request message structure and the response message structure.
  • the request message structure includes the offset address offset and the data length length.
  • the response message structure contains version information version.
  • the CPLD query function In response to receiving a request for querying CPLD version information, the CPLD query function is called according to the request. It is used to query the CPLD version information by entering the command line. When the system detects the relevant command for querying the CPLD version information, it can call the registered CPLD query function.
  • the file location for saving the CPLD data is determined.
  • the file location for saving CPLD data may be /sys/class/hwmon/hwmon0/device/version.
  • the original data of the CPLD version information can be obtained from the file corresponding to the file location.
  • the obtaining the original data of the CPLD version information from the file corresponding to the file location includes: reading the original data of the CPLD version information based on the offset address and the data length in the message structure.
  • the processing the original data to obtain CPLD version information includes: performing an AND operation on the three sub-data in the original data with different reference values and shifting them to obtain the main version information and the sub-version information, respectively And the stage version number.
  • the version information of the CPLD in the embodiment of the present invention is composed of three parts: main version information, sub-version information, and phase version number. Ver1 can be used to represent the main version information, ver2 is the sub-version information, and ver3 is the phase version number. In the example, ver1, ver2, and ver3 are all 8-bit binary numbers. ver1 is ANDed with the first reference value, and then shifted to obtain the data of the main version information.
  • the first reference value can be 0xE0
  • the first reference value and ver1 are ANDed and then shifted to the right by 5 Bit to obtain the data of the main version information
  • ver1 is 01100000
  • 11100000 (0xE0) is ANDed to obtain 01100000
  • the main version information is 3.
  • ver2 is to get the data of the sub-version information by AND operation with 0x18, and then shifted to the right by 3 bits
  • ver3 is to get the data of the stage version number by performing the AND operation with 0x07.
  • the processing of the original data to obtain CPLD version information further includes: using an identifier to separate the main version information, the sub-version information, and the phase version number, respectively.
  • the identifier can be either ".” or "/”. Of course, it can also be any other symbol that can produce segmentation.
  • the main version information is 3, the subversion information is 0, and the stage version number is 2.
  • the final data is converted into the 3.0.2 format, and the data is returned through the response message structure version.
  • the embodiment of the present invention defines the function category and sub-category commands for obtaining CPLD information by registering the CPLD query function. Then call the CPLD query function, read the CPLD device file, parse the CPLD version information, read the file at a specific location to obtain the information, add processing operations to form human-recognizable version information, and finally return the final result through the response message structure CPLD version information.
  • Figure 2 shows a flowchart of an embodiment of the method for querying CPLD version information provided by the present invention.
  • box 102 register the CPLD query function based on the IPMI protocol; then proceed to box 103, determine whether a request for querying CPLD version information is received, if not, return to box 103 to judge again If yes, proceed to box 104, call the CPLD query function according to the request; then proceed to box 105, determine the file location to save the CPLD data based on the mapping relationship between the CPLD parameters in the CPLD query function and the CPLD file; then proceed to box 106, from Obtain the original data of the CPLD version information from the file corresponding to the file location, and then proceed to block 108 to end.
  • the second aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory, where computer instructions that can run on the processor are stored in the memory, and the instructions are executed by the processor.
  • the registration of the CPLD query function based on the IPMI protocol includes: registering a request message structure and a response message structure in the CPLD query function.
  • the obtaining the original data of the CPLD version information from the file corresponding to the file location includes: reading the original data of the CPLD version information based on the offset address and the data length in the message structure.
  • the processing the original data to obtain CPLD version information includes: performing an AND operation on the three sub-data in the original data with different reference values and shifting them to obtain the main version information and the sub version information, respectively And the stage version number.
  • the processing of the original data to obtain CPLD version information further includes: separating the main version information, sub-version information, and stage version number by using identifiers to obtain CPLD version information.
  • FIG. 3 it is a schematic diagram of the hardware structure of an embodiment of the method for querying CPLD version information provided by the present invention.
  • the device includes a processor 301 and a memory 302, and may also include an input device 303 and an output device 304.
  • the processor 301, the memory 302, the input device 303, and the output device 304 may be connected by a bus or in other ways. In FIG. 3, the connection by a bus is taken as an example.
  • the memory 302 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, as in the method for querying CPLD version information in this embodiment of the application.
  • the processor 301 executes various functional applications and data processing of the server by running non-volatile software programs, instructions, and modules stored in the memory 302, that is, realizing the method of querying CPLD version information in the foregoing method embodiment.
  • the memory 302 may include a storage program area and a storage data area.
  • the storage program area can store an operating system and an application program required by at least one function; the storage data area can store data created according to the use of the method of querying CPLD version information, etc. .
  • the memory 302 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
  • the memory 302 may optionally include a memory remotely provided with respect to the processor 301, and these remote memories may be connected to a local module through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 303 can receive the input user name and password and other information.
  • the output device 304 may include a display device such as a display screen.
  • the program instructions/modules corresponding to one or more methods for querying CPLD version information are stored in the memory 302, and when executed by the processor 301, the method for querying CPLD version information in any of the foregoing method embodiments is executed.
  • Any embodiment of the computer device that executes the foregoing method for querying CPLD version information can achieve the same or similar effect as any of the foregoing corresponding method embodiments.
  • the present invention also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program that executes the above method when executed by a processor.
  • the program of the method for querying CPLD version information can be stored in a computer.
  • the program may include the procedures of the above-mentioned method embodiments.
  • the storage medium of the program can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
  • the foregoing computer program embodiment can achieve the same or similar effects as any of the foregoing corresponding method embodiments.
  • the method disclosed according to the embodiment of the present invention may also be implemented as a computer program executed by a processor, and the computer program may be stored in a computer-readable storage medium.
  • the computer program executes the above-mentioned functions defined in the method disclosed in the embodiment of the present invention.
  • the above method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.
  • non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory Memory.
  • Volatile memory can include random access memory (RAM), which can act as external cache memory.
  • RAM can be obtained in many forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchronous link DRAM (SLDRAM) and direct Rambus RAM (DRRAM).
  • DRAM synchronous RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM Synchronous link DRAM
  • DRRAM direct Rambus RAM
  • the storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
  • DSP digital signal processors
  • ASIC application-specific integrated circuits
  • FPGA Field Programmable Gate Array
  • a general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine.
  • the processor may also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in combination with a DSP, and/or any other such configuration.
  • the steps of the method or algorithm described in combination with the disclosure herein may be directly included in hardware, a software module executed by a processor, or a combination of the two.
  • the software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor such that the processor can read information from or write information to the storage medium.
  • the storage medium may be integrated with the processor.
  • the processor and the storage medium may reside in the ASIC.
  • the ASIC can reside in the user terminal.
  • the processor and the storage medium may reside as discrete components in the user terminal.
  • functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted through the computer-readable medium.
  • Computer-readable media include computer storage media and communication media, including any media that facilitates the transfer of a computer program from one location to another location.
  • a storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
  • the computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, magnetic disk storage devices, or other magnetic storage devices, or may be used for carrying or storing instructions in the form of Or any other medium that can be accessed by a general-purpose or special-purpose computer or general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium.
  • coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave to send software from a website, server, or other remote source
  • coaxial cable Cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media.
  • magnetic disks and optical disks include compact disks (CD), laser disks, optical disks, digital versatile disks (DVD), floppy disks, and Blu-ray disks. Disks usually reproduce data magnetically, while optical disks use lasers to optically reproduce data. . Combinations of the above content should also be included in the scope of computer-readable media.
  • the program can be stored in a computer-readable storage medium.
  • the storage medium can be a read-only memory, a magnetic disk or an optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A method for querying CPLD version information. The method comprises the following steps executed on the basis of a BMC: registering a CPLD query function on the basis of an IPMI protocol; in response to reception of a request for querying CPLD version information, calling the CPLD query function according to the request; determining a file position for storing CPLD data on the basis of a mapping relationship between CPLD parameters in the CPLD query function and a CPLD file; obtaining original data of the CPLD version information from a file corresponding to the file position; and processing the original data to obtain the CPLD version information. Also disclosed in the present invention are a computer device and a readable storage medium. According to the method for querying the CPLD version information, the device, and the medium provided in the present invention, CPLD version information query is achieved by means of the ipmi protocol and an eeprom, a display interface is provided for a web interface. Moreover, a command line query mode is also provided for a user, thereby facilitating other users in using.

Description

一种查询CPLD版本信息的方法、设备及介质A method, equipment and medium for querying CPLD version information
本申请要求于2019年10月25日提交中国专利局、申请号为201911022208.2、发明名称为“一种查询CPLD版本信息的方法、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on October 25, 2019, the application number is 201911022208.2, and the invention title is "a method, equipment and medium for querying CPLD version information", the entire content of which is incorporated by reference Incorporated in this application.
技术领域Technical field
本发明涉及CPLD领域,更具体地,特别是指一种查询CPLD版本信息的方法、设备及可读介质。The present invention relates to the field of CPLD, and more specifically, to a method, equipment and readable medium for querying CPLD version information.
背景技术Background technique
随着互联网的不断发展,计算机及服务器设备得到广泛的使用,在人们网购及银行业务处理中,背后支撑的是大量的服务器设备,通过服务器设备的业务处理使得人们的生活质量得到了极大的改善。因此服务器设备的稳定性及可靠性是非常重要的。服务器的硬件资源可以通过BMC(Baseboard Manager Controller,基板管理控制器)进行监控,可以通过监控各种硬件信息提示用户系统是否出现问题。同时各种软件的版本信息也是非常重要的,而CPLD(Complex Programmable Logic Device,复杂可编程逻辑器件)主要是控制上电时序的,每个版本的功能不同,如在一个版本中增加风扇控制逻辑功能,只有在风扇满足特定个数后才能CPU上电,又如在一个版本中增加时延控制及寄存器复位清零功能等,每个CPLD版本有哪些功能是根据版本信息进行确定的,但BMC中没有提供CPLD软件版本信息的功能。With the continuous development of the Internet, computers and server equipment have been widely used. In people's online shopping and banking business processing, a large number of server equipment is supported behind it. Through the business processing of server equipment, people's quality of life has been greatly improved. improve. Therefore, the stability and reliability of server equipment is very important. The hardware resources of the server can be monitored through the BMC (Baseboard Manager Controller), and various hardware information can be monitored to prompt the user whether there is a problem in the system. At the same time, the version information of various software is also very important. CPLD (Complex Programmable Logic Device) mainly controls the power-on sequence. The functions of each version are different, such as adding fan control logic to one version. Function, the CPU can be powered on only after the fan meets a specific number. Another example is the addition of delay control and register reset clearing functions in a version. Which functions of each CPLD version are determined according to the version information, but BMC There is no function to provide CPLD software version information.
发明内容Summary of the invention
有鉴于此,本发明实施例的目的在于提出一种查询CPLD版本信息的方法、设备及介质,通过ipmi协议及eeprom实现了CPLD版本信息查询,为web界面提供了显示接口,同时也为用户提供了命令行查询方式,方便其他用户使用。In view of this, the purpose of the embodiments of the present invention is to propose a method, equipment and medium for querying CPLD version information, which implements CPLD version information query through ipmi protocol and eeprom, provides a display interface for the web interface, and also provides users with A command line query method is provided to facilitate other users to use.
基于上述目的,本发明实施例的一方面提供了一种查询CPLD版本信 息的方法,包括基于BMC执行如下步骤:基于IPMI协议注册CPLD查询函数;响应于接收到查询CPLD版本信息的请求,根据所述请求调用所述CPLD查询函数;基于CPLD查询函数中CPLD参数与CPLD文件的映射关系确定保存CPLD数据的文件位置;从所述文件位置对应的文件中获取CPLD版本信息的原始数据;以及对所述原始数据进行处理得到CPLD版本信息。Based on the foregoing objectives, one aspect of the embodiments of the present invention provides a method for querying CPLD version information, which includes performing the following steps based on BMC: registering a CPLD query function based on the IPMI protocol; in response to receiving a request for querying CPLD version information, The request calls the CPLD query function; determines the file location for saving the CPLD data based on the mapping relationship between the CPLD parameters in the CPLD query function and the CPLD file; obtains the original data of the CPLD version information from the file corresponding to the file location; and The original data is processed to obtain CPLD version information.
在一些实施方式中,所述基于IPMI协议注册CPLD查询函数包括:注册CPLD查询函数中的请求消息结构体和响应消息结构体。In some embodiments, the registration of the CPLD query function based on the IPMI protocol includes: registering a request message structure and a response message structure in the CPLD query function.
在一些实施方式中,所述从所述文件位置对应的文件中获取CPLD版本信息的原始数据包括:基于所述消息结构体中的偏移地址和数据长度大小读取CPLD版本信息的原始数据。In some embodiments, the obtaining the original data of the CPLD version information from the file corresponding to the file location includes: reading the original data of the CPLD version information based on the offset address and the data length in the message structure.
在一些实施方式中,所述对所述原始数据进行处理得到CPLD版本信息包括:将所述原始数据中的三个子数据与不同参考值进行与操作并移位分别得到主版本信息、子版本信息以及阶段版本号。In some embodiments, the processing the original data to obtain CPLD version information includes: performing an AND operation on the three sub-data in the original data with different reference values and shifting them to obtain the main version information and the sub-version information, respectively And the stage version number.
在一些实施方式中,所述对所述原始数据进行处理得到CPLD版本信息还包括:在所述主版本信息、子版本信息和阶段版本号之间分别采用标识符进行分隔以得到CPLD版本信息。In some implementation manners, the processing of the original data to obtain CPLD version information further includes: separating the main version information, sub-version information, and stage version number by using identifiers to obtain CPLD version information.
本发明实施例的另一方面,还提供了一种计算机设备,包括:至少一个处理器;以及存储器,存储器存储有可在处理器上运行的计算机指令,指令由处理器执行以实现如下步骤:基于IPMI协议注册CPLD查询函数;响应于接收到查询CPLD版本信息的请求,根据所述请求调用所述CPLD查询函数;基于CPLD查询函数中CPLD参数与CPLD文件的映射关系确定保存CPLD数据的文件位置;从所述文件位置对应的文件中获取CPLD版本信息的原始数据;以及对所述原始数据进行处理得到CPLD版本信息。In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory. The memory stores computer instructions that can run on the processor, and the instructions are executed by the processor to implement the following steps: Register the CPLD query function based on the IPMI protocol; in response to receiving a request for querying CPLD version information, call the CPLD query function according to the request; determine the file location for saving CPLD data based on the mapping relationship between the CPLD parameters in the CPLD query function and the CPLD file Obtain the original data of the CPLD version information from the file corresponding to the file location; and process the original data to obtain the CPLD version information.
在一些实施方式中,所述基于IPMI协议注册CPLD查询函数包括:注册CPLD查询函数中的请求消息结构体和响应消息结构体。In some embodiments, the registration of the CPLD query function based on the IPMI protocol includes: registering a request message structure and a response message structure in the CPLD query function.
在一些实施方式中,所述从所述文件位置对应的文件中获取CPLD版本信息的原始数据包括:基于所述消息结构体中的偏移地址和数据长度大小读取CPLD版本信息的原始数据。In some embodiments, the obtaining the original data of the CPLD version information from the file corresponding to the file location includes: reading the original data of the CPLD version information based on the offset address and the data length in the message structure.
在一些实施方式中,所述对所述原始数据进行处理得到CPLD版本信息包括:将所述原始数据中的三个子数据与不同参考值进行与操作并移位分别得到主版本信息、子版本信息以及阶段版本号。In some embodiments, the processing the original data to obtain CPLD version information includes: performing an AND operation on the three sub-data in the original data with different reference values and shifting them to obtain the main version information and the sub-version information, respectively And the stage version number.
本发明实施例的再一方面,还提供了一种计算机可读存储介质,计算机可读存储介质存储有被处理器执行时实现如上方法步骤的计算机程序。In yet another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, and the computer-readable storage medium stores a computer program that implements the steps of the above method when executed by a processor.
本发明具有以下有益技术效果:通过ipmi协议及eeprom实现了CPLD版本信息查询,为web界面提供了显示接口,同时也为用户提供了命令行查询方式,方便其他用户使用。The present invention has the following beneficial technical effects: the CPLD version information query is realized through the ipmi protocol and eeprom, the display interface is provided for the web interface, and the command line query mode is also provided for the user, which is convenient for other users to use.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other embodiments can be obtained according to the drawings without creative work.
图1为本发明提供的查询CPLD版本信息的方法的实施例的示意图;Fig. 1 is a schematic diagram of an embodiment of a method for querying CPLD version information provided by the present invention;
图2为本发明提供的查询CPLD版本信息的方法的实施例的流程图;2 is a flowchart of an embodiment of a method for querying CPLD version information provided by the present invention;
图3为本发明提供的查询CPLD版本信息的方法的实施例的硬件结构示意图。3 is a schematic diagram of the hardware structure of an embodiment of the method for querying CPLD version information provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。In order to make the objectives, technical solutions, and advantages of the present invention clearer, the following describes the embodiments of the present invention in detail in conjunction with specific embodiments and with reference to the accompanying drawings.
需要说明的是,本发明实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”“第二”仅为了表述的方便,不应理解为对本发明实施例的限定,后续实施例对此不再一一说明。It should be noted that all the expressions "first" and "second" in the embodiments of the present invention are used to distinguish two entities with the same name but not the same or parameters that are not the same, as shown in "first" and "second" Only for the convenience of presentation, it should not be construed as a limitation to the embodiments of the present invention, and subsequent embodiments will not describe this one by one.
基于上述目的,本发明实施例的第一个方面,提出了一种查询CPLD版本信息的方法的实施例。图1示出的是本发明提供的查询CPLD版本信息 的方法的实施例的示意图。如图1所示,本发明实施例包括基于BMC执行如下步骤:Based on the foregoing objectives, the first aspect of the embodiments of the present invention proposes an embodiment of a method for querying CPLD version information. Figure 1 shows a schematic diagram of an embodiment of a method for querying CPLD version information provided by the present invention. As shown in Figure 1, the embodiment of the present invention includes performing the following steps based on BMC:
S1、基于IPMI协议注册CPLD查询函数;S1. Register CPLD query function based on IPMI protocol;
S2、响应于接收到查询CPLD版本信息的请求,根据请求调用CPLD查询函数;S2, in response to receiving a request for querying CPLD version information, call the CPLD query function according to the request;
S3、基于CPLD查询函数中CPLD参数与CPLD文件的映射关系确定保存CPLD数据的文件位置;S3. Determine the file location for saving the CPLD data based on the mapping relationship between the CPLD parameters in the CPLD query function and the CPLD file;
S4、从文件位置对应的文件中获取CPLD版本信息的原始数据;以及S4. Obtain the original data of the CPLD version information from the file corresponding to the file location; and
S5、对原始数据进行处理得到CPLD版本信息。S5. Process the original data to obtain CPLD version information.
基于IPMI协议注册CPLD查询函数。基于IPMI协议注册可以查询CPLD版本信息的函数体,可以指定功能类别为netfun=0x3c及子命令类别为cmdGetCPLDVersionInfo=0x51,查询CPLD版本信息的函数可以命名为ipmiReadCPLDEEPROM。在一些实施方式中,所述基于IPMI协议注册CPLD查询函数包括:注册CPLD查询函数中的请求消息结构体和响应消息结构体。该函数的参数为请求消息结构体及响应消息结构体。在请求消息结构体中包含偏移地址offset及数据长度大小length。响应消息结构体中包含版本信息version。Register CPLD query function based on IPMI protocol. The function body that can query CPLD version information based on IPMI protocol registration can specify the function category as netfun=0x3c and the subcommand category as cmdGetCPLDVersionInfo=0x51. The function for querying CPLD version information can be named ipmiReadCPLDEEPROM. In some embodiments, the registration of the CPLD query function based on the IPMI protocol includes: registering a request message structure and a response message structure in the CPLD query function. The parameters of this function are the request message structure and the response message structure. The request message structure includes the offset address offset and the data length length. The response message structure contains version information version.
响应于接收到查询CPLD版本信息的请求,根据请求调用CPLD查询函数。用于可以通过输入命令行的方式对CPLD版本信息进行查询,当系统检测到查询CPLD版本信息的相关命令时,可以调用注册的CPLD查询函数。In response to receiving a request for querying CPLD version information, the CPLD query function is called according to the request. It is used to query the CPLD version information by entering the command line. When the system detects the relevant command for querying the CPLD version information, it can call the registered CPLD query function.
基于CPLD查询函数中CPLD参数与CPLD文件的映射关系确定保存CPLD数据的文件位置。CPLD参数与存放具体CPLD数据的文件之间存在映射关系,可以通过CPLD参数确定保存CPLD数据的文件位置。例如,在本实施例中,保存CPLD数据的文件位置可以是/sys/class/hwmon/hwmon0/device/version。Based on the mapping relationship between the CPLD parameters and the CPLD file in the CPLD query function, the file location for saving the CPLD data is determined. There is a mapping relationship between the CPLD parameter and the file storing the specific CPLD data, and the file location for storing the CPLD data can be determined through the CPLD parameter. For example, in this embodiment, the file location for saving CPLD data may be /sys/class/hwmon/hwmon0/device/version.
从文件位置对应的文件中获取CPLD版本信息的原始数据。在确定了保存CPLD数据的文件位置之后,可以从文件位置对应的文件中获取CPLD版本信息的原始数据。在一些实施方式中,所述从所述文件位置对应的文件中获取CPLD版本信息的原始数据包括:基于所述消息结构体中的偏移地址 和数据长度大小读取CPLD版本信息的原始数据。Obtain the original data of the CPLD version information from the file corresponding to the file location. After the file location for saving the CPLD data is determined, the original data of the CPLD version information can be obtained from the file corresponding to the file location. In some embodiments, the obtaining the original data of the CPLD version information from the file corresponding to the file location includes: reading the original data of the CPLD version information based on the offset address and the data length in the message structure.
对原始数据进行处理得到CPLD版本信息。在一些实施方式中,所述对所述原始数据进行处理得到CPLD版本信息包括:将所述原始数据中的三个子数据与不同参考值进行与操作并移位分别得到主版本信息、子版本信息以及阶段版本号。本发明实施例中的CPLD的版本信息是由主版本信息、子版本信息和阶段版本号三部分构成,可以用ver1表示主版本信息,ver2表示子版本信息,ver3表示阶段版本号,在本实施例中,ver1、ver2和ver3均为8位的二进制数。ver1通过与第一参考值进行与操作,再进行移位得到主版本信息的数据,在本实施例中,第一参考值可以是0xE0,第一参考值与ver1进行与操作后再右移5位,以获取主版本信息的数据,例如,ver1为01100000,与11100000(0xE0)进行与操作,得到01100000,然后右移5位得到011,即主版本信息为3。类似的,ver2是通过与0x18进行与操作,再右移3位以获取子版本信息的数据,ver3是通过与0x07进行与操作,获取阶段版本号的数据。Process the original data to get the CPLD version information. In some embodiments, the processing the original data to obtain CPLD version information includes: performing an AND operation on the three sub-data in the original data with different reference values and shifting them to obtain the main version information and the sub-version information, respectively And the stage version number. The version information of the CPLD in the embodiment of the present invention is composed of three parts: main version information, sub-version information, and phase version number. Ver1 can be used to represent the main version information, ver2 is the sub-version information, and ver3 is the phase version number. In the example, ver1, ver2, and ver3 are all 8-bit binary numbers. ver1 is ANDed with the first reference value, and then shifted to obtain the data of the main version information. In this embodiment, the first reference value can be 0xE0, and the first reference value and ver1 are ANDed and then shifted to the right by 5 Bit to obtain the data of the main version information, for example, ver1 is 01100000, and 11100000 (0xE0) is ANDed to obtain 01100000, and then shifted to the right by 5 bits to obtain 011, that is, the main version information is 3. Similarly, ver2 is to get the data of the sub-version information by AND operation with 0x18, and then shifted to the right by 3 bits, and ver3 is to get the data of the stage version number by performing the AND operation with 0x07.
在一些实施方式中,所述对所述原始数据进行处理得到CPLD版本信息还包括:在所述主版本信息、子版本信息和阶段版本号之间分别采用标识符进行分隔。标识符可以是“.”,也可以是“/”,当然也可以是其他可以产生分割作用的任意符号,例如,主版本信息为3,子版本信息为0,阶段版本号为2,可以将最后的数据转换成3.0.2的格式,通过响应消息结构体version返回数据。In some implementation manners, the processing of the original data to obtain CPLD version information further includes: using an identifier to separate the main version information, the sub-version information, and the phase version number, respectively. The identifier can be either "." or "/". Of course, it can also be any other symbol that can produce segmentation. For example, the main version information is 3, the subversion information is 0, and the stage version number is 2. The final data is converted into the 3.0.2 format, and the data is returned through the response message structure version.
本发明实施例通过注册CPLD查询函数,定义获取CPLD信息的功能类别及子类别命令。然后调用CPLD查询函数,通过读取CPLD的设备文件,解析CPLD的版本信息,读取特定位置的文件以获取信息,添加处理操作形成人类可识别的版本信息,最终通过响应消息结构体返回最终的CPLD版本信息。The embodiment of the present invention defines the function category and sub-category commands for obtaining CPLD information by registering the CPLD query function. Then call the CPLD query function, read the CPLD device file, parse the CPLD version information, read the file at a specific location to obtain the information, add processing operations to form human-recognizable version information, and finally return the final result through the response message structure CPLD version information.
图2示出的是本发明提供的查询CPLD版本信息的方法的实施例的流程图。如图2所示,从框101开始,接着前进到框102,基于IPMI协议注册CPLD查询函数;接着前进到框103,判断是否接收到查询CPLD版本信息的请求,如果否,返回框103再次判断,如果是,前进到框104,根据请求调用CPLD 查询函数;接着前进到框105,基于CPLD查询函数中CPLD参数与CPLD文件的映射关系确定保存CPLD数据的文件位置;接着前进到框106,从文件位置对应的文件中获取CPLD版本信息的原始数据,然后前进到框108结束。Figure 2 shows a flowchart of an embodiment of the method for querying CPLD version information provided by the present invention. As shown in Figure 2, starting from box 101, then proceed to box 102, register the CPLD query function based on the IPMI protocol; then proceed to box 103, determine whether a request for querying CPLD version information is received, if not, return to box 103 to judge again If yes, proceed to box 104, call the CPLD query function according to the request; then proceed to box 105, determine the file location to save the CPLD data based on the mapping relationship between the CPLD parameters in the CPLD query function and the CPLD file; then proceed to box 106, from Obtain the original data of the CPLD version information from the file corresponding to the file location, and then proceed to block 108 to end.
需要特别指出的是,上述查询CPLD版本信息的方法的各个实施例中的各个步骤均可以相互交叉、替换、增加、删减,因此,这些合理的排列组合变换之于查询CPLD版本信息的方法也应当属于本发明的保护范围,并且不应将本发明的保护范围局限在实施例之上。It should be particularly pointed out that the steps in the various embodiments of the above method for querying CPLD version information can be crossed, replaced, added, and deleted. Therefore, these reasonable permutations and combinations are also effective in querying CPLD version information. It should belong to the protection scope of the present invention, and the protection scope of the present invention should not be limited to the embodiments.
基于上述目的,本发明实施例的第二个方面,提出了一种计算机设备,包括:至少一个处理器;以及存储器,存储器存储有可在处理器上运行的计算机指令,指令由处理器执行以实现如下步骤:S1、基于IPMI协议注册CPLD查询函数;S2、响应于接收到查询CPLD版本信息的请求,根据请求调用CPLD查询函数;S3、基于CPLD查询函数中CPLD参数与CPLD文件的映射关系确定保存CPLD数据的文件位置;S4、从文件位置对应的文件中获取CPLD版本信息的原始数据;以及S5、对原始数据进行处理得到CPLD版本信息。Based on the foregoing objective, the second aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory, where computer instructions that can run on the processor are stored in the memory, and the instructions are executed by the processor. Implement the following steps: S1, register the CPLD query function based on the IPMI protocol; S2, in response to receiving the request for querying CPLD version information, call the CPLD query function according to the request; S3, determine the mapping relationship between the CPLD parameters and the CPLD file in the CPLD query function The file location for saving the CPLD data; S4. Obtain the original data of the CPLD version information from the file corresponding to the file location; and S5. Process the original data to obtain the CPLD version information.
在一些实施方式中,所述基于IPMI协议注册CPLD查询函数包括:注册CPLD查询函数中的请求消息结构体和响应消息结构体。In some embodiments, the registration of the CPLD query function based on the IPMI protocol includes: registering a request message structure and a response message structure in the CPLD query function.
在一些实施方式中,所述从所述文件位置对应的文件中获取CPLD版本信息的原始数据包括:基于所述消息结构体中的偏移地址和数据长度大小读取CPLD版本信息的原始数据。In some embodiments, the obtaining the original data of the CPLD version information from the file corresponding to the file location includes: reading the original data of the CPLD version information based on the offset address and the data length in the message structure.
在一些实施方式中,所述对所述原始数据进行处理得到CPLD版本信息包括:将所述原始数据中的三个子数据与不同参考值进行与操作并移位分别得到主版本信息、子版本信息以及阶段版本号。In some embodiments, the processing the original data to obtain CPLD version information includes: performing an AND operation on the three sub-data in the original data with different reference values and shifting them to obtain the main version information and the sub version information, respectively And the stage version number.
在一些实施方式中,所述对所述原始数据进行处理得到CPLD版本信息还包括:在所述主版本信息、子版本信息和阶段版本号之间分别采用标识符进行分隔以得到CPLD版本信息。In some implementation manners, the processing of the original data to obtain CPLD version information further includes: separating the main version information, sub-version information, and stage version number by using identifiers to obtain CPLD version information.
如图3所示,为本发明提供的上述查询CPLD版本信息的方法的一个实施例的硬件结构示意图。As shown in FIG. 3, it is a schematic diagram of the hardware structure of an embodiment of the method for querying CPLD version information provided by the present invention.
以如图3所示的装置为例,在该装置中包括一个处理器301以及一个存 储器302,并还可以包括:输入装置303和输出装置304。Take the device shown in Fig. 3 as an example. The device includes a processor 301 and a memory 302, and may also include an input device 303 and an output device 304.
处理器301、存储器302、输入装置303和输出装置304可以通过总线或者其他方式连接,图3中以通过总线连接为例。The processor 301, the memory 302, the input device 303, and the output device 304 may be connected by a bus or in other ways. In FIG. 3, the connection by a bus is taken as an example.
存储器302作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施例中的查询CPLD版本信息的方法对应的程序指令/模块。处理器301通过运行存储在存储器302中的非易失性软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例的查询CPLD版本信息的方法。The memory 302, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, as in the method for querying CPLD version information in this embodiment of the application. Program instructions/modules. The processor 301 executes various functional applications and data processing of the server by running non-volatile software programs, instructions, and modules stored in the memory 302, that is, realizing the method of querying CPLD version information in the foregoing method embodiment.
存储器302可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据查询CPLD版本信息的方法的使用所创建的数据等。此外,存储器302可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器302可选包括相对于处理器301远程设置的存储器,这些远程存储器可以通过网络连接至本地模块。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 302 may include a storage program area and a storage data area. The storage program area can store an operating system and an application program required by at least one function; the storage data area can store data created according to the use of the method of querying CPLD version information, etc. . In addition, the memory 302 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 302 may optionally include a memory remotely provided with respect to the processor 301, and these remote memories may be connected to a local module through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
输入装置303可接收输入的用户名和密码等信息。输出装置304可包括显示屏等显示设备。The input device 303 can receive the input user name and password and other information. The output device 304 may include a display device such as a display screen.
一个或者多个查询CPLD版本信息的方法对应的程序指令/模块存储在存储器302中,当被处理器301执行时,执行上述任意方法实施例中的查询CPLD版本信息的方法。The program instructions/modules corresponding to one or more methods for querying CPLD version information are stored in the memory 302, and when executed by the processor 301, the method for querying CPLD version information in any of the foregoing method embodiments is executed.
执行上述查询CPLD版本信息的方法的计算机设备的任何一个实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。Any embodiment of the computer device that executes the foregoing method for querying CPLD version information can achieve the same or similar effect as any of the foregoing corresponding method embodiments.
本发明还提供了一种计算机可读存储介质,计算机可读存储介质存储有被处理器执行时执行如上方法的计算机程序。The present invention also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program that executes the above method when executed by a processor.
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,查询CPLD版本信息的方法的程序可存储于一计算机可读取存储介质中,该程 序在执行时,可包括如上述各方法的实施例的流程。其中,程序的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。上述计算机程序的实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。Finally, it should be noted that those of ordinary skill in the art can understand that all or part of the process in the above-mentioned embodiment method can be realized by instructing relevant hardware through a computer program. The program of the method for querying CPLD version information can be stored in a computer. When the program is executed in the read storage medium, the program may include the procedures of the above-mentioned method embodiments. Among them, the storage medium of the program can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. The foregoing computer program embodiment can achieve the same or similar effects as any of the foregoing corresponding method embodiments.
此外,根据本发明实施例公开的方法还可以被实现为由处理器执行的计算机程序,该计算机程序可以存储在计算机可读存储介质中。在该计算机程序被处理器执行时,执行本发明实施例公开的方法中限定的上述功能。In addition, the method disclosed according to the embodiment of the present invention may also be implemented as a computer program executed by a processor, and the computer program may be stored in a computer-readable storage medium. When the computer program is executed by the processor, it executes the above-mentioned functions defined in the method disclosed in the embodiment of the present invention.
此外,上述方法步骤以及系统单元也可以利用控制器以及用于存储使得控制器实现上述步骤或单元功能的计算机程序的计算机可读存储介质实现。In addition, the above method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.
此外,应该明白的是,本文的计算机可读存储介质(例如,存储器)可以是易失性存储器或非易失性存储器,或者可以包括易失性存储器和非易失性存储器两者。作为例子而非限制性的,非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦写可编程ROM(EEPROM)或快闪存储器。易失性存储器可以包括随机存取存储器(RAM),该RAM可以充当外部高速缓存存储器。作为例子而非限制性的,RAM可以以多种形式获得,比如同步RAM(DRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据速率SDRAM(DDR SDRAM)、增强SDRAM(ESDRAM)、同步链路DRAM(SLDRAM)、以及直接Rambus RAM(DRRAM)。所公开的方面的存储设备意在包括但不限于这些和其它合适类型的存储器。In addition, it should be understood that the computer-readable storage medium (eg, memory) herein may be volatile memory or non-volatile memory, or may include both volatile memory and non-volatile memory. By way of example and not limitation, non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory Memory. Volatile memory can include random access memory (RAM), which can act as external cache memory. As an example and not limitation, RAM can be obtained in many forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchronous link DRAM (SLDRAM) and direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本发明实施例公开的范围。Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. In order to clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and functions have been described in general terms. Whether this function is implemented as software or hardware depends on the specific application and the design constraints imposed on the entire system. Those skilled in the art can implement the functions in various ways for each specific application, but such implementation decisions should not be construed as causing a departure from the scope of the disclosure of the embodiments of the present invention.
结合这里的公开所描述的各种示例性逻辑块、模块和电路可以利用被设计成用于执行这里功能的下列部件来实现或执行:通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或其它可编程逻辑器件、分立门或晶体管逻辑、分立的硬件组件或者这些部件的任何组合。通用处理器可以是微处理器,但是可替换地,处理器可以是任何传统处理器、控制器、微控制器或状态机。处理器也可以被实现为计算设备的组合,例如,DSP和微处理器的组合、多个微处理器、一个或多个微处理器结合DSP和/或任何其它这种配置。The various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure herein can be implemented or executed using the following components designed to perform the functions herein: general-purpose processors, digital signal processors (DSP), and application-specific integrated circuits (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in combination with a DSP, and/or any other such configuration.
结合这里的公开所描述的方法或算法的步骤可以直接包含在硬件中、由处理器执行的软件模块中或这两者的组合中。软件模块可以驻留在RAM存储器、快闪存储器、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、可移动盘、CD-ROM、或本领域已知的任何其它形式的存储介质中。示例性的存储介质被耦合到处理器,使得处理器能够从该存储介质中读取信息或向该存储介质写入信息。在一个替换方案中,存储介质可以与处理器集成在一起。处理器和存储介质可以驻留在ASIC中。ASIC可以驻留在用户终端中。在一个替换方案中,处理器和存储介质可以作为分立组件驻留在用户终端中。The steps of the method or algorithm described in combination with the disclosure herein may be directly included in hardware, a software module executed by a processor, or a combination of the two. The software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from or write information to the storage medium. In an alternative, the storage medium may be integrated with the processor. The processor and the storage medium may reside in the ASIC. The ASIC can reside in the user terminal. In an alternative, the processor and the storage medium may reside as discrete components in the user terminal.
在一个或多个示例性设计中,功能可以在硬件、软件、固件或其任意组合中实现。如果在软件中实现,则可以将功能作为一个或多个指令或代码存储在计算机可读介质上或通过计算机可读介质来传送。计算机可读介质包括计算机存储介质和通信介质,该通信介质包括有助于将计算机程序从一个位置传送到另一个位置的任何介质。存储介质可以是能够被通用或专用计算机访问的任何可用介质。作为例子而非限制性的,该计算机可读介质可以包括RAM、ROM、EEPROM、CD-ROM或其它光盘存储设备、磁盘存储设备或其它磁性存储设备,或者是可以用于携带或存储形式为指令或数据结构的所需程序代码并且能够被通用或专用计算机或者通用或专用处理器访问的任何其它介质。此外,任何连接都可以适当地称为计算机可读介质。例如,如果使用同轴线缆、光纤线缆、双绞线、数字用户线路(DSL)或诸如红外线、无线电和微波的无线技术来从网站、服务器或其 它远程源发送软件,则上述同轴线缆、光纤线缆、双绞线、DSL或诸如红外线、无线电和微波的无线技术均包括在介质的定义。如这里所使用的,磁盘和光盘包括压缩盘(CD)、激光盘、光盘、数字多功能盘(DVD)、软盘、蓝光盘,其中磁盘通常磁性地再现数据,而光盘利用激光光学地再现数据。上述内容的组合也应当包括在计算机可读介质的范围内。In one or more exemplary designs, functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted through the computer-readable medium. Computer-readable media include computer storage media and communication media, including any media that facilitates the transfer of a computer program from one location to another location. A storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer. By way of example and not limitation, the computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, magnetic disk storage devices, or other magnetic storage devices, or may be used for carrying or storing instructions in the form of Or any other medium that can be accessed by a general-purpose or special-purpose computer or general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if you use coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave to send software from a website, server, or other remote source, the above-mentioned coaxial cable Cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media. As used herein, magnetic disks and optical disks include compact disks (CD), laser disks, optical disks, digital versatile disks (DVD), floppy disks, and Blu-ray disks. Disks usually reproduce data magnetically, while optical disks use lasers to optically reproduce data. . Combinations of the above content should also be included in the scope of computer-readable media.
以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。The above are exemplary embodiments disclosed by the present invention, but it should be noted that various changes and modifications can be made without departing from the scope of the disclosure of the embodiments of the present invention as defined by the claims. The functions, steps and/or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any specific order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual forms, they may also be understood as plural unless explicitly limited to a singular number.
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。It should be understood that as used herein, unless the context clearly supports exceptions, the singular form "a" is intended to also include the plural form. It should also be understood that "and/or" as used herein refers to any and all possible combinations including one or more items listed in association.
上述本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the disclosed embodiments of the foregoing embodiments of the present invention are only for description, and do not represent the superiority of the embodiments.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the above-mentioned embodiments can be completed by hardware, or by a program instructing related hardware to be completed. The program can be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a magnetic disk or an optical disk, etc.
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本发明实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is only exemplary, and is not intended to imply that the scope of disclosure (including the claims) of the embodiments of the present invention is limited to these examples; under the idea of the embodiments of the present invention The above embodiments or the technical features in different embodiments can also be combined, and there are many other changes in different aspects of the above embodiments of the present invention, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.

Claims (10)

  1. 一种查询CPLD版本信息的方法,其特征在于,基于BMC执行以下步骤:A method for querying CPLD version information, characterized in that the following steps are performed based on BMC:
    基于IPMI协议注册CPLD查询函数;Register CPLD query function based on IPMI protocol;
    响应于接收到查询CPLD版本信息的请求,根据所述请求调用所述CPLD查询函数;In response to receiving a request for querying CPLD version information, calling the CPLD query function according to the request;
    基于CPLD查询函数中CPLD参数与CPLD文件的映射关系确定保存CPLD数据的文件位置;Determine the file location for saving CPLD data based on the mapping relationship between CPLD parameters and CPLD files in the CPLD query function;
    从所述文件位置对应的文件中获取CPLD版本信息的原始数据;以及Obtain the original data of the CPLD version information from the file corresponding to the file location; and
    对所述原始数据进行处理得到CPLD版本信息。The original data is processed to obtain CPLD version information.
  2. 根据权利要求1所述的方法,其特征在于,所述基于IPMI协议注册CPLD查询函数包括:The method according to claim 1, wherein the CPLD query function registration based on the IPMI protocol comprises:
    注册CPLD查询函数中的请求消息结构体和响应消息结构体。Register the request message structure and response message structure in the CPLD query function.
  3. 根据权利要求2所述的方法,其特征在于,所述从所述文件位置对应的文件中获取CPLD版本信息的原始数据包括:The method according to claim 2, wherein the obtaining the original data of CPLD version information from the file corresponding to the file position comprises:
    基于所述消息结构体中的偏移地址和数据长度大小读取CPLD版本信息的原始数据。Read the original data of the CPLD version information based on the offset address and the size of the data length in the message structure.
  4. 根据权利要求1所述的方法,其特征在于,所述对所述原始数据进行处理得到CPLD版本信息包括:The method according to claim 1, wherein the processing the original data to obtain CPLD version information comprises:
    将所述原始数据中的三个子数据与不同参考值进行与操作并移位分别得到主版本信息、子版本信息以及阶段版本号。The three sub-data in the original data are ANDed with different reference values and shifted to obtain the main version information, the sub-version information, and the phase version number, respectively.
  5. 根据权利要求4所述的方法,其特征在于,所述对所述原始数据进行处理得到CPLD版本信息还包括:The method according to claim 4, wherein said processing the original data to obtain CPLD version information further comprises:
    在所述主版本信息、子版本信息和阶段版本号之间分别采用标识符进行分隔以得到CPLD版本信息。The main version information, the sub-version information, and the phase version number are separated by identifiers to obtain CPLD version information.
  6. 一种计算机设备,其特征在于,包括:A computer device, characterized in that it comprises:
    至少一个处理器;以及At least one processor; and
    存储器,所述存储器存储有可在所述处理器上运行的计算机指令,所述指令由所述处理器执行时实现以下步骤:A memory, the memory stores computer instructions that can run on the processor, and when the instructions are executed by the processor, the following steps are implemented:
    基于IPMI协议注册CPLD查询函数;Register CPLD query function based on IPMI protocol;
    响应于接收到查询CPLD版本信息的请求,根据所述请求调用所述CPLD查询函数;In response to receiving a request for querying CPLD version information, calling the CPLD query function according to the request;
    基于CPLD查询函数中CPLD参数与CPLD文件的映射关系确定保存CPLD数据的文件位置;Determine the file location for saving CPLD data based on the mapping relationship between CPLD parameters and CPLD files in the CPLD query function;
    从所述文件位置对应的文件中获取CPLD版本信息的原始数据;以及Obtain the original data of the CPLD version information from the file corresponding to the file location; and
    对所述原始数据进行处理得到CPLD版本信息。The original data is processed to obtain CPLD version information.
  7. 根据权利要求6所述的计算机设备,其特征在于,所述基于IPMI协议注册CPLD查询函数包括:The computer device according to claim 6, wherein the CPLD query function based on IPMI protocol registration comprises:
    注册CPLD查询函数中的请求消息结构体和响应消息结构体。Register the request message structure and response message structure in the CPLD query function.
  8. 根据权利要求7所述的计算机设备,其特征在于,所述从所述文件位置对应的文件中获取CPLD版本信息的原始数据包括:8. The computer device according to claim 7, wherein the obtaining the original data of CPLD version information from the file corresponding to the file location comprises:
    基于所述消息结构体中的偏移地址和数据长度大小读取CPLD版本信息的原始数据。Read the original data of the CPLD version information based on the offset address and the size of the data length in the message structure.
  9. 根据权利要求6所述的计算机设备,其特征在于,所述对所述原始数据进行处理得到CPLD版本信息包括:The computer device according to claim 6, wherein said processing the original data to obtain CPLD version information comprises:
    将所述原始数据中的三个子数据与不同参考值进行与操作并移位分别得到主版本信息、子版本信息以及阶段版本号。The three sub-data in the original data are ANDed with different reference values and shifted to obtain the main version information, the sub-version information, and the phase version number, respectively.
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-5任意一项所述方法的步骤。A computer-readable storage medium storing a computer program, wherein the computer program implements the steps of any one of claims 1 to 5 when the computer program is executed by a processor.
PCT/CN2020/092823 2019-10-25 2020-05-28 Method for querying cpld version information, device, and medium WO2021077740A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911022208.2A CN111045989A (en) 2019-10-25 2019-10-25 Method, device and medium for querying CPLD version information
CN201911022208.2 2019-10-25

Publications (1)

Publication Number Publication Date
WO2021077740A1 true WO2021077740A1 (en) 2021-04-29

Family

ID=70231779

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/092823 WO2021077740A1 (en) 2019-10-25 2020-05-28 Method for querying cpld version information, device, and medium

Country Status (2)

Country Link
CN (1) CN111045989A (en)
WO (1) WO2021077740A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045989A (en) * 2019-10-25 2020-04-21 苏州浪潮智能科技有限公司 Method, device and medium for querying CPLD version information
CN113885963B (en) * 2021-10-18 2023-04-21 广州中望龙腾软件股份有限公司 Secondary development file execution method, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160103864A1 (en) * 2014-10-08 2016-04-14 Adobe Systems Incorporated Structured Information Differentiation in Naming
CN109634686A (en) * 2018-12-17 2019-04-16 郑州云海信息技术有限公司 A kind of method and system by BMC remote configuration server state
CN109739772A (en) * 2019-01-09 2019-05-10 郑州云海信息技术有限公司 It is a kind of to realize that CPLD refreshes the method and apparatus tested automatically
CN111045989A (en) * 2019-10-25 2020-04-21 苏州浪潮智能科技有限公司 Method, device and medium for querying CPLD version information

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634659A (en) * 2018-12-18 2019-04-16 浪潮电子信息产业股份有限公司 Method, apparatus, equipment and the storage medium that a kind of couple of BMC is controlled

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160103864A1 (en) * 2014-10-08 2016-04-14 Adobe Systems Incorporated Structured Information Differentiation in Naming
CN109634686A (en) * 2018-12-17 2019-04-16 郑州云海信息技术有限公司 A kind of method and system by BMC remote configuration server state
CN109739772A (en) * 2019-01-09 2019-05-10 郑州云海信息技术有限公司 It is a kind of to realize that CPLD refreshes the method and apparatus tested automatically
CN111045989A (en) * 2019-10-25 2020-04-21 苏州浪潮智能科技有限公司 Method, device and medium for querying CPLD version information

Also Published As

Publication number Publication date
CN111045989A (en) 2020-04-21

Similar Documents

Publication Publication Date Title
WO2019153549A1 (en) Method and apparatus for dynamically generating api, computer device and storage medium
WO2021128903A1 (en) Method and system for accelerating reading of information of field replace unit, device and medium
US10911565B2 (en) Method, device and system for associating a service account
WO2017028514A1 (en) Method and device for storing and reading data
US11243595B2 (en) Method and apparatus for reducing continuous-wakeup delay of bluetooth loudspeaker, and bluetooth loudspeaker
WO2021077740A1 (en) Method for querying cpld version information, device, and medium
WO2015024494A1 (en) Application sharing method and device
WO2017097075A1 (en) Fuzzy keyword matching method and apparatus
WO2020228038A1 (en) Domain name processing method, apparatus, electronic device, and storage medium
WO2019153555A1 (en) Method and device for generating er relationships, computer device, and storage medium
US11800575B2 (en) Just in time connection configuration stored in SIM profile
WO2021051624A1 (en) Data acquisition method and apparatus, and electronic device and storage medium
WO2020244159A1 (en) Interface message refreshing method and apparatus, computer device, and readable storage medium
WO2021027182A1 (en) Method for communication between front stage and rear stage of server power supply, device, and readable medium
WO2021082417A1 (en) Method and system for controlling internal serial port access of multi-node device
CN109753424B (en) AB test method and device
WO2020015500A1 (en) Processing method, device and apparatus for mesh network, and storage medium
US20140074933A1 (en) Method and terminal for editing information in social network service applications
US10984383B2 (en) Book information collaboration system and method
WO2020134949A1 (en) Session request sending method and apparatus, electronic device and storage medium
WO2023155591A1 (en) Progress information management and control method, micro-service apparatus, electronic device, and storage medium
KR20180038522A (en) Forward activity-related information from the source electronic device to the companion electronic device
WO2021120459A1 (en) Application program starting method and device
WO2022017398A1 (en) Method and apparatus for establishing communication connection, and device, and computer readable storage medium
US20160321226A1 (en) Insertion of unsaved content via content channel

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20880237

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20880237

Country of ref document: EP

Kind code of ref document: A1