Peripheral device interaction method, peripheral device, main controller and storage medium

By reading the shared memory information and reporting it to the main controller after the bus driver layer of the peripheral device is initialized, the problem of the main controller being unable to perceive the status of the peripheral device in a timely manner is solved, and the interaction efficiency and accuracy are improved.

CN114691406BActive Publication Date: 2025-09-05FIBOCOM WIRELESS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210320666.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-29
Publication Date
2025-09-05
Estimated Expiration
2042-03-29

AI Technical Summary

Technical Problem

The main controller cannot sense the status of the peripheral device for a period of time after it is powered on, resulting in a long period of inability to exchange commands with the peripheral device.

Method used

After the bus driver layer of the peripheral device is initialized, it generates reporting information by reading the operating information in the shared memory and reports it to the main controller, including status information, exception information, etc., so that the main controller can timely understand the initialization progress and status of the peripheral device.

Benefits of technology

This avoids the problem that the main controller cannot perceive the status of the peripheral device before the application layer initialization is completed, improves the interaction stability and efficiency, reduces system resource usage, and reduces the probability of misjudging peripheral device abnormalities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114691406B_ABST
    Figure CN114691406B_ABST
Patent Text Reader

Abstract

The present application relates to a peripheral device interaction method, a peripheral device, a main controller, and a storage medium. In the peripheral device interaction method, when the bus driver layer of the peripheral device is initialized, the bus driver layer reads the operation information of the peripheral device from the shared memory of the peripheral device, generates reporting information based on the operation information, and reports the reporting information to the main controller. Since the initialization of the bus driver layer of the peripheral device precedes the completion of the initialization of the application layer of the peripheral device, the reporting information of the peripheral device is determined and sent by the bus driver layer of the peripheral device, which can avoid the problem that the peripheral device does not respond to the request instruction of the main controller until the initialization of its application layer is completed, resulting in the main controller being unable to perceive the status of the peripheral device for a long time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of peripheral devices, and in particular to a peripheral device interaction method, a peripheral device, a main controller, and a storage medium. Background Art

[0002] Peripheral devices are auxiliary or supplementary devices connected to the main controller. They are typically connected to the main controller via a simple physical bus (such as UART, SPI, USB, etc.). The main controller communicates with the peripheral devices through a set of instructions. Generally speaking, if the physical bus connection is normal, the main controller blindly sends request commands to the peripheral device until it receives a response from the peripheral device. This determines that the peripheral device initialization is complete and the system is operating normally. The main controller software then communicates with the peripheral device through commands.

[0003] However, the current peripheral devices will not respond to the request instructions of the main controller until some time after being powered on. During this time, the main controller does not receive any information about the peripheral devices, resulting in the main controller being unable to perceive the status of the peripheral devices for a long time. Summary of the Invention

[0004] Based on this, it is necessary to provide a peripheral device interaction method, peripheral device, main controller and storage medium that can avoid the problem that the main controller cannot perceive the status of the peripheral device for a long time to address the above technical problems.

[0005] In a first aspect, a method for interacting with a peripheral device is provided, wherein the peripheral device is used to be connected to a main controller via a bus, and the method comprises: when the bus driver layer of the peripheral device is initialized, the bus driver layer reads the operating information of the peripheral device from the shared memory of the peripheral device; the operating information includes information written into the shared memory by each system layer of the peripheral device during initialization; the bus driver layer generates reporting information based on the operating information, and reports the reporting information to the main controller.

[0006] In one embodiment, the reported information includes status information, and the status information is used to represent the initialization degree of the peripheral device.

[0007] In one embodiment, the reported information includes first status information, second status information and target time, the first status information is used to represent the system layer in the peripheral device that has completed initialization, and the second status information is used to represent the system layer in the peripheral device that is being initialized; the target time is the time required for the system layer in the peripheral device that is being initialized to complete initialization.

[0008] In one embodiment, the operation information includes initialization information in each memory area corresponding to each system layer in the shared memory, and each system layer is used to update the initialization information in the corresponding memory area. The initialization information includes first initialization information and second initialization information, the first initialization information is used to indicate that the system layer is being initialized, and the second initialization information is used to indicate that the system layer has completed initialization;

[0009] The bus driver layer generates reporting information according to the operation information, including: the bus driver layer generates status information according to the initialization information of each memory area.

[0010] In one embodiment, each system layer is further configured to perform a dog feeding operation according to a corresponding preset time, and the operation information includes dog feeding parameters corresponding to each system layer in a shared memory, the dog feeding parameters being used to indicate whether the corresponding system layer has performed the dog feeding operation, and the reported information includes exception information;

[0011] The bus driver layer generates reporting information based on the operation information, including: the bus driver layer determines whether the corresponding system layer performs the dog feeding operation at the preset time based on the dog feeding parameters; if not, the bus driver layer generates the abnormal information, and the abnormal information is used to indicate that an abnormality occurs in the system layer corresponding to the dog feeding parameters.

[0012] In one embodiment, the bus driver layer generates reporting information based on the operation information and reports the reporting information to the main controller, including: the bus driver layer generates reporting information based on the operation information, packages the reporting information into a heartbeat packet, and reports the heartbeat packet to the main controller at a regular interval.

[0013] In the second aspect, a method for interacting with a peripheral device is provided, wherein the peripheral device is used to be connected to a main controller via a bus, and the method includes: the main controller receives reporting information reported by the bus driver layer of the peripheral device; the reporting information is generated by the bus driver layer based on the operating information in the shared memory, and the operating information includes information written into the shared memory by each system layer of the peripheral device during initialization; the main controller performs corresponding operations based on the reporting information.

[0014] In one embodiment, the main controller performs corresponding operations based on the reported information, including: the main controller determines whether an abnormality occurs in the peripheral device based on the reported information; when an abnormality occurs in the peripheral device, the main controller sends an exception handling instruction to the peripheral device to instruct the peripheral device to perform corresponding exception handling operations.

[0015] In one embodiment, the reported information includes first status information, second status information, and a target time, wherein the first status information is used to indicate that the system layer in the peripheral device has completed initialization, and the second status information is used to indicate that the system layer in the peripheral device is being initialized; the target time is the time required for the system layer in the peripheral device being initialized to complete initialization;

[0016] The method of determining whether an abnormality occurs in the peripheral device includes: the main controller determining the interval time between the main controller receiving the first reporting information and receiving the second reporting information; the first reporting information is the first reporting information received by the main controller indicating that the system layer in the peripheral device that has completed initialization includes the first system layer, and the second reporting information is the first reporting information received by the main controller indicating that the system layer in the peripheral device that is undergoing initialization is the first system layer; the first system layer is one of the multiple system layers of the peripheral device; the main controller determines whether the interval time is greater than the target time, and if so, it means that an abnormality occurs in the peripheral device.

[0017] In the third aspect, an interaction device for a peripheral device is provided, which is applied to the bus driver layer of the peripheral device, and the peripheral device is used to be connected to the main controller via a bus. The device includes: a reading module, which is used to read the operation information of the peripheral device from the shared memory of the peripheral device when the bus driver layer of the peripheral device is initialized; the operation information includes the information written into the shared memory by each system layer of the peripheral device during initialization; and a generation module, which is used to generate reporting information based on the operation information and report the reporting information to the main controller.

[0018] In a fourth aspect, an interactive device for a peripheral device is provided, which is applied to a main controller, and the main controller is used to connect to the peripheral device through a bus. The device includes: a receiving module, which is used to receive reporting information reported by the bus driver layer of the peripheral device; the reporting information is generated by the bus driver layer based on the operating information in the shared memory, and the operating information includes information written into the shared memory by each system layer of the peripheral device during initialization; and an execution module, which is used to perform corresponding operations based on the reporting information.

[0019] In a fifth aspect, a peripheral device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, an interaction method of the peripheral device as described in any one of the first aspects above is implemented.

[0020] In a sixth aspect, a main controller is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the peripheral device interaction method as described in any one of the second aspects above is implemented.

[0021] In the seventh aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for interacting with a peripheral device as described in any one of the first aspects above is implemented, or when the computer program is executed by a processor, the method for interacting with a peripheral device as described in any one of the second aspects above is implemented.

[0022] A computer program product includes a computer program, which, when executed by a processor, implements the peripheral device interaction method as described in any one of the first aspects above, or, when executed by a processor, implements the peripheral device interaction method as described in any one of the second aspects above.

[0023] In the above-mentioned interaction method of peripheral devices, when the bus driver layer of the peripheral device is initialized, the bus driver layer reads the operation information of the peripheral device from the shared memory of the peripheral device, and the bus driver layer of the peripheral device generates reporting information based on the operation information, and reports the reporting information to the main controller. Since the initialization of the bus driver layer of the peripheral device precedes the completion of the initialization of the application layer of the peripheral device, the reporting information of the peripheral device is determined and sent by the bus driver layer of the peripheral device, which can avoid the problem that the peripheral device does not respond to the request instruction of the main controller until its application layer initialization is completed, resulting in the main controller being unable to perceive the status of the peripheral device for a long time. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a schematic diagram of a system layer diagram of a peripheral device in one embodiment;

[0025] Figure 2 A schematic diagram of interactive control between a main controller and peripheral devices in one embodiment;

[0026] Figure 3 A diagram of an application environment of a peripheral device interaction method according to an embodiment;

[0027] Figure 4 is a flowchart of the method for interacting with peripheral devices in the first embodiment;

[0028] Figure 5 is a schematic diagram of a system architecture of a peripheral device in one embodiment;

[0029] Figure 6 is a flowchart of a method for interacting with peripheral devices in a second embodiment;

[0030] Figure 7 is a flowchart of a method for interacting with peripheral devices in a third embodiment;

[0031] Figure 8 is a flowchart of a method for interacting with peripheral devices in a fourth embodiment;

[0032] Figure 9 is a flowchart of a method for interacting with peripheral devices in a fifth embodiment;

[0033] Figure 10 is a flowchart of a method for interacting with peripheral devices in a sixth embodiment;

[0034] Figure 11 2 is a flow chart of a method for interacting with peripheral devices in a seventh embodiment;

[0035] Figure 12 is a flowchart of a peripheral device interaction method according to an eighth embodiment;

[0036] Figure 13 A structural block diagram of an interactive device for a peripheral device in one embodiment;

[0037] Figure 14 is a structural block diagram of an interactive device for a peripheral device in another embodiment;

[0038] Figure 15 is a diagram of the internal structure of a peripheral device in one embodiment;

[0039] Figure 16 1 is a diagram of the internal structure of the main controller in one embodiment. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0041] It should be noted that peripheral devices possess a certain level of computing power and are highly integrated. They integrate device-related logic and protocols that would otherwise run on a main controller. Peripheral devices provide a simple hardware bus and software instructions, simplifying their application and shortening the overall product development cycle. Typically, peripheral devices connect to the main controller via a simple physical bus, which controls the device's behavior through a set of instructions.

[0042] Because peripheral devices carry a certain amount of computing power, their initialization and response times can be extended to varying degrees compared to physical devices with weaker computing capabilities and no software business logic. The initialization time for different types of peripheral devices and different services can range from milliseconds to tens of seconds.

[0043] Please refer to Figure 1 , which shows a system layer diagram of peripheral devices, such as Figure 1 As shown, the peripheral device system can be divided into the application layer, system service layer, logical device driver layer, and bus driver layer. Peripheral devices also include a hardware layer. The application layer is responsible for application programs that interact with and perform business logic. The system service layer is responsible for system backend services and logic. It manages device management and provides services to the application layer. It also handles logic that can be abstracted into public services and requires continuous operation. The device driver layer, based on the bus, implements peripheral devices as software logical devices, facilitating access and operation by user-space programs. Examples include network devices (net) and character devices (tty). Since peripheral devices are generally connected to the host controller via some type of bus, the bus driver layer primarily handles driver logic related to the physical bus. For example, USB, UART, SPI, and IIC all belong to device buses. The peripheral device's operating system can be Linux. As you can understand, Linux systems are generally divided into kernel space and user space. The application layer and system service layer belong to the Linux user space, while the logical device driver layer and bus driver layer belong to the Linux kernel space.

[0044] Please refer to Figure 2 , which shows the current interactive control work between the main controller and the peripheral devices. The interactive control work between the main controller and the peripheral devices can be divided into three stages, namely, stage one - hardware startup stage, stage two - software startup stage, and stage three - normal operation stage. Figure 2 The three stages of interactive control between the main controller and peripheral devices are briefly described.

[0045] like Figure 2 As shown, in the hardware startup phase, the main controller is powered on, and the peripheral devices are powered on simultaneously with the main controller hardware, or the main controller controls the peripheral devices to delay powering on through certain software logic. The peripheral devices are enumerated normally as bus-level devices and logic devices in the main controller system, and enter phase two.

[0046] During the software startup phase, the hardware bus is connected normally, but the main controller software still cannot interact with the peripheral devices through commands. It needs to wait for a certain period of time T1 to blindly send a request instruction Req-cmd0 to the peripheral device and wait for the peripheral device application layer to complete the initialization response message Ack-cmd0. If Ack-cmd0 (the response message to Req-cmd0) is not received within T1, the next cycle will be entered, and the request instruction Req-cmd0 will be blindly sent to the peripheral device, waiting for the peripheral device response message until the main controller receives the response message Ack-cmd0 or exceeds the preset timeout period T0 (the timeout period for determining that the peripheral device is abnormal). If the response message Ack-cmd0 is received, it is determined that the system is operating normally and enters stage three. If the response message Ack-cmd0 is still not received after the T0 period, the main controller controls the peripheral device to restart through hardware and re-executes stages one and two.

[0047] During the normal operation phase, for the case where the T2 duration is set, the main controller sends an instruction and waits for T2. If a response is received from the peripheral device before T2 arrives, it means that the peripheral device is operating normally. If no response is received from the peripheral device after T2, it is determined that the peripheral device is abnormal. One processing strategy is to restart the peripheral device through hardware and re-execute phases one, two, and three. For the case where the T2 duration is not set, the main controller sends an instruction and waits until a response is received from the peripheral device. However, if the main controller does not receive a response from the peripheral device for a long time after sending an instruction, it may cause an abnormality in the main controller's business logic, resulting in a system operation failure.

[0048] According to the above description, the peripheral device will not respond to the request of the main controller until its application layer is initialized, and there is almost no information reported before that, which causes the main controller to be unable to perceive the status of the peripheral device for a long time. In view of this, an embodiment of the present application provides an interaction method for peripheral devices. In this interaction method for peripheral devices, when the bus driver layer of the peripheral device is initialized, the bus driver layer reads the operation information of the peripheral device from the shared memory of the peripheral device, and the bus driver layer of the peripheral device generates reporting information based on the operation information and reports the reporting information to the main controller. Since the initialization of the bus driver layer of the peripheral device precedes the completion of the initialization of the application layer of the peripheral device, the reporting information of the peripheral device is determined and sent by the bus driver layer of the peripheral device, which can avoid the problem that the peripheral device does not respond to the request instruction of the main controller until its application layer is initialized, resulting in the main controller being unable to perceive the status of the peripheral device for a long time.

[0049] The peripheral device interaction method provided in the embodiment of the present application can be applied to Figure 3In the application environment shown. The peripheral device 302 communicates with the main controller 304 through a bus. The peripheral device 302 may be, but is not limited to, a GNSS module, a Bluetooth module, a Wi-Fi module, a cellular wireless communication module, etc., wherein the cellular wireless communication module includes an LTE module and a 5G module, etc. The main controller 304 may include, but is not limited to, a terminal or a server. The terminal may be, but is not limited to, various personal computers, laptops, smart phones, tablets, IoT devices and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server may be implemented as an independent server or a server cluster consisting of multiple servers.

[0050] Please refer to Figure 4 , which shows a peripheral device interaction method provided by the first embodiment of the present application, and the method is applied to Figure 3 The peripheral devices in the example are explained as follows. Figure 4 As shown, the peripheral device interaction method includes steps S402 to S404.

[0051] S402 : When the initialization of the bus driver layer of the peripheral device is completed, the bus driver layer of the peripheral device reads the operation information of the peripheral device from the shared memory of the peripheral device.

[0052] The operational information includes information written to the shared memory by each system layer of the peripheral device during initialization. Shared memory refers to memory that can be read and written by each system layer of the peripheral device. System peripheral device initialization proceeds sequentially through the bus driver layer, device driver layer, system service layer, and application layer. After the bus driver layer is initialized, it reads the peripheral device's operational information from the shared memory, generates reporting information based on the operational information, and transmits the reporting information to the main controller.

[0053] Please refer to Figure 5 , which shows a schematic diagram of the system architecture of a peripheral device provided by an embodiment of the present application, such as Figure 5 As shown, the application layer may include an interactive application module, the system service layer may include a system service module, and the device driver layer may include a device driver module. It should be noted that the interactive application module, the system service module, and the device driver module may be used to call relevant interface functions to write information corresponding to each system layer into the shared memory. In one embodiment, each system layer of a peripheral device writes information to the shared memory at corresponding preset intervals to update the operating information in the shared memory, thereby improving the real-time performance of the operating information in the shared memory.

[0054] In one embodiment, the information written into the shared memory by each system layer of the peripheral device during initialization is binary information. The bus driver layer of the peripheral device uses binary bit operations to scan the running information. For example, each system layer can be used to write a first parameter into the shared memory. The first parameter includes "0" and "1", wherein "0" is used to indicate that the corresponding system layer has not completed initialization, and "1" is used to indicate that the corresponding system layer has completed initialization. Since the initialization of the peripheral device requires a certain amount of time, the system layer may write multiple "0"s into the shared memory before writing "1" into the shared memory. The bus driver layer of the peripheral device uses an OR operation to scan the first parameter of each system layer. If the scan result is "1", it means that the initialization of the corresponding system layer is completed. If the scan result is "0", it means that the initialization of the corresponding system layer is not completed. In the above embodiment, the information written into the shared memory by each system layer is binary information, which can reduce the space occupied by the shared memory and increase the amount of data transferred.

[0055] S404: The bus driver layer of the peripheral device generates reporting information according to the operation information, and reports the reporting information to the main controller.

[0056] It should be noted that the bus driver layer of the peripheral device generates reporting information based on the operating information, and reports the reporting information to the main controller. In one embodiment, the bus driver layer of the peripheral device summarizes the operating information read to generate reporting information, and reports the reporting information to the main controller. Since the bus driver layer is mature and stable, the probability of anomalies in the bus driver layer is very small, and the bus driver layer is the earliest system layer to complete initialization in the peripheral device. Therefore, the embodiment of the present application reads the operating information of the peripheral device in the shared memory of the peripheral device through the bus driver layer of the peripheral device, generates reporting information based on the operating information, and reports the reporting information to the main controller, which can improve the interaction stability and interaction efficiency between the peripheral device and the controller.

[0057] In one embodiment, the reported information may include status information, wherein the status information is used to characterize the degree of initialization of the peripheral device, or in other words, the status information can be used to reflect whether the peripheral device has completed startup, and the main controller can perceive the status of the peripheral device based on the status information. The bus driver layer of the peripheral device generates the reported information based on the operation information, including: the bus driver layer of the peripheral device generates the status information based on the operation information. The reported information reported by the peripheral device to the main controller includes status information, which can enable the main controller to understand the current status information of the peripheral device, bringing convenience to abnormal analysis and debugging.

[0058] In one embodiment, the reported information may include first status information, second status information, and a target time. The first status information is used to indicate the system layer in the peripheral device that has completed initialization, the second status information is used to indicate the system layer in the peripheral device that is currently being initialized, and the target time is the time required for the system layer in the peripheral device to complete initialization. When the reported information includes the first status information, the second status information, and the target time, the main controller can easily determine whether the actual initialization time of the first system layer is normal, thereby determining whether the peripheral device is abnormal. The process by which the main controller determines whether a peripheral device is abnormal is described in detail in the following embodiments.

[0059] In one embodiment, the operation information may include initialization information in each memory area corresponding to each system layer in the shared memory. The shared memory includes multiple memory areas. When the system layer calls a related interface function to write information to the shared memory, the area in which the information is written is the memory area corresponding to the system layer. Each system layer can be configured to update the initialization information in the corresponding memory area at corresponding time intervals. The initialization information may include first initialization information and second initialization information. The first initialization information indicates that the system layer is undergoing initialization, and the second initialization information indicates that the system layer has completed initialization. It should be noted that since the initialization of peripheral devices proceeds in the order of the bus driver layer, device driver layer, system service layer, and application layer, if the system layer has not been initialized, the system layer does not have the function of writing initialization information to the shared memory. That is, after the bus driver layer is initialized, when the bus driver layer of the peripheral device reads the peripheral device's operation information from the shared memory of the peripheral device, since the uninitialized system layer cannot write the initialization information to the shared memory, the operation information read by the bus driver layer of the peripheral device does not include the initialization information written by the system layer. In this case, it is considered that the system layer that has not written the initialization information has not begun initialization. Thus, the bus driver layer can determine the initialization status of each system layer (not initialized, initialization in progress, or initialization completed) by reading the operating information of the shared memory, thereby generating reporting information including first status information, second status information, and target time. In particular, when the peripheral device determines the initialization time of each system layer of the peripheral device, the initialization time is within a reasonable range. In one embodiment, the bus driver layer includes a status scanning module, wherein the status scanning module is configured to read the initialization information in the shared memory and generate status information based on the initialization information.

[0060] In one embodiment, the bus driver layer of the peripheral device includes a reporting module, wherein the reporting module is used to report the reporting information to the main controller. In one embodiment, the reporting module follows the power management policy of the bus, that is, stops reporting in the dormant state and restarts information reporting after resuming from the dormant state.

[0061] In one embodiment, the reported information may further include an identification code of the peripheral device, wherein the identification code is used to identify the peripheral device so that the main controller can determine the peripheral device to which the reported information belongs. Optionally, the identification code is ID information. Through the identification code, the main controller can distinguish whether the received heartbeat packet is sent by the peripheral device, and at the same time, it can avoid the problem that the main controller cannot distinguish which peripheral device sent the received report information when multiple peripheral devices are connected to the main controller.

[0062] The main controller queries the status of peripheral devices through periodic polling. There may be certain factors (such as: the main controller selects a certain peripheral to import into the debugging stage or the same main controller needs to be compatible with similar products from different manufacturers) that cause the peripheral device to probabilistically fail to respond to the handshake instruction of the main controller within the time set by the main controller. The main controller mistakenly judges that the peripheral device is abnormal, and powers on the peripheral device again to cause a hard restart of the device, resulting in greatly reduced interaction efficiency. In the embodiment of the present application, since the peripheral device adopts a reporting mechanism, it can actively send reporting information to the main controller, thereby avoiding the situation where the main controller mistakenly judges that the peripheral device is abnormal due to the probabilistic failure of the peripheral device to respond to the handshake instruction of the main controller within the time set by the main controller. At the same time, the main controller can perceive the status of the peripheral device without blindly scanning the device through a polling strategy or blindly sending requests to query the device status, reducing the system resource usage of the main controller and improving the efficiency and accuracy of the interaction between the main controller and the peripheral device.

[0063] Please refer to Figure 6 , which shows the interaction method of the peripheral device provided by the second embodiment of the present application, and the method is applied to Figure 3 The peripheral devices in the example are explained as follows. Figure 6 As shown, the peripheral device interaction method includes steps S602 to S606.

[0064] S602 : When the bus driver layer of the peripheral device is initialized, the bus driver layer of the peripheral device reads the operation information of the peripheral device from the shared memory of the peripheral device.

[0065] It should be noted that each system layer of the peripheral device can be used to perform a dog feeding operation according to a corresponding preset time, wherein the preset time corresponding to each system layer can be the same or different, and can be designed according to actual needs, and the embodiments of the present application are not limited to this. The operation information may include dog feeding parameters corresponding to each system layer in the shared memory, that is, the dog feeding parameters corresponding to each system layer are stored in the shared memory, and the dog feeding parameters are used to indicate whether the corresponding system layer has performed the dog feeding operation.

[0066] S604: The bus driver layer of the peripheral device determines whether the corresponding system layer has performed a dog feeding operation within a preset time according to the dog feeding parameters.

[0067] S606: If the system layer fails to perform the dog feeding operation within the preset time, the bus driver layer of the peripheral device generates an exception message and reports the exception message to the main controller, wherein the exception message indicates that the system layer fails to perform the dog feeding operation within the corresponding preset time.

[0068] It should be noted that the bus driver layer of the peripheral device determines, based on the dog feeding parameters, whether the system layer corresponding to the dog feeding parameters executes the dog feeding parameters within the corresponding preset time. If, based on the dog feeding parameters, it is determined that the system layer corresponding to the dog feeding parameters does not execute the dog feeding operation within the corresponding preset time, the bus driver layer generates exception information indicating that an exception has occurred in the system layer corresponding to the dog feeding parameters, and reports the exception information. The system layer can execute the dog feeding operation in both phases 2 and 3, thereby determining whether an exception has occurred in each system layer in phases 2 and 3.

[0069] In one embodiment, after the system layer performs the dog feeding operation, the dog feeding parameter corresponding to the system layer changes by a preset value, so that the bus driver layer determines whether the dog feeding parameter changes by the preset value within the corresponding preset time, thereby determining whether the system layer corresponding to the dog feeding parameter has performed the dog feeding operation within the preset time. Optionally, changing the preset value can be increasing the preset value or decreasing the preset value. It should be noted that the preset value can be set as needed. The embodiment of the present application does not limit the size of the preset value and can be set as needed.

[0070] In one embodiment, the bus driver layer includes an exception monitoring module, wherein the exception monitoring module can be used to read the dog feeding parameters corresponding to each system layer from the shared memory of the peripheral device, and determine whether the corresponding system layer has performed the dog feeding operation within the preset time based on the dog feeding parameters. If not, the exception information is reported to the main controller so that the main controller performs the corresponding operation.

[0071] The embodiment of the present application provides an interaction method for peripheral devices. The bus driver layer of the peripheral device can determine whether an abnormality occurs in each system layer of the peripheral device and report the abnormality information to the main controller, providing the main controller with more specific information for handling the abnormality of the peripheral device, thereby improving the efficiency and accuracy of the main controller's abnormality handling.

[0072] Please refer to Figure 7 , which shows the peripheral device interaction method provided by the third embodiment of the present application, and the method is applied to Figure 3 The peripheral devices in the example are explained as follows. Figure 7 As shown, the peripheral device interaction method includes steps S702 to S706.

[0073] S702 : When the bus driver layer of the peripheral device is initialized, the bus driver layer of the peripheral device reads the operation information of the peripheral device from the shared memory of the peripheral device.

[0074] S704: The bus driver layer of the peripheral device generates reporting information according to the operation information.

[0075] For the step in which the bus driver layer of the peripheral device reads the operation information of the peripheral device from the shared memory of the peripheral device after the bus driver layer of the peripheral device is initialized, and the step in which the bus driver layer of the peripheral device generates reporting information based on the operation information, please refer to the above embodiment for details and will not be repeated here.

[0076] S706 , the bus driver layer of the peripheral device packages the reported information into a heartbeat packet, and reports the heartbeat packet to the main controller at a fixed time.

[0077] The bus driver layer of the peripheral device packages the generated reporting information into a heartbeat packet and reports the heartbeat packet to the main controller at regular intervals. In one embodiment, the heartbeat packet reports the heartbeat packet to the main controller at regular intervals according to a preset time interval. Optionally, a correspondence between a preset time interval and a bus type is pre-set in the peripheral device, and the peripheral device can determine the preset time interval based on the bus type connected to the main controller. It should be noted that the preset time interval corresponding to the bus can be compatible with bus protocol regulations. For example, when the bus type is a USB2.0 bus, the preset time interval should be greater than the USB SOF cycle (125 microseconds). When the bus type is UART / SPI, etc., the preset time interval can be configured according to the hardware bus capability.

[0078] In one embodiment, the bus driver layer of the peripheral device includes a packet assembly module that packages the reported information into a heartbeat packet according to a packet assembly protocol. Generally speaking, different buses and different types of peripheral devices have different packet assembly protocols. The packet assembly protocol may include: bus type, bus protocol version, peripheral device type, a list of peripheral device startup process states (including a timeout range for each state), current state, packet checksum, etc.

[0079] Please refer to Figure 8 , which shows the peripheral device interaction method provided by the fourth embodiment of the present application, and the method is applied to Figure 3 The peripheral devices in the example are explained as follows. Figure 8 As shown, the peripheral device interaction method includes steps S802 to S808.

[0080] S802 , when the bus driver layer of the peripheral device is initialized, the bus driver layer of the peripheral device reads initialization information and dog feeding parameters in each memory area corresponding to each system layer from the shared memory of the peripheral device.

[0081] S804: The bus driver layer of the peripheral device generates status information according to the initialization information in each memory area corresponding to each system layer.

[0082] S806: The bus driver layer of the peripheral device determines whether the corresponding system layer has performed the dog feeding operation within the preset time according to the dog feeding parameters. If not, the bus driver layer of the peripheral device generates abnormal information.

[0083] S808 , the bus driver layer of the peripheral device packages the status information and the abnormal information into a heartbeat packet, and reports the heartbeat packet to the main controller at a regular interval.

[0084] It should be noted that the bus driver layer of the peripheral device periodically obtains the initialization information and dog feeding parameters in each memory area corresponding to each system layer according to the reporting time of the heartbeat packet, and generates corresponding status information and exception information, thereby ensuring that the information in the heartbeat packet reported to the main controller matches the peripheral device.

[0085] Please refer to Figure 9 , which shows the interaction method of the peripheral device provided by the fifth embodiment of the present application, and the method is applied to Figure 3 The main controller in the example is as follows: Figure 9 As shown, the peripheral device interaction method includes steps S902 to S904.

[0086] S902: The main controller receives reporting information reported by the bus driver layer of the peripheral device.

[0087] The reporting information is generated by the bus driver layer of the peripheral device based on the operating information in the shared memory. The operating information includes information written into the shared memory by each system layer of the peripheral device during initialization. The description of the reporting information and operating information is detailed in the above embodiment and will not be repeated here.

[0088] In one embodiment, the main controller receives the reporting information reported by the bus driver layer of the peripheral device based on the reception interrupt of the bus.

[0089] S904: The main controller performs corresponding operations according to the reported information.

[0090] In one embodiment, the main controller identifies the peripheral device that sent the report information. In one embodiment, the report information also includes an identification code for the peripheral device. The bus driver layer of the main controller parses the report information. If it determines that the report information is from a peripheral device, the bus driver layer of the main controller notifies the event processing module of the system service layer of the main controller via the system event reporting mechanism according to a pre-designed event. For example, the active reporting event is designed to be "USB-TTY peripheral device startup status." When the main controller's USB bus receives a signal indicating that a peripheral device has been connected, if the report information is parsed and determined to be from a USB-TTY peripheral device, the event is reported based on the system event notification mechanism. The system service layer of the main controller is responsible for monitoring this event. Upon detecting this event, the system service layer of the main controller notifies the interactive application layer of the main controller or has the system service layer of the main controller handle the event. USB-TTY device status may include: a new device connected to the USB X interface; device startup in progress; device startup complete; interactive program startup in progress; interactive program startup complete; USB-TTY peripheral device startup complete, etc.

[0091] Please refer to Figure 10 , which shows the interaction method of the peripheral device provided by the sixth embodiment of the present application, and the method is applied to Figure 3 The main controller in the example is as follows: Figure 10 As shown, the peripheral device interaction method includes steps S1002 to S1006.

[0092] S1002: The main controller receives reporting information reported by the bus driver layer of the peripheral device.

[0093] The description of the step of the main controller receiving the reporting information reported by the bus driver layer of the peripheral device is detailed in the above embodiment and will not be repeated here.

[0094] S1004: The main controller determines whether an abnormality occurs in the peripheral device based on the reported information.

[0095] In one embodiment, the system service layer of the main controller determines whether an abnormality has occurred in the peripheral device based on the reported information. If not, the main controller proceeds according to the original system process. For example, the main controller receives the report information based on the bus receive interrupt. If it determines that the peripheral device has not experienced an abnormality, the main controller returns to the interruption point and continues execution.

[0096] S1006 , when an exception occurs in the peripheral device, the main controller sends an exception handling instruction to the peripheral device to instruct the peripheral device to perform a corresponding exception handling operation.

[0097] In one embodiment, the main controller is preset with a correspondence between the exception type and the exception handling instruction, that is, the main controller can determine the exception handling instruction to be sent to the peripheral device according to the exception type, so as to instruct the peripheral device to perform the exception handling operation corresponding to the exception handling instruction to resolve the abnormal situation of the peripheral device. In one embodiment, before sending the exception handling instruction to the peripheral device, it also includes: determining the exception type of the peripheral device. It should be noted that the embodiment of the present application does not limit the correspondence between the exception type and the exception handling instruction, and can be set according to the type of the peripheral device. For example: the exception type is that the peripheral device has no reported information within a preset time, and the exception handling instruction corresponding to the exception type is to instruct the peripheral device to restart.

[0098] Please refer to Figure 11 , which shows the interaction method of the peripheral device provided by the seventh embodiment of the present application, and the method is applied to Figure 3 The main controller in the example is as follows: Figure 11 As shown, the peripheral device interaction method includes steps S1102 to S1108.

[0099] S1102: The main controller receives reporting information reported by the bus driver layer of the peripheral device.

[0100] The description of the step of the main controller receiving the reporting information reported by the bus driver layer of the peripheral device is detailed in the above embodiment and will not be repeated here.

[0101] S1104: The main controller determines the interval between when the main controller receives the first reporting information and when it receives the second reporting information.

[0102] The reported information includes first status information, second status information and target time, the first status information is used to characterize the system layer that has completed initialization in the peripheral device, the second status information is used to characterize the system layer that is being initialized in the peripheral device, and the target time is the time required for the system layer that is being initialized by the peripheral device to complete initialization. In one embodiment, the first status information is used to characterize the topmost system layer among the system layers that have completed initialization in the peripheral device. In one embodiment, the first status information can be S1, S2, S3, S4 or S5, wherein S1 indicates that the bus driver layer initialization is complete, S2 indicates that the device driver layer initialization is complete, S3 indicates that the system service layer initialization is complete, S4 indicates that the application layer initialization is complete, and S5 indicates that the peripheral device is in normal operating state.

[0103] The first reporting information is the reporting information received by the master controller indicating that the system layer of the peripheral device has completed initialization, including the first system layer. The second reporting information is the reporting information received by the master controller indicating that the system layer of the peripheral device is undergoing initialization, namely the first system layer. It should be noted that the first system layer is one of multiple system layers of the peripheral device. The actual time required to initialize the first system layer can be determined based on the interval between receiving the first reporting information and receiving the second reporting information.

[0104] S1106: The main controller determines whether the interval time is greater than the target time.

[0105] It should be noted that, based on the above analysis, the interval time can be used to represent the time required for the first system layer to initialize. In one embodiment, the target time is a time range. Only when the first system layer initialization time falls within this time range can the first system layer be considered normal. In other words, only when the actual initialization time of the first system layer falls within the time range required for normal initialization of the first system layer can the first system layer be considered to be normal. It should be noted that if the interval time is greater than the target time, it indicates that an abnormality has occurred in the first system layer, that is, an abnormality has occurred in the peripheral device.

[0106] S1108 , if the interval time is greater than the target time, the main controller sends an exception handling instruction to the peripheral device to instruct the peripheral device to perform a corresponding exception handling operation.

[0107] For the step of if the interval time is greater than the target time, the main controller sends an exception handling instruction to the peripheral device to instruct the peripheral device to perform the corresponding exception handling operation, please refer to the above embodiment for details, and the embodiment of the present application will not repeat it again.

[0108] Please refer to Figure 12 , which shows the interaction method of the peripheral device provided by the eighth embodiment of the present application, such as Figure 12 As shown, the peripheral device interaction method includes steps S1202 to S1218.

[0109] S1202 , when the bus driver layer of the peripheral device is initialized, the bus driver layer reads initialization information and dog feeding parameters in each memory area corresponding to each system layer from the shared memory of the peripheral device.

[0110] In one embodiment, the peripheral device is connected to the main controller via a bus. The peripheral device is powered on when the main controller is powered on, and the main controller starts.

[0111] S1204: The bus driver layer of the peripheral device generates status information according to the initialization information.

[0112] S1206: The bus driver layer of the peripheral device determines whether the corresponding system layer has performed the dog feeding operation within the preset time according to the dog feeding parameters. If not, the bus driver layer of the peripheral device generates abnormal information.

[0113] S1208 , the bus driver layer of the peripheral device packages the status information and the abnormal information into a heartbeat packet, and reports the heartbeat packet to the main controller at a regular interval.

[0114] S1210: The bus driver layer of the main controller receives a heartbeat packet reported by the bus driver layer of the peripheral device based on a bus reception interrupt.

[0115] S1212: The bus driver layer of the main controller notifies the event processing module of the system service layer of the main controller through the system event reporting mechanism according to the pre-designed event.

[0116] S1214: The event processing module of the system service layer of the main controller determines whether an abnormality occurs in the peripheral device. If so, step S1216 is executed; if not, step S1218 is executed.

[0117] S1216: The main controller sends an exception handling instruction to the peripheral device to instruct the peripheral device to perform a corresponding exception handling operation.

[0118] S1218: The main controller returns to the interruption point and continues execution.

[0119] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0120] Based on the same inventive concept, embodiments of the present application also provide a peripheral device interaction apparatus for implementing the aforementioned peripheral device interaction method. The solution to the problem provided by this apparatus is similar to the solution described in the aforementioned method. Therefore, the specific limitations of the embodiments of the peripheral device interaction apparatus provided below can be found in the aforementioned limitations of the peripheral device interaction method, and will not be further elaborated here.

[0121] In one embodiment, Figure 13As shown, a peripheral device interaction device 1300 is provided, which is applied to Figure 3 The peripheral device bus driver layer in the peripheral device is configured as follows: the peripheral device interaction device 1300 includes a reading module 1302 and a reporting module 1304. The reading module 1302 is configured to read the peripheral device's operating information from the peripheral device's shared memory after the peripheral device's bus driver layer is initialized. The operating information includes information written to the shared memory by each system layer of the peripheral device during initialization. The generating module 1304 is configured to generate reporting information based on the operating information and report the reporting information to the main controller.

[0122] In one embodiment, the generating module may also be configured to generate status information according to initialization information of each memory area.

[0123] In one embodiment, the generation module can also be used to determine whether the corresponding system layer has performed the dog feeding operation within the preset time based on the dog feeding parameters; if not, the exception information is generated, and the exception information is used to indicate that an exception has occurred in the system layer corresponding to the dog feeding parameters.

[0124] In one embodiment, the generating module may also be configured to generate reporting information according to the operating information, package the reporting information into a heartbeat packet, and report the heartbeat packet to the main controller at regular intervals.

[0125] In one embodiment, Figure 14 As shown, a peripheral device interaction device 1400 is provided, which is applied to Figure 3 In the main controller, the peripheral device interaction device 1400 includes a receiving module 1402 and an execution module 1404. The receiving module 1402 is configured to receive reporting information from the bus driver layer of the peripheral device; the reporting information is generated by the bus driver layer based on operating information in the shared memory, including information written to the shared memory by various system layers of the peripheral device during initialization. The execution module 1404 is configured to perform corresponding operations based on the reporting information.

[0126] In one embodiment, the execution module can also be used to determine whether an exception occurs in the peripheral device based on the reported information; if an exception occurs in the peripheral device, send an exception handling instruction to the peripheral device to instruct the peripheral device to perform a corresponding exception handling operation.

[0127] In one embodiment, the execution module can also be used to determine the interval time between the main controller receiving the first reporting information and receiving the second reporting information; the first reporting information is the first reporting information received by the main controller, indicating that the system layer in the peripheral device that has completed initialization includes the first system layer, and the second reporting information is the first reporting information received by the main controller, indicating that the system layer in the peripheral device that is undergoing initialization is the first system layer; the first system layer is one of the multiple system layers of the peripheral device; determine whether the interval time is greater than the target time, and if so, it means that an abnormality has occurred in the peripheral device.

[0128] Each module in the aforementioned peripheral device interaction device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0129] In one embodiment, a peripheral device is provided. The peripheral device may be a terminal, and its internal structure diagram may be as follows: Figure 15 As shown. The peripheral device includes a processor, a memory, and a communication interface connected via a system bus. The processor of the peripheral device is used to provide computing and control capabilities. The memory of the peripheral device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the peripheral device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for interacting with a peripheral device is implemented.

[0130] Those skilled in the art will understand that Figure 15 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the peripheral devices to which the solution of the present application is applied. The specific peripheral devices may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0131] In one embodiment, a peripheral device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0132] In one embodiment, a main controller is provided. The main controller may be a terminal, and its internal structure diagram may be as follows: Figure 16As shown. The main controller includes a processor, a memory, and a communication interface connected through a system bus. Among them, the processor of the main controller is used to provide computing and control capabilities. The memory of the main controller includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The communication interface of the main controller is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for interacting with a peripheral device is implemented.

[0133] Those skilled in the art will understand that Figure 16 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the main controller to which the solution of the present application is applied. The specific main controller may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0134] In one embodiment, a main controller is further provided, comprising a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0135] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0136] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0137] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0138] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0139] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A peripheral device interaction method, characterized in that: The peripheral device is used to connect to the main controller via a bus, and the method includes: When the bus driver layer of the peripheral device is initialized, the bus driver layer reads the operation information of the peripheral device from the shared memory of the peripheral device; the operation information includes information written into the shared memory by each system layer of the peripheral device during initialization; The bus driver layer generates reporting information according to the operation information, and reports the reporting information to the main controller.

2. The peripheral device interaction method according to claim 1, characterized in that: The reported information includes status information, and the status information is used to represent the initialization degree of the peripheral device.

3. The peripheral device interaction method according to claim 2, characterized in that: The reported information includes first status information, second status information and target time. The first status information is used to represent the system layer in the peripheral device that has completed initialization, and the second status information is used to represent the system layer in the peripheral device that is being initialized; the target time is the time required for the system layer in the peripheral device that is being initialized to complete initialization.

4. The peripheral device interaction method according to claim 2, characterized in that: The operation information includes initialization information in each memory area corresponding to each system layer in the shared memory, each system layer is used to update the initialization information in the corresponding memory area, the initialization information includes first initialization information and second initialization information, the first initialization information is used to indicate that the system layer is being initialized, and the second initialization information is used to indicate that the system layer has completed initialization; The bus driver layer generates reporting information according to the operation information, including: The bus driver layer generates status information according to the initialization information of each memory area.

5. The peripheral device interaction method according to claim 1, characterized in that: Each system layer is further configured to perform a dog feeding operation according to a corresponding preset time, the operation information includes dog feeding parameters corresponding to each system layer in the shared memory, the dog feeding parameters are used to indicate whether the corresponding system layer has performed the dog feeding operation, and the reported information includes abnormal information; The bus driver layer generates reporting information according to the operation information, including: The bus driver layer determines whether the corresponding system layer has performed the dog feeding operation at the preset time according to the dog feeding parameter; If not, the bus driver layer generates the abnormal information, and the abnormal information is used to indicate that an abnormality occurs in the system layer corresponding to the dog feeding parameter.

6. The peripheral device interaction method according to claim 1, characterized in that: The bus driver layer generates reporting information according to the operation information and reports the reporting information to the main controller, including: The bus driver layer generates reporting information according to the operation information, packages the reporting information into a heartbeat packet, and reports the heartbeat packet to the main controller at a regular interval.

7. A peripheral device interaction method, characterized in that: The peripheral device is used to connect to the main controller via a bus, and the method includes: The main controller receives reporting information reported by the bus driver layer of the peripheral device; the reporting information is generated by the bus driver layer according to the operation information in the shared memory when the bus driver layer of the peripheral device is initialized, and the operation information includes information written into the shared memory by each system layer of the peripheral device during initialization; The main controller performs corresponding operations according to the reported information.

8. The peripheral device interaction method according to claim 7, characterized in that: The main control performs corresponding operations according to the reported information, including: The main controller determines whether an abnormality occurs in the peripheral device according to the reported information; When an exception occurs in the peripheral device, the main controller sends an exception handling instruction to the peripheral device to instruct the peripheral device to perform a corresponding exception handling operation.

9. The peripheral device interaction method according to claim 8, characterized in that: The reported information includes first status information, second status information, and a target time, wherein the first status information is used to indicate that the system layer in the peripheral device has completed initialization, and the second status information is used to indicate that the system layer in the peripheral device is undergoing initialization; The target time is the time required for the system layer of the peripheral device being initialized to complete initialization; The determining whether an abnormality occurs in the peripheral device includes: The main controller determines an interval between the main controller receiving the first reporting information and the main controller receiving the second reporting information; The first reporting information is the first reporting information received by the main controller indicating that the system layer in the peripheral device that has completed initialization includes the first system layer, and the second reporting information is the first reporting information received by the main controller indicating that the system layer in the peripheral device that is undergoing initialization is the first system layer; the first system layer is one of the multiple system layers of the peripheral device; The main controller determines whether the interval time is greater than the target time, and if so, it means that an abnormality occurs in the peripheral device.

10. A peripheral device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

11. A main controller comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 7 to 9 are implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Core logic circuit, computer system and method for initializing peripheral equipment

    CN101699415A

  • Method and system for remote access of peripheral device connected to serial bus

    CN102238054A