Slave station message processing method, slave station servo driver, equipment and storage medium
By introducing a message storage and processing module into the slave servo driver, the message number of the most recent connection to the master station is obtained and processed, which solves the problem that the slave cannot view messages after power failure and realizes message display and printing without the need for master station support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, after a slave station connects to a master station, a computer and manufacturer software are required to view the slave station's message information, which makes it impossible to process messages after the slave station is powered off.
By introducing a message storage and processing module into the slave servo driver, the message number of the most recent connection to the master station is obtained, and the message is displayed and printed based on the message number, thus avoiding dependence on the master station.
It enables independent message display and printing even when the slave station is connected to the master station and the slave station is powered off, simplifying the process of obtaining message information.
Smart Images

Figure CN121644632A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of message control, in particular to a slave station message processing method, a slave station servo driver, equipment and a storage medium. BACKGROUND
[0002] With the development of the interactive communication mode from the master station, the user has put forward higher requirements for the processing of the slave station message.
[0003] The traditional slave station message processing mode is to connect the slave station to the master station, such as a PLC (Programmable Logic Controller), to view the configuration information of the interactive communication to obtain the last message information. This slave station message processing mode has great defects, and there is a problem that after the slave station is connected to the master station, and the computer and the corresponding manufacturer's software are connected to the PLC, the last message information can be viewed and obtained. Therefore, a new slave station message processing mode is urgently needed to realize the slave station message processing after the slave station is connected to the master station and the slave station is powered off.
[0004] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0005] The main purpose of the present application is to provide a slave station message processing method, a slave station servo driver, equipment and a storage medium, aiming at the technical problem of how to realize the slave station message processing after the slave station is connected to the master station and the slave station is powered off.
[0006] To achieve the above purpose, the present application provides a slave station message processing method, which is applied to a slave station servo driver, the slave station servo driver includes a message storage and a message processing module, and the slave station message processing method includes:
[0007] Obtain the historical message number in the message storage, wherein the historical message number includes the last message number of the last connection to the master station;
[0008] Determine the to-be-processed message information according to the last message number, and control the message processing module to process the to-be-processed message information, wherein the message processing includes message display and message printing.
[0009] In an embodiment, the step of determining the to-be-processed message information according to the last message number includes:
[0010] If the latest message number matches a preset valid message number, input / output information and message information corresponding to the latest message number are determined, and the input / output information is updated into the message information to obtain to-be-processed message information;
[0011] If the latest message number does not match the preset valid message number, preset message information is taken as to-be-processed message information.
[0012] In an embodiment, the message processing module includes a key unit and a display unit, and the step of controlling the message processing module to process the to-be-processed message information includes:
[0013] When the control display instruction input by the key unit is obtained, it is detected whether the control display instruction matches a preset message display instruction;
[0014] If the control display instruction matches the preset message display instruction, the display unit is controlled to display the to-be-processed message information.
[0015] In an embodiment, the message processing module includes a serial port interaction unit, and the step of controlling the message processing module to process the to-be-processed message information includes:
[0016] When the control printing instruction input by the serial port interaction unit is obtained, it is detected whether the control printing instruction matches a preset message printing instruction;
[0017] If the control printing instruction matches the preset message printing instruction, the to-be-processed message information is packaged to obtain to-be-printed information, and the serial port interaction unit is controlled to print the to-be-printed information.
[0018] In an embodiment, after the step of determining to-be-processed message information according to the latest message number, the method further includes:
[0019] If a master station connection request of a to-be-connected master station is received, it is detected whether request connection message information in the master station connection request matches the to-be-processed message information;
[0020] If the request connection message information in the master station connection request matches the to-be-processed message information, a connection is established between the to-be-processed message information and the to-be-connected master station;
[0021] If the request connection message information in the master station connection request does not match the to-be-processed message information, a connection is established between the request connection message information and the to-be-connected master station.
[0022] In an embodiment, after the step of determining whether the request connection message information in the master station connection request matches the to-be-processed message information, the method comprises:
[0023] determining a current message number corresponding to the request connection message information, and updating the historical message number in the message storage based on the current message number.
[0024] In an embodiment, the message processing module comprises a network port interaction unit, and after the step of determining the to-be-processed message information according to the latest message number, the method comprises:
[0025] when the connection state information input by the network port interaction unit is obtained, determining whether the connection state information matches a preset master station connection state;
[0026] if the connection state information matches the preset master station connection state, controlling the network port interaction unit to send the to-be-processed message information based on a preset communication rule.
[0027] In addition, to achieve the above-mentioned purpose, the application further provides a slave station servo driver, which comprises a message storage, a message processing module and a controller, the controller is connected with the message storage and the message processing module, and the controller comprises:
[0028] a message acquisition module, configured to acquire a historical message number in the message storage, wherein the historical message number comprises a latest message number of the latest connection with a master station;
[0029] a message processing module, configured to determine to-be-processed message information according to the latest message number, and control the message processing module to perform message processing on the to-be-processed message information, wherein the message processing comprises message display and message printing.
[0030] In addition, to achieve the above-mentioned purpose, the application further provides a slave station message processing device, which comprises a processor, a memory and a slave station message processing program stored in the memory and executable by the processor, wherein when the slave station message processing program is executed by the processor, the steps of the slave station message processing method are implemented.
[0031] The application further provides a storage medium, wherein the storage medium stores a slave station message processing program, and when the slave station message processing program is executed by a processor, the steps of the slave station message processing method are implemented.
[0032] This application provides a slave station message processing method applied to a slave servo driver. The slave servo driver includes a message memory and a message processing module. The method involves obtaining historical message numbers from the message memory, including the most recent message number from the most recent connection to the master station; determining the message information to be processed based on the most recent message number; and controlling the message processing module to process the message information. The message processing includes message display and message printing. By obtaining the most recent message number from the most recent connection to the master station from the message memory and processing it to obtain the message information to be processed, the message information to be processed can be displayed and printed based on the message processing module. This avoids the situation where, after the slave station connects to the master station, a computer and corresponding manufacturer software are needed to connect to the PLC to view the previous message information. This slave message processing method can perform message display and printing based on the most recent message number of the most recent connection to the master station in the message memory and then based on the message processing module, without needing to connect to the master station before processing (i.e., message processing can be completed in the slave servo driver). This allows slave message processing to be achieved after the slave and master station have established a connection and the slave has been powered off and on. Attached Figure Description
[0033] Figure 1 This is a flowchart illustrating the first embodiment of the slave message processing method of this application;
[0034] Figure 2 This is a schematic diagram of a frame of the slave servo driver in this application;
[0035] Figure 3 This is a schematic diagram of the reading process of the message processing method of this application;
[0036] Figure 4 This is a schematic diagram of the slave servo driver module of the slave message processing slave servo driver in this application;
[0037] Figure 5 This is a schematic diagram of the hardware operating environment involved in the device in this application;
[0038] Figure 6 This is a schematic diagram illustrating the message processing method of this application.
[0039] Figure 7 This is a schematic diagram of the printout of the message processing method for this application.
[0040] Figure 8 This is a schematic diagram of a connection process for the message processing method of this application.
[0041] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0042] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0043] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0044] Currently, there is no historical message exchange between the master and slave stations. To view historical message information between them, it can only be done in two ways, with the PLC as the master station. One method is to connect to the PLC's host computer software to view the configuration information and obtain the message number. This involves deducing the message number from the PLC's communication architecture (configuration information). However, this method requires a computer and the installation of corresponding specialized software (such as the PLC manufacturer's software). Furthermore, the PLC must be connected before the servo drive (slave station) crashes, allowing access to the message information. It's worth noting that access to the PLC is also required. If the PLC project involves confidential information and is protected, access to the PLC to obtain message information will be impossible. The second method involves restarting the servo drive and then reconnecting to the PLC to view the currently connected message number. However, if a fault prevents reconnection to the PLC, the message number will not be available. After a connection is established between the slave and master stations, if the slave station is not powered off, the connection packets can be read through the PNU in the profidrive. However, if the slave station is powered off, the packets will not be saved in the PNU.
[0045] Therefore, based on the shortcomings of the above-mentioned slave station message processing schemes, this application proposes a slave station message processing method. The main solution of this application embodiment is: to obtain the most recent message number of the most recent connection to the master station in the message memory, and to process the most recent message number to obtain the message information to be processed. Finally, the message information to be processed can be displayed and printed based on the message processing module. This avoids the phenomenon that after the slave station is connected to the master station, it is necessary to use a computer and corresponding manufacturer software to connect to the PLC before it can view and obtain the previous message information. This slave station message processing method can perform message display and printing based on the most recent message number of the most recent connection to the master station in the message memory, without needing to connect to the master station to process (i.e., message processing can be completed in the slave station servo drive). It can realize slave station message processing after the slave station has established a connection with the master station and the slave station has been powered off and on.
[0046] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or a device capable of performing the above functions, such as a slave message processing device. The following description uses a slave message processing device as an example to illustrate this embodiment and the subsequent embodiments.
[0047] Based on this, embodiments of this application provide a slave station message processing method. This method is applied to a slave servo driver, which includes a message storage and a message processing module. (Refer to...) Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the slave message processing method of this application.
[0048] Reference Figure 1 This application provides a slave station message processing method. In a first embodiment of the slave station message processing method, the slave station message processing method includes:
[0049] Step S10: Obtain the historical message number in the message storage, wherein the historical message number includes the most recent message number of the most recent connection to the master station;
[0050] In this embodiment, the slave message processing method is applied to a slave servo drive, and this method can be applied to slaves using PROFINET communication. PROFINET, developed by PROFIBUS International (PI), is a next-generation automation bus standard based on industrial Ethernet technology. The slave servo drive can be a CDHD2S-PN servo drive, which is the first direct-drive servo drive from Hikvision to support both PROFINET and AC4-DSC communication. AC4 refers to position closed-loop speed control, and DSC refers to dynamic servo control; AC4-DSC refers to a position loop that enables highly dynamic servo control. It can also be used with other types of slave servo drives or communication methods. Since PROFINET communication allows for message number viewing, this embodiment uses PROFINET communication and the CDHD2S-PN servo drive as examples. Because the slave servo driver includes a message memory and a message processing module, historical message numbers can be directly retrieved from the message memory during message processing. These historical message numbers include the most recent message number from the last connection to the master station. The slave's messages are then processed based on this most recent message number. The message memory can include commonly used flash memory, programmable read-only memory, and power-off memory devices. It's worth noting that the historical message numbers in the message memory can also include message numbers from any other historical point in time. The most recent message number refers to the message number from the most recent connection to the master station, or it can be the default message number (i.e., the message number from which the master station was not recently connected). This allows for processing of slave messages based on the most recent message number, preventing the loss of access to this information during faults or shutdowns. By checking the most recent message number, the cause of the fault or shutdown can be identified, ensuring transparent operation.
[0051] Step S20: Determine the message information to be processed based on the most recent message number, and control the message processing module to process the message information to be processed. The message processing includes message display and message printing.
[0052] In this embodiment, after obtaining the most recent message number, the most recent message number is processed to obtain the message information to be processed. The processing method can be to check whether it is valid, or to fill in complete message information based on the message number (specific to PROFINET communication). At this time, the message processing module is controlled to process the message information to be processed. The message processing includes message display and message printing. That is, the message processing module is controlled to print and / or display the message information to be processed. The message processing module can include related instruments for printing and / or display. At this time, it is not necessary to connect to the master station to process the message information. Moreover, the slave message processing method of this application can be implemented by calling the memory, display instrument, and printing instrument in the slave servo driver. This allows the slave message processing to be implemented after the slave and master stations have established a connection and the slave station has been powered off and on.
[0053] In one embodiment, the slave message processing method of this embodiment is applied to a slave servo drive before it is put into use. At this time, it is not convenient to configure a corresponding master station (relatively complete, such as related instruments connected to the master station) for viewing messages. Therefore, the slave message processing program of this application (based on the original components inside the slave servo drive) can be added internally to realize the processing function. At the same time, it avoids the situation in common solutions where message information cannot be viewed. Based on the advantages of PROFINET communication in message number processing, a slave message processing method for PROFINET communication is proposed to ensure the high efficiency of slave message processing.
[0054] In this embodiment, a slave station message processing method is provided. This method is applied to a slave servo driver, which includes a message memory and a message processing module. The method involves obtaining historical message numbers from the message memory, including the most recent message number from the most recent connection to the master station; determining the message information to be processed based on the most recent message number; and controlling the message processing module to process the message information. The message processing includes message display and message printing. By obtaining the most recent message number from the most recent connection to the master station from the message memory and processing it to obtain the message information to be processed, the message information to be processed can be displayed and printed based on the message processing module. This avoids the situation where, after the slave station connects to the master station, a computer and corresponding manufacturer software are needed to connect to the PLC to view the previous message information. This slave message processing method can perform message display and printing based on the most recent message number of the most recent connection to the master station in the message memory and then based on the message processing module, without needing to connect to the master station before processing (i.e., message processing can be completed in the slave servo driver). This allows slave message processing to be achieved after the slave and master station have established a connection and the slave has been powered off and on.
[0055] Furthermore, based on the first embodiment of this application described above, a second embodiment of the slave station message processing method of this application is proposed. In this embodiment, step S20, the step of determining the message information to be processed based on the most recent message number, includes:
[0056] Step S21: If the most recent message number matches the preset valid message number, determine the input / output information and message information corresponding to the most recent message number, and update the message information with the input / output information to obtain the message information to be processed.
[0057] Step S22: If the most recent message number does not match the preset valid message number, then the preset message information is used as the message information to be processed.
[0058] In this embodiment, upon reading the most recent message number from the message memory, the most recent message number is checked to avoid errors. For a slave servo driver, its own preset valid message number is known. For example, a message number that meets condition A is its own valid message number. Therefore, the most recent message number is matched with the preset valid message number as the valid message number. Then, the input / output information and message information corresponding to the most recent message number are determined. The input / output information is then updated into the message information to obtain the message information to be processed. Here, input / output information refers to the communication interaction architecture, such as the input / output of the master station and slave station, the input / output of messages, etc. Message information refers to the content of periodic exchanges between the master and slave stations, etc. Message information to be processed refers to the information related to the message to be processed. Conversely, if the most recent message number does not match the preset valid message number, the preset message information is used as the message information to be processed. It is worth noting that in addition to valid detection, other detection methods exist, such as checking whether the sequence number in the message number is continuous or meets expectations. If the sequence number is discontinuous or jumps too much, it may indicate data loss or out-of-order delivery, thus ensuring data accuracy. Preset message information refers to message information pre-defined by the user, such as a single message structure without internal input / output or message information. This facilitates subsequent processing, ensuring accuracy when viewing historical messages and preventing misinterpretation. Furthermore, it allows for rapid connection to the main station by quickly writing input / output and message information.
[0059] In one embodiment, refer to Figure 3 , Figure 3This is a schematic diagram of the reading process of the slave station message processing method of this application. After the system is initialized (i.e., initialized after the slave station servo driver is powered on), the last connection message number (most recent message number) is read from the memory (message memory). The message number is checked as described above. If the message number is determined to be invalid, the preset message information is directly used as the message information to be processed. Otherwise, the last connection message number is set as the configuration message (i.e., the message information stored for the relevant components to work) and the input and output sizes are updated to obtain the message information to be processed.
[0060] Furthermore, based on the first and / or second embodiments of this application described above, a third embodiment of the slave station message processing method of this application is proposed. In this embodiment, step S20, in which the message processing module includes a button unit and a display unit, and the step of controlling the message processing module to process the message information to be processed, includes:
[0061] Step S201: When a control display command is received from the key unit, it is checked whether the control display command matches the preset message display command.
[0062] Step S202: If the control display command matches the preset message display command, the control display unit displays the message information to be processed.
[0063] In this embodiment, the message processing module includes a button unit and a display unit. When a control display command is received from the button unit, it checks whether the control display command matches a preset message display command. If they match, the display unit is controlled to display the message information to be processed, i.e., the relevant logs within the message information. The button unit can consist of a single control button, and the display unit can consist of a display screen. The control display command refers to the command that controls the display screen to show various information, while the preset message display command refers to the command that controls the display screen to show the logs within the message information to be processed. Conversely, if the control display command does not match the preset message display command, the message information to be processed will not be displayed. (See also...) Figure 2 , Figure 2This is a schematic diagram of a slave servo driver framework for this application. The controller, acting as the control center of the slave servo driver, completes the entire processing flow. The controller can be an MCU (Microcontroller Unit), used for network communication with the network interface unit and serial communication with the serial interface unit, while also running the user program of the slave servo driver. Random access memory (RAM) is used to support the MCU in code execution. Flash memory stores the code. Message memory (EEPROM) stores user data that needs to be saved during power outages or fault shutdowns, i.e., the most recent message number. The button unit and display unit are used for the instruction input interface of the display panel (display unit). Pressing a button on the button unit determines that message information needs to be displayed, and the MCU controls the display screen in the display unit to display it. In other words, the MCU drives the display driver interface to receive and display data to complete the message display processing.
[0064] In one embodiment, refer to Figure 6 , Figure 6 This is a schematic diagram of the display flow of the slave station message processing method of this application. After obtaining the current operation panel menu (control display command input by the button unit), it is determined whether it is the message number reading menu (preset message display command). If it is not the message number reading menu, the current process ends. If it is not the message number reading menu, the current message number is sent to the display driver (i.e., the display unit). At this time, the display is confirmed to execute the process of displaying the current message number, thus realizing message display, and there is no situation where a connection to the master station is required to view messages.
[0065] In one embodiment, the message processing module includes a serial port interaction unit, and the steps for controlling the message processing module to process the message information to be processed include:
[0066] Step S211: When the control printing command input by the serial port interaction unit is obtained, it is detected whether the control printing command matches the preset message printing command.
[0067] Step S212: If the control printing command matches the preset message printing command, the message information to be processed is packaged to obtain the information to be printed, and the serial port interaction unit is controlled to print the information to be printed.
[0068] In this embodiment, the message processing module includes a serial port interaction unit, which can be a communication serial port connected to a relevant instrument, such as a computer. When a control printing command is received from the serial port interaction unit, it checks whether the control printing command matches a preset message printing command. If they match, the message information to be processed is packaged to obtain the information to be printed, and the serial port interaction unit is controlled to print the information to be printed, i.e., the relevant logs in the message information to be processed are printed. The control printing command refers to the command sent by the computer or other instrument connected to the serial port to control the printing of various information. The preset message printing command refers to the command sent by the computer or other instrument connected to the serial port to print the logs in the message information to be processed. Conversely, if the control printing command does not match the preset message printing command, the message information to be processed will not be printed. If printing is required, the message information to be processed is packaged to obtain the information to be printed, i.e., processed through encapsulation and other processing methods, and then the serial port interaction unit is controlled to transmit the information to be printed to the instrument connected to the serial port for printing, thereby realizing the printing processing of slave station messages.
[0069] In one embodiment, reference is made to Figure 7 , Figure 7 This is a schematic diagram of a printing process in the slave station message processing method of this application. By parsing the serial port command (the control printing command input by the port interaction unit), it is determined whether the command is a command to obtain the current message number (a preset message printing command). If it is not a command to obtain the current message number, the entire processing flow ends. Otherwise, when a command to obtain the current message number is not present, the current message number is packaged, i.e., encapsulated to obtain the information to be printed. At this time, the serial port can return the read result, i.e., the information to be printed, to the instrument connected to the serial port for printing. There is no situation where a connection to the master station is required to view the message.
[0070] Furthermore, based on the first, second, and / or third embodiments of this application described above, a fourth embodiment of the slave station message processing method of this application is proposed. In this embodiment, after the step of determining the message information to be processed based on the most recent message number, the slave station message processing method further includes:
[0071] Step S30: If a master station connection request to be connected to is received, check whether the request connection message information in the master station connection request matches the message information to be processed.
[0072] Step S40: If the request connection message information in the master station connection request matches the message information to be processed, then establish a connection with the master station to be connected based on the message information to be processed.
[0073] Step S50: If the request connection message information in the master station connection request does not match the message information to be processed, then establish a connection with the master station to be connected based on the request connection message information.
[0074] In this embodiment, in addition to printing and displaying the message information to be processed, a fast connection to the master station is also achieved. During the entire process, if a master station connection request is received, the message information to be processed is determined based on the above process. Then, it is checked whether the request connection message information in the master station connection request matches the message information to be processed, that is, whether the master station to be connected to at this time is the same master station from the previous connection. If the request connection message information in the master station connection request matches the message information to be processed, it is determined that the master station to be connected to at this time is the same master station from the previous connection, and a connection is established with the master station to be connected based on the message information to be processed. Conversely, if the request connection message information in the master station connection request does not match the message information to be processed, it is determined that the master station to be connected to at this time is not the same master station from the previous connection, and a connection is established with the master station to be connected based on the request connection message information. The connection request message information refers to the message information sent when connecting to the master station, such as the communication architecture with the slave station. The master station connection request refers to the request sent when connecting to the master station. It can guarantee the connection request message information. At this time, when establishing a connection with the master station based on the connection request message information, the relevant configuration in the message information to be processed is directly deleted. The relevant configuration is the message information, input and output information, etc. in the message information to be processed. At this time, the master station connection can be quickly realized by deleting and overwriting based on the message information to be processed, thus ensuring the efficiency of the master station connection.
[0075] In one embodiment, reference is made to Figure 8 , Figure 8 This is a schematic diagram of a connection process for the slave station message processing method of this application. After receiving a connection request from the master station, it checks whether the connection request message in the connection request is consistent with the current message. This can be determined at least by checking the internal input and output information, or directly based on the message number; no specific limitation is made here. If they are consistent, the current message will be used directly for a fast connection. Conversely, if they are inconsistent, the relevant configuration of the current message will be deleted first, and the configuration of the message requested by the master station will be used. At the same time, the new message will be saved to the memory for later retrieval. In this case, a fast connection between the master and slave stations can also be achieved by simply deleting the relevant configuration.
[0076] Furthermore, after the step where the connection request message information in the main station connection request does not match the message information to be processed, the following steps are included:
[0077] Step S60: Determine the current message number corresponding to the request connection message information, and update the historical message number in the message storage based on the current message number.
[0078] In this embodiment, when it is determined that a new message is needed to establish a connection between the master and slave stations, the current message number corresponding to the connection request message information is determined, and the historical message number in the message memory is updated based on the current message number. The current message number refers to the message number corresponding to the connection request message information. The historical message number in the message memory is updated based on the current message number, specifically by updating the most recent message number. It is worth noting that the timing of saving message information is not limited to when establishing a connection; it can also be done after the connection is established to facilitate the subsequent retrieval of the most recent message number.
[0079] Furthermore, based on the first, second, third, and / or fourth embodiments of this application described above, a fifth embodiment of the slave station message processing method of this application is proposed. In this embodiment, the message processing module includes a network interface interaction unit. After determining the message information to be processed based on the most recent message number, the method includes:
[0080] Step a: When the connection status information input by the network interface interaction unit is obtained, check whether the connection status information matches the preset master station connection status.
[0081] Step b: If the connection status information matches the preset master station connection status, then the network interface interaction unit is controlled to send the message information to be processed based on the preset communication rules.
[0082] In this embodiment, the message processing module includes a network port interaction unit. This unit can be a communication network port connected to the master station, such as a PLC. Upon receiving connection status information from the network port interaction unit, the module checks if the connection status information matches a preset master station connection status. If they match, the module sends the message information to be processed based on preset communication rules. The preset communication rules refer to the PROFINET communication method, the connection status information refers to the connection status between the master station and the network port interaction unit, and the preset master station connection status refers to the connection status between the master station and the network port interaction unit. Conversely, if the connection status information does not match the preset master station connection status, the message information to be processed will not be sent. The network port interaction unit can be controlled to transmit the information to be printed to the master station connected to the network port for viewing, thus realizing message interaction processing between the slave station and the master station. It is worth noting that the method of reading the last connection message is not limited to serial port or display panel; other communication methods are also possible and are not limited here.
[0083] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the message processing method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0084] This application also provides a slave servo driver, which includes a message memory, a message processing module, and a controller. The controller is connected to the message memory and the message processing module. Please refer to [reference needed]. Figure 4 The controller includes:
[0085] The message acquisition module A10 is used to acquire the historical message number in the message storage, wherein the historical message number includes the most recent message number of the most recent connection to the master station;
[0086] The message processing module A20 is used to determine the message information to be processed based on the most recent message number, and to control the message processing module to process the message information to be processed, wherein the message processing includes message display and message printing.
[0087] The slave message processing slave servo driver provided in this application, employing the slave message processing method in the above embodiments, can solve the technical problem of how to perform slave message processing after the slave and master stations have established a connection and the slave has been powered off. Compared with the prior art, the beneficial effects of the slave message processing slave servo driver provided in this application are the same as those of the slave message processing method provided in the above embodiments, and other technical features in the slave message processing slave servo driver are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0088] This application provides a slave message processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the slave message processing method in the above embodiment 1.
[0089] The following is for reference. Figure 5 This document illustrates a structural diagram of a slave message processing device suitable for implementing embodiments of this application. The slave message processing device in these embodiments may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 5 The slave message processing device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0090] like Figure 5 As shown, the slave message processing device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the slave message processing device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following slave servo drives can be connected to I / O interface 1006: input slave servo drives 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the slave message processing device to communicate wirelessly or wiredly with other devices to exchange data. Although a slave message processing device with various slave servo drives is shown in the figure, it should be understood that it is not required to implement or have all of the slave servo drives shown. More or fewer slave servo drives can be implemented or have alternatively.
[0091] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0092] The slave message processing device provided in this application, employing the slave message processing method in the above embodiments, can solve the technical problem of how to perform slave message processing after a connection has been established between the slave and the master station and the slave has been powered off. Compared with the prior art, the beneficial effects of the slave message processing device provided in this application are the same as those of the slave message processing method provided in the above embodiments, and other technical features of this slave message processing device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0093] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0094] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0095] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the slave message processing method in the above embodiments.
[0096] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor slave servo drive, slave servo drive, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be executed by instructions for use by or in conjunction with a slave servo drive, slave servo drive, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0097] The aforementioned computer-readable storage medium may be included in the slave message processing device; or it may exist independently and not assembled into the slave message processing device.
[0098] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the slave message processing device, cause the slave message processing device to:
[0099] Obtain the historical message number from the message storage, wherein the historical message number includes the most recent message number of the most recent connection to the master station;
[0100] The message information to be processed is determined based on the most recent message number, and the message processing module is controlled to process the message information to be processed, wherein the message processing includes message display and message printing.
[0101] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone 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 remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0102] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of slave servo drivers, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based slave servo driver that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0103] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0104] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described slave station message processing method. This solves the technical problem of how to implement slave station message processing after a connection has been established between the slave station and the master station and the slave station has been powered off. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the slave station message processing method provided in the above embodiments, and will not be repeated here.
[0105] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the slave message processing method described above.
[0106] The computer program product provided in this application solves the technical problem of how to process slave station messages after a connection has been established between the slave and master stations and the slave station has been powered off. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the slave station message processing method provided in the above embodiments, and will not be repeated here.
[0107] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for processing messages from a slave station, characterized in that, The slave station message processing method is applied to a slave station servo driver, the slave station servo driver comprises a message storage and a message processing module, and the slave station message processing method comprises the following steps: Obtain a historical message number in the message storage, wherein the historical message number comprises a latest message number of the last time when the slave station is connected to a master station; Determine to-be-processed message information according to the latest message number, and control the message processing module to perform message processing on the to-be-processed message information, wherein the message processing comprises message display and message printing.
2. The method of claim 1, wherein the message is a request for a list of the at least one master station. The step of determining to-be-processed message information according to the latest message number comprises the following steps: If the latest message number matches a preset valid message number, determine input / output information and message information corresponding to the latest message number, and update the input / output information into the message information to obtain to-be-processed message information; If the latest message number does not match the preset valid message number, use preset message information as to-be-processed message information.
3. The method of claim 1, wherein the message is a request for a list of the at least one master station. The message processing module comprises a key unit and a display unit, and the step of controlling the message processing module to perform message processing on the to-be-processed message information comprises the following steps: When a control display instruction input by the key unit is obtained, detect whether the control display instruction matches a preset message display instruction; If the control display instruction matches the preset message display instruction, control the display unit to display the to-be-processed message information.
4. The method of claim 1, wherein the message is a request for a list of the at least one master station. The message processing module comprises a serial port interaction unit, and the step of controlling the message processing module to perform message processing on the to-be-processed message information comprises the following steps: When a control printing instruction input by the serial port interaction unit is obtained, detect whether the control printing instruction matches a preset message printing instruction; If the control printing instruction matches the preset message printing instruction, package the to-be-processed message information to obtain to-be-printed information, and control the serial port interaction unit to print the to-be-printed information.
5. The method of claim 1, wherein the message is a request for a list of the at least one master station. After the step of determining to-be-processed message information according to the latest message number, the method further comprises the following steps: If a master station connection request of a to-be-connected master station is received, detect whether request connection message information in the master station connection request matches the to-be-processed message information; If the request connection message information in the master station connection request matches the to-be-processed message information, establish a connection between the to-be-processed message information and the to-be-connected master station; If the request connection message information in the master station connection request does not match the to-be-processed message information, establish a connection between the request connection message information and the to-be-connected master station.
6. The method of claim 5, wherein the message is a request for a list of the master stations. After the step of determining to-be-processed message information according to the latest message number, the method further comprises the following steps: Determine a current message number corresponding to the request connection message information, and update the historical message number in the message storage based on the current message number.
7. The method of claim 1 to 6, wherein, The message processing module comprises a network port interaction unit, and after the step of determining to-be-processed message information according to the latest message number, the method further comprises the following steps: When the connection state information input by the network port interaction unit is acquired, it is detected whether the connection state information matches a preset master station connection state; If the connection state information matches the preset master station connection state, the network port interaction unit is controlled to send the to-be-processed message information based on a preset communication rule.
8. A station-servo drive, characterized by The slave station servo driver includes a message storage, a message processing module and a controller, the controller is connected with the message storage and the message processing module, and the controller includes: a message acquisition module, configured to acquire a historical message number in the message storage, wherein the historical message number includes a latest message number of the last time of connecting the master station; a message processing module, configured to determine to-be-processed message information according to the latest message number, and control the message processing module to process the to-be-processed message information, wherein the message processing includes message display and message printing.
9. A station message processing device, characterized by, The slave station message processing device includes a processor, a memory and a slave station message processing program stored in the memory and executable by the processor, wherein the slave station message processing program is executed by the processor to implement the steps of the slave station message processing method in any one of claims 1 to 7.
10. A storage medium, characterized by The storage medium stores a slave station message processing program, wherein the slave station message processing program is executed by the processor to implement the steps of the slave station message processing method in any one of claims 1 to 7.
Citation Information
Patent Citations
Message serial number updating method
CN112134884A
Abnormal message processing method and device
CN115396339A
Driving and collecting data interaction method and device based on CANOPEN protocol and medium
CN116155639A
Method and apparatus for saving and recombining message fragment, and computer storage medium
WO2018177041A1