Information Transmission Method, Apparatus, System, Electronic Device, and Storage Medium
By using I2C links between the master and slave control systems for out-of-band communication, the interactive instructions are split into multiple data packets, which solves the problem of the master and slave system communication relying on complex configurations, realizes efficient and reliable information transmission, and improves the universality of the system.
Patent Information
- Application Number
- CN202211371979.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-03
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-11-03
AI Technical Summary
In the prior art, in-band communication between the master control system and the slave control system depends on complex hardware differential configurations, resulting in poor versatility and difficult to achieve efficient information transmission.
The I2C link is used for out-of-band communication, and the reliable information transmission of the master and slave system is realized by splitting a single interactive instruction into multiple I2C packets and sending and receiving them in multiple time periods. Combined with the I2C timing, the reliable information transmission of the master and slave system is realized.
It realizes simple and reliable information transmission between master and slave systems without relying on complex configurations, improving the universality and communication efficiency between different models.
Smart Images

Figure CN115733806B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the technical field of data processing. Specifically, the present application relates to a method, apparatus, system, electronic device, and storage medium for information transmission. Background Art
[0002] Currently, many devices are configured with a main control system and one or more slave control systems. The main control system is used to control the device as a whole, and the slave control system is used to execute the control process of specific tasks.
[0003] Exemplarily, taking the chassis management module in a storage system as an example, the main control system is, for example, a CPU, and the slave control systems are, for example, BMC or SES programs, etc. The BMC or SES program mainly collects data on the status of the chassis and reports it to the CPU, and the CPU performs data warning and processing. Information transmission between the main and slave control systems is based on in-band SAS communication.
[0004] However, due to differences in the hardware of the control chips used in the slave control systems, the SAS topologies, SAS addresses, SAS PHY numbers, etc. of each slave control system will also be different. Therefore, complex link configurations are required between the main control system and different slave control systems to achieve in-band communication, that is, in-band communication between the main control system and the slave control system depends on hardware differences and complex configurations, and the universality between different models is poor.
[0005] How to achieve information transmission between the main control system and the slave control system without relying on complex high configurations is an urgent problem to be solved. Summary of the Invention
[0006] Embodiments of the present application provide a method, apparatus, system, electronic device, and storage medium for information transmission, aiming to provide a method for achieving information transmission between the main control system and the slave control system without relying on complex high configurations.
[0007] In a first aspect, embodiments of the present application provide an information transmission method, which is applied to a first system. The first system communicates with a second system through an I2C link. The method includes:
[0008] After the I2C driver is loaded, split a single interaction instruction into multiple I2C data packets according to the duration of a single I2C data transmission time period;
[0009] Send the multiple I2C data packets to the second system in multiple I2C data transmission time periods, where in each I2C data transmission time period, the first system sends one I2C data packet;
[0010] Receive the execution status of the interaction instruction returned multiple times by the second system during the multiple I2C data transmission time periods. The second system returns the execution status of the interaction instruction once during each I2C data transmission time period.
[0011] Optionally, the single interaction instruction is a query instruction and / or a control instruction, and the execution status of the interaction instruction is in progress or completed.
[0012] Optionally, when the single interaction instruction is a query instruction, the method further includes:
[0013] When receiving the execution status of the interaction instruction indicating completion, within a single I2C data transmission time period, send an I2C query result acquisition data packet to the second system;
[0014] Receive the query result returned by the second system within the single I2C data transmission time period.
[0015] Optionally, splitting a single interaction instruction into multiple I2C data packets includes:
[0016] Split a single interaction instruction into: an I2C request data packet and multiple I2C status query data packets. The I2C request data packet includes the content of the single interaction instruction, and the I2C status query data packet is used to query the execution status of the single interaction instruction.
[0017] Optionally, before each sending of a single interaction instruction, it further includes:
[0018] Within a single I2C data transmission time period, send a clear instruction to the second system. The clear instruction indicates that the previous interaction instruction has been sent and another new interaction instruction will be sent;
[0019] Receive the response result returned by the second system within the single I2C data transmission time period. The response result indicates that the second system is ready to receive a new interaction instruction.
[0020] Optionally, when the second system is connected to the chassis, it further includes:
[0021] Within a single I2C data transmission time period, send a chassis status query instruction to the second system;
[0022] Receive the chassis status query result returned by the second system within the single I2C data transmission time period;
[0023] Power down the first system itself according to the chassis status query result.
[0024] Optionally, when the second system is connected to the chassis, it further includes:
[0025] Receive the chassis status query results returned by the second system multiple times during the multiple I2C data transmission time periods. The second system returns a chassis status query result once during each I2C data transmission time period, and the chassis status query result is returned together with the execution status of the interaction instruction.
[0026] In a second aspect, an embodiment of the present application provides an information transmission method, which is applied to a second system. The second system communicates with a first system through an I2C link. The method includes:
[0027] When the I2C driver is loaded, receive multiple I2C data packets sent by the first system in multiple I2C data transmission time periods. Among them, the first system sends one I2C data packet during each I2C data transmission time period, and the multiple I2C data packets form a single interaction instruction.
[0028] Execute the single interaction instruction, and return the interaction instruction execution status to the first system multiple times during the multiple I2C data transmission time periods. The second system returns the interaction instruction execution status once during each I2C data transmission time period.
[0029] Optionally, executing the single interaction instruction includes:
[0030] When an error occurs in receiving any one of the I2C data packets, return an error code indicating the reception error to the first system;
[0031] Whenever an I2C data packet is successfully received, check the I2C data packet;
[0032] When an error occurs in checking an I2C data packet, return an error code indicating the check error to the first system;
[0033] When an I2C data packet is successfully checked, parse the I2C data packet and process the task obtained by parsing when the I2C data packet is successfully checked.
[0034] Optionally, when the single interaction instruction is a query instruction, it further includes:
[0035] After generating an interaction instruction execution status indicating the query is completed, receive an I2C query result acquisition data packet sent by the first system during a single I2C data transmission time period;
[0036] During the single I2C data transmission time period, return the query result to the first system.
[0037] Optionally, it further includes:
[0038] Receive the clear instruction sent by the first system within a single I2C data transmission period, where the clear instruction indicates that the previous interaction instruction has been sent and a new interaction instruction will be sent;
[0039] Return a response result to the first system within the single I2C data transmission period, where the response result indicates that the second system is ready to receive a new interaction instruction.
[0040] Optionally, the second system is connected to a chassis, and further includes:
[0041] Receive the chassis status query instruction sent by the first system within a single I2C data transmission period;
[0042] Within the single I2C data transmission period, return the chassis status query result to the second system.
[0043] Optionally, the second system is connected to a chassis, and further includes:
[0044] During the execution of the single interaction instruction, generate the in-progress interaction instruction execution status multiple times;
[0045] When the single interaction instruction is executed, generate an interaction instruction execution status indicating completion once;
[0046] Return the chassis status query result to the first system in multiple times within the multiple I2C data transmission periods. The second system returns the chassis status query result once within each I2C data transmission period, and the chassis status query result is returned together with the interaction instruction execution status.
[0047] In a third aspect, an embodiment of the present application provides an information transmission device, which is applied to a first system. The first system communicates with a second system through an I2C link, and the device includes:
[0048] An interaction instruction splitting module, configured to split a single interaction instruction into multiple I2C data packets according to the duration of a single I2C data transmission period when the I2C driver is loaded;
[0049] A first sending module, configured to send the multiple I2C data packets to the second system in multiple I2C data transmission periods, where the first system sends one I2C data packet within each I2C data transmission period;
[0050] A first receiving module, configured to receive the interaction instruction execution status returned by the second system multiple times within the multiple I2C data transmission periods, and the second system returns the interaction instruction execution status once within each I2C data transmission period.
[0051] In a fourth aspect, an embodiment of the present application provides an information transmission device, which is applied to a second system. The second system communicates with a first system through an I2C link. The device includes:
[0052] A second receiving module, configured to receive a plurality of I2C data packets sent by the first system in a plurality of I2C data transmission time periods when the I2C driver is loaded. In each I2C data transmission time period, the first system sends one I2C data packet, and the plurality of I2C data packets form a single interaction instruction.
[0053] A second sending module, configured to execute the single interaction instruction and return the execution status of the interaction instruction to the first system multiple times in the plurality of I2C data transmission time periods. In each I2C data transmission time period, the second system returns the execution status of the interaction instruction once.
[0054] In a fifth aspect, an embodiment of the present application provides an information transmission system, including: a first system and a second system. The first system communicates with the second system through an I2C link, where:
[0055] The first system is configured to execute the information transmission method described in the first aspect of the embodiment.
[0056] The second system is configured to execute the information transmission method described in the second aspect of the embodiment.
[0057] In a sixth aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the information transmission method described in the first aspect of the embodiment, or the processor executes the computer program to implement the information transmission method described in the second aspect of the embodiment.
[0058] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, it implements the information transmission method described in the first aspect of the embodiment, or when the computer program / instruction is executed by a processor, it implements the information transmission method described in the second aspect of the embodiment.
[0059] Beneficial effects:
[0060] The first system communicates with the second system via an I2C link. When the I2C driver is loaded, according to the duration of a single I2C data transmission period, the first system splits a single interaction instruction into multiple I2C data packets and sends the multiple I2C data packets to the second system within multiple I2C data transmission periods; the second system receives the multiple I2C data packets of a single interaction instruction sent by the first system and returns the execution status of the interaction instruction to the first system in multiple times within multiple I2C data transmission periods. Specifically, the second system can return the execution status of the interaction instruction once within each I2C data transmission period.
[0061] As a general communication channel, the I2C link only needs to load the I2C driver to perform reliable information transmission, has a low dependence on hardware, and has high generality among different models. Therefore, this method uses the general I2C link as a carrier, combines the I2C timing, splits a single interaction instruction into multiple I2C data packets and sends them sequentially. During the execution of a single interaction instruction by the second system, the execution status of the interaction instruction will also be timely returned to the first system, enabling the first system to know the execution status and progress of the single interaction instruction by the second system. Thus, without relying on complex high configurations, simple and reliable out-of-band communication between the first system and the second system is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0063] Figure 1 is a flowchart of the steps of an information transmission method proposed in an embodiment of the present application;
[0064] Figure 2 is a flowchart of the steps of an information transmission method proposed in an embodiment of the present application;
[0065] Figure 3 is a functional module diagram of an information transmission device provided in an embodiment of the present application;
[0066] Figure 4 is a functional module diagram of an information transmission device proposed in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0067] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts belong to the scope of protection of the present application.
[0068] In some devices that require high-speed transmission of information data, in-band communication is generally used between the main control system and the slave control system. In-band communication can transmit a large amount of data at a high speed, but the communication link used in in-band communication usually requires complex link configuration. For example, based on the SAS communication method, for different models of hardware chips, there are also differences in SAS topology, SAS address, SAS PHY number, etc. Therefore, the in-band communication between the main control system and different slave control systems has poor generality.
[0069] For some information data with low requirements for transmission rate and small quantity, other out-of-band communications with better generality and simplicity can be tried for transmission, which can not only reduce the transmission pressure of in-band communication, but also facilitate the main control system to obtain information data in different slave control systems. Therefore, this embodiment provides an information transmission method, which can provide a simple and reliable out-of-band communication method for systems that does not rely on complex high configurations.
[0070] Refer to Figure 1 , which shows a step flow chart of an information transmission method in the embodiments of the present application. The method is applied to the first system, and the first system communicates with the second system through an I2C link. The method may specifically include the following steps:
[0071] S101: When the I2C driver is loaded, split a single interaction instruction into multiple I2C data packets according to the duration of a single I2C data transmission time period.
[0072] Since the I2C link is a general communication channel, reliable information transmission can be achieved only by loading the I2C driver, and the dependence on hardware is low. Therefore, this method is based on the I2C link for out-of-band communication.
[0073] The first system acts as the role of the host or master device Master in I2C communication, and the second system acts as the role of the slave or slave device Slave in I2C communication. That is, a single interaction instruction is sent from the first system to the second system, and the second system makes a response or executes after receiving the single interaction instruction. The single interaction instruction is a query instruction and / or a control instruction.
[0074] Generally, in an I2C timing sequence, the master device can send commands and also receive the acknowledgment signals sent by the slave device. However, there is still a problem in actual implementation: if the first system sends a single interaction command in a single I2C timing sequence, but since the second system takes a relatively long time to process the single interaction command, and the processing time may exceed the duration of a single I2C timing sequence, the second system cannot respond to the single interaction command in a single I2C timing sequence, resulting in the inability of the first system and the second system to complete the interaction of the single interaction command.
[0075] To solve this problem, in this embodiment, the first system splits the single interaction command into multiple I2C data packets and sends them to the second system respectively.
[0076] S102: Send the multiple I2C data packets to the second system in multiple I2C data transmission time periods, where the first system sends one I2C data packet in each I2C data transmission time period.
[0077] After the first system divides the single interaction command into multiple I2C data packets, it can send one I2C data packet to the second system in each I2C data transmission time period.
[0078] In a feasible implementation manner, the single interaction command can be split into: an I2C request data packet and multiple I2C status query data packets. The I2C request data packet includes the content of the single interaction command, that is, the first system informs the second system through the I2C request data packet that the single interaction command is a query command for any content or a control command for executing a certain task; the I2C status query data packet is used to query the execution status of the single interaction command.
[0079] Exemplarily, the first system can, in an I2C data transmission time period, first send the I2C request data packet to the second system to inform the second system of the data to be queried this time or the task to be controlled for the second system to execute. After receiving the I2C request data packet, the second system immediately starts to obtain data or execute the task; in the next I2C data transmission time period, the first system sends an I2C status query data packet to inquire about the execution status of the single interaction command by the second system; since the processing duration of the single interaction command by the second system is uncertain, the first system can continuously send multiple I2C status query data packets to query the processing progress.
[0080] S103: Receive the execution status of the interaction command returned multiple times by the second system in the multiple I2C data transmission time periods, and the second system returns the execution status of the interaction command once in each I2C data transmission time period. [[ID=(19)]]
[0081] Since an acknowledgement signal sent from a slave device to the master device must accompany an I2C timing, in the I2C timing when the first system sends an I2C status query data packet each time, the second system can return the execution status of the interaction instruction to the first system in this I2C timing, so as to inform the first system of the execution progress of the single interaction instruction currently.
[0082] Specifically, the execution status of the interaction instruction can be in progress or completed. In actual implementation, when the first system receives the execution status of the interaction instruction as completed, it stops sending the I2C status query data packet to the second system.
[0083] If the single interaction instruction is a control instruction, when the received execution status of the interaction instruction is completed, it means that the second system has completed the execution of the content of the control instruction, then the first system and the second system have completed the interaction process of this control instruction.
[0084] If the single interaction instruction is a query instruction, when the received execution status of the interaction instruction is completed, it means that the second system has completed the acquisition of relevant data according to the content to be queried. However, at this time, the first system only knows that the second system has generated the query result, but the first system has not received the query result yet.
[0085] Therefore, in a feasible implementation manner, in the case where the single interaction instruction is a query instruction, when the first system receives the execution status of the interaction instruction indicating completion, within a single I2C data transmission time period, it sends an I2C query result acquisition data packet to the second system; and receives the query result returned by the second system within the single I2C data transmission time period; when the first system receives the query result, the first system and the second system have completed the interaction process of this query instruction.
[0086] In the actual application process, there will be multiple single interaction instructions on the out-of-band I2C communication link from time to time, and since each single interaction instruction has multiple I2C data packets, in order to avoid confusion, different single interaction instructions need to be executed serially one by one.
[0087] In an implementation manner, in order to avoid mutual influence between different single interaction instructions, before sending each single interaction instruction, the first system can also send a clear instruction to the second system within a single I2C data transmission time period. The clear instruction indicates that the previous interaction instruction has been sent and another new interaction instruction will be sent; after receiving the clear instruction, the second system returns a response result within a single I2C data transmission time period, and the response result indicates that the second system is ready to receive the new interaction instruction.
[0088] Since the clear instruction essentially only includes the content of the notification and does not require the second system to perform specific tasks, in specific implementation, the clear instruction can be not split into multiple data packets, that is, the first system can send the clear instruction and receive its response result in a single I2C timing.
[0089] In another implementation, to avoid mutual influence between different single interaction instructions, when dividing each single interaction instruction, the first I2C data packet can also be set as the I2C clear data packet, and then the first system sequentially sends I2C request data packets and multiple I2C status query data packets.
[0090] This method uses a general I2C link as the out-of-band communication channel. Only by loading the I2C driver can reliable information transmission be carried out, and it has a low dependence on hardware and high generality between different models. To use the I2C timing to realize the interaction between the first system and the second system, a single interaction instruction is divided into multiple I2C data packets and sent sequentially. During the execution of a single interaction instruction by the second system, the execution status of the interaction instruction will also be returned to the first system in a timely manner, enabling the first system to know the execution status and progress of the second system for this single interaction instruction, thus realizing simple and reliable out-of-band communication between the first system and the second system without relying on complex high-configurations.
[0091] Refer to Figure 2 , which shows the step flowchart of another information transmission method provided by the embodiment of the present application. The information transmission method is applied to the second system, and the second system communicates with the first system through an I2C link. The method specifically includes the following steps:
[0092] S201: In the case where the I2C driver is loaded, receive multiple I2C data packets sent by the first system in multiple I2C data transmission time periods. Among them, the first system sends one I2C data packet in each I2C data transmission time period, and the multiple I2C data packets form a single interaction instruction.
[0093] Referring to steps S101 - S102, the first system divides a single interaction instruction into multiple I2C data packets and sends one I2C data packet to the second system in each I2C data transmission time period. Specifically, a single interaction instruction can be divided into: an I2C request data packet representing the content and multiple I2C status query data packets for querying the execution status of the interaction instruction.
[0094] S202: Execute the single interaction instruction and return the execution status of the interaction instruction to the first system multiple times in the multiple I2C data transmission time periods. The second system returns the execution status of the interaction instruction once in each I2C data transmission time period.
[0095] The second system to execute a single interaction instruction specifically includes the following steps:
[0096] B1: When any I2C data packet is received in error, return an error code indicating the reception error to the first system.
[0097] Exemplarily, after the first system sends an I2C data packet in a single I2C timing, when the I2C driver on the second system side receives the data in error, directly return the corresponding error code in this I2C timing; after the first system receives the returned error code, it can resend this I2C data packet, thereby preventing the second system from not receiving any I2C data packet.
[0098] B2: Whenever an I2C data packet is received successfully, verify the I2C data packet.
[0099] When the I2C driver on the second system side receives the data successfully, it is necessary to verify the successfully received I2C data packet, specifically to check the validity of the I2C data packet.
[0100] B3: When the verification of an I2C data packet fails, return an error code indicating the verification error to the first system.
[0101] Since the general verification time is relatively short, if the verification of the I2C data packet fails, the second system can return an error code indicating the verification error in the single I2C timing when the first system sends the I2C data packet.
[0102] Of course, if the verification time exceeds the duration of this I2C timing, it is also possible to return an error code indicating the verification error to the first system in the next I2C timing.
[0103] B4: When the verification of an I2C data packet is successful, parse the I2C data packet and process the task obtained by parsing.
[0104] When the verification of the I2C data packet is successful, that is, parse the I2C data packet, obtain the content of the I2C data packet and execute it. In each I2C timing where the I2C data packet is located, the second system returns the execution status of the interaction instruction to the first system.
[0105] Exemplarily, after the second system receives and successfully parses the I2C request data packet representing the content, it can send the execution status of the ongoing interaction instruction to the first system within a single I2C data transfer time period where the I2C request data packet is located, that is, within the I2C timing where the I2C request data packet is located; for any I2C status query data packet received and successfully parsed by the second system, if the second system has completed the execution of the content in the I2C request data packet, it sends the execution status of the interaction instruction representing completion to the first system in the I2C timing where the I2C status query data packet is located.
[0106] For control instructions, when the execution status of the interaction instruction sent by the second system is completion, it indicates that the first system and the second system have completed the interaction process of this control instruction.
[0107] However, in the case where a single interaction instruction is a query instruction, when the execution status of the interaction instruction sent by the second system is completion, the first system will send an I2C query result acquisition data packet in order to receive the query result; after the second system successfully receives and parses the I2C query result acquisition data packet, it returns the query result to the first system in the I2C timing where the I2C query result acquisition data packet is located. Thus, the first system and the second system complete the interaction process of this query instruction.
[0108] In one implementation, in order to avoid mutual influence between different single interaction instructions, the first system can send a clear instruction to the second system before sending each single interaction instruction, or the first I2C data packet in each single interaction instruction is an I2C clear data packet, so as to inform the second system that the previous interaction instruction has ended. After receiving the clear instruction or the I2C clear data packet, the second system is ready to receive a new interaction instruction.
[0109] In a feasible implementation, taking the storage system as an example, an application example of the information transmission method provided in this embodiment is given.
[0110] There is a chassis management module in the storage system, which is used to detect the operation status of the device in real time, including temperature, voltage, fan, etc.; in order to ensure that the device can run stably and reliably for a long time, it is necessary to detect the information of the peripheral hardware of the device in real time.
[0111] If a serious fault occurs in the chassis, it is necessary to perform a power-down control on the main control system CPU. However, considering that serious fault signals are relatively few, the information transmission method provided in this embodiment can be used to implement the power-down control task of the main control system CPU.
[0112] Specifically, the main control system CPU is the first system in the embodiments of this application, and the BMC or SES program is the second system in the embodiments of this application. The second system is connected to the chassis and is used to obtain various operating data of the chassis and generate severe fault information indicating whether the chassis has a fault.
[0113] The first system uses the I2C link to interact with the second system. The interaction instructions can include a chassis status query instruction and a single interaction instruction. Among them, the single interaction instruction includes a query instruction and / or a control instruction.
[0114] Specifically, the chassis status query instruction is used to detect the critical information or SuperStatus information of the chassis in real time. The SuperStatus information is an important basis for judging whether the chassis has a fault and whether to perform control actions such as powering off the large system. Therefore, the second system obtains and updates the SuperStatus information in real time and waits at any time for the query or retrieval by the first system.
[0115] Therefore, after the first system sends a chassis status query instruction to the second system, the second system can immediately return the chassis status query result to the first system within a single I2C timing, that is, return the SuperStatus information to the first system. Therefore, the chassis status query instruction can be regarded as a single data packet without being divided into multiple data packets.
[0116] The query instruction is mainly used to read the VPD information. The VPD information is important information stored in the EEPROM. The VPD information includes chassis information, PHY link configuration, serial number, and SAS address, etc., and is used for the first system to identify the chassis and start information related to storage services; the control instruction uses the out-of-band control method provided by the I2C link. For example, it performs VPD writing, lighting control, and reset control, etc.
[0117] For the query instruction and the control instruction, considering the processing duration of the second system and the duration of the I2C timing, the query instruction and the control instruction are divided into multiple I2C data packets; for example, the format of each I2C data packet can be defined to include at least the following elements:
[0118] 1) Start of Frame (SOF);
[0119] 2) Packet Length;
[0120] 3) Checksum, which is used to calculate whether the data in this packet is valid;
[0121] 4) Packet type: packet_type, which is used to characterize the type of data packet. For example, it indicates whether the data packet is an I2C request data packet, an I2C status query data packet, or an I2C query result acquisition data packet;
[0122] 5) Packet number: packet_id, which is included for each data packet to facilitate maintaining the continuity of data packets during multi-packet transmission;
[0123] 6) Data within the packet: packet_data, which includes specific read and write instructions, that is, the specific content of the data packet;
[0124] 7) End of Frame (EOF).
[0125] In one implementation, the I2C request data packet of a single interaction instruction can be denoted as packet_request, which represents the sent request instruction. Specifically, it can be a query-type request instruction or a control command request instruction.
[0126] Considering that the SuperStatus information is the most important information for judging whether a chassis fails, the I2C status query data packet of a single interaction instruction is denoted as: packet_SuperStatus. That is, every time the first system asks about the execution status of the interaction instruction of the second system, it also obtains the SuperStatus information. At this time, the information returned by the second system to the first system not only includes the execution status of the interaction instruction, but also returns the latest SuperStatus information. For example, the information returned by the second system for the I2C status query data packet can be marked as: SuperStatus+IN_PROGRESS, indicating that the execution status of the interaction instruction is in progress; SuperStatus+COMPLETE, indicating that the execution status of the interaction instruction is completed. Furthermore, the first system can frequently obtain the SuperStatus information to make the following electrical responses in time for serious failures.
[0127] The I2C query result acquisition data packet in the query-type instruction can be denoted as: packet_Result, which is used to return the query result after the second system finishes the query. The second system returns the query result for the I2C query result acquisition data packet. Taking the query-type instruction as an example, the interaction process between the first system and the second system for a single interaction instruction is as follows:
[0128] 1) The first system first sends an I2C clear data packet packet_clear in an I2C timing sequence, which represents the start of the interaction process of a new interaction instruction; the response returned by the second system to the I2C clear data packet within this I2C timing sequence is SuperStatus;
[0129] 2) The first system sends an I2C request data packet packet_request in the new I2C timing sequence to send a specific cmd instruction; the response returned by the second system within this I2C timing sequence is SuperStatus + IN_PROGRESS, that is, it returns both the execution status of the interaction instruction and the SuperStatus information at the same time; IN_PROGRESS indicates that the second system is currently executing the cmd instruction.
[0130] 3) The first system sends an I2C status query data packet packet_SuperStatus in the new I2C timing sequence to query the execution status of the second system for the cmd instruction; the response returned by the second system within this I2C timing sequence is the SuperStatus + IN_PROGRESS flag, indicating that the second system has not finished executing the cmd instruction yet.
[0131] 4) The first system sends the I2C status query data packet packet_SuperStatus again in the new I2C timing sequence; if the second system has finished executing the cmd instruction, the response returned by the second system within this I2C timing sequence is SuperStatus + COMPLETE.
[0132] 5) The first system sends an I2C query result acquisition data packet packet_result in the new I2C timing sequence; the response returned by the second system within this I2C timing sequence is the query result obtained after executing the cmd instruction.
[0133] For control type instructions, the interaction process between the first system and the second system is the same as steps 1) to 4) of the interaction process of query type instructions, and it is not necessary to execute the query result acquisition in step 5).
[0134] packet_SuperStatus can not only be used as the I2C status query data packet in a single interaction instruction, but also be used alone as the chassis status query instruction. For example, the interaction process between the first system and the second system for the chassis status query instruction is as follows:
[0135] 1) The second system obtains the SuperStatus information in real time.
[0136] 2) The first system sends the chassis status query instruction packet_SuperStatus in an I2C timing sequence; the response returned by the second system within this I2C timing sequence is SuperStatus.
[0137] During the process of instruction interaction, if the second system receives an error in the data packet during any I2C timing, it returns an error code indicating the reception error to the first system; or when the reception is successful but the verification is incorrect, it returns an error code indicating the verification error to the first system. After receiving the error code indicating the reception error or the error code indicating the verification error, the first system can resend the data packet in the next I2C timing.
[0138] When a serious fault occurs in the chassis, the first system powers itself down according to the received SuperStatus information, and can also set a timer (timer) after the second system starts. Each time it receives the I2C timing of the first system, the timing is cleared and starts again. When the timing exceeds the preset time, it indicates that the first system has completed the power-down task.
[0139] In summary, in the information transmission method provided in this embodiment, the I2C link is used as a general communication channel. Only by loading the I2C driver can reliable information transmission be carried out, and the dependence on hardware is low, and the generality between different models is relatively high. Furthermore, this method uses the general I2C link as a carrier, combines the I2C timing, and divides a single interaction instruction into multiple I2C data packets and sends them sequentially. During the process of the second system executing a single interaction instruction, it will also timely return the execution status of the interaction instruction to the first system, enabling the first system to know the execution status and progress of the second system for this single interaction instruction. Thus, without relying on complex high configurations, simple and reliable out-of-band communication between the first system and the second system is achieved.
[0140] Refer to Figure 3 , which shows the functional module diagram of an information transmission device in an embodiment of the present application. An information transmission device is applied to the first system, and the first system communicates with the second system through the I2C link. The device includes:
[0141] The interaction instruction splitting module 101 is used to split a single interaction instruction into multiple I2C data packets according to the duration of a single I2C data transmission time period when the I2C driver is loaded.
[0142] The first sending module 102 is used to send the multiple I2C data packets to the second system in multiple I2C data transmission time periods, where in each I2C data transmission time period, the first system sends one I2C data packet.
[0143] The first receiving module 103 is used to receive the execution status of the interaction instruction returned by the second system multiple times in the multiple I2C data transmission time periods, and the second system returns the execution status of the interaction instruction once in each I2C data transmission time period.
[0144] Reference Figure 4 , a functional module diagram of an information transmission device in an embodiment of the present application is shown. An information transmission device is applied to a second system, and the second system communicates with a first system through an I2C link. The device includes:
[0145] A second receiving module 201, configured to receive a plurality of I2C data packets sent by the first system in multiple I2C data transmission time periods when the I2C driver is loaded. Wherein, in each I2C data transmission time period, the first system sends one I2C data packet, and the plurality of I2C data packets form a single interaction instruction;
[0146] A second sending module 202, configured to execute the single interaction instruction and return the interaction instruction execution status to the first system multiple times in the multiple I2C data transmission time periods. In each I2C data transmission time period, the second system returns the interaction instruction execution status once.
[0147] An embodiment of the present application further provides an information transmission system, which includes: a first system and a second system. The first system communicates with the second system through an I2C link, wherein:
[0148] The first system is configured to execute the information transmission method applied to the first system provided in the embodiment;
[0149] The second system is configured to execute the information transmission method applied to the second system provided in the embodiment.
[0150] An embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the information transmission method applied to the first system provided in the embodiment, or the processor executes the computer program to implement the information transmission method applied to the second system provided in the embodiment.
[0151] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program / instructions are stored. When the computer program / instructions are executed by a processor, the information transmission method applied to the first system provided in the embodiment is implemented, or when the computer program / instructions are executed by a processor, the information transmission method applied to the second system provided in the embodiment is implemented.
[0152] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other.
[0153] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, apparatuses, or computer program products. Therefore, the embodiments of the present application can take the form of all-hardware embodiments, all-software embodiments, or embodiments combining software and hardware aspects. Moreover, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.
[0154] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate a device for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0155] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0156] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, such that a series of operation steps are executed on the computer or other programmable terminal device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0157] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0158] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the said element.
[0159] Specific examples are used in this text to elaborate on the principles and implementation manners 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 those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. An information transmission method, characterized in that, Applied to the first system, the first system communicates with the second system via an I2C link, and the second system is connected to the chassis. Among them, the first system acts as the host or master device (Master) in I2C communication. The method includes: When the I2C driver is loaded, split a single interaction instruction into multiple I2C data packets according to the duration of a single I2C data transmission period; Send the multiple I2C data packets to the second system in multiple I2C data transmission periods, where the first system sends one I2C data packet in each I2C data transmission period; Receive the execution status of the interaction instruction returned by the second system multiple times during the multiple I2C data transmission periods, and the second system returns the execution status of the interaction instruction once in each I2C data transmission period; During a single I2C data transmission period, send a chassis status query instruction to the second system; Receive the chassis status query result returned by the second system during the single I2C data transmission period; Power down the first system itself according to the chassis status query result.
2. The method according to claim 1, wherein The single interaction instruction is a query instruction and / or a control instruction, and the execution status of the interaction instruction is in progress or completed.
3. The method according to claim 2, characterized in that, When the single interaction instruction is a query instruction, the method further includes: When receiving the execution status of the interaction instruction indicating completion, send an I2C query result acquisition data packet to the second system during a single I2C data transmission period; Receive the query result returned by the second system during the single I2C data transmission period.
4. The method according to claim 1, wherein Splitting a single interaction instruction into multiple I2C data packets includes: Split a single interaction instruction into: an I2C request data packet and multiple I2C status query data packets. The I2C request data packet includes the content of the single interaction instruction, and the I2C status query data packet is used to query the execution status of the single interaction instruction.
5. The method according to claim 1, wherein Before each sending of a single interaction instruction, it further includes: During a single I2C data transmission period, send a clear instruction to the second system. The clear instruction indicates that the previous interaction instruction has been sent and a new interaction instruction will be sent; Receive the response result returned by the second system during the single I2C data transmission period. The response result indicates that the second system is ready to receive a new interaction instruction.
6. The method according to claim 1, wherein The second system is connected to the chassis, and it further includes: Receive the chassis status query results returned by the second system multiple times during the multiple I2C data transmission periods. The second system returns a chassis status query result once in each I2C data transmission period, and the chassis status query result is returned together with the execution status of the interaction instruction.
7. An information transmission method, characterized in that Applied to the second system, the second system communicates with the first system via an I2C link, and the second system is connected to the chassis. Among them, the first system acts as the host or master device (Master) in I2C communication. The method includes: When the I2C driver is loaded, receive multiple I2C data packets sent by the first system in multiple I2C data transfer time periods. In each I2C data transfer time period, the first system sends one I2C data packet, and the multiple I2C data packets form a single interaction instruction. Execute the single interaction instruction, and return the interaction instruction execution status to the first system multiple times in the multiple I2C data transfer time periods. In each I2C data transfer time period, the second system returns the interaction instruction execution status once. Receive the chassis status query instruction sent by the first system in a single I2C data transfer time period. In the single I2C data transfer time period, return the chassis status query result to the first system.
8. The method according to claim 7, wherein Executing the single interaction instruction includes: When an error occurs in receiving any I2C data packet, return an error code indicating the reception error to the first system. Whenever an I2C data packet is successfully received, perform a check on the I2C data packet. When an error occurs in checking an I2C data packet, return an error code indicating the check error to the first system. When an I2C data packet is successfully checked, parse the I2C data packet and process the task obtained from the parsing.
9. The method according to claim 7, characterized in that, When the single interaction instruction is a query instruction, it further includes: After generating an interaction instruction execution status indicating the completion of the query once, receive the I2C query result acquisition data packet sent by the first system in a single I2C data transfer time period. In the single I2C data transfer time period, return the query result to the first system.
10. The method according to claim 7, characterized in that, It further includes: Receive the clear instruction sent by the first system in a single I2C data transfer time period. The clear instruction indicates that the previous interaction instruction has been sent and another new interaction instruction will be sent. In the single I2C data transfer time period, return a response result to the first system. The response result indicates that the second system is ready to receive a new interaction instruction.
11. The method according to claim 7, wherein The second system is connected to the chassis, and it further includes: During the execution of the single interaction instruction, generate the in-progress interaction instruction execution status multiple times. When the single interaction instruction is executed, generate an interaction instruction execution status indicating completion once. Return the chassis status query result to the first system multiple times in the multiple I2C data transfer time periods. In each I2C data transfer time period, the second system returns the chassis status query result once. The chassis status query result is returned together with the interaction instruction execution status.
12. An information transmission device, characterized in that, Applied to the first system, the first system communicates with the second system through an I2C link, and the second system is connected to the chassis. Among them, the first system acts as the host or master device (Master) in I2C communication. The device includes: An interaction instruction splitting module, configured to split a single interaction instruction into multiple I2C data packets according to the duration of a single I2C data transfer time period when the I2C driver is loaded. A first sending module, configured to send the plurality of I2C data packets to the second system in multiple I2C data transmission time periods, wherein, in each I2C data transmission time period, the first system sends one I2C data packet; A first receiving module, configured to receive the execution status of the interaction instruction returned by the second system multiple times in the multiple I2C data transmission time periods, wherein, in each I2C data transmission time period, the second system returns the execution status of the interaction instruction once; In a single I2C data transmission time period, send a chassis status query instruction to the second system; Receive the chassis status query result returned by the second system in the single I2C data transmission time period; Power down the first system itself according to the chassis status query result.
13. An information transmission device, characterized in that, Applied to the second system, the second system communicates with the first system through an I2C link, the second system is connected to the chassis, wherein the first system acts as a host or a master device (Master) in I2C communication, and the device includes: A second receiving module, configured to receive the plurality of I2C data packets sent by the first system in multiple I2C data transmission time periods when the I2C driver is loaded, wherein, in each I2C data transmission time period, the first system sends one I2C data packet, and the plurality of I2C data packets form a single interaction instruction; A second sending module, configured to execute the single interaction instruction and return the execution status of the interaction instruction to the first system multiple times in the multiple I2C data transmission time periods, wherein, in each I2C data transmission time period, the second system returns the execution status of the interaction instruction once; Receive the chassis status query instruction sent by the first system in a single I2C data transmission time period; In the single I2C data transmission time period, return the chassis status query result to the second system.
14. An information transmission system, characterized in that, Comprising: A first system and a second system, the first system communicates with the second system through an I2C link, wherein: The first system is configured to execute the information transmission method according to any one of claims 1-6; The second system is configured to execute the information transmission method according to any one of claims 7-11.
15. An electronic device, comprising a memory, a processor, and a computer program stored on the memory, characterized in that, The processor executes the computer program to implement the information transmission method according to any one of claims 1-6, or the processor executes the computer program to implement the information transmission method according to any one of claims 7-11.
16. A computer-readable storage medium having computer programs / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, the information transmission method according to any one of claims 1-6 is implemented, or when the computer program / instructions are executed by the processor, the information transmission method according to any one of claims 7-11 is implemented.
Citation Information
Patent Citations
Simulated I2C slave machine and implementation method thereof, terminal equipment and storage medium
CN111078606A