Industrial equipment remote maintenance method and system
Through the remote maintenance method, priority allocation and index calculation functions are used to realize remote maintenance of industrial equipment, which solves the problems of low maintenance real-time and high cost under the traditional maintenance mode, and improves maintenance efficiency and equipment life.
Patent Information
- Application Number
- CN202210798715.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-08
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-07-08
AI Technical Summary
Industrial equipment fault maintenance in harsh environments has poor real-time performance, high cost and difficulty. The traditional local maintenance mode has low real-time maintenance performance, which increases the cost and difficulty of operation and maintenance.
The industrial equipment remote maintenance method is adopted, and remote maintenance communication interfaces are allocated by priority, and interfaces with high activity and priority are judged and selected for remote maintenance. The index calculation function is used to parse maintenance instructions and perform corresponding functions to achieve remote diagnosis and repair.
It improves the timeliness of equipment maintenance, extends the service life of equipment, reduces maintenance costs and difficulties, and reduces equipment scrapping and commuting costs for operation and maintenance personnel.
Smart Images

Figure CN115361371B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of single-chip embedded systems, and in particular to a remote maintenance method and system for industrial equipment. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] With the popularization of Internet technology, many industrial devices have the function of communicating with remote servers. With the rapid development of microelectronics technology in recent years, ordinary single-chip microcomputers have the advantages of high performance and low cost. Therefore, many industrial equipment generally adopt the mode of single-chip microcomputer + 2G / 3G / 4G wireless communication module, wired broadband or WIFI module to achieve communication with remote servers.
[0004] For these industrial equipment, due to their different functional positioning, the working environment they are in also varies greatly. Some are in high radiation and high magnetic field environments, and some are in high temperature and high humidity environments. Therefore, under the influence of many interference factors, the equipment will inevitably fail during operation. Some failures, once they occur, are irreparable and can only be replaced; however, for many failures, as long as the operation and maintenance personnel repair them in time when a fault alarm is generated, the equipment can resume normal operation.
[0005] However, since these industrial equipment are generally large in number and widely distributed, once a device fails and needs maintenance, if it can only rely on the operation and maintenance personnel to operate on the equipment site, not only will the operation and maintenance cost be high, but the real-time performance will be relatively poor; when a device fails, the operation and maintenance personnel need to first determine the specific location of the device, and then rush to the equipment site. For some equipment that has been running in the mountains and fields for many years, if the archive records are not detailed, it is difficult to find it accurately. Some equipment may need to hire a guide for guidance, or even hire special mechanical equipment to rush to the site, which not only increases the equipment's operation and maintenance cycle, but also increases the operation and maintenance cost. Even if some equipment can be located in time, its special installation location and installation environment may not be suitable for operation and maintenance personnel to enter. For example, some equipment is suspended in the air, or sunk into a deep well, and some equipment is in a factory with harmful gases, which increases the difficulty of operation and maintenance.
[0006] In summary, the problems and defects of existing local equipment maintenance are:
[0007] (1) The real-time performance of equipment maintenance is poor. When a device failure is discovered, maintenance personnel are required to rush to the site, find the specific device, and start maintenance, which increases time costs.
[0008] (2) The cost of equipment maintenance is relatively high; maintenance personnel will incur additional travel expenses and personnel / equipment costs when rushing to the site.
[0009] (3) Equipment maintenance is relatively difficult. For equipment in special application scenarios, when entering the site for maintenance, it is necessary to report in advance, coordinate between multiple departments, and even conduct a safety assessment. Maintenance can only be carried out after approval.
[0010] Therefore, since the working environment of industrial equipment is generally relatively harsh, operational failures are inevitable after long-term operation and maintenance is required; and when local equipment maintenance is adopted, the real-time nature of maintenance will be reduced, especially when multiple devices fail. In order to handle the failure as quickly as possible, the only way to improve the real-time nature of maintenance is to increase the number of maintenance personnel, which further increases the cost of maintenance. Summary of the invention
[0011] In order to solve the above problems, the present invention proposes a remote maintenance method and system for industrial equipment, which improves the timeliness of equipment maintenance, extends the service life of equipment, reduces material waste caused by equipment scrapping, and reduces the maintenance cost and difficulty of equipment.
[0012] In order to achieve the above object, the present invention adopts the following technical solution:
[0013] In a first aspect, the present invention provides a method for remote maintenance of industrial equipment, comprising:
[0014] Assigning a priority to a remote maintenance communication interface; the remote maintenance communication interface is used for communication between the industrial device and the remote server and receiving maintenance instructions from the remote server;
[0015] Determine whether the current remote maintenance communication interface is forcibly allocated;
[0016] If it is forcibly assigned, determine whether the effective life cycle of the current remote maintenance communication interface has ended. If not, use the current remote maintenance communication interface as the selected maintenance interface. Otherwise, clear the current remote maintenance communication interface and reselect;
[0017] If it is not forcibly assigned, the selected maintenance interface is determined based on the activity and priority of each remote maintenance communication interface;
[0018] After receiving the maintenance instruction with the selected maintenance interface, the maintenance password in the maintenance instruction is extracted, and the index value corresponding to the maintenance password is determined by calling the index calculation function. The execution function corresponding to the maintenance password is selected according to the index value and the execution function is called to perform remote maintenance.
[0019] As an optional implementation, before the industrial device communicates with the remote server, the network communication protocol stack is transplanted and the remote maintenance communication interface is initialized to establish a communication link.
[0020] As an optional implementation, the effective life cycle is the time during which there is no continuous data communication when each remote maintenance communication interface is in the remote maintenance state.
[0021] As an optional implementation, the process of determining the selected maintenance interface includes:
[0022] Obtain the activity of each remote maintenance communication interface, construct an activity statistics array, and use the bubble method to reorder the data;
[0023] After sorting, the activity of the last remote maintenance communication interface is obtained, and it is determined whether there is a remote maintenance communication interface with the same activity; if not, the last remote maintenance communication interface is used as the selected maintenance interface;
[0024] If yes, a remote maintenance communication interface with the same activity as the last remote maintenance communication interface is obtained, and the remote maintenance communication interface with the highest priority is used as the selected maintenance interface.
[0025] As an optional implementation, the process of determining whether the effective life cycle of the current remote maintenance communication interface has ended includes:
[0026] Define the interrupt service function LifeMonit[z], when a timer interrupt is generated with a fixed period T, LifeMonit[z] = LifeMonit[z] + T; where z is the internal number value of the current remote maintenance communication interface minus 1, and T is greater than 0 and less than or equal to the effective life cycle;
[0027] When the remote maintenance communication interface receives a maintenance instruction, LifeMonit[z] is set equal to 0, otherwise the value of LifeMonit[z] remains unchanged;
[0028] Periodically check whether the value of LifeMonit[z] is greater than or equal to the valid life cycle; if so, it means the valid life cycle has ended.
[0029] As an optional implementation, before executing the maintenance instruction received by the selected maintenance interface, initialization of the maintenance password and the execution function is performed; including:
[0030] Define command table, command quick lookup table and index inference function;
[0031] Add maintenance passwords and corresponding execution functions to the command table;
[0032] The index value of the maintenance password is obtained according to the index deduction function, and the index value and its corresponding maintenance password and execution function are stored in a command quick search table, so that the execution function corresponding to the maintenance password can be selected according to the index value in the command quick search table.
[0033] As an optional implementation, the maintenance password includes at least 3 English letters, and the first, second and last letters cannot be completely consistent; the first, second and last letters of different maintenance passwords cannot be completely consistent either.
[0034] As an optional implementation, the index calculation function performs a CRC operation on the maintenance password to obtain a corresponding index value.
[0035] In a second aspect, the present invention provides an industrial equipment remote maintenance system, comprising:
[0036] A priority allocation module is configured to allocate priorities to the remote maintenance communication interface; the remote maintenance communication interface is used for the industrial device to communicate with the remote server and receive maintenance instructions from the remote server;
[0037] A forced allocation judgment module is configured to judge whether the current remote maintenance communication interface is forcedly allocated;
[0038] A forced allocation module is configured to determine whether the effective life cycle of the current remote maintenance communication interface has ended if it is forcedly allocated, and if not, use the current remote maintenance communication interface as the selected maintenance interface, otherwise clear the current remote maintenance communication interface and reselect;
[0039] The general selection module is configured to determine the selected maintenance interface according to the activity and priority of each remote maintenance communication interface if it is not forcibly assigned;
[0040] The instruction parsing module is configured to extract the maintenance password in the maintenance instruction after receiving the maintenance instruction through the selected maintenance interface, determine the index value corresponding to the maintenance password by calling the index calculation function, select the execution function corresponding to the maintenance password according to the index value and call the execution function to perform remote maintenance.
[0041] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in the first aspect is performed.
[0042] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions, wherein when the computer instructions are executed by a processor, the method described in the first aspect is performed.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] The invention provides a remote maintenance method and system for industrial equipment, which improves the timeliness of equipment maintenance, prolongs the service life of equipment, reduces material waste caused by equipment scrapping, and reduces the maintenance cost and difficulty of equipment.
[0045] In terms of reducing maintenance costs; in the traditional local maintenance mode, once a device fails, the operation and maintenance personnel are required to rush to the location of the device, which will incur commuting costs. For some equipment in special locations, additional rental fees will also be incurred, including the cost of hiring guides or special mechanical equipment; the present invention proposes a remote maintenance method and system for industrial equipment, which only requires the operation and maintenance personnel to issue maintenance commands on the server side to achieve remote control of the equipment, thereby reducing maintenance costs.
[0046] In terms of improving the real-time performance of maintenance; in the traditional local maintenance mode, there is a certain time interval from the discovery of the fault to the arrival of the operation and maintenance personnel on site. During this period, the equipment is either allowed to continue to run "with the disease" or the equipment is stopped and waits to be repaired before continuing to run. For equipment that runs "with a disease", the initial minor problem may evolve into a major fault, or even cause a fatal and irreparable fault to the equipment. The present invention proposes a remote maintenance method and system for industrial equipment. Once a fault is discovered, the remote device fault can be first remotely diagnosed on the server side, and the remotely repairable fault can be repaired in time to allow the equipment to quickly return to normal. For serious faults, remote diagnosis can be performed before the operation and maintenance personnel are dispatched to perform on-site repairs, thereby improving the timeliness of maintenance and extending the service life of the equipment. At the same time, the commuting expenses of the operation and maintenance personnel are reduced, thereby reducing the cost of equipment use.
[0047] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0049] Figure 1 This is a flowchart of the industrial equipment remote maintenance method provided by Embodiment 1 of the present invention;
[0050] Figure 2 is a flow chart of selecting a remote maintenance communication interface provided by Embodiment 1 of the present invention;
[0051] Figure 3 This is a maintenance password initialization and execution flow chart provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0052] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0053] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0054] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0055] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0056] Example 1
[0057] This embodiment proposes a remote maintenance method for industrial equipment, such as Figure 1 As shown, the basic idea is to first transplant the network protocol stack and initialize each remote maintenance communication interface, then select the remote maintenance interface according to the selection strategy, and after receiving the maintenance instruction, extract the maintenance password and call the execution function to perform the maintenance function.
[0058] The specific steps include:
[0059] Assigning a priority to a remote maintenance communication interface; the remote maintenance communication interface is used for communication between the industrial device and the remote server and receiving maintenance instructions from the remote server;
[0060] Determine whether the current remote maintenance communication interface is forcibly allocated;
[0061] If it is forcibly assigned, determine whether the effective life cycle of the current remote maintenance communication interface has ended. If not, use the current remote maintenance communication interface as the selected maintenance interface. Otherwise, clear the current remote maintenance communication interface and reselect;
[0062] If it is not forcibly assigned, the selected maintenance interface is determined based on the activity and priority of each remote maintenance communication interface;
[0063] After receiving the maintenance instruction with the selected maintenance interface, the maintenance password in the maintenance instruction is extracted, and the index value corresponding to the maintenance password is determined by calling the index calculation function. The execution function corresponding to the maintenance password is selected according to the index value and the execution function is called to perform remote maintenance.
[0064] The remote maintenance method of industrial equipment is described in detail below.
[0065] Step 1: Complete the communication with the remote server by transplanting the network communication protocol stack and initializing the remote maintenance communication interface; specifically including:
[0066] Step 1-1, transplantation of network communication protocol stack; in order to improve the communication rate, network communication is adopted during remote maintenance, so it is necessary to transplant the network communication protocol stack. According to the resource situation of the specific selected microcontroller, TCP / IP protocol stack, LWIP protocol stack or uIP protocol stack can be selected.
[0067] In order to reduce the consumption of processor resources (RAM and ROM) and optimize the entire network communication process, this embodiment takes the LwIP protocol stack transplantation as an example to optimize the configuration options, as follows:
[0068] 1) Disable the UDP function;
[0069] 2) Disable the DNS function;
[0070] 3) Adjust TCP_MSS (TCP Maximum segment size) from the default 536 to 1024;
[0071] 4) Adjust TCP_WND (The size of a TCP window, TCP receive window) from the default (4*TCP_MSS) to (2*TCP_MSS);
[0072] 5) Adjust MEMP_NUM_PBUF (the number of memp struct pbufs, memory pool) from the default 16 to 10.
[0073] Step 1-2, initialization configuration of remote maintenance communication interface; according to the selected remote maintenance communication interface, different initialization settings are performed to complete the establishment of the communication link; the remote maintenance communication interface includes 2G / 3G / 4G wireless communication interface, wired broadband interface or WIFI interface, etc.;
[0074] Taking the 4G wireless communication interface as an example, the initialization operation before dialing online is first completed through the AT command set, which mainly includes:
[0075] 1) AT+GMR, used to obtain module software version information;
[0076] 2) AT+ICCID, used to obtain the ICCID number of the SIM card;
[0077] 3) AT+CREG?, used to query the module registration status (whether it is attached to the base station);
[0078] 4) AT+CSQ, used to query signal strength;
[0079] 5) AT+CIMI, query the IMSI number of the SIM card;
[0080] Secondly, dial up through the ATD*99***1# command. After the dial-up is successful, a PPP link can be established and the IP address assigned by the operator can be obtained. At this point, the device has the ability to connect to the public network and can perform standard Socket network programming operations.
[0081] Step 2, selection of remote maintenance communication interface; set N (N is greater than 2) remote maintenance communication interfaces with remote maintenance function, assign a unique number Port to each remote maintenance communication interface, which are 1, 2, 3, 4, ... N, respectively, but in order to avoid execution conflicts, only one remote maintenance communication interface is allowed to be in maintenance activation state in the same period of time, and can execute remote maintenance instructions;
[0082] like Figure 2 As shown, the specific steps include:
[0083] Step 2-1, respectively assign priorities to N remote maintenance communication interfaces, the smaller the value, the higher the priority; for example, the priority of interface No. 1 is 1, the priority of interface No. 2 is 2, the priority of interface No. 3 is 3, and the priority of each remote maintenance communication interface is different.
[0084] Step 2-2, define the activity statistics array PortAct[Q] of the remote maintenance communication interface, where Q and N have the same value; this array is used to count the activity values of each communication interface, and the relationship between the array subscript x and the communication interface number Port is x+1==Port.
[0085] Step 2-3, define the life cycle monitoring array LifeMonit[P] of the remote maintenance communication interface, where P and N have the same value. The array is used to count the continuous time when there is no data communication when each communication interface is in the remote maintenance state. The relationship between the array subscript y and the communication interface number Port is y+1==Port.
[0086] Step 2-4, define the variable PortAssign, the valid value range is greater than or equal to 1 and less than or equal to R, and other values are invalid. R and N have the same value. This variable is used to determine whether the remote maintenance interface is forcibly assigned to a communication interface.
[0087] Step 2-5, define a structure:
[0088]
[0089]
[0090] Among them, udwPortActValue represents the activity value of the communication interface; ucPortNumb represents the communication interface number corresponding to the current activity value; ucPortPri represents the priority corresponding to the ucPortNumb communication interface;
[0091] Then, use the structure ST_PORT_ACT_INFO to define the structure array stPortActInfo[Q], and the value of Q is consistent with the definition in step 2-2.
[0092] Step 2-6, determine whether the variable PortAssign is valid, the validity standard is that its value is greater than or equal to 1 and less than or equal to R; if invalid, it means that the current remote maintenance communication interface has not been forcibly assigned, go to step 2-7, and select a valid communication interface; if valid, it means that the current remote maintenance communication interface is forcibly assigned, go to step 2-10.
[0093] Step 2-7: Use the bubble method to reorder the Q data values of the activity statistics array PortAct[Q], and store the sorted data values in the array stPortActInfo[Q] in sequence; specifically:
[0094] (1) The value of PortAct[i] is assigned to stPortActInfo[i].udwPortActValue;
[0095] (2) i+1 is assigned to stPortActInfo[i].ucPortNumb, where i is the subscript of the array and the value range of i is greater than or equal to 0 and less than Q;
[0096] (3) According to the value of stPortActInfo[i].ucPortNumb, according to step 2-1, select the corresponding priority and assign it to stPortActInfo[i].ucPortPri; then go to step 2-8.
[0097] Step 2-8, obtain the communication interface activity value udwPortActValue of the last element stPortActInfo[Q-1] of the array stPortActInfo[Q], that is, stPortActInfo[Q-1].udwPortActValue;
[0098] Determine whether the activity value udwPortActValue of other array elements in the array stPortActInfo[Q] is equal to stPortActInfo[Q-1].udwPortActValue;
[0099] If they are not equal, the communication interface recorded in stPortActInfo[Q-1].ucPortNumb is selected as the selected remote maintenance interface, and step 3 is entered; if they are equal, steps 2-9 are entered.
[0100] Step 2-9, obtain all array elements in the array stPortActInfo[Q] that are equal to the value of stPortActInfo[Q-1].udwPortActValue; then select the stPortActInfo[n] with the smallest corresponding ucPortPri value, where n is greater than or equal to 0 and less than Q; the communication interface corresponding to the stPortActInfo[n].ucPortNumb value with the highest priority is the remote maintenance interface, and then go to step 3.
[0101] Step 2-10: To facilitate the operation and maintenance of the equipment and increase the flexibility of the maintenance interface selection, a maintenance interface mandatory allocation strategy is designed while automatically selecting based on the activity of the communication interface. However, in order to enhance security and reliability, a valid life cycle LIFETIME is designed for the mandatory allocated maintenance interface. During the valid life cycle, the mandatory allocated interface has a remote maintenance function. Once the valid life cycle ends, the mandatory allocated interface loses its maintenance function and is automatically reselected based on the activity.
[0102] The effective lifecycle monitoring strategy for the mandatory assigned communication maintenance interface is as follows:
[0103] Step 2-10-1, start the timer to generate a timer interrupt with a fixed period T, where the value of T is greater than 0 and less than or equal to the preset effective life cycle LIFETIME of the maintenance interface.
[0104] Step 2-10-2: In the interrupt service function of the timer, execute the LifeMonit[z]=LifeMonit[z]+T operation, where z is the internal number Port value of the current remote maintenance interface minus 1, that is, z=Port-1.
[0105] Step 2-10-3: At the application layer receiving frame of the remote maintenance interface, add a clearing operation for LifeMonit[z], where the z value is the same as in step 2-10-2; when a remote maintenance instruction is received, execute LifeMonit[z]=0, otherwise keep the LifeMonit[z] value unchanged.
[0106] Step 2-10-4, set up a periodic inspection function, and periodically check whether the variable PortAssign is valid in the function; if not, go directly to step 3; if valid, determine whether the value of LifeMonit[z] is greater than or equal to the effective life cycle LIFETIME value. If it is, it means that the effective life cycle has ended, and the variable PortAssign is set to 0, and then go to step 2-6; otherwise, keep the PortAssign value unchanged and go to step 3.
[0107] Step 3, initialization of maintenance password and execution function; after receiving the maintenance command with the selected maintenance interface, it is necessary to quickly respond to the maintenance password to improve the execution efficiency. For this reason, initialization operation is required before receiving frame parsing; Figure 3 As shown, the specific initialization steps are as follows:
[0108] Step 3-1, define the function pointer typedef (*Cmd_Analys_Fun_P) (UINT8 Argc, CHAR**aRGV);
[0109] Define the structure:
[0110]
[0111] Among them, *pName is the maintenance password; pCmdFunc is a function pointer used to point to the execution function corresponding to the maintenance instruction.
[0112] Step 3-2: Use the structure S_Shell_Cmd to define the command fast search table Shell_Cmd_Find_Fast[K], where the K value is greater than 0 and less than or equal to 256.
[0113] Step 3-3, use the structure S_Shell_Cmd to define the command table Shell_Cmd:
[0114]
[0115]
[0116] Among them, Shell_Cmd[] is a structure array;
[0117] According to business needs, add corresponding maintenance passwords and execution functions to the command table Shell_Cmd. The maintenance password is required to consist of no less than 3 English letters, and for different maintenance passwords, the first, second and last letters of the password cannot be completely consistent, and these three letters of different passwords cannot be completely consistent either.
[0118] As shown in the above example, the string "help" is the maintenance password, and PrintCmdList is the corresponding execution function, that is, Shell_Cmd[0].pName = "help"; Shell_Cmd[0].pCmdFunc = pCmdFunc; among them, the first, second and last letters of "help" are "h", "e" and "p" respectively, and these three letters cannot be completely consistent. At the same time, the first, second and last letters of "reboot" are "r", "e" and "t" respectively, and they cannot be completely consistent with "h", "e" and "p".
[0119] Step 3-4, create an index calculation function UINT8 GetShellCmdIndex(CHAR*CmdWord,UINT8ucCmdWrdSum); this function uses an 8-bit CRC algorithm to perform a CRC operation on the ucCmdWrdSum data pointed to by CmdWord, and returns the operation result ShellIndex.
[0120] Step 3-5: Distribute the elements in the command table Shell_Cmd to the command fast search table Shell_Cmd_Find_Fast to complete the assignment initialization of the fast search table. The specific steps are as follows:
[0121] Step 3-5-1. Define an array TempCmd[3] containing three elements.
[0122] Step 3-5-2, take out the first element Shell_Cmd[0] in the command table Shell_Cmd, and then assign the maintenance password of Shell_Cmd[0], that is, the first element, the second element and the last element of Shell_Cmd[0].pName to TempCmd[0], TempCmd[1] and TempCmd[2] respectively.
[0123] Step 3-5-3, use the index calculation function GetShellCmdIndex() to calculate the operation value TempIndex of the array TempCmd[].
[0124] Step 3-5-4, assign Shell_Cmd[0].pName and Shell_Cmd[0].pCmdFunc to Shell_Cmd_Find_Fast[TempIndex].pName and Shell_Cmd_Find_Fast[TempIndex].pCmdFunc of the command speed lookup table respectively.
[0125] Step 3-5-5, determine whether there are any elements in the command table Shell_Cmd that have not been dispersed to the command fast search table Shell_Cmd_Find_Fast;
[0126] If not, the command table is dispersed and the process goes to step 4;
[0127] If there is, take it out, and then refer to step 3-5-2 to take out the first, second and last elements of the corresponding maintenance password in turn, and use the index calculation function GetShellCmdIndex() to calculate the corresponding operation value TempIndex. Then refer to step 3-5-4 to assign the corresponding value to the fast search table Shell_Cmd_Find_Fast[TempIndex]; then repeat step 3-5 until all elements of the command table Shell_Cmd are scattered.
[0128] Step 4: Parsing and executing the maintenance password; Figure 3 As shown, including:
[0129] Step 4-1: Extraction of maintenance password: Analyze the received maintenance instruction and extract the specific maintenance password cmd; then proceed to step 4-2.
[0130] Step 4-2, determine the index value of the fast lookup table Shell_Cmd_Find_Fast[K]; for the determined maintenance password cmd, extract the first, second and last elements of the password respectively; for example, if the maintenance password mcd = "reboot", after extracting the first, second and last elements respectively, the new command sequence is "ret";
[0131] Use the index calculation function GetShellCmdIndex() to perform CRC operation on "ret", calculate the index value TempIndex of the password cmd, and then go to step 4-3.
[0132] Step 4-3, according to the index value TempIndex, locate the function Shell_Cmd_Find_Fast[TempIndex].pCmdFunc as the execution function corresponding to the maintenance password cmd, that is, the function RebootTerminal; then go to step 4-4.
[0133] Step 4-4, call the function Shell_Cmd_Find_Fast[TempIndex].pCmdFunc to perform device maintenance.
[0134] Example 2
[0135] This embodiment provides an industrial equipment remote maintenance system, including:
[0136] A priority allocation module is configured to allocate priorities to the remote maintenance communication interface; the remote maintenance communication interface is used for the industrial device to communicate with the remote server and receive maintenance instructions from the remote server;
[0137] A forced allocation judgment module is configured to judge whether the current remote maintenance communication interface is forcedly allocated;
[0138] A forced allocation module is configured to determine whether the effective life cycle of the current remote maintenance communication interface has ended if it is forcedly allocated, and if not, use the current remote maintenance communication interface as the selected maintenance interface, otherwise clear the current remote maintenance communication interface and reselect;
[0139] The general selection module is configured to determine the selected maintenance interface according to the activity and priority of each remote maintenance communication interface if it is not forcibly assigned;
[0140] The instruction parsing module is configured to extract the maintenance password in the maintenance instruction after receiving the maintenance instruction through the selected maintenance interface, determine the index value corresponding to the maintenance password by calling the index calculation function, select the execution function corresponding to the maintenance password according to the index value and call the execution function to perform remote maintenance.
[0141] It should be noted that the above modules correspond to the steps described in Example 1, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above Example 1. It should be noted that the above modules, as part of the system, can be executed in a computer system such as a set of computer executable instructions.
[0142] In further embodiments, there is also provided:
[0143] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in Embodiment 1 is performed. For the sake of brevity, it will not be described in detail here.
[0144] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0145] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0146] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the method described in Example 1 is completed.
[0147] The method in Example 1 can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it is not described in detail here.
[0148] Those skilled in the art will appreciate that the units, i.e., algorithm steps, of the various examples described in conjunction with this embodiment can be implemented in electronic hardware or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0149] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A remote maintenance method for industrial equipment, characterized in that: include: Assigning priorities to remote maintenance communication interfaces; The remote maintenance communication interface is used for communication between the industrial device and the remote server and for receiving maintenance instructions from the remote server; Determine whether the current remote maintenance communication interface is forcibly allocated; If it is forcibly assigned, determine whether the effective life cycle of the current remote maintenance communication interface has ended. If not, use the current remote maintenance communication interface as the selected maintenance interface. Otherwise, clear the current remote maintenance communication interface and reselect; The effective life cycle is the time during which there is no continuous data communication when each remote maintenance communication interface is in the remote maintenance state; If it is not forcibly assigned, the selected maintenance interface is determined based on the activity and priority of each remote maintenance communication interface; After receiving the maintenance instruction with the selected maintenance interface, the maintenance password in the maintenance instruction is extracted, and the index value corresponding to the maintenance password is determined by calling the index calculation function. The execution function corresponding to the maintenance password is selected according to the index value and the execution function is called to perform remote maintenance.
2. A remote maintenance method for industrial equipment according to claim 1, characterized in that: Before the industrial equipment communicates with the remote server, the network communication protocol stack is transplanted and the remote maintenance communication interface is initialized to build a communication link.
3. The remote maintenance method for industrial equipment according to claim 1, characterized in that: The process of determining the selected maintenance interface includes: Obtain the activity of each remote maintenance communication interface, construct an activity statistics array, and use the bubble method to reorder the data; After sorting, the activity of the last remote maintenance communication interface is obtained, and it is determined whether there is a remote maintenance communication interface with the same activity; if not, the last remote maintenance communication interface is used as the selected maintenance interface; If yes, a remote maintenance communication interface with the same activity as the last remote maintenance communication interface is obtained, and the remote maintenance communication interface with the highest priority is used as the selected maintenance interface.
4. The remote maintenance method for industrial equipment according to claim 1, characterized in that: The process of determining whether the effective life cycle of the current remote maintenance communication interface has ended includes: Define the interrupt service function LifeMonit[z]. When a timed interrupt is generated at a fixed period T, LifeMonit[z]=LifeMonit[z]+T; where z is the internal number value of the current remote maintenance communication interface minus 1, and T is greater than 0 and less than or equal to the effective life cycle; When the remote maintenance communication interface receives a maintenance instruction, LifeMonit[z] is set equal to 0, otherwise the value of LifeMonit[z] remains unchanged; Periodically check whether the value of LifeMonit[z] is greater than or equal to the valid life cycle; if so, it means the valid life cycle has ended.
5. The remote maintenance method for industrial equipment according to claim 1, characterized in that: Before executing the maintenance command received by the selected maintenance interface, the maintenance password and execution function are initialized; including: Define command table, command quick lookup table and index inference function; Add maintenance passwords and corresponding execution functions to the command table; The index value of the maintenance password is obtained according to the index deduction function, and the index value and its corresponding maintenance password and execution function are stored in a command quick search table, so that the execution function corresponding to the maintenance password can be selected according to the index value in the command quick search table.
6. A remote maintenance method for industrial equipment as claimed in claim 5, characterized in that: The maintenance password includes at least 3 English letters, and the first, second and last letters cannot be completely consistent; the first, second and last letters of different maintenance passwords cannot be completely consistent either.
7. The remote maintenance method for industrial equipment according to claim 5, characterized in that: The index calculation function performs a CRC operation on the maintenance password to obtain a corresponding index value.
8. An industrial equipment remote maintenance system, characterized in that: include: A priority allocation module is configured to allocate priorities to the remote maintenance communication interface; The remote maintenance communication interface is used for communication between the industrial device and the remote server and for receiving maintenance instructions from the remote server; A forced allocation judgment module is configured to judge whether the current remote maintenance communication interface is forcedly allocated; A forced allocation module is configured to determine whether the effective life cycle of the current remote maintenance communication interface has ended if it is forcedly allocated, and if not, use the current remote maintenance communication interface as the selected maintenance interface, otherwise clear the current remote maintenance communication interface and reselect; The effective life cycle is the time during which there is no continuous data communication when each remote maintenance communication interface is in the remote maintenance state; The general selection module is configured to determine the selected maintenance interface according to the activity and priority of each remote maintenance communication interface if it is not forcibly assigned; The instruction parsing module is configured to extract the maintenance password in the maintenance instruction after receiving the maintenance instruction through the selected maintenance interface, determine the index value corresponding to the maintenance password by calling the index calculation function, select the execution function corresponding to the maintenance password according to the index value and call the execution function to perform remote maintenance.
9. An electronic device, characterized in that: The method comprises a memory and a processor and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 7 is completed.
10. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the method described in any one of claims 1 to 7.
