Double-control SD card communication method, device and medium

文档序号:735122 发布日期:2021-04-20 浏览:39次 中文

阅读说明:本技术 一种双控sd卡通信的方法、装置及介质 (Double-control SD card communication method, device and medium ) 是由 叶明洋 王鹏 杨德晓 张敏 付水论 于 2020-12-25 设计创作,主要内容包括:本发明公开了一种双控SD卡通信的方法,包括环境部署,设置第一控制中心的第一通信pin和第二控制中心的第二通信pin,将第一控制中心与第二控制中心连接;加载固件信息,根据固件信息匹配存储模块的Raid模式;建立数据交互条件,并设置优先级,建立数据交互条件,并设置优先级,根据所述数据交互条件以及所述优先级控制所述第一控制中心和所述第二控制中心进行通信状态交互,控制所述第一控制中心和所述第二控制中心与所述存储模块进行数据交互;通过上述方式,本发明能够支持双控切换的SD卡通信,以及对能够对SD卡进行Raid,且兼顾了BMC和PCH对于SD卡的需求,同时可以支持Raid,实现数据的安全,降低成本。(The invention discloses a double-control SD card communication method, which comprises the steps of environment deployment, setting a first communication pin of a first control center and a second communication pin of a second control center, and connecting the first control center and the second control center; loading firmware information, and matching the Raid mode of the storage module according to the firmware information; establishing a data interaction condition, setting a priority, controlling the first control center and the second control center to carry out communication state interaction according to the data interaction condition and the priority, and controlling the first control center and the second control center to carry out data interaction with the storage module; by the mode, the dual-control switching SD card communication and the RAid for the SD card can be supported, the requirements of BMC and PCH for the SD card are considered, the RAid can be supported, data safety is realized, and cost is reduced.)

1. A method for double-control SD card communication is characterized by comprising the following steps:

presetting communication pins of a control center, wherein the communication pins of the control center comprise a first communication pin of a first control center and a second communication pin of a second control center, connecting the first control center and the second control center, establishing a data interaction condition, and setting a priority;

loading firmware information, and matching the Raid mode of the storage module according to the firmware information;

and respectively controlling the first control center and the second control center to carry out communication state interaction according to the data interaction condition and the priority, and controlling the first control center and the second control center to carry out data interaction with the storage module.

2. The method for dual-control SD card communication according to claim 1, wherein: when the first control center and the second control center do not perform data interaction or the first control center and the second control center complete data interaction, the states of the first communication pin and the second communication pin are not in-place.

3. The method for dual-control SD card communication according to claim 2, wherein: the step of controlling the first control center and the second control center to perform data interaction with the storage module comprises the following steps:

when the first control center performs data exchange, the state of the first communication pin is changed to an on-position state, if the second control center needs to perform data exchange, the state of the second communication pin is changed to the on-position state, the first control center waits for completion of data exchange, and after the state of the first communication pin is changed to a non-on-position state, the second control center performs data exchange.

4. The method for dual-control SD card communication according to claim 1, wherein: the establishing of the data interaction condition comprises the following steps: and when data interaction is carried out, data interaction is carried out at the first control center, and after the data interaction of the first control center is finished, data interaction is carried out at the second control center.

5. The method for dual-control SD card communication according to claim 1, wherein: the setting of the priority comprises the following steps:

setting a control center with a first priority and a control center with a second priority;

when the control center of the first priority needs to perform data interaction, if the control center of the second priority is performing data interaction at the moment, storing the data of the control center of the second priority in a storage chip, wherein the control center of the first priority performs data interaction first;

and after the data interaction of the control center with the first priority is finished, the data interaction of the control center with the second priority is carried out again.

6. The method for dual-control SD card communication according to claim 1, wherein: the storage module is provided with a first SD card and a second SD card, and the first SD card and the second SD card store the same data.

7. A double-control SD card communication device is characterized by comprising a first control center, a second control center, a storage control module, a flash memory and a storage module; the first control center is connected with the second control center through a connecting line, the first control center is provided with a plurality of first communication pins, and the second control center is provided with a plurality of second communication pins; the first control center is connected with the storage control module through a USB (universal serial bus) line; the second control center is connected with the storage control module through an MMC; the storage control module is connected with the storage module through an MMC; the flash memory is connected with the storage control module through a connecting wire.

8. The dual-control SD card communication device according to claim 7, wherein said connection lines comprise an I2C bus and an SPI bus.

9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of a method for dual-controlled SD card communication according to any one of claims 1 to 6.

Technical Field

The invention relates to the field of hardware design, in particular to a method, a device and a medium for double-control SD card communication.

Background

In a server system, a component using RAID (Redundant Arrays of Independent Disks) technology generally refers to a hard disk, and RAID is performed on a hard disk expanded by a server through a standard PCIe (peripheral component interconnect express) RAID card, so that the throughput of a storage system is greatly improved on the basis of increasing a transmission rate of the hard disk, and a fault-tolerant mechanism is added, thereby ensuring the safety and reliability of the system. As for the SD (Secure Digital) memory card, because the SD memory card has a small size, is convenient to carry and easy to assemble, more and more server systems are added with SD storage devices, so that a user can store data conveniently, or some software tools are loaded to a server by using the SD memory card.

In the prior art, SD storage devices are extended through protocol conversion or interfaces including SDIO (Secure Digital Input and Output) protocols through protocol interfaces carried by PCH (Platform control center) and BMC (Baseboard management Controller) chips in a server system. In the prior art, the use of the SD storage device is generally limited to simple hardware expansion, although the SD storage device can be used for data storage or loading, the efficiency of redundancy and security is greatly reduced, and currently, one SD card is respectively hung under the PCH and the BMC in the design, so that the data security is insufficient; if the design is carried out according to the conventional Raid scheme, two groups of SD card RAIDs need to be set for the PCH and the BMC, which results in higher cost.

Disclosure of Invention

The invention mainly solves the technical problems that the existing method for expanding the SD card storage equipment has insufficient safety, the Raid redundancy design cannot be realized, the data cannot be recovered after being lost, the PCH and the BMC are required to be respectively provided with the RAID, and the cost is higher.

In order to solve the technical problems, the invention adopts a technical scheme that: the method for the double-control SD card communication comprises the following steps:

presetting communication pins of a control center, wherein the communication pins of the control center comprise a first communication pin of a first control center and a second communication pin of a second control center, connecting the first control center and the second control center, establishing a data interaction condition, and setting a priority;

loading firmware information, and matching the Raid mode of the storage module according to the firmware information;

and respectively controlling the first control center and the second control center to carry out communication state interaction according to the data interaction condition and the priority, and controlling the first control center and the second control center to carry out data interaction with the storage module.

Further, when the first control center and the second control center do not perform data interaction or the first control center and the second control center complete data interaction, the states of the first communication pin and the second communication pin are in-place states.

Further, the step of controlling the first control center and the second control center to perform data interaction with the storage module includes the following steps:

when the first control center performs data exchange, the state of the first communication pin is changed to an on-position state, if the second control center needs to perform data exchange, the state of the second communication pin is changed to the on-position state, the first control center waits for completion of data exchange, and after the state of the first communication pin is changed to a non-on-position state, the second control center performs data exchange.

Further, the establishing of the data interaction condition comprises: and when data interaction is carried out, data interaction is carried out at the first control center, and after the data interaction of the first control center is finished, data interaction is carried out at the second control center.

Further, the setting of the priority includes the steps of:

setting a control center with a first priority and a control center with a second priority;

when the control center of the first priority needs to perform data interaction, if the control center of the second priority is performing data interaction at the moment, storing the data of the control center of the second priority in a storage chip, wherein the control center of the first priority performs data interaction first;

and after the data interaction of the control center with the first priority is finished, the data interaction of the control center with the second priority is carried out again.

Further, a first SD card and a second SD card are provided in the storage module, and the first SD card and the second SD card store the same data.

The invention also provides a device for double-control SD card communication, which comprises a first control center, a second control center, a storage control module, a flash memory and a storage module; the first control center is connected with the second control center through a connecting line, the first control center is provided with a plurality of first communication pins, and the second control center is provided with a plurality of second communication pins; the first control center is connected with the storage control module through a USB (universal serial bus) line; the second control center is connected with the storage control module through an MMC; the storage control module is connected with the storage module through an MMC; the flash memory is connected with the storage control module through a connecting wire.

The connection lines include an I2C bus and an SPI bus.

The present invention also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a method for dual-control SD card communication as described above.

The invention has the beneficial effects that:

1. according to the method for double-control SD card communication, the SD card can be composed into Raid by loading FW information in FLASH, the requirements of PCH and BMC on the SD card can be considered at the same time through the communication pin, a priority mechanism is established during data interaction, important data can be ensured to be interacted at the first time, and the safety is improved.

2. According to the device for the double-control SD card communication, whether data interaction is carried out or not can be judged through the high and low levels of the communication pin in the PCH and the BMC, the data interaction state can be seen more clearly, the two SDs are arranged to store the same data respectively, the data can be recovered when the data are lost, the data safety is ensured, and the situation that the data cannot be recovered due to errors is avoided.

3. The computer readable storage medium can automatically judge the interaction state through the mutual matching of the PCH and the BMC and through the medium, does not need manual operation when the PCH and the BMC need to perform data interaction simultaneously, automatically and sequentially completes the data interaction, and improves the efficiency.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.

Fig. 1 is a flowchart of a method for dual-control SD card communication according to embodiment 2 of the present invention;

fig. 2 is a schematic diagram of a dual-control SD card communication apparatus according to embodiment 3 of the present invention.

Detailed Description

The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

In the description of the present invention, it should be noted that the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.

In the description of the present invention, it should be noted that RAID means a redundant array of independent disks, and the disk array is a disk group with a large capacity, which is formed by combining a plurality of independent disks, and the performance of the entire disk system is improved by the additive effect generated by providing data by individual disks. With this technique, data is divided into a plurality of sectors, each of which is stored on a respective hard disk.

The SD memory card is a new-generation memory device based on a semiconductor flash memory, and is widely used in portable devices due to its excellent characteristics such as small size, high data transfer speed, hot-swappability, and the like.

SPI is an abbreviation for Serial Peripheral Interface (Serial Peripheral Interface), a synchronous Serial Interface technology introduced by Motorola corporation, is a high-speed, full-duplex, synchronous communication bus,

FLASH memory is one kind of memory device, FLASH. Flash memory is a Non-Volatile (Non-Volatile) memory that can hold data for a long time without current supply, and has storage characteristics equivalent to a hard disk, which is the basis of flash memory becoming a storage medium for various portable digital devices.

A DRAM (Dynamic Random Access Memory) is a type of semiconductor Memory. USB3.0 is a USB specification, which is initiated by intel et al. MMC (Multimedia Card, Multimedia memory Card) is a flash memory Card standard.

The I2C (Inter-Integrated Circuit) bus is a simple, bi-directional two-wire synchronous serial bus developed by Philips corporation.

FW is an abbreviation for Firmware, known as Firmware.

The pin, also called pin, is a wiring led out from the internal circuit of the integrated circuit (chip) to the peripheral circuit, and all the pins form the interface of the chip.

The eMMC protocol (Embedded Multi Media Card) is an Embedded memory standard specification established by the MMC association and mainly used for products such as mobile phones and tablet computers.

The first control center is a PCH; the second control center is BMC, the on-position state is low level, and the off-position state is high level.

The embodiment of the invention comprises the following steps:

example 1

A method for dual-control SD card communication comprises the following steps:

s100, connecting and deploying devices, establishing a plurality of connections between a first control center and a second control center, setting two communication pins for communication, namely a first communication pin and a second communication pin, respectively indicating the communication state of the first control center and the communication state of the second control center, indicating that no communication is performed when the two pins are high, and pulling down a pin signal corresponding to the control center when communication is required;

s101, loading FW information from FLASH, sending the FW information to a storage module, and setting the storage module into a Raid mode matched with the FW information according to the FW information;

the storage module is provided with a first SD card and a second SD card, the first SD card and the second SD card store the same data, the data of the control center is stored and backed up, and the safety of the data is guaranteed.

S102, after the server is started, a first control center is used for communication with the storage module by default, and the first control center pulls down a first communication pin;

when the first control center is in communication with the storage module, if the second control center needs to communicate with the storage module, the second communication pin is pulled down to wait for the first control center to complete communication with the storage module, and when the first communication pin is high, the second control center communicates with the storage module.

In the communication process of the control center, different bus forms can be selected for communication, so that the requirements for faster response and more complex functions can be met; and the priority of the control center, the first priority and the second priority can be set, when the control center of the first priority needs to communicate, but the control center of the second priority is communicating at the moment, the data of the control center of the second priority is stored in the memory chip, the advanced communication of the first priority is ensured, and when the communication of the first priority is completed, the communication of the second priority is carried out again.

Example 2

The present embodiment further provides a method for dual-control SD card communication, please refer to fig. 1, which includes the following steps:

s200, deploying a test environment, wherein an SD controller is connected with a USB3.0 interface of a PCH through a USB line, is connected with a BMC through an MMC, is connected with a first SD card and a second SD card through the MMC, is connected with a FLASH through an SPI bus, and is connected with a pin in the PCH through a connecting line; the connecting line comprises an I2C bus or an SPI bus; different data can be transmitted and more complex functions can be performed through different forms of buses;

s201, after being electrified, an SD controller loads FW information from FLASH, and sets a first SD card and a second SD card connected with the FLASH into corresponding Raid modes according to the information in the FW; after power-on, the PCH and the SD card are communicated preferentially by default, namely, the PCH pulls down a pin signal of the PCH;

the FW information is a program provided by a manufacturer of the SD controller chip to adapt to the motherboard, and operations required to be performed by the SD controller chip loading, including RAID information, IO pin configuration, and the like, are generally provided by the manufacturer according to our needs. FW will be stored in Flash chip, SD controller will read the required information from the Flash chip through I2C or SPI bus.

If the PCH is carrying out data interaction, but the BMC also needs to carry out data interaction at the moment, the BMC pulls down a pin signal of the BMC to wait for the PCH to finish interaction, and carries out data interaction when the pin of the PCH is high;

because the access amount of the BMC to the data is not high, the communication of the PCH is not greatly affected basically. Meanwhile, on the basis, a priority function can be added, if the data communication requirement of the PCH is detected, the BMC can temporarily store the data in a DRAM or other memory chips, the communication of the PCH is preferentially ensured, and the data is stored in the SD card when the PCH is idle or the PCH communication is finished.

The method comprises the steps that the BMC can be connected with a GPIO (general purpose input/output) interface of the PCH, information of finishing data interaction of the PCH is read, when the PCH is in a power-on state and a power-off state, namely a standby state, the GPIO interface reads that data interaction is not performed on the PCH, and the BMC can perform data interaction.

Example 3

Based on the same inventive concept as the method for dual-control SD card communication in the foregoing embodiment, the present embodiment further provides a device for dual-control SD card communication, please refer to fig. 2, which includes a first control center, a second control center, a storage control module, a flash memory, and a storage module;

the first control center is connected with the second control center through a plurality of connecting wires, the first control center is provided with a plurality of first communication pins, and the second control center is provided with a plurality of second communication pins; the system comprises a storage module, a first control center, a second control center and a control module, wherein the storage module is used for storing communication state information of the first control center and the second control center;

the storage control module is provided with a plurality of uplink interfaces and a plurality of downlink interfaces;

the first control center is connected with the uplink interface of the storage control module through a USB3.0 interface connecting USB line;

the second control center is connected with the uplink interface of the storage control module through the MMC;

the downlink interface of the storage control module is connected with the storage module through an MMC; the flash memory is connected with the storage control module through a connecting wire;

when information is transmitted through the MMC, the information is transmitted through the eMMC protocol.

The storage module is provided with a first SD card and a second SD card.

The connection lines include an I2C bus, an SPI bus.

Based on the same inventive concept as the method in the foregoing embodiments, the present embodiment further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method for dual-control SD card communication as disclosed in the foregoing.

The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.

It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, and a program that can be implemented by the hardware and can be instructed by the program to be executed by the relevant hardware may be stored in a computer readable storage medium, where the storage medium may be a read-only memory, a magnetic or optical disk, and the like.

The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:DMA编程电路及基于DMA编程电路的编程方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!