Data processing method and device based on servo driver, equipment and medium
By generating frequency-corresponding sending timestamps for the servo drive and combining with the timer update mechanism, the misalignment problem caused by excessively fast data transmission in the remote monitoring system is solved, the accuracy of data reception and system stability are improved, and the servo drive is realized High frequency precision data monitoring.
Patent Information
- Application Number
- CN202411085540.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-08-08
AI Technical Summary
The existing servo drive remote monitoring system can easily lead to data misalignment problems when data is sent too quickly. Due to the performance limitations of the web side and the large amount of data, the page is stuttered and memory leaked when data is received, which leads to page crashes.
By generating the sending timestamp corresponding to the frequency of the sent data for the servo drive, the timestamp and rendered data are stored, and the system timestamp is avoided. Combined with the timer and the timing update mechanism of the rendered data, the data storage and refresh frequency are optimized, and the memory is reduced. Essence and performance consumption.
It effectively avoids data misalignment problems, improves the accuracy of data reception and storage, reduces page lag and memory leakage, and realizes stable and real-time visual monitoring of servo drive data.
Smart Images

Figure CN119011669A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to a data processing method, device, equipment and medium based on a servo drive. Background Art
[0002] A servo drive is a controller used to control a servo motor. It is part of a servo system and is widely used in automation equipment such as industrial robots and CNC machining centers. A servo drive is usually composed of a main control board and a power board. The main control board is a low-voltage board responsible for motor control algorithms and communication functions; the power board is a high-voltage board responsible for power supply and converting the control signal of the main control board into a high-voltage signal, thereby driving the servo motor to operate.
[0003] Currently, many servo drive manufacturers in the industry provide products that support remote monitoring (such as remote service platforms, remote monitoring systems). By connecting the servo drive to the industrial router, the data is sent to the database, and then the data in the database is obtained to achieve remote monitoring and management of the servo drive. This can improve production efficiency and equipment utilization, perform fault diagnosis, alarm notification, etc., and can also prevent accidents to a certain extent.
[0004] The remote monitoring system is now being expanded to include various parameter data of the servo driver and presented in the form of a waveform. Since some waveforms require high accuracy, the servo driver needs to send data at a faster frequency, but this can easily lead to data misalignment when receiving data. After the data is received, it is also necessary to refresh and render the data in real time. Due to the performance limitations of the Web end and the large amount of data, the remote monitoring system will experience reduced refresh frequency, page freezes, and page crashes caused by memory leaks after it is running. Summary of the invention
[0005] The embodiments of the present invention provide a data processing method, device, equipment and medium based on a servo drive, aiming to solve the existing problem of data misalignment during data reception and storage caused by overly fast data transmission by the servo drive.
[0006] In a first aspect, an embodiment of the present invention provides a data processing method based on a servo drive, comprising:
[0007] Processing the data sent by the servo driver to obtain rendering data;
[0008] Generate a sending timestamp according to the frequency at which the servo driver sends data;
[0009] The sending timestamp and the rendering data are stored.
[0010] In a second aspect, an embodiment of the present invention further provides a data processing device based on a servo drive, comprising:
[0011] A processing unit, used for processing the data sent by the servo driver to obtain rendering data;
[0012] A generating unit, configured to generate a sending timestamp according to a frequency at which the servo driver sends data;
[0013] A storage unit is used to store the sending timestamp and the rendering data.
[0014] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.
[0015] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.
[0016] The embodiment of the present invention provides a data processing method, device, equipment and medium based on a servo drive. The method includes: processing the data sent by the servo drive to obtain rendering data; generating a sending timestamp according to the frequency of the servo drive sending data; storing the sending timestamp and the rendering data. The technical solution of the embodiment of the present invention generates a sending timestamp according to the frequency of the servo drive sending data, and stores the sending timestamp and rendering data, rather than storing data according to the timestamp generated by the system time, thereby avoiding data misalignment when the servo drive sends data too quickly and causes data to be received and stored. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0018] Figure 1 A schematic flow chart of a data processing method based on a servo drive provided in one embodiment of the present invention;
[0019] Figure 2 A schematic diagram of a sub-flow chart of a data processing method based on a servo drive provided in one embodiment of the present invention;
[0020] Figure 3 A schematic diagram of a sub-flow chart of a data processing method based on a servo drive provided in one embodiment of the present invention;
[0021] Figure 4 A schematic flow chart of a data processing method based on a servo drive provided in another embodiment of the present invention;
[0022] Figure 5 A schematic diagram of a sub-flow chart of a data processing method based on a servo drive provided in another embodiment of the present invention;
[0023] Figure 6 A simplified flow chart of processing and storing data sent by a servo driver provided in an embodiment of the present invention;
[0024] Figure 7 A simplified flow chart of updating waveform data according to a timer and rendering data to refresh the waveform provided by an embodiment of the present invention;
[0025] Figure 8 A schematic block diagram of a data processing device based on a servo drive provided in an embodiment of the present invention;
[0026] Fig. 9 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0029] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0030] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0031] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0032] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a data processing method based on a servo drive according to an embodiment of the present invention. The data processing method based on a servo drive is described in detail below. Figure 1 As shown, the method includes the following steps S110-S130.
[0033] S110, processing the data sent by the servo driver to obtain rendering data.
[0034] In an embodiment of the present invention, the data processing method based on the servo drive is applied to a servo drive data visualization platform, and the servo drive data visualization platform includes a front end and a back end, wherein the back end refers to the part of the servo drive data visualization platform that is responsible for processing business logic, data storage and processing; the front end draws a waveform diagram of various parameters of the servo drive and displays it. It should be noted that in this embodiment, because the data acquisition, waveform drawing and update of the servo drive need to maintain a connection with the servo drive for a long time, high real-time performance is required, and the performance consumption should be minimized, a WebSocket network connection is used to obtain data, that is, a WebSocket network connection is established between the back end and the servo drive to receive the data sent by the servo drive, and the data sent by the servo drive is stored in a database corresponding to the servo drive data visualization platform. It should also be noted that in this embodiment, the VUE framework is used as the framework of the servo drive data visualization platform.
[0035] Furthermore, if Figure 2 As shown, step S110 may specifically include steps S111-S113:
[0036] S111, converting the data sent by the servo driver into JSON format data;
[0037] S112, classifying the JSON format data in the form of key-value pairs to obtain classified data;
[0038] S113, calculating the data length of the data block in the classified data, and dividing the classified data according to the data length to obtain the parameter data and the function code.
[0039] In an embodiment of the present invention, the data sent by the servo driver is processed to obtain rendering data. Specifically, the data sent by the servo driver is first converted into JSON format data; then the JSON format data is classified in the form of key-value pairs to obtain classified data. It should be noted that, in this embodiment, the servo driver transmission protocol transmits data in the form of "transmission header" + "function code" + "data block" + "sixteen-bit data information check code" + "transmission tail", for example "0f01 01020304 12345678901234560d", the space is used to separate the protocol areas, the actual transmitted data does not contain spaces, and after classification, "function code: data block" is obtained, that is, the classified data is "function code: data block". It can be understood that the function code is a parameter identifier of the servo driver, and different servo drivers will be distinguished by the IP address of the device. Therefore, the function codes of the same function of different servo drivers will be consistent, while different function codes of the same servo driver will be inconsistent. After classifying the JSON format data, the data length of the data block in the classified data is calculated, and the classified data is segmented according to the data length to obtain the parameter data and the function code, that is, the parameter data is the data block. It should also be noted that in this embodiment, when the waveform diagram of each parameter of the servo driver is drawn, the servo driver is required to send the status information of the current device once at a preset time interval, but due to the performance limitations and delays of the Web end, it is impossible to receive data at the frequency of the preset time, and due to the fast data transmission frequency, data sticking phenomenon will occur. When the data is actually received, the amount of data received at the same time will be much higher than the preset time. Therefore, it is necessary to classify and segment the data sent by the received servo driver, wherein the preset time is 3ms. It can be understood that in other embodiments, the preset time can be set according to actual needs.
[0040] S120: Generate a sending timestamp according to the frequency at which the servo driver sends data.
[0041] In an embodiment of the present invention, after the classified data is segmented according to the data length to obtain the parameter data and the function code, a sending timestamp is generated according to the frequency of the servo driver sending data, and the sending timestamp corresponds to the parameter data. It should be noted that in the present embodiment, the reason why the sending timestamp is generated according to the frequency of the servo driver sending data, rather than the system time, is to avoid the problem of data misalignment when the servo driver sends data too quickly and causes data to be received and stored. It should also be noted that in the present embodiment, the sending timestamp is generated according to the frequency of the servo driver sending data. Specifically, taking 3ms as an example, the servo driver sends data for the first time at 3ms, that is, the generated sending timestamp is 3ms; the servo driver sends data for the second time at 6ms, that is, the generated sending timestamp is 6ms.
[0042] S130: Store the sending timestamp and the rendering data.
[0043] In an embodiment of the present invention, after generating a sending timestamp according to the frequency of the servo drive sending data, the sending timestamp and the rendering data are stored. In this embodiment, the sending timestamp, the parameter data and the function code are stored in a receiving array for subsequent waveform drawing. It should be noted that in this embodiment, the parameter data is determined by the front end of the servo drive data visualization platform. After the customer selects the parameters to be observed in the UI interface of the front end, a request is sent to the back end of the servo drive data visualization platform, and the back end calls out the corresponding parameter data from the database.
[0044] Furthermore, if Figure 3 As shown, step S130 may specifically include steps S131-S133:
[0045] S131, determining whether the sending timestamp is accumulated to a preset timestamp, if the sending timestamp is accumulated to the preset timestamp, executing step S132, otherwise executing step S133;
[0046] S132, converting the sending timestamp to generate a processing timestamp, and storing the processing timestamp and the rendering data;
[0047] S133: Store the sending timestamp and the rendering data.
[0048] In the embodiment of the present invention, the preset timestamp is 1000ms. When the sending timestamp accumulates to 1000ms, the timestamp conversion is performed, that is, 1000ms is converted into the processing timestamp 1s, and 1s and the rendering data are stored. If the sending timestamp does not reach 1000ms, for example, 800ms, 800ms and the rendering data are stored. It should be noted that in this embodiment, when the collected waveform exceeds 10s, the timestamp will reach more than 10000ms. Because the collected waveform is often used to detect whether the servo drive is normal, it is necessary to collect at least half a minute of data for observation. In this case, if milliseconds are used as the unit of the timestamp, it will be detrimental to subsequent observation. It can be understood that data is received once every 3ms, and 333 groups of data will be received within 1 second. If more than 333 groups of data are received, it can be judged that the sending timestamp exceeds 1s. When there is the 334th group of data, the sending timestamp will exceed 1000ms. At this time, the subsequent timestamps will be converted into units before being stored.
[0049] Figure 4 A flow chart of a data processing method based on a servo drive according to another embodiment of the present invention is shown as follows: Figure 4 As shown, in this embodiment, the method includes steps S110-S140. That is, in this embodiment, after step S130 of the above embodiment, the method further includes step S140.
[0050] S140, updating the waveform graph data regularly according to the setting of the timer and the stored rendering data to refresh the waveform graph.
[0051] In an embodiment of the present invention, after the sending timestamp and the rendering data are stored in the receiving array, the waveform data is updated regularly according to the setting of the timer and the stored rendering data to refresh the waveform. Specifically, Figure 5 As shown, step S140 may specifically include steps S141-S143:
[0052] S141, transmitting the rendering data stored in the receiving array to the original array;
[0053] S142, copying the rendering data in the original array to a temporary array;
[0054] S143: If the update time set by the timer is reached, data is obtained from the temporary data to update the waveform data to refresh the waveform.
[0055] In an embodiment of the present invention, the rendering data stored in the receiving array is transferred to the original array, and the array length of the original array is obtained; if the array length does not exceed the preset copy length, all the rendering data in the original array are copied to the temporary array; if the array length exceeds the preset copy length, the latest rendering data of the preset copy length in the original array is copied to the temporary array; when the update time set by the timer is reached, it is determined whether the execution number of the timer reaches the execution number threshold; if the execution number of the timer does not reach the execution number threshold, data is obtained from the temporary data to update the waveform data to refresh the waveform; if the execution number of the timer reaches the execution number threshold, the timer is destroyed to release the memory, and a new timer is created, and the step of obtaining data from the temporary data to update the waveform data to refresh the waveform is returned. It can be understood that in this embodiment, the temporary array is created after the waveform is drawn for the first time.
[0056] It should be noted that in this embodiment, the reason why a timer is set and the timer is destroyed to release memory when the execution number of the timer reaches the execution number threshold is that the data sent by the servo driver is processed and displayed in the form of a broken line, thereby achieving the effect of an oscilloscope. For the graphical display of data, for example, the ECharts plug-in can be used to convert the data into a corresponding image, and the data is imported into the method provided by the plug-in to render the data regularly, and the data is updated regularly to achieve the effect of real-time update. However, since the ECharts plug-in cannot process data rendering with a period of ms (because the servo driver can send a maximum of 12 sets of parameter data, about 1000 / 3*12=4000 sets of data will be added per second at a period of 3ms), the ECharts plug-in will continue to occupy memory when updating data, and because of the cache mechanism of the Web page, the replaced data cannot directly release the occupied memory, and the waveform graph corresponding to the ECharts plug-in needs to be destroyed before it can be released. However, if the waveform graph is destroyed, a short white screen phenomenon will appear, which is not suitable for both the perception and actual use. When the memory occupies more, the page will have obvious jamming, which will cause the page to crash. In this embodiment, by controlling the working threshold of the timer, limiting the data length, and recycling the memory occupied by the plug-in, the maximum refresh frequency of the waveform can reach 33 Hz, and the maximum frame rate that the human eye can capture is as follows: CFF = 24 + 0.4\luminance, where \(L\) is the abbreviation of luminance, which represents the ambient brightness in cd / m 2(candela per square meter) as the unit, it can be calculated that the frame rate observable by the human eye is 24-30hz. When the waveform data is updated after each data acquisition, the timer and data length are logically judged and processed, and the memory usage of the waveform rendered by some plug-ins is released at the same time, so that long-term high-frequency data refresh can be achieved, thereby achieving the effect of real-time remote observation of the precise data of the servo drive. In other embodiments, the VUE framework and ECharts plug-in can also be replaced by other languages, such as frameworks and plug-ins written in C language.
[0057] It should also be noted that, in this embodiment, the timer is set after the sending timestamp and the rendering data are stored in the receiving array for the first time. The timer is set at an interval of 150ms, that is, 50 groups of data are updated each time. Since the data received every 3ms will be drawn as a point in the waveform graph, if it is updated every time the data is received, it is not only impossible to observe with the naked eye, but also wastes performance. Therefore, the refresh frequency needs to be reduced. In actual measurements, an interval of 150ms can achieve a smooth waveform drawing effect. When the timer is set, it will be triggered once for the initial waveform drawing. At this time, the rendering data processed and stored for the first time will be used for the drawing of the waveform. All the received rendering data will be stored in the original array, that is, the data in the original array is used for the first waveform drawing. After the timer is triggered successfully, the variable recording the number of timer triggers is added by 1. In this embodiment, the variable recording the number of timer triggers is the number of executions, and the execution number threshold is 50 times. Understandably, since the timer will continue to occupy memory after each timing trigger, the timer is destroyed after a certain number of executions to release the memory occupied by the timer itself. Creating a new timer is equivalent to allocating only fixed memory to the timer. When the timer itself reaches the memory usage limit, it is released and cleared, thereby continuing to use the previously occupied memory and reducing the performance pressure of the browser. It is also understandable that the interval set for the timer can also be set according to actual needs to correspond to different refresh frequencies of the waveform.
[0058] See also Figure 6 , Figure 6 A simplified flow chart of processing and storing data sent by a servo driver provided in an embodiment of the present invention, Figure 6 In the process, the servo drive establishes a WebSocket connection with the backend; receives data sent by the servo drive; converts the data into JSON format; classifies the data in the form of key-value pairs; calculates the data length, performs data segmentation, and generates a sending timestamp; determines whether the sending timestamp is accumulated to 1000ms; if it is accumulated to 1000ms, converts milliseconds to seconds and then generates a processing timestamp; if it is not accumulated to 1000ms, stores the segmented data and the sending timestamp.
[0059] See also Figure 7 , Figure 7 A simplified flow chart of updating waveform data according to a timer and rendering data to refresh the waveform according to an embodiment of the present invention is provided. Figure 7 In the process, a timer is set to continuously update the waveform graph; when rendering data is received for the first time, it is stored and rendered; a temporary array is created for subsequent continuous updating of rendering data; the original array receives the newly transmitted rendering data; the rendering data in the original array is copied to the temporary array; it is determined whether the length of the original array exceeds the preset copy length; if the length of the original array does not exceed the preset copy length, the original array is completely copied; if the length of the original array exceeds the preset copy length, the latest rendering data within the preset copy length is retained; wait for the timer to trigger the update rendering; after the timer is executed, it will be determined whether the number of executions reaches the execution number threshold; if the number of executions reaches the execution number threshold, the timer is destroyed, the memory is released, and a new timer is created to continue to execute the timer function. It can be understood that if the number of executions does not reach the execution number threshold, the timer function is also continued to be executed to update the waveform data and refresh the waveform.
[0060] In summary, in this embodiment, a large amount of data transmitted by the servo drive can be stably received and processed and rendered into a waveform display, thereby realizing accurate data visualization of the servo drive and remotely monitoring the servo drive.
[0061] Figure 8 is a schematic block diagram of a data processing device 200 based on a servo drive provided by an embodiment of the present invention. Figure 8 As shown, corresponding to the above data processing method based on servo drive, the present invention also provides a data processing device 200 based on servo drive. The data processing device 200 based on servo drive includes a unit for executing the above data processing method based on servo drive, and the device can be configured in a computer device. Figure 8 The servo drive-based data processing device 200 includes a processing unit 201 , a generating unit 202 and a storage unit 203 .
[0062] The processing unit 201 is used to process the data sent by the servo driver to obtain rendering data; the generating unit 202 is used to generate a sending timestamp according to the frequency of the data sent by the servo driver; and the storage unit 203 is used to store the sending timestamp and the rendering data.
[0063] In some embodiments, such as this embodiment, the processing unit 201 includes a conversion unit, a classification unit, and a calculation and segmentation unit.
[0064] Among them, the conversion unit is used to convert the data sent by the servo drive into JSON format data; the classification unit is used to classify the JSON format data in the form of key-value pairs to obtain classified data; the calculation and segmentation unit is used to calculate the data length of the data block in the classified data, and segment the classified data according to the data length to obtain the parameter data and the function code.
[0065] In some embodiments, such as this embodiment, the storage unit 203 includes a first judgment unit, a first storage subunit, and a second storage subunit.
[0066] Among them, the first judgment unit is used to judge whether the sending timestamp is accumulated to a preset timestamp; the first storage subunit is used to convert the sending timestamp to generate a processing timestamp if the sending timestamp is accumulated to the preset timestamp, and store the processing timestamp and the rendering data; the second storage subunit is used to store the sending timestamp and the rendering data if the sending timestamp is not accumulated to the preset timestamp.
[0067] In some embodiments, such as the present embodiment, the servo drive-based data processing device 200 further includes an updating unit.
[0068] The updating unit is used for updating the waveform graph data regularly according to the setting of the timer and the stored rendering data to refresh the waveform graph.
[0069] In some embodiments, such as the present embodiment, the update unit includes a transmission unit, a copy unit, and an update sub-unit.
[0070] Among them, the transmission unit is used to transmit the rendering data stored in the receiving array to the original array; the copy unit is used to copy the rendering data in the original array to a temporary array; and the update subunit is used to obtain data from the temporary data to update the waveform data to refresh the waveform if the update time set by the timer is reached.
[0071] In some embodiments, such as this embodiment, the copy unit includes an acquisition unit, a first copy subunit and a second copy subunit.
[0072] Among them, the acquisition unit is used to obtain the array length of the original array; the first copy subunit is used to copy all the rendering data in the original array to the temporary array if the array length does not exceed the preset copy length; the second copy subunit is used to copy the latest rendering data of the preset copy length in the original array to the temporary array if the array length exceeds the preset copy length.
[0073] In some embodiments, such as the present embodiment, before the step of acquiring data from the temporary data to update the waveform data to refresh the waveform, a second judgment unit and a destruction and reconstruction unit are also included.
[0074] Among them, the second judgment unit is used to judge whether the execution times of the timer reaches the execution times threshold; the destruction and reconstruction unit is used to destroy the timer to release memory and recreate a new timer if the execution times of the timer reaches the execution times threshold.
[0075] The above-mentioned data processing device based on servo drive can be realized in the form of a computer program, which can be used in Fig. 9 Runs on the computer device shown.
[0076] See also Fig. 9 , Fig. 9 300 is a schematic block diagram of a computer device provided by an embodiment of the present invention. The computer device 300 is a device having a data processing function based on a servo drive.
[0077] See also Fig. 9 The computer device 300 includes a processor 302 , a memory and a network interface 305 connected via a system bus 301 , wherein the memory may include a non-volatile storage medium 303 and an internal memory 304 .
[0078] The non-volatile storage medium 303 can store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, the processor 302 can execute a data processing method based on a servo drive.
[0079] The processor 302 is used to provide computing and control capabilities to support the operation of the entire computer device 300 .
[0080] The internal memory 304 provides an environment for the operation of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute a data processing method based on a servo drive.
[0081] The network interface 305 is used to communicate with other devices over the network. Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 300 to which the solution of the present invention is applied. The specific computer device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0082] The processor 302 is used to run a computer program 3032 stored in the memory to implement any embodiment of the above-mentioned data processing method based on the servo drive.
[0083] It should be understood that in the embodiment of the present invention, the processor 302 may be a central processing unit (CPU), and the processor 302 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0084] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0085] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. When the computer program is executed by a processor, the processor executes any embodiment of the above-mentioned data processing method based on a servo drive.
[0086] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0087] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0088] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0089] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0090] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device to execute all or part of the steps of the method described in each embodiment of the present invention.
[0091] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0092] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
[0093] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A data processing method based on a servo drive, characterized in that: include: Processing the data sent by the servo driver to obtain rendering data; Generate a sending timestamp according to the frequency at which the servo driver sends data; The sending timestamp and the rendering data are stored.
2. The method according to claim 1, characterized in that The rendering data includes parameter data and function codes, and the step of processing the data sent by the servo driver to obtain the rendering data includes: Convert the data sent by the servo driver into JSON format data; Classifying the JSON format data in the form of key-value pairs to obtain classified data; The data length of the data block in the classified data is calculated, and the classified data is segmented according to the data length to obtain the parameter data and the function code.
3. The method according to claim 1, characterized in that The step of storing the sending timestamp and the rendering data comprises: Determine whether the sending timestamp is accumulated to a preset timestamp; If the sending timestamp is accumulated to the preset timestamp, the sending timestamp is converted to generate a processing timestamp, and the processing timestamp and the rendering data are stored; If the sending timestamp is not accumulated to the preset timestamp, the sending timestamp and the rendering data are stored.
4. The method according to any one of claims 1 to 3, characterized in that: After the step of storing the sending timestamp and the rendering data, the method further includes: The waveform graph data is updated regularly according to the setting of the timer and the stored rendering data to refresh the waveform graph.
5. The method according to claim 4, characterized in that The step of updating the waveform data regularly according to the setting of the timer and the stored rendering data to refresh the waveform graph comprises: Transferring the rendering data stored in the receiving array to the original array; Copying the rendering data in the original array to a temporary array; If the update time set by the timer is reached, data is obtained from the temporary data to update the waveform data to refresh the waveform.
6. The method according to claim 5, characterized in that The step of copying the rendering data in the original array to a temporary array comprises: Get the array length of the original array; If the array length does not exceed the preset copy length, copying all the rendering data in the original array to the temporary array; If the array length exceeds the preset copy length, the latest rendering data of the preset copy length in the original array is copied to the temporary array.
7. The method according to claim 5, characterized in that Before the step of acquiring data from the temporary data to update the waveform data to refresh the waveform, the method further includes: Determine whether the execution count of the timer reaches an execution count threshold; If the execution times of the timer reaches the execution times threshold, the timer is destroyed to release memory, and a new timer is created.
8. A data processing device based on a servo drive, characterized in that: include: A processing unit, used for processing the data sent by the servo driver to obtain rendering data; A generating unit, configured to generate a sending timestamp according to a frequency at which the servo driver sends data; A storage unit is used to store the sending timestamp and the rendering data.
9. A computer device, characterized in that: The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that:The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 can be implemented.
Citation Information
Patent Citations
High present sensation intelligent perception interactive motor system and implementing method
CN101510074A
Moving platform landing composite landmark navigation system
CN110253580A
Data transmission processing method and device of numerical control machine tool, numerical control machine tool and medium
CN117119006A
Data rendering processing method and device, computer equipment and storage medium
CN117244237A
Data connection and processing method and system for station control fusion, electronic equipment and medium
CN118353945A
