A method and system for plotting a voltage waveform graph based on a sequence of voltage variations
By calculating the start and end times and voltage values of the voltage fluctuation sequence, the time-voltage fluctuation points are separated into two time-voltage pairs, and a voltage waveform diagram is plotted. This solves the problem in existing technologies that cannot display voltage fluctuations without directly measuring the voltage, and realizes intuitive display in power fluctuation testing of vehicle-mounted embedded controllers.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING YINWO AUTOMOBILE TECH CO LTD
- Filing Date
- 2022-12-01
- Publication Date
- 2026-05-15
AI Technical Summary
Existing methods for drawing voltage waveforms are not applicable when there is only a sequence of voltage changes, and cannot intuitively display voltage fluctuations to users without directly measuring the voltage.
The start and end times and voltage values of voltage fluctuation points are calculated based on the voltage fluctuation sequence. The time-voltage fluctuation points are split into two time-voltage pairs, which are added to the plotting queue in sequence to draw the voltage waveform.
It enables users to intuitively display voltage fluctuations without measuring the voltage, making it suitable for power fluctuation testing of automotive embedded controllers.
Smart Images

Figure CN115932359B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive electronic equipment technology, and more specifically to a method and system for plotting voltage waveforms based on voltage variation sequences. Background Technology
[0002] The actual operating conditions of automotive embedded controllers are quite complex. In the later stages of production, it is necessary to simulate the real vehicle environment and conduct power fluctuation tests on the automotive embedded controllers. Power fluctuation tests are used to test the operation of embedded systems under different power fluctuations. For example, automotive embedded controllers are usually required to work stably under 9-16V input.
[0003] In the process of power fluctuation testing of vehicle-mounted embedded controllers, the current test scheme is as follows: the host computer sends the voltage change sequence to the programmable power supply, which is responsible for the actual voltage output. The programmable power supply outputs voltage to the vehicle-mounted embedded controller according to the voltage change command. Since there are many types of vehicle-mounted embedded controllers, in order to simplify the system, a separate testing host computer is used to test the vehicle-mounted embedded controller.
[0004] A voltage change sequence refers to a set of voltage change commands. For example, in programmable power supply programming control, a pair of (T, VS, VE, t) sequences needs to be sent. That is, within a time period of duration T, the voltage changes from the initial voltage VS to the final voltage VE. This (T, VS, VE, t) pair is the voltage change sequence, where t is a timestamp. The voltage change sequence is sent from the control host computer to the detection host computer. In the detection host system, because there is no corresponding voltage detection device, the voltage cannot be directly measured, but there is a need to display it to the user. However, setting up additional voltage detection device would only increase costs.
[0005] The existing method for drawing voltage waveforms typically involves continuously averaging voltage measurements over a short period of time and plotting these time and voltage values consecutively to create a continuous voltage waveform. However, this method is not suitable when there is only a sequence of voltage changes, where data is recorded only when the voltage changes.
[0006] Therefore, there is an urgent need for a method that can plot voltage waveforms based on voltage change sequences, so as to be applied in test scenarios where voltage cannot be directly measured but where it is necessary to intuitively display voltage fluctuations to users. Summary of the Invention
[0007] To address the aforementioned problems, this invention provides a method, system, apparatus, and storage medium for plotting voltage waveforms based on voltage variation sequences. It provides a way to plot waveforms based on time-series voltage values, allowing users to intuitively display voltage fluctuations without measuring the voltage.
[0008] The technical solution is as follows: A method for plotting voltage waveforms based on voltage variation sequences, characterized by the following steps:
[0009] Step 1: Obtain the voltage change sequence from the voltage change command, obtain the end time of the voltage change sequence based on the voltage change sequence, and calculate the voltage value at the end time;
[0010] Step 2: Calculate the start time of the voltage fluctuation sequence based on the voltage fluctuation sequence, and calculate the voltage value at the start time;
[0011] Step 3: Combine the start time and start voltage to form a time-voltage pair, add it to the drawing queue, and use it as the first node to be drawn in the drawing queue;
[0012] Step 4: Split the voltage variation points with timestamps between the start and end times into two time-voltage pairs and add them to the drawing queue in chronological order. The timestamp of the first time-voltage pair is the timestamp of the current voltage variation point that meets the conditions, and the voltage value of the first time-voltage pair is the start time voltage value of the voltage variation point. The timestamp of the second voltage time pair is the timestamp of the current voltage variation point plus the sampling duration of the current voltage variation point, and the voltage value of the second voltage time pair is the end time voltage value of the voltage variation point.
[0013] Step 5: Combine the end time and the voltage value at the end time to form a time-voltage pair, add it to the drawing queue, and use it as the last node to be drawn;
[0014] Step 6: Draw the voltage waveforms sequentially according to the drawing queue.
[0015] Furthermore, in step 1, the end time and the voltage value at the end time of the voltage fluctuation sequence are calculated as follows:
[0016] Assuming there is a time-voltage variation sequence set A = {[T] x ,VS x ,VE x ,t x ], x∈(1,n)+, where T x Let VS be the sampling duration of the x-th time voltage variation point in the time voltage variation sequence set A. x Let VE be the initial voltage value at the x-th time voltage variation point. x Let t be the voltage value at the end of the x-th time voltage variation point. x This is the timestamp of the x-th voltage change point.
[0017] End time t of the voltage variation sequence e The calculation is as follows:
[0018] If the last voltage fluctuation point has its own timestamp t, and the error between this timestamp and the local time (t) is Δt, then the end time t e The calculation formula is as follows: t e =t+Δt
[0019] The voltage value V at the end of the voltage variation sequence e The calculation is as follows:
[0020] If t is satisfied e If V is less than t1, then e =VS1, where t1 is the timestamp of the first time voltage change point, and VS1 is the starting time voltage value of the first time voltage change point;
[0021] If t is satisfied e Greater than t n Then V e =VE n , where t n Let VE be the timestamp of the nth time voltage change point. n This represents the voltage value at the end of the nth time voltage variation point.
[0022] Otherwise, find the time-voltage variation point x in the time-voltage variation sequence such that t x ≤t e ≤t x+1 , where t x and t x+1 The timestamps for two adjacent voltage change points;
[0023] If t is satisfied e ≥t x +T x Then V e =VE x Otherwise, V e =VS x +(VE x -VS x )*(t e -t x ) / T x ;
[0024] Among them, T x Let VE be the duration of the voltage variation point x. x The voltage value at the end of the voltage variation point x is VS. x Let t be the initial voltage value at time point x, where t is the voltage variation point. x The timestamp is the point x where the voltage changes over time.
[0025] Furthermore, in step 2, the start time t of the voltage variation sequence sand the starting point voltage value V s is calculated as follows:
[0026] Calculate the starting time t s , assuming the total length of the time of the plotted waveform is TM. If t e - t1 < TM, then t s = t1, otherwise t s = t e - TM, where t1 is the timestamp of the first time voltage change point;
[0027] The starting time voltage value V of the voltage change sequence s is calculated as follows:
[0028] If t s is less than t1, then V s = VS1, where t1 is the timestamp of the first time voltage change point and VS1 is the starting time voltage value of the first time voltage change point;
[0029] If t s is greater than t n , then V s = VE n , where t n is the timestamp of the nth time voltage change point and VE n is the ending time voltage value of the nth time voltage change point;
[0030] Otherwise, find the time voltage change point x in the time voltage change sequence such that t x ≤ t s ≤ t x+1 , where t x and t x+1 are the timestamps of two adjacent time voltage change points;
[0031] If t s ≥ t x + T x , then V s = VE x , otherwise, V s = VS x + (VE x - VS x ) * (t s - t x ) / T x ;
[0032] where, T x is the duration of the time voltage change point x, VE x is the ending time voltage value of the time voltage change point x, VS xLet t be the initial voltage value at time point x, where t is the voltage variation point. x The timestamp is the point x where the voltage changes over time.
[0033] Furthermore, in step 4, for all timestamps in the time-voltage variation sequence set A that satisfy t s ≤t x ≤t e The time-voltage variation point x is decomposed into (t) x ,VS s ) and (t x +T x ,VE s Two points are added to the drawing queue in sequence.
[0034] Furthermore, in step 6, continuous waveforms are drawn sequentially according to the drawing queue, and the steps are as follows:
[0035] Establish a coordinate system with time as the horizontal axis and voltage as the vertical axis;
[0036] Determine the scale of the horizontal and vertical axes. The scale of the horizontal axis is equal to the width of the drawn image divided by the total drawing time TM, and the scale of the vertical axis is equal to the length of the drawn image divided by the maximum voltage value.
[0037] Points are taken sequentially from the drawing queue in chronological order (t). x V x Multiply each point by the scale of the horizontal and vertical axes to obtain the points in the voltage waveform diagram. Connect the points sequentially from the first point to the last point to obtain the voltage waveform diagram.
[0038] A system for plotting voltage waveforms based on voltage variation sequences, characterized in that it includes:
[0039] The end parameter acquisition module is used to acquire the voltage variation sequence, obtain the end time of the voltage variation sequence based on the voltage variation sequence, and calculate the voltage value at the end time.
[0040] The initial parameter acquisition module is used to calculate the start time of the voltage variation sequence based on the voltage variation sequence, and to calculate the voltage value at the start time.
[0041] The starting point acquisition module is used to construct a time-voltage pair from the starting time and the starting voltage, add it to the drawing queue, and use it as the first node to be drawn.
[0042] The intermediate point acquisition module is used to split the voltage change points with timestamps between the start time and the end time into two time-voltage pairs and add them to the drawing queue in chronological order. The timestamp of the first time-voltage pair is the timestamp of the current voltage change point that meets the conditions, and the voltage value of the first time-voltage pair is the start time voltage value of the voltage change point. The timestamp of the second voltage time pair is the timestamp of the current voltage change point plus the sampling duration of the current voltage change point, and the voltage value of the second voltage time pair is the end time voltage value of the voltage change point.
[0043] The end point acquisition module is used to construct a time-voltage pair from the end time and the end time voltage value, and add it to the drawing queue as the last node to be drawn;
[0044] The waveform drawing module is used to draw voltage waveforms sequentially according to the drawing queue.
[0045] A system for testing power fluctuations in automotive embedded devices, characterized in that it includes components connected to:
[0046] A programmable power supply, wherein there is one and only one programmable power supply, which is used to output voltages of different amplitudes according to voltage change commands to perform power fluctuation tests.
[0047] A host computer is connected to the programmable power supply and is used to control the output voltage of the programmable power supply.
[0048] An in-vehicle embedded controller is provided, and at least one in-vehicle embedded controller is provided; the programmable power supply is connected to the in-vehicle embedded controller and is used to supply power to the in-vehicle embedded controller;
[0049] A detection host computer is connected to the control host computer and the vehicle-mounted embedded controller, and is used to detect the working status of the connected vehicle-mounted embedded controller and feed it back to the control host computer;
[0050] A voltage waveform display device, wherein the voltage waveform display device uses the above-described method for drawing voltage waveform diagrams based on voltage variation sequences to draw voltage waveform diagrams.
[0051] A computer device, characterized in that it comprises: a processor, a memory, and a program;
[0052] The program is stored in the memory, and the processor calls the program stored in the memory to execute the above-described method for drawing voltage waveforms based on voltage variation sequences.
[0053] A computer-readable storage medium is characterized in that: the computer-readable storage medium is used to store a program for executing the above-described method for drawing voltage waveforms based on voltage variation sequences.
[0054] This invention provides a method for plotting voltage waveforms based on voltage variation sequences. Given a known voltage variation command, a voltage variation sequence containing duration, start voltage, end voltage, and timestamp is extracted from the command. The voltage waveform can be plotted based on this sequence without voltage measurement. This method can be widely applied in test scenarios where voltage variation commands are known. It can intuitively display voltage waveforms to users without direct voltage measurement and can be applied to systems for power fluctuation testing of automotive embedded devices. Attached Figure Description
[0055] Figure 1 This is a schematic diagram illustrating the steps of a method for drawing a voltage waveform based on a voltage variation sequence in an embodiment.
[0056] Figure 2 This is a block diagram of a system for plotting voltage waveforms based on voltage variation sequences, as shown in the embodiment.
[0057] Figure 3 A block diagram of a system for testing power fluctuations in automotive embedded devices;
[0058] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be described in detail below. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0060] As shown in the background art, during power fluctuation testing of an automotive embedded controller, the host computer sends a voltage fluctuation sequence to a programmable power supply. The programmable power supply is responsible for the actual voltage output. Based on the voltage fluctuation command, the programmable power supply outputs voltage to the automotive embedded controller. A detection host computer is set up to detect the automotive embedded controller. The current user requirement is to intuitively display the voltage waveform during testing without adding voltage measurement equipment. This invention provides a method for drawing voltage waveforms based on voltage fluctuation sequences, including the following steps:
[0061] Step 1: Obtain the voltage change sequence from the voltage change command, obtain the end time of the voltage change sequence based on the voltage change sequence, and calculate the voltage value at the end time;
[0062] Step 2: Calculate the start time of the voltage fluctuation sequence based on the voltage fluctuation sequence, and calculate the voltage value at the start time;
[0063] Step 3: Combine the start time and start voltage to form a time-voltage pair, add it to the drawing queue, and use it as the first node to be drawn;
[0064] Step 4: Split the voltage variation points with timestamps between the start and end times into two time-voltage pairs and add them to the drawing queue in chronological order. The timestamp of the first time-voltage pair is the timestamp of the current voltage variation point that meets the conditions, and the voltage value of the first time-voltage pair is the start time voltage value of the voltage variation point. The timestamp of the second voltage time pair is the timestamp of the current voltage variation point plus the sampling duration of the current voltage variation point, and the voltage value of the second voltage time pair is the end time voltage value of the voltage variation point.
[0065] Step 5: Combine the end time and the voltage value at the end time to form a time-voltage pair, add it to the drawing queue, and use it as the last node to be drawn;
[0066] Step 6: Draw the voltage waveforms sequentially according to the drawing queue.
[0067] In one embodiment of the present invention, in step 1, the end time and the voltage value at the end time of the voltage variation sequence are specifically calculated as follows:
[0068] Assuming there is a time-voltage variation sequence set A = {[T] x ,VS x ,VE x ,t x ], x∈(1,n)+, where T x Let VS be the sampling duration of the x-th time voltage variation point in the time voltage variation sequence set A. x Let VE be the initial voltage value at the x-th time voltage variation point. x Let t be the voltage value at the end of the x-th time voltage variation point. x Let t be the timestamp of the x-th voltage variation point. The voltage variation sequence is dynamic, with the last voltage variation point being the most recent. The entire sequence has a fixed length, and the oldest points are sequentially removed from the sequence. The end time t of the voltage variation sequence is... e The calculation is as follows:
[0069] If the last voltage fluctuation point has its own timestamp t, and the error between this timestamp and the local time (t) is Δt, then the end time t e The calculation formula is as follows: t e = t + Δt.
[0070] The voltage value V at the end of the voltage variation sequence e The calculation is as follows:
[0071] If t is satisfied e If V is less than t1, then e =VS1, where t1 is the timestamp of the first time voltage change point, and VS1 is the starting time voltage value of the first time voltage change point;
[0072] If t is satisfied e Greater than t n Then V e =VE n , where t n Let VE be the timestamp of the nth time voltage change point. n This represents the voltage value at the end of the nth time voltage variation point.
[0073] Otherwise, find the time-voltage variation point x in the time-voltage variation sequence such that t x ≤t e ≤t x+1 , where t x and t x+1 The timestamps for two adjacent voltage change points;
[0074] If t is satisfied e ≥t x +T x Then V e =VE x Otherwise, V e =VS x +(VE x -VS x )*(t e -t x ) / T x ;
[0075] Among them, T x Let VE be the duration of the voltage variation point x. x The voltage value at the end of the voltage variation point x is VS. x Let t be the initial voltage value at time point x, where t is the voltage variation point. x The timestamp is the point x where the voltage changes over time.
[0076] In one embodiment of the present invention, in step 2, the start time t of the voltage variation sequence sand the starting point voltage value V s is calculated as follows:
[0077] Calculate the starting time t s , assuming that the total length of the time of the plotted waveform is TM. If t e - t1 < TM, then t s = t1, otherwise t s = t e - TM, where t1 is the timestamp of the first time voltage change point;
[0078] The starting time voltage value V of the voltage change sequence s is calculated as follows:
[0079] If t s is less than t1, then V s = VS1, where t1 is the timestamp of the first time voltage change point and VS1 is the starting time voltage value of the first time voltage change point;
[0080] If t s is greater than t n , then V s = VE n , where t n is the timestamp of the nth time voltage change point and VE n is the ending time voltage value of the nth time voltage change point;
[0081] Otherwise, find the time voltage change point x in the time voltage change sequence such that t x ≤ t s ≤ t x+1 , where t x and t x+1 are the timestamps of two adjacent time voltage change points;
[0082] If t s ≥ t x + T x , then V s = VE x , otherwise, V s = VS x + (VE x - VS x ) * (t s - t x ) / T x ;
[0083] where T x is the duration of the time voltage change point x, VE x is the ending time voltage value of the time voltage change point x, and VS xLet t be the initial voltage value at time point x, where t is the voltage variation point. x The timestamp is the point x where the voltage changes over time.
[0084] Specifically, in step 3, the start time and start voltage are compared to (t). s V s It is added to the drawing queue as the first node to be drawn.
[0085] Specifically, in step 4, for all timestamps in the time-voltage variation sequence set A that satisfy t s ≤t x ≤t e The time-voltage variation point x is decomposed into (t) x ,VS s ) and (t x +T x ,VE s Two points are added to the drawing queue in sequence. The voltage change command describes the change over a time period. Each voltage change point is decomposed into two points, namely the start point and the end point, which facilitates vertical plotting of the graph. That is, connect the start point of voltage change point 1 to the end point of voltage change point 1, then connect to the start point of voltage change point 2, and then connect to the end point of voltage change point 2 to obtain the waveform.
[0086] Specifically, in step 5, the end time-voltage value sequence (t) is... e V e Add to the end of the drawing queue;
[0087] Specifically, in step 6, the continuous waveforms are drawn sequentially according to the drawing queue. The steps are as follows:
[0088] Establish a coordinate system with time as the horizontal axis and voltage as the vertical axis;
[0089] Determine the scale of the horizontal and vertical axes. The scale of the horizontal axis is equal to the width of the plotted image divided by the total plotting time TM. The scale of the vertical axis is equal to the length of the plotted image divided by the maximum voltage value. The maximum voltage value is the maximum value of the output voltage that is predetermined and used to determine the maximum value of the vertical axis of the image. This makes it easier to display the waveform in the vertical direction and avoids the waveform being too small in height, which would make it look bad.
[0090] Points are taken sequentially from the drawing queue according to time order (t). x V x Multiply each point by the scale of the horizontal and vertical axes to obtain the points in the voltage waveform diagram. Connect the points sequentially from the first point to the last point to obtain the voltage waveform diagram.
[0091] The existing method for drawing voltage waveforms typically involves continuously averaging voltage measurements over a short period of time and plotting these time and voltage values consecutively to create a continuous voltage waveform. However, this method is not suitable when there is only a sequence of voltage changes, where data is recorded only when the voltage changes.
[0092] Existing technical solutions involve continuously measuring voltage values at equal time intervals and sequentially plotting these voltage values to form a continuous voltage waveform. However, this method is only suitable for plotting voltage values measured continuously at equal time intervals; it cannot plot continuous voltage waveforms based solely on sequences of voltage changes.
[0093] Based on the complete voltage variation sequence and the desired duration of the continuous voltage waveform, this invention determines the set of voltage variation sequences to be plotted, calculates the end time and end voltage value, as well as the start time and start voltage value, and plots the required continuous voltage variation waveform together with the aforementioned set of voltage variation sequences.
[0094] Given a known voltage fluctuation command, a voltage fluctuation sequence containing duration, start voltage, end voltage, and timestamp can be extracted from the command. Based on this sequence, a voltage waveform can be plotted without measuring the voltage. This method can be widely used in test scenarios where a known voltage fluctuation command is given. It can intuitively display the voltage waveform to the user without directly measuring the voltage and can be applied to systems that test power fluctuations in automotive embedded devices.
[0095] See Figure 2 In an embodiment of the present invention, a system for plotting voltage waveforms based on voltage variation sequences is also provided, comprising:
[0096] End parameter acquisition module 1 is used to acquire the voltage variation sequence, obtain the end time of the voltage variation sequence based on the voltage variation sequence, and calculate the voltage value at the end time.
[0097] The initial parameter acquisition module 2 is used to calculate the start time of the voltage variation sequence based on the voltage variation sequence and to calculate the voltage value at the start time.
[0098] The starting point acquisition module 3 is used to construct a time-voltage pair from the starting time and the starting voltage, add it to the drawing queue, and use it as the first node to be drawn.
[0099] The intermediate point acquisition module 4 is used to split the voltage change points with timestamps between the start time and the end time into two time-voltage pairs and add them to the drawing queue in chronological order. The timestamp of the first time-voltage pair is the timestamp of the current voltage change point that meets the conditions, and the voltage value of the first time-voltage pair is the start time voltage value of the voltage change point. The timestamp of the second voltage time pair is the timestamp of the current voltage change point plus the sampling duration of the current voltage change point, and the voltage value of the second voltage time pair is the end time voltage value of the voltage change point.
[0100] End point acquisition module 5 is used to construct a time-voltage pair from the end time and the end time voltage value, and add it to the drawing queue as the last node to be drawn;
[0101] Waveform drawing module 6 is used to draw voltage waveforms sequentially according to the drawing queue.
[0102] See Figure 3 In an embodiment of the present invention, a system for testing power fluctuations of an in-vehicle embedded device is also provided, comprising:
[0103] Programmable power supply 100, there is only one programmable power supply 100, which is used to output voltage of different amplitude according to voltage change command to perform power fluctuation test.
[0104] The host computer 200 is connected to the programmable power supply 100 and is used to control the output voltage of the programmable power supply.
[0105] The vehicle-mounted embedded controller 300 is provided, and at least one vehicle-mounted embedded controller is provided; the programmable power supply is connected to the vehicle-mounted embedded controller to provide power to the vehicle-mounted embedded controller.
[0106] The detection host computer 400 is connected to the control host computer 200 and the vehicle-mounted embedded controller 300. It is used to detect the working status of the connected vehicle-mounted embedded controller and feed it back to the control host computer.
[0107] The voltage waveform display device 500 uses the above-mentioned method of drawing voltage waveform diagrams based on voltage variation sequences to draw voltage waveform diagrams.
[0108] In an embodiment of the present invention, a computer device is also provided, comprising: a processor, a memory, and a program;
[0109] The program is stored in memory, and the processor calls the program stored in memory to execute the method described above for drawing voltage waveforms based on voltage variation sequences.
[0110] The computer device can be a terminal, and its internal structure diagram can be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements a method for plotting voltage waveforms based on voltage variation sequences. The display screen can be a liquid crystal display (LCD) or an electronic ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0111] Memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), and Electrically Erasable Programmable Read-Only Memory (EEPROM). Memory stores programs, and the processor executes these programs after receiving execution instructions.
[0112] A processor can be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc. The processor can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor.
[0113] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0114] In an embodiment of the present invention, a computer-readable storage medium is also provided for storing a program for executing the above-described method for plotting voltage waveforms based on voltage variation sequences.
[0115] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, computer devices, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0116] Embodiments of the present invention are described with reference to flowchart illustrations of methods, computer apparatuses, or computer program products according to embodiments of the invention. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart.
[0117] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in the flowchart.
[0118] The above provides a detailed description of the method, system, computer device, and computer-readable storage medium for plotting voltage waveforms based on voltage variation sequences provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A method for plotting voltage waveforms based on voltage variation sequences, characterized in that... This includes the following steps: Step 1: Obtain the voltage change sequence from the voltage change command, obtain the end time of the voltage change sequence based on the voltage change sequence, and calculate the voltage value at the end time; Step 2: Calculate the start time of the voltage fluctuation sequence based on the voltage fluctuation sequence, and calculate the voltage value at the start time; Step 3: Combine the start time and start voltage to form a time-voltage pair, add it to the drawing queue, and use it as the first node to be drawn in the drawing queue; Step 4: Split the voltage variation points with timestamps between the start and end times into two time-voltage pairs and add them to the drawing queue in chronological order. The timestamp of the first time-voltage pair is the timestamp of the current voltage variation point that meets the conditions, and the voltage value of the first time-voltage pair is the start time voltage value of the voltage variation point. The timestamp of the second voltage time pair is the timestamp of the current voltage variation point plus the sampling duration of the current voltage variation point, and the voltage value of the second voltage time pair is the end time voltage value of the voltage variation point. Step 5: Combine the end time and the voltage value at the end time to form a time-voltage pair, add it to the drawing queue, and use it as the last node to be drawn; Step 6: Draw the voltage waveforms sequentially according to the drawing queue.
2. The method for plotting voltage waveforms based on voltage variation sequences according to claim 1, characterized in that, In step 1, the end time and the voltage value at the end time of the voltage variation sequence are calculated as follows: Assuming there is a time-voltage variation sequence set A = {,T} x ,VS x ,VE x ,t x ], x∈(1,n)}, where T x Let VS be the sampling duration of the x-th time voltage variation point in the time voltage variation sequence set A. x Let VE be the initial voltage value at the x-th time voltage variation point. x Let t be the voltage value at the end of the x-th time voltage variation point. x This is the timestamp of the x-th voltage change point. End time t of the voltage variation sequence e The calculation is as follows: If the last voltage fluctuation point has its own timestamp t, and the error between this timestamp and the local time (t) is Δt, then the end time t e The calculation formula is as follows: t e =t+Δt The voltage value V at the end of the voltage variation sequence e The calculation is as follows: If t is satisfied e If V is less than t1, then e =VS1, where t1 is the timestamp of the first time voltage change point, and VS1 is the starting time voltage value of the first time voltage change point; If t is satisfied e Greater than t n Then V e =VE n , where t n Let VE be the timestamp of the nth time voltage change point. n This represents the voltage value at the end of the nth time voltage variation point. Otherwise, find the time-voltage variation point x in the time-voltage variation sequence such that t x ≤t e ≤t x+1 , where t x and t x+1 The timestamps for two adjacent voltage change points; If t is satisfied e ≥t x +T x Then V e =VE x Otherwise, V e =VS x +(VE x -VS x )*(t e -t x ) / T x ; Among them, T x Let VE be the duration of the voltage variation point x. x The voltage value at the end of the voltage variation point x is VS. x Let t be the initial voltage value at time point x, where t is the voltage variation point. x The timestamp is the point x where the voltage changes over time.
3. The method for plotting voltage waveforms based on voltage variation sequences according to claim 2, characterized in that, In step 2, the start time t of the voltage variation sequence s and starting point voltage value V s The calculation is as follows: Calculate the starting time t s , assuming that the total time length of the plotted waveform is TM, if t e - t1 < TM, then t s = t1, otherwise t s = t e - TM, where t1 is the timestamp of the first time voltage change point; The initial voltage value V of the voltage variation sequence s The calculation is as follows: If t is satisfied s If V is less than t1, then s =VS1, where t1 is the timestamp of the first time voltage change point, and VS1 is the starting time voltage value of the first time voltage change point; If t is satisfied s Greater than t n Then V s =VE n , where t n Let VE be the timestamp of the nth time voltage change point. n This represents the voltage value at the end of the nth time voltage variation point. Otherwise, find the time-voltage variation point x in the time-voltage variation sequence such that t x ≤t s ≤t x+1 , where t x and t x+1 The timestamps for two adjacent voltage change points; If t is satisfied s ≥t x +T x Then V s =VE x Otherwise, V s =VS x +(VE x -VS x )*(t s -t x ) / T x ; Among them, T x Let VE be the duration of the voltage variation point x. x The voltage value at the end of the voltage variation point x is VS. x Let t be the initial voltage value at time point x, where t is the voltage variation point. x The timestamp is the point x where the voltage changes over time.
4. The method for plotting voltage waveforms based on voltage variation sequences according to claim 3, characterized in that, In step 4, for all timestamps in the time-voltage variation sequence set A that satisfy t s ≤t x ≤t e The time-voltage variation point x is decomposed into (t) x ,VS s ) and (t x +T x ,VE s Two points are added to the drawing queue in sequence.
5. The method for plotting voltage waveforms based on voltage variation sequences according to claim 4, characterized in that, In step 6, the continuous waveforms are drawn sequentially according to the drawing queue. The steps are as follows: Establish a coordinate system with time as the horizontal axis and voltage as the vertical axis; Determine the scale of the horizontal and vertical axes. The scale of the horizontal axis is equal to the width of the drawn image divided by the total drawing time TM, and the scale of the vertical axis is equal to the length of the drawn image divided by the maximum voltage value. Points are taken sequentially from the drawing queue in chronological order (t). x V x Multiply each point by the scale of the horizontal and vertical axes to obtain the points in the voltage waveform diagram. Connect the points sequentially from the first point to the last point to obtain the voltage waveform diagram.
6. A system for plotting voltage waveforms based on voltage variation sequences, characterized in that... ,include: The end parameter acquisition module is used to acquire the voltage variation sequence, obtain the end time of the voltage variation sequence based on the voltage variation sequence, and calculate the voltage value at the end time. The initial parameter acquisition module is used to calculate the start time of the voltage variation sequence based on the voltage variation sequence, and to calculate the voltage value at the start time. The starting point acquisition module is used to construct a time-voltage pair from the starting time and the starting voltage, add it to the drawing queue, and use it as the first node to be drawn. The intermediate point acquisition module is used to split the voltage change points with timestamps between the start time and the end time into two time-voltage pairs and add them to the drawing queue in chronological order. The timestamp of the first time-voltage pair is the timestamp of the current voltage change point that meets the conditions, and the voltage value of the first time-voltage pair is the start time voltage value of the voltage change point. The timestamp of the second voltage time pair is the timestamp of the current voltage change point plus the sampling duration of the current voltage change point, and the voltage value of the second voltage time pair is the end time voltage value of the voltage change point. The end point acquisition module is used to construct a time-voltage pair from the end time and the end time voltage value, and add it to the drawing queue as the last node to be drawn; The waveform drawing module is used to draw voltage waveforms sequentially according to the drawing queue.
7. A system for testing power fluctuations in vehicle-mounted embedded devices, characterized in that, Including connected: A programmable power supply, wherein there is one and only one programmable power supply, which is used to output voltages of different amplitudes according to voltage change commands to perform power fluctuation tests. A host computer is connected to the programmable power supply and is used to control the output voltage of the programmable power supply. An in-vehicle embedded controller is provided, and at least one in-vehicle embedded controller is provided; the programmable power supply is connected to the in-vehicle embedded controller and is used to supply power to the in-vehicle embedded controller; A detection host computer is connected to the control host computer and the vehicle-mounted embedded controller, and is used to detect the working status of the connected vehicle-mounted embedded controller and feed it back to the control host computer; A voltage waveform display device, wherein the voltage waveform display device uses the method for drawing voltage waveform diagrams based on voltage variation sequences as described in claim 1 to draw voltage waveform diagrams.
8. A computer device, characterized in that, It includes: a processor, memory, and programs; The program is stored in the memory, and the processor calls the program stored in the memory to execute the method for drawing voltage waveforms based on voltage variation sequences as described in claim 1.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a program for executing the method for drawing voltage waveforms based on voltage variation sequences as described in claim 1.