CN113204381A - Instruction file generation method, instruction file generation device, machine equipment and storage medium - Google Patents

Instruction file generation method, instruction file generation device, machine equipment and storage medium Download PDF

Info

Publication number
CN113204381A
CN113204381A CN202110513766.XA CN202110513766A CN113204381A CN 113204381 A CN113204381 A CN 113204381A CN 202110513766 A CN202110513766 A CN 202110513766A CN 113204381 A CN113204381 A CN 113204381A
Authority
CN
China
Prior art keywords
instruction
file
sub
instruction file
group
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.)
Pending
Application number
CN202110513766.XA
Other languages
Chinese (zh)
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.)
Shenzhen Xinghuo Cnc Co ltd
Original Assignee
Shenzhen Xinghuo Cnc 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 Shenzhen Xinghuo Cnc Co ltd filed Critical Shenzhen Xinghuo Cnc Co ltd
Priority to CN202110513766.XA priority Critical patent/CN113204381A/en
Publication of CN113204381A publication Critical patent/CN113204381A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/22Procedural

Abstract

The invention discloses a machine instruction file generation method, a program, machine equipment and a storage medium, wherein the instruction file generation method is applied to an electric control system of the machine equipment, the electric control system of the machine equipment is used for carrying out character modification on the parameter expression of a preset electric control instruction, and the electric control instruction subjected to the character modification is stored to a source instruction library to be used as a sub-instruction of the source instruction library; acquiring an instruction file to be generated and a first instruction configuration operation, and adding the sub-instructions to each instruction group of the instruction file to be generated according to the first instruction configuration operation; and encrypting the instruction file to be generated and storing the instruction file as an instruction file with a preset data format. The invention reduces the coupling between the equipment manufacturer and the electric control system manufacturer, shortens the equipment manufacturing and software program research and development period, and improves the efficiency of equipment production and software design.

Description

Instruction file generation method, instruction file generation device, machine equipment and storage medium
Technical Field
The present invention relates to the field of electronic control programs, and in particular, to a method and an apparatus for generating an instruction file, a machine device, and a storage medium.
Background
In the field of industrial control equipment, with the rapid development of industrial automation, the diversity requirements of users require different types of industrial equipment to meet the diversified requirements, so that equipment manufacturers need to research and develop various types of machine equipment.
Aiming at the machine equipment required by the current user, the research and development modes mainly adopted by manufacturers mainly comprise two modes: firstly, a multi-electric control combination mode (Programmable Logic Controller (PLC) + "motion control electric control system") is adopted, and secondly, a special electric control system mode is adopted. The first mode adopts multi-electric control combination to meet the requirements of related processes, so that a plurality of electric control systems and communication and action coordination among different electric controls need to be purchased, the equipment research and development cost is increased, the coordination and debugging among the plurality of electric control systems are complex and difficult, and the research and development period of machine equipment is long; in the second mode, dedicated electronic control systems are developed for different types of machine equipment, so that the different types of machine equipment use one electronic control system, and in addition, if there is a difference in action or delay time between different machine equipment, the electronic control systems need to be developed separately for the difference, so that the mode causes many versions of the electronic control systems used by the machine equipment daily, and the difficulty in later-stage management and maintenance is high.
In summary, the research and development mode of the electric control system of the existing machine equipment has complex debugging process and higher difficulty, needs longer research and development period, is inconvenient for later operation and maintenance, and has low overall research and development efficiency.
Disclosure of Invention
The invention mainly aims to provide a method and a device for generating an instruction file, machine equipment and a storage medium, and aims to solve the technical problems that the existing electric control system of the machine equipment is complex in research and development mode, complex in debugging process and high in difficulty, needs a long research and development period, is inconvenient for later operation and maintenance, and is low in overall research and development efficiency.
In order to achieve the above object, the present invention provides a method for generating an instruction file, the method being applied to an electronic control system of a machine device, the method comprising:
carrying out character modification on the parameter expression of a preset electric control instruction, and storing the electric control instruction subjected to character modification into a source instruction library to be used as a sub-instruction of the source instruction library;
acquiring an instruction file to be generated and a first instruction configuration operation, and adding the sub-instructions to each instruction group of the instruction file to be generated according to the first instruction configuration operation;
and encrypting the instruction file to be generated and storing the instruction file as an instruction file with a preset data format.
Further, the first instruction configuration operation comprises: a first determine group of instructions operation, a first determine sub-instruction operation, and a first add sub-instruction operation,
the step of adding the sub-instruction to each instruction group of the instruction file to be generated according to the first instruction configuration operation includes:
determining an instruction group to be edited according to the first determination instruction group operation;
determining the sub-instruction from within the source instruction library according to the first determining sub-instruction operation;
and adding the sub-instruction to the instruction group to be edited according to the first adding sub-instruction operation.
Further, after the step of obtaining the instruction file to be generated and the first instruction configuration operation and adding the sub-instruction to each instruction group of the instruction file to be generated according to the first instruction configuration operation, the method further includes:
acquiring second instruction configuration operation, determining an instruction group to be modified according to the second instruction configuration operation, and modifying the sub-instructions in the instruction group to be modified;
the second instruction configuration operation comprises: a second determining sub-instruction operation and a first modifying sub-instruction operation,
the step of modifying the sub-instructions in the instruction group to be modified includes:
determining a first sub instruction to be modified in the instruction group to be modified according to the second determination sub instruction operation;
and modifying the parameters of the first sub-instruction to be modified according to the first modifying sub-instruction operation.
Further, the step of encrypting the instruction file to be generated and saving the encrypted instruction file as the instruction file in the preset data format includes:
implanting preset file information into the instruction file to be generated;
and recoding the instruction file to be generated implanted with the preset file information, and storing the instruction file in a preset data format.
Further, after the step of encrypting the instruction file to be generated and saving the encrypted instruction file as the instruction file in the preset data format, the method further includes:
reading and decrypting the instruction file;
acquiring third instruction configuration operation, determining a first instruction group in the instruction file according to the third instruction configuration operation, and modifying the sub-instructions in the first instruction group;
the third instruction configuration operation comprises: a third determining sub-instruction operation and a second modifying sub-instruction operation,
the step of modifying for sub-instructions in the first instruction group comprises:
determining a second sub instruction to be modified in the first instruction group according to the third determination sub instruction operation;
and modifying the parameters of the second sub-instruction to be modified according to the second modifying sub-instruction operation.
Further, the step of reading and decrypting the instruction file includes:
reading the instruction file and decoding the instruction file;
judging whether file information in the instruction file is matched with preset information or not;
if yes, analyzing and extracting the instruction group in the instruction file and the sub-instructions in the instruction group.
Further, after the step of determining whether the file information in the instruction file matches the preset information, the method further includes:
if not, the analysis operation of the instruction file is terminated.
In addition, in order to achieve the above object, the present invention provides an instruction file generating apparatus, which is applied to an electronic control system of a machine device, the instruction file generating apparatus including:
the modification storage module is used for carrying out character modification on the parameter expression of a preset electric control instruction and storing the electric control instruction subjected to the character modification to a source instruction library to be used as a sub-instruction of the source instruction library;
the acquisition modification module is used for acquiring an instruction file to be generated and first instruction configuration operation, and adding the sub-instructions to each instruction group of the instruction file to be generated according to the first instruction configuration operation;
and the encryption storage module is used for encrypting the instruction file to be generated and storing the instruction file into an instruction file with a preset data format.
Further, to achieve the above object, the present invention also provides a machine apparatus including: the computer program product comprises a memory, a processor and an instruction file generating program stored on the memory and capable of running on the processor, wherein the instruction file generating program realizes the steps of the instruction file generating method as described above when being executed by the processor.
In order to achieve the above object, the present invention further provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the instruction file generating method as described above.
The invention provides an instruction file generation method, an instruction file generation device, machine equipment and a storage medium, wherein a parameter expression of a preset electric control instruction is subjected to character modification through an electric control system of the machine equipment, and the electric control instruction subjected to character modification is stored to a source instruction library to be used as a sub-instruction of the source instruction library; acquiring an instruction file to be generated and a first instruction configuration operation, and adding the sub-instructions to each instruction group of the instruction file to be generated according to the first instruction configuration operation; and encrypting the instruction file to be generated and storing the instruction file as an instruction file with a preset data format.
In the process of generating the instruction file, the electric control system of the machine equipment performs text modification on the parameter expression of the electric control instruction in a form, stores the electric control instruction subjected to text modification in a source instruction library in the electric control system of the machine equipment as a sub-instruction for standby, acquires a blank instruction file to be generated, adds the sub-instruction in the source instruction library to each instruction group of the instruction file to be generated according to instruction configuration operation of a user, encrypts the instruction file to be generated, and stores the encrypted instruction file as the instruction file in a preset data format.
Compared with the existing electric control system program, the method and the device can enable a user to well understand and apply the software programming function on the premise of not learning or having a professional software programming technology, can quickly edit and generate the instruction file to be applied to the equipment electric control system according to the actual process flow requirement, are convenient and quick to operate, reduce the coupling between equipment manufacturers and the electric control system manufacturers, shorten the equipment manufacturing and software program research and development period, and improve the efficiency of equipment production and software design.
Drawings
Fig. 1 is a schematic structural diagram of a hardware operating environment of a machine device according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first exemplary embodiment of a method for generating an instruction file according to the present invention;
FIG. 3 is a schematic diagram illustrating an application flow of an embodiment of a method for generating an instruction file according to the present invention;
FIG. 4 is a schematic diagram of another application flow of an embodiment of a method for generating an instruction file according to the present invention;
FIG. 5 is a schematic diagram of another application flowchart of an embodiment of a method for generating an instruction file according to the present invention;
fig. 6 is a schematic block diagram of an instruction file generating apparatus 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
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a hardware operating environment related to a machine device according to an embodiment of the present invention.
Fig. 1 is a schematic structural diagram of a hardware operating environment of a machine device. The machine equipment of the embodiment of the invention can be machine equipment, such as other small embedded equipment like sewing equipment.
As shown in fig. 1, the machine device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the machine configuration shown in fig. 1 does not constitute a limitation of the machine, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a distributed task processing program. Among other things, the operating system is a program that manages and controls the hardware and software resources of the sample machine device, a handler that supports distributed tasks, and the execution of other software or programs.
In the equipment device shown in fig. 1, the user interface 1003 is mainly used for data communication with each terminal; the network interface 1004 is mainly used for connecting a background server and performing data communication with the background server; and the processor 1001 may be configured to call the instruction file generation program stored in the memory 1005 and perform the following operations:
carrying out character modification on the parameter expression of a preset electric control instruction, and storing the electric control instruction subjected to character modification into a source instruction library to be used as a sub-instruction of the source instruction library;
acquiring an instruction file to be generated and a first instruction configuration operation, and adding the sub-instructions to each instruction group of the instruction file to be generated according to the first instruction configuration operation;
and encrypting the instruction file to be generated and storing the instruction file as an instruction file with a preset data format.
Further the first instruction configuration operation comprises: the first determination instruction group operation, the first determination sub-instruction operation, and the first add sub-instruction operation, the processor 1001 may call the instruction file generation program stored in the memory 1005, and further perform the following operations:
determining an instruction group to be edited according to the first determination instruction group operation;
determining the sub-instruction from within the source instruction library according to the first determining sub-instruction operation;
and adding the sub-instruction to the instruction group to be edited according to the first adding sub-instruction operation.
Further, the processor 1001 may call an instruction file generating program stored in the memory 1005, and after the step of acquiring the instruction file to be generated and the first instruction configuration operation, and adding the sub-instruction to each instruction group of the instruction file to be generated according to the first instruction configuration operation, further perform the following operations:
acquiring second instruction configuration operation, determining an instruction group to be modified according to the second instruction configuration operation, and modifying the sub-instructions in the instruction group to be modified;
the second instruction configuration operation comprises: a second determining sub-instruction operation and a first modifying sub-instruction operation,
the step of modifying the sub-instructions in the instruction group to be modified includes:
determining a first sub instruction to be modified in the instruction group to be modified according to the second determination sub instruction operation;
and modifying the parameters of the first sub-instruction to be modified according to the first modifying sub-instruction operation.
Further, the processor 1001 may call an instruction file generation program stored in the memory 1005, and also perform the following operations:
implanting preset file information into the instruction file to be generated;
and recoding the instruction file to be generated implanted with the preset file information, and storing the instruction file in a preset data format.
Further, the processor 1001 may call an instruction file generating program stored in the memory 1005, and after the step of encrypting and saving the instruction file to be generated into an instruction file in a preset data format, further perform the following operations:
reading and decrypting the instruction file;
acquiring third instruction configuration operation, determining a first instruction group in the instruction file according to the third instruction configuration operation, and modifying the sub-instructions in the first instruction group;
the third instruction configuration operation comprises: a third determining sub-instruction operation and a second modifying sub-instruction operation,
the step of modifying for sub-instructions in the first instruction group comprises:
determining a second sub instruction to be modified in the first instruction group according to the third determination sub instruction operation;
and modifying the parameters of the second sub-instruction to be modified according to the second modifying sub-instruction operation.
Further, the processor 1001 may call an instruction file generation program stored in the memory 1005, and also perform the following operations:
reading the instruction file and decoding the instruction file;
judging whether file information in the instruction file is matched with preset information or not;
if yes, analyzing and extracting the instruction group in the instruction file and the sub-instructions in the instruction group.
Further, the processor 1001 may call an instruction file generating program stored in the memory 1005, and after the step of determining whether the file information in the instruction file matches with the preset information, further perform the following operations:
if not, the analysis operation of the instruction file is terminated.
Based on the above structure, embodiments of the instruction file generation method of the present invention are provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for generating an instruction file according to a first embodiment of the present invention.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different than that shown.
The method for generating the instruction file is applied to an electric control system of the machine equipment, and comprises the following steps:
and S100, performing character modification on the parameter expression of the preset electric control instruction, and storing the electric control instruction subjected to character modification into a source instruction library to be used as a sub-instruction of the source instruction library.
It should be noted that, in this embodiment, the preset electronic control instruction is an electronic control instruction preset and formed in an electronic control system by an equipment manufacturer, and specifically, for example, the preset electronic control instruction may specifically be an electronic control instruction that outputs an IOA, a single-axis movement, a multi-axis reset, and the like.
The electric control system of the machine equipment performs character modification on a preset parameter expression form of the electric control instruction so as to enable the parameter expression of the electric control instruction to be in a Chinese form, and stores the electric control instruction subjected to character modification to a source instruction library of the electric control system of the machine equipment to be used as a sub-instruction of the source instruction library for standby.
Specifically, for example, the electronic control system of the machine equipment expresses the instruction name of the "output IOA" instruction and related parameters (such as IO number, level state, execution mode, and the like) included in the instruction in a chinese form, and stores the "output IOA" instruction to a source instruction library of the electronic control system of the machine equipment as a sub-instruction of the source instruction library for standby.
Step S200, obtaining an instruction file to be generated and a first instruction configuration operation, and adding the sub-instructions to each instruction group of the instruction file to be generated according to the first instruction configuration operation.
The machine equipment electric control system obtains an instruction file to be generated and a first instruction configuration operation triggered by a user, determines an instruction group to be edited according to the first instruction configuration operation, determines a sub-instruction from a source instruction library, and adds the determined sub-instruction to the instruction group to be edited to generate the instruction file.
Further, as shown in the application flow of fig. 3, in an embodiment, the first instruction configuration operation includes: in the step S200, "add the sub-instruction to each instruction group of the instruction file to be generated according to the first instruction configuration operation" may include:
step S201, determining an instruction group to be edited according to the first instruction group determining operation.
And the machine equipment electronic control system determines an instruction group to be edited according to a first determination instruction group operation triggered by a user.
Specifically, for example, when a user edits and generates an instruction file through a front-end display screen based on a user graphical interface displayed by an electronic control system, if the user needs to add a sub-instruction to a "powered-up" instruction group of the instruction file to be generated currently, the electronic control system determines that a first determined instruction group operation triggered by the user is received when detecting a selection control of the user based on the "powered-up" instruction group displayed in the user graphical interface, and determines that the "powered-up" instruction group corresponding to the selection control is the instruction group to be edited to which the sub-instruction is to be added when the user edits the instruction file to be generated currently.
Step S202, determining the sub-instruction from the source instruction library according to the first determination sub-instruction operation.
And the machine equipment electronic control system determines the sub-instruction which needs to be added to the instruction group to be edited from the source instruction library according to the first determination sub-instruction operation triggered by the user.
Specifically, for example, when a user edits a generated instruction file through a front-end display screen based on a user graphical interface displayed by an electronic control system, if the user needs to add an "output IOA" instruction to a "powered-up" instruction group of the instruction file to be generated, the electronic control system determines that a first determination sub-instruction operation triggered by the user is received when detecting a selection control of the "output IOA" instruction displayed by the user based on a source instruction library in the user graphical interface, and determines that the "output IOA" instruction corresponding to the selection control is a sub-instruction that needs to be added to the "powered-up" instruction group from the source instruction library when the user edits the instruction file to be generated.
Step S203, adding the sub-instruction to the instruction group to be edited according to the first adding sub-instruction operation.
And the machine equipment electric control system adds the sub-instruction in the source instruction library to the instruction group to be edited according to the first adding sub-instruction operation triggered by the user.
Specifically, for example, when a user edits a generated instruction file through a front-end display screen based on a user graphical interface displayed by an electronic control system, if the user needs to add an "output IOA" instruction to a "powered-up" instruction group of the instruction file to be generated at present, the electronic control system determines that a first addition sub-instruction operation triggered by the user is received when detecting an addition control of the user based on the "output IOA" instruction shown in the user graphical interface, and adds the "output IOA" corresponding to the addition control to the "powered-up" instruction group of the instruction file to be generated at present from a source instruction library.
And step S300, encrypting the instruction file to be generated and saving the instruction file as an instruction file with a preset data format.
It should be noted that, in this embodiment, the original data of the instruction file to be generated belongs to plaintext data, and a specific data protocol is visual; when the original data of the instruction file to be generated is encrypted, the data of the instruction file to be generated is presented in a chaotic form, and if the instruction file to be generated is not decrypted by a specific encryption algorithm, the data of the instruction file to be generated cannot be identified. In addition, the preset data format is a preset fixed data format, and the fixed data format may be specifically ". xhc".
And the electronic control system of the machine equipment encrypts the instruction file to be generated and stores the encrypted instruction file to be generated into an instruction file of xhc in a preset fixed data format.
Specifically, for example, the electronic control system of the machine equipment encrypts the instruction file to be generated so as to convert the instruction file from a plain code form to a messy code form for representation, and stores the encrypted instruction file to be generated as an instruction file of xhc in a preset fixed data format.
According to the invention, by encrypting the instruction file to be generated, the situation that the labor achievement can not be guaranteed because the plaintext data in the instruction file to be generated is easily identified and applied by a competitor is avoided; meanwhile, when the electrical control system of the machine equipment reuses the data after decoding and checking, whether the instruction file is damaged or modified by external persons can be identified.
Further, as shown in the application flow of fig. 4, in a possible embodiment, the step S300 may include:
step S301, implanting preset file information into the instruction file to be generated.
And the machine equipment electric control system implants the preset file information which is automatically generated corresponding to the instruction file to be generated into the instruction file to be generated.
It should be noted that preset file information is file information which is automatically generated by the electronic control system and corresponds to the instruction file to be generated, aiming at the instruction file to be generated, and the file information comprises a file header identifier, a file size, a file version, a company identifier and a file check code value; specifically, the file header identifier may be an identifier value XCF _ START, the company identifier may be a character value XHCNCWKCMD, and the file check code value may be an accumulated value and an exclusive or value of data of the instruction file to be generated.
Specifically, for example, the electrical control system of the machine equipment automatically generates an identification value XCF _ START, a file size, a file version, a character value XHCNCWKCMD, and an accumulated value and an exclusive or value of data of the instruction file to be generated, which correspond to the instruction file to be generated, and implants the generated instruction file.
Step S302, recoding the instruction file to be generated after the preset file information is implanted, and saving the recoded instruction file as an instruction file in a preset data format.
The machine equipment electric control system generates a dynamic key value for the instruction file to be generated after the preset file information is implanted, traverses all data of the instruction file to be generated, performs calculation shift, exclusive OR, check operation and the like to perform recoding encryption, and stores the encrypted instruction file to be generated as an instruction file with a preset fixed data format.
It should be noted that the principle of generating the dynamic key value is to generate a random number key value by using a system random function rand, and then the key value is xored with the current system time conversion number (day, hour, minute, second and millisecond, alternatively spliced into a 4-byte value) to obtain a new key value again.
Specifically, for example, the machine equipment electronic control system generates a dynamic key value for an instruction file to be generated after embedding preset file information, then mutually exchanges and shifts all instruction data of the instruction file to be generated according to a single byte, calculates a data accumulated value every 4 bytes, then carries out an exclusive or operation on every 4 bytes of the instruction data and the dynamic key value, then mutually exchanges and shifts the instruction data according to double bytes, calculates an exclusive or value every 2 bytes, and finally stores the instruction file to be generated as an instruction file of xhc in a preset fixed data format.
In the embodiment, a parameter expression form of a preset electric control instruction is subjected to character modification through a machine equipment application program so that the parameter expression of the electric control instruction is in a Chinese form, and the electric control instruction subjected to character modification is stored in a source instruction library of an electric control system of machine equipment and is used as a sub-instruction of the source instruction library for standby; the method comprises the steps that an electronic control system of the machine equipment obtains an instruction file to be generated and first instruction configuration operation triggered by a user, and sub-instructions of a source instruction library are added to each instruction group of the instruction file to be generated according to the first instruction configuration operation; and the electronic control system of the machine equipment encrypts the instruction file to be generated and stores the encrypted instruction file to be generated as an instruction file with a preset fixed data format.
The invention can enable a user to well understand and apply the software programming function without learning or having a professional software programming technology, can quickly edit and generate the instruction file to be applied to the equipment electric control system according to the actual process flow requirement, is convenient and quick to operate, reduces the coupling between an equipment manufacturer and an electric control system manufacturer, shortens the equipment manufacturing and software program research and development period, and improves the efficiency of equipment production and software design.
Further, a second embodiment of the instruction file generating method of the present invention is proposed based on the first embodiment of the instruction file generating method described above.
In the second embodiment of the instruction file generating method of the present invention, after the step S200, the method further includes:
step A, obtaining a second instruction configuration operation, determining an instruction group to be modified according to the second instruction configuration operation, and modifying the sub-instructions in the instruction group to be modified.
And the machine equipment electric control system determines an instruction group to be modified in the instruction file to be generated according to second instruction configuration operation triggered by a user, and modifies parameters aiming at the sub-instructions in the instruction group to be modified.
Further, in a possible embodiment, the second instruction configuration operation includes: in the step a, the step of modifying the sub instruction in the instruction group to be modified may include:
step a1, determining a first sub-instruction to be modified in the instruction group to be modified according to the second determining sub-instruction operation.
And the machine equipment electric control system determines a first sub-instruction to be modified in the instruction group to be modified according to the second determination sub-instruction operation triggered by the user.
Specifically, for example, when a user edits a generated instruction file through a user graphical interface displayed by a front-end display screen based on an electronic control system, if the user currently needs to modify an "output IOA" instruction in a "powered-on" instruction group of the instruction file to be generated, the electronic control system determines that a second determination sub-instruction operation triggered by the user is received when detecting a selection control of the user based on the "output IOA" instruction in the "powered-on" instruction group displayed in the user graphical interface, and determines that the "output IOA" instruction corresponding to the selection control is a first sub-instruction to be modified when the user edits the instruction file to be generated currently.
Step A2, modifying the parameter of the first sub-instruction to be modified according to the first modifying sub-instruction operation.
And the machine equipment electric control system modifies parameters aiming at the first sub-instruction to be modified in the instruction group to be modified according to the first modification sub-instruction operation triggered by the user.
Specifically, for example, when a user edits a generated instruction file through a user graphical interface displayed by a front-end display screen based on an electronic control system, if the user currently needs to modify an "output IOA" instruction in a "powered-on" instruction group of the instruction file to be generated, the electronic control system determines that a first modification sub-instruction operation triggered by the user is received based on a modification control of the "output IOA" instruction in the "powered-on" instruction group shown in the user graphical interface, and modifies relevant parameters (such as an IO number, a level state, an execution mode, and the like) of the corresponding "output IOA" instruction in the "powered-on" instruction group according to the modification control.
In this embodiment, a to-be-modified instruction group is determined in an instruction file to be generated by a machine device electronic control system according to a second instruction configuration operation triggered by a user, and a parameter is modified for a sub-instruction in the to-be-modified instruction group.
The method and the device realize that the parameters of the sub-instructions of the instruction group in the instruction file to be generated can be modified according to actual requirements by a user in the editing process of the instruction file to be generated, so that the requirements of process production can be better met when the machine equipment executes the instruction file.
Further, as an application flow shown in fig. 5, a third embodiment of the instruction file generation method according to the present invention is proposed based on the first embodiment of the instruction file generation method.
In a third embodiment of the instruction file generating method of the present invention, after step S300, the method further includes:
and step S400, reading and decrypting the instruction file.
The machine equipment electric control system reads the existing instruction file and decrypts the instruction file so as to convert the data of the instruction file from a messy code form to a clear code form for representation.
Further, in a possible embodiment, the step S400 may include:
step S401, reading the instruction file and decoding the instruction file.
The machine equipment electric control system reads the existing instruction file and decodes the instruction file to enable the instruction file to reach a state of being capable of being read.
Step S402, judging whether the file information in the instruction file is matched with preset information.
And the machine equipment electric control system judges whether the pre-implanted file information in the instruction file is matched with the preset information in the machine equipment electric control system.
Specifically, for example, the machine-equipment electronic control system identifies the pre-embedded file information included in the instruction file, such as the identification value XCF _ START, the file size, the file version, the character value XHCNCWKCMD, and the accumulated value and the exclusive or value of the data of the instruction file to be generated, and determines whether the pre-embedded file information matches the preset information in the machine-equipment electronic control system.
Step S403, if yes, analyzing and extracting the instruction group in the instruction file and the sub-instruction in the instruction group.
If the pre-implanted file information in the instruction file is matched with the preset information in the machine equipment electric control system, the machine equipment electric control system analyzes the instruction file, and extracts an instruction group and sub-instructions in the instruction group contained in the instruction file so that a user can edit or modify the instruction group or the sub-instructions.
Specifically, for example, the pre-embedded file information included in the instruction file, such as the identification value XCF _ START, the file size, the file version, the character value XHCNCWKCMD, and the cumulative value and the exclusive or value of the data of the instruction file to be generated, are all matched with the preset information of the machine equipment electronic control system, the machine equipment electronic control system analyzes the instruction file, and extracts the instruction group and the sub-instructions in the instruction group included in the instruction file, so that the user can edit or modify the instruction group or the sub-instructions.
Further, in a possible embodiment, after the step S402, the method further includes:
and step S404, if not, the analysis operation of the instruction file is terminated.
And if the pre-implanted file information in the instruction file is not matched with the preset information in the machine equipment electric control system, the machine equipment electric control system stops the analysis operation of the instruction file.
Specifically, for example, if the pre-embedded file information included in the instruction file, such as the file header identifier XXF _ START, does not match the identification value XCF _ START in the machine equipment electronic control system, the machine equipment electronic control system terminates the parsing operation on the instruction file.
Step S500, a third instruction configuration operation is obtained, a first instruction group in the instruction file is determined according to the third instruction configuration operation, and modification is carried out on sub-instructions in the first instruction group.
And the machine equipment electric control system determines a first instruction group in the existing instruction file according to the third instruction configuration operation triggered by the user, and modifies parameters aiming at the sub-instructions in the first instruction group.
Further, in a possible embodiment, the second instruction configuration operation includes: the third instruction configuration operation comprises: in the step S500, the modifying step for the sub-instruction in the first instruction group may include:
step S501, determining a second sub instruction to be modified in the first instruction group according to the third determination sub instruction operation.
And the machine equipment electronic control system determines a second sub-instruction to be modified in the first instruction group according to the third determination sub-instruction operation triggered by the user.
Specifically, for example, when a user edits an existing instruction file based on a user graphical interface output and displayed by the electronic control system through the front-end display screen, if the user currently needs to modify an "output IOA" instruction in a "powered-on" instruction group of the existing instruction file, the electronic control system determines that a third determination sub-instruction operation triggered by the user is received when detecting a selection control of the user based on the "output IOA" instruction in the "powered-on" instruction group shown in the user graphical interface, and determines that the "output IOA" instruction corresponding to the selection control is a second to-be-modified sub-instruction to be modified in the "powered-on" instruction group of the instruction file when the user edits the existing instruction file.
Step S502, modifying the parameter of the second sub-instruction to be modified according to the second modifying sub-instruction operation.
And the machine equipment electric control system modifies the parameters of the second to-be-modified sub-instruction in the first instruction group according to the second modification sub-instruction operation triggered by the user.
Specifically, for example, when a user edits an existing instruction file based on a user graphical interface output and displayed by the electronic control system through the front-end display screen, if the user currently needs to modify an "output IOA" instruction in a "powered-on" instruction group of the existing instruction file, the electronic control system determines that a second modification sub-instruction operation triggered by the user is received when detecting a modification control of the user based on the "output IOA" instruction in the "powered-on" instruction group shown in the user graphical interface, and modifies relevant parameters (such as an IO number, a level state, an execution mode, and the like) of the corresponding "output IOA" instruction in the "powered-on" instruction group according to the modification control.
In the embodiment, the existing instruction file is read through the machine equipment electric control system, and the instruction file is decrypted, so that the data of the instruction file is converted from a messy code form to a plain code form to be represented; and the machine equipment electric control system determines a first instruction group in the existing instruction file according to the third instruction configuration operation triggered by the user, and modifies parameters aiming at the sub-instructions in the first instruction group.
Thus, the third embodiment of the present invention realizes that a user can modify an instruction group and a sub-instruction in an existing instruction file according to actual requirements, so that the user can continuously generate a new instruction file based on the existing instruction file, the efficiency of generating the instruction file is further improved, and the use experience of the user in the process of generating the instruction file is improved.
In addition, referring to fig. 6, an embodiment of the present invention further provides an instruction file generating device, where the instruction file generating method is applied to an electronic control system of a machine device, and the instruction file generating device includes:
the modification storage module is used for carrying out character modification on the parameter expression of a preset electric control instruction and storing the electric control instruction subjected to the character modification to a source instruction library to be used as a sub-instruction of the source instruction library;
the acquisition module is used for acquiring an instruction file to be generated and first instruction configuration operation, and adding the sub-instructions to each instruction group of the instruction file to be generated according to the first instruction configuration operation;
and the encryption storage module is used for encrypting the instruction file to be generated and storing the instruction file into an instruction file with a preset data format.
Preferably, the first instruction configuration operation comprises: the first determining instruction group operation, the first determining sub-instruction operation and the first adding sub-instruction operation are performed, and the obtaining module comprises:
the first instruction group determining unit is used for determining an instruction group to be edited according to the first instruction group determining operation;
a first determining sub-instruction unit to determine the sub-instruction from within the source instruction library according to the first determining sub-instruction operation;
and the first adding sub-instruction unit is used for adding the sub-instruction to the instruction group to be edited according to the first adding sub-instruction operation.
Preferably, the instruction file generating apparatus of the present invention further includes:
the modification module is used for acquiring second instruction configuration operation, determining an instruction group to be modified according to the second instruction configuration operation, and modifying the sub-instructions in the instruction group to be modified;
the second instruction configuration operation comprises: a second determining sub-instruction operation and a first modifying sub-instruction operation, a modifying module comprising:
the second determining sub-instruction unit is used for determining a first sub-instruction to be modified in the instruction group to be modified according to the second determining sub-instruction operation;
and the first modifying sub-instruction unit is used for modifying the parameter of the first sub-instruction to be modified according to the first modifying sub-instruction operation.
Preferably, the encryption saving module comprises:
the implantation unit is used for implanting preset file information into the instruction file to be generated;
and the coding unit is used for recoding the instruction file to be generated after the preset file information is implanted and storing the instruction file in a preset data format.
Preferably, the modification module of the instruction file generation device of the present invention is further configured to read and decrypt the instruction file; acquiring a third instruction configuration operation, determining a first instruction group in the instruction file according to the third instruction configuration operation, and modifying the sub-instructions in the first instruction group;
the third instruction configuration operation comprises: the third determining sub-instruction operation and the second modifying sub-instruction operation modify the module, further comprising:
a third determining sub-instruction unit, configured to determine, according to the third determining sub-instruction operation, a second to-be-modified sub-instruction within the first instruction group;
and the second modification sub-instruction unit is used for modifying the parameters of the second sub-instruction to be modified according to the second modification sub-instruction operation.
Preferably, the modification module further comprises:
the decoding unit is used for reading the instruction file and decoding the instruction file;
the judging unit is used for judging whether the file information in the instruction file is matched with preset information or not;
and the first analysis unit is used for analyzing and extracting the instruction group and the sub-instructions in the instruction group in the instruction file if the judgment unit judges that the instruction group is the instruction group.
Preferably, the modification module further comprises:
and the second analysis unit is used for terminating the analysis operation of the instruction file if the judgment unit judges that the instruction file is not the instruction file.
In addition, an embodiment of the present invention further provides a machine device, where the machine device includes: the computer program product comprises a memory, a processor and an instruction file generating program stored on the memory and capable of running on the processor, wherein the instruction file generating program realizes the steps of the instruction file generating method as described above when being executed by the processor.
The steps implemented when the instruction file generating program running on the processor is executed may refer to various embodiments of the instruction file generating method of the present invention, and are not described herein again.
Furthermore, an embodiment of the present invention further provides a storage medium applied to a computer, where the storage medium may be a non-volatile computer-readable storage medium, and the storage medium stores an instruction file generation program, and the instruction file generation program, when executed by a processor, implements the steps of the instruction file generation method described above.
The steps implemented when the instruction file generating program running on the processor is executed may refer to various embodiments of the instruction file generating method of the present invention, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a machine or other terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An instruction file generation method is applied to an electronic control system of machine equipment, and is characterized by comprising the following steps:
carrying out character modification on the parameter expression of a preset electric control instruction, and storing the electric control instruction subjected to character modification into a source instruction library to be used as a sub-instruction of the source instruction library;
acquiring an instruction file to be generated and a first instruction configuration operation, and adding the sub-instructions to each instruction group of the instruction file to be generated according to the first instruction configuration operation;
and encrypting the instruction file to be generated and storing the instruction file as an instruction file with a preset data format.
2. The instruction file generating method according to claim 1, wherein the first instruction configuration operation includes: a first determine group of instructions operation, a first determine sub-instruction operation, and a first add sub-instruction operation,
the step of adding the sub-instruction to each instruction group of the instruction file to be generated according to the first instruction configuration operation includes:
determining an instruction group to be edited according to the first determination instruction group operation;
determining the sub-instruction from within the source instruction library according to the first determining sub-instruction operation;
and adding the sub-instruction to the instruction group to be edited according to the first adding sub-instruction operation.
3. The method for generating an instruction file according to claim 1, wherein after the step of obtaining the instruction file to be generated and the first instruction configuration operation and adding the sub-instruction to each instruction group of the instruction file to be generated according to the first instruction configuration operation, the method further comprises:
acquiring second instruction configuration operation, determining an instruction group to be modified according to the second instruction configuration operation, and modifying the sub-instructions in the instruction group to be modified;
the second instruction configuration operation comprises: a second determining sub-instruction operation and a first modifying sub-instruction operation,
the step of modifying the sub-instructions in the instruction group to be modified includes:
determining a first sub instruction to be modified in the instruction group to be modified according to the second determination sub instruction operation;
and modifying the parameters of the first sub-instruction to be modified according to the first modifying sub-instruction operation.
4. The method for generating the instruction file according to claim 1, wherein the step of encrypting the instruction file to be generated and saving the encrypted instruction file as the instruction file in the preset data format comprises:
implanting preset file information into the instruction file to be generated;
and recoding the instruction file to be generated implanted with the preset file information, and storing the instruction file in a preset data format.
5. The method for generating an instruction file according to claim 1, wherein after the step of encrypting the instruction file to be generated and saving the encrypted instruction file as the instruction file in the preset data format, the method further comprises:
reading and decrypting the instruction file;
acquiring third instruction configuration operation, determining a first instruction group in the instruction file according to the third instruction configuration operation, and modifying the sub-instructions in the first instruction group;
the third instruction configuration operation comprises: a third determining sub-instruction operation and a second modifying sub-instruction operation,
the step of modifying for sub-instructions in the first instruction group comprises:
determining a second sub instruction to be modified in the first instruction group according to the third determination sub instruction operation;
and modifying the parameters of the second sub-instruction to be modified according to the second modifying sub-instruction operation.
6. The instruction file generating method according to claim 5, wherein the step of reading and decrypting the instruction file comprises:
reading the instruction file and decoding the instruction file;
judging whether file information in the instruction file is matched with preset information or not;
if yes, analyzing and extracting the instruction group and the sub-instructions in the instruction group in the instruction file.
7. The method for generating an instruction file according to claim 6, wherein after the step of determining whether the file information in the instruction file matches the preset information, the method further comprises:
if not, the analysis operation of the instruction file is terminated.
8. An instruction file generation device, characterized in that the instruction file generation method is applied to an electronic control system of a machine device, and the instruction file generation device comprises:
the modification storage module is used for carrying out character modification on the parameter expression of a preset electric control instruction and storing the electric control instruction subjected to the character modification to a source instruction library to be used as a sub-instruction of the source instruction library;
the acquisition modification module is used for acquiring an instruction file to be generated and first instruction configuration operation, and adding the sub-instructions to each instruction group of the instruction file to be generated according to the first instruction configuration operation;
and the encryption storage module is used for encrypting the instruction file to be generated and storing the instruction file into an instruction file with a preset data format.
9. A machine device, characterized in that the machine device comprises: memory, a processor and an instruction file generating program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the instruction file generating method of any one of claims 1 to 7.
10. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the instruction file generating method according to any one of claims 1 to 7.
CN202110513766.XA 2021-05-11 2021-05-11 Instruction file generation method, instruction file generation device, machine equipment and storage medium Pending CN113204381A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110513766.XA CN113204381A (en) 2021-05-11 2021-05-11 Instruction file generation method, instruction file generation device, machine equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110513766.XA CN113204381A (en) 2021-05-11 2021-05-11 Instruction file generation method, instruction file generation device, machine equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113204381A true CN113204381A (en) 2021-08-03

Family

ID=77031421

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110513766.XA Pending CN113204381A (en) 2021-05-11 2021-05-11 Instruction file generation method, instruction file generation device, machine equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113204381A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103513992A (en) * 2013-10-23 2014-01-15 电子科技大学 Universal development platform for education and entertainment robot application software
CN111352620A (en) * 2020-03-25 2020-06-30 珠海格力电器股份有限公司 Visual configuration programming method and system
CN111684414A (en) * 2019-04-29 2020-09-18 深圳市大疆创新科技有限公司 Visual programming control device, programmable control device, control method thereof, computer-readable storage medium, and programming control system
CN111966344A (en) * 2020-08-18 2020-11-20 北京中关村银行股份有限公司 Component code generation method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103513992A (en) * 2013-10-23 2014-01-15 电子科技大学 Universal development platform for education and entertainment robot application software
CN111684414A (en) * 2019-04-29 2020-09-18 深圳市大疆创新科技有限公司 Visual programming control device, programmable control device, control method thereof, computer-readable storage medium, and programming control system
CN111352620A (en) * 2020-03-25 2020-06-30 珠海格力电器股份有限公司 Visual configuration programming method and system
CN111966344A (en) * 2020-08-18 2020-11-20 北京中关村银行股份有限公司 Component code generation method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107592238B (en) Automatic test method and system of interface, service terminal and memory
CN101316168B (en) Authentification device and method
EP2503457A1 (en) Loading and debugging method and debugging system thereof
CN104317589A (en) Automatic code generating method and automatic code generating device for loading dynamic link library
US11620469B2 (en) Bar code generation scanning, and display method, apparatus, storage medium, and electronic device
CN106055375B (en) Application program installation method and device
CN111026439B (en) Application program compatibility method, device, equipment and computer storage medium
JP2005085255A (en) Method and device for developing source program on target system base
CN107508846B (en) Updating method and system of application client and terminal equipment
CN111209001A (en) Method, system, equipment and medium for batch generation of APKs of android channels
CN111459539A (en) Continuous integration pipeline operation method and device based on mirror layering
CN110351225B (en) Hardware device networking method and system, computing device and readable storage medium
CN106681773A (en) Android system starting method and device, and Android mobile terminal
CN111144878B (en) Instruction generation method and instruction generation device
CN113204381A (en) Instruction file generation method, instruction file generation device, machine equipment and storage medium
KR20110062075A (en) Server and system for providing mobile standard template data
CN111338940A (en) Code processing method, device and system
CN112395096A (en) Remote function call processing method and device, electronic equipment and storage medium
US9262128B2 (en) Information processing apparatus, information processing method and computer program
CN112987597B (en) FSU control method, device, equipment and computer readable storage medium
CN110061861B (en) Internet protocol configuration method, device, equipment and computer readable storage medium
CN115965227A (en) Workflow data processing method, device, equipment, storage medium and product
CN112905464A (en) Application running environment data processing method and device
CN111857782A (en) Interface updating method and device, computer equipment and storage medium
CN110765610A (en) PDM (product data management) integration method and device, computer equipment and 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