Data reading methods, devices, equipment and media
By calculating and comparing data verification values in the controller of the main control cabinet, the problem of invalid data caused by PCIe link instability is solved, thereby improving the stability and reliability of the storage system.
Patent Information
- Application Number
- CN202411186473.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2044-08-27
AI Technical Summary
In the event of an unstable PCIe link, the receiving end in the storage system may receive invalid data, leading to a hot restart of the node and affecting the stability of the storage system.
The controller in the main control cabinet obtains the data returned by the expansion card and calculates the check value. It then determines whether the check value is consistent. If they are inconsistent, the data is determined to be invalid and is not parsed to avoid hot restart.
It improves the operational stability of the storage system, avoids hot restarts caused by invalid data, and enhances the reliability and robustness of the system.
Smart Images

Figure CN119226195B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data reading method, apparatus, device, and medium. Background Technology
[0002] When the PCIe link between the receiver and sender of the storage system is unstable, the expansion card will substitute for the transmitted content. That is, when the link is unstable, the MRPC command sent to the PSX (PCIe switch module) will substitute for the data to be sent to the receiver by filling the corresponding page data with 0xFF, so that the receiver receives invalid data. When the receiver needs to read the data in the page, it will cause a hot restart of the node corresponding to the receiver in the storage after reading the invalid data value, thus affecting the stability of the storage operation. Summary of the Invention
[0003] In view of the above, embodiments of this application provide a data reading method, apparatus, device, and medium to overcome or at least partially solve the above problems.
[0004] A first aspect of this application provides a data reading method applied to a first controller of a main control cabinet, wherein the main control cabinet is communicatively connected to an expansion cabinet via an expansion card, the method comprising:
[0005] Execute the target process to obtain the first data returned by the expansion card. The target process is used to read the current data in the target page of the expansion cabinet.
[0006] Obtain the first verification value corresponding to the current data;
[0007] Calculate the second verification value based on the first data, and determine whether the first verification value and the second verification value are equal;
[0008] When the first check value and the second check value are not equal, the first data is determined to be invalid data from the expansion card and is not parsed.
[0009] Optionally, the first controller includes a first main controller and a first backup controller, and the method further includes:
[0010] After determining that the first data is invalid data from the expansion card, the target program is determined to have failed to execute, and the number of times the target process has failed to execute is counted.
[0011] When the number of times the target process corresponding to the first main controller fails to execute reaches a first preset threshold, the first backup controller takes over the first main controller.
[0012] When the number of times the target process corresponding to the first backup controller fails to execute reaches the 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 verification value corresponding to the current data, the method further includes:
[0014] The second controller of the expansion cabinet receives a third verification value actively uploaded by the expansion card when the current data on the target page is updated. The third verification value is calculated by the second controller based on the updated current data of the target page.
[0015] And / or, during the execution of the target process, the verification value of the expansion cabinet is actively read to obtain the fourth verification value returned by the expansion card;
[0016] The fourth check value includes any one of the following:
[0017] The expansion card receives the set data in case the link between the main control cabinet and the expansion cabinet is unstable.
[0018] The second controller of the expansion cabinet calculates the fifth verification value based on the current data in the target page;
[0019] The step of obtaining the first verification value corresponding to the current data includes:
[0020] The verification value associated with the target page most recently obtained through the expansion card is determined as the first verification value corresponding to the current data;
[0021] The verification values associated with the target page include the third verification value and the fourth verification value.
[0022] Optionally, before executing the target process, the following may also be included:
[0023] The main control cabinet is connected to multiple expansion cabinets via the expansion card, so that the main control cabinet and the expansion cabinets can communicate with each other.
[0024] A storage cluster is established based on the main control cabinet and multiple expansion cabinets.
[0025] Optionally, the target process is any one of the following: a discovery process, a command issuance process, and a license information processing process, and the method further includes:
[0026] Determine the target page to be read based on the type of the target process to be executed.
[0027] Optionally, determining the target page to be read based on the type of the target process to be executed includes:
[0028] When the target process is a discovery process, the target page to be read is determined to be the first page;
[0029] When the target process is a command issuance process, the target page to be read is determined to be the second page;
[0030] When the target process is a license information processing process, the target page to be read is determined to be the third page.
[0031] The method further includes:
[0032] The number of times the discovery process, the command issuance process, and the license information processing process failed to be counted respectively.
[0033] When the number of execution failures in any 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 this application provides a data reading method 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, the method comprising:
[0035] The first verification value is calculated based on the current data in the target page of the expansion cabinet;
[0036] The first verification value is sent 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, it calculates the second verification value based on the first data, and determines whether the first verification value and the second verification value are equal. If the first verification value and the second verification value are not equal, the first data is determined to be invalid data answered by the expansion card, and the first data is not parsed. The target process is used to read the current data in the target page of the expansion cabinet.
[0037] A third aspect of this application provides a data reading device applied to a first controller of a main control cabinet, wherein the main control cabinet is communicatively connected to an expansion cabinet via an expansion card, and the device includes:
[0038] The first data acquisition module is used to execute the target process and acquire the first data returned by the expansion card. The target process is used to read the current data in the target page of the expansion cabinet.
[0039] The first verification value acquisition module is used to acquire the first verification value corresponding to the current data;
[0040] The judgment module is used to calculate the second verification value based on the first data, and to determine whether the first verification value and the second verification value are equal;
[0041] The determination module is used to determine that the first data is invalid data sent by the expansion card when the first verification value and the second verification value are not equal, and not to parse the first data.
[0042] A fourth aspect of this application 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 the first or second aspect.
[0043] A fifth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data reading method as described in the first or second aspect.
[0044] The beneficial effects of this application are:
[0045] This application provides a data reading method, apparatus, device, and medium applied to a first controller of a main control cabinet. The main control cabinet is communicatively connected to an expansion cabinet via an expansion card. The method includes: executing a target process to obtain first data returned by the expansion card, the target process being used to read current data in a target page of the expansion cabinet; obtaining a first verification value corresponding to the current data; calculating a second verification value based on the first data, and determining whether the first verification value and the second verification value are equal; when the first verification value and the second verification value are not equal, determining that the first data is invalid data answered by the expansion card, and not parsing the first data.
[0046] The technical solution of this application allows the first controller in the main control cabinet to receive the first data and the first check value returned from the expansion card when executing the target process. It then calculates the second check value based on the first data, compares the first check value and the second check value, and considers the data transmission complete when they are equal. Otherwise, it considers the data transmission to be incorrect and the first data to be invalid. In this case, the first data is not parsed, thus avoiding a hot restart of the main control cabinet and improving the stability of the storage system operation. Attached Figure Description
[0047] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an undue limitation of this application.
[0048] To more clearly illustrate the technical solution of this application, the drawings used in the description of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 This is a schematic diagram of a data reading method provided in an embodiment of this application;
[0050] Figure 2 This is a schematic diagram of a storage system provided in a data reading method according to an embodiment of this application;
[0051] Figure 3 This is another flowchart of a data reading method provided in one embodiment of this application;
[0052] Figure 4 This is a schematic diagram of the data and check value transmission process in another data reading method provided in an embodiment of this application;
[0053] Figure 5 This is a schematic diagram of a data reading method according to another embodiment of this application;
[0054] Figure 6 This is a schematic diagram of the structure of a data reading device provided in one embodiment of this application;
[0055] Figure 7 This is a schematic diagram of the structure of another data reading device provided in an embodiment of this application;
[0056] Figure 8 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0057] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort 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-shared communication method: PCIe uses point-to-point communication, with each device acting as both receiver and transmitter, full-duplex, 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 receivers and transmitters is represented by a channel), increasing the number of channels to meet higher bandwidth requirements. A channel consists of two differential signal pairs, one pair for receiving data and the other for transmitting. Therefore, each channel consists of four lines or signal traces. Conceptually, each channel acts as a full-duplex byte stream, simultaneously transmitting 8-bit "byte" formatted data packets in both directions between the link endpoints. A physical PCI Express link may contain 1 to 32 channels, more precisely 1, 2, 4, 8, 12, 16, or 32 channels. Channel counts are prefixed with "×" (e.g., "×8" indicates an eight-channel card or slot), with ×16 being a commonly used maximum size.
[0060] In terms of storage, PCIe's main advantage lies in its ability to reduce latency. Specifically, PCIe boasts high speed and transfer rates, with a maximum data transfer rate of up to 264MB / s. This allows high-performance CPUs to fully utilize their capabilities and meets the needs of high-speed device data transfer. Simultaneously, PCIe's multi-bus coexistence and revolutionary storage architecture are also advantages, enabling high-speed transmission, expanded storage capacity, 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 enables the expansion and sharing of storage capacity 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 receiver and sender of the storage system is unstable, the expansion card will substitute for the transmitted content. That is, when the link is unstable, the MRPC command sent to the PSX (PCIe switch module) will substitute for the data to be sent to the receiver by filling the corresponding page data with 0xFF, so that the receiver receives invalid data. When the receiver needs to read the data in the page, it will cause a hot restart of the node corresponding to the receiver in the storage after reading the invalid data value, thus affecting the stability of the storage system.
[0063] Therefore, based on the technical problem mentioned above where reading abnormal data leads to hot restarts of nodes in the storage, resulting in decreased storage stability, this application proposes a data reading method, apparatus, device, and medium.
[0064] Figure 1 This is a schematic diagram of a data reading method provided in an embodiment of this application, as shown below. Figure 1 As shown, one embodiment of this application provides a data reading method applied to a first controller of a main control cabinet, wherein the main control cabinet is communicatively connected to an expansion cabinet via an expansion card. The method includes the following steps:
[0065] Step S101: Execute the target process to obtain the first data returned by the expansion card. The target process is used to read the current data in the target page of the expansion cabinet.
[0066] Step S102: Obtain the first verification value corresponding to the current data;
[0067] Step S103: Calculate the second verification value based on the first data, and determine whether the first verification value and the second verification value are equal;
[0068] Step S104: When the first verification value and the second verification value are not equal, the first data is determined to be invalid data from the expansion card and no parsing is performed on the first data.
[0069] Figure 2 This is a schematic diagram of a storage system provided in a data reading method according to an embodiment of this application, as shown below. 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 via expansion cards (e.g., NVME switch cards). This connection method allows the storage system to be expanded and managed more flexibly.
[0070] Figure 3 This is another flowchart of a data reading method provided in one embodiment of this application, such as... Figure 3 As shown.
[0071] First, in step S101, the first controller is the controller on the main control cabinet, 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 executing the target process. The target process refers to a predefined program used to acquire the data read from the target page of the expansion cabinet. The expansion card will act as a bridge between the expansion cabinet and the main control cabinet, returning the current data from 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. The target page is a specific display area for the data of the internal storage software and hardware of the expansion cabinet. Different target processes correspond to acquiring data from 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 it may not be the same as the current data on the target page of the expansion cabinet. The current data on the target page of the expansion cabinet is valid data, while the first data may not be valid data.
[0073] Furthermore, in step S102, the first controller further acquires the 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 changes as the current data of the target page changes.
[0074] Furthermore, 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 using the CRC check algorithm. The first check value and the second check value are then compared to determine if the comparison results are consistent. If the first check value and the second check value are equal, it means that both the first check value and the second check value were calculated for the same data. Therefore, the first data obtained by the main control cabinet is the same as the current data on the target page of the expansion cabinet. During data transmission, there was no link instability causing the expansion card to substitute for the current data on the target page of the expansion cabinet.
[0075] The checksum can be calculated using other checksum algorithms, each with different checksum capabilities and computational complexities. Choosing the appropriate algorithm requires considering factors such as the sensitivity of the data, the size of the data set, and computational capabilities.
[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. In this case, the first data is invalid data answered 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 will not parse the first data to avoid hot restart of the main control cabinet, thereby improving the stability of the storage system operation.
[0077] Through the above embodiments, 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 child for the first data, compares the first check value and the second check value, and considers the data transmission complete when they are equal; otherwise, it is considered that the data transmission is incorrect and the first data is invalid. 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 This is a schematic diagram illustrating the data and checksum transmission process in another data reading method provided in an embodiment of this application, as shown below. Figure 4 As shown.
[0079] Optionally, the first controller includes a first main controller and a first backup controller, and the method further includes:
[0080] After determining that the first data is invalid data from the expansion card, the target program is determined to have failed to execute, and the number of times the target process has failed to execute is counted.
[0081] When the number of times the target process corresponding to the first main controller fails to execute reaches a first preset threshold, the first backup controller takes over the first main controller.
[0082] When the number of times the target process corresponding to the first backup controller fails to execute reaches the 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 a first main controller and a first backup controller, so that when the main controller fails, the backup controller can take over the work and ensure the normal operation of the storage system.
[0084] After the first controller obtains the first data from the expansion card, if the first checksum and the second checksum do not match, the obtained first data is determined to be invalid, indicating an error occurred during data transmission. At this point, both the first primary controller and the first backup controller record the number of times the target process failed to execute. When the number of failed executions of the target process corresponding to the first primary controller reaches a first preset threshold, it indicates that the primary controller may have malfunctioned. In this case, the first backup controller takes over the operation of the first primary controller. When the number of failed executions of the target process corresponding to the first backup controller reaches a second preset threshold, it indicates that the backup controller may also have malfunctioned. In this case, it is determined that the entire first controller has malfunctioned, redundancy is no longer possible, and a corresponding first alarm message is issued to notify the storage system administrator to intervene.
[0085] The first and second preset thresholds need to be set according to the actual situation, such as the execution frequency of the target process and the system's tolerance for data latency.
[0086] Through the above embodiments, the controller redundancy mechanism can improve the reliability of the storage system. Even if the primary controller fails, the backup controller can take over, ensuring continued system operation. The redundancy mechanism reduces the impact of a single controller failure on the storage system, preventing system downtime or data loss. Furthermore, by promptly detecting and handling controller failures, the stability of the storage system can be improved, avoiding unforeseen failures. This ensures that the storage system can continue to operate normally even if one controller fails.
[0087] Optionally, before obtaining the first verification value corresponding to the current data, the method further includes:
[0088] The second controller of the expansion cabinet receives a third verification value actively uploaded by the expansion card when the current data on the target page is updated. The third verification value is calculated by the second controller based on the updated current data of the target page.
[0089] And / or, during the execution of the target process, the verification value of the expansion cabinet is actively read to obtain the fourth verification value returned by the expansion card;
[0090] The fourth check value includes any one of the following:
[0091] The expansion card receives the set data in case the link between the main control cabinet and the expansion cabinet is unstable.
[0092] The second controller of the expansion cabinet calculates the fifth verification value based on the current data in the target page;
[0093] The step of obtaining the first verification value corresponding to the current data includes:
[0094] The verification value associated with the target page most recently obtained through the expansion card is determined as the first verification value corresponding to the current data;
[0095] The verification values associated with the target page include the third verification value and the fourth verification value.
[0096] Specifically, in one embodiment, the process for determining the first check value is as follows.
[0097] First, before obtaining the first checksum corresponding to the current data, the second controller (i.e., PSX) of the expansion cabinet 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 checksum for the updated current data of the target page and send the checksum corresponding to the updated current data to the main control cabinet through the expansion card. Since the transmission of the checksum may be abnormal due to link instability, the checksum returned by the expansion card to the main control cabinet will ultimately be the third checksum. At this time, the third checksum may not be equal to the checksum 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, it will receive the fourth verification value returned by the expansion card. Similarly, the verification value sent by the expansion cabinet to the main control cabinet in response to the target process may also be answered by the expansion card due to link instability. Therefore, the fourth verification value received by the main control cabinet may not be equal to the verification value sent by the expansion cabinet to the main control cabinet.
[0099] There are two possible values for the fourth checksum. When the link is stable, the fourth checksum is equal to the fifth checksum 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 checksum is the set data for the expansion card to be used between the main control cabinet and the expansion cabinet, such as 0xFF.
[0100] In this situation, the main control cabinet will actually receive multiple verification values and obtain multiple verification values. Therefore, for different target processes, multiple verification values associated with the target page need to be read (i.e., including the third verification value and the fourth verification value). Before comparing the first verification value and the second verification value, the first verification value needs to be determined from the multiple verification values. The determination of the first verification value is to determine the verification value associated with the target page most recently obtained 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 second controller of the expansion cabinet calculates a checksum of 0x1234.
[0102] Due to the instability of the PCIe link between the main control cabinet and the expansion cabinet, the third check value actually received by the main control cabinet is 0xFF (i.e., the data sent by the expansion card).
[0103] At this point, 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 check value as 0x1234 (data transmitted normally). When there is no PCIe link instability, the check value actually received by the main control cabinet is the fourth check 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 and compared with the second check value to determine whether the data received by the main control cabinet is invalid data sent 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 embodiments, utilizing multiple checksums can improve the accuracy of error detection during data transmission, ensuring accurate data validity even with unstable links. Even if previously acquired checksums fail due to link issues, the storage system can still verify the data using the most recently received checksum, improving system robustness. Furthermore, since link instability can lead to data being substituted, selecting the most recently received checksum reduces the false positive rate for invalid data, preventing storage system errors caused by incorrect checksums. When invalid data is identified, it is not parsed, and a hot restart of the main control cabinet is unnecessary, ensuring the stability of the storage system.
[0106] Optionally, before executing the target process, the following may also be included:
[0107] The main control cabinet is connected to multiple expansion cabinets via the expansion card, so that the main control cabinet and the expansion cabinets can communicate with each other.
[0108] A storage cluster is established based on the main control cabinet and multiple expansion cabinets.
[0109] Specifically, in one embodiment, two key steps are required before executing the target process.
[0110] First, the main control cabinet establishes communication connections with multiple expansion cabinets through expansion cards, ensuring that the main control cabinet can exchange data with each expansion cabinet.
[0111] Furthermore, based on the established communication connections between the main control cabinet and multiple expansion cabinets, a storage cluster is constructed. The storage cluster integrates the storage space of multiple expansion cabinets into a unified storage system, providing a foundation for subsequent execution of the target process.
[0112] By integrating the storage space of the main control cabinet and multiple expansion cabinets through the above embodiments, the overall data storage capacity of the storage system can be greatly improved. The storage cluster can provide data redundancy and fault tolerance mechanisms; even if one expansion cabinet fails, other expansion cabinets can still provide data access, ensuring data availability. The storage cluster can distribute data across multiple expansion cabinets and perform load balancing, improving data access speed. Furthermore, the management of multiple expansion cabinets can be unified through the storage cluster, simplifying management operations and reducing management costs.
[0113] Optionally, the target process is any one of the following: a discovery process, a command issuance process, and a license information processing process, and the method further includes:
[0114] Determine the target page to be read based on the type of the target process to be executed.
[0115] Optionally, determining the target page to be read based on the type of the target process to be executed includes:
[0116] When the target process is a discovery process, the target page to be read is determined to be the first page;
[0117] When the target process is a command issuance process, the target page to be read is determined to be the second page;
[0118] When the target process is a license information processing process, the target page to be read is determined to be the third page.
[0119] The method further includes:
[0120] The number of times the discovery process, the command issuance process, and the license information processing process failed to be counted respectively.
[0121] When the number of execution failures in any 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 can be 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 the data required by the corresponding target process.
[0123] When the target process is a discovery process, the target page to be read is determined to be the first page. When the target process is a command issuance process, the target page to be read is determined to be the second page. When the target process is a license information processing process, the target page to be read is determined to be the third page.
[0124] The discovery process requires reading the target page to obtain information such as the hardware and software versions of the expansion cabinet. The first page corresponding to the discovery process includes the contents of page1, page2, page7, page26, and paged0-paged4.
[0125] For the command issuance 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 issuance 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 legality. The corresponding third page is: paged4.
[0127] When executing the target process, the number of failures for each type of process is recorded and monitored. Therefore, it is necessary to count the number of failures for the discovery process, command issuance process, and license information processing process respectively. The third preset threshold is a pre-set limit on the number of failures for a single type of target process. The value of the third preset threshold is different for different target processes. When the number of failures for any 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 the corresponding second alarm message is issued to notify the system administrator to check the redundancy configuration of the controller to ensure the stability and reliability of the system.
[0128] During this process, the main control cabinet needs to access different pages and calculate different verification values when executing different target processes. The corresponding failure counts and alarm actions are also different.
[0129] This effectively reduces the execution of irrelevant processes, such as those that do not involve data reading or will not encounter unstable links during execution. It also avoids situations where this solution is triggered and consumes important computing resources of the relevant controllers. Furthermore, binding the target page to the target process type avoids operations on other irrelevant page objects, thereby improving execution efficiency. Technical personnel can accurately locate the relevant pages where data acquisition failed based on alarms and the type of process being executed, and can then quickly perform failure handling actions such as data re-acquisition on these target pages.
[0130] By determining the target page based on the target process type through the above embodiments, unnecessary information reading can be avoided, thus improving efficiency. Reading a specific target page ensures that the information read is required by the target process, reducing the possibility of errors. Binding the target page to the target process type simplifies the operation process, makes it more convenient for users, improves efficiency, reduces errors, simplifies operations, and provides necessary data support for the subsequent execution of the target process.
[0131] Based on the same inventive concept, another embodiment of this application also provides a data reading method. Figure 5 This is a schematic diagram of a data reading method according to another embodiment of this application, as shown below. Figure 5 As shown, a second controller is applied to an expansion cabinet, which is communicatively connected to the main control cabinet via an expansion card. The method includes the following steps:
[0132] Step S201: Calculate the first verification value based on the current data in the target page of the expansion cabinet;
[0133] Step S202: The first verification value and the current data in the target page are sent 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, it calculates the second verification value based on the first data, and determines whether the first verification value and the second verification value are equal. When the first verification value and the second verification value are not equal, the first data is determined to be invalid data answered by the expansion card, and the first data is not parsed. The target process is used to read the current data in the target page of the expansion cabinet.
[0134] Specifically, in one embodiment, the expansion cabinet is equipped with a second controller, such as a PSX. The second controller can calculate a checksum based on the current data in the target page of the expansion cabinet, and send the calculated checksum and the corresponding current data in the target page to the expansion card. The expansion card then transmits the checksum to the main control cabinet. The checksum allows the main control cabinet to verify whether the received current data is complete and correct, avoiding potential data loss, corruption, or tampering during data transmission. If the checksum does not match, it indicates an error has occurred during data transmission, and the main control cabinet can take corresponding measures, such as re-acquiring the data.
[0135] Optionally, step S201 includes:
[0136] In response to the target process, the verification value is calculated based on the current data in the target page of the expansion cabinet;
[0137] And / or, when an update to the current data in the target page is detected, a verification value is calculated based on the updated current data in the target page of the expansion cabinet.
[0138] Specifically, such as Figure 4 In one embodiment, there are two ways to trigger the second controller to calculate the checksum 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, and the second controller, in response to the target process, needs to calculate the checksum for the current data in the target page of the expansion cabinet. Afterward, it sends the checksum to the expansion card so that the main control cabinet receives the fourth checksum returned by the expansion card as mentioned above. The second way is that when the second controller detects an update to the current data in the target page, it calculates the checksum for the updated current data in the target page of the expansion cabinet.
[0139] Through the above embodiments, the second controller can calculate the verification value for the current data on the target page of the expansion cabinet according to different situations.
[0140] Optionally, in one embodiment, in order to reduce the amount of data transmitted, when the second controller determines that the current data of the target page has changed, it can transmit only the changed data part and calculate the check value based on the changed data part and the location of the changed data. When the PCIe link is stable, the changed data part and the corresponding check value are automatically transmitted to the main control cabinet through the expansion card, without having to send the entire current data of the target page to the main control cabinet. In other words, the first data is determined based on the changed data part.
[0141] After receiving the changed data and the corresponding checksum, the main control cabinet calculates the checksum based on the received changed data and compares the checksum calculated by the main control cabinet with the checksum returned by the expansion card. When the comparison results are consistent, the main control cabinet then modifies the latest target page data obtained by the main control cabinet according to the changed data 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. This data volume is large, but the data changes infrequently, perhaps only once every so often.
[0143] If the expansion cabinet were to send the entire target page data to the main control cabinet every time data was updated, it would result in a large amount of data transmission, wasting bandwidth and time. Therefore, the expansion cabinet only sends the changed data portion, such as the updated temperature value, and calculates a checksum based on the updated temperature value and the corresponding location of the changed data. Then, it sends the updated temperature value and the corresponding checksum together to the main control cabinet. Upon receiving the updated temperature value and the corresponding checksum, the main control cabinet calculates its own checksum and compares it with the checksum returned by the expansion card. If the comparison results match, the main control cabinet then updates the latest target page data it previously obtained according to the updated temperature value, thus obtaining the current data for the expansion cabinet's target page.
[0144] The above embodiments enable the optimization of data transmission mechanisms by sending only changed data and corresponding checksums, thereby improving data transmission efficiency, reliability, and security, while ensuring that hot restarts do not occur. This is particularly effective for applications with large data volumes and low change frequencies, such as sensor data acquisition and industrial control.
[0145] Figure 6 This is a schematic diagram of the structure of a data reading device provided in an embodiment of this application, as shown below. Figure 6 As shown.
[0146] Based on the same inventive concept, another embodiment of this application also provides a data reading device, applied to a first controller of a main control cabinet, wherein the main control cabinet is communicatively connected to an expansion cabinet via an expansion card, and the device includes:
[0147] The first data acquisition module 11 is used to execute the target process and acquire the first data returned by the expansion card. The target process is used to read the current data in the target page of the expansion cabinet.
[0148] The first verification value acquisition module 12 is used to acquire the first verification value corresponding to the current data;
[0149] The judgment module 13 is used to calculate the second verification value based on the first data, and to determine whether the first verification value and the second verification value are equal;
[0150] The determination module 14 is used to determine that the first data is invalid data sent by the expansion card when the first verification value and the second verification value are not equal, and not to parse the first data.
[0151] Optionally, the first controller includes a first main controller and a first backup controller, and the device further includes:
[0152] The counting module is used to determine that the target program has failed to execute after determining that the first data is invalid data answered by the expansion card, and to count the number of times the target process has failed to execute.
[0153] The controller switching module is used to take over the first main controller through the first backup controller when the number of times the target process corresponding to the first main controller fails to execute reaches a first preset threshold.
[0154] The first alarm information issuing module is used to determine that the first controller is not redundant and to issue a first alarm information when the number of times the target process corresponding to the first backup controller fails to execute reaches a second preset threshold.
[0155] Optionally, the device further includes:
[0156] The third verification value receiving module is used to receive, before obtaining the first verification value corresponding to the current data, the third verification 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; the third verification value is calculated by the second controller based on the updated current data of the target page.
[0157] The active reading module is used to actively read the verification value of the expansion cabinet during the execution of the target process, and obtain the fourth verification value returned by the expansion card.
[0158] The fourth check value includes any one of the following:
[0159] The expansion card receives the set data in case the link between the main control cabinet and the expansion cabinet is unstable.
[0160] The second controller of the expansion cabinet calculates the fifth verification value based on the current data in the target page;
[0161] The first verification value acquisition module 12 includes:
[0162] The verification value determination module is used to determine the verification value associated with the target page most recently obtained through the expansion card as the first verification value corresponding to the current data;
[0163] The verification values associated with the target page include the third verification value and the fourth verification value.
[0164] Optionally, the device further includes:
[0165] A connection module is used to connect the main control cabinet to multiple expansion cabinets via the expansion card before the execution of the target process, so that the main control cabinet and the expansion cabinets can communicate with each other.
[0166] A storage cluster establishment module is used to establish a storage cluster based on the main control cabinet and multiple expansion cabinets.
[0167] Optionally, the target process is any one of the following: a discovery process, a command issuance process, and a license information processing process, and the apparatus further includes:
[0168] The target page determination module is used to determine the target page to be read based on the type of the target process to be executed.
[0169] Optionally, the target page determination module includes:
[0170] The first page determination unit is used to determine the target page to be read as the first page when the target process is a discovery process;
[0171] The second page determination unit is used to determine the target page to be read as the second page when the target process is a command issuance process;
[0172] The third page determination unit is used to determine the target page to be read as the third page when the target process is a license information processing process;
[0173] The device further includes:
[0174] The counting unit is used to count the number of times the discovery process, the command issuance process, and the license information processing process fail to execute.
[0175] The alarm unit is used to determine that the first controller is not redundant and to 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 This is a schematic diagram of another data reading device provided in an embodiment of this application, as shown below. Figure 7 As shown.
[0177] Based on the same inventive concept, another embodiment of this application also provides a data reading device applied to a second controller of an expansion cabinet, the expansion cabinet being communicatively connected to the main control cabinet via an expansion card, the device comprising:
[0178] Verification value calculation module 21 is used to calculate the first verification value based on the current data in the target page of the expansion cabinet;
[0179] The sending module 22 is used to send the first verification 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, it calculates the second verification value based on the first data, and determines whether the first verification value and the second verification value are equal. When the first verification value and the second verification value are not equal, it determines that the first data is invalid data answered by the expansion card and does not parse the first data. 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] The first calculation module is used to respond to the target process and calculate the verification value based on the current data in the target page of the expansion cabinet;
[0182] The second calculation module is used to calculate the verification value based on the updated current data in the target page of the expansion cabinet when an update is detected in the current data in the target page.
[0183] Based on the same inventive concept, another embodiment of this application also 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 devices refer to Figure 8 , Figure 8 This is a schematic diagram of an electronic device provided in an embodiment of this 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 for communication. The memory 810 stores a computer program that can run on the processor 820 to implement the steps in the data reading method disclosed in the above embodiments of this application.
[0185] Based on the same inventive concept, another embodiment of this application also provides a computer program product, including a computer program that is executed by a processor using the data reading method as described in any of the above embodiments.
[0186] Based on the same inventive concept, another embodiment of this application provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the data reading method as described in any of the above embodiments.
[0187] As the apparatus is basically similar to the method embodiment, it is described in a relatively simple way. For relevant details, please refer to the description of the method embodiment.
[0188] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0189] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products 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] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0191] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The 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 equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0193] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0194] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes the element.
[0195] The above provides a detailed description of a data reading method, apparatus, device, and medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A data reading method characterized by, The first controller is applied to a master control cabinet, the master control cabinet is in communication connection with an extension cabinet through an extension card, and the method comprises the following steps: A target process is executed to obtain first data returned by the extension card, the target process is used for reading current data in a target page of the extension cabinet; A first check value corresponding to the current data is obtained; A second check value is calculated according to the first data, and it is judged 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, it is determined that the first data is invalid data answered by the extension card, and the first data is not parsed; 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 comprises the following steps: According to the type of the target process currently required to be executed, a target page currently required to be read is determined, including: when the target process is the discovery process, it is determined that the target page currently required to be read is a first page; when the target process is the command issuing process, it is determined that the target page currently required to be read is a second page; and when the target process is the license information processing process, it is determined that the target page currently required to be read is a third page; The method further comprises the following steps: The number of execution failures of the discovery process, the command issuing process and the license information processing process is counted respectively; When the number of execution failures of any one of the discovery process, the command issuing process and the license information processing process reaches a third preset threshold value, it is determined that the first controller is not redundant, and a first alarm information is issued.
2. The data reading method according to claim 1, wherein, The first controller comprises a first master controller and a first backup controller, and the method further comprises the following steps: After it is determined that the first data is invalid data answered by the extension card, it is determined that the target process fails to execute, and the number of execution failures of the target process is counted; When the number of execution failures of the target process corresponding to the first master controller reaches a first preset threshold value, the first master controller is taken over by the first backup controller; When the number of execution failures of the target process corresponding to the first backup controller reaches a second preset threshold value, it is determined that the first controller is not redundant, and a first alarm information is issued.
3. The data reading method according to claim 1, wherein, Before the first check value corresponding to the current data is obtained, the method further comprises the following steps: A second controller of the extension cabinet receives a third check value actively uploaded by the extension card when the current data in the target page is updated, the third check value is 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, the extension cabinet is actively read for a check value to obtain a fourth check value returned by the extension card; The fourth check value comprises any one of the following: Set data answered by the extension card in the case that a link between the master control cabinet and the extension cabinet is unstable; A fifth check value calculated by the second controller of the extension cabinet according to the current data in the target page; The acquiring the first check value corresponding to the current data comprises: determining, as the first check value corresponding to the current data, a check value associated with the target page obtained last time through the expansion card; The check value associated with the target page comprises the third check value and the fourth check value.
4. The data reading method according to claim 1, characterized by, Before the executing the target process, the method further comprises: connecting, through the expansion card, the main control cabinet with a plurality of the expansion cabinets, so that the main control cabinet is in communication connection with the expansion cabinets; establishing a storage cluster based on the main control cabinet and the plurality of the expansion cabinets.
5. A data reading method characterized by, A second controller applied to an expansion cabinet, the expansion cabinet being in communication connection with a main control cabinet through an expansion card, the method comprising: calculating a first check value according to current data in a 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 a first controller of the main control cabinet executes a target process and obtains first data returned by the expansion card, the first controller calculates a second check value according to the first data, and judges 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; The target process is used to read current data in a target page of the expansion cabinet. 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 comprises: determining a target page to be read currently according to a type of the target process to be executed currently, comprising: when the target process is the discovery process, determining that the target page to be read currently is a first page; when the target process is the command issuing process, determining that the target page to be read currently is a second page; and when the target process is the license information processing process, determining that the target page to be read currently is a third page. The method further comprises: counting a number of times of failure of execution of the discovery process, the command issuing process, and the license information processing process, respectively; when the number of times of failure of execution of any one of the discovery process, the command issuing process, and the license information processing process reaches a third preset threshold value, determining that the first controller is not redundant, and issuing a first alarm information.
6. A data reading device, characterized by A first controller applied to a main control cabinet, the main control cabinet being in communication connection with an expansion cabinet through an expansion card, the device comprising: a first data acquisition module, configured to execute a target process and acquire first data returned by the expansion card, the target process being used to read current data in a target page of the expansion cabinet; a first check value acquisition module, configured to acquire a first check value corresponding to the current data; a judging module, configured to calculate a second check value according to the first data, and judge whether the first check value and the second check value are equal. The determining module is configured to determine that the first data is invalid data of the extended card answer when the first check value and the second check value are not equal, and not to parse the first data. The target process is any one of a discovery process, a command issuing process, and a license information processing process, and the apparatus further comprises: A target page determining module is configured to determine a target page to be read currently according to a type of a target process to be executed currently. The target page determining module comprises: A first page determining unit is configured to determine that the target page to be read currently is a first page when the target process is the discovery process; a second page determining unit is configured to determine that the target page to be read currently is a second page when the target process is the command issuing process; and a third page determining unit is configured to determine that the target page to be read currently is a third page when the target process is the license information processing process. The apparatus further comprises: A counting unit is configured to count a number of execution failures of the discovery process, the command issuing process, and the license information processing process respectively; An alarm unit is configured to determine that the first controller is not redundant when the number of execution failures of any one of the discovery process, the command issuing process, and the license information processing process reaches a third preset threshold, and to issue a second alarm information.
7. An electronic device, comprising: A computer program product comprising a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the data reading method according to any one of claims 1-4 or 5.
8. A computer-readable storage medium, characterized in that, A computer program product comprising a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the data reading method according to any one of claims 1-4 or 5.
Citation Information
Patent Citations
Data processing method and device, equipment and medium
CN117093395A