CN-121979761-A - Method, apparatus and storage medium for program assisted development
Abstract
The embodiment of the application provides a method, equipment and a storage medium for programming auxiliary development, belonging to the technical field of industrial robots; the method comprises the steps of obtaining a code row to be detected, determining an effective code section according to the code row to be detected, correcting the letter cases of first abnormal codes which do not meet preset assignment conditions in the effective code section, and correcting the letter cases of second abnormal codes which do not meet preset grammar configuration files in the effective code section. By extracting the effective code sections of the codes of each row and correcting the letters of the first abnormal code and the second abnormal code in the effective code sections, the abnormal detection and correction of the progressive codes can be realized, and as the first abnormal code and the second abnormal code are the assigned variable and the code sections related to grammar, the abnormal conditions in the programming form of the industrial robot can be corrected in real time, the requirement on the programming capability of the industrial robot is reduced, and the programming convenience of the industrial robot is improved.
Inventors
- Feng Yangguang
- CHEN JIAHAO
- ZHANG ZHAOHUI
Assignees
- 珠海市海峰机器人系统有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251201
Claims (10)
- 1. A method of programming assisted development, the method comprising: Acquiring a code line to be detected; Determining an effective code segment according to the code line to be detected; Correcting the letter cases of the first abnormal codes which do not meet the preset assignment conditions in the effective code segments; And correcting the letter cases of the second abnormal codes which do not meet the preset grammar configuration file in the effective code segment.
- 2. The method of programming assist development of claim 1 wherein the acquiring a line of code to be detected comprises at least one of: responding to the detection that the carriage return line changing key is triggered, and taking a code segment where a cursor is located when the carriage return line changing key is triggered as a code line to be detected; In response to detecting that a target direction key is triggered, taking a code segment of a line where a cursor is located when the target direction key is triggered as a code line to be detected; And responding to the detection that the mouse button is triggered, and taking the code segment of the line where the current cursor is positioned as the code line to be detected.
- 3. The method of programming assisted development of claim 1, wherein said determining valid code segments from said line of code to be detected comprises: deleting the annotation in the code line to be detected; replacing the assignment of each character string in the code line to be detected with a space; and taking the code line to be detected after deleting the annotation and replacing the character as the effective code segment.
- 4. The method of programming aid development according to claim 1, wherein said correcting the letter case of the first exception code in the valid code segment that does not satisfy a preset assignment condition comprises: When a first variable matched with a preset robot point position abnormal format exists in the effective code segment, correcting the first variable according to the preset robot point position format by letter cases; when a second variable matched with a preset percentage variable abnormal format exists in the effective code segment, correcting the letter case of the second variable according to a preset robot percentage variable format; The first variable and the second variable are both the first exception code.
- 5. The method of programming aid development according to claim 1, wherein the grammar profile includes a base grammar profile, and the letter case correcting the second exception code in the active code segment that does not satisfy a preset grammar profile includes: when a target keyword with similarity to each keyword in the basic grammar configuration file being larger than a first threshold exists in the effective code segment, replacing the target keyword with the matched keyword, wherein the keyword comprises at least one of a basic keyword, a program control logic keyword, a data type keyword and an identification keyword; When a target operator with similarity to each operator in the basic grammar configuration file larger than a second threshold exists in the effective code segment, replacing the target operator with the matched operator; wherein the target keyword and the target operator are both the second exception code.
- 6. The method of programming aid development according to claim 1, wherein the grammar configuration file further includes an instruction grammar file, and the performing letter case correction on the second abnormal code in the valid code segment that does not satisfy the preset grammar configuration file includes: And when a target instruction name field with similarity larger than a third threshold value with each instruction name in each defined instruction in the grammar configuration file exists in the effective code segment, replacing the target instruction name field with a matched instruction name.
- 7. The method of programming aid development of claim 1, wherein the letter case correction is performed on a second exception code in the active code segment that does not satisfy a predetermined grammar profile, Acquiring a regular expression of each configuration item in the grammar configuration file; Matching each regular expression with the effective code segment to obtain the second abnormal code; And correcting the letter cases of the second abnormal codes according to the configuration items corresponding to the regular expressions when the second abnormal codes are matched.
- 8. The method of programming aid development according to claim 1, wherein said alphabetic case correcting the second abnormal code in the valid code segment that does not satisfy the preset grammar profile comprises: Taking the effective code segment after the first abnormal code is subjected to letter case correction as a target code segment; And correcting the letter cases of the second abnormal codes which do not meet the grammar configuration file in the target code segment.
- 9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of programming aid development according to any one of claims 1 to 8 when executing the computer program.
- 10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method of programming aid development of any one of claims 1 to 8.
Description
Method, apparatus and storage medium for program assisted development Technical Field The present application relates to the field of industrial robots, and in particular, to a method, apparatus, and storage medium for programming assisted development. Background In order to ensure the development freedom of a developer, a conventional code editor generally provides functions such as code completion, grammar highlighting, grammar detection and the like. However, in the industrial automation industry, the programming of the industrial robot is simpler than the conventional computer development, and the requirements on the users are often lower in the programming development of the industrial robot, so the method for assisting the development provided by the existing code editor is not suitable for the programming of the industrial robot, and a method for assisting the development of the programming is needed to improve the convenience of the development of the industrial robot. Disclosure of Invention The embodiment of the application mainly aims to provide a programming aided development method, programming aided development equipment and a storage medium, which can improve the programming convenience of an industrial robot. To achieve the above object, a first aspect of an embodiment of the present application proposes a method of program-assisted development, the method comprising: Acquiring a code line to be detected; Determining an effective code segment according to the code line to be detected; Correcting the letter cases of the first abnormal codes which do not meet the preset assignment conditions in the effective code segments; And correcting the letter cases of the second abnormal codes which do not meet the preset grammar configuration file in the effective code segment. To achieve the above object, a second aspect of the embodiments of the present application proposes an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method of program-assisted development according to any one of the first aspects when executing the computer program. To achieve the above object, a third aspect of the embodiments of the present application proposes a computer-readable storage medium storing a computer program which, when executed by a processor, implements the method of program-assisted development of any one of the first aspects. The method, the device and the storage medium for programming aided development provided by the application can realize the anomaly detection and correction of the progressive codes by extracting the effective code sections of the codes of each row and correcting the first anomaly code and the second anomaly code in the effective code sections according to the letter cases, and can correct the anomalies in the programming form of the industrial robot in real time because the first anomaly code and the second anomaly code are the assigned variables and the code sections related to grammar respectively. Compared with the related art, the embodiment of the application can realize real-time row-by-row correction and simultaneously reduce the requirement on the programming capability of the industrial robot, thereby improving the programming convenience of the industrial robot. Drawings FIG. 1 is a flow chart of one embodiment of a method of programming aid development provided by the present application; FIG. 2 is a schematic application diagram of another embodiment of a method of programming aid development provided by the present application; FIG. 3a is an interface schematic of one embodiment of a method of programming aid development provided by the present application; FIG. 3b is an interface schematic diagram of another embodiment of a method of programming aid development provided by the present application; Fig. 4 is a schematic hardware structure of a device corresponding to the method for programming assisted development provided by the application. Detailed Description The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. It should be noted that although functional block division is performed in a device diagram and a logic sequence is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the block division in the device, or in the flowchart. The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. Unless def