CN113342738A - Method, apparatus, computer program product and medium for modifying controller algorithm - Google Patents

Method, apparatus, computer program product and medium for modifying controller algorithm Download PDF

Info

Publication number
CN113342738A
CN113342738A CN202110702856.3A CN202110702856A CN113342738A CN 113342738 A CN113342738 A CN 113342738A CN 202110702856 A CN202110702856 A CN 202110702856A CN 113342738 A CN113342738 A CN 113342738A
Authority
CN
China
Prior art keywords
file
control
controller
instruction
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110702856.3A
Other languages
Chinese (zh)
Other versions
CN113342738B (en
Inventor
李精华
陈钊
沈国辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Mushroom Iot Technology Co ltd
Original Assignee
Mogulinker Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mogulinker Technology Shenzhen Co Ltd filed Critical Mogulinker Technology Shenzhen Co Ltd
Priority to CN202110702856.3A priority Critical patent/CN113342738B/en
Publication of CN113342738A publication Critical patent/CN113342738A/en
Application granted granted Critical
Publication of CN113342738B publication Critical patent/CN113342738B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/116Details of conversion of file system types or formats
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The invention discloses a method, a device, a computer program product and a medium for modifying a controller algorithm, wherein the method comprises the following steps: receiving a controller algorithm development file, and acquiring an instruction list according to the development file; generating a control algorithm configuration file according to the instruction list; the control algorithm configuration file is analyzed through the analyzer, and the analysis result is output to the terminal equipment to control the terminal equipment, so that the problem that the control algorithm fixed on the special controller cannot be modified to adapt to different working scenes is solved, and the applicability of the special controller is improved.

Description

Method, apparatus, computer program product and medium for modifying controller algorithm
Technical Field
The present invention relates to the field of industrial control technologies, and in particular, to a method, an apparatus, a computer program product, and a medium for modifying a controller algorithm.
Background
The special controller is produced by various manufacturers in the industrial robot industry, has various types and different appearances and internal structures, the control algorithm of the traditional special controller is generally fixed in the special controller through a program, and in the actual use process, a user cannot modify the control algorithm of the special controller, so that the application scene of the controller is relatively limited.
Disclosure of Invention
Embodiments of the present application provide a method, an apparatus, a computer program product, and a medium for modifying a controller algorithm, so as to solve the problem that a control algorithm fixed on a dedicated controller cannot be modified to adapt to different working scenarios.
The embodiment of the application provides a method for modifying a controller algorithm, which comprises the following steps:
receiving a controller algorithm development file, and acquiring an instruction list according to the development file;
generating a control algorithm configuration file according to the instruction list;
and analyzing the control algorithm configuration file through an analyzer, and outputting an analysis result to terminal equipment so as to control the terminal equipment.
In one embodiment, the step of receiving a controller algorithm development file and obtaining an instruction list according to the development file includes:
receiving a controller algorithm development file;
judging the file type of the development file;
and when the file type of the development file is a ladder diagram, converting the ladder diagram into an instruction list.
In one embodiment, the control algorithm profile includes: a file header and a file body; the file header comprises a file type, a file version number, a data packet length and a check code; the file body comprises at least one control instruction, and the components of each control instruction comprise an instruction format, an instruction name, an operand type, an operand and a parameter.
In one embodiment, the step of generating a control algorithm configuration file according to the instruction list comprises:
acquiring a control instruction in the instruction list and a data format of the control algorithm configuration file;
and converting the data format of the control instruction based on the data format of the configuration file to obtain the control algorithm configuration file.
In one embodiment, the data format of the control algorithm configuration file comprises the data format of the header; the step of converting the data format of the control instruction based on the data format of the configuration file to obtain the control algorithm configuration file comprises:
converting the data format of the control instruction based on the data format of the file header to obtain a file body of the control algorithm configuration file;
and splicing the file header and the file body to obtain the control algorithm configuration file.
In one embodiment, the step of generating a control algorithm profile according to the instruction list is followed by:
and storing the control algorithm configuration file in a storage system of the controller so as to control the terminal equipment according to the control algorithm configuration file in the storage system when the controller works.
In an embodiment, the step of parsing the control algorithm configuration file through a parser and outputting the parsed result to a terminal device to control the terminal device includes:
acquiring a control algorithm configuration file stored in a storage system;
analyzing the control algorithm configuration file, and obtaining a control instruction according to an analysis result;
processing the control instruction to obtain a processing result;
and outputting the processing result to terminal equipment to control the terminal equipment.
Further, to achieve the above object, the present invention also provides a control apparatus comprising: the controller algorithm modification method comprises a memory, a processor and a controller algorithm modification program stored on the memory and capable of running on the processor, wherein the controller algorithm modification program realizes the steps of the controller algorithm modification method when being executed by the processor.
Furthermore, to achieve the above object, the present invention also provides a computer program product comprising a modification program of a controller algorithm, which when executed by the processor implements the steps of the above-described modification method of the controller algorithm.
Further, to achieve the above object, the present invention also provides a storage medium having stored thereon a modification program of a controller algorithm, which when executed by a processor, implements the steps of the above-described modification method of the controller algorithm.
The technical solutions of the modification method, the modification device, the modification computer program product, and the modification medium for the controller algorithm provided in the embodiments of the present application have at least the following technical effects or advantages:
the technical scheme includes that a receiving controller algorithm development file is adopted, the development file is converted into an instruction list, a data format of the instruction list is converted into a data format required by a control algorithm configuration file and stored in a storage system, when the controller works, the control algorithm configuration file is obtained from the storage system and analyzed to obtain data of the control algorithm configuration file, a processor is adopted to execute the data of the control algorithm configuration file, a terminal device is controlled according to an execution result, the problem that a control algorithm fixed on a special controller cannot be modified to adapt to different working scenes is solved, and different control algorithm configuration files are configured according to different working scenes to improve the applicability of the special controller.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of a method for modifying a controller algorithm according to the present invention;
FIG. 3 is a schematic flow chart of a second embodiment of a method for modifying the controller algorithm according to the present invention;
FIG. 4 is a schematic flow chart of a third embodiment of a method for modifying a controller algorithm according to the present invention;
FIG. 5 is a schematic flow chart diagram of a fourth embodiment of a method for modifying a controller algorithm according to the present invention;
FIG. 6 is a schematic flow chart diagram of a sixth embodiment of a method for modifying the algorithm of the controller according to the present invention;
FIG. 7 is a data format schematic of a controller algorithm configuration file according to the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a hardware operating environment according to an embodiment of the present invention.
It should be noted that fig. 1 may be a schematic structural diagram of a hardware operating environment of the control device.
As shown in fig. 1, the control apparatus may include: an input interface 1003, a memory 1004, an algorithm parser 1005, a processor 1006, such as a single chip or an embedded RTOS, and an output interface 1007. The control device further comprises a communication bus, wherein the communication bus is used for realizing connection communication among the components; the input interface of the control device may be a user interface or a network interface, the user interface may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface may also include a standard wired interface, a wireless interface; the network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 1004 may alternatively be a storage device separate from the processor 1006 described previously.
It will be appreciated by those skilled in the art that the control device configuration presented in fig. 1 does not constitute a limitation of the control device, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, the memory 1004, which is a kind of storage medium, may include therein an operating system, a network communication module, a user interface module, and a modification program of a controller algorithm. Among these, an operating system is a program that manages and controls the hardware and software resources of the control device, a modification program that controls the controller algorithms, and the execution of other software or programs.
In the control device shown in fig. 1, the user interface is mainly used for connecting the cloud device and performing data communication with the cloud device; the network interface is mainly used for the background server and is in data communication with the background server; the processor 1006 may be used to invoke a modification program of the controller algorithm stored in the memory 1004.
In this embodiment, the control device includes: a memory 1004, a processor 1006, and a modified program of controller algorithms stored on the memory and executable on the processor, wherein:
the processor 1006, when calling the modification program of the controller algorithm stored in the memory 1004, performs the following operations:
receiving a controller algorithm development file, and acquiring an instruction list according to the development file;
generating a control algorithm configuration file according to the instruction list;
and analyzing the control algorithm configuration file through an analyzer, and outputting an analysis result to terminal equipment so as to control the terminal equipment.
The processor 1006, when calling the modification program of the controller algorithm stored in the memory 1004, also performs the following operations:
receiving a controller algorithm development file;
judging the file type of the development file;
and when the file type of the development file is a ladder diagram, converting the ladder diagram into an instruction list.
The processor 1006, when calling the modification program of the controller algorithm stored in the memory 1004, also performs the following operations:
acquiring a control instruction in the instruction list and a data format of the control algorithm configuration file;
and converting the data format of the control instruction based on the data format of the configuration file so as to obtain the control algorithm configuration file according to the converted control instruction.
The processor 1006, when calling the modification program of the controller algorithm stored in the memory 1004, also performs the following operations:
converting the data format of the control instruction based on the data format of the file header to obtain a file body of the control algorithm configuration file;
and splicing the file header and the file body to obtain the control algorithm configuration file.
The processor 1006, when calling the modification program of the controller algorithm stored in the memory 1004, also performs the following operations:
and storing the control algorithm configuration file in a storage system of the controller so as to control the terminal equipment according to the control algorithm configuration file in the storage system when the controller works.
The processor 1006, when calling the modification program of the controller algorithm stored in the memory 1004, also performs the following operations:
acquiring a control algorithm configuration file stored in a storage system;
analyzing the control algorithm configuration file, and obtaining a control instruction according to an analysis result;
processing the control instruction to obtain a processing result;
and outputting the processing result to terminal equipment to control the terminal equipment.
Embodiments of the present invention provide an embodiment of a method for modifying a controller algorithm, and it should be noted that although a logical sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in a sequence different from that shown here, and the method for modifying a controller algorithm is applied to a control device applied to the technical field of industrial control.
As shown in fig. 2, in a first embodiment of the present application, a method for modifying a controller algorithm of the present application includes the steps of:
step S110, receiving a controller algorithm development file, and acquiring an instruction list according to the development file;
step S120, generating a control algorithm configuration file according to the instruction list;
and step S130, analyzing the control algorithm configuration file through an analyzer, and outputting an analysis result to the terminal equipment so as to control the terminal equipment.
In the embodiment, in order to solve the problem that the application scenario of the controller is limited due to the fact that a traditional controller control algorithm cannot be developed or expanded in a self-defined mode, a modification method of the controller algorithm is designed, the method achieves the self-defined development of the control algorithm of the traditional controller, different instruction lists are determined according to different working scenarios, different configuration files are determined according to the instruction lists, and the controller control algorithm is defined according to the configuration files, so that the application scenario of the controller is not limited.
In this embodiment, the file type of the controller algorithm development file includes a ladder diagram or an instruction list, and during the development process, a user can use a standard ladder diagram or an instruction list to develop the controller algorithm, the ladder diagram is a graphic programming voice, and the ladder diagram and the instruction list can directly perform data format conversion; after the development is completed, sending the control algorithm configuration file to the controller, and acquiring an instruction list in the control algorithm configuration file, specifically, the controller algorithm development file can be directly acquired from a cloud, on the cloud, according to a user control requirement, specific development software is adopted for development to generate the controller algorithm development file and store the controller algorithm development file on the cloud, and when an acquisition request of the controller algorithm development file is received, the controller algorithm development file on the cloud is transmitted to the controller, in other embodiments, the controller algorithm development file can also be locally developed and stored in a local database, and in the using process, the controller algorithm development file can be directly acquired; in the application, in order to convert the data format of the instruction list into the data format of the control algorithm configuration file, after the development is completed, if the ladder diagram is used for development, the ladder diagram needs to be converted into the instruction list after the development is completed, and the instruction list is compiled by the compiler and then sent to the controller.
In this embodiment, the control algorithm configuration file is a file for controlling a terminal device, and a data format of the control algorithm configuration file is shown in fig. 7, where the data format includes: a file header 2100 and a data packet 2200, the data packet being a file body; the file header 2100 includes 16 bytes, and the file header includes four portions, which are: the file type, the file version number, the data packet length and the check code, and the following tables respectively list the components of the file header, the number of occupied bytes and the corresponding functions:
constituent parts Number of bytes occupied Function of
File type 4 bytes For a controller to identify a file type
File version number 4 bytes Control algorithm configuration file version number
Packet length 4 bytes Data length for identifying a profile file body
Check code 4 bytes Check code for hash generation of file body
The file body is instruction table data, the maximum length is 2147483647, the data packet 2200 comprises at least one control instruction, and each control instruction comprises an instruction format, an instruction name, an operand type, an operand and a parameter, wherein the instruction format comprises an operation code and an address code, an address of the operand, a storage address of an operation result and an address of a next instruction, the instruction format comprises 2 bytes, and the instruction format is fixed to 0xFBF 1; the instruction comprises 4 bytes, ASCII encoding of the instruction and the instruction corresponding to a standard instruction list; each instruction may correspond to a plurality of different operand types, the operand types including 1 byte, ASCII encoding of the operand types including: x, Y, M, T, C, respectively; each instruction may correspond to a plurality of different operands, the operands comprising 1 byte, the operands representing the numerical portion of a particular operand; each instruction may correspond to a plurality of different parameters, the parameters including 1 byte.
In this embodiment, after the instruction table is obtained, because the data formats of the instruction table and the controller control algorithm configuration file are different, the instruction table needs to be converted into the control algorithm configuration file, specifically, the data format required by the controller control algorithm configuration file is obtained, the data format of the instruction table is converted into the data format required by the controller control algorithm configuration file to realize conversion of the data format of the instruction table, and then the converted controller control algorithm configuration file is transmitted into the controller through the controller input interface.
In this embodiment, after the instruction list is converted into the control algorithm configuration file, the controller stores the control algorithm configuration file in the controller storage system, when the controller works, an algorithm parser inside the controller reads the control algorithm configuration file from the storage system for parsing, and a parsing result is sent to a processor for processing, where the processor may be a single chip microcomputer or an embedded device, and outputs a processing result to the terminal device through an output interface of the controller, so as to control the terminal device.
In the technical scheme of the embodiment, because the controller algorithm development file is received, the development file is converted into the instruction list, the data format of the instruction list is converted into the data format required by the control algorithm configuration file and is stored in the storage system, when the controller works, the control algorithm configuration file is obtained from the storage system and is analyzed to obtain the data of the control algorithm configuration file, the processor is adopted to execute the data of the control algorithm configuration file, the technical scheme of controlling the terminal equipment according to the execution result solves the problem that the control algorithm fixed on the special controller cannot be modified to adapt to different working scenes, and different control algorithm configuration files are configured according to different working scenes to improve the applicability of the special controller.
As shown in fig. 3, in the second embodiment of the present application, steps S111 to S113 in the second embodiment are refinement steps of step S110 in the first embodiment, and include:
step S111, receiving a controller algorithm development file;
step S112, judging the file type of the development file;
and step S113, when the file type of the development file is a ladder diagram, converting the ladder diagram into an instruction list.
In this embodiment, the controller algorithm development file may be directly acquired from a cloud, and on the cloud, according to a user control requirement, specific development software is used for development to generate the controller algorithm development file and store the controller algorithm development file on the cloud, and when an acquisition request of the controller algorithm development file is received, the controller algorithm development file on the cloud is transmitted to the controller, and the controller algorithm development file may also be locally developed and stored in a local database, and in a use process, the controller algorithm development file may be directly acquired.
In this embodiment, because the controller algorithm development file may be any one of an instruction list or a ladder diagram, after receiving the controller algorithm development file, the file type of the controller algorithm development file needs to be determined, and when the file type of the development file is the instruction list, the instruction is directly compiled, and a compiling result is sent to the controller; when the file type of the development file is a ladder diagram, the ladder diagram needs to be converted into a data format of an instruction list, then the converted instruction list is compiled, and a compiling result is sent to a controller.
In the technical scheme of the embodiment, the receiving controller algorithm is adopted to develop the file; judging the file type of the development file; when the file type of the development file is a ladder diagram, the ladder diagram is converted into an instruction list, so that the file type of the development file is converted into the instruction list capable of generating the configuration file.
As shown in fig. 4, in the third embodiment of the present application, steps S121 to S122 in the third embodiment are refinement steps of step S120 in the first embodiment, and include:
step S121, acquiring a control instruction in the instruction list and a data format of the control algorithm configuration file;
step S122, converting the data format of the control instruction based on the data format of the configuration file to obtain the control algorithm configuration file.
In this embodiment, the instruction table includes at least one control instruction, and after the instruction table is obtained, because the instruction table and the controller control algorithm configuration file have different data formats, the instruction table needs to be converted into the control algorithm configuration file, specifically, the control instruction in the instruction table is obtained, and the data format required by the controller control algorithm configuration file is obtained, the data format of the control instruction in the instruction table is converted into the data format required by the controller control algorithm configuration file to modify the data formats of all the control instructions in the instruction table, the control algorithm configuration file is obtained according to the modified control instruction, and then the converted controller control algorithm configuration file is transmitted to the storage system of the controller through the controller input interface to be stored.
In the technical scheme of the embodiment, the control instruction in the instruction list and the data format of the control algorithm configuration file are acquired; converting the data format of the control instruction based on the data format of the configuration file; and according to the technical scheme of obtaining the control algorithm configuration file according to the converted control instruction, modifying the data format of each control instruction in the instruction list into the data format required by the control algorithm configuration file to obtain the control algorithm configuration file of the controller.
As shown in fig. 5, in the fourth embodiment of the present application, steps S1221 to S1222 in the fourth embodiment are the refinement steps of step S122 in the third embodiment, and include:
step S1221, converting the data format of the control instruction based on the data format of the file header to obtain a file body of the control algorithm configuration file;
step S1222, splicing the file header and the file body to obtain the control algorithm configuration file.
In this embodiment, the control instruction in the instruction list includes at least one, the data format of the control algorithm configuration file includes the data format of a file header, the data format of at least one control instruction in the instruction list is converted according to the data format of the file header to obtain a file body corresponding to the corresponding control instruction, and the file bodies of different control instructions and the corresponding file headers are spliced to obtain the control algorithm configuration file. The specific process is as follows: for example, the following instruction tables exist:
instructions Instruction numbering Operand(s)
LD 0x0001 X00
AND 0x0005 X01
OR 0x0007 X02
AND 0x0001 X03
OUT 0x000B Y00
First, the first line instruction "LD X00" is converted: according to the instruction table, the "LD" instruction number is obtained to be "0001", the fixed instruction format is added and can be converted into a hexadecimal message "FAF 10001", the operand type "X" in the operand "X00" is converted into ASCII code "58", the 8-bit reserved field is filled with "00", the "00" is converted into a 2-byte hexadecimal number "0000", and finally the first instruction message is obtained: "FAF 1000158000000";
transition first line instruction "AND X01": obtaining the number of an 'AND' instruction as '0005' according to an instruction table, adding a fixed instruction format AND converting the instruction format into a hexadecimal message 'FAF 10005', converting an operand type 'X' in the operand 'X01' into an ASCII code '58', completing a '00' by using an 8-bit reserved field, converting a '01' into a hexadecimal number '0001' of 2 bytes, AND finally obtaining a first instruction message as follows: "FAF 1000558000001";
translate first line instruction "OR X02": according to the instruction table, the "OR" instruction number is "0007", the fixed instruction format is added and can be converted into a hexadecimal message "FAF 10007", the operand type "X" in the operand "X02" is converted into ASCII code "58", the 8-bit reserved field is filled with "00", the "02" is converted into a 2-byte hexadecimal number "0002", and finally, the first instruction message is obtained: "FAF 1000758000002";
transition first line instruction "AND X03": according to the instruction table, the "LD" instruction number is obtained to be "0001", the added fixed instruction format can be converted into a hexadecimal message "FAF 10001", the operand type "X" in the operand "X03" is converted into an ASCII code "58", the 8-bit reserved field is filled with "00", the "01" is converted into a 2-byte hexadecimal number "0003", and finally the first instruction message is obtained: "FAF 1000158000003";
transition first line instruction "OUT Y00": according to the instruction table, the number of the "OUT" instruction is "000B", the addition of a fixed instruction format can be converted into a hexadecimal message "FAF 1000B", the operand type "Y" in the operand "Y00" is converted into ASCII code "59", the 8-bit reserved field is filled with "00", the "00" is converted into a 2-byte hexadecimal number "0000", and finally, the first instruction message is obtained: "FAF 1000B 59000000";
the file body content for splicing the instructions and obtaining the configuration file is as follows: FAF1000158000000FAF1000558000001FAF1000758000002FAF1000158000003FAF1000B59000000
Then, the data format of the header may be expressed as: adding a fixed file type identifier: "00000001"; add configuration file version numbers, for example: "00000001"; and calculating the data length (calculated by hexadecimal digits) of the file body according to the content of the file body: "00000050"; and (3) generating a check code by using a CRC-32 algorithm mode: "BA 75D 41F", splicing the above components of the header to obtain: 000000010000000100000050BA75D 41F;
and finally, splicing the file header and the file body to obtain a final configuration file: 000000010000000100000050BA75D41FFAF1000158000000FAF1000558000001FAF1000758000002FAF1000158000003FAF1000B 59000000.
In the technical scheme of this embodiment, the data format of the instruction list is converted into the data format of the control algorithm configuration file, and the converted file header and the converted file body are spliced to obtain the control algorithm configuration file.
The following is a fifth embodiment of the present application, and step S210 in the fifth embodiment is located after step S120 in the first embodiment, and includes:
step S210, storing the control algorithm configuration file in a storage system of the controller, so that when the controller works, the terminal equipment is controlled according to the control algorithm configuration file in the storage system.
In this embodiment, after converting the data format of the control instruction in the instruction table into the data format required by the control algorithm configuration file, obtaining the converted control algorithm configuration file, and transmitting the control algorithm configuration file to a storage system of the controller through an input interface of the controller for storage, where the storage system is located inside the controller and connected to the input interface of the controller, and the storage system may store other data besides the control algorithm configuration file; and when the controller works, processing the control algorithm configuration file in the storage system to realize the control of the terminal equipment according to the control algorithm configuration file in the storage system.
In the technical solution of this embodiment, the method and the device for controlling the terminal device are used for storing the control algorithm configuration file in the storage system of the controller, so as to obtain the control algorithm configuration file from the storage system to control the terminal device when the controller works.
As shown in fig. 6, in the sixth embodiment of the present application, steps S131 to S134 in the sixth embodiment of the present application are located after step S210 in the fifth embodiment, and include:
step S131, acquiring a control algorithm configuration file stored in a storage system;
step S132, analyzing the control algorithm configuration file, and obtaining a control instruction according to an analysis result;
step S133, processing the control instruction to obtain a processing result;
and step S134, outputting the processing result to the terminal equipment so as to control the terminal equipment.
In this embodiment, the obtaining of the control algorithm configuration file stored in the storage system may be to obtain the control algorithm configuration file when a power-on instruction work instruction of the controller is received, and when the power-on instruction work instruction of the controller is received, an algorithm parser inside the controller reads the control algorithm configuration file from the storage system to parse the control algorithm configuration file, and sends a parsing result to a processor inside the controller to process the parsing result, where the processor may be a single chip microcomputer, an embedded device, or another processing device, and the processor transmits a processing result to the terminal device through an output interface of the controller, so as to control the terminal device according to the control algorithm configuration file in the storage system; in the application, the control actions corresponding to different control algorithm configuration files are different, and different control actions and control effects can be realized by setting the control instructions in the instruction list, for example, when the control instructions in the instruction list are movement instructions, the corresponding control actions are used for controlling the terminal device to move.
In the technical scheme of the embodiment, the control algorithm configuration file stored in the storage system is acquired; analyzing the control algorithm configuration file, and obtaining a control instruction according to an analysis result; processing the control instruction to obtain a processing result; and outputting the processing result to the terminal equipment to control the terminal equipment, thereby realizing different control of the terminal equipment according to different control algorithm configuration files.
The system specific implementation of the modification of the controller algorithm of the present invention is basically the same as the embodiments of the modification method of the controller algorithm described above, and is not described herein again.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for modifying a controller algorithm, the method comprising:
receiving a controller algorithm development file, and acquiring an instruction list according to the development file;
generating a control algorithm configuration file according to the instruction list;
and analyzing the control algorithm configuration file through an analyzer, and outputting an analysis result to terminal equipment so as to control the terminal equipment.
2. The method for modifying a controller algorithm according to claim 1, wherein the step of receiving a controller algorithm development file and obtaining an instruction list based on the development file comprises:
receiving a controller algorithm development file;
judging the file type of the development file;
and when the file type of the development file is a ladder diagram, converting the ladder diagram into an instruction list.
3. The method of modifying a controller algorithm of claim 1, wherein the control algorithm profile comprises: a file header and a file body; the file header comprises a file type, a file version number, a data packet length and a check code; the file body comprises at least one control instruction, and the components of each control instruction comprise an instruction format, an instruction name, an operand type, an operand and a parameter.
4. A method of modifying a controller algorithm according to claim 3, wherein the step of generating a control algorithm profile from the instruction list comprises:
acquiring a control instruction in the instruction list and a data format of the control algorithm configuration file;
and converting the data format of the control instruction based on the data format of the configuration file to obtain the control algorithm configuration file.
5. The method of modifying a controller algorithm of claim 4, wherein the data format of the control algorithm configuration file comprises the data format of the header; the step of converting the data format of the control instruction based on the data format of the configuration file to obtain the control algorithm configuration file comprises:
converting the data format of the control instruction based on the data format of the file header to obtain a file body of the control algorithm configuration file;
and splicing the file header and the file body to obtain the control algorithm configuration file.
6. The method of modifying a controller algorithm of claim 1, wherein said step of generating a control algorithm configuration file from said instruction list is followed by:
and storing the control algorithm configuration file in a storage system of the controller so as to control the terminal equipment according to the control algorithm configuration file in the storage system when the controller works.
7. The method for modifying a controller algorithm according to claim 6, wherein the step of parsing the control algorithm configuration file by a parser and outputting the parsed result to a terminal device to control the terminal device comprises:
acquiring a control algorithm configuration file stored in a storage system;
analyzing the control algorithm configuration file, and obtaining a control instruction according to an analysis result;
processing the control instruction to obtain a processing result;
and outputting the processing result to terminal equipment to control the terminal equipment.
8. A computer program product, characterized in that the computer program product comprises a modification program of a controller algorithm, which when executed by a processor implements the steps of the modification method of the controller algorithm according to any one of claims 1-7.
9. A control apparatus, characterized in that the control apparatus comprises: memory, a processor and a modification program of a controller algorithm stored on the memory and executable on the processor, which when executed by the processor implements the steps of the method of modifying a controller algorithm according to any of claims 1-7.
10. A storage medium, characterized in that a modification program of a controller algorithm is stored thereon, which when executed by a processor implements the steps of the modification method of the controller algorithm of any one of claims 1-7.
CN202110702856.3A 2021-06-23 2021-06-23 Method, apparatus, computer program product and medium for modifying controller algorithm Active CN113342738B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110702856.3A CN113342738B (en) 2021-06-23 2021-06-23 Method, apparatus, computer program product and medium for modifying controller algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110702856.3A CN113342738B (en) 2021-06-23 2021-06-23 Method, apparatus, computer program product and medium for modifying controller algorithm

Publications (2)

Publication Number Publication Date
CN113342738A true CN113342738A (en) 2021-09-03
CN113342738B CN113342738B (en) 2022-09-02

Family

ID=77478237

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110702856.3A Active CN113342738B (en) 2021-06-23 2021-06-23 Method, apparatus, computer program product and medium for modifying controller algorithm

Country Status (1)

Country Link
CN (1) CN113342738B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568365A (en) * 2021-09-22 2021-10-29 蘑菇物联技术(深圳)有限公司 Method of controlling industrial controller, computing device and computer storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103218349A (en) * 2013-03-08 2013-07-24 广东工业大学 Reading and conversion method for PLC (Programmable Logic Controller) instruction storage rule in PMW-format file
CN104460490A (en) * 2014-11-12 2015-03-25 深圳市英威腾电气股份有限公司 Programmable logic control processing method of frequency converter, digital processor and frequency converter
CN110989487A (en) * 2019-12-23 2020-04-10 北京东土科技股份有限公司 PLC initialization method and device for industrial server and readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103218349A (en) * 2013-03-08 2013-07-24 广东工业大学 Reading and conversion method for PLC (Programmable Logic Controller) instruction storage rule in PMW-format file
CN104460490A (en) * 2014-11-12 2015-03-25 深圳市英威腾电气股份有限公司 Programmable logic control processing method of frequency converter, digital processor and frequency converter
CN110989487A (en) * 2019-12-23 2020-04-10 北京东土科技股份有限公司 PLC initialization method and device for industrial server and readable storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
孙勤等: "PLC开发平台的研究及实现", 《现代制造工程》 *
张小亮等: "基于μC/OSⅡ-的软PLC研究与实现", 《机床与液压》 *
练淼森: "分析嵌入式软PLC编程系统的设计", 《数字技术与应用》 *
韩兵兵: ""PLC梯形图编程系统研究与实现"", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568365A (en) * 2021-09-22 2021-10-29 蘑菇物联技术(深圳)有限公司 Method of controlling industrial controller, computing device and computer storage medium

Also Published As

Publication number Publication date
CN113342738B (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN111404883B (en) Method and device for analyzing Internet of things equipment universal protocol
CN112153048B (en) Information analysis method, information analysis device, information analysis system, storage medium, and electronic device
CN107450899B (en) Method and device for generating terminal control script
CN111683066A (en) Heterogeneous system integration method and device, computer equipment and storage medium
CN108376078A (en) Upgrade method, device and the household appliance of equipment
CN110719296B (en) Method for automatically analyzing message data in terminal communication protocol
CN108322437B (en) Adaptive communication method and device for multiple protocol devices
CN113342738B (en) Method, apparatus, computer program product and medium for modifying controller algorithm
CN110647490A (en) Data transmission method, device, equipment and computer storage medium
CN111061678A (en) Service data processing method and device, computer equipment and storage medium
CN115277882B (en) CAN message database establishment method and device, vehicle-mounted electronic equipment and storage medium
CN111369237B (en) Data processing method and device and computer storage medium
CN114331416A (en) Data processing method and device, electronic equipment and storage medium
CN103378994A (en) Method and terminal for testing communication equipment
CN110098959B (en) Industrial control protocol interactive behavior modeling method, device, system and storage medium
CN112929331B (en) Universal communication protocol implementation method
CN101197959B (en) Terminal control method, system and equipment
CN115903733A (en) Remote diagnosis method for vehicle, server, terminal and storage medium
CN112367234B (en) Simulation data generation method, terminal device and computer-readable storage medium
CN114330246A (en) Universal data stream analyzing method and system
CN106789515B (en) Data transmission method and device
CN113438226A (en) Message generating and analyzing method, device and system based on hybrid transmission protocol
CN115037514B (en) Hash algorithm-based efficient data integrity verification method
CN115567495A (en) Instruction block loading system and method based on software defined network
CN114866530A (en) Method and apparatus for downloading upgrade data package, and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: No. 118, Building C1, No.1 Qingsheng Avenue, Nansha District, Guangzhou City, Guangdong Province, 511455

Patentee after: Guangdong Mushroom IoT Technology Co.,Ltd.

Country or region after: China

Address before: 518110 room 2202, building 1, Huide building, Beizhan community, Minzhi street, Longhua District, Shenzhen, Guangdong

Patentee before: MOGULINKER TECHNOLOGY (SHENZHEN) CO.,LTD.

Country or region before: China