Oscillographic processing method of virtual oscilloscope and elevator system
By using multi-threaded parallel processing technology in virtual oscilloscopes, the problem of loss and distortion of high-sampling rate signal waveform data in virtual oscilloscopes is solved, and the accurate and complete display of signal waveforms is achieved.
Patent Information
- Application Number
- CN202510308841.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-06-20
AI Technical Summary
In a virtual oscilloscope, the waveform data of the high-sampling rate signal is easily lost and distorted due to the communication baud rate limit, which affects the accuracy and completeness of the signal waveform.
Through at least two target device threads in parallel processing, waveform display configuration information is sent, device acquisition data is obtained regularly sent by the automation control device, and waveform drawing is performed to ensure the integrity and accuracy of the data.
It effectively improves the software response speed of the virtual oscilloscope, avoids data loss problems in high sampling rate data communication, and ensures that accurate and complete signal waveforms are generated and displayed under high sampling rate conditions.
Smart Images

Figure CN120179514A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to an oscilloscope processing method for a virtual oscilloscope and an elevator system. Background Art
[0002] In the field of industrial control, a virtual oscilloscope is a commonly used tool for displaying waveform diagrams. A computer equipped with a virtual oscilloscope can perform data interaction with a lower computer through communication methods such as a serial port to monitor and display the signal waveforms sent by the lower computer in real time. The waveform data sampling rate and integrity of the signal directly affect its display effect. A high sampling rate can capture the instantaneous changes of the signal more accurately, ensuring that the waveform details of the signal are not lost or distorted, while a low sampling rate may cause distortion of the waveform data of the signal and fail to truly restore the shape of the signal.
[0003] However, in the related art, when the sampling rate of the signal is high, in order to ensure the integrity of the waveform, it is often necessary to increase the communication baud rate. However, due to hardware constraints, the communication baud rate cannot be increased, resulting in loss and distortion of the waveform data of the signal, affecting the accuracy and integrity of the signal waveform display. Therefore, how to ensure that the virtual oscilloscope displays accurate and complete signal waveforms is a technical problem that urgently needs to be solved. Summary of the Invention
[0004] Embodiments of this application provide an oscilloscope processing method for a virtual oscilloscope and an elevator system. The technical solutions are as follows:
[0005] In a first aspect, embodiments of this application provide an oscilloscope processing method for a virtual oscilloscope, which is applied to an electronic device. The method includes:
[0006] In response to a waveform drawing start operation, obtain waveform display configuration information, where the waveform display configuration information is used to instruct the automation control device to send device acquisition data to the electronic device according to a preset timer time;
[0007] Based on at least two target device threads, send the waveform display configuration information to the automation control device, obtain the device acquisition data sent by the automation control device according to the preset timer time, and perform waveform drawing processing based on the device acquisition data to obtain a target waveform.
[0008] In a second aspect, embodiments of this application provide an oscilloscope processing method for a virtual oscilloscope, which is applied to an automation control device. The method includes:
[0009] Obtain the waveform display configuration information sent by the electronic device, where the waveform display configuration information is obtained by the electronic device in response to a waveform drawing start operation;
[0010] Acquire device acquisition data based on the waveform display configuration information, determine the preset timer time based on the waveform display configuration information, and send the device acquisition data to the electronic device according to the preset timer time, so that the electronic device, based on at least two target device threads, executes sending the waveform display configuration information to the automation control device, acquiring the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain a target waveform.
[0011] In a third aspect, an embodiment of the present application provides an oscilloscope processing device for a virtual oscilloscope, which is applied to an electronic device. The device includes:
[0012] An information acquisition module, configured to acquire waveform display configuration information in response to a waveform drawing start operation, where the waveform display configuration information is used to instruct the automation control device to send device acquisition data to the electronic device according to a preset timer time;
[0013] A waveform drawing module, configured to execute, based on at least two target device threads, sending the waveform display configuration information to the automation control device, acquiring the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain a target waveform.
[0014] In a fourth aspect, an embodiment of the present application provides an oscilloscope processing device for a virtual oscilloscope, which is applied to an automation control device. The device includes:
[0015] An information receiving module, configured to acquire the waveform display configuration information sent by the electronic device, where the waveform display configuration information is acquired by the electronic device in response to a waveform drawing start operation;
[0016] A data sending module, configured to acquire device acquisition data based on the waveform display configuration information, determine a preset timer time based on the waveform display configuration information, and send the device acquisition data to the electronic device according to the preset timer time, so that the electronic device, based on at least two target device threads, executes sending the waveform display configuration information to the automation control device, acquiring the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain a target waveform.
[0017] In a fifth aspect, an embodiment of the present application provides a computer storage medium, which has multiple instructions, and the instructions are suitable for being loaded and executed by a processor to perform the above method.
[0018] In a sixth aspect, an embodiment of the present application provides an elevator system, including an electronic device and an automation control device. The electronic device is configured to execute the method described in the first aspect above, and the automation control device is configured to execute the method described in the second aspect above.
[0019] The beneficial effects brought by the technical solution provided by the embodiment of the present application at least include:
[0020] For the oscilloscope processing method of the virtual oscilloscope provided by the embodiment of the present application, in response to a waveform drawing start operation, waveform display configuration information for instructing the automation control device to periodically send device acquisition data is sent to the automation control device through at least two target device threads, device acquisition data periodically sent by the automation control device is obtained through at least two target device threads, and target waveforms are obtained through waveform drawing processing based on the device acquisition data by at least two target device threads. Thus, by sending configuration information in parallel through multiple threads, obtaining device acquisition data periodically sent by the automation control device, and drawing waveforms, not only can the software response speed of the virtual oscilloscope be effectively improved, but also the problem of data loss in high-sampling-rate data communication can be avoided, so as to ensure that accurate and complete signal waveforms can be generated and displayed by the virtual oscilloscope in high-sampling-rate data communication. Description of the Drawings
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention, and those skilled in the art can obtain other drawings without creative efforts based on these drawings.
[0022] Figure 1 is a schematic diagram of the scenario of an elevator system provided by an embodiment of the present application;
[0023] Figure 2 is a schematic flowchart of an oscilloscope processing method of a virtual oscilloscope provided by an embodiment of the present application;
[0024] Figure 3 is a schematic flowchart of another oscilloscope processing method of a virtual oscilloscope provided by an embodiment of the present application;
[0025] Figure 4 is a schematic flowchart of yet another oscilloscope processing method of a virtual oscilloscope provided by an embodiment of the present application;
[0026] Figure 5 is a schematic flowchart of a method for receiving and saving data by a serial port thread provided by an embodiment of the present application;
[0027] Figure 6It is a schematic flowchart of a method for a data parsing thread to parse data provided by an embodiment of the present application;
[0028] Figure 7 It is a schematic flowchart of another oscillogram processing method for a virtual oscilloscope provided by an embodiment of the present application;
[0029] Figure 8 It is a schematic flowchart of another oscillogram processing method for a virtual oscilloscope provided by an embodiment of the present application;
[0030] Figure 9 It is a schematic structural diagram of an oscillogram processing device for a virtual oscilloscope provided by an embodiment of the present application;
[0031] Figure 10 It is a schematic structural diagram of another oscillogram processing device for a virtual oscilloscope provided by an embodiment of the present application;
[0032] Figure 11 It is a schematic structural diagram of a terminal device provided by an embodiment of the present application. Detailed implementation manners
[0033] To make the objectives, features, and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.
[0034] In the description of the present application, it should be understood that terms such as "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. In the description of the present application, it should be noted that unless otherwise clearly defined and limited, 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 series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific situations. In addition, in the description of the present application, unless otherwise stated, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0035] Please refer to Figure 1 , which is a schematic diagram of a scenario of an elevator system provided by an embodiment of the present application. As Figure 1 shown, the elevator system may at least include an automated control device cluster and an electronic device.
[0036] In some embodiments, the automated control device cluster may include at least one automated control device. The automated control device may be a device responsible for specific tasks in the industrial control field. Optionally, the automated control device may be a total device composed of hardware devices such as a controller, a sensor connected to the controller, and an actuator, or the automated control device may directly be a controller. For example, in an automated production line, the automated control device may specifically be a programmable logic controller, a robot controller, etc.; in a heating, ventilation, and air conditioning (HVAC) system, the automated control device may specifically be a temperature / humidity controller, a fan controller, a heat pump / chiller controller, etc.; in a power system, the automated control device may specifically be a substation automation device, a power quality monitoring instrument, etc.; in a water treatment system, the automated control device may specifically be a water pump controller, a water quality monitoring instrument, etc.; in a material handling system, the automated control device may specifically be a conveyor belt control device, a crane control device; in a smart building system, the automated control device may specifically be a lighting control device, an access control controller, an elevator operation device, and so on.
[0037] In some embodiments, the electronic device may be an intelligent device with communication functions and supporting the operation of virtual oscilloscope software. The electronic device may specifically include, but is not limited to, a handheld device, a personal computer, a tablet computer, a vehicle-mounted device, a smartphone, a computing device, or other processing devices connected to a wireless modem, etc. In different networks, the electronic device may be called different names. For example: user equipment, access terminal, user unit, user station, mobile station, mobile phone, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device, cellular phone, cordless phone, personal digital assistant (PDA), an electronic device in a 5G network or a future evolved network, etc.
[0038] In one or more embodiments of the present application, an electronic device can establish a communication connection with at least one automation control device in an automation control device cluster, and complete data interaction during the oscilloscope processing of a virtual oscilloscope based on this communication connection. For example, in response to a waveform drawing start operation, the electronic device obtains waveform display configuration information, and the waveform display configuration information is used to instruct the automation control device to send device acquisition data to the electronic device according to a preset timer time; the electronic device executes sending the waveform display configuration information to the automation control device, obtaining the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain a target waveform based on at least two target device threads.
[0039] It should be noted that the electronic device and at least one automation control device in the automation control device cluster perform interactive communication by establishing a wired connection method or a wireless connection method, where the wireless connection method includes but is not limited to cellular network connection, wireless local area network connection, infrared connection, or Bluetooth connection, and the wired connection method includes but is not limited to Ethernet, universal serial bus (USB), serial communication interface, or controller area network. In one or more embodiments of the specification, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec), etc. are used to encrypt all or some links. Additionally, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. can be used to represent data (such as a target compressed package) exchanged through the network. Furthermore, in some other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the above data communication technologies.
[0040] The elevator system embodiments provided in this specification and the oscilloscope processing method of the virtual oscilloscope described in one or more embodiments belong to the same concept. The execution subject corresponding to the oscilloscope processing method of the virtual oscilloscope involved in one or more embodiments of the specification can be the above-mentioned electronic device or the above-mentioned automation control device, which is specifically determined based on the actual application environment. The specific implementation process of the elevator system embodiments can be seen in detail in the following method embodiments, which will not be elaborated here.
[0041] In one embodiment, as Figure 2 shown, a method for oscilloscope processing of a virtual oscilloscope is proposed. This method can be implemented relying on a computer program and can run on an oscilloscope processing device of a virtual oscilloscope based on the von Neumann architecture. This computer program can be integrated into an application or run as an independent tool-type application.
[0042] Specifically, the execution subject of the method for oscilloscope processing of the virtual oscilloscope is an electronic device, and this method includes:
[0043] S201, in response to a waveform drawing start operation, obtain waveform display configuration information.
[0044] In the embodiments of the present application, the waveform display configuration information is used to instruct an automated control device to send device acquisition data to the electronic device according to a preset timer time.
[0045] Among them, the waveform drawing start operation refers to an operation triggered in the virtual oscilloscope that is intended to indicate that the virtual oscilloscope starts to draw a signal waveform. The waveform drawing start operation can be triggered by a user or automatically triggered according to a timer. Specifically, the user can trigger the waveform drawing start operation by clicking on a waveform drawing start control; or, when the virtual oscilloscope is running, the timer detects that the current time reaches the set time and automatically triggers the waveform drawing start operation corresponding to the set time. Among them, a virtual oscilloscope is a computer application program that simulates the functions of a traditional hardware oscilloscope and is used to display and analyze signal waveforms. Different from a hardware oscilloscope, a virtual oscilloscope does not rely on dedicated hardware devices, but obtains signals through the processing power of a computer and connected external devices (such as an automated control device) and draws waveforms on the computer screen.
[0046] The waveform display configuration information refers to the settings or configuration parameters that control how waveforms are displayed on the virtual oscilloscope. The waveform display configuration information can specifically include, but is not limited to, signal sampling rate, signal channel definition, preset timer time, etc. For example, the signal sampling rate refers to how many data are collected per second, the signal channel definition can include the number of signal input channels, the identifier of each signal input channel, the signal type of each signal input channel, etc., and the preset timer time refers to the time when the automated control device automatically sends acquisition data to the electronic device.
[0047] In some embodiments, when performing step S201, after obtaining a waveform drawing start operation triggered by a user, or after obtaining a waveform drawing start operation automatically triggered by a timer, in response to this waveform drawing start operation, obtain waveform display configuration information from a configuration file.
[0048] Specifically, in addition to storing waveform display configuration information, the configuration file can also store serial port configuration parameters, waveform display styles, and other information. The various configuration information stored in the configuration file can be obtained through the input configuration operations of the configuration personnel. Among them, the serial port configuration parameters are used to initialize serial port communication. For example, the serial port configuration parameters can include parameters such as port number, baud rate, data bits, and stop bits. Before executing step S201, serial port communication is initialized through the serial port configuration parameters. For example, the waveform display style can include but is not limited to the color of the waveform, line thickness, whether to display grid lines, whether to display trigger points, etc.
[0049] S202, based on at least two target device threads, send the waveform display configuration information to the automation control device, obtain the device acquisition data sent by the automation control device based on the preset timer time, and perform waveform drawing processing based on the device acquisition data to obtain the target waveform.
[0050] Among them, the target device thread refers to the basic unit that executes the oscilloscope processing method program in the operating system. In the embodiments of the present application, there can be at least two different target device threads, and each target device thread is used to execute different tasks in the oscilloscope processing method program. Optionally, the target device thread can include a main thread and a serial port thread. The serial port thread can be used to execute the task of sending the waveform display configuration and the task of obtaining the device acquisition data, and the main thread can be used to execute the waveform drawing task.
[0051] The device acquisition data refers to the data that can be parsed by the electronic device generated after the automation control device acquires the signals of the corresponding hardware devices. Among them, the above-mentioned hardware devices can refer to sensors, actuators, etc. For example, in a heating, ventilation, and air conditioning system, the automation control device can specifically be composed of devices such as a temperature / humidity controller, a fan controller, a heat pump / chiller controller, etc., and the hardware device can be a temperature sensor and a humidity sensor connected to the temperature / humidity controller; for another example, in an intelligent building system, the automation control device is specifically lighting control equipment, an access control controller, an elevator operation device, etc., and the hardware device can be a corresponding sensor connected to the lighting control equipment, the hardware device can also be a corresponding sensor connected to the access control controller, and the hardware device can also be a corresponding sensor and a corresponding actuator in the elevator operation device. It can be understood that the signal data in the device acquisition data can include at least one of analog signals and digital signals.
[0052] The target waveform refers to the signal waveform drawn according to the signal change data in the device acquisition data.
[0053] In some embodiments, performing step S202 may be to, based on one of at least two target device threads (such as a serial port thread), send waveform display configuration information to the automation control device, obtain device acquisition data sent by the automation control device based on a preset timer time, and based on another of at least two target device threads (such as the main thread), perform waveform drawing processing on the device acquisition data to obtain a target waveform.
[0054] The oscilloscope processing method of the virtual oscilloscope provided by the embodiments of the present application, in response to a waveform drawing start operation, sends waveform display configuration information for instructing the automation control device to send device acquisition data at regular intervals to the automation control device through at least two target device threads, obtains device acquisition data sent by the automation control device at regular intervals through at least two target device threads, and performs waveform drawing processing on the device acquisition data through at least two target device threads to obtain a target waveform. Thus, by parallelly sending configuration information, obtaining device acquisition data sent by the automation control device at regular intervals, and drawing waveforms through multiple threads, not only can the software response speed of the virtual oscilloscope be effectively improved, but also the problem of data loss in high-sampling-rate data communication can be avoided, so as to ensure that the virtual oscilloscope generates and displays accurate and complete signal waveforms in high-sampling-rate data communication.
[0055] Next, please refer to Figure 3 , Figure 3 which is a schematic flowchart of another embodiment of an oscilloscope processing method of a virtual oscilloscope proposed by the present application.
[0056] Specifically, the execution subject of the oscilloscope processing method of the virtual oscilloscope is an electronic device, and the method includes:
[0057] S301, in response to a waveform drawing start operation, obtain waveform display configuration information.
[0058] Specifically, the implementation manner of step S301 can refer to the relevant part description of step S201 in the embodiment shown in Figure 2 and will not be elaborated here.
[0059] S302, send the waveform display configuration information to the automation control device through the serial port thread, obtain device acquisition data sent by the automation control device based on a preset timer time, and perform data parsing processing on the device acquisition data to obtain waveform sampling point data.
[0060] In some embodiments, the serial port thread may specifically include a data receiving thread and a data parsing thread, and performing step S302 may specifically be:
[0061] A1: Send the waveform display configuration information to the automation control device through the serial port thread;
[0062] A2: Obtain the device acquisition data sent by the automation control device based on the preset timer time through the data receiving thread, and store the device acquisition data in the receiving buffer;
[0063] A3: Through the data parsing thread, execute the operations of reading the device acquisition data from the receiving buffer, performing data frame interception processing on the device acquisition data to obtain the target data frame, and performing sampling point data extraction processing on the target data frame to obtain waveform sampling point data, and store the waveform sampling point data in the data point set.
[0064] Before step A1, it further includes: saving the waveform display configuration information to the serial port sending queue, and then step A1 can be: sending the waveform display configuration information from the serial port sending queue to the automation control device through the serial port thread; monitoring the configuration feedback information of the automation control device based on the preset waiting time; obtaining the configuration feedback information of the automation control device; if the configuration feedback information is of the configuration success type, create a data parsing thread.
[0065] Specifically, the serial port thread can execute the task of monitoring whether there is waveform display configuration information to be sent in the serial port sending queue, and when it is detected that there is waveform display configuration information to be sent in the serial port sending queue, execute the task of sending the waveform display configuration information to the automation control device.
[0066] Specifically, the configuration feedback information is used to reflect whether the automation control device is successfully configured according to the waveform display configuration information.
[0067] It can be understood that if the configuration feedback information is of the configuration success type, it means that the automation control device has successfully completed the relevant configuration tasks (such as configuring the signal input channel) according to the waveform display configuration. Then the electronic device can create a data parsing thread to perform data parsing tasks after obtaining the device acquisition data sent by the automation control device. If the configuration feedback information is of the configuration failure type, it means that the automation control device has not completed the relevant configuration tasks according to the waveform display configuration information. Then the electronic device can ignore creating a data parsing thread, generate a configuration failure prompt message, and output the configuration failure prompt message to remind the user that the configuration fails, so that the user can perform waveform configuration operations again according to the prompt message, or adjust the waveform display configuration information.
[0068] Optionally, if the configuration feedback information is of the configuration success type, in addition to creating a data parsing thread, the receiving buffer can also be cleared, so as to provide storage space for the data to be stored (i.e., the device acquisition data obtained from the automation control device).
[0069] In step A2, the tasks of obtaining the device acquisition data sent by the automation control device and storing the device acquisition data are executed by the data receiving thread. The automation control device automatically sends the device acquisition data to the electronic device based on the preset timer time. The data receiving thread can continuously monitor whether the device acquisition data arrives. Each time the device acquisition data is monitored to arrive, the device acquisition data is stored in the receiving buffer. In this way, data loss is avoided.
[0070] In step A3, the target data frame refers to the complete data frame intercepted from the device acquisition data. At least one target data frame can be intercepted from the device acquisition data. The waveform sampling point data includes the signal change values collected in chronological order.
[0071] Specifically, when executing step A3, the data frame interception process is performed on the device acquisition data by the data parsing thread to obtain the target data frame. It can be understood that: the data parsing thread determines whether there is a complete data frame in the device acquisition data according to the data frame start identifier, data frame end identifier, data length, and check code. When there is a complete data frame, the complete data frame is intercepted to obtain the target data frame.
[0072] When executing step A3, the waveform sampling point data is obtained by performing the sampling point data extraction process on the target data frame by the data parsing thread, and the waveform sampling point data is stored in the data point set. Specifically, it can include: the data parsing thread extracts the reference waveform sampling point data from the target data frame using the preset data frame protocol; determines the waveform sampling point data corresponding to at least one reference waveform channel from the reference waveform sampling point data according to the waveform display configuration information, stores the waveform sampling point data in the data point set buffer corresponding to the reference waveform channel, and deletes the waveform sampling point data from the receiving buffer.
[0073] Specifically, the preset data frame protocol can define what data is stored at what position in the complete data frame. The data parsing thread determines the storage position of the sampling point data in the target data frame according to the preset data frame protocol, and extracts the reference waveform sampling point data from the sampling point data storage position. The reference waveform sampling point data can include the waveform sampling point data corresponding to at least one reference waveform channel. The data parsing thread determines at least one reference waveform channel according to the waveform display configuration information, and then determines the waveform sampling point data corresponding to at least one reference waveform channel from the reference waveform sampling point data. There is a corresponding data point set buffer for each reference waveform channel, and the waveform sampling point data corresponding to the reference waveform channel is stored in the corresponding data point set buffer. It can be understood that the above-mentioned reference waveform channel refers to the signal input channel used to process signals in the virtual oscilloscope. In this way, the embodiment of the present application can store the waveform sampling point data corresponding to different reference waveform channels separately, which provides convenience for subsequent data reading and data processing.
[0074] Specifically, after storing the waveform sampling point data, the target data frame corresponding to the waveform sampling point data is deleted from the receive buffer. In this way, deleting the parsed target data frame from the buffer can save the storage space of the buffer.
[0075] S303. The waveform drawing thread performs waveform drawing processing on the waveform sampling point data to obtain the target waveform, and displays the target waveform on the waveform display interface.
[0076] In some embodiments, when step S303 executes the waveform drawing thread to perform waveform drawing processing on the waveform sampling point data to obtain the target waveform, it may specifically include: the waveform drawing thread reads all the waveform sampling point data corresponding to the reference waveform channel from the data point set buffer, and performs waveform drawing processing on all the waveform sampling point data to obtain the target waveform corresponding to the reference waveform channel.
[0077] Specifically, since each reference waveform channel corresponds to a data point set buffer, the waveform sampling point data corresponding to each reference waveform channel received from the automatic control device will be stored in the data point set buffer corresponding to each reference waveform channel. The waveform drawing thread can read all the waveform sampling point data corresponding to each reference waveform channel from the data point set buffer, and draw the target waveform corresponding to each reference waveform channel according to all the waveform sampling point data corresponding to each reference waveform channel.
[0078] Furthermore, after the waveform drawing thread draws the target waveform corresponding to each reference waveform channel, the target waveform corresponding to each reference waveform channel can be displayed on the waveform display interface of the virtual oscilloscope.
[0079] Optionally, the embodiments of the present application can also perform the following operations: obtain the signal sampling rate, the signal acquisition data volume, and the waveform update rate in the oscilloscope processing scenario; perform oscilloscope configuration detection processing on the signal sampling rate, the signal acquisition data volume, and the waveform update rate using the oscilloscope detection large model to obtain the target circular queue capacity, the target timer time, and the thread priority; generate an oscilloscope configuration prompt message based on the target circular queue capacity, the target timer time, and the thread priority, and output the oscilloscope configuration prompt message, where the target circular queue capacity is used to perform capacity configuration processing on the circular queue of the automation device, the target timer time is used to update the waveform display configuration information, and the thread priority is used to perform priority configuration processing on at least two target device threads. Further, after obtaining a new waveform drawing start operation, in response to the new waveform drawing start operation, obtain the updated waveform display configuration information, where the updated waveform display configuration information is used to instruct the automation control device to send device acquisition data to the electronic device according to the target timer time; perform sending the updated waveform display configuration information to the automation control device, obtaining the device acquisition data sent by the automation control device based on the target timer time, and performing waveform drawing processing based on the device acquisition data to obtain the target waveform based on at least two target device threads with updated priorities.
[0080] It can be understood that the signal sampling rate in the above oscilloscope processing scenario refers to the signal acquisition frequency set based on the device working conditions using expert experience. The above signal acquisition data volume refers to the number of signals to be acquired set by the configurator in the configuration interface of the virtual oscilloscope. The above waveform update rate refers to the rate at which the configurator sets the oscilloscope to update the waveform in the configuration interface of the virtual oscilloscope. The signal sampling rate affects the size of the circular queue capacity in the automation control device. For example, the lower the signal sampling rate, the smaller the circular queue capacity. The signal acquisition data volume affects the timer time for the automation control device to send the acquired data to the electronic device. For example, the larger the signal acquisition data volume, the smaller the interval of the timer time. The waveform update rate affects the priorities of the thread for the electronic device to execute the data acquisition task and the thread for drawing the waveform. For example, the larger the waveform update rate, the higher the priority of the thread for the electronic device to execute the waveform drawing task. Thus, by using the oscilloscope detection large model to obtain the target circular queue capacity, the target timer time, and the thread priority according to the signal sampling rate, the signal acquisition data volume, and the waveform update rate, the relevant configurations in the oscilloscope processing process can be changed according to user needs, increasing the software extensibility of the virtual oscilloscope.
[0081] The oscilloscope processing method of the virtual oscilloscope provided by the embodiment of the present application, in response to a waveform drawing start operation, obtains waveform display configuration information, sends the waveform display configuration information to an automation control device through a serial port thread, obtains device acquisition data sent by the automation control device based on a preset timer time, and performs data parsing processing on the device acquisition data to obtain waveform sampling point data. The waveform sampling point data is subjected to waveform drawing processing through a waveform drawing thread to obtain a target waveform, and the target waveform is displayed on a waveform drawing interface. In this way, by using multiple threads to parallelly send configuration information, obtain device acquisition data sent by the automation control device at regular intervals, and draw waveforms, each thread can process corresponding tasks in parallel, reducing the program response time, effectively improving the software response speed of the virtual oscilloscope, and avoiding data loss problems in high-sampling-rate data communication. Moreover, the automation control device sends data to the electronic device at regular intervals, eliminating the need for the electronic device to query data from the automation control device at regular intervals, thus avoiding data loss problems during data query due to the accuracy problem of the timer built into the electronic device. Therefore, the embodiment of the present application can ensure that the virtual oscilloscope generates and displays accurate and complete signal waveforms in high-sampling-rate data communication.
[0082] Please refer to Figure 4 , which is a schematic flowchart of another oscilloscope processing method of the virtual oscilloscope provided by the embodiment of the present application.
[0083] Specifically, the execution subject of the oscilloscope processing method of the virtual oscilloscope is an electronic device, and the method includes:
[0084] S401: Initialize components;
[0085] S402: Read a waveform configuration file and update the interface display according to the waveform configuration file;
[0086] S403: Create a serial port thread;
[0087] S404: Monitor whether a waveform drawing start control is clicked;
[0088] If the result of S404 is yes, then execute S405: Send the waveform display configuration information in the waveform configuration file to the automation control device;
[0089] If the result of S404 is no, then execute S411: Monitor whether a waveform drawing stop control is clicked;
[0090] S406: Monitor whether there is configuration feedback information of the configuration success type;
[0091] If the result of S406 is yes, then execute S407: Clear the receive buffer and create a data parsing thread;
[0092] If the result of S406 is No, then execute S408: Monitor whether the waveform drawing pause control is clicked;
[0093] If the result of S408 is Yes, then execute S410: Monitor the serial port communication status and the device status of the automation control device, and update the serial port communication status and the device status of the automation control device regularly;
[0094] If the result of S408 is No, then execute S409: Draw waveforms regularly;
[0095] If the result of S411 is Yes, then execute S412: Send a waveform drawing end command to the automation control device, and execute S413: End the data parsing thread;
[0096] If the result of S412 is No, then execute S408: Monitor whether the waveform drawing pause control is clicked.
[0097] It can be understood that in step S401, the initialized components may specifically include but are not limited to a communication interface component, a graphic display component, a user interface component, etc. The role of initializing the above components is to configure parameters, allocate resources, establish connections, and make the components in the correct initial state, so as to prepare for the normal operation of the virtual oscilloscope software, accurate data acquisition and display, and user interaction operations. Optionally, the timing of initializing the components can be determined according to the moment when the electronic device starts the virtual oscilloscope software. For example, at the moment when the electronic device starts the virtual oscilloscope software, create a main thread, and then start initializing the components through the main thread. Optionally, the electronic device can communicate with the automation control device through a serial port, then the communication interface component includes a serial port communication component. When initializing the serial port communication component, the parameters of the serial port can be set, such as baud rate, data bits, stop bits, parity bits, etc. During the initialization process, configure the serial port communication component according to these parameters to ensure that the electronic device can correctly transmit data with the automation control device. Optionally, initializing the graphic display component can be understood as making corresponding configurations for the waveform display area, such as setting the initial ranges of the horizontal axis (time axis) and the vertical axis (amplitude axis) of the waveform display area, etc.; if there is historical configuration information, the waveform color can also be initialized according to the waveform color defined in the historical configuration information. For example, set the waveform color of channel 1 to red and the waveform color of channel 2 to blue according to the historical configuration information. Optionally, initializing the user interface component can be understood as initializing the waveform drawing control, initializing the menu and toolbar. Among them, the waveform drawing control may include a waveform drawing start control, a waveform drawing pause control, a waveform drawing stop control. Initializing these controls specifically can be setting the initial states and appearances of these controls. Initializing the menu and toolbar can be understood as initializing the icons of each menu item and the toolbar, and initializing the layout of the menu items and the toolbar.
[0098] It can be understood that in step S402, the read waveform configuration file can be the waveform configuration file updated according to the configuration operations input by the user in the virtual oscilloscope software. Updating the interface display according to the waveform configuration file can be understood as updating the interface display according to the relevant definitions of the waveform channels in the waveform configuration file. For example, if the waveform configuration file defines the number of signal input channels selected by the user, the identifiers of the signal input channels, the signal types of the signal input channels, and the colors of the signal input channels, the interface display can be updated according to this information.
[0099] Optionally, in step S403, the method for the serial port thread to receive and save data can be specifically referred to Figure 5 the flow schematic diagram shown, and this method can include the following steps:
[0100] S501: Determine whether there is waveform display configuration information in the send buffer;
[0101] If the result of S501 is yes, then execute S502: Send the waveform display configuration information to the automation control device;
[0102] S503: Determine whether a data reception interrupt occurs;
[0103] If the result of S503 is yes, then execute S504: Save the device acquisition data sent by the automation control device to the data reception buffer.
[0104] It can be understood that in step S503, when the device acquisition data sent by the automation control device is received, a data reception interrupt occurs, and when the device acquisition data sent by the automation control device is not received, no data reception interrupt occurs.
[0105] It can be understood that if the result of S501 is no, then execute S503.
[0106] It can be understood that if the result of S503 is no, then execute S501.
[0107] Optionally, in step S407, the method for the data parsing thread to parse data can be specifically referred to Figure 6 the flow schematic diagram shown, and this method can include the following steps:
[0108] S601: Determine whether there is device acquisition data in the reception buffer;
[0109] If the result of S601 is yes, then execute S602: Perform data frame truncation processing on the device acquisition data to obtain the target data frame;
[0110] S603: Extract the sampled point data from the target data frame to obtain waveform sampled point data, and store the waveform sampled point data in the data point set;
[0111] S604: Delete the waveform sampled point data from the receive buffer.
[0112] It can be understood that if the result of S601 is negative, return to execute S601.
[0113] Specifically, for the implementation manners of steps S602 to S604, reference can be made to Figure 3 the descriptions of the relevant parts in the embodiments shown, which will not be elaborated here.
[0114] It can be understood that in step S408, by monitoring whether the waveform drawing pause control is clicked, so that when the waveform drawing pause control is clicked, the user's operation can be responded to in a timely manner, and the waveform drawing task is not performed, but data will still be received.
[0115] It can be understood that in step S409, for the implementation process of drawing the waveform, reference can be made to Figure 3 the descriptions of the relevant parts in the embodiments shown, which will not be elaborated here.
[0116] It can be understood that in step S410, the serial port communication state can specifically include the normal serial port communication state and the abnormal serial port communication state. If the electronic device can receive the data sent by the automation control device, the normal serial port communication state can be generated. If the electronic device cannot receive the data sent by the automation control device, the abnormal serial port communication state can be generated. The device state of the automation control device can be determined by the device query instruction additionally sent by the electronic device to the automation control device. The device state of the automation control device can specifically include the normal device state and the abnormal device state. When it is determined through the device query instruction that the automation control device is in the normal state, the normal device state can be generated. When it is determined through the device query instruction that the automation control device is in the abnormal state, the abnormal device state can be generated. In this way, by updating the serial port communication state and the device state of the automation control device, the electronic device can timely obtain the communication state and the state of the automation control device, and further enables the electronic device to flexibly adjust its work according to the above states.
[0117] In the oscilloscope processing method of the virtual oscilloscope provided in the embodiments of the present application, when the electronic device starts the virtual oscilloscope software, it creates a main thread and completes the above steps through the main thread, so as to provide an interface display to the user before the user starts the waveform drawing task. After the user starts the drawing task, the electronic device receives data from the automatic control device through the serial port thread, parses the received data through the data parsing thread, and then draws a waveform according to the parsed data to obtain a target waveform. In this way, by parallelizing the sending of configuration information, obtaining the data regularly sent by the automatic control device, and drawing waveforms through multiple threads, each thread can process the corresponding tasks in parallel, reducing the program response time, effectively improving the software response speed of the virtual oscilloscope, and avoiding data loss problems in high-sampling-rate data communication. Moreover, the automatic control device regularly sends data to the electronic device, eliminating the need for the electronic device to regularly query data from the automatic control device, thus avoiding data loss problems during data query due to the accuracy problem of the timer built into the electronic device. Therefore, the embodiments of the present application can ensure that the virtual oscilloscope generates and displays accurate and complete signal waveforms in high-sampling-rate data communication.
[0118] Next, please refer to Figure 7 , Figure 7 which is a schematic flowchart of another embodiment of an oscilloscope processing method of a virtual oscilloscope proposed in the present application.
[0119] Specifically, the execution subject of the oscilloscope processing method of the virtual oscilloscope is an automatic control device, and the method includes:
[0120] S701, obtaining waveform display configuration information sent by the electronic device.
[0121] In the embodiments of the present application, the waveform display configuration information is obtained by the electronic device in response to a waveform drawing start operation. Specifically, the definition of the waveform display configuration information, and the methods for the electronic device to obtain and send the waveform display configuration information can be referred to the description of the relevant parts in the Figure 2 illustrated embodiment, which will not be elaborated here.
[0122] Specifically, the automatic control device can receive the waveform display configuration information sent by the electronic device through the serial port.
[0123] S702, obtaining device acquisition data based on the waveform display configuration information, determining a preset timer time based on the waveform display configuration information, and sending the device acquisition data to the electronic device according to the preset timer time, so that the electronic device, based on at least two target device threads, executes sending the waveform display configuration information to the automatic control device, obtaining the device acquisition data sent by the automatic control device according to the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain a target waveform.
[0124] In some embodiments, the execution of S702 can be understood as follows: The automated control device parses the waveform display configuration information to obtain the channel-related information of the target waveform channel and the preset timer time. Based on the channel-related information of the target waveform channel, the automated control device completes the relevant configuration tasks of the target waveform channel, and collects the signal data corresponding to the target waveform channel from the hardware device corresponding to the target waveform channel. The automated control device generates device acquisition data based on the signal data corresponding to the target waveform channel. Then, according to the preset timer, the device acquisition data is sent to the electronic device, so that the electronic device, based on at least two target device threads, executes sending the waveform display configuration information to the automated control device, obtaining the device acquisition data sent by the automated control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain the target waveform.
[0125] In the oscilloscope processing method of the virtual oscilloscope provided by the embodiments of the present application, the automated control device obtains the waveform display configuration information sent by the electronic device, obtains the device acquisition data based on the waveform display configuration information, determines the preset timer time based on the waveform display configuration information, and sends the device acquisition data to the electronic device according to the preset timer time, so that the electronic device, based on at least two target device threads, executes sending the waveform display configuration information to the automated control device, obtaining the device acquisition data sent by the automated control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain the target waveform. In this way, the automated control device obtains the device acquisition data and the preset timer time according to the waveform display configuration information, so as to realize sending the device acquisition data to the electronic device at a fixed time, enabling the electronic device to send the configuration information in parallel through multiple threads, obtain the device acquisition data sent by the automated control device at a fixed time, and draw the waveform. This can not only effectively improve the software response speed of the virtual oscilloscope, but also avoid the problem of data loss in high-sampling-rate data communication, thereby ensuring that the virtual oscilloscope generates and displays accurate and complete signal waveforms in high-sampling-rate data communication.
[0126] Next, please refer to Figure 8 , Figure 8 which is a schematic flowchart of another embodiment of an oscilloscope processing method of a virtual oscilloscope proposed by the present application.
[0127] Specifically, the execution subject of the oscilloscope processing method of the virtual oscilloscope is an automated control device, and the method includes:
[0128] S801, obtaining the waveform display configuration information sent by the electronic device.
[0129] Specifically, the implementation manner of step S801 can be referred to Figure 7 the relevant part descriptions in the embodiments shown, and will not be elaborated here.
[0130] S802, Configure the target waveform channel based on the waveform display configuration information, and determine the target sampling rate from the waveform display configuration information.
[0131] It can be understood that the target waveform channel refers to the signal input channel in the virtual oscilloscope for processing signals. Configuring the target waveform channel based on the waveform display configuration information can be understood as parsing the waveform display configuration information to obtain the number of signal input channels, the identification of each signal input channel, the signal type of each signal input channel, etc., allocating memory addresses for each channel according to the relevant information of the above channels, and associating the memory addresses of each channel with the identification of each channel, so as to store the signal data of each channel collected subsequently to the corresponding addresses. Parsing the waveform display configuration information can not only obtain the relevant information of the above channels, but also obtain the signal sampling rate corresponding to each channel (such as how much data is collected per second), and use the signal sampling rate as the target sampling rate.
[0132] S803, Collect the device acquisition data corresponding to the target waveform channel at the target sampling rate, and generate a data acquisition flag.
[0133] Specifically, step S803 can be understood as collecting the signal data corresponding to the target waveform channel from the hardware device corresponding to the target waveform channel at the target sampling rate corresponding to each target waveform channel, and generating device acquisition data based on the signal data.
[0134] Specifically, generating a data acquisition flag can be understood as setting a preset data acquisition variable to a preset value. For example, setting the value of the preset data acquisition variable to a fixed value of 1. The data acquisition flag can be used to indicate whether to perform the task of saving the device acquisition data to the circular queue. For example, when the data acquisition flag is valid, it indicates the task of saving the device acquisition data to the circular queue, and when the data acquisition flag is invalid, it indicates to ignore the task of saving the device acquisition data to the circular queue.
[0135] S804, Determine the preset timer time based on the waveform display configuration information.
[0136] Specifically, in step S804, parsing the waveform display configuration information can not only obtain the relevant information of the above channels, but also obtain the preset timer time. The preset timer time is the time when the automation control device periodically sends the device acquisition data to the electronic device. In this way, the automation control device periodically sends the device acquisition data to the electronic device, without the electronic device using the timer period to send query instructions to the automation control device to obtain the device acquisition data, which can avoid data loss problems caused by the timer accuracy of the electronic device.
[0137] S805, Detect whether a data acquisition flag is generated.
[0138] S806. If the data acquisition flag is of the valid flag type, save the device acquisition data to the circular queue, and send the device acquisition data from the circular queue to the electronic device according to the preset timer time, so that the electronic device, based on at least two target device threads, executes sending waveform display configuration information to the automation control device, obtaining the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain the target waveform.
[0139] Specifically, in step S805, by detecting whether the preset data acquisition variable is the preset value, it is determined whether a data acquisition flag is generated. When the preset data acquisition variable is the preset value, it can be confirmed that a data acquisition flag has been generated, or it can be understood that the data acquisition flag is of the valid flag type. When the data acquisition variable is not the preset value, it can be confirmed that no data acquisition flag is generated, or it can be understood that the data acquisition flag is of the invalid flag type.
[0140] In step S806, if the data acquisition flag is of the valid flag type, the automation control device executes the task of saving the device acquisition data to the circular queue. Further, the automation control device sends the device acquisition data from the circular queue to the electronic device according to the preset timer time. In this way, by saving the device acquisition data to be sent to the circular queue, the automation control device can effectively solve the problem of data loss in high-sampling-rate data communication.
[0141] It can be understood that the electronic device, based on at least two target device threads, executes sending waveform display configuration information to the automation control device, obtaining the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain the target waveform. The specific implementation method of this step can be referred to Figure 2 or Figure 3 the description of the relevant part in the embodiments shown, which will not be elaborated here.
[0142] It can also be understood that the oscilloscope processing method of the virtual oscilloscope provided in this embodiment further includes: when receiving the waveform drawing end command sent by the electronic device, stop the acquisition device from acquiring data. After the automation control device stops the acquisition device from acquiring data, it can also execute a preset logic program to complete other logic tasks except the data acquisition task.
[0143] The oscilloscope processing method of the virtual oscilloscope provided by the embodiment of the present application is as follows: The automation control device obtains waveform display configuration information sent by the electronic device, configures the target waveform channel based on the waveform display configuration information, determines the target sampling rate from the waveform display configuration information, acquires device acquisition data corresponding to the target waveform channel at the target sampling rate, and generates a data acquisition flag. Based on the waveform display configuration information, the preset timer time is determined, and it is detected whether the data acquisition flag is generated. If the data acquisition flag is of the flag valid type, the device acquisition data is saved to the circular queue, and the device acquisition data is sent from the circular queue to the electronic device according to the preset timer time, so that the electronic device, based on at least two target device threads, executes sending the waveform display configuration information to the automation control device, acquiring the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain the target waveform. Thus, the automation control device acquires data according to the waveform display configuration information sent by the electronic device, and can also send the device acquisition data to the electronic device at a fixed time according to the preset timer time indicated by the waveform display configuration information, without the electronic device using the timer period to send query instructions to the automation control device to obtain the device acquisition data, which can avoid the data loss problem caused by the timer accuracy of the electronic device. Moreover, by saving the device acquisition data to be sent to the circular queue, the automation control device can effectively solve the data loss problem in high-sampling-rate data communication. In addition, by sending configuration information, acquiring the device acquisition data sent by the automation control device at a fixed time, and drawing waveforms in parallel through multiple threads, the electronic device can not only effectively improve the software response speed of the virtual oscilloscope, but also avoid the data loss problem in high-sampling-rate data communication, so as to ensure that the virtual oscilloscope generates and displays accurate and complete signal waveforms in high-sampling-rate data communication.
[0144] Please refer to Figure 9 , which is a schematic structural diagram of an oscilloscope processing device of a virtual oscilloscope provided by an embodiment of the present application. It should be noted that Figure 9 The oscilloscope processing device of the virtual oscilloscope shown is used to execute the method of the embodiment of the present application Figures 2 - 6 shown. For the sake of convenience of description, only the parts related to the embodiment of the present application are shown. For the specific technical details not disclosed, please refer to the embodiment of the present application Figures 2 - 6 shown.
[0145] Please refer to Figure 9 , which shows a schematic structural diagram of an oscilloscope processing device of a virtual oscilloscope according to an embodiment of the present application. The oscilloscope processing device 1 of the virtual oscilloscope can be implemented as all or part of the device through software, hardware, or a combination of both. According to some embodiments, the oscilloscope processing device 1 of the virtual oscilloscope includes an information acquisition module 11 and a waveform drawing module 12, and is specifically used for:
[0146] An information acquisition module 11, configured to acquire waveform display configuration information in response to a waveform drawing start operation, where the waveform display configuration information is used to instruct the automation control device to send device acquisition data to the electronic device according to a preset timer time;
[0147] A waveform drawing module 12, configured to execute, based on at least two target device threads, sending the waveform display configuration information to the automation control device, acquiring the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain a target waveform.
[0148] Optionally, the waveform drawing module 12 includes:
[0149] A first drawing unit, configured to send the waveform display configuration information to the automation control device through a serial port thread, acquire the device acquisition data sent by the automation control device based on the preset timer time, and perform data parsing processing on the device acquisition data to obtain waveform sampling point data;
[0150] A second drawing unit, configured to perform waveform drawing processing on the waveform sampling point data through a waveform drawing thread to obtain a target waveform, and display the target waveform on a waveform drawing interface.
[0151] Optionally, the serial port thread includes a data receiving thread and a data parsing thread, and the first drawing unit includes:
[0152] A first drawing subunit, configured to acquire the device acquisition data sent by the automation control device based on the preset timer time through the data receiving thread, and store the device acquisition data into a receiving buffer;
[0153] A second drawing subunit, configured to execute, through the data parsing thread, reading the device acquisition data from the receiving buffer, performing data frame interception processing on the device acquisition data to obtain a target data frame, and performing sampling point data extraction processing on the target data frame to obtain waveform sampling point data, and storing the waveform sampling point data into a data point set.
[0154] Optionally, the second drawing subunit is specifically configured to:
[0155] Extract reference waveform sampling point data from the target data frame through the data parsing thread using a preset data frame protocol;
[0156] Determine the waveform sampling point data corresponding to at least one reference waveform channel from the reference waveform sampling point data according to the waveform display configuration information, store the waveform sampling point data into the data point set buffer area corresponding to the reference waveform channel, and delete the target data frame corresponding to the waveform sampling point data from the receiving buffer area.
[0157] Optionally, the second drawing unit is specifically configured to:
[0158] Read all the waveform sampling point data corresponding to the reference waveform channel from the data point set buffer area through a waveform drawing thread, and perform waveform drawing processing on all the waveform sampling point data to obtain the target waveform corresponding to the reference waveform channel.
[0159] Optionally, the oscilloscope processing device of the virtual oscilloscope further includes: a data saving module, which saves the waveform display configuration information to the serial port sending queue;
[0160] The first drawing unit is specifically configured to:
[0161] Send the waveform display configuration information to the automation control device from the serial port sending queue through a serial port thread;
[0162] Monitor the configuration feedback information of the automation control device based on a preset waiting time.
[0163] Optionally, the first drawing unit is further configured to:
[0164] Obtain the configuration feedback information of the automation control device;
[0165] If the configuration feedback information is of the configuration success type, create a data parsing thread.
[0166] Please refer to Figure 10 , which is a schematic structural diagram of an oscilloscope processing device of a virtual oscilloscope provided by an embodiment of the present application. It should be noted that Figure 10 The shown oscilloscope processing device of the virtual oscilloscope is used to execute the method of the embodiment of the present application Figures 7 - 8 Shown in the embodiment. For the sake of convenience of description, only the parts related to the embodiment of the present application are shown. For the specific technical details not disclosed, please refer to the embodiment Figures 7 - 8 Shown in the present application.
[0167] Please refer to Figure 10 , which shows a schematic structural diagram of an oscilloscope processing device of a virtual oscilloscope according to an embodiment of the present application. The oscilloscope processing device 2 of the virtual oscilloscope can be implemented as all or part of the device through software, hardware, or a combination of both. According to some embodiments, the oscilloscope processing device 2 of the virtual oscilloscope includes an information receiving module 21 and a data sending module 22, and is specifically configured to:
[0168] An information receiving module 21, configured to obtain waveform display configuration information sent by the electronic device, where the waveform display configuration information is obtained by the electronic device in response to a waveform drawing start operation;
[0169] A data sending module 22, configured to obtain device acquisition data based on the waveform display configuration information, determine a preset timer time based on the waveform display configuration information, and send the device acquisition data to the electronic device according to the preset timer time, so that the electronic device, based on at least two target device threads, executes sending the waveform display configuration information to the automation control device, obtaining the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain a target waveform.
[0170] Please refer to Figure 11 , Figure 11 which is a schematic structural diagram of a terminal device provided in an embodiment of the present application. Specifically, the terminal device may be the electronic device or the automation control device described in the above embodiments. Exemplarily, the terminal device in the embodiment of the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected through the bus 150.
[0171] The processor 110 may include one or more processing cores. The processor 110 connects various parts within the entire electronic device using various interfaces and circuits. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and by invoking data stored in the memory 120, it performs various functions of the electronic device and processes data. Optionally, the processor 110 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 110 may integrate a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for rendering and drawing the display content; the modem is used to process wireless communications. It can be understood that the above modem may not be integrated into the processor 110 and may be implemented separately through a communication chip.
[0172] The memory 120 may include random access memory (RAM) and may also include read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the following various method embodiments, etc. The operating system may be the Android system, including a system developed based on the Android system in depth, the IOS system developed by Apple Inc., including a system developed based on the IOS system in depth, or other systems.
[0173] In order for the operating system to distinguish the specific application scenarios of third-party application programs, it is necessary to establish data communication between the third-party application programs and the operating system, so that the operating system can obtain the current scenario information of the third-party application programs at any time, and then perform targeted system resource adaptation based on the current scenario.
[0174] Among them, the input device 130 is used to receive input instructions or data. The input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output instructions or data. The output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 are a touch display screen.
[0175] The touch display screen can be designed as a full-screen, a curved screen, or a special-shaped screen. The touch display screen can also be designed as a combination of a full-screen and a curved screen, or a combination of a special-shaped screen and a curved screen. The embodiments of the present application do not limit this.
[0176] In addition, those skilled in the art can understand that the structure of the terminal device shown in the above drawings does not constitute a limitation on the terminal device. The terminal device may include more or fewer components than shown in the drawings, or combine some components, or have different component arrangements. For example, the terminal device further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a Wireless Fidelity (WiFi) module, a power supply, a Bluetooth module, etc., which will not be elaborated here.
[0177] In Figure 11 In the terminal device shown, in one embodiment, the processor 110 can be used to call the program of the oscilloscope processing method of the virtual oscilloscope stored in the memory 120, and specifically perform the following operations:
[0178] In response to a waveform drawing start operation, obtain waveform display configuration information, where the waveform display configuration information is used to instruct the automation control device to send device acquisition data to the electronic device according to a preset timer time;
[0179] Based on at least two target device threads, execute sending the waveform display configuration information to the automation control device, obtaining the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain a target waveform.
[0180] In another embodiment, the processor 110 can be used to call the program of the oscilloscope processing method of the virtual oscilloscope stored in the memory 120, and specifically perform the following operations:
[0181] Obtain the waveform display configuration information sent by the electronic device, where the waveform display configuration information is obtained by the electronic device in response to a waveform drawing start operation;
[0182] Acquire device acquisition data based on the waveform display configuration information, determine the preset timer time based on the waveform display configuration information, and send the device acquisition data to the electronic device according to the preset timer time, so that the electronic device executes, based on at least two target device threads, sending the waveform display configuration information to the automation control device, acquiring the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain a target waveform.
[0183] In addition, those skilled in the art can understand that the structure of the terminal device shown in the above drawings does not constitute a limitation on the terminal device. The terminal device may include more or fewer components than those shown in the drawings, or combine some components, or have different component arrangements. For example, the terminal device also includes components such as a radio frequency circuit, an audio circuit, a WiFi component, a power supply, and a Bluetooth component, which will not be elaborated here.
[0184] The embodiment of the present application also provides a computer-readable storage medium. The computer storage medium stores at least one instruction, and the at least one instruction is used to be executed by a processor to implement the oscilloscope processing method of the virtual oscilloscope as described in the above various embodiments.
[0185] The embodiment of the present application also provides a computer program product. The computer program product stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the oscilloscope processing method of the virtual oscilloscope as described in the above various embodiments.
[0186] Those skilled in the art should be able to realize that in the above one or more examples, the functions described in the embodiments of the present application can be implemented by hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. The computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium accessible by a general-purpose or special-purpose computer.
[0187] The above are only optional embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An oscilloscope processing method of a virtual oscilloscope, characterized in that: Applied to electronic equipment, the method comprises: In response to a waveform drawing start operation, waveform display configuration information is acquired, where the waveform display configuration information is used to instruct the automation control device to send device acquisition data to the electronic device according to a preset timer time; Based on at least two target device threads, the waveform display configuration information is sent to the automation control device, the device acquisition data sent by the automation control device based on the preset timer time is acquired, and waveform drawing processing is performed based on the device acquisition data to obtain the target waveform.
2. The method according to claim 1, characterized in that The step of sending the waveform display configuration information to the automation control device based on at least two target device threads, acquiring the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain the target waveform includes: Sending the waveform display configuration information to the automation control device through a serial port thread, acquiring the device acquisition data sent by the automation control device based on the preset timer time, and performing data analysis and processing on the device acquisition data to obtain waveform sampling point data; The waveform drawing thread performs waveform drawing processing on the waveform sampling point data to obtain a target waveform, and displays the target waveform on a waveform drawing interface.
3. The method according to claim 2, characterized in that The serial port thread includes a data receiving thread and a data parsing thread, and the acquiring of the device acquisition data sent by the automation control device based on the preset timer time through the serial port thread, and the data parsing processing of the device acquisition data to obtain waveform sampling point data, including: Acquire the device collected data sent by the automation control device based on the preset timer time through the data receiving thread, and store the device collected data in a receiving buffer area; The data parsing thread is used to read the device acquisition data from the receiving buffer area, perform data frame interception processing on the device acquisition data to obtain a target data frame, perform sampling point data extraction processing on the target data frame to obtain waveform sampling point data, and store the waveform sampling point data in a data point set.
4. The method according to claim 3, characterized in that The extracting of sampling point data from the target data frame by the data parsing thread to obtain waveform sampling point data, and storing the waveform sampling point data in a data point set, comprises: Extracting reference waveform sampling point data from the target data frame by using a preset data frame protocol through the data parsing thread; Determine waveform sampling point data corresponding to at least one reference waveform channel from the reference waveform sampling point data according to the waveform display configuration information, store the waveform sampling point data in a data point set buffer area corresponding to the reference waveform channel, and delete a target data frame corresponding to the waveform sampling point data from the receiving buffer area.
5. The method according to claim 4, characterized in that The waveform drawing process is performed on the waveform sampling point data by a waveform drawing thread to obtain a target waveform, including: All waveform sampling point data corresponding to the reference waveform channel are read from the data point set buffer area through a waveform drawing thread, and waveform drawing processing is performed on all waveform sampling point data to obtain a target waveform corresponding to the reference waveform channel.
6. The method according to claim 2, characterized in that The method further comprises: saving the waveform display configuration information to a serial port transmission queue; The step of sending the waveform display configuration information to the automation control device through a serial port thread includes: Sending the waveform display configuration information from the serial port sending queue to the automation control device through a serial port thread; Monitoring the configuration feedback information of the automation control device based on a preset waiting time; Obtaining configuration feedback information of the automation control device; If the configuration feedback information is of a configuration success type, a data parsing thread is created.
7. An oscilloscope processing method for a virtual oscilloscope, characterized in that: Applied to automatic control equipment, the method comprises: Acquire waveform display configuration information sent by the electronic device, wherein the waveform display configuration information is acquired by the electronic device in response to a waveform drawing start operation; The device acquisition data is acquired based on the waveform display configuration information, a preset timer time is determined based on the waveform display configuration information, and the device acquisition data is sent to the electronic device according to the preset timer time, so that the electronic device, based on at least two target device threads, executes sending the waveform display configuration information to the automation control device, acquiring the device acquisition data sent by the automation control device based on the preset timer time, and performing waveform drawing processing based on the device acquisition data to obtain a target waveform.
8. The method according to claim 7, characterized in that The acquiring device acquisition data based on the waveform display configuration information includes: configuring a target waveform channel based on the waveform display configuration information, and determining a target sampling rate from the waveform display configuration information; The device acquisition data corresponding to the target waveform channel is acquired at the target sampling rate, and a data acquisition mark is generated.
9. The method according to claim 8, characterized in that The sending the device collected data to the electronic device according to the preset timer time includes: Detecting whether the data collection flag is generated; If the data collection flag is a flag valid type, the device collected data is saved in a ring queue, and the device collected data is sent from the ring queue to the electronic device according to the preset timer time.
10. An elevator system, characterized in that: The method comprises an electronic device and an automatic control device, wherein the electronic device is used to execute the method according to any one of claims 1 to 6, and the automatic control device is used to execute the method according to any one of claims 7 to 9.