Workpiece processing quantity statistical method and device, storage medium and processor
By acquiring the operating information of CNC machine tools and using program identifiers and annotation information to count the number of workpieces processed, the problem of not being able to automatically count the number of workpieces processed in the existing technology is solved, and accurate counting of the number of workpieces processed is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2026-03-20
AI Technical Summary
Existing technologies cannot effectively count the number of workpieces processed in a CNC machine tool system, especially in non-batch processing where the specific number of workpieces processed cannot be determined. Furthermore, the M-instruction counting method requires manual zeroing and cannot count the total number of processes processed in a single NC numerical control program execution.
By acquiring the operating information of the processing equipment, including the program identifier, program comments, and program operating conditions of the preset program, the preset program of the target workpiece is determined using the program identifier, and the number of times the preset program is run is determined based on the program comments and program operating conditions, and the number of workpieces processed is counted.
It enables accurate counting of the number of workpieces processed, solving the problem that existing technologies cannot automatically count the number of workpieces processed, especially in non-batch processing where it can accurately determine the number of specific workpieces processed.
Smart Images

Figure CN114328099B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of numerical control, in particular to a machining quantity statistical method and device of a workpiece, a storage medium and a processor. BACKGROUND
[0002] With the construction of digital workshop, the detailed manufacturing data and process system of the existing MDC workshop have a general method of recording machining count through M instruction.
[0003] At present, a general machining counting method in a CNC numerical control machine tool system is to record the end of machining of a main program and a subprogram, and to increase 1 of machining count, and to record the total number of machining in the CNC system by using a macro variable, and the commonly used M instructions are M30 and M99.
[0004] However, this counting method has the following disadvantages: the machining count is always accumulated, and if the count is started from zero, the count macro variable in the CNC system needs to be manually cleared; the total number of machining when a single NC digital control program is executed once cannot be counted; the machining numbers corresponding to the main program and the subprogram cannot be obtained; and when non-batch machining is performed, the machining number of a specific workpiece cannot be obtained.
[0005] In view of the above problem that the machining number of a workpiece cannot be counted, no effective solution has been proposed. SUMMARY
[0006] Embodiments of the present application provide a machining quantity statistical method and device of a workpiece, a storage medium and a processor, to at least solve the technical problem that the machining number of a workpiece cannot be counted.
[0007] According to an aspect of an embodiment of the present application, a machining quantity statistical method of a workpiece is provided, including: obtaining running information of a machining device, wherein the running information at least includes program identification of a preset program, program annotation and program working condition, the program identification is used to indicate the preset program of a machining target workpiece, the program annotation is used to indicate whether to be used to count the execution times of the preset program, and the program working condition is used to indicate the execution condition of the preset program, and the target workpiece is a workpiece whose machining number needs to be counted; determining the preset program for machining the target workpiece according to the program identification; determining the running times of the preset program according to the program annotation and the program working condition; and counting the machining number of the target workpiece according to the running times.
[0008] Optionally, before the operation information of the machining device is acquired, the method further comprises: acquiring a pre-configured workpiece mark; acquiring a program mark of the preset program, wherein the association between the workpiece mark and the program mark represents the association between the preset program and the target workpiece; and generating a program note according to the workpiece mark, the program mark and a preset count mark, wherein the count mark is used to indicate whether the execution times of the preset program corresponding to the program mark are counted.
[0009] Optionally, acquiring the pre-configured workpiece mark comprises: acquiring workpiece information of the target workpiece; and querying a workpiece mark corresponding to the workpiece information in a preset mapping table, wherein the preset mapping table records the association between the workpiece information and the workpiece mark.
[0010] Optionally, the preset program comprises: a first preset program and a second preset program, and the second preset program is a subprogram of the first preset program.
[0011] Optionally, when the preset program is the first preset program, the program working condition is acquired by the following steps: monitoring a program state of the first preset program, wherein the program state at least comprises: an activated state and a reset state; and determining the program working condition of the machining device according to the program state, wherein when the program state changes from the activated state to the reset state, it is determined that the program working condition is that the first preset program is executed once.
[0012] Optionally, when the preset program is the second preset program, the program working condition is acquired by the following steps: monitoring a preset macro instruction of the second preset program, wherein the preset macro instruction is set at the end of the second preset program and is used to indicate that the execution of the second preset program is completed; generating macro variable data based on the preset macro instruction, wherein the macro variable data is used to indicate the execution times of the second preset program; and determining the program working condition of the machining device according to the macro variable data.
[0013] According to another aspect of the embodiments of the present application, there is also provided a workpiece processing quantity counting device, comprising: a first obtaining unit configured to obtain operation information of a processing device, wherein the operation information comprises at least program identification, program annotation and program working condition, the program identification is used to indicate a preset program for processing a target workpiece, the program annotation is used to indicate whether the preset program is used to count the number of executions, and the program working condition is used to indicate the execution condition of the preset program; a first determining unit configured to determine the preset program for processing the target workpiece according to the program identification; a second determining unit configured to determine the number of executions of the preset program according to the program annotation and the program working condition; and a counting unit configured to count the processing quantity of the target workpiece according to the number of executions.
[0014] Optionally, the device further comprises: a second obtaining unit configured to obtain a pre-configured workpiece mark before obtaining the operation information of the processing device; a third obtaining unit configured to obtain a program mark of the preset program, wherein the association between the workpiece mark and the program mark indicates the association between the preset program and the target workpiece; and a generating unit configured to generate the program annotation according to the workpiece mark, the program mark and a preset counting mark, wherein the counting mark is used to indicate whether the number of executions of the preset program corresponding to the program mark is counted.
[0015] According to another aspect of the embodiments of the present application, there is also provided a computer readable storage medium for storing a program, wherein the device where the computer readable storage medium is located executes the workpiece processing quantity counting method when the program runs.
[0016] According to another aspect of the embodiments of the present application, there is also provided a processor for running a program, wherein the processor executes the workpiece processing quantity counting method when the program runs.
[0017] In the embodiment of the present application, the running information of the machining equipment is acquired, wherein the running information at least includes: program identification of a preset program, program annotation and program working condition, the program identification is used to indicate the preset program of the machining target workpiece, the program annotation is used to indicate whether the execution times of the preset program are counted, and the program working condition is used to indicate the execution condition of the preset program; the preset program of the machining target workpiece is determined according to the program identification; the running times of the preset program are determined according to the program annotation and the program working condition; the machining quantity of the target workpiece is counted according to the running times; and whether the execution times of the preset program are counted is determined by adding the annotation information in the preset program. The execution times of the preset program used for machining the target workpiece are counted according to the running information of the machining equipment, and then the machining quantity of the target workpiece is determined, so that the technical effect of counting the machining quantity of the workpiece is realized, and then the technical problem that the machining quantity of the workpiece cannot be counted is solved. BRIEF DESCRIPTION OF DRAWINGS
[0018] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the principles of the present application, and are not intended to limit the present application. In the drawings:
[0019] Figure 1 It is a flow chart of a machining quantity counting method of a workpiece according to an embodiment of the present application;
[0020] Figure 2 It is a schematic diagram of collecting running information according to an embodiment of the present application;
[0021] Figure 3 It is a schematic diagram of counting logic according to an embodiment of the present application;
[0022] Figure 4 It is a schematic diagram of a machining quantity counting device of a workpiece according to an embodiment of the present application;
[0023] Figure 5 It is a structural block diagram of a computer terminal according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the personnel in the technical field better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by the personnel in the field without creative labor should belong to the protection scope of the present application.
[0025] It should be noted that the terms "first", "second", and the like in the description and in the claims of the present application and above-described accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular sequential or chronological order. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a list of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to such processes, methods, products or devices.
[0026] According to an embodiment of the present application, a workpiece processing quantity statistical method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0027] Figure 1 is a flowchart of a workpiece processing quantity statistical method according to an embodiment of the present application, as shown in Figure 1 The method comprises the following steps:
[0028] Step S102, obtaining the running information of the processing equipment, wherein the running information at least includes: program identification of the preset program, program annotation and program working condition, the program identification is used to indicate the preset program of the processing target workpiece, the program annotation is used to indicate whether to be used for statistical execution times of the preset program, the program working condition is used to indicate the execution condition of the preset program, and the target workpiece is the workpiece whose processing quantity needs to be counted;
[0029] Step S104, determining the preset program of the processing target workpiece according to the program identification;
[0030] Step S106, determining the running times of the preset program according to the program annotation and the program working condition;
[0031] Step S108, counting the processing quantity of the target workpiece according to the running times.
[0032] In the embodiment of the present application, the running information of the machining equipment is acquired, wherein the running information at least includes: program identification of a preset program, program annotation and program working condition, the program identification is used to indicate the preset program of the machining target workpiece, the program annotation is used to indicate whether the execution times of the preset program are counted, and the program working condition is used to indicate the execution condition of the preset program; the preset program of the machining target workpiece is determined according to the program identification; the running times of the preset program are determined according to the program annotation and the program working condition; the machining quantity of the target workpiece is counted according to the running times; and whether the execution times of the preset program are counted is determined by adding the annotation information in the preset program, so that the execution times of the preset program for machining the target workpiece are counted according to the running information of the machining equipment, and then the machining quantity of the target workpiece is determined, thereby realizing the technical effect of counting the machining quantity of the workpiece, and further solving the technical problem that the machining quantity of the workpiece cannot be counted.
[0033] In the step S102, the machining equipment can be a numerical control machine tool, and the preset program can be an NC numerical control program of the numerical control machine tool, and the numerical control machine tool can realize the machining of the target workpiece by executing the numerical control program.
[0034] In the step S102, the running information is collected according to a preset time interval.
[0035] Optionally, the preset program is used to control the machining equipment to machine the target workpiece, and the running information including the preset program can be determined according to the program identification of the preset program.
[0036] As an optional embodiment, the preset program includes: a first preset program and a second preset program, and the second preset program is a subprogram of the first preset program.
[0037] In the above embodiment of the present application, the target workpiece can be machined by a main program (i.e. the first preset program) or a subprogram (i.e. the second preset program); according to the machining process of different workpieces, it can be selected whether the target workpiece is machined by the main program (i.e. the first preset program) or the subprogram (i.e. the second preset program).
[0038] In the step S102, the program identification includes: main program identification (or main program number) of a main program (i.e. the first preset program), and subprogram identification (or subprogram number) of a subprogram (i.e. the second preset program).
[0039] Optionally, the running information further includes: collection time.
[0040] Optionally, the running information is collected according to a predetermined time interval, and the predetermined time interval is 1s.
[0041] Optionally, the format of the running information can include: acquisition time-first program identifier-second program identifier-program note.
[0042] As an optional embodiment, before the running information of the processing equipment is acquired, the method further comprises: acquiring a pre-configured workpiece marker; and acquiring a program marker of the preset program, wherein the association between the workpiece marker and the program marker represents the association between the preset program and the target workpiece; and generating the program note according to the workpiece marker, the program marker and a preset counting marker, wherein the counting marker is used to indicate whether the execution times of the preset program corresponding to the program marker are counted.
[0043] Optionally, the program marker includes a main program marker and a subprogram marker, and the association between the workpiece marker and the program marker indicates whether the target workpiece is processed by the main program or the subprogram, and which preset program is used to process the target workpiece, so that the association between the preset program and the target workpiece can be represented by the association between the workpiece marker and the program marker.
[0044] Optionally, the program marker can be implemented by using binary coding, wherein 0 represents the main program (i.e., the first preset program), and 1 represents the subprogram (i.e., the second preset program).
[0045] Optionally, the counting marker is used to indicate whether it is used for counting, and if it is used for counting, the execution times of the preset program are recorded.
[0046] Optionally, the counting marker can be implemented by using binary coding, wherein 0 represents that it is used for counting, and 1 represents that it is not used for counting.
[0047] Optionally, the format of the program note can include: workpiece marker-main submarker (i.e., program marker)-counting marker.
[0048] Optionally, the pre-configured workpiece marker can be acquired through a preset mapping table.
[0049] As an optional embodiment, acquiring the pre-configured workpiece marker includes: acquiring workpiece information of the target workpiece; and querying the workpiece marker corresponding to the workpiece information in the preset mapping table, wherein the preset mapping table records the association between the workpiece information and the workpiece marker.
[0050] Optionally, the preset mapping table at least records the workpiece code (such as the ID of the workpiece) of each workpiece and the corresponding relationship between the workpiece code (such as the ID of the workpiece) and the workpiece information, wherein the workpiece code (such as the ID of the workpiece) is a binary code, and the workpiece information is specific information of the corresponding workpiece, such as shape description or process description of the workpiece.
[0051] Optionally, the preset mapping table can convert the binary workpiece code into a decimal workpiece mark, so that a shorter string can be used as a unique representation of the workpiece, thereby shortening the character length of the program comment.
[0052] As an optional embodiment, in the case of the preset program being a first preset program, the following steps are adopted to obtain the program working condition: monitoring the program state of the first preset program, wherein the program state at least includes: an active state and a reset state; determining the program working condition of the machining device according to the program state, wherein in the case that the program state is changed from the active state to the reset state, it is determined that the program working condition is that the first preset program has been executed once.
[0053] Optionally, in the case of the preset program being a main program (i.e., the first preset program), the program working condition of the preset program can be identified by the program state.
[0054] Optionally, the program state at least includes: a termination state (a reset state), a stop state, a running state (an active state), a waiting state and an interruption state.
[0055] Optionally, in the case that the program state is changed from the running state to the reset state, it is determined that the main program (i.e., the first preset program) has been executed once.
[0056] As an optional embodiment, in the case of the preset program being a second preset program, the following steps are adopted to obtain the program working condition: monitoring the preset macro instruction of the second preset program, wherein the preset macro instruction is set at the end of the second preset program and is used to indicate that the execution of the second preset program is completed; generating macro variable data based on the preset macro instruction, wherein the macro variable data is used to indicate the number of executions of the second preset program; and determining the program working condition of the machining device according to the macro variable data.
[0057] Optionally, in the case of the preset program being a subprogram (i.e., the second preset program), the program working condition of the preset program can be identified by the macro variable data.
[0058] Optionally, the program working condition is represented by the program state of the main program and the macro variable data of the subprogram.
[0059] The above embodiments of the present application set the preset macro instruction at the end of the second preset program, which controls the macro variable data + 1 in the case that the subprogram (i.e., the second preset program) has been executed once.
[0060] Optionally, the format of the running information can also include: acquisition time_first program identifier_second program identifier_program comment_program state (i.e., the first program working condition)_macro variable data (i.e., the second program working condition).
[0061] The application also provides a preferred embodiment, which provides a scheme for collecting the number of workpiece machining through program numbers.
[0062] The application defines information mapping data through NC program modification, collects the main program number, the subprogram number, the comment information, the program state information and the macro variable data in combination with the communication API of the CNC system, and obtains the number of machining of the specific workpiece corresponding to the main program and the subprogram when a single NC program is executed once through statistics.
[0063] The technical scheme provided by the application comprises the following steps: NC program modification defines information mapping data, machine tool information collection (i.e. collecting running information, wherein the running information comprises the main program number, the subprogram number, the comment information, the program state and the macro variable), and statistical logic (calculating the number of machining of the specific workpiece corresponding to the main program and the subprogram when a single NC program is executed once, and calculating the total number of machining of the workpiece).
[0064] Optionally, the NC program modification defines information mapping data, and the information mapping data comprises the specific workpiece information, the flag for identifying the machining count increment 1 at the machining end of the main program and the subprogram, and the specific workpiece and main program or subprogram association information.
[0065] Table 1 is a schematic table of the comment information (i.e. program comment) provided by the application, as shown in Table 1, the comment information (i.e. program comment) is defined and implemented by adding the comment information (i.e. program comment), and the format of the comment information (i.e. program comment) is (workpiece mark-main sub mark-count mark-other information). In order to avoid that the comment information exceeds the maximum limit, the mapping table for the workpiece mark is used herein, as shown in Table 2.
[0066]
[0067] Table 1
[0068] Table 2 is a mapping table for the workpiece mark provided by the application, as shown in Table 2, the mapping table (the specific workpiece information and workpiece mark association table) database storage is schematic, and it is required to ensure that the workpiece mark is a unique value.
[0069] Item (ID auto increment) Workpiece mark (hexadecimal) Workpiece information 1 0 Workpiece 1 detailed information ... ... ... 11 A Workpiece 10 detailed information ... ... ... 101 64 Workpiece 100 detailed information ... ... ... 10001 3E8 Workpiece 1000 detailed information ... ... ...
[0070] Table 2
[0071] It should be noted that in Table 2, the item (ID self-increment) is the workpiece code in binary mark, the workpiece code in decimal is converted into the workpiece mark in hexadecimal, the code length can be shortened, and it is avoided that the comment information (i.e. program comment) exceeds the maximum limit.
[0072] Optionally, the machining start and the machining end of the main program are marked, and the program state is used for distinguishing.
[0073] Table 3 is a schematic table of a program state provided by the present application, as shown in Table 3.
[0074] Program status Function Remark 0 Terminate (reset) Program execution end 1 Stop (stop) 2 Run (activate) When the program starts to execute for the first time, mark the flag 3 Wait 4 Interrupt
[0075] Table 3
[0076] Optionally, in the case that the program state of the preset program (i.e., the first preset program) is changed from the running state to the termination state, it is determined that the preset program (i.e., the first preset program) is executed once.
[0077] Optionally, a macro instruction is added at the end of the NC code of the subprogram to mark the end of the subprogram, and the system macro variable data corresponding to the subprogram is increased by 1 each time the subprogram is executed, for example: Siemens "R100=R100+1", Fanuc "#3901=#3901+1".
[0078] Optionally, an NC program modification example taking the Fanuc system as an example is as follows:
[0079] The original program is as follows:
[0080] "%
[0081] O0009
[0082] M08
[0083] M03S1500
[0084] T0101
[0085] G0X60.0Z-9.9
[0086] G1X35.0F0.15
[0087] …
[0088] G70P1Q2F0.1
[0089] G0X100.0Z100.0
[0090] M30
[0091] %".
[0092] The subprogram is as follows:
[0093] "%
[0094] O00091
[0095] …
[0096] M99
[0097] %".
[0098] The modified original program is as follows:
[0099]
[0100] O0009(A-0-0-msg1)
[0101] M08
[0102] M03 S1500
[0103] T0101
[0104] G0 X60.0 Z-9.9
[0105] G1 X35.0 F0.15
[0106] …
[0107] G70 P1 Q2 F0.1
[0108] G0 X100.0 Z100.0
[0109] M30
[0110]
[0111] Reformed subroutine is:
[0112]
[0113] O00091(A-1-1-msg2)
[0114] …
[0115] M99
[0116] #3901 = #3901 + 1
[0117]
[0118] Optionally, the machine tool information collection is based on the communication API of the CNC system to collect the main program number, subroutine number, program comment information, program state information and macro variable data for the reformed NC program.
[0119] Table 4 is a schematic table of collected information after a single NC program is executed according to an embodiment of the present application, as shown in Table 4, each row in the table is a result of one information collection, and the collection period is 1s.
[0120]
[0121] Table 4
[0122] Figure 2 is a schematic diagram of collecting running information according to an embodiment of the present application, Figure 3 is a schematic diagram of statistical logic according to an embodiment of the present application, as Figure 2 and Figure 3 As shown, the statistical logic comprises:
[0123] S1, positioning the specific NC program according to the main program number change.
[0124] Optionally, in the actual processing process, when non-batch processing, the NC program is replaced as needed, so it is necessary to determine the NC program used for processing the current workpiece. When the NC program is changed, the main program number will be changed accordingly. Here, the main program number can be used to locate the specific NC program.
[0125] S2, according to the main program number and the program state, positioning the processing start and processing end of the NC program.
[0126] Optionally, after determining the specific NC program, the processing start and processing end of the specific NC program are located according to the program state.
[0127] S3, according to the main program number, the program annotation and the mapping table, the processing number of the specific workpiece corresponding to the main program is parsed.
[0128] Optionally, after the main program is executed once, it represents that the workpiece or the process is processed, the owner of the annotation information is distinguished by combining the main subprogram in the annotation information, whether the count mark in the annotation information is used for counting, if the owner is the main program and the count mark is used for counting, it is considered that the count is added by 1 after the main program is executed once, and the number of processing of the specific workpiece when executing the main program is obtained by combining the workpiece mark mapping table.
[0129] S4, according to the subprogram number, the program annotation, the macro variable data and the mapping table, the processing number of the specific workpiece corresponding to the subprogram is parsed.
[0130] Optionally, after the subprogram is executed once, it represents that the workpiece or the process is processed, the owner of the annotation information is distinguished by combining the main subprogram in the annotation information, whether the count mark in the annotation information is used for counting, if the owner is the subprogram and the count mark is used for counting, it is considered that the count is added by 1 after the subprogram is executed once, the execution times of the subprogram when the single main program is executed (taking the difference value of the macro variable data from the beginning to the end of the main program) are determined by combining the macro variable data and the subprogram and the main program start and end, and the number of processing of the specific workpiece when executing the subprogram is obtained by combining the workpiece mark mapping table.
[0131] The technical scheme provided by the application solves the problem that M instruction counting cannot count the total number of processing when a single NC program is executed once; solves the problem that M instruction counting cannot obtain the processing number corresponding to the main program and the subprogram; solves the problem that M instruction counting cannot obtain the processing number of the specific workpiece when non-batch processing.
[0132] According to the embodiment of the present application, a workpiece processing quantity statistical device is also provided. It should be noted that the workpiece processing quantity statistical device can be used to execute the workpiece processing quantity statistical method of the embodiment of the present application, and the workpiece processing quantity statistical method of the embodiment of the present application can be executed in the workpiece processing quantity statistical device.
[0133] Figure 4 is a schematic diagram of a workpiece processing quantity statistical device according to the embodiment of the present application. As shown in the figure, the device can include: Figure 4
[0134] The first acquisition unit 42 is configured to acquire operation information of a processing device, wherein the operation information at least includes program identification of a preset program, program annotation and program working condition, the program identification is used to indicate the preset program of a target workpiece, the program annotation is used to indicate whether the execution times of the preset program are counted, the program working condition is used to indicate the execution situation of the preset program, and the target workpiece is a workpiece whose processing quantity needs to be counted. The first determination unit 44 is configured to determine the preset program of processing the target workpiece according to the program identification. The second determination unit 46 is configured to determine the operation times of the preset program according to the program annotation and the program working condition. The statistical unit 48 is configured to count the processing quantity of the target workpiece according to the operation times.
[0135] It should be noted that the first acquisition unit 42 in this embodiment can be used to execute step S102 in the embodiment of the present application, the first determination unit 44 in this embodiment can be used to execute step S104 in the embodiment of the present application, the second determination unit 46 in this embodiment can be used to execute step S106 in the embodiment of the present application, and the statistical unit 48 in this embodiment can be used to execute step S108 in the embodiment of the present application. The above modules have the same examples and application scenarios as the corresponding steps, but are not limited to the contents disclosed in the above embodiments.
[0136] In the embodiment of the present application, the running information of the machining device is acquired, wherein the running information at least includes: program identification of a preset program, program annotation and program working condition, the program identification is used to indicate the preset program of a machining target workpiece, the program annotation is used to indicate whether the execution times of the preset program are counted, and the program working condition is used to indicate the execution situation of the preset program; the preset program of the machining target workpiece is determined according to the program identification; the running times of the preset program are determined according to the program annotation and the program working condition; the machining quantity of the target workpiece is counted according to the running times; and whether the execution times of the preset program are counted is limited and determined by adding the annotation information in the preset program. Therefore, the execution times of the preset program used for machining the target workpiece can be counted according to the running information of the machining device, and then the machining quantity of the target workpiece is determined, so that the technical effect of counting the machining quantity of the workpiece is realized, and then the technical problem that the machining quantity of the workpiece cannot be counted is solved.
[0137] As an optional embodiment, the apparatus further includes: a second acquisition unit, configured to acquire a pre-configured workpiece mark before acquiring the running information of the machining device; a third acquisition unit, configured to acquire a program mark of the preset program, wherein the association relationship between the workpiece mark and the program mark indicates the association relationship between the preset program and the target workpiece; and a generation unit, configured to generate the program annotation according to the workpiece mark, the program mark and a preset counting mark, wherein the counting mark is used to indicate whether the execution times of the preset program corresponding to the program mark are counted.
[0138] As an optional embodiment, the second acquisition unit includes: an acquisition module, configured to acquire workpiece information of the target workpiece; and a query module, configured to query a workpiece mark corresponding to the workpiece information in a preset mapping table, wherein the association relationship between the workpiece information and the workpiece mark is recorded in the preset mapping table.
[0139] As an optional embodiment, the preset program includes: a first preset program and a second preset program, and the second preset program is a subprogram of the first preset program.
[0140] As an optional embodiment, when the preset program is the first preset program, the following modules are used to acquire the program working condition: a first monitoring module, configured to monitor the program state of the first preset program, wherein the program state at least includes: an activated state and a reset state; and a first determination module, configured to determine the program working condition of the machining device according to the program state, wherein when the program state is changed from the activated state to the reset state, it is determined that the program working condition is that the first preset program is executed once.
[0141] As an optional embodiment, when the preset program is the second preset program, the following modules are used to obtain the program working condition: a first monitoring module, configured to monitor a preset macro instruction of the second preset program, wherein the preset macro instruction is arranged at the end of the second preset program and is used to indicate that the execution of the second preset program is completed; a generating module, configured to generate macro variable data based on the preset macro instruction, wherein the macro variable data is used to indicate the execution times of the second preset program; and a second determining module, configured to determine the program working condition of the machining equipment according to the macro variable data.
[0142] The embodiment of the present application can provide a computer terminal, which can be any one of computer terminal devices in a computer terminal group. Alternatively, in the embodiment, the computer terminal can be replaced by a mobile terminal or other terminal device.
[0143] Alternatively, in the embodiment, the computer terminal can be located in at least one of a plurality of network devices in a computer network.
[0144] In the embodiment, the computer terminal can execute program codes of the following steps in the machining quantity counting method of a workpiece: obtaining running information of a machining equipment, wherein the running information at least includes a program identification of a preset program, a program comment and a program working condition, the program identification is used to indicate the preset program of a machining target workpiece, the program comment is used to indicate whether the execution times of the preset program are counted, the program working condition is used to indicate the execution situation of the preset program, and the target workpiece is a workpiece whose machining quantity is to be counted; determining the preset program of the machining target workpiece according to the program identification; determining the running times of the preset program according to the program comment and the program working condition; and counting the machining quantity of the target workpiece according to the running times.
[0145] Alternatively, Figure 5 is a structural block diagram of a computer terminal according to an embodiment of the present application. As shown in Figure 5 the computer terminal 50 can include one or more (only one is shown in the figure) processors 52 and a memory 54.
[0146] The memory can be configured to store software programs and modules, such as program instructions / modules corresponding to the workpiece processing quantity counting method and device in the embodiments of the present application. The processor executes the software programs and modules stored in the memory to perform various functions and data processing, i.e., to implement the workpiece processing quantity counting method described above. The memory can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory can further include a memory remotely arranged with respect to the processor, which can be connected to the terminal 50 through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0147] The processor can call information and applications stored in the memory through the transmission device to perform the following steps: obtaining running information of the processing equipment, wherein the running information at least includes program identification of a preset program, program annotation, and program working condition, the program identification is used to indicate the preset program of the target workpiece, the program annotation is used to indicate whether the execution times of the preset program are counted, and the program working condition is used to indicate the execution situation of the preset program; determining the preset program of the target workpiece according to the program identification; determining the running times of the preset program according to the program annotation and the program working condition; and counting the processing quantity of the target workpiece according to the running times.
[0148] Optionally, the processor can further execute program codes of the following steps: obtaining a pre-configured workpiece marker before obtaining the running information of the processing equipment; obtaining a program marker of the preset program, wherein the association relationship between the workpiece marker and the program marker indicates the association relationship between the preset program and the target workpiece; and generating the program annotation according to the workpiece marker, the program marker, and a preset counting marker, wherein the counting marker is used to indicate whether the execution times of the preset program corresponding to the program marker are counted.
[0149] Optionally, the processor can further execute program codes of the following steps: obtaining workpiece information of the target workpiece; and querying the workpiece marker corresponding to the workpiece information in a preset mapping table, wherein the association relationship between the workpiece information and the workpiece marker is recorded in the preset mapping table.
[0150] Optionally, the preset program includes a first preset program and a second preset program, and the second preset program is a subprogram of the first preset program.
[0151] Optionally, the processor can further execute program codes of the following steps: monitoring a program state of the first preset program in a case that the preset program is the first preset program, wherein the program state at least includes an active state and a reset state; determining a program working condition of the machining device according to the program state, wherein in a case that the program state is changed from the active state to the reset state, it is determined that the program working condition is that the first preset program is executed once.
[0152] Optionally, the processor can further execute program codes of the following steps: monitoring a preset macro instruction of the second preset program in a case that the preset program is the second preset program, wherein the preset macro instruction is arranged at the end of the second preset program and is used for indicating that the execution of the second preset program is completed; generating macro variable data based on the preset macro instruction, wherein the macro variable data is used for indicating the execution times of the second preset program; and determining the program working condition of the machining device according to the macro variable data.
[0153] According to the embodiment of the present application, a machining quantity statistical scheme of a workpiece is provided. Running information of a machining device is acquired, wherein the running information at least includes a program identification of a preset program, a program comment and a program working condition, the program identification is used for indicating the preset program of a machining target workpiece, the program comment is used for indicating whether the execution times of the preset program are counted, and the program working condition is used for indicating the execution situation of the preset program; the preset program of the machining target workpiece is determined according to the program identification; the running times of the preset program are determined according to the program comment and the program working condition; the machining quantity of the target workpiece is counted according to the running times; and whether the execution times of the preset program are counted is determined by adding comment information in the preset program. Thus, the execution times of the preset program used for machining the target workpiece can be counted according to the running information of the machining device, and the machining quantity of the target workpiece is determined, so that the technical effect of counting the machining quantity of the workpiece is realized, and the technical problem that the machining quantity of the workpiece cannot be counted is solved.
[0154] Those skilled in the art can understand that Figure 5 The structure shown is only schematic, and the computer terminal can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Figure 5 It does not limit the structure of the electronic device. For example, the computer terminal 50 can further include more or fewer components (such as a network interface, a display device, etc.) than Figure 5 shown in the figures, or have a different configuration than Figure 5 shown in the figures.
[0155] Those skilled in the art can understand that all or part of the steps in the above-mentioned various methods of the embodiments can be completed by instructing the terminal device related hardware through a program, and the program can be stored in a computer readable storage medium, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0156] The embodiments of the present application also provide a storage medium. Optionally, in the embodiments, the storage medium can be used to save the program code executed by the workpiece processing quantity counting method provided by the embodiments.
[0157] Optionally, in the embodiments, the storage medium can be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
[0158] Optionally, in the embodiments, the storage medium is configured to store program code for executing the following steps: obtaining running information of a processing device, wherein the running information at least includes program identification of a preset program, program annotation and program working condition, the program identification is used to indicate the preset program of a target workpiece, the program annotation is used to indicate whether the preset program is used to count the execution times, and the program working condition is used to indicate the execution situation of the preset program; determining the preset program of the target workpiece according to the program identification; determining the running times of the preset program according to the program annotation and the program working condition; and counting the processing quantity of the target workpiece according to the running times.
[0159] Optionally, in the embodiments, the storage medium is configured to store program code for executing the following steps: obtaining a pre-configured workpiece mark before obtaining the running information of the processing device; obtaining program marks of the preset program, wherein the association relationship between the workpiece mark and the program mark indicates the association relationship between the preset program and the target workpiece; and generating the program annotation according to the workpiece mark, the program mark and a preset counting mark, wherein the counting mark is used to indicate whether to count the execution times of the preset program corresponding to the program mark.
[0160] Optionally, in the embodiments, the storage medium is configured to store program code for executing the following steps: obtaining workpiece information of the target workpiece; and querying the workpiece mark corresponding to the workpiece information in a preset mapping table, wherein the association relationship between the workpiece information and the workpiece mark is recorded in the preset mapping table.
[0161] Optionally, in the embodiments, the preset program includes a first preset program and a second preset program, and the second preset program is a subprogram of the first preset program.
[0162] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: monitoring a program state of the first preset program in a case that the preset program is the first preset program, wherein the program state at least includes an active state and a reset state; determining a program working condition of the machining device according to the program state, wherein in a case that the program state is changed from the active state to the reset state, it is determined that the program working condition is that the first preset program is executed once.
[0163] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: monitoring a preset macro instruction of the second preset program in a case that the preset program is the second preset program, wherein the preset macro instruction is arranged at the end of the second preset program and is used to indicate that the execution of the second preset program is completed; generating macro variable data based on the preset macro instruction, wherein the macro variable data is used to indicate the execution times of the second preset program; and determining the program working condition of the machining device according to the macro variable data.
[0164] In the embodiment of the application, the running information of the machining device is acquired, wherein the running information at least includes a program identifier of a preset program, a program comment and a program working condition, the program identifier is used to indicate the preset program of a machining target workpiece, the program comment is used to indicate whether the execution times of the preset program are counted, and the program working condition is used to indicate the execution condition of the preset program; the preset program of the machining target workpiece is determined according to the program identifier; the running times of the preset program are determined according to the program comment and the program working condition; the machining quantity of the target workpiece is counted according to the running times; and whether the execution times of the preset program are counted is determined by adding the comment information in the preset program, so that the execution times of the preset program used for machining the target workpiece are counted according to the running information of the machining device, and then the machining quantity of the target workpiece is determined, thereby realizing the technical effect of counting the machining quantity of the workpiece, and further solving the technical problem that the machining quantity of the workpiece cannot be counted.
[0165] The serial numbers of the above embodiments of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0166] In the above embodiments of the application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0167] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented by other means. Among them, the above-mentioned device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division mode, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be through some interface, indirect coupling or communication connection between units or modules, which can be electrical or other forms.
[0168] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0169] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0170] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0171] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A method for calculating the number of workpieces processed, characterized in that, include: Obtain the operating information of the processing equipment, wherein the operating information includes at least: the program identifier, program comments, and program operating status of the preset program, wherein the program identifier is used to indicate the preset program for processing the target workpiece, the program comments are used to indicate whether the preset program is used to count the number of times it is executed, the program operating status is used to indicate the execution status of the preset program, and the target workpiece is the workpiece whose processing quantity needs to be counted. A preset program for processing the target workpiece is determined based on the program identifier; The number of times the preset program is run is determined based on the program comments and the program operating conditions; The number of target workpieces processed is calculated based on the number of runs. The preset program includes: a first preset program and a second preset program, wherein the second preset program is a subroutine of the first preset program; when the preset program is the first preset program, the program operating conditions are obtained by means of the following steps: Monitor the program status of the first preset program, wherein the program status includes at least: an active state and a reset state; The program operating condition of the processing equipment is determined according to the program state, wherein, when the program state changes from the active state to the reset state, the program operating condition is determined to be that the first preset program has been executed once; The format of the operation information includes: acquisition time_first program identifier_second program identifier_program comment_program status_macro variable data, where the first program identifier is the program identifier of the first preset program, the second program identifier is the program identifier of the second preset program, the program status is the program operating condition of the first preset program, and the macro variable data is the program operating condition of the second preset program.
2. The method according to claim 1, characterized in that, Before acquiring the operating information of the processing equipment, the method further includes: Obtain pre-configured workpiece markers; Obtain the program tag of the preset program, wherein the association between the workpiece tag and the program tag represents the association between the preset program and the target workpiece; A program annotation is generated based on the workpiece mark, the program mark, and a preset count mark, wherein the count mark is used to indicate whether to count the number of times the preset program corresponding to the program mark is executed.
3. The method according to claim 2, characterized in that, Obtaining pre-configured workpiece markers includes: Obtain the workpiece information of the target workpiece; The workpiece information is queried in a preset mapping table, where the preset mapping table records the association between the workpiece information and the workpiece mark.
4. The method according to claim 1, characterized in that, When the preset program is the second preset program, the following steps are used to obtain the program operating conditions: Monitor the preset macro instructions of the second preset program, wherein the preset macro instructions are set at the end of the second preset program to indicate that the execution of the second preset program has ended; Macro variable data is generated based on the preset macro instructions, wherein the macro variable data is used to represent the number of times the second preset program is executed; The operating conditions of the processing equipment are determined based on the macro variable data.
5. A workpiece processing quantity counting device, characterized in that, include: The first acquisition unit is used to acquire the operating information of the processing equipment, wherein the operating information includes at least: a program identifier, a program comment, and a program status of a preset program, wherein the program identifier is used to indicate the preset program for processing the target workpiece, the program comment is used to indicate whether it is used to count the number of times the preset program is executed, the program status is used to indicate the execution status of the preset program, and the target workpiece is the workpiece whose processing quantity needs to be counted. The first determining unit is used to determine a preset program for processing the target workpiece based on the program identifier; The second determining unit is used to determine the number of times the preset program is run based on the program comments and the program operating conditions; A statistics unit is used to count the number of times the target workpiece is processed based on the number of runs. The preset program includes a first preset program and a second preset program, wherein the second preset program is a subroutine of the first preset program. When the preset program is the first preset program, the following modules are used to obtain the program's operating status: The first monitoring module is used to monitor the program status of the first preset program, wherein the program status includes at least: an active state and a reset state; The first determining module is used to determine the program operating condition of the processing equipment based on the program state, wherein, when the program state changes from the active state to the reset state, the program operating condition is determined to be that the first preset program has been executed once; The format of the operation information includes: acquisition time_first program identifier_second program identifier_program comment_program status_macro variable data, where the first program identifier is the program identifier of the first preset program, the second program identifier is the program identifier of the second preset program, the program status is the program operating condition of the first preset program, and the macro variable data is the program operating condition of the second preset program.
6. The apparatus according to claim 5, characterized in that, The device further includes: The second acquisition unit is used to acquire pre-configured workpiece markings before acquiring the operating information of the processing equipment; The third acquisition unit is used to acquire the program tag of the preset program, wherein the association between the workpiece tag and the program tag represents the association between the preset program and the target workpiece; The generation unit is used to generate program annotations based on the workpiece mark, the program mark, and a preset count mark, wherein the count mark is used to indicate whether to count the number of times the preset program corresponding to the program mark is executed.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the workpiece processing quantity statistics method according to any one of claims 1 to 4.
8. A processor, characterized in that, The processor is used to run a program, wherein the program executes the method for calculating the number of workpieces processed according to any one of claims 1 to 4.
Citation Information
Patent Citations
CNC (computer numerical control) machining information analysis system and method
CN104423344A
Working result control system
JP1993261650A