Waveform generation method and system for electrochemical workstation
By generating stage skeletons and boundary consistency constraints in an electrochemical workstation, calculating code domain transition ratios and foldback entropy, and forming segmented execution packets, the problem of pseudo-features caused by waveform generation in multi-stage measurements is solved, improving the interpretability and repeatability of measurement results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-25
- Publication Date
- 2026-03-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In multi-stage measurements, existing electrochemical workstations suffer from waveform generation methods that lead to spurious features or baseline anomalies at stage boundaries, making it difficult to distinguish the differences between sample reactions and waveform execution processes. This increases the uncertainty of measurement results and the cost of reproducibility.
By receiving the measurement method identifier and target potential range, a stage skeleton and basic time grid are generated, a waveform semantic segment table is constructed and boundary consistency constraints are solidified, the code domain transition ratio and foldback entropy are calculated, and segmented execution packets and differential update packets are formed to ensure that the waveform is loaded and output in the order of packets at the front end, and the execution trajectory is recorded to maintain consistency.
It significantly reduces spurious features introduced by stage splicing, improves the interpretability and reproducibility of measurement results, reduces the uncertainty of parameter tuning trial and error and whole-stage reconstruction, and enhances the reliability of electrochemical workstations in multi-stage detection scenarios.
Smart Images

Figure CN121722207A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electrochemical instrument control and waveform compilation, and more specifically, to a waveform generation method and system for an electrochemical workstation. Background Technology
[0002] In electrochemical workstations, especially portable electrochemical measuring devices, a common practice is for a processor or control unit to generate an excitation waveform based on user-defined measurement modes and waveform parameters. This waveform is then applied to the electrode system via a digital-to-analog converter and a constant potential circuit. Simultaneously, the detected current signal is amplified and converted from analog to digital before being transmitted back to a host computer or portable processing device for display and analysis. For example, the prior art invention "A Portable Electrochemical System" proposes that a microprocessor generates a specific waveform digitization sequence, which is converted into an analog signal and applied to the electrochemical device via a constant potential circuit. The collected quantitative data is then uploaded to a personal computer for processing and presentation. Its publication number is CN213068704U. Another example is the prior art invention "Electrochemical Detection Equipment and Electrochemical Detection Method," which proposes that a voltage scanning unit generates various voltage scanning signals based on a scanning waveform control signal. A function generation module generates a signal function corresponding to the waveform and sends it to a constant potential circuit to output a continuous scanning signal. Furthermore, it allows the control unit to be a portable processing device and to communicate wirelessly with each unit. Its publication number is CN109490399A. Based on the existing technical approaches mentioned above, waveform generation usually revolves around converting user requirements into outputtable waveforms to adapt to different measurement methods and the portability requirements of on-site testing.
[0003] However, in actual electrochemical measurements, many methods cannot be completed with a single continuous scan, but are composed of multiple stages connected in series. The stages must not only meet constraints such as potential connection, maintenance and superposition, but also need to make fine-grained adjustments according to the differences between electrode state and sample. The waveform generation method shown in the comparison file tends to put the waveform into the underlying output form of digital sequence or signal function. The control signal often takes effect on the entire waveform. When the user only wants to fine-tune the details of a certain stage, the system is more likely to reconstruct and reissue the entire sequence or function. The front-end output needs to be reloaded and aligned, and the transition conditions at the stage boundary are also recalculated and spliced. As a result, although the parameter changes seem small, the waveform actually applied to the electrode may have imperceptible small steps, short pauses or superposition relationship shifts at the stage boundaries. This can form difficult-to-distinguish pseudo-features or baseline anomalies in the electrochemical response, making it difficult to determine whether the difference in measurement results comes from the sample reaction or from the waveform execution process itself. This increases the cost and risk of method development, on-site adjustment and result reproduction.
[0004] To address the aforementioned problems, a technical solution is provided. Summary of the Invention
[0005] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a waveform generation method and system for an electrochemical workstation. This method involves receiving a measurement method identifier and a target potential range to generate a stage skeleton and a basic time grid, constructing a waveform semantic segment table and solidifying boundary consistency constraints. During the compilation stage, the code domain transition ratio and code order foldback entropy are calculated and combined to obtain a connection shaping coefficient. Based on this, the generation of transition segments and the compilation of local fine grids in the boundary neighborhood are determined, forming segmented execution packets and differential update packets. These packets are loaded and output in sequence at the front end, while execution trajectory records are transmitted back to maintain consistency between description and execution, thus solving the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: A waveform generation method for an electrochemical workstation includes the following steps: S1: Receive the measurement method identifier and target potential range, call the waveform rule library to extract the stage skeleton and basic waveform rules, calculate the basic time grid based on the existing equal interval discretization and scanning speed conversion relationship, and output the stage skeleton and basic time grid. S2: Generate a waveform semantic segment table based on the stage skeleton and the basic time grid, solidify each stage into a set of generation rules and constraints, and write the boundary consistency constraints of adjacent stages to form a unified connection condition. S3: Compile the waveform semantic segment table into a segmented execution package and a differential update package, extract the boundary amplitude jump features and boundary sequence complexity features, and comprehensively analyze them to obtain the connection shaping coefficient. Based on this, determine the generation of the transition segment and the compilation of the local fine grid in the boundary neighborhood, and write them into the segmented execution package and the differential update package. S4: Load and output waveforms in the segmented execution package order at the front end, use segmented buffering and loading confirmation mechanism to complete the inter-segment switching preparation, and generate transition segments according to the transition segment instructions in the segmented execution package when a transition segment needs to be generated. S5: Generates an execution trajectory record during output and sends it back to the host computer.
[0007] In a preferred embodiment, in step S1, the measurement method identifier is in the form of a predefined string or an enumeration value. The target potential range consists of a minimum potential value and a maximum potential value. The waveform rule base uses the measurement method identifier as the primary key index to extract the stage skeleton and basic waveform rules. The stage skeleton is composed of an ordered sequence of stages. The basic waveform rules correspond one-to-one with the stage skeleton. The basic time grid traverses the basic waveform rule set according to the principle of equal interval discreteness to identify the scanning stage and selects the minimum suggested time step as the initial candidate time step. Then, it is adjusted upward to the system-allowed time grid level, and the stage skeleton and basic time grid are output.
[0008] In a preferred embodiment, the waveform semantic segment table in step S2 adopts an ordered segment table structure. Segment entries are created based on the total number of stages in the stage skeleton. Each segment entry includes a stage number, stage type, start time index, end time index, generation rule pointer, and constraint set pointer. The target potential range is written to the header of the segment table. The generation rules and constraint sets are solidified to the corresponding segment entries according to the stage skeleton order. The generation rules include scanning speed, hold duration, superposition offset, and sampling potential step size constraints. The constraint set includes potential boundary constraints, superposition effective constraints, and hold constraints.
[0009] In a preferred embodiment, step S2 involves writing boundary consistency constraints for adjacent stages. The boundary consistency constraints include potential connection constraints, time alignment constraints, and superposition effectiveness consistency. The potential connection constraints record the difference between the equivalent potential at the end of the previous stage and the equivalent potential at the beginning of the next stage. The constraints are appended to the end of the constraint set of the previous stage in the form of key-value pairs, and are also cross-referenced to the entries of the next stage to form a unified connection condition.
[0010] In a preferred embodiment, the boundary amplitude jump feature in step S3 includes the code domain jump ratio, and the boundary sequence complexity feature includes the code order return entropy. For adjacent stages, the boundary neighborhood is defined as the union of the fixed number of grid cells that the end of the previous stage extends forward and the same fixed number of grid cells that the beginning of the next stage extends backward. The equivalent potential at the end of the previous stage and the equivalent potential at the beginning of the next stage are analyzed, and the calibration mapping relationship is called to convert it into code word endpoints and normalize it to obtain the code domain transition ratio. Within the boundary neighborhood, the codeword sequence is expanded, and four patterns are extracted: monotonically increasing segments, monotonically decreasing segments, repeating segments, and short-period round-trip segments. The grid proportion of the four patterns within the boundary neighborhood is counted, and the normalized information entropy is calculated to obtain the pattern diversity measure. Simultaneously, the first-order difference of the codeword sequence is denoteed, and the number of sign inversions is counted. The return density is obtained by normalizing according to the total number of grids in the neighborhood. The pattern diversity measure and the return density are fused according to preset weights to obtain the code order return entropy. The endpoint transition evidence strength and structural complexity evidence strength are generated. The weighted sum of the maximum value and absolute difference of the two is taken and truncated in the range of 0 to 1 to obtain the connection shaping coefficient. The generation of transition segment indication and the activation of local fine grid compilation are determined based on the connection shaping coefficient.
[0011] In a preferred embodiment, step S3 generates segmented execution packages in sequence according to stage number. The packages contain codeword sequences, time index ranges, and decision instructions. For boundaries that trigger reshaping, an additional transition segment package is added. The differential update package contains stage increment codewords affected by the adjustment and decision changes. The segmented execution package and differential update package carrying the judgment decision results are output. When the decision instruction includes local fine grid compilation, the segmented execution package contains fine grid neighborhood markers and corresponding fine grid neighborhood codeword subsequences, which are used to replace the original codeword sequence of the boundary neighborhood.
[0012] In a preferred embodiment, in step S4, the front-end execution unit maintains an active buffer and a preparation buffer. After parsing the packet header metadata to verify the continuity of the time index range according to the segmented execution packet order, it copies the codeword sequence and decision indication to the preparation buffer. The differential update packet only replaces the incremental subsequence and decision indication. When the number of remaining grid cells is less than the safety margin, the two-way handshake confirmation mechanism is used to trigger a confirmation request and update the switching flag to complete the inter-segment switching preparation.
[0013] In a preferred embodiment, in step S4, codewords are read from the active buffer and sent to the output of the digital-to-analog converter in each grid clock cycle. When the segment end time index is reached, if the decision instruction requires the generation of a transition segment, linear interpolation is used to generate the transition segment codeword sequence to reduce the amplitude of a single change and align the superposition effective time. After the transition segment is generated, the active buffer is switched to output the starting codeword of the next segment to ensure that the output is continuous and the superposition relationship is consistent.
[0014] In a preferred embodiment, the execution trajectory recording in step S5 adopts an ordered record table structure. Each entry includes a segment number, a start time marker, an end time marker, a segment execution package identifier, and a boundary processing status. The start time marker and segment execution package identifier are recorded at the beginning of segment output, and the end time marker and boundary processing status are recorded at the end of segment output. After the entire process output is completed, the continuity is verified, a checksum is generated, and then the data is sent back to the host computer.
[0015] A waveform generation system for an electrochemical workstation, comprising: The skeleton extraction module is used to: receive the measurement method identifier and target potential range, call the waveform rule library to extract the stage skeleton and basic waveform rules, calculate the basic time grid based on the existing equal interval discretization and scanning speed conversion relationship, and output the stage skeleton and basic time grid. The semantic constraint module is used to: generate a waveform semantic segment table based on the stage skeleton and the basic time grid, solidify each stage into a set of generation rules and constraints, and write the boundary consistency constraints of adjacent stages to form a unified connection condition. The shaping compilation module is used to: compile the waveform semantic segment table into a segmented execution package and a differential update package, extract boundary amplitude jump features and boundary sequence complexity features, and comprehensively analyze them to obtain the connection shaping coefficients. Based on this, it determines the generation of transition segments and the compilation of local fine grids in the boundary neighborhood, and writes them into the segmented execution package and the differential update package. The segmented execution module is used to: load and output waveforms in the segmented execution package order at the front end, complete the inter-segment switching preparation using the segmented buffer and loading confirmation mechanism, and generate transition segments according to the transition segment instructions in the segmented execution package when transition segments need to be generated. The trajectory recording module is used to generate execution trajectory records during output and send them back to the host computer.
[0016] The technical effects and advantages of the waveform generation method and system for electrochemical workstations of this invention are as follows: This invention elevates the generation of complex electrochemical measurement waveforms from discrete point representations to a generation and execution method that is semantically organized by stages and allows for local compilation and replacement. This enables waveforms to be stably arranged and finely adjusted around the stage structure of the measurement process in practical applications. When forming segmented execution packages and differential update packages, the system no longer directly reconstructs the entire waveform based solely on user parameters. Instead, it performs a code domain-level risk assessment of the boundary neighborhoods of adjacent stages. It uses code domain transition ratios and code sequence foldback entropy to extract the transition tendency of boundary endpoints and the complexity of the neighborhood structure. Through comprehensive analysis, it obtains the connection shaping coefficients, thereby determining whether to generate transition segments and whether to enable local fine-grid compilation during the compilation stage. As a result, local rewriting is limited to the target stage, and the continuity and superposition alignment at the boundaries can be actively constrained and shaped during the generation stage. This significantly reduces the false features introduced by hidden steps, short pauses, or superposition misalignments caused by stage splicing, making the differences in the measurement curves more reflective of the sample reaction itself rather than waveform execution details.
[0017] Meanwhile, this invention combines segmented loading and switching preparation mechanisms with execution trajectory recording during the front-end execution process. This ensures that the host computer not only saves parameters and curves but also execution evidence that corresponds one-to-one with the actual output process. Thus, when the same measurement method is reproduced under different device connection configurations or different operating loads, the system can output waveforms with consistent segmented execution logic. Furthermore, the handling of critical boundaries is traceable and comparable, reducing the uncertainty caused by parameter tuning trial and error and complete segment reconstruction. This improves the repeatability and interpretability of complex process measurements in field applications, further enhancing the reliability of electrochemical workstations in multi-stage detection scenarios. Attached Figure Description
[0018] Figure 1 This is a schematic flowchart of a waveform generation method for an electrochemical workstation according to the present invention.
[0019] Figure 2 This is a schematic diagram of the waveform generation system for an electrochemical workstation according to the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Example 1: Figure 1 This invention provides a waveform generation method for an electrochemical workstation, comprising: S1: Receives the measurement method identifier and target potential range, calls the waveform rule library to extract the stage skeleton and basic waveform rules, calculates the basic time grid based on the existing equal interval discretization and scanning speed conversion relationship, and outputs the stage skeleton and basic time grid.
[0022] S2: Generate a waveform semantic segment table based on the stage skeleton and the basic time grid, solidify each stage into a set of generation rules and constraints, and write the boundary consistency constraints of adjacent stages to form a unified connection condition.
[0023] S3: Compile the waveform semantic segment table into a segmented execution package and a differential update package, extract boundary amplitude jump features and boundary sequence complexity features, and comprehensively analyze them to obtain the connection shaping coefficients. Based on this, determine the generation of transition segments and the compilation of local fine grids in the boundary neighborhood, and write them into the segmented execution package and the differential update package.
[0024] S4: Load and output waveforms in the segmented execution package sequence at the front end, use segmented buffering and loading confirmation mechanism to complete the inter-segment switching preparation, and generate transition segments according to the transition segment instructions in the segmented execution package when necessary to ensure continuous output and consistent superposition relationship.
[0025] S5: Generate an execution trajectory record during output and send it back to the host computer. The execution trajectory record is associated with at least the start mark, end mark and corresponding segment execution package identifier of each segment, so that the saved waveform description is consistent with the actual execution process.
[0026] The concept of this invention is to transform the waveform generation of an electrochemical workstation from a one-time generation and distribution of the entire waveform to a phased organization, compilation, and execution based on the measurement process, thereby improving the controllability of complex waveforms during adjustment and reproduction from the source. The method first uses the measurement method identifier and target potential range as entry points to generate a stage skeleton and a basic time grid, and then constructs a waveform semantic segment table based on this. The generation rules for each stage and the boundary consistency constraints between adjacent stages are explicitly solidified, so that stage transitions no longer rely on empirical splicing. Subsequently, in the compilation stage, the boundary neighborhoods of adjacent stages are evaluated, and the code domain transition ratio and code sequence foldback entropy are calculated to simultaneously characterize the transition tendency of boundary endpoints and the structural complexity of the neighborhood. A comprehensive analysis yields a transition shaping coefficient, which is used to determine whether a transition segment needs to be generated and whether local fine-grid compilation should be performed on the boundary neighborhood. This allows for targeted shaping and local updates without reconstructing the entire waveform. The final output segmented execution package and differential update package are loaded and output sequentially by the front end. Combined with the execution trajectory recording and feedback mechanism, the waveform description is kept consistent with the actual execution process, which effectively reduces the risk of false features at the stage boundary and improves the repeatability and interpretability of complex measurement processes.
[0027] In electrochemical workstations, especially portable electrochemical measurement devices, complex measurement methods often consist of multiple stages connected in series, each with a specific waveform type, scan direction, hold duration, or superposition relationship. To ensure that subsequent waveform compilation and execution can achieve precise connection and risk assessment at stage boundaries, the entire generation process must start from a unified stage structure description and time reference, establishing a reusable and locally adjustable intermediate expression form.
[0028] However, existing multi-stage waveform generation methods are prone to boundary pseudo-features due to whole-segment reconstruction. In order to introduce targeted shaping constraints in the pre-compilation stage, it is first necessary to reliably extract the stage organization structure of the measurement method from the user input and establish a unified time discrete benchmark applicable to the whole process, so as to provide a stable skeleton and grid foundation for the subsequent semantic segment table generation.
[0029] S101: Receive measurement method identifier and target potential range.
[0030] At the beginning of the waveform generation process, it is necessary to first obtain the measurement method type and potential boundary conditions selected by the user, which will serve as the input parameters for the entire multi-stage waveform organization, ensuring that the subsequent rule extraction is clearly targeted.
[0031] The measurement method identifier uses a predefined string or enumerated value to uniquely identify an electrochemical measurement technique, such as cyclic voltammetry, linear sweep voltammetry, square wave voltammetry, or differential pulse voltammetry. The target potential range consists of two potential values: a minimum potential value and a maximum potential value, both in volts. The minimum potential value is less than the maximum potential value, and together they define the global upper and lower bounds of the potentials involved in all stages of the measurement method.
[0032] The receiving process is achieved through structured parameter parsing: First, the measurement method identifier is input into a hash table or switch statement for mapping, confirming that the identifier is valid and corresponds to the rule base entry; at the same time, boundary checks are performed on the target potential range, requiring that the difference between the maximum potential value and the minimum potential value is greater than the system's minimum range resolution, and this range is recorded as a global reference benchmark for subsequent code domain mapping and normalization.
[0033] After completing this step, two core input objects are obtained: the measurement method identifier and the target potential range, which can be directly used by the rule base in the next step.
[0034] S102: Call the waveform rule library to extract the stage skeleton and basic waveform rules.
[0035] Based on the received measurement method identifier and target potential range, it is necessary to extract the corresponding stage organization structure and waveform generation rules from the pre-stored rule base to provide a complete stage description basis for subsequent time grid calculation.
[0036] The waveform rule base is a pre-built structured database, indexed using the measurement method identifier as the primary key. Each database entry contains two parts: a stage skeleton and basic waveform rules.
[0037] The stage skeleton consists of an ordered sequence of stages. Each stage in the sequence includes a stage type, stage number, relative start potential flag, relative end potential flag, and scan direction flag. The stage type is an enumerated value, including linear scan, constant potential hold, step jump, or pulse superposition. The stage number increments from 1. The relative start potential flag and relative end potential flag are expressed as normalized positions relative to the target potential range or the end point of the previous stage. The scan direction flag indicates forward scan, reverse scan, or no scan.
[0038] The basic waveform rules correspond one-to-one with the stage skeleton and are composed of a set of rules. Each rule includes the scanning speed (unit: volts per second, valid only for scanning stages), the holding time (unit: seconds, valid only for holding stages), the superposition offset (unit: volts, valid only for superposition stages), and the sampling potential step size constraint (unit: volts, as the suggested potential discrete interval for this stage).
[0039] The extraction process is completed through direct indexing combined with integrity verification: the waveform rule base is identified by the measurement method, and the ordered stage sequence and its corresponding rule set are fully loaded; at the same time, it is verified that the total number of stages is greater than or equal to 1, and that the termination and start marks of adjacent stages have no logical conflict under superposition or preservation constraints.
[0040] After completing this step, you will obtain two intermediate objects: the stage skeleton and the basic waveform rules. These can be directly used for the next step of calculating the basic time grid.
[0041] S103: Calculate the base time grid based on the conversion relationship between equal interval discretization and scanning speed.
[0042] Based on the extracted stage skeleton and basic waveform rules, in order to ensure that the waveforms throughout the entire process adopt a uniform discrete interval in the time domain, it is necessary to calculate a basic time grid applicable to all stages. This grid determines the minimum time unit for subsequent waveform discretization, thereby avoiding discretization inconsistencies caused by differences in scanning speed in different stages.
[0043] The base time grid is defined as a uniform time step throughout the entire process, in seconds.
[0044] The calculation process follows the principle of equal interval discretization. First, it traverses the set of basic waveform rules to identify all scanning stages (stage types are linear scanning or composite stages with scanning attributes), and extracts the absolute value of the scanning speed and the corresponding sampling potential step size constraint for each such stage.
[0045] For each scan stage, first calculate the suggested time step: divide the sampling potential step size constraint of that stage by the absolute value of the scan speed to obtain the corresponding suggested time step.
[0046] Then, the minimum value among all suggested time steps is selected as the initial candidate time step. The calculation method is as follows: compare the suggested time steps of all scan stages and take the smallest value as the initial candidate time step.
[0047] To ensure compatibility with hardware execution capabilities, the initial candidate time step is adjusted upwards to the closest system-allowed time grid level: the minimum value greater than or equal to the initial candidate time step is selected from the system's predefined set of discrete time grid candidates as the final base time grid.
[0048] The system's predefined discrete-time raster candidate set is determined based on the digital-to-analog converter update rate and is typically a sequence of powers of 2. The value range of the base time raster is constrained by the upper bound of the initial candidate time step and must be greater than the system's minimum time resolution to ensure that the potential step size is not less than the potential equivalent corresponding to the effective resolution of the digital-to-analog converter at the highest scan rate.
[0049] For example, in cyclic voltammetry measurements, if the first stage is a forward linear scan with a scan rate of 0.1 volts per second and a sampling potential step size constraint of 0.001 volts, then a time step of 0.001 divided by 0.1 is recommended to obtain 0.01 seconds. If the second stage is a reverse scan with a scan rate of 0.05 volts per second and a sampling potential step size constraint of 0.001 volts, then a time step of 0.001 divided by 0.05 is recommended to obtain 0.02 seconds. The minimum of the two, 0.01 seconds, is taken as the initial candidate time step, and then adjusted upwards to the nearest grid allowed by the system, such as 0.012 seconds. This is then used as the base time grid to ensure that both forward and reverse scans are discretely unfolded over the same time interval.
[0050] After completing this step, the basic time grid is obtained and output directly along with the stage skeleton for use in the subsequent generation of waveform semantic segment tables.
[0051] Step S1 receives the measurement method identifier and target potential range, calls the waveform rule library to extract the stage skeleton and basic waveform rules, and calculates a unified basic time grid based on the principle of equal interval discretization and the conversion relationship of scanning speed. This provides a complete stage structure description and time discretization benchmark for generating the waveform semantic segment table in the subsequent step S2, ensuring that all stages are expanded on the same time grid, which facilitates the unified writing of boundary constraints and subsequent code domain risk assessment.
[0052] Step S1 outputs the stage skeleton and the basic time grid. The stage skeleton provides an ordered structural description of the multi-stage electrochemical measurement, and the basic time grid establishes a unified discrete time reference for the entire process. Together, they lay a stable organizational framework and time reference for waveform generation.
[0053] However, in order to achieve risk assessment and targeted shaping of adjacent stage boundaries in subsequent compilation stages, abstract stage skeletons and basic waveform rules alone are insufficient to support fine-grained local adjustments and unified constraint writing. The stage skeleton must be further transformed into a semantic intermediate expression, each stage is solidified into an independent compilable set of rules and constraints, and boundary consistency constraints between adjacent stages are explicitly written, thereby forming a unified connection condition, which facilitates accurate location of boundary neighborhoods and assessment of pseudo-feature risks during compilation.
[0054] S201: Initialize the waveform semantic segment table structure.
[0055] Based on the stage skeleton and basic time grid output in step S1, it is necessary to first create the overall framework of the waveform semantic segment table to accommodate the rule solidification and constraint writing of each subsequent stage, and ensure that the segment table structure supports ordered traversal and boundary association.
[0056] The waveform semantic segment table adopts an ordered segment table structure. Each entry in the table corresponds to a stage in the stage skeleton. The whole table is stored in the form of a linked list or array to achieve sequential traversal and random access.
[0057] The initialization process creates an empty segment table based on the total number of stages in the stage skeleton, allocates a corresponding number of segment entries, and each segment entry has a set of fixed fields, including stage number, stage type, start time index, end time index (initially set to empty), generation rule pointer and constraint set pointer.
[0058] The start time index and end time index record the grid position of this stage on the entire process timeline. The time index is based on the base time grid and is accumulated starting from 0.
[0059] At the same time, the target potential range is written as a global field into the segment table header so that all stage rules can reference it uniformly.
[0060] After completing this sub-step, an initialized empty waveform semantic segment table is obtained, which can be directly used to fill in the rules and constraints in subsequent stages.
[0061] S202: Solidify the set of rules and constraints for each stage.
[0062] After initializing the waveform semantic segment table structure, in order to achieve independent compilation and local adjustment capabilities for each stage, the basic waveform rules need to be transformed into specific generation rules and constraint sets in the order of the stage skeleton, and then filled into the corresponding segment entries. At the same time, the duration of the stage on the time grid is calculated.
[0063] The processing adopts a sequential filling method, processing each stage one by one from stage number 1 to the total number of stages.
[0064] For the current stage, first copy the corresponding content in the basic waveform rules, generate rules including scanning speed, hold duration, superposition offset, sampling potential step size constraint, and supplement the calculation of the stage continuous grid number and potential endpoint pairs.
[0065] The calculation of the stage persistence grid number is divided into two cases: If the stage type is a scan type, first calculate the potential scan range: subtract the potential value corresponding to the start potential from the potential value corresponding to the end potential flag and take the absolute value. The start potential flag and the end potential flag are obtained by combining the stage skeleton with the superimposed offset. Then calculate the equivalent time step: divide the sampling potential step length constraint by the absolute value of the scan speed. The stage continuous grid number is obtained by the following calculation: first divide the potential scan range by the sampling potential step length constraint, and then round up the quotient (i.e., take the smallest integer not less than the quotient), and then add 1 to include the starting point.
[0066] If the stage type is a hold-in stage, the hold duration is divided by the base time grid, and the quotient is rounded up to get the stage duration grid number.
[0067] The constraint set includes potential boundary constraints (limited to the target potential range), superimposed effective constraints (records the time when the offset takes effect), and maintenance constraints (records the constant potential value if they exist).
[0068] After the filling is complete, update the start time index of the current stage to the end time index of the previous stage plus 1 (the first stage is 0), and the end time index to the start time index plus the stage duration grid number minus 1.
[0069] For example, in cyclic voltammetry measurement, the first stage of the forward scan ranges from -0.5 volts to +0.8 volts at a scanning speed of 0.1 volts per second, with a sampling potential step size constraint of 0.001 volts. The potential scan range is 1.3 volts. Dividing this by 0.001 volts gives 1300, which is rounded up to 1300. Adding 1 gives 1301, which is used as the stage duration grid number. The corresponding time span is expanded based on the base time grid.
[0070] After completing this sub-step, the generation rules and constraint sets of all stages are solidified into the waveform semantic segment table, and each stage gains independent generation capabilities and clear time positioning.
[0071] S203: Write boundary consistency constraints for adjacent stages to form a unified connection condition.
[0072] After all the generation rules and constraint sets are solidified, in order to ensure that the compilation stage can uniformly evaluate the risk of pseudo-features at the boundaries of adjacent stages, it is necessary to explicitly write boundary consistency constraints so that the connection conditions remain consistent in local adjustments.
[0073] The processing adopts a boundary traversal method, starting from stage number 1 to the total number of stages minus 1, and performs constraint writing for each pair of adjacent stages.
[0074] First, analyze the equivalent potential at the end of the previous stage: index the corresponding grid position with the end time of this stage, and calculate the actual output potential by combining the superposition and retention constraints in the generation rules.
[0075] Similarly, the starting equivalent potential of the next stage is analyzed: the actual initial output potential is calculated by indexing the grid position corresponding to the starting time of this stage and combining it with the generation rules.
[0076] Boundary consistency constraints include three types: Potential connection constraint: Record the difference between the equivalent potential at the end of the previous stage and the equivalent potential at the beginning of the next stage under the superposition relationship.
[0077] Time alignment constraint: Record boundary time indices, where the start time index of the next stage is the next cell after the end time index of the previous stage, to ensure time continuity.
[0078] Consistency of superposition effect: If there is superposition offset, record the effective state transition rules at the boundary of the offset.
[0079] The above constraints are appended to the end of the constraint set of the previous stage entry in the waveform semantic segment table in the form of key-value pairs, and are also cross-referenced to the next stage entry to form a two-way association.
[0080] All constraint potential values are limited to the target potential range, and the time index is a non-negative integer.
[0081] After completing this sub-step, the waveform semantic segment table carries complete consistency constraints of adjacent stage boundaries, forming unified connection conditions that can be directly used by subsequent compilation steps.
[0082] Step S2 converts the stage skeleton and basic time grid output in Step S1 into a semantic segment table expression by initializing the waveform semantic segment table structure, solidifying the set of rules and constraints for each stage and calculating the number of stage continuity grids, and writing the boundary consistency constraints of adjacent stages. Each stage is solidified independently and the boundary connection conditions are recorded explicitly and uniformly. This provides an intermediate structure that can be locally compiled and has unified constraints for Step S3 to accurately locate the boundary neighborhood, calculate the code domain transition ratio and code order foldback entropy and evaluate the risk of pseudo-features during compilation. This ensures that the boundary continuity of multi-stage complex waveforms is guaranteed in advance under fine-grained adjustment.
[0083] Step S2 has generated a waveform semantic segment table, and the generation rules and constraint sets for each stage have been solidified. Consistency constraints at the boundaries of adjacent stages have been uniformly written to form a semantic intermediate expression, which facilitates targeted processing of multi-stage connections during the compilation stage.
[0084] However, in order to proactively reduce the risk of pseudo-features introduced by hidden steps, short pauses or superimposed misalignments at stage boundaries in the pre-compilation stage, semantic segment tables and boundary constraints alone are not enough. Further quantitative evaluation of endpoint jump tendency and neighborhood structure complexity at the code domain level is needed to determine whether to generate transition segments or enable local fine grid compilation. It is necessary to introduce complementary risk feature calculation and comprehensive decision-making mechanisms to achieve the forward shift and precise control of local shaping constraints.
[0085] In step S3, the code domain hopping ratio and code sequence return entropy are selected for processing because they respectively cover two key root causes of boundary pseudo-feature formation and are mutually irreplaceable: the code domain hopping ratio, based on the difference between the endpoints of the calibrated and mapped codewords and normalized by the code domain span, characterizes the tendency of abrupt changes in output amplitude at the boundary between adjacent stages, and can directly reflect the step risk that may occur in the digital-analog output at the moment of switching; the code sequence return entropy, based on the return structure statistics of the codeword sequence in the boundary neighborhood and normalized, is used to characterize the structural complexity and uncertainty of codeword changes in the neighborhood, and can identify the hidden pseudo-feature risk caused by seemingly smooth endpoints but frequent internal returns, repetitions, or short-cycle round trips. If only one of these parameters is used, it will inevitably lead to missed or false judgments in two scenarios: endpoints with abrupt changes but simple structure and endpoints with gentle changes but complex structure, thus making it impossible to reliably determine whether to generate a transition segment and whether to enable local fine-grid compilation in the boundary neighborhood during the compilation stage. By using these two complementary parameters and obtaining the connection shaping coefficients through comprehensive analysis, the boundary risk assessment can be moved to the compilation stage without increasing user input. This enables precise constraints and targeted shaping of local rewriting, reduces the uncertainty caused by whole-segment reconstruction and boundary splicing, and makes the output waveform more continuous and interpretable at the stage connection, thereby improving the reproducibility and reliability of complex measurement processes.
[0086] S301: Locate the neighboring boundary of adjacent stages and resolve the equivalent endpoint potential.
[0087] After the waveform semantic segment table enters the compilation process, in order to ensure that the pseudo-feature risk assessment of each pair of adjacent stages has a consistent analysis scope, it is necessary to first determine the specific grid coverage of the boundary neighborhood and extract the equivalent endpoint potential of the actual output to the electrode side.
[0088] The processing adopts a boundary neighborhood definition method. From stage number 1 to the total number of stages minus 1, for the current stage and the next stage, the boundary neighborhood is defined as the union of the fixed number of grid cells that the end of the previous stage extends forward and the same fixed number of grid cells that the beginning of the next stage extends backward. The fixed number of grid cells is predefined as the neighborhood width to ensure coverage of the potential pseudo-feature influence range.
[0089] The boundary time index is taken from the end time index of the previous stage in the waveform semantic segment table, and the start time index of the next stage is the next grid cell after the boundary time index.
[0090] The equivalent endpoint potential analysis is divided into two parts: the equivalent endpoint potential in the previous stage is calculated by using the boundary time index to correspond to the grid position, combined with the superimposed offset and holding constraints in the generation rules of this stage, to calculate the final set potential; the initial equivalent endpoint potential in the next stage is calculated by combining the generation rules in the same way to calculate the initial set potential. The unit of both is volts, and the value is limited to the target potential range.
[0091] After completing this sub-step, the boundary neighborhood range and equivalent endpoint potential pair of each pair of adjacent stages are obtained, which can be directly used for subsequent code domain feature extraction.
[0092] S302: Calculate the code domain transition ratio.
[0093] Boundary amplitude transition characteristics include code domain transition ratio.
[0094] After determining the boundary neighborhood and equivalent endpoint potential, in order to quantify the step risk tendency at the moment of digital-to-analog output switching at the boundary of adjacent stages, it is necessary to convert the equivalent endpoint potential into code domain expression and perform normalization processing to form a dimensionless index that can be compared across ranges.
[0095] The calculation process first calls the calibration mapping relationship to convert the equivalent potential at the end of the previous stage into the codeword endpoint of the previous stage, and converts the equivalent potential at the beginning of the next stage into the codeword endpoint of the next stage.
[0096] Simultaneously, using the same calibration mapping relationship, the minimum value of the target potential range is converted into the lower limit of the code domain, and the maximum value of the target potential range is converted into the upper limit of the code domain. The difference between the two is used as the code domain span.
[0097] The code domain transition ratio is obtained by the following operation: first calculate the absolute value of the difference between the code word endpoint of the previous stage and the code word endpoint of the next stage, and then divide the absolute value by the code domain span to obtain the dimensionless code domain transition ratio, which ranges from 0 to 1.
[0098] For example, in differential pulse voltammetry measurement, if the equivalent potential at the end of the previous stage is 0.2 volts and mapped to codeword 2458, and the equivalent potential at the beginning of the next stage is 0.8 volts and mapped to codeword 3276, with a code domain span of 4096, then first calculate (the absolute value of 3276 minus 2458 is 818), and then divide 818 by 4096 to obtain a code domain transition ratio of approximately 0.2, indicating a low tendency for transitions at the boundary endpoints.
[0099] After completing this sub-step, the code domain transition ratio of each pair of adjacent stages is obtained, which is then used together with the code order return entropy for comprehensive analysis.
[0100] S303: Calculate the code order return entropy.
[0101] Boundary sequence complexity features include code order return entropy.
[0102] Given that the boundary neighborhood has been located, in order to identify the risk of hidden false features caused by seemingly smooth endpoints but frequent internal back-and-forth, repetition, or short-cycle round trips, it is necessary to expand the rules in the neighborhood into codeword sequences and extract the back-and-forth structural features to form complementary dimensionless complexity indicators.
[0103] The calculation process first involves traversing all grid positions within the boundary neighborhood using the base time grid as a reference, and converting the scanning rules, preservation rules, and superposition rules involved in the waveform semantic segment table into codeword sequences grid by grid. Each codeword is obtained from the corresponding instantaneous set potential through the calibration mapping relationship.
[0104] Subsequently, the codeword sequence was subjected to a foldback structure extraction, and four types of patterns were identified: monotonically increasing segment, monotonically decreasing segment, repeating and holding segment, and short-period round-trip segment.
[0105] The proportion of the four patterns in the boundary neighborhood is statistically analyzed to form a pattern probability distribution. The normalized information entropy of this distribution is then calculated to obtain a measure of pattern diversity.
[0106] The code order return entropy is obtained through the following process: the first-order difference of the codeword sequence is used to extract the sign and count the number of sign inversions, and the return density is obtained by normalizing it according to the total number of grids in the neighborhood; then, the regularity diversity measure and the return density are fused according to the pre-fixed weights of the rule base to obtain the dimensionless code order return entropy, the value of which is constrained to 0 to 1.
[0107] For example, when multiple patterns such as repeated hold-up and short-period round trips occur simultaneously in the boundary neighborhood and switch frequently, the pattern diversity and return density are both high, and the code order return entropy increases accordingly, indicating a complex internal structure. Even if the endpoint potential changes slowly, it may introduce hidden pseudo-features.
[0108] After completing the sub-step, the code sequence return entropy of each pair of adjacent stages is obtained, which, together with the code domain transition ratio, reflects the boundary risk.
[0109] S304: Comprehensive analysis yields the connection shaping coefficient and forms a judgment decision.
[0110] After calculating the code domain transition ratio and code order foldback entropy, in order to integrate the two complementary risk evidences of endpoint transition tendency and neighborhood structural complexity and form a single shaping decision basis, it is necessary to perform weighted evidence fusion on the two, output the connection shaping coefficient and drive the specific shaping action.
[0111] The comprehensive analysis process first generates the evidence strength: the endpoint transition evidence strength is derived from the code domain transition ratio, and the structural complexity evidence strength is derived from the code order foldback entropy. Both are dimensionless quantities ranging from zero to one.
[0112] The cohesion shaping coefficient is obtained through the following process: first, take the larger value between the evidence strength of endpoint transition and the evidence strength of structural complexity, then calculate the difference between the two, and sum the larger value and the difference according to the preset weights. Finally, truncate the result to the range of zero to one to obtain the dimensionless cohesion shaping coefficient.
[0113] The decision-making logic is as follows: if the transition coefficient exceeds the pre-fixed security threshold in the rule base, then an instruction to generate a transition segment is written into the segmented execution package and local fine grid compilation of the boundary neighborhood is enabled. The transition segment reduces the amplitude of single codeword changes and aligns the superposition effective time through linear interpolation; otherwise, regular segmented compilation is maintained, and only the boundary commitment information is retained.
[0114] After completing the sub-steps, the judgment and decision results of each pair of adjacent stages are obtained and directly embedded into the subsequent execution package generation.
[0115] S305: Generate and output segmented execution packages and differential update packages.
[0116] After risk assessment and shaping decisions are completed at all adjacent stage boundaries, in order to support front-end segmented loading and local parameter adjustments, it is necessary to integrate the regular codeword sequence and shaping decision results to form a package format that can be executed independently and updated incrementally.
[0117] The processing is packaged in sequence according to the stage number: each stage generates an independent segmented execution package, which contains the codeword sequence, time index range, and corresponding decision instruction for that stage; for boundaries that trigger integer shaping, an independent transition segment package is attached. When the decision instruction requires enabling local fine grid compilation, the boundary neighborhood grid range is used as the operation window. While keeping the codewords at both endpoints unchanged, the boundary transition is distributed to multiple grids in the neighborhood, generating a fine grid neighborhood codeword subsequence, which is then fixed along with the package.
[0118] The differential update package only contains the stage incremental codewords and decision change content affected by parameter adjustments, supporting targeted replacement without rebuilding the entire process sequence.
[0119] After completing this step, the output includes a segmented execution package and a differential update package carrying all judgment and decision results, which can be directly used for front-end loading and waveform output.
[0120] Step S3 involves locating the equivalent endpoint potential of the boundary neighborhood, calculating the code domain transition ratio and code order foldback entropy, comprehensively analyzing and obtaining the connection shaping coefficients to form a judgment decision, generating segmented execution packets and differential update packets carrying the decision results, compiling the waveform semantic segment table into a risk assessment-driven execution format, and moving the boundary pseudo-feature shaping constraint forward during the compilation stage to achieve targeted activation of transition segment generation and local fine grid compilation, ensuring precise control of the continuity and superposition consistency of the lower boundary of multi-stage waveform local adjustment.
[0121] Step S3 has completed the compilation of the waveform semantic segment table and outputs segmented execution packages and differential update packages carrying the judgment and decision results. Each execution package contains the codeword sequence of independent stages, time index range, decision indication and possible transition segment packages, thereby realizing the pre-compilation stage evaluation and targeted shaping of boundary pseudo-feature risk.
[0122] However, in order to safely and reliably convert these compilation results into continuous analog waveforms actually applied to the electrodes, and to avoid hidden steps and superposition misalignments caused by output interruption, asynchronous loading, or missing transition segments during segment switching, a segmented buffering and loading confirmation mechanism must be introduced at the front-end hardware execution end. The execution package is preloaded and prepared for switching according to the execution order, and a transition segment is generated in real time according to the decision instruction to ensure continuous output and strict consistency of superposition relationship throughout the process.
[0123] S401: Initialize the segmented buffer structure.
[0124] After outputting the segmented execution package and differential update package in step S3, in order to support seamless switching and continuous output between segments, it is necessary to first establish a buffer framework for the front-end execution unit to ensure that at least two buffers work alternately to avoid output interruption.
[0125] The front-end execution unit maintains two segmented buffers, called the active buffer and the preparatory buffer, respectively. Each buffer has a capacity sufficient to hold the maximum codeword sequence length and associated metadata of a single segmented execution package.
[0126] The initialization process is completed before waveform output starts: the active buffer and the preparatory buffer are cleared, the active buffer is marked as the current output source, and the preparatory buffer is marked as the target to be loaded.
[0127] At the same time, a buffer switching flag and an acknowledgment signal line are established for subsequent inter-segment switching synchronization.
[0128] The buffer index is in units of the underlying time raster and is aligned with the time index range in the segmented execution package.
[0129] After completing this step, the segmented buffer structure is ready to directly receive the segmented execution packet sequence.
[0130] S402: Load the segments into the preparation buffer in the order of execution.
[0131] After the segmented buffer structure is initialized, in order to ensure that the current segment is output while the next segment is ready, the contents need to be copied to the preparation buffer in advance according to the packet sequence, supporting uninterrupted waveform application.
[0132] The processing adopts a sequential preloading method, starting from the first segment execution packet and processing the packet sequence in turn.
[0133] For the currently loaded segmented execution package, first parse the package header metadata and verify the continuity of the time index range with the end time index of the previous package.
[0134] The codeword sequence, decision instructions, and possible transition packets are then copied completely to the corresponding address space of the preparatory buffer.
[0135] Once loading is complete, a loading completion signal is sent to the control unit, and a confirmation mechanism response is awaited.
[0136] If a differential update packet is detected, only the affected incremental subsequences and decision indicators in the pre-buffer are replaced, supporting local parameter adjustments without interrupting the output.
[0137] After completing the steps in this module, the preparation buffer carries the complete content of the next segment and directly enters the switching confirmation stage.
[0138] S403: Use the loading confirmation mechanism to complete the preparation for inter-segment switching.
[0139] After the pre-buffer is loaded, in order to avoid codeword misalignment or output pause during the switching moment, a strict confirmation and buffer role pre-switching need to be performed near the end of the current segment output.
[0140] The confirmation mechanism adopts a two-way handshake: the output progress of the current segment is monitored by a time index counter, and a confirmation request is triggered when the number of remaining grid cells is less than a predefined safety margin.
[0141] The safety margin is predefined as the number of grids corresponding to the minimum hardware switching delay, and its value range ensures that the preparation buffer is ready before the switch.
[0142] The prepared buffer responds to the acknowledgment request, checks the integrity of the load and the consistency of the time index, and returns an acknowledgment signal if it passes.
[0143] After successful confirmation, update the switching flag, mark the prepared buffer as the next active buffer, and mark the original active buffer as the new prepared buffer, ready to receive the next execution package.
[0144] After completing the steps in this document, the inter-segment switching preparation is complete, the buffer role has been pre-switched, and we are now just waiting for the precise switching moment.
[0145] S404: Generates a transition segment and outputs a waveform as needed, according to the transition segment instruction.
[0146] After the inter-segment switching preparation is completed, in order to ensure the continuity of output and the consistency of superposition at the boundary, it is necessary to sequentially read the contents of the active buffer in each grid clock cycle and insert the transition segment in real time according to the decision instruction.
[0147] The processing is performed in each grid clock cycle: the codeword is read from the current pointer of the active buffer and sent to the output of the digital-to-analog converter.
[0148] When the segment end time index is reached, if the decision indicates that a transition segment should be generated, the transition segment generation logic should be activated immediately.
[0149] The transition segment is generated using linear interpolation: the length of the transition segment is predefined as a fixed number of grid cells, the starting codeword is taken from the end codeword of the current segment, and the ending codeword is taken from the starting codeword of the next segment.
[0150] The grid-by-grid codeword is obtained through the following operation: First, calculate the difference between (the current grid number divided by the transition segment length multiplied by (the starting codeword of the next segment minus the ending codeword of the current segment)), then add the product result to the ending codeword of the current segment, and round it to the nearest integer to ensure that the integerity of the codeword and the single change range are controlled.
[0151] While generating the transition segment, the buffer is officially switched, and the new active buffer begins to output the next starting codeword, precisely aligning with the end point of the transition segment.
[0152] The next normal sequence is output immediately after the transition segment to ensure that the superposition relationship is smoothly aligned within the transition segment.
[0153] For example, when a transition segment needs to be generated at the boundary of the differential pulse voltammetry method, the linear interpolation sequence from codeword 2458 to codeword 3276 is calculated and output at the moment of switching. Each grid codeword increases gradually, and the potential on the electrode rises smoothly without steps, and then the next pulse stage sequence is seamlessly entered.
[0154] If there is no transition segment indication, the buffer will be switched directly to output the next starting codeword.
[0155] After completing the steps in this module, the entire process waveform is continuously output until completion, directly triggering the generation of the execution trajectory record.
[0156] Step S4 initializes the dual-segment buffer, preloads the segmented execution packages in sequence, completes the inter-segment switching preparation using the loading confirmation mechanism, and generates linear interpolation transition segments in real time according to the decision instructions and outputs waveforms in sequence during switching. This transforms the segmented execution packages and differential update packages output in step S3 into simulated waveforms that are actually continuously applied to the electrodes, ensuring that the inter-segment switching is uninterrupted, the boundary continuity and superposition relationship are strictly consistent, avoiding pseudo-feature diffusion during operation, and supporting stable output under local updates.
[0157] Step S4 uses a segmented buffering, loading confirmation, and transition segment generation mechanism to convert the segmented execution package into a continuous analog waveform that is actually applied to the electrode, ensuring that the switching between segments is uninterrupted, the boundaries are continuous, and the superposition relationship is consistent.
[0158] However, in order to achieve strict reproduction of the same measurement method under different devices or loads, and to make the waveform description saved by the host computer consistent with the actual execution process, parameter and curve records alone are not enough to trace the critical boundary processing methods. Execution trajectory records must be generated synchronously during the output process, at least associating the start and end marks of each segment with the corresponding segment execution package identifier, thereby providing execution evidence to support the interpretability of the results.
[0159] S501: Initialize the execution trajectory recording structure.
[0160] Before waveform output is started, in order to ensure that all segment execution details of the entire process are traceable, it is necessary to first create an ordered table framework for the execution trajectory record to support the sequential addition of subsequent markers and labels.
[0161] The execution trajectory record adopts an ordered record table structure, with each entry corresponding to a segment execution package, and the number of pre-allocated entries equal to the total number of stages.
[0162] Each entry has preset fields, including segment number, start time marker (initially empty), end time marker (initially empty), segment execution package identifier, and boundary processing status.
[0163] The initialization process is executed synchronously with the waveform output startup: the record table is cleared and the global time index counter is set to zero.
[0164] The record table includes a global header field containing the measurement method identifier, target potential range, and base time grid value.
[0165] After completing the steps in this document, the trajectory recording structure is ready and can be recorded synchronously with the segmented output process.
[0166] S502: Record the start marker and execution package identifier at the beginning of segmented output.
[0167] After the execution trajectory recording structure is initialized, in order to ensure that the actual start time of each segment can be accurately associated with the corresponding execution content, the start information needs to be recorded at the same time as the first codeword is output in the new segment.
[0168] The processing is synchronized with the switching of the active buffer: in the raster period of the first codeword of the new segment, the current global time index is read as the start time marker and written to the corresponding entry in the record table.
[0169] Simultaneously, the segment execution package identifier is extracted from the activity buffer metadata and directly written into the same record table entry.
[0170] The segment number increments from 1, consistent with the stage number.
[0171] The starting time marker has a range of non-negative integer values, in units of the base time grid.
[0172] For example, when the first stage pulse segment of the square wave voltammetry method begins to output, the corresponding entry in the record table is written with the start time marked as global index 0 and the execution package identifier of that segment. When the host computer reproduces the data, it can directly compare the initial pulse potential applied to the electrode at that moment.
[0173] After completing the steps in this document, the start time marker and execution package identifier for each segment are recorded, and we are ready to add the end marker.
[0174] S503: Record the end marker and boundary processing status when the segmented output ends.
[0175] After the segment start information is recorded, in order to fully describe the execution span and actual boundary processing of each segment, it is necessary to record the end information and decision execution evidence at the end of the segment output.
[0176] The processing is performed on the grid cycle of the arrival segment end time index: the current global time index is read as the end time marker and written to the corresponding entry in the record table.
[0177] The end time marker is obtained through the following operation: first calculate (the length of the raster segment minus 1), then add the result to the start time marker to obtain the end time marker, ensuring that it is consistent with the actual number of output raster cells, and the value range is an integer greater than the start time marker.
[0178] The length of this raster segment is obtained from the active buffer metadata or the cumulative length generated by the transition segment, including the transition segment raster if it exists.
[0179] Simultaneously, the boundary processing status is extracted from the decision instructions, including whether a transition segment is generated for the front boundary, whether local fine grid compilation is enabled, and the preparation status of the rear boundary (the end segment is marked as empty), and stored as enumerated values.
[0180] For example, at the end of the reverse scan segment of the cyclic voltammetry, the corresponding entry in the record table is written with the end time marked as the value obtained by adding the start mark to the grid length minus 1, and the transition segment of the previous boundary is marked. The host computer can then compare the end time with the initial value of the electrode to ensure that the potential is smoothly connected to the next segment.
[0181] After completing this sub-step, each segment entry carries complete start and end markers, execution package identifiers, and boundary processing status, directly forming a traceable record.
[0182] S504: After the entire process is completed, organize and send back the execution trajectory record.
[0183] After all segment end markers are recorded, in order for the host computer to obtain complete execution evidence, the record table needs to be organized and returned at the end of the final segment output.
[0184] The processing adopts a continuous verification method: traverse all entries in the record table, verify that the end time marker of the adjacent entry plus 1 equals the start time marker of the next entry, and that the total number of grids is consistent with the total length of the stage.
[0185] After successful verification, a checksum field is generated: the hash value of all timestamps, execution package identifiers and boundary processing statuses in the record table is calculated and appended to the end of the record table to ensure data integrity.
[0186] The feedback method transmits the execution trajectory record as a structured data packet to the host computer via the communication interface, and saves it together with the measurement curve and parameters.
[0187] The checksum field takes values of a fixed-length dimensionless hash value.
[0188] After completing the steps in this document, the execution trajectory record is returned, directly supporting comparison of results with the host computer and method reproduction.
[0189] Step S5 converts the continuous waveform output process of step S4 into traceable execution evidence by initializing the execution trajectory recording structure, synchronously recording the start and end marks, execution package identifiers and boundary processing status at the beginning and end of each segment, verifying and organizing the record table after the entire process is completed, and sending it back. This process associates at least the start mark, end mark and segment execution package identifier of each segment, ensuring that the waveform description saved by the host computer is strictly consistent with the actual execution process, and improving the reproducibility of complex multi-stage measurements under different devices and the interpretability of boundary processing.
[0190] Example 2: Figure 2 The present invention discloses a waveform generation system for an electrochemical workstation, comprising: The skeleton extraction module is used to: receive the measurement method identifier and target potential range, call the waveform rule library to extract the stage skeleton and basic waveform rules, calculate the basic time grid based on the existing equal interval discretization and scanning speed conversion relationship, and output the stage skeleton and basic time grid. The semantic constraint module is used to: generate a waveform semantic segment table based on the stage skeleton and the basic time grid, solidify each stage into a set of generation rules and constraints, and write the boundary consistency constraints of adjacent stages to form a unified connection condition. The shaping and compilation module is used to: compile the waveform semantic segment table into segment execution packages and differential update packages, calculate the code domain transition ratio and code order foldback entropy and comprehensively analyze the connection shaping coefficients, determine the generation of transition segments and the local fine grid compilation of boundary neighborhoods, and write them into the segment execution packages and differential update packages. The segmented execution module is used to: load and output waveforms in the segmented execution package order at the front end, complete the inter-segment switching preparation using the segmented buffer and loading confirmation mechanism, and generate transition segments according to the transition segment instructions in the segmented execution package when transition segments need to be generated. The trajectory recording module is used to generate execution trajectory records during output and send them back to the host computer.
[0191] Specifically, the above description is only a preferred embodiment of this application and is not intended to limit this application.
[0192] The various thresholds and other preset parameters can be pre-calibrated through offline simulation testing or set to fixed values according to on-site operating procedures.
[0193] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0194] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to only certain specific implementations. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention.
Claims
1. A waveform generation method for an electrochemical workstation, characterized in that, Including the following steps: S1: Receive the measurement method identifier and target potential range, call the waveform rule library to extract the stage skeleton and basic waveform rules, calculate the basic time grid based on the existing equal interval discretization and scanning speed conversion relationship, and output the stage skeleton and basic time grid. S2: Generate a waveform semantic segment table based on the stage skeleton and the basic time grid, solidify each stage into a set of generation rules and constraints, and write the boundary consistency constraints of adjacent stages to form a unified connection condition. S3: Compile the waveform semantic segment table into a segmented execution package and a differential update package, extract the boundary amplitude jump features and boundary sequence complexity features, and comprehensively analyze them to obtain the connection shaping coefficient. Based on this, determine the generation of the transition segment and the compilation of the local fine grid in the boundary neighborhood, and write them into the segmented execution package and the differential update package. S4: Load and output waveforms in the segmented execution package order at the front end, use segmented buffering and loading confirmation mechanism to complete the inter-segment switching preparation, and generate transition segments according to the transition segment instructions in the segmented execution package when a transition segment needs to be generated. S5: Generates an execution trajectory record during output and sends it back to the host computer.
2. The waveform generation method for an electrochemical workstation according to claim 1, characterized in that: In step S1, the measurement method identifier is in the form of a predefined string or enumeration value. The target potential range consists of the minimum potential value and the maximum potential value. The waveform rule base uses the measurement method identifier as the primary key index to extract the stage skeleton and basic waveform rules. The stage skeleton is composed of an ordered sequence of stages. The basic waveform rules correspond one-to-one with the stage skeleton. The basic time grid traverses the basic waveform rule set according to the principle of equal interval discreteness to identify the scanning stage and selects the minimum suggested time step as the initial candidate time step. Then, it is adjusted upward to the system-allowed time grid level, and the stage skeleton and basic time grid are output.
3. The waveform generation method for an electrochemical workstation according to claim 2, characterized in that: In step S2, the waveform semantic segment table adopts an ordered segment table structure. Segment entries are created based on the total number of stages in the stage skeleton. Each segment entry contains a stage number, stage type, start time index, end time index, generation rule pointer, and constraint set pointer. The target potential range is written to the header of the segment table. The generation rules and constraint sets are solidified to the corresponding segment entries according to the stage skeleton order. The generation rules include scanning speed, hold duration, superposition offset, and sampling potential step size constraints. The constraint set includes potential boundary constraints, superposition effective constraints, and hold constraints.
4. The waveform generation method for an electrochemical workstation according to claim 3, characterized in that: In step S2, boundary consistency constraints are written for adjacent stages. Boundary consistency constraints include potential connection constraints, time alignment constraints, and superposition effectiveness consistency. Potential connection constraints record the difference between the equivalent potential at the end of the previous stage and the equivalent potential at the beginning of the next stage. The constraints are appended to the end of the constraint set of the previous stage in the form of key-value pairs, and are cross-referenced to the entries of the next stage to form a unified connection condition.
5. The waveform generation method for an electrochemical workstation according to claim 4, characterized in that: In step S3, the boundary amplitude jump features include the code domain jump ratio, and the boundary sequence complexity features include the code order return entropy. For adjacent stages, the boundary neighborhood is defined as the union of the fixed number of grid cells that the end of the previous stage extends forward and the same fixed number of grid cells that the beginning of the next stage extends backward. The equivalent potential at the end of the previous stage and the equivalent potential at the beginning of the next stage are analyzed, and the calibration mapping relationship is called to convert it into code word endpoints and normalize it to obtain the code domain transition ratio. Within the boundary neighborhood, the codeword sequence is expanded, and four patterns are extracted: monotonically increasing segments, monotonically decreasing segments, repeating segments, and short-period round-trip segments. The grid proportion of the four patterns within the boundary neighborhood is counted, and the normalized information entropy is calculated to obtain the pattern diversity measure. Simultaneously, the first-order difference of the codeword sequence is denoteed, and the number of sign inversions is counted. The return density is obtained by normalizing according to the total number of grids in the neighborhood. The pattern diversity measure and the return density are fused according to preset weights to obtain the code order return entropy. The endpoint transition evidence strength and structural complexity evidence strength are generated. The weighted sum of the maximum value and absolute difference of the two is taken and truncated in the range of 0 to 1 to obtain the connection shaping coefficient. The generation of transition segment indication and the activation of local fine grid compilation are determined based on the connection shaping coefficient.
6. The waveform generation method for an electrochemical workstation according to claim 5, characterized in that: In step S3, segmented execution packages are generated in sequence according to stage number. The contents include codeword sequences, time index ranges, and decision instructions. For boundaries that trigger reshaping, an additional transition segment package is added. The differential update package contains the stage increment codeword affected by the adjustment and the decision change. The segmented execution package and differential update package carrying the judgment decision result are output. When the decision instruction includes local fine grid compilation, the segmented execution package contains fine grid neighborhood markers and corresponding fine grid neighborhood codeword subsequences, which are used to replace the original codeword sequence of the boundary neighborhood.
7. The waveform generation method for an electrochemical workstation according to claim 6, characterized in that: In step S4, the front-end execution unit maintains the active buffer and the preparation buffer. After parsing the packet header metadata to verify the continuity of the time index range according to the segmented execution packet order, it copies the codeword sequence and decision indication to the preparation buffer. The differential update packet only replaces the incremental subsequence and decision indication. When the number of remaining grids is less than the safety margin, the two-way handshake confirmation mechanism triggers the confirmation request and updates the switching flag to complete the inter-segment switching preparation.
8. The waveform generation method for an electrochemical workstation according to claim 7, characterized in that: In step S4, codewords are read from the active buffer and sent to the digital-to-analog converter output in each grid clock cycle. When the segment end time index is reached, if the decision instruction requires the generation of a transition segment, linear interpolation is used to generate the transition segment codeword sequence to reduce the amplitude of a single change and align the superposition effective time. After the transition segment is generated, the active buffer is switched to output the starting codeword of the next segment to ensure that the output is continuous and the superposition relationship is consistent.
9. A waveform generation method for an electrochemical workstation according to claim 8, characterized in that: In step S5, the execution trajectory recording adopts an ordered record table structure. Each entry includes a segment number, a start time marker, an end time marker, a segment execution package identifier, and a boundary processing status. The start time marker and segment execution package identifier are recorded at the beginning of segment output, and the end time marker and boundary processing status are recorded at the end of segment output. After the entire process is completed, the continuity is verified, a checksum is generated, and then sent back to the host computer.
10. A waveform generation system for an electrochemical workstation, used to implement the waveform generation method for an electrochemical workstation as described in any one of claims 1-9, characterized in that, include: The skeleton extraction module is used to: receive the measurement method identifier and target potential range, call the waveform rule library to extract the stage skeleton and basic waveform rules, calculate the basic time grid based on the existing equal interval discretization and scanning speed conversion relationship, and output the stage skeleton and basic time grid. The semantic constraint module is used to: generate a waveform semantic segment table based on the stage skeleton and the basic time grid, solidify each stage into a set of generation rules and constraints, and write the boundary consistency constraints of adjacent stages to form a unified connection condition. The shaping compilation module is used to: compile the waveform semantic segment table into a segmented execution package and a differential update package, extract boundary amplitude jump features and boundary sequence complexity features, and comprehensively analyze them to obtain the connection shaping coefficients. Based on this, it determines the generation of transition segments and the compilation of local fine grids in the boundary neighborhood, and writes them into the segmented execution package and the differential update package. The segmented execution module is used to: load and output waveforms in the segmented execution package order at the front end, complete the inter-segment switching preparation using the segmented buffer and loading confirmation mechanism, and generate transition segments according to the transition segment instructions in the segmented execution package when transition segments need to be generated. The trajectory recording module is used to generate execution trajectory records during output and send them back to the host computer.
Citation Information
Patent Citations
Electrochemical detection equipment and electrochemical detection method
CN109490399A
Portable electrochemical system
CN213068704U