Management method, device, electronic equipment and storage medium for multiple slave stations

By allocating the processing period and charging period in the processing cycle of the second bus, the problem of excessive power consumption of the slave station under the control of the second bus is solved, and the communication efficiency and power management in the multi-slave scenario are improved.

CN114745223BActive Publication Date: 2024-09-03SHENZHEN HEGUANG MEASUREMENT CONTROL TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210282589.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-22
Publication Date
2024-09-03
Estimated Expiration
2042-03-22

AI Technical Summary

Technical Problem

In the multi-slave station scenario controlled by the second bus, the communication efficiency between the master station and the slave station is low, causing the slave station to consume too much power while waiting for a response, and cannot effectively manage the information collection of multiple slave stations.

Method used

By allocating a processing period and a charging period in each processing cycle, the processing period is used to receive the slave station response packet, and the charging period is used to replenish the power of the slave station to ensure that the slave station does not run out of power during the communication process.

Benefits of technology

It effectively guarantees the power supply of the slave station during the communication process, improves the efficiency and reliability of the master station's information collection of multiple slave stations, and avoids the problem of excessive power consumption of the slave stations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114745223B
    Figure CN114745223B
Patent Text Reader

Abstract

The present application is applicable to the field of data transmission, and provides a management method for multiple slave stations, including: sending a polling request to N slave stations through two buses, wherein N is an integer greater than 1; determining N processing cycles, each processing cycle including a processing period and a charging period, wherein one processing period corresponds to one slave station, and different processing periods correspond to different slave stations; at the beginning of each processing period, the two buses are controlled to a low level state to receive the slave station response packet fed back by the corresponding slave station based on the polling request; in each charging period, the two buses are controlled to a high level state to realize charging of each slave station. The present application also provides a management device, an electronic device and a storage medium for multiple slave stations. The present application aims to solve the problem that the power storage of multiple slave stations cannot work normally during the two-bus transmission process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data transmission, and in particular to a management method, device, electronic device and storage medium for multiple slave stations. Background Art

[0002] When the bus is not communicating, the master station keeps the bus in a high level state, that is, the bus is in a state of powering the slave. During communication, the master station will pull the bus level down while waiting for the slave station to respond. That is, while waiting for the slave station to respond, the bus is equivalent to not supplying power to the slave station, and the slave station must power itself with its own stored electricity.

[0003] Since the two-bus adopts the technology of combining power supply and communication, the working mode of the master and slave is a question-and-answer between the master and slave, and the communication efficiency in this working mode is extremely low. Especially in the scenario where the two-bus is commonly used for long-distance and multi-slave communication, because there are many slaves controlled by the master on a two-bus, it takes a long time for the master to collect the status information or alarm information of the slave by polling, resulting in the possibility that the power stored in the slave itself will be consumed at any time. Summary of the invention

[0004] The purpose of the present application is to provide a management method, device, electronic device and storage medium for multiple slave stations, so that each slave station can work normally in a scenario of controlling multiple slave stations based on two buses.

[0005] In a first aspect, the present application provides a management method for multiple slave stations, which is executed by a master station in two buses and adopts the following technical solution:

[0006] Sending polling requests to N slave stations via the second bus, where N is an integer greater than 1;

[0007] Determine N processing cycles, each processing cycle includes a processing period and a charging period, wherein one processing period corresponds to one slave station, and different processing periods correspond to different slave stations;

[0008] At the beginning of each processing period, the second bus is controlled to be in a low level state to receive a slave station response packet fed back by the corresponding slave station based on the polling request;

[0009] In each charging period, the second bus is controlled to be in a high level state to realize charging of each slave station.

[0010] In a second aspect, the present application provides a management device for multiple slave stations, which adopts the following technical solution:

[0011] A management device for multiple slave stations, the management device is integrated in a master station in two buses, and the management device comprises a request sending module, a cycle determination module, an information processing module and slave station charging.

[0012] A request sending module, used for sending polling requests to N slave stations through the second bus, where N is an integer greater than 1;

[0013] A cycle determination module, used to determine N processing cycles, each processing cycle includes a processing period and a charging period, wherein one processing period corresponds to one slave station, and different processing periods correspond to different slave stations;

[0014] The information processing module is used to control the second bus to a low level state at the beginning of each processing period to receive a slave station response packet fed back by the corresponding slave station based on the polling request;

[0015] The slave station charging module is used to control the second bus to a high level state in each charging period to realize charging of each slave station.

[0016] In a third aspect, the present application provides an electronic device comprising at least one connected processor and a memory, wherein the memory is used to store computer-readable instructions, and the processor is used to call the computer-readable instructions in the memory to execute the steps of the above-mentioned multi-slave station management method.

[0017] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method of the first aspect are implemented.

[0018] In a fifth aspect, the present application provides a computer program product, which includes a computer program. When the computer program is executed by one or more processors, it implements the steps of the method of the first aspect.

[0019] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0020] Compared with the prior art, the present invention has the following beneficial effects:

[0021] This application designs a charging period and a processing period for the polling feedback process. The processing period is used to ensure the communication time between the master station and the slave station, and the charging period is used to ensure that the slave station will not consume its own power during the communication process, so that the master station can complete the collection of information from multiple slave stations on the second bus. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0023] Figure 1 is an exemplary system architecture diagram provided in an embodiment of the present application;

[0024] Figure 2 It is a flowchart of a method for managing multiple slave stations provided in an embodiment of the present application;

[0025] Figure 3 It is a schematic diagram of a processing cycle of a multi-slave station management method provided in an embodiment of the present application;

[0026] Figure 4 It is a schematic diagram of the response completion of the multi-slave station management method provided in an embodiment of the present application;

[0027] Figure 5 It is a schematic diagram of a response timeout of a management method for multiple slave stations provided in an embodiment of the present application;

[0028] Figure 6 It is another schematic diagram of a response timeout of the management method of multiple slave stations provided in an embodiment of the present application;

[0029] Figure 7 It is a structural diagram of a multi-slave station management device provided in an embodiment of the present application;

[0030] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0032] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0034] like Figure 1 As shown, the system architecture 100 may include slave stations 101, 102, 103, a network 104 and a master station 105. The network 104 is a medium for providing a communication link between the slave stations 101, 102, 103 and the master station 105. The network 104 is a dual bus.

[0035] Users can use slave stations 101, 102, 103 to interact with master station 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on slave stations 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0036] Slave stations 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture E8pertsGroup Audio La9er III, Moving Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture E8pertsGroup Audio La9er IV, Moving Picture Experts Compression Standard Audio Layer 4) players, laptop computers and desktop computers, etc.

[0037] The master station 105 may be a server that provides various services, such as a background server that provides support for pages displayed on the slave stations 101 , 102 , and 103 .

[0038] It should be noted that the management method of multiple slave stations provided in the embodiment of the present application is generally executed by the master station, and accordingly, the management device of multiple slave stations is generally set in the master station.

[0039] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0040] Continue to refer Figure 2 , shows a flow chart of a multi-slave management method provided by an embodiment of the present application. The multi-slave management method is executed by a master station in two buses, and includes the following steps:

[0041] Step 201: Send a polling request to N slave stations via the second bus, where N is an integer greater than 1.

[0042] In this embodiment, the multi-slave station management method is run on the electronic device (eg Figure 1 The master station shown) can receive data via a wired connection.

[0043] In this implementation, polling request means that the master station sends out queries at regular intervals, asking each slave station (device) in sequence whether it needs to provide corresponding information requests. Such information can be working status or alarm information, etc. If there is, the corresponding resources are given for processing, and after the processing is completed, the next slave station is asked, and the above process is repeated continuously.

[0044] Step 202 , determining N processing cycles, each processing cycle including a processing period and a charging period, wherein one processing period corresponds to one slave station, and different processing periods correspond to different slave stations.

[0045] In this embodiment, if Figure 3 As shown, the processing period of each slave station includes: two safety periods and one response period, and the charging period is after the processing period. In the present application, the charging period can also be designed before the processing period. In the present application, two safety periods are used to protect the integrity of the received data. Because the data cannot be transmitted in an ideal state during the actual data transmission and reception process, it is necessary to consider the length of the response packet returned by the slave station so that the transmitted data can smoothly reach the master station, that is, the size of each processing period. Therefore, when considering the processing period, not only the length of the returned data should be considered, but also the clock error should be considered, so two safety periods are added to each response period to ensure that the data can be delivered normally under certain advance and delay conditions. Taking the message sent by slave station A as an example, it is estimated that it will be completed between 11:30 and 11:35 (response period). In order to prevent the data from arriving early or delayed, a 2-minute safety period can be added, that is, the processing period of slave station A at this time is: 11:28 to 11:37.

[0046] Step 203: at the beginning of each processing period, the second bus is controlled to be in a low level state to receive a slave station response fed back by the corresponding slave station based on the polling request.

[0047] In this embodiment, when the two buses are not communicating, the master station keeps the bus in a high level state, that is, the bus is in a state of powering the slave station. During communication, the master station will pull down the level of the two buses while waiting for the slave station to respond, waiting for the slave station to respond. That is, during the period of waiting for the slave station to respond, the bus is equivalent to not supplying power to the slave station, and the slave station needs to power itself with the power stored in itself.

[0048] Step 204: In each charging period, the second bus is controlled to be in a high level state to realize charging of each slave station.

[0049] In this embodiment, if Figure 3 As shown, during the charging period, the level is raised to charge all slave stations, which can make up for the power consumed by each slave station during the last communication between the master station and the slave station, thereby ensuring the normal operation of all slave stations in the next communication. Taking the processing period of slave station A from 11:28 to 11:37 as an example, a 3-minute charging period can be added at this time to replenish the power of all slave stations waiting for slave station A to communicate with the master station, that is, the charging period of slave station A is from 11:37 to 11:40. At 11:37, the level of the second bus is raised. At the end of the charging period, the data processing process of the next slave station must be started at the same time, so the level of the second bus is lowered at 11:40 to prepare for receiving the data sent by the next slave station.

[0050] In this embodiment, the present application designs a charging period and a processing period for the polling feedback process. The processing period is used to ensure the communication time between the master station and the slave station, and the charging period is used to ensure that the slave station will not consume its own power during the communication process, so that the master station can complete the collection of information from multiple slave stations on the second bus.

[0051] In some optional implementations, the management method further includes:

[0052] For each processing period, when a complete target slave response packet is received within the processing period, the second bus is controlled to switch from a low level state to a high level state, wherein the target slave response packet is: a slave response packet sent by the slave corresponding to the processing period.

[0053] In the above implementation, since the two buses use the technology of combining power supply and communication, the working mode of the master and slave stations can only adopt a one-question-one-answer mode, so only the information of one slave station can be processed at a time, and the information of multiple slave stations cannot be processed at the same time. Figure 3It can be known that each slave station must wait until the previous slave station has completed charging before it can enter the processing period. Taking the processing period of slave station A as 11:28 to 11:37 and the charging period as 11:37 to 11:40 as an example, only after 11:40 can it enter the processing period of slave station B. Because the master station adopts a question-and-answer format, the response time of each slave station has been planned. If slave station B does not send after 40 minutes, it may enter the processing period of slave station A and cause data confusion, or enter the charging period of slave station A and cause data reception problems (the two buses are in a high-level state and cannot receive data). Therefore, it can be determined that slave station B can only enter its own processing period after 40 minutes. And if Figure 3 It can be seen that for the security of communication, two safety periods are added to each slave station, thereby increasing the communication time between the slave station and the master station, so that each subsequent slave station has a longer waiting time when waiting for the communication between the previous slave station and the master station, and in this process it cannot enter its own processing period in advance and can only consume power.

[0054] Therefore, if Figure 4 As shown, in the processing period, after the communication process between the slave station and the master station is completed, the level of the second bus is pulled high in advance at the moment of communication completion. In this way, there is no need to wait until the charging period arrives before pulling the level of the second bus high. This can prevent the slave station from continuing to wait and consume power, and can further replenish the power consumed by the slave station during the communication process. Take the processing period of slave station A from 11:28 to 11:37 and the charging period from 11:37 to 11:40 as an example: the master station receives the first data sent by slave station A at 11:29 and completes the reception of all data at 11:34. Therefore, the master station no longer pulls the level of the second bus high at 11:37, but pulls the level of the second bus high in advance at 11:34, and then pulls the level of the second bus back to a low level at 11:40.

[0055] In some optional implementations, the management method further includes:

[0056] For each processing period, determine whether there is a risk of receiving timeout within the processing period;

[0057] When it is determined that there is a risk of receiving timeout within the processing period, the second bus is controlled to switch from a low level state to a high level state.

[0058] In the above implementation, there are two types of timeout risks: one is that the entire data packet times out. The other is that some bytes of data in the data packet times out. Data packet timeout means that it is determined that the data packet cannot be received completely, so no subsequent data is received. Partial byte data timeout in the data packet means that some data has been received, but the subsequent data cannot be sent on time. Because each slave station must send data in a specific period of time. Therefore, when it is determined that there is a risk that the data cannot be received completely, the level is raised in advance and charged. The following is a method for processing the entire data packet timeout. For example, when the first data is received, it can be checked whether the first data is within the first preset timeout period. If the data is received within the first timeout period, the level of the second bus is raised. If it is not within the first timeout period, the level of the second bus is directly raised after the first data is received. Take the processing period of slave station A from 11:28 to 11:37 and the charging period from 11:37 to 11:40 as an example. Since it is known that it takes 5 minutes to receive all the data from slave station A, if the first data is sent before 11:32, the level of the second bus will be pulled high after the data is received. If the first data is sent after 11:32, the level of the second bus will be pulled high after the first data is received. In the above way, when it is judged that the data reception timeout, the level is directly pulled high to charge the slave station, which further guarantees the working power of the slave station.

[0059] In some optional implementations, determining whether there is a risk of receiving timeout within the processing period includes:

[0060] Within a first preset timeout period after the start of the processing period, determining whether the first byte of data in a target slave station response packet is received, wherein the target slave station response packet is: a slave station response packet sent by a slave station corresponding to the processing period;

[0061] If the first byte of data is not received within the first preset timeout period, it is determined that there is a receiving timeout risk within the processing period.

[0062] In the above implementation, if Figure 5As shown, within a certain period of time, whether the first data is received, if data is received within a certain period of time, the level of the second bus is pulled high after the data is received. If no data is received within a certain period of time, the level of the second bus is directly pulled high. Take the processing period of slave A from 11:28 to 11:37 and the charging period from 11:37 to 11:40 as an example. Since it is known that it takes 5 minutes to receive the data from slave A, if the first data is sent before 11:32, the level of the second bus is pulled high after the data is received. If the first data is still not received at 11:32, the level of the second bus is directly pulled high at 11:32. When it is judged that the data reception timeout, the level is directly pulled high to charge the slave, which further guarantees the working power of the slave.

[0063] In some optional implementations, determining whether there is a risk of receiving timeout within the processing period includes:

[0064] within a second preset timeout period after receiving non-tail byte data in a target slave station response packet, determining whether the next byte data of the non-tail byte data is received, wherein the target slave station response packet is: a slave station response packet sent by a slave station corresponding to the processing period;

[0065] If the next byte data other than the tail byte data is not received within the second timeout period, it is determined that there is a risk of receiving timeout within the processing period.

[0066] In the above implementation, since the tail byte is the last data, when the tail byte data is received, the level of the second bus will be pulled high for charging. Figure 6 As shown, if a part of the data is received first, and then no subsequent data is received within a certain period of time, the level of the second bus is directly pulled high. Take the processing period of slave A from 11:28 to 11:37 and the charging period from 11:37 to 11:40 as an example. The first byte of data is received at 11:30, and then the data sent by slave A can be received normally before 11:33, but after 11:33, 1 minute (the second timeout period) has passed and still no data is received, so the timing starts at 11:33, which is the time when the last data is received. Finally, the level of the second bus is pulled high at 11:34. When it is judged that the data reception has timed out, the level is directly pulled high to charge the slave, which further guarantees the working power of the slave.

[0067] In some optional implementations, the management method further includes:

[0068] In the case where it is determined that there is a risk of reception timeout within the processing period, all data transmitted by the slave station corresponding to the processing period is discarded.

[0069] In the above implementation mode, the data is risky and is directly not used to prevent misleading the user.

[0070] In some optional implementations, for each processing cycle, a processing period in the processing cycle precedes a charging period in the processing cycle.

[0071] In the above implementation, if Figure 3 As shown, after each processing period, the present application designs a charging period after the processing period. The normal operation of the slave station is guaranteed by reasonably designing the processing period and the working period.

[0072] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0073] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by 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 they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0074] Further references Figure 7 , as a response to the above Figure 2 The present application provides an embodiment of a management device for multiple slave stations, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0075] like Figure 7 As shown, the management device is integrated into the master station in the two buses. The management device 700 of multiple slave stations in this embodiment includes: a request sending module 701, a cycle determination module 702, an information processing module 703 and a slave station charging module 704. Among them:

[0076] The request sending module 701 is used to send polling requests to N slave stations through the second bus, where N is an integer greater than 1;

[0077] The cycle determination module 702 is used to determine N processing cycles, each processing cycle includes a processing period and a charging period, wherein one processing period corresponds to one slave station, and different processing periods correspond to different slave stations;

[0078] The information processing module 703 is used to control the second bus to a low level state at the beginning of each processing period to receive a slave station response packet fed back by the corresponding slave station based on the polling request;

[0079] The slave station charging module 704 is used to control the second bus to a high level state in each charging period to realize charging of each slave station.

[0080] In some optional implementations of this embodiment, the apparatus 700 further includes:

[0081] The response packet judgment module is used to control the second bus to switch from a low level state to a high level state when a complete target slave station response packet is received within the processing period for each processing period, wherein the target slave station response packet is: a slave station response packet sent by the slave station corresponding to the processing period.

[0082] In some optional implementations of this embodiment, the apparatus 700 further includes:

[0083] A timeout judgment module is used to judge whether there is a receiving timeout risk in each processing period;

[0084] The timeout control module is used to control the second bus to switch from a low level state to a high level state when it is determined that there is a risk of receiving timeout within the processing period.

[0085] In some optional implementations of this embodiment, the timeout determination module further includes:

[0086] A first processing unit, configured to determine whether the first byte of data in a target slave station response packet is received within a first preset timeout period after the start of the processing period, wherein the target slave station response packet is: a slave station response packet sent by a slave station corresponding to the processing period;

[0087] The second processing unit is configured to determine that there is a receiving timeout risk within the processing period if the first byte of data is not received within the first preset timeout period.

[0088] In some optional implementations of this embodiment, the timeout determination module further includes:

[0089] A third processing unit is used to determine whether the next byte data of the non-tail byte data is received within a second preset timeout period after receiving the non-tail byte data in the target slave station response packet, wherein the target slave station response packet is: a slave station response packet sent by the slave station corresponding to the processing period;

[0090] The fourth processing unit is configured to determine that there is a receiving timeout risk within the processing period if the next byte data other than the tail byte data is not received within the second timeout period.

[0091] In some optional implementations of this embodiment, the apparatus 700 further includes:

[0092] The data discarding module is used to discard all data sent by the slave station corresponding to the processing period when it is determined that there is a risk of receiving timeout within the processing period.

[0093] In some optional implementations of this embodiment, for each processing cycle, a processing period in the processing cycle precedes a charging period in the processing cycle.

[0094] To solve the above technical problems, the present application also provides an electronic device. Figure 8 , Figure 8 This is a basic structural block diagram of the electronic device of this embodiment.

[0095] The electronic device 8 includes a memory 801 and a processor 802 which are connected to each other through a system bus. It should be noted that the figure only shows an electronic device 8 having components 801 and 802, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the electronic device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), programmable gate arrays (FPGA), digital processors (DSP), embedded devices, etc.

[0096] Electronic devices can be computing devices such as desktop computers, notebooks, PDAs, and cloud servers. Electronic devices can interact with users through keyboards, mice, remote controls, touch pads, or voice control devices.

[0097] The memory 801 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or D8 memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 801 can be an internal storage unit of the electronic device 8, such as a hard disk or memory of the electronic device 8. In other embodiments, the memory 801 can also be an external storage device of the electronic device 8, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 801 can also include both the internal storage unit of the electronic device 8 and its external storage device. In this embodiment, the memory 801 is generally used to store the operating system and various application software installed on the electronic device 8, such as computer-readable instructions of the management method of multiple slave stations, etc. In addition, the memory 801 can also be used to temporarily store various types of data that have been output or are to be output.

[0098] In some embodiments, the processor 802 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 802 is generally used to control the overall operation of the electronic device 8. In this embodiment, the processor 802 is used to run computer-readable instructions stored in the memory 801 or process data, such as computer-readable instructions for running a management method for multiple slave stations.

[0099] The present application also provides another implementation, namely, providing a computer-readable storage medium, which stores computer-readable instructions. The computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the multi-slave station management method as described above.

[0100] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0101] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A method for managing multiple slave stations, characterized in that: The management method is executed by the master station in the second bus, and the management method includes: Sending a polling request to N slave stations via the second bus, wherein N is an integer greater than 1; Determine N processing cycles, each of the processing cycles includes a processing period and a charging period, wherein one processing period corresponds to one slave station, and different processing periods correspond to different slave stations; At the beginning of each processing period, the second bus is controlled to be in a low level state to receive a slave station response packet fed back by the corresponding slave station based on the polling request; In each charging period, the second bus is controlled to be in a high level state to realize charging of each slave station; Wherein, each processing period includes two safety periods and one response period, and the two safety periods are respectively located before and after the response period; The management method also includes: For each of the processing time periods, determining whether there is a receiving timeout risk within the processing time period; When it is determined that there is a risk of receiving timeout within the processing period, the second bus is controlled to switch from a low level state to a high level state.

2. The management method according to claim 1, characterized in that: The management method also includes: For each of the processing time periods, when a complete target slave station response packet is received within the processing time period, the second bus is controlled to switch from a low level state to a high level state, wherein the target slave station response packet is: a slave station response packet sent by the slave station corresponding to the processing time period.

3. The management method according to claim 1, characterized in that: The determining whether there is a receiving timeout risk within the processing period includes: within a first preset timeout period after the start of the processing period, determining whether the first byte of data in a target slave station response packet is received, wherein the target slave station response packet is: a slave station response packet sent by a slave station corresponding to the processing period; If the first byte of data is not received within the first preset timeout period, it is determined that there is a risk of receiving timeout within the processing period.

4. The management method according to claim 1, characterized in that: The determining whether there is a receiving timeout risk within the processing period includes: After receiving the non-tail byte data in the target slave station response packet, determining whether the next byte data of the non-tail byte data is received within a second preset timeout period, wherein the target slave station response packet is: a slave station response packet sent by the slave station corresponding to the processing period; If the next byte data of the non-tail byte data is not received within the second timeout period, it is determined that there is a risk of receiving timeout within the processing period.

5. The management method according to claim 3, characterized in that: The management method also includes: If it is determined that there is a risk of reception timeout within the processing period, all data sent by the slave station corresponding to the processing period are discarded.

6. The management method according to any one of claims 1 to 5, characterized in that: For each of the processing cycles, a processing period in the processing cycle precedes a charging period in the processing cycle.

7. A management device for multiple slave stations, characterized in that: The management device is integrated into the master station of the second bus, and the management device includes: A request sending module, used for sending polling requests to N slave stations through the second bus, wherein N is an integer greater than 1; A cycle determination module, used to determine N processing cycles, each of which includes a processing period and a charging period, wherein one processing period corresponds to one slave station, and different processing periods correspond to different slave stations; An information processing module, used for controlling the second bus to a low level state at the beginning of each processing period to receive a slave station response packet fed back by the corresponding slave station based on the polling request; A slave station charging module, used for controlling the two buses to be in a high level state in each charging period, so as to realize charging of each slave station; Wherein, each processing period includes two safety periods and one response period, and the two safety periods are respectively located before and after the response period; The management device also includes: A timeout judgment module, used for judging, for each processing period, whether there is a receiving timeout risk in the processing period; The timeout control module is used to control the second bus to switch from a low level state to a high level state when it is determined that there is a risk of receiving timeout within the processing period.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.