Data reading method and device, equipment and medium
By comparing the data returned by the expansion card in the main control cabinet, identifying and avoiding invalid data analysis, the storage system stability problem caused by PCIe link instability is solved, and the system operation stability is improved.
Patent Information
- Application Number
- CN202411186473.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-08-27
AI Technical Summary
When the PCIe link is unstable, the receiver of the storage system will receive invalid data from the expansion card, causing the node to restart and affect the stability of the storage system.
By executing the target process in the main control cabinet, obtaining the data and verification values returned by the expansion card, calculating the second verification value and comparing it with the first verification value. If it is not equal, it is judged that the data is invalid data and no analysis is performed. Avoid hot restart.
Improve the operation stability of the storage system, prevent hot restarts caused by invalid data, and ensure the integrity of data transmission.
Smart Images

Figure CN119226195A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data reading method, device, equipment and medium. Background Art
[0002] When the PCIe link between the receiving end and the sending end of the storage system is unstable, the transmission content between the two will be answered by the expansion card. That is to say, the MRPC instruction sent to the PSX (PCIe switch, PCIe switch module) will fill 0xFF into the corresponding page data sent to the receiving end when the link is unstable, so that the receiving end receives invalid data. When the receiving end needs to read the data in the page, after reading the invalid data value, it will cause a hot restart of the node corresponding to the receiving end in the storage, thereby affecting the stability of the storage operation. Summary of the invention
[0003] In view of this, embodiments of the present application provide a data reading method, apparatus, device and medium to overcome the above problems or at least partially solve the above problems.
[0004] A first aspect of an embodiment of the present application provides a data reading method, which is applied to a first controller of a main control cabinet, wherein the main control cabinet is communicatively connected with an extension cabinet through an extension card, and the method includes:
[0005] Execute a target process to obtain first data returned by the expansion card, wherein the target process is used to read current data in a target page of the expansion cabinet;
[0006] Obtaining a first check value corresponding to the current data;
[0007] Calculating a second check value according to the first data, and determining whether the first check value is equal to the second check value;
[0008] When the first check value is not equal to the second check value, it is determined that the first data is invalid data replied by the expansion card, and the first data is not parsed.
[0009] Optionally, the first controller includes a first main controller and a first standby controller, and the method further includes:
[0010] After determining that the first data is invalid data replied by the expansion card, determining that the target program fails to execute, and counting the number of times the target process fails to execute;
[0011] When the number of execution failures of the target process corresponding to the first main controller reaches a first preset threshold, taking over the first main controller through the first standby controller;
[0012] When the number of execution failures of the target process corresponding to the first standby controller reaches a second preset threshold, it is determined that the first controller is not redundant, and a first alarm message is issued.
[0013] Optionally, before obtaining the first check value corresponding to the current data, the method further includes:
[0014] Receiving, by the second controller of the expansion cabinet, a third check value actively uploaded by the expansion card when the current data in the target page is updated, the third check value being calculated by the second controller according to the current data after the target page is updated;
[0015] and / or, in the process of executing the target process, actively reading the verification value of the expansion cabinet to obtain a fourth verification value returned by the expansion card;
[0016] The fourth verification value includes any one of the following:
[0017] Setting data answered by the expansion card in case the link between the main control cabinet and the expansion cabinet is unstable;
[0018] A fifth check value calculated by the second controller of the expansion cabinet according to the current data in the target page;
[0019] The obtaining a first check value corresponding to the current data includes:
[0020] Determine the check value associated with the target page obtained most recently through the expansion card as the first check value corresponding to the current data;
[0021] The check value associated with the target page includes the third check value and the fourth check value.
[0022] Optionally, before executing the target process, the method further includes:
[0023] The main control cabinet is connected to the plurality of extension cabinets through the extension card, so that the main control cabinet is in communication connection with the extension cabinets;
[0024] A storage cluster is established based on the main control cabinet and the plurality of expansion cabinets.
[0025] Optionally, the target process is any one of the following: a discovery process, a command issuing process, and a license information processing process, and the method further includes:
[0026] According to the type of the target process currently to be executed, the target page currently to be read is determined.
[0027] Optionally, determining the target page to be read currently according to the type of the target process to be executed currently includes:
[0028] When the target process is a discovery process, determining that the target page currently required to be read is the first page;
[0029] When the target process is a command issuing process, determining that the target page currently to be read is the second page;
[0030] When the target process is a license information processing process, determining that the target page currently required to be read is the third page;
[0031] The method further comprises:
[0032] Counting the number of execution failures of the discovery process, the command issuing process, and the license information processing process respectively;
[0033] When the number of execution failures of any one of the discovery process, the command issuance process, and the license information processing process reaches a third preset threshold, it is determined that the first controller is not redundant, and a first alarm message is issued.
[0034] A second aspect of an embodiment of the present application provides a data reading method, which is applied to a second controller of an expansion cabinet, wherein the expansion cabinet is communicatively connected to a main control cabinet through an expansion card, and the method includes:
[0035] Calculating a first check value according to current data in the target page of the expansion cabinet;
[0036] The first check value is sent to the expansion card so that the first controller of the main control cabinet calculates the second check value according to the first data after executing the target process and obtaining the first data returned by the expansion card, and determines whether the first check value is equal to the second check value, and when the first check value is not equal to the second check value, determines that the first data is invalid data answered by the expansion card, and does not parse the first data; wherein the target process is used to read the current data in the target page of the expansion cabinet.
[0037] A third aspect of an embodiment of the present application provides a data reading device, which is applied to a first controller of a main control cabinet, wherein the main control cabinet is communicatively connected with an extension cabinet through an extension card, and the device includes:
[0038] A first data acquisition module, used to execute a target process to acquire first data returned by the expansion card, wherein the target process is used to read current data in a target page of the expansion cabinet;
[0039] A first check value acquisition module, used to acquire a first check value corresponding to the current data;
[0040] A judgment module, used to calculate a second check value according to the first data, and judge whether the first check value is equal to the second check value;
[0041] The determination module is used to determine that the first data is invalid data replied by the expansion card when the first verification value is not equal to the second verification value, and not to parse the first data.
[0042] A fourth aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the data reading method as described in the first aspect or the second aspect.
[0043] A fifth aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the data reading method as described in the first aspect or the second aspect is implemented.
[0044] Beneficial effects of this application:
[0045] An embodiment of the present application provides a data reading method, device, equipment and medium, which are applied to a first controller of a main control cabinet, and the main control cabinet is communicatively connected to the expansion cabinet through an expansion card. The method includes: executing a target process to obtain first data returned by the expansion card, and the target process is used to read current data in a target page of the expansion cabinet; obtaining a first check value corresponding to the current data; calculating a second check value based on the first data, and determining whether the first check value and the second check value are equal; when the first check value and the second check value are not equal, determining that the first data is invalid data answered by the expansion card, and not parsing the first data.
[0046] Through the technical solution of the present application, when the first controller of the main control cabinet executes the target process, it receives the first data and the first check value returned from the expansion card, calculates the second check value for the first data, and compares the first check value and the second check value. When they are equal, the data transmission is considered to be complete, otherwise it is considered that the data transmission is erroneous and the first data is invalid data. At this time, the first data is not parsed to avoid hot restart of the main control cabinet, thereby improving the stability of the storage system operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.
[0048] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0049] Figure 1 is a schematic diagram of a data reading method provided by an embodiment of the present application;
[0050] Figure 2 is a schematic diagram of a storage system provided in a data reading method provided in an embodiment of the present application;
[0051] Figure 3 is another flow chart of a data reading method provided in an embodiment of the present application;
[0052] Figure 4 is a schematic diagram of a data and check value transmission process in another data reading method provided in an embodiment of the present application;
[0053] Figure 5 is a schematic diagram of a data reading method according to another embodiment of the present application;
[0054] Figure 6 is a structural schematic diagram of a data reading device provided by an embodiment of the present application;
[0055] Figure 7 is a structural schematic diagram of another data reading device provided by an embodiment of the present application;
[0056] Figure 8 It is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0057] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.
[0058] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0059] PCI-Express (Peripheral Component Interconnect Express) is a high-speed serial computer expansion bus standard. PCIE uses a bus-sharing communication method: PCIE uses a point-to-point communication method, with each receiving end and the transmitting end, full-duplex, and based on data packet transmission; the connection between two PCIE devices is called a link, and a link can contain multiple channels (each pair of receiving and transmitting is called a channel), and the number of channels can be increased to meet higher bandwidth requirements. The channel consists of two differential signal pairs, one pair for receiving data and the other pair for sending. Therefore, each channel consists of four lines or signal traces. Conceptually, each channel is used as a full-duplex byte stream, transmitting 8-bit "byte" format data packets simultaneously in both directions between the link endpoints. A physical PCI Express link may contain 1 to 32 channels, more precisely including 1, 2, 4, 8, 12, 16 or 32 channels. The channel count is prefixed with "×" (for example, "×8" indicates an eight-channel card or slot), and ×16 is the commonly used maximum size.
[0060] The main advantage of PCIe in storage is its ability to reduce latency. Specifically, PCIe has a high speed and transfer rate, with a maximum data transfer rate of 264MB / s, which allows the functions of high-performance CPUs to be fully utilized and meet the needs of high-speed device data transfer. At the same time, PCIe's multi-bus coexistence and storage structure changes are also one of its advantages, which enables PCIe to achieve high-speed transmission and storage capacity expansion and storage sharing. PCIe devices are directly connected to the PCIe bus, bringing cache and data closer to the CPU and eliminating the overhead of traditional storage protocols.
[0061] In summary, PCIe achieves storage capacity expansion and storage sharing through high-speed transmission, storage capacity expansion and storage sharing, providing strong support for application scenarios such as high-performance computing and big data processing.
[0062] When the PCIe link between the receiving end and the sending end of the storage system is unstable, the transmission content between the two will be answered by the expansion card. That is to say, the MRPC instruction sent to the PSX (PCIe switch, PCIe switch module) will fill 0xFF into the corresponding page data sent to the receiving end when the link is unstable, causing the receiving end to receive invalid data. When the receiving end needs to read the data in the page, after reading the invalid data value, it will cause a hot restart of the node corresponding to the receiving end in the storage, thereby affecting the stability of the storage system operation.
[0063] Therefore, based on the technical problem mentioned above that abnormal data read causes hot restart of nodes in storage, resulting in reduced stability of storage operation, the present application proposes a data reading method, device, equipment and medium.
[0064] Figure 1 is a schematic diagram of a data reading method provided by an embodiment of the present application, such as Figure 1 As shown, an embodiment of the present application provides a data reading method, which is applied to a first controller of a main control cabinet, wherein the main control cabinet is communicatively connected with an extension cabinet through an extension card, and the method comprises the following steps:
[0065] Step S101, executing a target process to obtain first data returned by the expansion card, wherein the target process is used to read current data in a target page of the expansion cabinet;
[0066] Step S102, obtaining a first check value corresponding to the current data;
[0067] Step S103, calculating a second check value according to the first data, and determining whether the first check value is equal to the second check value;
[0068] Step S104: when the first check value is not equal to the second check value, it is determined that the first data is invalid data replied by the expansion card, and the first data is not parsed.
[0069] Figure 2 is a schematic diagram of a storage system provided in a data reading method provided in an embodiment of the present application, such as Figure 2 As shown, the storage system includes a main control cabinet and multiple expansion cabinets. The main control cabinet is the storage control cabinet in the storage system. The main control cabinet and each expansion cabinet are connected through an expansion card (for example, an NVME switch card). This connection method allows the storage system to be expanded and managed more flexibly.
[0070] Figure 3 is another flow chart of a data reading method provided by an embodiment of the present application, such as Figure 3 shown.
[0071] First, in step S101, the first controller is the controller on the main control cabinet, which is responsible for executing the task of acquiring data from the expansion cabinet. When the first controller needs to acquire the current data of the target page on the expansion cabinet, it will start to execute the target process, wherein the target process refers to a predefined program for acquiring the data read from the target page of the expansion cabinet. The expansion card will serve as a bridge between the expansion cabinet and the main control cabinet, and return the current data in the target page of the expansion cabinet to the main control cabinet. Therefore, the data returned to the main control cabinet through the expansion card is called the first data, wherein the target page is a specific display area for storing software and hardware data inside the expansion cabinet, and different target processes correspond to acquiring data in different target pages.
[0072] It should be noted that the first data is the data returned by the expansion card to the main control cabinet, and is not necessarily the same as the current data in the target page of the expansion cabinet. The current data in the target page of the expansion cabinet is valid data, but the first data is not necessarily valid data.
[0073] Further, in step S102, the first controller further obtains a first verification value corresponding to the current data. The first verification value is calculated by the expansion cabinet based on the current data of the target page, and transmitted to the main control cabinet through the expansion card. The first verification value can be determined according to the CRC verification algorithm, and the first verification value changes with the change of the current data of the target page.
[0074] Further, in step S103, the first controller calculates a second check value based on the received first data. Similarly, the second check value can also be determined based on the CRC check algorithm, and the first check value and the second check value are compared to determine whether the comparison results are consistent. If the first check value and the second check value are equal, it means that the first check value and the second check value are both calculated for the same data. Therefore, the first data obtained by the main control cabinet is the same as the current data in the target page of the expansion cabinet. During the data transmission process, there is no situation where the link is unstable and causes the expansion card to answer the current data in the target page of the expansion cabinet.
[0075] The calculation of the check value may also adopt other check algorithms, and different check algorithms have different check capabilities and calculation complexities. The selection of a suitable algorithm needs to consider factors such as the sensitivity of the data, the amount of data, and the calculation capability.
[0076] Finally, in step S104, when the comparison result of the first check value and the second check value indicates that the first check value and the second check value are not equal, it means that the first check value and the second check value are calculated for different data. Then, the first data is invalid data replied by the expansion card, which causes the first data received by the main control cabinet to be different from the current data in the target page of the expansion cabinet. At this time, the first controller of the main control cabinet does not parse the first data, so as to avoid hot restart of the main control cabinet, thereby improving the stability of the storage system operation.
[0077] Through the above embodiment, the first controller of the main control cabinet receives the first data and the first check value returned from the expansion card by executing the target process, calculates the second check value for the first data, compares the first check value and the second check value, and when they are equal, it is considered that the data transmission is complete, otherwise it is considered that the data transmission is erroneous and the first data is invalid data. At this time, the first data is not parsed to avoid hot restart of the main control cabinet, thereby improving the stability of the storage system operation.
[0078] Figure 4 is a schematic diagram of a transmission process of data and a check value in another data reading method provided in an embodiment of the present application, such as Figure 4 shown.
[0079] Optionally, the first controller includes a first main controller and a first standby controller, and the method further includes:
[0080] After determining that the first data is invalid data replied by the expansion card, determining that the target program fails to execute, and counting the number of times the target process fails to execute;
[0081] When the number of execution failures of the target process corresponding to the first main controller reaches a first preset threshold, taking over the first main controller through the first standby controller;
[0082] When the number of execution failures of the target process corresponding to the first standby controller reaches a second preset threshold, it is determined that the first controller is not redundant, and a first alarm message is issued.
[0083] Specifically, in one embodiment, the first controller is divided into two primary and secondary controllers, namely a first primary controller and a first secondary controller, so that when the primary controller fails, the secondary controller can take over the work to ensure the normal operation of the storage system.
[0084] After the first controller obtains the first data from the expansion card, when the first check value and the second check value do not match, it is determined that the first data obtained is invalid, indicating that an error occurred during the data transmission process. At this time, the first main controller and the first backup controller will both record the number of times the target process execution fails. When the number of times the target process execution corresponding to the first main controller fails reaches the first preset threshold, it indicates that the main controller may have a fault. At this time, the work of the first main controller is taken over by the first backup controller. When the number of times the target process execution corresponding to the first backup controller fails reaches the second preset threshold, it indicates that the backup controller may also have a fault. At this time, it is determined that the entire first controller has a fault and cannot be redundant, and a corresponding first alarm message is issued to notify the administrator of the storage system to intervene.
[0085] The first preset threshold and the second preset threshold need to be set according to actual conditions, for example, based on factors such as the execution frequency of the target process and the system's tolerance to data delays.
[0086] Through the above embodiments, the controller redundancy mechanism can improve the reliability of the storage system. Even if the main controller fails, the backup controller can take over to ensure that the system continues to operate. The redundancy mechanism can reduce the impact of a single controller failure on the storage system, avoiding system downtime or data loss. In addition, by timely discovering and handling controller failures, the stability of the storage system can be improved to avoid unexpected failures. This ensures that when one of the controllers fails, the storage system can continue to operate normally.
[0087] Optionally, before obtaining the first check value corresponding to the current data, the method further includes:
[0088] Receiving, by the second controller of the expansion cabinet, a third check value actively uploaded by the expansion card when the current data in the target page is updated, the third check value being calculated by the second controller according to the current data after the target page is updated;
[0089] and / or, in the process of executing the target process, actively reading the verification value of the expansion cabinet to obtain a fourth verification value returned by the expansion card;
[0090] The fourth verification value includes any one of the following:
[0091] Setting data answered by the expansion card in case the link between the main control cabinet and the expansion cabinet is unstable;
[0092] A fifth check value calculated by the second controller of the expansion cabinet according to the current data in the target page;
[0093] The obtaining a first check value corresponding to the current data includes:
[0094] Determine the check value associated with the target page obtained most recently through the expansion card as the first check value corresponding to the current data;
[0095] The check value associated with the target page includes the third check value and the fourth check value.
[0096] Specifically, in one embodiment, the process of determining the first verification value is as follows.
[0097] First, before obtaining the first check value corresponding to the current data, the second controller of the expansion cabinet (i.e., PSX) will periodically monitor the current data of each target page to determine whether an update has occurred. When the current data of the target page is updated, the second controller will calculate the check value for the current data of the updated target page, and send the check value corresponding to the updated current data to the main control cabinet through the expansion card. Since the transmission of the check value may cause transmission abnormalities due to unstable links, the check value returned by the expansion card received by the main control cabinet is the third check value. At this time, the third check value is not necessarily equal to the check value corresponding to the updated current data of the expansion card.
[0098] In addition, during the execution of the target process, the first controller of the main control cabinet will also actively read the verification value from the expansion cabinet for the current data of the target page. During this process, the fourth verification value returned by the expansion card will be received. Similarly, in order to respond to the target process, the verification value sent by the expansion cabinet to the main control cabinet may also be answered by the expansion card due to unstable link. Therefore, the fourth verification value received by the main control cabinet is not necessarily equal to the verification value sent by the expansion cabinet to the main control cabinet.
[0099] There are two situations for the value of the fourth check value. One is that when the link is stable, the fourth check value is equal to the fifth check value calculated by the second controller of the expansion cabinet based on the current data in the target page. When the link is unstable, the fourth check value is the setting data of the expansion card between the main control cabinet and the expansion cabinet, such as 0xFF.
[0100] In this case, the main control cabinet will actually receive multiple verification values and obtain multiple verification values. Therefore, different target processes need to read multiple verification values associated with the target page (that is, including: the third verification value and the fourth verification value). Before comparing the first verification value and the second verification value, it is necessary to determine the first verification value from the multiple verification values. The first verification value is determined by determining the verification value associated with the target page obtained most recently through the expansion card as the first verification value corresponding to the current data.
[0101] For example, when the target page data is updated for the first time, the checksum calculated by the second controller of the expansion cabinet is 0x1234.
[0102] Since the PCIe link between the main control cabinet and the expansion cabinet is unstable, the third check value actually received by the main control cabinet is 0xFF (that is, the expansion card reply data).
[0103] At this time, the target page data is updated for the second time. The main control cabinet actively reads the target page data, and the expansion cabinet calculates the fourth verification value as 0x1234 (normally transmitted data). When there is no unstable PCIe link at this time, the verification value actually received by the main control cabinet is the fourth verification value.
[0104] Since the fourth check value is the check value associated with the target page most recently obtained through the expansion card, the fourth check value is used as the first check value to be compared with the second check value to determine whether the data received by the main control cabinet is invalid data answered by the expansion card. That is, the main control cabinet will select the most recently received fourth check value 0x1234 as the first check value for subsequent comparison with the second check value.
[0105] Through the above-mentioned embodiments, by using multiple check values, the accuracy of error judgment in the data transmission process can be improved, and even if the link is unstable, it can be determined as accurately as possible whether the data is valid. Even if the previously obtained check value has a problem with the link, the storage system can perform data verification by selecting the most recently received check value, thereby improving the robustness of the business trip system. In addition, since the unstable link may cause data to be answered, selecting the most recently received check value can reduce the error rate of judging whether the data is invalid, avoiding storage system errors caused by incorrect check values. When invalid data is determined, the invalid data is not parsed, and there is no need to hot restart the main control cabinet, thereby ensuring the stability of the storage system operation.
[0106] Optionally, before executing the target process, the method further includes:
[0107] The main control cabinet is connected to the plurality of extension cabinets through the extension card, so that the main control cabinet is in communication connection with the extension cabinets;
[0108] A storage cluster is established based on the main control cabinet and the plurality of expansion cabinets.
[0109] Specifically, in one embodiment, before executing the target process, two key steps need to be performed:
[0110] First, the main control cabinet establishes a communication connection with multiple expansion cabinets through the expansion card to ensure that the main control cabinet can exchange data with each expansion cabinet.
[0111] Furthermore, a storage cluster is constructed based on the main control cabinet and multiple expansion cabinets with established communication connections. The storage cluster is used to integrate the storage space of multiple expansion cabinets to form a unified storage system, providing a basis for the subsequent execution of the target process.
[0112] Through the above embodiments, the storage space of the main control cabinet and multiple expansion cabinets are integrated together, which can greatly improve the overall data storage capacity of the storage system. The storage cluster can provide data redundancy and fault tolerance mechanism. Even if an expansion cabinet fails, other expansion cabinets can still provide data access to ensure data availability. The storage cluster can distribute data on multiple expansion cabinets and perform load balancing to improve data access speed. In addition, through the storage cluster, the management of multiple expansion cabinets can be unified, simplifying management operations and reducing management costs.
[0113] Optionally, the target process is any one of the following: a discovery process, a command issuing process, and a license information processing process, and the method further includes:
[0114] According to the type of the target process currently to be executed, the target page currently to be read is determined.
[0115] Optionally, determining the target page to be read currently according to the type of the target process to be executed currently includes:
[0116] When the target process is a discovery process, determining that the target page currently required to be read is the first page;
[0117] When the target process is a command issuing process, determining that the target page currently to be read is the second page;
[0118] When the target process is a license information processing process, determining that the target page currently required to be read is the third page;
[0119] The method further comprises:
[0120] Counting the number of execution failures of the discovery process, the command issuing process, and the license information processing process respectively;
[0121] When the number of execution failures of any one of the discovery process, the command issuance process, and the license information processing process reaches a third preset threshold, it is determined that the first controller is not redundant, and a second alarm message is issued.
[0122] Specifically, in one embodiment, the target process is a variety of different processes, such as a discovery process, a command issuance process, and a license information processing process. Different target processes need to read specific pages, and different pages contain data required by the corresponding target process.
[0123] When the target process is a discovery process, the target page currently required to be read to execute the target process is determined to be the first page. When the target process is a command issuance process, the target page currently required to be read to execute the target process is determined to be the second page. When the target process is a license information processing process, the target page currently required to be read to execute the target process is determined to be the third page.
[0124] Among them, for the discovery process (discovery process), it is necessary to read the target page to obtain the hardware information, software version and other information of the expansion cabinet. The first page corresponding to the discovery process includes: page1, page2, page7, page26, paged0-paged4.
[0125] For the command issuing process, it is necessary to read the target page to obtain the current status of the expansion cabinet and the specific parameter information required to execute the command. The second page corresponding to the command issuing process is: page2.
[0126] For the license information processing flow (License vpd reading flow), the license information processing flow needs to read the target page to obtain the license information of the expansion cabinet in order to verify its legitimacy. The corresponding third page is: paged4.
[0127] When executing the target process, the number of failures of each type of process will be recorded and monitored. Therefore, it is necessary to count the number of execution failures of the discovery process, command issuance process, and license information processing process respectively. The third preset threshold is a pre-set failure limit for a single type of target process. The value of the third preset threshold for different target processes is different. When the number of execution failures of any one of the discovery process, command issuance process, and license information processing process reaches the third preset threshold, it is determined that the first controller of the main control cabinet is not redundant, and a corresponding second alarm message is issued to notify the system administrator that the redundant configuration of the controller needs to be checked to ensure the stability and reliability of the system.
[0128] In this process, when the main control cabinet executes different target processes, the pages that need to be accessed are different, the calculation of the check value is also different, and the corresponding execution failure counts and alarm actions are also different.
[0129] In this way, the execution of irrelevant processes can be effectively reduced, for example, other processes that do not involve data reading, or processes that will not encounter link instability during execution. In addition, the situation in which the execution of this solution is triggered and important computing resources of the relevant controller are occupied, and the target page is bound to the target process type, so as to avoid operations on other irrelevant page objects, thereby improving execution efficiency. In addition, technical personnel can accurately locate the relevant pages where data acquisition fails based on the alarm and the type of process executed, and then quickly perform failure processing actions such as data re-acquisition on these target pages.
[0130] Through the above embodiments, the target page is determined according to the target process type, which can avoid reading unnecessary information and improve efficiency. Reading a specific target page can ensure that the read information is required by the target process and reduce the possibility of errors. Binding the target page with the target process type can simplify the operation process, facilitate user use, improve efficiency, reduce errors, simplify operations, and provide necessary data support for subsequent target process execution.
[0131] Based on the same inventive concept, another embodiment of the present application further provides a data reading method. Figure 5 is a schematic diagram of a data reading method according to another embodiment of the present application. Figure 5 As shown, a second controller is applied to an expansion cabinet, and the expansion cabinet is connected to the main control cabinet through an expansion card. The method includes the following steps:
[0132] Step S201, calculating a first check value according to current data in the target page of the expansion cabinet;
[0133] Step S202, sending the first check value and the current data in the target page to the expansion card, so that the first controller of the main control cabinet calculates the second check value based on the first data after executing the target process and obtaining the first data returned by the expansion card, and determines whether the first check value and the second check value are equal, and when the first check value and the second check value are not equal, determines that the first data is invalid data answered by the expansion card, and does not parse the first data; wherein the target process is used to read the current data in the target page of the expansion cabinet.
[0134] Specifically, in one embodiment, a second controller, such as PSX, is configured on the expansion cabinet. The second controller can calculate a check value based on the current data in the target page of the expansion cabinet, and send the calculated check value and the current data in the target page corresponding to the check value to the expansion card, which is then transmitted to the main control cabinet through the expansion card. Through the check value, the main control cabinet can verify whether the received current data is complete and correct, thereby avoiding data loss, damage or tampering during data transmission. If the check value does not match, it means that an error has occurred during the data transmission process, and the main control cabinet can take corresponding measures, such as re-acquiring data.
[0135] Optionally, the step S201 includes:
[0136] In response to the target process, a checksum is calculated based on current data in the target page of the expansion cabinet;
[0137] And / or, when it is detected that the current data in the target page is updated, a check value is calculated according to the updated current data in the target page of the expansion cabinet.
[0138] Specifically, Figure 4 In one embodiment, there are two ways to trigger the second controller to calculate the check value corresponding to the current data of the target page of the expansion cabinet. The first way is that the main control cabinet executes the target process. In order to respond to the target process, the second controller needs to calculate the check value for the current data in the target page of the expansion cabinet, and then send the check value to the expansion card so that the main control cabinet can obtain the fourth check value returned by the expansion card mentioned above. The second way is that when the second controller detects that the current data in the target page is updated, the updated current data in the target page of the expansion cabinet is calculated to check the value.
[0139] Through the above embodiment, the second controller can calculate a check value for the current data in the target page of the expansion cabinet according to different situations.
[0140] Optionally, in one embodiment, in order to reduce the amount of data transmission, when the second controller determines that the current data of the target page has changed, it may only transmit the changed data portion, and calculate the check value based on the changed data portion and the position of the changed data; when the PCIe link is stable, the changed data portion and the corresponding check value are automatically transmitted to the main control cabinet through the expansion card, without sending the entire current data of the target page to the main control cabinet; that is, the first data is determined based on the changed data portion.
[0141] After the main control cabinet receives the changed data part and the corresponding check value, it will calculate the check value based on the received changed data part, and compare the check value calculated by the main control cabinet with the check value returned by the expansion card. When the comparison result is consistent, the current data of the latest target page previously obtained by the main control cabinet is changed according to the changed data part to obtain the current data of the target page of the expansion cabinet.
[0142] As an example, suppose a target page inside the expansion cabinet stores data collected by sensors. The amount of data is large, but the data changes less frequently and may be updated only once in a while.
[0143] If the expansion cabinet sends the entire target page data to the main control cabinet every time the data is updated, this will result in a large amount of data transmission, wasting bandwidth and time. Therefore, the expansion cabinet only sends the changed data part, for example, only sends the updated temperature value, and calculates the check value based on the updated temperature value and the corresponding changed data position, and then sends the updated temperature value and the corresponding check value together to the main control cabinet. After the main control cabinet receives the updated temperature value and the corresponding check value, it will calculate the check value based on the received updated temperature value, and compare the check value calculated by the main control cabinet with the check value returned by the expansion card. When the comparison results are consistent, the current data of the latest target page previously obtained by the main control cabinet is changed according to the updated temperature value to obtain the current data of the target page of the expansion cabinet.
[0144] Through the above embodiments, under the premise of ensuring that no hot restart occurs, by only sending the changed data and the corresponding check value, the data transmission mechanism can be optimized to improve the efficiency, reliability and security of data transmission. This is especially effective for application scenarios with large data volume and low frequency of change, such as sensor data acquisition, industrial control, etc.
[0145] Figure 6 is a structural diagram of a data reading device provided by an embodiment of the present application, such as Figure 6 shown.
[0146] Based on the same inventive concept, another embodiment of the present application further provides a data reading device, which is applied to a first controller of a main control cabinet, wherein the main control cabinet is communicatively connected with an extension cabinet through an extension card, and the device includes:
[0147] A first data acquisition module 11 is used to execute a target process to acquire first data returned by the expansion card, wherein the target process is used to read current data in a target page of the expansion cabinet;
[0148] A first check value acquisition module 12, used to acquire a first check value corresponding to the current data;
[0149] A judging module 13, configured to calculate a second check value according to the first data, and to judge whether the first check value is equal to the second check value;
[0150] The determination module 14 is configured to determine that the first data is invalid data replied by the expansion card when the first verification value is not equal to the second verification value, and not parse the first data.
[0151] Optionally, the first controller includes a first main controller and a first standby controller, and the device further includes:
[0152] A counting module, configured to determine that the target program fails to execute after determining that the first data is invalid data replied by the expansion card, and count the number of times the target process fails to execute;
[0153] A controller switching module, configured to take over the first main controller through the first standby controller when the number of execution failures of the target process corresponding to the first main controller reaches a first preset threshold;
[0154] The first alarm information issuing module is used to determine that the first controller is not redundant and issue a first alarm information when the number of execution failures of the target process corresponding to the first standby controller reaches a second preset threshold.
[0155] Optionally, the device further comprises:
[0156] A third check value receiving module is used to receive, before the first check value corresponding to the current data is obtained, a third check value actively uploaded by the second controller of the expansion cabinet through the expansion card when the current data in the target page is updated, wherein the third check value is calculated by the second controller according to the current data after the target page is updated;
[0157] An active reading module, used for actively reading the verification value of the expansion cabinet during the execution of the target process, to obtain a fourth verification value returned by the expansion card;
[0158] The fourth verification value includes any one of the following:
[0159] Setting data answered by the expansion card in case the link between the main control cabinet and the expansion cabinet is unstable;
[0160] A fifth check value calculated by the second controller of the expansion cabinet according to the current data in the target page;
[0161] The first verification value acquisition module 12 includes:
[0162] A check value determination module, used to determine the check value associated with the target page obtained most recently through the expansion card as the first check value corresponding to the current data;
[0163] The check value associated with the target page includes the third check value and the fourth check value.
[0164] Optionally, the device further comprises:
[0165] A connection module, used for connecting the main control cabinet with the plurality of extension cabinets through the extension card before executing the target process, so that the main control cabinet is in communication connection with the extension cabinets;
[0166] The storage cluster establishment module is used to establish a storage cluster based on the main control cabinet and the plurality of expansion cabinets.
[0167] Optionally, the target process is any one of the following: a discovery process, a command issuing process, and a license information processing process, and the device further includes:
[0168] The target page determination module is used to determine the target page that needs to be read currently according to the type of the target process that needs to be executed currently.
[0169] Optionally, the target page determination module includes:
[0170] A first page determination unit, configured to determine, when the target process is a discovery process, that the target page currently required to be read is a first page;
[0171] A second page determination unit, configured to determine that the target page currently to be read is a second page when the target process is a command issuing process;
[0172] A third page determination unit, configured to determine that the target page currently required to be read is a third page when the target process is a license information processing process;
[0173] The device also includes:
[0174] A counting unit, used to count the number of execution failures of the discovery process, the command issuing process and the license information processing process respectively;
[0175] The alarm unit is used to determine that the first controller is not redundant and issue a second alarm message when the number of execution failures of any one of the discovery process, the command issuance process and the license information processing process reaches a third preset threshold.
[0176] Figure 7 is a schematic diagram of the structure of another data reading device provided by an embodiment of the present application. Figure 7 shown.
[0177] Based on the same inventive concept, another embodiment of the present application further provides a data reading device, which is applied to a second controller of an expansion cabinet, wherein the expansion cabinet is communicatively connected to a main control cabinet via an expansion card, and the device includes:
[0178] A check value calculation module 21, configured to calculate a first check value according to current data in the target page of the expansion cabinet;
[0179] A sending module 22 is used to send the first check value and the current data in the target page to the expansion card, so that the first controller of the main control cabinet calculates the second check value based on the first data after executing the target process and obtaining the first data returned by the expansion card, and determines whether the first check value and the second check value are equal, and when the first check value and the second check value are not equal, it is determined that the first data is invalid data answered by the expansion card, and the first data is not parsed; wherein the target process is used to read the current data in the target page of the expansion cabinet.
[0180] Optionally, the check value calculation module 21 includes:
[0181] A first calculation module, configured to calculate a check value according to current data in a target page of the expansion cabinet in response to a target process;
[0182] The second calculation module is used to calculate a check value according to the updated current data in the target page of the expansion cabinet when it is detected that the current data in the target page is updated.
[0183] Based on the same inventive concept, another embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the data reading method as described in any of the above embodiments.
[0184] Among them, electronic equipment refers to Figure 8 , Figure 8 is a schematic diagram of an electronic device provided by an embodiment of the present application. Figure 8 As shown, the electronic device 800 includes: a memory 810 and a processor 820. The memory 810 and the processor 820 are connected via a bus communication. A computer program is stored in the memory 810. The computer program can be run on the processor 820 to implement the steps in the data reading method disclosed in the above embodiment of the present application.
[0185] Based on the same inventive concept, another embodiment of the present application further provides a computer program product, including a computer program, which is executed by a processor to perform the data reading method described in any of the above embodiments.
[0186] Based on the same inventive concept, another embodiment of the present application further provides a computer-readable medium on which a computer program is stored, wherein when the program is executed by a processor, the data reading method as described in any of the above embodiments is implemented.
[0187] As for the device, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0188] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0189] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0190] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0191] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.
[0192] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0193] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0194] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0195] The above is a detailed introduction to a data reading method, device, equipment and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data reading method, characterized in that: A first controller applied to a main control cabinet, wherein the main control cabinet is communicatively connected with an extension cabinet via an extension card, and the method comprises: Execute a target process to obtain first data returned by the expansion card, wherein the target process is used to read current data in a target page of the expansion cabinet; Obtaining a first check value corresponding to the current data; Calculating a second check value according to the first data, and determining whether the first check value is equal to the second check value; When the first check value is not equal to the second check value, it is determined that the first data is invalid data replied by the expansion card, and the first data is not parsed.
2. The data reading method according to claim 1, characterized in that: The first controller includes a first main controller and a first standby controller, and the method further includes: After determining that the first data is invalid data replied by the expansion card, determining that the target program fails to execute, and counting the number of times the target process fails to execute; When the number of execution failures of the target process corresponding to the first main controller reaches a first preset threshold, taking over the first main controller through the first standby controller; When the number of execution failures of the target process corresponding to the first standby controller reaches a second preset threshold, it is determined that the first controller is not redundant, and a first alarm message is issued.
3. The data reading method according to claim 1, characterized in that: Before obtaining the first verification value corresponding to the current data, the method further includes: Receiving, by the second controller of the expansion cabinet, a third check value actively uploaded by the expansion card when the current data in the target page is updated, the third check value being calculated by the second controller according to the current data after the target page is updated; and / or, in the process of executing the target process, actively reading the verification value of the expansion cabinet to obtain a fourth verification value returned by the expansion card; The fourth verification value includes any one of the following: Setting data answered by the expansion card in case the link between the main control cabinet and the expansion cabinet is unstable; A fifth check value calculated by the second controller of the expansion cabinet according to the current data in the target page; The obtaining a first check value corresponding to the current data includes: Determine the check value associated with the target page obtained most recently through the expansion card as the first check value corresponding to the current data; The check value associated with the target page includes the third check value and the fourth check value.
4. The data reading method according to claim 1, characterized in that: Before executing the target process, the method further includes: The main control cabinet is connected to the plurality of extension cabinets through the extension card, so that the main control cabinet is in communication connection with the extension cabinets; A storage cluster is established based on the main control cabinet and the plurality of expansion cabinets.
5. The data reading method according to any one of claims 1 to 4, characterized in that: The target process is any one of the following: a discovery process, a command issuing process, and a license information processing process, and the method further includes: According to the type of the target process currently to be executed, the target page currently to be read is determined.
6. The data reading method according to claim 5, characterized in that: Determining the target page to be read currently according to the type of the target process to be executed currently includes: When the target process is a discovery process, determining that the target page currently required to be read is the first page; When the target process is a command issuing process, determining that the target page currently to be read is the second page; When the target process is a license information processing process, determining that the target page currently required to be read is the third page; The method further comprises: Counting the number of execution failures of the discovery process, the command issuing process, and the license information processing process respectively; When the number of execution failures of any one of the discovery process, the command issuance process, and the license information processing process reaches a third preset threshold, it is determined that the first controller is not redundant, and a first alarm message is issued.
7. A data reading method, characterized in that: A second controller applied to an expansion cabinet, wherein the expansion cabinet is communicatively connected to a main control cabinet via an expansion card, the method comprising: Calculating a first check value according to current data in the target page of the expansion cabinet; Sending the first check value and the current data in the target page to the expansion card, so that after the first controller of the main control cabinet executes the target process and obtains the first data returned by the expansion card, the second check value is calculated according to the first data, and it is determined whether the first check value is equal to the second check value, and when the first check value is not equal to the second check value, it is determined that the first data is invalid data replied by the expansion card, and the first data is not parsed; The target process is used to read current data in the target page of the expansion cabinet.
8. A data reading device, characterized in that: A first controller applied to a main control cabinet, wherein the main control cabinet is communicatively connected with an extension cabinet via an extension card, and the device comprises: A first data acquisition module, used to execute a target process to acquire first data returned by the expansion card, wherein the target process is used to read current data in a target page of the expansion cabinet; A first check value acquisition module, used to acquire a first check value corresponding to the current data; A judgment module, used to calculate a second check value according to the first data, and judge whether the first check value is equal to the second check value; The determination module is used to determine that the first data is invalid data replied by the expansion card when the first verification value is not equal to the second verification value, and not to parse the first data.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the data reading method according to any one of claims 1 to 5 or claim 6.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, wherein when the computer program is executed by a processor, the data reading method according to any one of claims 1 to 5 or claim 6 is implemented.
Citation Information
Patent Citations
Data transmission method, device and equipment for PCIe link
CN113489570A
Controller monitoring method and device, electronic equipment and storage medium
CN115454771A
Data processing method and device, equipment and medium
CN117093395A
Fractional redundant array of silicon independent elements
US20180143874A1
Device control method and system, electronic device, and storage medium
WO2022052407A1
