Asynchronous communication method, system and device and storage medium
Through the asynchronous communication method, the master device sends asynchronous instructions and receives feedback, and the slave device caches the result data, solving the problem of inefficiency of traditional embedded communication protocols, realizing efficient asynchronous communication between master and slave devices, and improving communication stability and flexibility.
Patent Information
- Application Number
- CN202510647268.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-08-15
AI Technical Summary
Traditional embedded communication protocols are inefficient. The master device needs to wait for the slave device to perform operations and return response data before sending the next instruction, resulting in inefficient communication.
Using the asynchronous communication method, the master device sends asynchronous instructions and receives feedback information, and the slave device caches the execution result data. The master device can send synchronous or polling instructions while waiting to realize asynchronous communication between the master and slave devices.
Improve communication efficiency between master and slave devices, enhance communication stability and flexibility, and reduce repeated execution and data loss caused by interference.
Smart Images

Figure CN120498923A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to communication technology, and in particular to an asynchronous communication method, system, device and storage medium. Background Art
[0002] Traditional embedded communication protocols, such as Modbus, are based on a master-slave architecture and are widely used to connect electronic devices for data exchange. Communication targets are divided into master and slave devices. The master device is generally the information acquirer and presenter, sending commands to the slave device based on the request. The slave device then performs actions based on the commands or provides information.
[0003] After a user issues an operation command through the master device, they must wait for the slave device to complete the action corresponding to the operation command and return the response data before sending the next command. The slave device takes a certain amount of time to execute the action corresponding to the operation command, which makes the current communication method inefficient. Summary of the Invention
[0004] The present invention provides an asynchronous communication method, system, device and storage medium to improve the communication efficiency between a master device and a slave device.
[0005] In a first aspect, the present invention provides an asynchronous communication method, comprising:
[0006] The master device sends asynchronous instructions to the slave device;
[0007] In response to the asynchronous instruction, the slave device feeds back feedback information indicating whether the instruction is received successfully to the master device;
[0008] The slave device executes the action corresponding to the asynchronous instruction and generates execution result data;
[0009] The slave device executes the action corresponding to the asynchronous instruction, and caches the execution result data generated during the execution of the action into a register of the slave device;
[0010] During the process of the slave device executing the action corresponding to the asynchronous instruction, the master device sends a data acquisition instruction to the slave device.
[0011] Optionally, before the slave device responds to the asynchronous instruction, the method further includes:
[0012] The slave device parses the instruction sent by the master device and determines the instruction type;
[0013] When the instruction type is a synchronization instruction, the slave device responds to the synchronization instruction in real time and returns the synchronization information cached in the register to the master device;
[0014] When the instruction type is a polling instruction, the slave device returns the action data cached in the register to the master device.
[0015] Optionally, during the process in which the slave device executes the action corresponding to the asynchronous instruction, after the master device sends a data acquisition instruction to the slave device, the method further includes:
[0016] The slave device parses the instruction sent by the master device and determines the instruction type;
[0017] When the instruction type is a synchronization instruction, the slave device responds to the synchronization instruction in real time and returns the synchronization information cached in the register to the master device;
[0018] When the instruction type is a polling instruction, the slave device returns the action data cached in the register to the master device.
[0019] Optionally, the asynchronous communication method also includes:
[0020] The master device periodically sends a polling instruction to the slave device according to a preset frequency.
[0021] Optionally, the master device is connected to a plurality of slave devices, and the asynchronous communication method further comprises:
[0022] During the process of the slave device executing the action corresponding to the asynchronous instruction, the master device sends instructions to other slave devices, where the instructions include asynchronous instructions, synchronous instructions and polling instructions.
[0023] Optionally, the instruction issued by the master device includes a serial number used to represent unique identity information of the instruction, and the method further includes:
[0024] The slave device detects a serial number of the instruction, wherein the instruction includes an asynchronous instruction, a synchronous instruction, and a polling instruction;
[0025] Determining whether the serial number is a repeated serial number;
[0026] If so, in response to the instruction, the corresponding historical data cached in the register is returned to the master device.
[0027] Optionally, the asynchronous communication method also includes:
[0028] Counting the number of times the instruction appears repeatedly based on the serial number;
[0029] Determining whether the instruction is repeated more than a preset number of times;
[0030] If so, clear the historical data corresponding to the instruction from the register.
[0031] In a second aspect, the present invention further provides an asynchronous communication system for executing the asynchronous communication method provided in the first aspect of the present invention. The asynchronous communication system includes a master device and at least one slave device, and the master device is connected to the slave device.
[0032] In a third aspect, the present invention further provides an electronic device, comprising:
[0033] one or more processors;
[0034] a storage device for storing one or more programs;
[0035] When the one or more programs are executed by the one or more processors, the one or more processors implement the asynchronous communication method provided by the first aspect of the present invention.
[0036] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the asynchronous communication method provided in the first aspect of the present invention.
[0037] The asynchronous communication method provided by the present invention comprises the following steps: a master device sends an asynchronous instruction to a slave device; the slave device responds to the asynchronous instruction and feeds back feedback information to the master device to indicate whether the instruction is received successfully; the slave device executes the action corresponding to the asynchronous instruction and caches the execution result data generated during the execution of the action into a register of the slave device; while the slave device is executing the action corresponding to the asynchronous instruction, the master device sends a data acquisition instruction to the slave device; in this way, while the master device is waiting for the slave device to execute the action, the master device can send a synchronization instruction or a polling instruction to the slave device to obtain synchronization information or polling information that is ready; while the slave device is executing the action, the master device can send synchronization information or polling information that is ready to be sent to the master device, thereby realizing asynchronous communication between the master device and the slave device and improving communication efficiency.
[0038] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 A flowchart of an asynchronous communication method provided by the present invention;
[0041] Figure 2 A schematic structural diagram of an asynchronous communication system provided by the present invention;
[0042] Figure 3 A schematic structural diagram of an electronic device provided by an embodiment of the present invention.
[0043] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0044] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0045] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0046] Figure 1 This is a flowchart of an asynchronous communication method provided by the present invention. The present invention improves on the basis of existing embedded communication to realize asynchronous communication between the host and the slave. The method can be executed by the asynchronous communication system provided by the present invention. For example, Figure 1 As shown, the asynchronous communication method includes the following steps:
[0047] S101: The master device sends a command to the slave device.
[0048] In the embodiments of the present invention, a master device generally refers to a device that can actively send information. It possesses both initiative and control, initiating requests and controlling slave devices to complete tasks. The master device plays a dominant role in the communication process, initiating communication requests, managing the communication process, and actively controlling slave devices to perform corresponding tasks. A slave device, on the other hand, is a device that receives information and passively accepts requests from the master device and completes tasks accordingly. A slave device plays a subordinate role in the communication process, responding to requests from the master device and performing corresponding operations.
[0049] In an embodiment of the present invention, the master device sends an instruction to the slave device.
[0050] S102: The slave device parses the instruction sent by the master device to determine the instruction type.
[0051] After receiving the instruction, the slave device parses the instruction sent by the master device to determine the instruction type. In an embodiment of the present invention, the instruction type may include asynchronous instructions, synchronous instructions, and polling instructions. For example, the instruction may be a string of data including multiple data bits, one of which may be used as a data bit representing the instruction type, and different values of the data bit represent different instruction types. Among them, asynchronous instructions are used to control the slave device to perform corresponding actions, and synchronous instructions are used for the master device to obtain synchronization information from the slave device. The synchronization information is usually information with relatively low delay requirements. Polling instructions are used to periodically check whether a certain condition of the slave device is met or whether a certain data is ready. Polling instructions are used to obtain polling information with low delay requirements, such as execution result data of asynchronous instructions, operation logs of the slave device, error information of the slave device, etc. The present invention is not limited here.
[0052] In the embodiment of the present invention, the master device periodically sends polling instructions to the slave device according to a preset frequency.
[0053] S103: The slave device responds to the synchronization instruction in real time and returns the synchronization information cached in the register to the master device.
[0054] When the command type is a synchronous command, the slave device responds to the synchronous command in real time, returning the synchronization information cached in the register to the master device. This process is short, typically less than 100ms, and can be considered a real-time response. The synchronous command is primarily used by the master device to obtain information from the slave device.
[0055] S104: The slave device responds to the polling instruction and returns the polling information cached in the register to the master device.
[0056] When the command type is a polling command, the slave device responds to the polling command and returns the polling information cached in the register, the asynchronous command execution result data, the slave device's operation log, and the slave device's error information to the master device. It should be noted that if the data corresponding to the register is not yet ready, for example, if the action corresponding to the asynchronous command is still executing and the execution result data is not yet fully ready, the slave device will temporarily not respond to the polling command and wait for the next polling command. This process continues until the master device obtains the polling information.
[0057] S105 : The slave device responds to the asynchronous instruction and feeds back feedback information indicating whether the instruction is received successfully to the master device.
[0058] When the instruction type is an asynchronous instruction, the slave device responds to the asynchronous instruction and feeds back feedback information to the master device indicating whether the instruction was successfully received. Asynchronous instructions can be used to control the slave device to perform corresponding actions. For example, the instruction is provided with a data check bit, which verifies whether the instruction is correct. If correct, indicating successful instruction reception, the slave device feeds back feedback information indicating successful reception to the master device. If incorrect, indicating a problem occurred during instruction transmission, the slave device feeds back feedback information indicating failed instruction reception to the master device and does not respond to the instruction.
[0059] S106 , the slave device executes the action corresponding to the asynchronous instruction, and caches the execution result data generated during the execution of the action into a register of the slave device.
[0060] In an embodiment of the present invention, after successfully receiving the asynchronous instruction, the slave device executes the action corresponding to the asynchronous instruction, generates execution result data, and caches the execution result data in a register of the slave device.
[0061] S107 . While the slave device is executing the action corresponding to the asynchronous instruction, the master device sends a data acquisition instruction to the slave device.
[0062] While the slave device is executing an action corresponding to an asynchronous instruction, the master device can send a data acquisition instruction to the slave device. This data acquisition instruction can be a synchronization instruction or a polling instruction. In this way, while the master device is waiting for the slave device to execute an action, it can send a synchronization instruction or a polling instruction to the slave device to obtain synchronization information or a polling message indicating that it is ready. While the slave device is executing an action, it can send synchronization information or a polling message indicating that it is ready to execute to the master device. This achieves asynchronous communication between the master and slave devices and can improve communication efficiency.
[0063] In some embodiments of the present invention, the slave device parses a data acquisition instruction issued by the master device to determine the instruction type. If the instruction type is a synchronization instruction, the slave device responds to the synchronization instruction in real time and returns synchronization information cached in a register to the master device. If the instruction type is a polling instruction, the slave device returns action data cached in a register to the master device. The specific process has been described in detail in the aforementioned embodiments and will not be repeated here in the embodiments of the present invention.
[0064] The asynchronous communication method provided by the present invention comprises the following steps: a master device sends an asynchronous instruction to a slave device; the slave device responds to the asynchronous instruction and feeds back feedback information to the master device to indicate whether the instruction is received successfully; the slave device executes the action corresponding to the asynchronous instruction and caches the execution result data generated during the execution of the action into a register of the slave device; while the slave device is executing the action corresponding to the asynchronous instruction, the master device sends a data acquisition instruction to the slave device; in this way, while the master device is waiting for the slave device to execute the action, the master device can send a synchronization instruction or a polling instruction to the slave device to obtain synchronization information or polling information that is ready; while the slave device is executing the action, the master device can send synchronization information or polling information that is ready to be sent to the master device, thereby realizing asynchronous communication between the master device and the slave device and improving communication efficiency.
[0065] In the existing embedded communication method, if there is interference, if data interruption, garbled characters or other problems occur during data transmission, the communication status cannot be maintained, and repeated execution or data loss are prone to occur, and the communication stability is poor.
[0066] In some embodiments of the present invention, the instruction issued by the master device includes a serial number that represents the unique identity information of the instruction. After receiving the instruction, the slave device detects the instruction serial number, which may include asynchronous instructions, synchronous instructions, and polling instructions, and determines whether the serial number is a repeated serial number. If so, it indicates that the master device failed to obtain the corresponding data the previous time. In response to the instruction, the slave device returns the corresponding historical data cached in the register to the master device. In this way, there is no need to consider the timing between the various instructions. Even in the presence of interference, if data is interrupted or garbled during data transmission, it can be re-uploaded later, improving communication stability.
[0067] In some embodiments of the present invention, in order to reduce the accumulation of historical data in the register and release memory, the number of times an instruction is repeated can be counted based on the serial number to determine whether the number of times the instruction is repeated is greater than a preset number. If so, the historical data corresponding to the instruction is cleared from the register.
[0068] In some embodiments of the present invention, a master device is connected to multiple slave devices. While a slave device is executing an action corresponding to an asynchronous instruction, the master device sends instructions to other slave devices. The instructions may include asynchronous instructions, synchronous instructions, and polling instructions. In this way, asynchronous communication between the master device and different slave devices is achieved.
[0069] The present invention also provides an asynchronous communication system, which is used to execute the asynchronous communication method provided by any of the above embodiments. Figure 2 A schematic diagram of the structure of an asynchronous communication system provided by the present invention is shown in FIG. Figure 2 As shown, the asynchronous communication system includes a master device 110 and at least one slave device 120, and the master device 110 and the slave device 120 are connected, for example, Figure 2 Four slave devices 120 are taken as an example.
[0070] For example, in a specific embodiment of the present invention, the master device 110 is a mainboard of a coffee machine, and the slave devices include an extraction machine and a milk frother of the coffee machine.
[0071] Exemplarily, the main board sends an extraction instruction to the extraction machine. After receiving the instruction, the extraction machine parses the instruction and determines that the instruction type is an asynchronous instruction. After successfully receiving the asynchronous instruction, the extraction machine feeds back feedback information to the main board to indicate successful reception. At the same time, the extraction machine performs the extraction action, extracts the coffee liquid, generates extraction status data (whether the extraction is completed), and caches the extraction status data in the register of the slave device. During the process of the extraction machine extracting the coffee liquid, the main board can send a data acquisition instruction to the extraction machine. The data acquisition instruction can be a synchronous instruction or a polling instruction, which is used to obtain synchronous information or ready polling information, such as the currently set extraction temperature, duration, extraction status data and other data.
[0072] Figure 3 A schematic diagram of the structure of an electronic device provided for an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0073] like Figure 3As shown, the electronic device includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0074] Multiple components in the electronic device are connected to the I / O interface 15, including an input unit 16, such as a keyboard, mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, optical disk, etc.; and a communication unit 19, such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0075] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the asynchronous communication method.
[0076] In some embodiments, the asynchronous communication method can be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the asynchronous communication method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the asynchronous communication method in any other suitable manner (e.g., by means of firmware).
[0077] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0078] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0079] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0080] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0081] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0082] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0083] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the asynchronous communication method provided in any embodiment of the present application.
[0084] The computer program product may be implemented by writing computer program code for performing the operations of the present invention in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0085] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0086] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. An asynchronous communication method, characterized in that: include: The master device sends asynchronous instructions to the slave device; In response to the asynchronous instruction, the slave device feeds back feedback information indicating whether the instruction is received successfully to the master device; The slave device executes the action corresponding to the asynchronous instruction, and caches the execution result data generated during the execution of the action into a register of the slave device; During the process of the slave device executing the action corresponding to the asynchronous instruction, the master device sends a data acquisition instruction to the slave device.
2. The asynchronous communication method according to claim 1, wherein: Before the slave device responds to the asynchronous instruction, the method further includes: The slave device parses the instruction sent by the master device and determines the instruction type; When the instruction type is a synchronization instruction, the slave device responds to the synchronization instruction in real time and returns the synchronization information cached in the register to the master device; When the instruction type is a polling instruction, the slave device returns the action data cached in the register to the master device.
3. The asynchronous communication method according to claim 1, wherein: During the process in which the slave device executes the action corresponding to the asynchronous instruction, after the master device sends the data acquisition instruction to the slave device, the method further includes: The slave device parses the instruction sent by the master device and determines the instruction type; When the instruction type is a synchronization instruction, the slave device responds to the synchronization instruction in real time and returns the synchronization information cached in the register to the master device; When the instruction type is a polling instruction, the slave device returns the action data cached in the register to the master device.
4. The asynchronous communication method according to claim 1, wherein: Also includes: The master device periodically sends a polling instruction to the slave device according to a preset frequency.
5. The asynchronous communication method according to any one of claims 1 to 4, characterized in that: The master device is connected to a plurality of slave devices, and the asynchronous communication method further comprises: During the process of the slave device executing the action corresponding to the asynchronous instruction, the master device sends instructions to other slave devices, where the instructions include asynchronous instructions, synchronous instructions and polling instructions.
6. The asynchronous communication method according to any one of claims 1 to 4, characterized in that: The instruction issued by the master device includes a serial number used to represent unique identity information of the instruction, and the method further includes: The slave device detects a serial number of the instruction, wherein the instruction includes an asynchronous instruction, a synchronous instruction, and a polling instruction; Determining whether the serial number is a repeated serial number; If so, in response to the instruction, the corresponding historical data cached in the register is returned to the master device.
7. The asynchronous communication method according to claim 6, wherein: Also includes: Counting the number of times the instruction appears repeatedly based on the serial number; Determining whether the instruction is repeated more than a preset number of times; If so, clear the historical data corresponding to the instruction from the register.
8. An asynchronous communication system, characterized in that: Used to execute the asynchronous communication method according to any one of claims 1 to 7, the asynchronous communication system includes a master device and at least one slave device, and the master device is connected to the slave device.
9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the asynchronous communication method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the asynchronous communication method according to any one of claims 1 to 7 is implemented.