Photovoltaic equipment protocol adaptive analysis method
By combining syntax-physics joint satisfiability analysis and active mutation spectrum detection, an adaptive parsing method for photovoltaic equipment protocols is generated, which solves the problem of automated parsing of unknown protocols and protocol mutations in the existing technology, and realizes efficient and robust data acquisition and parsing.
Patent Information
- Application Number
- CN202511654069.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-01-30
AI Technical Summary
Existing technologies face technical bottlenecks in dealing with implicit variations and automatic semantic discovery of photovoltaic inverter protocols, resulting in systems that are highly dependent on manual intervention and have a low degree of automation, making them unable to effectively cope with unknown protocols and protocol variations.
By acquiring the original message sample set and acquisition context, a preprocessed message sequence and an environment-side reference sequence are generated. The first version of the parsing template is generated by performing syntax-physical joint satisfiability parsing. A revised parsing template is generated by active detection based on the mutation spectrum, thereby realizing automatic reverse engineering and active adaptation to unknown protocols.
It enables automated parsing of unknown protocols, improves the efficiency and robustness of data collection, reduces manual intervention, can proactively adapt to protocol variations, and ensures the self-consistency of data at the physical layer.
Smart Images

Figure CN121442015A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of photovoltaic device communication protocol analysis, and particularly relates to a photovoltaic device protocol adaptive analysis method. BACKGROUND
[0002] It is the basis for guaranteeing the safe and stable operation of the power grid, optimizing the power generation efficiency, and realizing unified metering management to realize efficient and accurate data collection and real-time monitoring of massive and heterogeneous photovoltaic devices such as inverters. Under this background, photovoltaic protocol conversion and analysis technology as the key hub connecting the bottom layer device and the upper layer master station system, its adaptive ability and analysis depth directly affect the data penetration efficiency of the power internet of things.
[0003] At present, for the protocol analysis of photovoltaic inverters of multiple manufacturers, the mainstream technical scheme mainly relies on manual configuration and template matching based on white list. The operation and maintenance personnel obtain the protocol point table provided by the manufacturer, manually configure or write scripts (such as YAML files), define the message header, register address, data type, etc. For unknown protocols, some methods try to use statistical clustering based on message length, function code or fixed field characteristics to classify similar messages, and then manually perform secondary screening and labeling to gradually expand the protocol library.
[0004] The existing technology has obvious technical bottlenecks in dealing with implicit variations of protocols and automatic discovery of semantics. These bottlenecks are concentrated in the black box characteristics of analysis and passive response to protocol variations, resulting in high dependence on manual intervention and low automation. SUMMARY
[0005] The application aims to provide a photovoltaic device protocol adaptive analysis method to solve the above problems existing in the prior art.
[0006] The technical scheme is a photovoltaic device protocol adaptive analysis method, comprising:
[0007] Obtain the original message sample set and the collection context, generate the preprocessed message sequence and the environment side reference sequence;
[0008] Based on the preprocessed message sequence and the environment side reference sequence, perform syntax-physical joint satisfiability analysis to generate the first version of the analysis template and the satisfiability residual;
[0009] Based on the first version of the analysis template and the satisfiability residual, perform active detection based on the variation spectrum to generate the revised version of the analysis template;
[0010] Obtain the online collection stream, and apply the revised version of the analysis template to analyze the online collection stream to generate the unified reporting data.
[0011] Beneficial effects, the application can automatically reverse engineer the semantics of unknown protocols, and actively adapt to protocol variations, realizing efficient and robust data acquisition. BRIEF DESCRIPTION OF DRAWINGS
[0012] Figure 1 A step flow chart of a photovoltaic equipment protocol adaptive analysis method provided by an embodiment of the application.
[0013] Figure 2 A step flow chart of generating a first version of an analysis template and a satisfiability residual provided by an embodiment of the application.
[0014] Figure 3 A step flow chart of jointly solving to obtain a semantic mapping scheme provided by an embodiment of the application.
[0015] Figure 4 A step flow chart of generating a revised version of an analysis template provided by an embodiment of the application. DETAILED DESCRIPTION
[0016] In order to make the personnel in the art better understand the application scheme, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor should belong to the protection scope of the application.
[0017] It should be noted that the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device containing a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0018] In the research, it is found that the traditional method only relies on syntax features (such as byte pattern or CRC check) for matching or clustering, and cannot establish semantic association between message fields and the physical world (such as voltage, current, power). Therefore, when facing unknown scaling factors, end sequences (big-endian or little-endian), or encoding methods (such as BCD code), even if the message is successfully parsed at the syntax level, the data is false in the physical dimension (such as P = V x I, where P is power, V is voltage, and I is current), and the system lacks self-checking ability for such semantic errors. In addition, the existing scheme has insufficient recognition ability for protocol variations (such as field rearrangement or cross-family mixing caused by manufacturer firmware upgrade). When the known template is invalid, the system cannot autonomously diagnose the root cause of the variation (for example, is the scaling factor changed, or is the field order changed), and lacks an active detection mechanism to obtain additional information to eliminate this ambiguity in parsing, ultimately relying on time-consuming packet analysis and template reconfiguration by operation and maintenance personnel.
[0019] As shown in Figure 1 A photovoltaic device protocol adaptive parsing method is proposed, including the following steps:
[0020] Obtain the original message sample set and the collection context, generate the preprocessed message sequence and the environment-side reference sequence.
[0021] In other words, obtain the original message sample set and the collection context, and preprocess the original message sample set and the collection context respectively to obtain the preprocessed message sequence and the environment-side reference sequence.
[0022] Specifically, the original message sample set includes the original byte sequence of multiple rounds of polling responses collected from a photovoltaic device (such as an inverter), the arrival time of each message, and the device identifier. The collection context provides auxiliary information, such as the latitude and longitude of the site where the device is located, the known field information of the device model, the communication medium (such as RS485, TCP / IP), and the historical reading strategy log, etc. After obtaining the above information, preprocessing is performed on the original message sample set. Exemplarily, preprocessing can include message denoising, CRC (Cyclic Redundancy Check) check classification, abnormal frame (such as length error, check failure) rejection, and preliminary judgment of end sequence. Through preprocessing, the original byte stream is converted into a structured frame list, i.e. the preprocessed message sequence, which can mark the suspicious frame header and length domain position. At the same time, if the collection context or external systems (such as irradiance meters, power meters) provide a synchronizable environment data history sequence, these data are synchronized to obtain the environment-side reference sequence. The environment-side reference sequence will provide an important basis for subsequent physical satisfiability analysis.
[0023] Based on the preprocessed message sequence and the environment-side reference sequence, perform syntax-physical joint satisfiability analysis to generate the first version of the parsing template and the satisfiability residual.
[0024] In this embodiment, two tasks are performed in parallel: on the one hand, based on the pre-processed message sequence, the structure rules of the message are induced using statistical tools such as sliding window information entropy, mutual information, etc., including identifying the boundaries of potential frame header, address field, function field, data field, check field, and extracting rules such as the correspondence between length field and data field, register alignment step, etc., to form a syntax constraint set. On the other hand, based on the environment-side reference sequence, a physical constraint set is established, which contains, for example, energy conservation relationship, unit dimension consistency (such as the product relationship of voltage, current and power), and grid limit and efficiency priori, etc. Under the joint constraints of the syntax constraint set and the physical constraint set, the mapping scheme of the message field to the physical semantics is jointly solved and optimized. The goal of this optimization is to find a mapping scheme (for example, determine which field represents voltage and which field represents current) that minimizes the weighted sum of the violation penalties of the physical constraints and the violation penalties of the syntax constraints. After the solution is completed, the first version of the parsing template is output. This template is a structured description file (such as YAML format) that contains the parsing required information such as the offset, length, endianness (big-endian or little-endian), scaling factor, unit, etc. of the field. At the same time, the satisfiability residual is output, which can be a sub-item residual vector, used to quantify the degree of satisfaction of the current template under each physical and syntax constraint.
[0025] Based on the first version of the parsing template and the satisfiability residual, active probing based on the mutation spectrum is performed to generate a revised version of the parsing template.
[0026] Specifically, when the satisfiability residual of the first version of the parsing template is too high, or there are unexplained fields with unclear semantics, a mutation spectrum posterior is established in the space of pre-defined template families (such as prototype templates of different manufacturers or firmware) and mutation operations (such as field rearrangement, encoding variants). Based on the mutation spectrum posterior, an active probing plan is generated according to, for example, the principle of minimizing expected regret. This active probing plan contains a series of restricted read-only operations that aim to maximize the differentiation between the current most confusing candidate template family and the mutation type combination. After executing the active probing plan (sending read-only instructions to the device and obtaining responses), the mutation spectrum posterior is updated with the newly obtained data, and the most likely mutation type is automatically determined, and then a compensation mapping is synthesized. Apply the compensation mapping to the first version of the parsing template to generate a revised version of the parsing template. For example, if the mutation type is determined to be field rearrangement, the compensation mapping is a permutation matrix; if it is an encoding variant, it is a selected decoder.
[0027] An online collection stream is obtained, and the revised version of the parsing template is applied to parse the online collection stream to generate unified reporting data.
[0028] In addition, the online collection stream can be parsed by the revised version of the parsing template, and the parsed data can be subjected to final consistency verification to generate unified reporting data and a consistency verification report.
[0029] In the present embodiment, after obtaining the high-confidence revised parsing template (or the final version template stored in the whitelist), the template is used in the online running phase. Specifically, the revised parsing template is loaded, the online acquisition stream acquired in real time is parsed, the original message is mapped to data items (such as telemetry, remote signaling, and remote adjustment data items) with clear physical semantics, and format conversion is performed according to requirements (such as the 698 protocol) to generate unified reporting data and send the unified reporting data to the master station or the monitoring system. Preferably, a final consistency verification link is further included. That is, before generating the unified reporting data, the data parsed is subjected to final consistency verification based on the set of physical constraints and the compensation mapping. The data to be reported is self-consistent in the physical layer (such as energy conservation and unit dimension). Correspondingly, a consistency verification report is also output, covering, for example, energy conservation error, unit dimension consistency statistics, out-of-bound and missing measurement statistics, and template coverage rate. Optionally, as a closed-loop optimization mechanism, if the consistency verification report shows abnormality exceeding a threshold value (for example, the energy balance error continuously exceeds 5%), the system can carry the corresponding residual item and automatically backtrack to the syntax-physical joint satisfiability analysis step to trigger re-solution or backtrack to the active detection step to trigger additional detection, thereby realizing online continuous optimization of the template.
[0030] As shown in Figure 2 In one possible implementation, generating the first version parsing template and the satisfiability residual includes:
[0031] Based on the preprocessed message sequence, structural rules are induced to form a set of syntax constraints.
[0032] In other words, the preprocessed message sequence is subjected to structural rule induction to obtain a set of syntax constraints.
[0033] In particular, the pre-processed packet sequence is statistically characterized and boundary detected. For example, a sliding window can be performed on each packet with a fixed step (e.g., 1 byte), and statistical features such as window information entropy, adjacent window mutual information, repetitive pattern period, etc. can be calculated. Based on these statistical features, a boundary confidence score for each byte position can be calculated. For example, a boundary score B(i) for a byte position i can be calculated by the following formula: B(i) = σ (α1 · ΔH(i) + α2 · MI(i) + α3 · period jump(i) + α4 · frame header match(i)); where σ is a sigmoid function; ΔH(i) is the difference of window information entropy on both sides of position i; MI(i) is the mutual information of windows on both sides of position i; period jump(i) is the score of change of repetitive period detected at position i; frame header match(i) is the matching degree with known frame header pattern; α1, α2, α3, α4 are respective weight coefficients, which can be set to 0.4, 0.2, 0.2, 0.2 respectively, and can be updated adaptively in subsequent optimization. After obtaining the boundary confidence curve B(i), a dynamic programming algorithm is used to find a segmentation path that maximizes the boundary confidence and structural consistency on the limited label set of frame header / address field / function field / length field / data field / check field. Exemplarily, the cost function J of dynamic programming can be designed as: J = Σ j [-logB(j)] + β · R struct ; where Σ j [-logB(j)] represents the sum of confidence of all selected boundaries (the cost is represented by negative logarithm); R struct is a penalty term of structural constraint, for example, the penalty of inconsistency between the number of bytes declared by the length field and the actual number of bytes in the data field, or the penalty of register alignment step length not being 2 or 4; β is the weight of structural penalty, which can be set to 3. After obtaining the initial segmentation sequence by dynamic programming, the frame header / length / check, etc. of the multi-frame set are summarized to learn the combinable grammar or finite automaton production, and a protocol syntax tree is formed. At the same time, common CRC polynomials (such as CRC16-MODBUS, CRC-CCITT) and XOR check are tried on the check field to search for check parameters that can cover most of the sample frames. The structural rules extracted in the above process, such as the consistency of the number of bytes between the length field and the data field, the consistency of the check family, the field alignment step length (e.g., 2 bytes or 4 bytes), etc. are summarized to form a syntax constraint set.
[0034] Based on the environment-side reference sequence, a physical prior is established to form a physical constraint set.
[0035] In an exemplary embodiment, establishing a physical prior to form a physical constraint set comprises:
[0036] Based on the environment-side reference sequence, an energy conservation constraint is constructed, which represents the integral relationship between energy and power.
[0037] Specifically, for any adjacent time window [t, t+Δ], the difference between the cumulative energy E(t+Δ) and E(t) parsed from the message should be approximately equal to the integral of the instantaneous power P(k) with respect to the time step Δt within that time window (e.g., summed using the trapezoidal rule: Σ). k∈时间窗口 The difference between P(k) and Δt should be close to zero.
[0038] Construct a unit dimension consistent constraint, which represents the product relationship between voltage, current and power.
[0039] Specifically, the DC voltage U analyzed at the same or similar times dc With DC current I dc The product of these two factors should be approximately equal to the analytically derived DC power P. dc Or, AC voltage U ac With alternating current I ac The product of these two values should be approximately equal to the analytically derived AC power P. ac .
[0040] In addition, we construct prior constraints on grid connection limits and efficiency.
[0041] For example, the grid-connected power P ac (i.e., AC power) should not exceed the rated power P of the equipment. rated (This value can be obtained from the acquisition context or used as a parameter to be estimated). Grid-connected power P ac It should be approximately equal to the DC power P dc Multiply by the efficiency η, where the efficiency η should be within a reasonable prior interval, such as η∈[0.7, 1.0]. Optionally, a diurnal and meteorological sparse prior can also be constructed, for example, the power P at night (which can be determined based on the station's latitude, longitude, and timestamp) should be close to zero.
[0042] A set of physical constraints is generated based on energy conservation constraints, unit dimension consistency constraints, and grid connection limit and efficiency prior constraints.
[0043] In other words, the above constraints and their default penalty functions (such as the Huber loss function) together constitute the set of physical constraints.
[0044] Under the common constraints of the syntactic constraint set and the physical constraint set, the semantic mapping scheme is obtained by joint solution.
[0045] In this embodiment, the joint solving is performed for joint optimization variables, including: a semantic mapping scheme of fields to physical semantics. It is defined which candidate fields (defined by offset and length) in which message data field are mapped to which physical quantity (such as voltage U, current I, power P, energy E, temperature T, etc.). And, offline encoding parameters, including at least: endianness or scale factor. Endianness e defines the arrangement of multi-byte (such as 2 bytes or 4 bytes) fields in memory, and its value space is {little, big}, where little is little endian, and big is big endian. Scale factor (scale) defines the scaling factor (v raw = scale · v phys ) from the original integer value v phys of the message to the physical quantity v raw , and its candidate set S scale may be generated according to empirical values (such as {0.01, 0.1, 1, 10}) or according to sample value domain. Optionally, the discrete encoding parameter can also include a sign variable sgn∈{signed, unsigned}, where signed is a signed integer, and unsigned is an unsigned integer.
[0046] As shown in Figure 3 , in a preferred embodiment, the joint solving obtains a semantic mapping scheme, including:
[0047] determining a physical constraint violation penalty based on a set of physical constraints;
[0048] determining a syntax constraint violation penalty based on a set of syntax constraints;
[0049] minimizing the weighted sum of the physical constraint violation penalty and the syntax constraint violation penalty to obtain the semantic mapping scheme.
[0050] In this embodiment, the objective function (optimization model) of joint optimization can be represented as: minΣ t [ρ energy (t) + ρ unit (t) + ρ grid (t)] + λ g · L grammar + λ s · L sparsity ; where min is the minimum value for all joint optimization variables (semantic mapping scheme Θ, discrete encoding parameter D, and possibly continuous parameter X such as efficiency η); Σ t is the sum for all time stamps t; ρ energy (t) is the energy conservation constraint violation penalty at time t; ρ unit (t) is the unit dimension consistent constraint violation penalty at time t; ρgrid (t) is the grid-in time limit and efficiency prior violation penalty at time t; preferably, the above ρ penalty function can adopt Huber loss to enhance robustness to abnormal data points; λ g is the weight coefficient of syntax constraints; L grammar is the violation penalty of the set of syntax constraints (such as length consistency, check consistency, alignment consistency); λ s is the weight coefficient of sparse terms; L sparsity is the field sparse term, used to suppress meaningless field mapping or excessive scaling factor.
[0051] In further embodiments, the weighted sum of the physical constraint violation penalty and the syntax constraint violation penalty is minimized, comprising:
[0052] performing a physical step that minimizes the physical constraint violation penalty under the premise of fixing the syntax constraints to update the semantic mapping scheme;
[0053] performing a syntax step that updates the syntax constraints under the premise of fixing the semantic mapping scheme;
[0054] alternately performing the physical step and the syntax step until convergence.
[0055] Specifically, in the physical step, fixing the current protocol syntax tree (i.e., field segmentation scheme), the above optimization model is solved on discrete and continuous variable domains to minimize the physical violation term (ρ energy + ρ unit + ρ grid ), thereby updating the semantic mapping scheme Θ and continuous parameters such as efficiency η. In the syntax step, fixing the semantic mapping scheme Θ obtained by the physical step, in turn, maximizes the sample coverage rate × check coverage rate / syntax violation (L grammar ), i.e., based on the statistical stability of the current field pair and the check coverage rate, updating the confidence of the syntax production (protocol syntax tree) or updating the alignment step length and other syntax constraints. The physical step and the syntax step are repeatedly performed until the decline ratio of the satisfiability residual (i.e., the value of the objective function) is less than a preset threshold (for example, ε = 1%) or the maximum number of iterations (for example, N max = 10) is reached, at which point the algorithm is considered to have converged.
[0056] Based on the semantic mapping scheme, a first version of the parsing template and the satisfiability residual are generated.
[0057] Specifically, after the alternating optimization converges, the obtained converged solution (i.e., the optimal semantic mapping scheme Θ and discrete coding parameters D) and the identified check family parameters are integrated into a structured YAML template, namely the first version of the parsing template. The first version of the parsing template details the field offset, length, end-order, scaling factor, and unit for each physical quantity. Simultaneously, it outputs the final satisfiability residual vector and organizes semantically insufficient or conflicting fields into an unexplained field set for use in subsequent implementations (such as active probing).
[0058] In a detailed embodiment, it is assumed that the Syntax-Physical Joint Satisfactionability Resolution (SPSA) module receives a preprocessed message whose data field contains the byte sequence ... 0C1A0064... Meanwhile, the reference power P at that moment is known from the acquisition context and the environmental reference sequence. ref Approximately 3.0kW, rated power P of the equipment rated The power is 5kW. The joint optimization variables that the SPSA module needs to determine include: candidate fields: it is assumed that two 2-byte candidate fields are nominated through parsing: F1 (starting from 0C1A) and F2 (starting from 0064); physical semantics: it is necessary to map {voltage U, current I} to {F1, F2}; discrete encoding parameters: end order e∈{little, big}, scaling factor scale∈{0.01, 0.1, 1, 10}. The SPSA solver will iteratively evaluate different hypotheses (i.e., different combinations of joint optimization variables) and calculate their penalty for breach of the physical constraint set. Here, the unit dimension consistency constraint (P≈U×I) and the grid connection limit constraint (P) are used. ac ≤P rated Let's take an example to illustrate. Assumption 1 (Θ1): The semantic mapping scheme is voltage U=F1; current I=F2. The discrete encoding parameters are end order e=big (big end); voltage scaling factor scale U =0.1; Current scaling factor I =0.1. Original voltage value V raw =0C1A hex =3100; Voltage physical quantity V phys =V raw ×scale U =3100×0.1=310.0V; Original current value I raw =0064 hex =100; Current physical quantity I phys =I raw ×scale I =100 × 0.1 = 10.0 A. Calculate the penalty for breach of physical constraints: In a unit-dimensional consistent breach, calculate the power P. calc =V phys ×Iphys =310.0V×10.0A=3100W=3.1kW; Default residual (compared to reference power P) ref (Comparison): |P calc -P ref |=|3.1kW-3.0kW|=0.1kW. In the extreme default of grid connection, P calc (3.1kW)≤P rated (5kW). Constraints satisfied. Under this assumption, the penalty for physical constraint breach (residual) is very low. Assumption 2 (Θ2): The semantic mapping scheme is voltage U=F1; current I=F2; discrete encoding parameters are endianness e=little (little-endian); voltage scaling factor scale U =0.1; Current scaling factor I =0.1. Original voltage value V raw =1A0C hex =6668; Voltage physical quantity V phys =V raw ×scale U =6668 × 0.1 = 666.8V; Original current value I raw =6400 hex =25600; Current physical quantity I phys =I raw ×scale I =25600 × 0.1 = 2560.0 A. Calculate the penalty for breach of physical constraints: In a unit-dimensional consistent breach, calculate the power P. calc =V phys ×I phys =666.8V×2560.0A≈1707008W≈1.71MW; the default residual is |1.71MW-3.0kW|; in the grid connection extreme default, P calc (1.71MW)>>P rated (5kW). Constraints are severely violated. Under this assumption, the penalty for violating physical constraints is extremely high. Assumption 3 (Θ3): The semantic mapping scheme is voltage U=F1; current I=F2. Discrete encoding parameters are end-order e=big (big end); voltage scaling factor scale U =1; Current scaling factor I =1. Voltage physical quantity V phys =3100V; Current physical quantity I phys =100A. Calculate the penalty for breach of physical constraints: In a unit-dimensional consistent breach, calculate the power P. calc =3100V×100A=310000W=310kW; the default residual is |310kW-3.0kW|; in the grid connection extreme default, P calc(310 kW) >> P rated (5 kW). The constraint is severely violated. Under this assumption, the physical constraint violation penalty is also extremely high.
[0059] From the above comparison, it can be seen that in the process of minimizing the objective function (i.e., minimizing the physical constraint violation penalty), the joint optimization solver finds that the residual (0.1 kW) corresponding to hypothesis 1 (Θ1) is much smaller than that of hypothesis 2 and hypothesis 3. Therefore, the solver will converge to hypothesis 1, automatically determine the correct semantic mapping scheme (U=F1, I=F2) and discrete encoding parameters (end sequence = Big-Endian, voltage scaling = 0.1, current scaling = 0.1), and generate the first version of the parsing template based on this.
[0060] As shown in Figure 4 , according to one aspect of the present application, the revised version of the parsing template is generated, including:
[0061] Based on the first version of the parsing template and the satisfiability residual, a mutation spectrum posterior of the template family and the mutation operation is established.
[0062] In the present embodiment, the template family T refers to a set of known prototype templates, for example, T can include {baseline template of manufacturer A, baseline template of manufacturer B, general Modbus template}. The mutation operation M refers to the modification that can be made to the template T. Preferably, the mutation operation includes at least one of field rearrangement, encoding variant, cross-family mixing, scaling mutation, or end sequence mutation. The mutation spectrum posterior Post(T, M) is a probability distribution representing the credibility of the assumption that the template T has undergone mutation M supported by the current data (i.e., the SPSA parsing result). Specifically, for each candidate hypothesis combination (T, M), apply it to the first version of the parsing template YAML v1 to obtain a temporary template, and replay the sample data using the temporary template to recalculate the physical and syntax residual vector r(T, M) = [r energy , r unit , r grid , r grammar ], where r energy is the energy conservation residual, r unit is the unit consistency residual, r grid is the grid connection constraint residual, and r grammarThe residual is a syntax structure residual. A likelihood function p(data|T*M) is defined to measure the degree of fitting of the data to the hypothesis, where * represents a composite operator. For example, p(data|T*M) can be defined as p(data|T*M) ∝ exp(-w·||r(T,M)||1); where ∝ represents proportional to; w is a scaling coefficient (for example, w=10), and ||r(T,M)||1 is the L1 norm of the residual vector r (i.e., the sum of the absolute values of each residual). The smaller the residual, the higher the likelihood value. In combination with the prior probability (the prior probability P(T) of the template family and the prior probability P(M) of the mutation operation, which can be set as a uniform distribution if there is no prior), the posterior probability is calculated by Bayes' theorem, and is normalized by using Softmax: Post(T,M)=Softmax(logp(data|T*M)+logP(T)+logP(M)); where Post(T,M) is the mutation spectrum posterior; and logP(T) and logP(M) are the logarithmic prior probabilities of the template family and the mutation operation, respectively.
[0063] Based on the mutation spectrum posterior, an active probing plan is generated.
[0064] Specifically, after the mutation spectrum posterior Post(T,M) is generated, if the entropy H(Post) of the distribution (mutation spectrum) is high, or there are multiple peaks with similar probabilities (i.e., there are highly confused hypotheses), new data needs to be obtained by active probing to eliminate ambiguity.
[0065] In a preferred implementation, generating the active probing plan includes: based on the mutation spectrum posterior, calculating the expected utility of a candidate action within a preset limited set of read-only actions.
[0066] In this embodiment, the limited set of read-only actions Actions refers to enumerated allowed read operations, for example, an action a=(function code, address, length, frequency). These actions are limited by a security constraint model Ca, which defines, for example, the maximum number of read operations per minute, the minimum read interval, the maximum concurrency, etc., to prevent device overload.
[0067] The calculation of the expected utility aims to minimize the expected regret.
[0068] A preferred implementation is to maximize the expected information gain (EIG). The calculation formula of the expected information gain EIG(a) is: EIG(a)=H(Post)-E y∼p(•|a) [H(Post|y)]; where EIG(a) is the information gain expected to be brought by performing the action a; H(Post) is the entropy (uncertainty) of the current mutation spectrum posterior; E y∼p(•|a)[H(Post|y)] is the expected posterior entropy (expected remaining uncertainty) after performing action a and observing possible outcome y. The higher the EIG, the more effective the action is in reducing the posterior uncertainty.
[0069] According to the expected utility, a candidate action is selected to form the active probing plan under the pre-configured safety constraint model.
[0070] Specifically, it can be understood as a constraint optimization problem: solving the action subset A (A belongs to the limited read-only action set Actions) so that Σ a∈A EIG(a) is maximized while satisfying the safety constraint model Ca (for example, the size of A does not exceed the concurrent upper limit C max ). The selected action subset A is the active probing plan. The plan can be executed in batches (A1, A2,...).
[0071] The active probing plan is executed to determine the mutation type and generate the compensation mapping.
[0072] Specifically, the actions in the active probing plan A are executed (i.e., read-only messages are sent to the device), and new read-only responses R new are obtained. The new read-only responses R new are integrated into the existing data set, and the re-calculated mutation spectrum posterior Post(T, M) is returned to obtain the updated posterior Post1. According to the maximum posterior item in the updated Post1, the most likely mutation type MT is determined. For example, if the item with the highest probability in Post1 is (T=manufacturer A, M=field rearrangement), then the mutation type MT is determined to be field rearrangement.
[0073] In an optional embodiment, generating the compensation mapping includes: generating a corresponding compensation mapping for the determined mutation type; wherein if the mutation type is field rearrangement, the compensation mapping includes a permutation matrix; and if the mutation type is an encoding variant, the compensation mapping includes a selected decoder.
[0074] Specifically, in Example 1 (field rearrangement), if the mutation type is field rearrangement, the compensation mapping includes a permutation matrix. Specifically, the system can solve the permutation between the known physical semantic fields (such as voltage, current) and the candidate fields in the first version of the template. Preferably, the permutation matrix P can be solved by the Hungarian algorithm to find a field permutation allocation scheme that minimizes the physical residual. The compensation mapping M comp is the permutation matrix P. In Example 2 (encoding variant), if the mutation type is an encoding variant, the compensation mapping includes a selected decoder. For example, if the mutation type MT is determined to be a BCD encoding variant, the system selects from the set {standard binary decoder, BCD decoder} and finds that the BCD decoder can significantly reduce the residual. At this time, the compensation mapping Mcomp i.e. the instruction to apply the BCD decoder for a specific field. In Example 3 (cross-family hybrid), if the MT is determined to be a cross-family hybrid, then the compensation mapping M comp is a template that is a piecewise composition, e.g. its voltage-related fields come from a vendor A template, while the energy accumulation fields come from a vendor B template. In Example 4 (scaling / endianness variant), if the MT is determined to be a scaling variant, then the compensation mapping M comp is a new optimal scaling factor found in the discrete variable domain D (e.g. correcting the voltage scaling from 0.1 to 1).
[0075] Apply the compensation mapping to the first version of the parsing template to generate a revised version of the parsing template.
[0076] In this embodiment, the compensation mapping M comp is applied to the first version of the parsing template YAML v1 to obtain a revised version of the parsing template YAML v2 . For example, if the compensation mapping M comp is a permutation matrix, then the matrix is applied to reorder the field offsets in the first version of the parsing template. Preferably, the revised version of the parsing template YAML v2 is again subjected to a consistency re-verification, and the residual error Rspsa v2 is recalculated. If each of the individual components of the recalculated residual error Rspsa v2 is below a pre-set threshold (e.g. r energy ≤ 3%, r unit ≤ 2%), then the process is marked as converged, and the revised version of the parsing template YAML v2 is output as a stable template. If the residual error is still too high, then the process returns to continue generating the next batch of active probing plans based on the current updated posterior Post1, and iteratively optimizes.
[0077] In further embodiments, the output of the active probing includes: the revised version of the parsing template (e.g. YAML v2 ), the final variant spectrum posterior (Post(T, M)), and the generated compensation mapping (M comp ). The output of the active probing is used to update the protocol knowledge graph state (KG). The knowledge graph is a graph-like data structure, whose nodes can include protocols (e.g. Modbus), vendors (e.g. Vendor A), firmware versions (e.g. V1.2.3), field semantics (e.g. AC voltage, cumulative energy), variant types (e.g. field rearrangement, BCD encoding), etc.; and edges represent the relationships between these nodes (e.g. Vendor A’s V1.2.3 firmware uses the Modbus protocol but has a field rearrangement variant). When the active probing outputs a new set of learning outcomes (e.g. for Vendor A’s V1.2.3 firmware, through the compensation mapping M compsuccessfully resolved), the system will add or weight the corresponding relationship edge in the knowledge graph. Preferably, the updating process also includes soft constraint satisfiability solving for potential conflicts. For example, if the system has historically learned a scaling factor of 0.1 for another device of this firmware, and this time the learning result is a scaling factor of 1, the knowledge graph is not simply overwritten, but can be merged or revised based on satisfiability residual, data volume, variation spectrum posterior confidence, etc. information, in a way that minimizes the default cost, thereby improving the robustness of the knowledge base. After the knowledge graph state KG is stable (for example, through a batch task or after the confidence reaches a threshold), the system exports the white list entry (W) from the knowledge graph. The white list entry preferably includes template identification, identification fingerprints for fast matching (for example, reading response characteristics of a specific address range), applicable scope (such as manufacturer, firmware version list), and version information. At the same time, the verified revised parsing template (YAML v2 ) is versioned to form the final version parsing template (YAML vfinal ). The white list entry and the final version parsing template are stored in the non-volatile memory as the basis for fast matching and operation and maintenance when new devices are subsequently accessed. The function of automatically and structurally adding unknown protocols learned automatically to the known protocol library (i.e. the white list) is realized, improving the protocol matching speed and accuracy of subsequent devices of the same type.
[0078] According to an aspect of the present application, a photovoltaic device protocol adaptive parsing system includes a processor and a memory, the memory having stored thereon computer instructions which, when executed by the processor, implement the photovoltaic device protocol adaptive parsing method of any of the above embodiments.
[0079] According to an aspect of the present application, a photovoltaic device protocol adaptive parsing system includes: a syntax-physical joint satisfiability parsing module for jointly solving based on a preprocessed message sequence and an environment-side reference sequence under the joint constraints of a syntax constraint set and a physical constraint set to generate a first version parsing template. It also includes: a variation spectrum-based active probing module for establishing a variation spectrum posterior based on the first version parsing template and a satisfiability residual, and generating an active probing plan to minimize expected regret to generate a revised version parsing template.
[0080] In a preferred embodiment, a photovoltaic protocol converter is provided. The converter is functionally downstream: for power consumption information acquisition of single or multiple inverters, especially for data acquisition of multiple manufacturers' inverters, and automatically adapts to all photovoltaic inverter manufacturers' (for example) Modbus protocol and its variants. Upstream: encapsulates and reports the read photovoltaic data through a unified upstream protocol (for example, DL / T698 protocol) to the master station or monitoring system, realizes the unified reporting of data.
[0081] The converter realizes the downstream protocol adaptation by adopting a multi-level identification mechanism. Specifically: the first level is known protocol feature identification. When a new device is connected or the system is initialized, the converter performs fast feature matching, which corresponds to using identification fingerprints (part of the white list entries). For example, the converter sends a specific message to the device to read the manufacturer's identification or device model, and by comparing the characteristics of the response message, it quickly identifies whether the device belongs to the known protocol library. The second level is white list matching. If the first level feature identification is successful (for example, it is identified as V1.2.3 firmware of manufacturer A), the system enters white list matching, which corresponds to directly loading and applying the final version of the parsing template associated with the fingerprint from the storage. Since the template has been previously analyzed and verified by syntax-physical joint satisfiability analysis and active probing based on variation spectrum, the converter can immediately use the field offset, length, end sequence, scaling factor, etc. in the template to efficiently and accurately start reading various data items of the device. The third level is automatic learning. If a device fails in both the first level feature identification and the second level white list matching, the system determines that it is an unknown protocol or a known protocol variant, and automatically activates the automatic learning module. The implementation of the automatic learning module is as follows: collect the original message sample set of the unknown device and the collection context; activate the syntax-physical joint satisfiability analysis (SPSA) module to try to reverse engineer and solve the first version of the parsing template from the original message; activate the active probing module based on variation spectrum, based on the output of the syntax-physical joint satisfiability analysis module (the first version of the parsing template and the residual), iteratively optimize and revise the first version of the parsing template through active read-only probing when necessary, and generate a high-credibility revised version of the parsing template; activate the knowledge graph incremental learning and white list rewriting module to persist the high-credibility revised version of the parsing template and its variation characteristics, update the knowledge graph, and generate a new white list entry and a final version of the template, so that the next time a device of this type is connected, it can be directly matched in the first and second levels.
[0082] In some alternative embodiments, the photovoltaic protocol converter can employ a layered processing architecture in hardware or software: a protocol conversion layer is responsible for performing a multi-level identification mechanism. A built-in multi-protocol library (e.g., Modbus, DLT645, 698.45, etc.) is implemented to realize the standardized parsing of heterogeneous data. A data processing layer is responsible for fusing and processing the standardized data output by the protocol conversion layer. For example, a uniform time stamp is applied to the parsed data (e.g., voltage, current), and a unified format of telemetry data sets (e.g., voltage, current, power, frequency, energy), telecontrol data sets (e.g., device start-stop state, alarm state, switch position), and remote control data sets (e.g., for receiving power regulation instructions issued by the master station) are generated according to the requirements of the uplink protocol. A configuration interface layer is responsible for the configuration and maintenance of the system. For example, configuration information (e.g., device account, master station IP address) can be input by the operation and maintenance personnel through wired (e.g., Ethernet port) or wireless (e.g., WiFi, 4G, 5G) means, or the protocol library (i.e., white list and template) and acquisition parameters can be dynamically updated.
[0083] In an alternative embodiment, when facing unknown devices, the protocol adaptation process can include: using the converter to determine the communication address of the unknown device on the bus. Specifically, the converter can send a multi-address domain polling message to the bus (e.g., try Modbus addresses 1 to 247 in turn), and determine the specific address list of the active device on the bus according to the source address of the response message. After determining the device address, protocol matching is performed. The converter sends feature reading messages of different protocols to the target device in turn according to the built-in, pre-defined custom protocol library (e.g., containing a list of multiple common manufacturer Modbus variants). For example, first try to send a message to read the identification of A manufacturer, and if it fails, try to send a message to read the model of B manufacturer device. By comparing whether the response content conforms to the expected features defined in the protocol library (e.g., whether the register content is a specific string or value range), the specific protocol supported by the inverter is identified. In a possible embodiment, for automatic learning identification and reading processing, a dual Kalman filter architecture can be used. This architecture can be used to process timing noise and feature drift in the collected data. For example, after initial identification of the protocol, when parsing data items, through timing alignment (aligning data with different timestamps) and feature drift compensation (correcting reading drift due to sensor aging or environmental changes), the most representative and distinctive data items are filtered out to assist in the final confirmation of the protocol or improve the quality of the reported data.
[0084] It should be noted that the protocol matching process of the mechanism described in the embodiment highly depends on the predefined protocol library, and in the data processing process (such as double Kalman filtering), the timing characteristics of the parsed data are mainly focused on. Compared with the syntax-physical joint solving and the active detection mechanism, in terms of processing deep unknown protocols (that is, not in the predefined library) and reverse engineering complex semantics (such as automatically discovering unknown end sequences, scaling factors and field mapping relationships), the ability is relatively limited.
[0085] According to another aspect of the present application, the first version of the parsing template and the satisfiability residual are also generated, which can be:
[0086] The preprocessed message sequence and the context index are read, the window width w (default w = 8 bytes) and the step size s (default s = 1 byte) are set, and the window information entropy H = -Σ b p(b)·log p(b), where p(b) is the frequency of byte b in the window; the adjacent window mutual information MI = Σ b1,b2 p(b1, b2)·log[p(b1, b2) / (p(b1)p(b2))], where p(b1, b2) is the probability of the simultaneous occurrence of bytes b1 and b2 in the adjacent window; the autocorrelation is performed in the window, and the main peak position is taken as the cycle candidate; the matching degree is calculated through the known common frame header mode (such as fixed high byte). Based on the boundary score B(i) = σ(α1·ΔH(i) + α2·MI(i) + α3·periodic jump(i) + α4·frame header matching(i)) of each byte position, the segment candidate set and the boundary confidence curve (a real value vector with a length equal to the message length) are obtained. The segment candidate set and the boundary confidence curve are read, and dynamic programming segmentation is performed on the label set L = {frame header, address field, function field, length field, data field, check field}: the cost function is J = Σ j [-logB(j)]+β·R struct ; R structThe length domain and the data domain byte are consistent, the register alignment step is 2 or 4, and the hard / soft constraint is included, and β is a weight (default β = 3). The initial segmentation sequence and the segmentation confidence vector of each segment label are obtained by using forward cumulative minimum cost and recording the backtracking pointer. Meanwhile, the rules such as the consistency of the length domain ↔ data domain, the alignment step and the like are summarized as a syntax constraint set. The initial segmentation sequence and the syntax constraint set are read, and the production induction is performed on a plurality of frame sets: the prefix byte distribution and the length domain position of the frame header candidate are counted, and the production G→Hdr Addr Func Len Data Crc (frame header, address domain, function code, length domain, data domain, and check domain) is formed; the combinable block of the data domain (Data) substructure is performed (taking the data segmentation prior (Pseg) and the alignment step as the prior), and the data domain block production Data→F1 F2 …Fk is obtained; the production probability is estimated by maximum likelihood, and the production with the confidence degree ≥τ g (the default threshold τ g = 0.6) is retained to form a protocol syntax tree; and the check domain is identified: the common polynomials, initial values and reverse configurations of CRC16 and CRC-CCITT are enumerated, and the coverage rate (the hit rate ≥τ crc , the default hit rate threshold τ crc = 0.95) is evaluated, and the check family parameter set is output. The above is comprehensively updated to form a syntax constraint set (including the consistency of the length, the alignment step, and the consistency of the check family). The protocol syntax tree and the initial segmentation sequence are read, and the field candidate (offset, length ∈ {2, 4}) is enumerated in the data domain: the end sequence variable e ∈ {little, big}; the sign variable sgn ∈ {signed, unsigned}; the scaling candidate set S scale is automatically generated according to the sample value domain, for example, let the original integer value v raw be converted into a physical quantity v phys = scale·v raw , the scaling factor scale is taken from {10 k | k ∈ [-3, 3]} and adaptive candidates can be added (to match the unit dimension); the field candidate set and the discrete variable domain are summarized; and the continuous variable domain (efficiency η ∈ [0.7, 1.0], rated power P rated is given or estimated by the context index, and the integral step Δt is determined by the sampling period). The environment side reference sequence and the context index are read, and the energy conservation constraint is constructed: for any adjacent time window [t, t+Δ], the energy E(t+Δ)-E(t)-Σ k∈窗 power P(k)·Δt ≈ 0, the violation penalty ρ energy = Huber (residual; energy conservation residual tolerance Δ e ); the unit dimension consistency constraint is constructed: power P ≈ voltage U × current I, and the violation penalty ρ unit= Huber(P-U·I; unit-consistent residual tolerance Δ u ); construct grid-connection limits and efficiency priors: power P ac ≤ P rated , P ac ≈ efficiency η × voltage U dc × current I dc , η ∈ [η min , η max ], where η min is the minimum efficiency value and η max is the maximum efficiency value; construct day-night and weather sparsity priors: night-time power P is close to 0; overcast days depress expected power with ambient-side irradiance proxy sequence; form weighted set physical constraint set (containing Δ e , Δ u , η, P rated , prior weight λ c ). Read syntax constraint set, field candidate set, discrete variable domain, continuous variable domain, and physical constraint set, set up mixed integer-continuous joint optimization, where variables include: semantic mapping scheme: select field candidate (offset, length) for each physical quantity (voltage U, current I, power P, energy E, temperature T), and select endianness e, sign sgn, scale scale; continuous parameters: efficiency η, infinitesimal integration error term ε int . Objective function is: min Σ t [ρ energy (t) + ρ unit (t) + ρ grid (t)] + λ g · L grammar + λ s · L sparsity ; constraints: each physical quantity is mapped to at most one field; endianness / scale / sign values belong to discrete variable domain; syntax productions and alignment step lengths satisfy hard constraints of syntax constraint set; efficiency η, P rated belong to continuous variable domain; form optimization model. Read optimization model, first do beam search on discrete variable domain: use power coarse consistency as screening criterion (minimize Σ |P proxy -U·I| on a loose scale set, where P proxy is proxy power), get top K endianness / scale / candidate field combinations (default K=32), form intermediate solution; initialize continuous parameters (efficiency η starts from 0.9, integration error ε int =0) with intermediate solution, call SMT or MILP solver to get first global solution, get stage solution and stage residual. Read stage solution and optimization model, alternately execute physical steps: fix syntax production confidence and field split, minimize ρ energy + ρ unit + ρgrid , update semantic mapping scheme with efficiency η; and syntax step: fix semantic mapping scheme, maximize sample coverage x verification coverage / syntax violation, update production confidence and alignment step length; convergence criterion is that the proportion of satisfiability residual decreases < ε (default ε = 1%) or the number of iterations ≥ N max (default N max = 10); output the converged solution, updated protocol syntax tree, satisfiability residual and unexplained field set. Read the converged solution, protocol syntax tree, verification family parameter set and satisfiability residual to generate the first version of the parsing template (field offset, length, end sequence, scaling, unit, quality bit, sampling period, with verification family parameters and exception handling rules); convert the sample frame into a semantic annotated message (time series of voltage U, current I, power P, energy E, temperature T) according to the converged solution, and carry the satisfiability residual.
[0087] According to another aspect of the present application, the revised version of the parsing template can also be:
[0088] Read the first version of the parsing template, the semantic annotated message, the satisfiability residual, the unexplained field set and the context index, load the template family prior P(T) from historical knowledge (such as manufacturer A / B / C baseline template), define the variation operation set = {field rearrangement, encoding variant, cross-family mixing, scaling variant, end sequence variant}, and set the device security budget (maximum read operation N max , minimum interval Δmin, timeout T out , maximum concurrency C max per minute). Output the template family prior and the variation operation set. Read the template family prior, the variation operation set, the semantic annotated message and the satisfiability residual, for each candidate combination (T, M): apply (T, M) to the first version of the parsing template to obtain a temporary template, replay the sample and calculate the physical and syntax residual vector r(T, M) = [r energy , r unit , r grid , r grammar ]; the likelihood is defined as p(data | T*M) ∝ exp(-w·||r(T, M)||1); the posterior is Post(T, M) = Softmax(log p(data | T*M) + log P(T) + log P(M)); the uncertainty metric uses the posterior entropy H(Post) and the difference Δp of the closest two peaks; output the variation spectrum posterior and the uncertainty graph. Read the context index, enumerate the read-only actions a = (function code, address, length, frequency), filter out the combinations of function codes that will trigger write operations and high-frequency reads that will cause load, and form the action set; establish a safety constraint model: the frequency constraint is that the number of actions per unit time of any device ≤ the maximum number of iterations N max ; the concurrency constraint is that the number of concurrent actions ≤ the concurrency upper limit C maxTimeout T out The algorithm will retry a maximum of R times (default R=2); output the action set and safety constraint model. Read the posterior variance spectrum, uncertainty plot, action set, and safety constraint model, and estimate the expected information gain for each candidate action a: EIG(a)=H(Post)-E y∼p(•|a) [H(Post|y)] is estimated using the Laplace approximation or Monte Carlo subsample estimation; or using expected regret E[Regret(a)]≈Σ. (T,M) The negative value of Post(T, M)·(L*(T, M)-L(T, M|a)) is used as the utility, where L*(T, M) is the ideal loss value and L(T, M|a) is the conditional loss value; solving the constrained maximization problem max 子集A⊂Actions Σ a∈A EIG(a), st Ca, yields the active probing plan (batch A1, A2, ..., each batch size not exceeding the concurrency limit). The first batch of actions in the active probing plan is executed. New responses are read through the communication stack and CRC checks are performed to obtain new read-only responses. These responses are aligned with semantically annotated messages and preprocessed message sequences by time and message identifier to form an aggregated dataset (containing new and old samples and parsed values, verification results, and action metadata). The aggregated dataset and mutation operation set are read. For each (T, M), r(T, M) and similarity are recalculated, and the mutation spectrum posterior is updated to obtain the updated posterior. The mutation type is determined based on the maximum posterior and threshold rules: if a permutation significantly reduces the residual (Δr / r... base ≥ θ perm The default field rearrangement threshold θ perm =30%, where Δr is the residual decrease value, r base If the residual is the baseline residual, then field rearrangement is determined; if the residuals of different encoders are significantly different (e.g., BCD / hexadecimal encoder), then encoding variant is determined; if the segment combination of different template families is optimal, then cross-family mixing is determined; if end-order / scaling switching significantly improves the residual, then end-order or scaling variant is determined; output the updated posterior and mutation type. Read the mutation type and updated posterior: use the Hungarian algorithm to find the minimum residual permutation between the field sets, generate the permutation matrix, and obtain the permutation part of the compensation map; select the decoder that minimizes the residual in the candidate decoder set and write it into the compensation map; select segments from different template families for different field segments, synthesize segmented templates and record them into the compensation map; perform a local search in the discrete variable domain, select the (e, scale) with the smallest residual, and write it into the compensation map; output the compensation map. Apply the compensation map to the first version of the parsing template to obtain the revised parsing template; replay the samples of the revised parsing template under the physical constraint set and the syntax constraint set, and calculate the residual; if the residual of each item is lower than the threshold (e.g., r), then the revised parsing template is revised. energy ≤ε e =3%, r unit ≤εu =2%, r grid ≤ε g =5%, r grammar without violation), then convergence; otherwise, return to continue plan generation. The entropy of the integrated update posterior H(Post)≤h min (default posterior entropy threshold h min =0.3), the residual satisfies the threshold, and the action budget does not exceed the threshold, output the active probing log (records each round of action, information gain, posterior change curve, and device load index) and the convergence flag; at the same time, package the revised version of the analysis template, the mutation spectrum posterior, and the compensation mapping for incremental writing to the knowledge graph and rewriting the white list. The output active probing log and convergence flag are used for closed-loop auditing.
[0089] The present application introduces a set of physical constraints, including energy conservation, unit dimension consistency, and grid limit, etc. By jointly solving and minimizing the physical violation penalty, the analysis result is physically reasonable, thereby realizing self-checking and automatically solving the undetermined scaling factor and end sequence in the same optimization process. When the residual of the first version of the analysis template is too high, it does not rely on manual intervention, but actively diagnoses the root cause of the problem by establishing a mutation spectrum posterior, i.e., determining whether the failure is caused by field rearrangement, coding variants, or cross-tribe mixing, etc. Moreover, the active probing plan is generated by minimizing the expected regret principle, solving the problem of passive response and lack of active mechanism. In summary, the present application establishes semantic association through syntax-physical joint satisfiability analysis, and then automatically generates compensation mapping by actively diagnosing and repairing mutations based on the mutation spectrum, forming a closed-loop, automated protocol reverse engineering and adaptive maintenance process, solving the defects of relying on manual intervention, lacking physical checking, and being unable to actively adapt to mutations.
[0090] The above describes the preferred embodiments of the present application in detail, but the present application is not limited to the specific details in the above embodiments. Within the technical concept of the present application, various equivalent transformations of the technical solutions of the present application can be made, and these equivalent transformations all belong to the protection scope of the present application.
Claims
1. A photovoltaic device protocol self-adapting parsing method, characterized in that, The method comprises: obtaining a raw message sample set and a collection context, generating a preprocessed message sequence and an environment-side reference sequence; based on the preprocessed message sequence and the environment-side reference sequence, performing syntax-physical joint satisfiability analysis to generate a first version of the analysis template and the satisfiability residual; based on the first version of the analysis template and the satisfiability residual, performing active probing based on a mutation spectrum to generate a revised version of the analysis template; obtaining an online collection stream, and applying the revised version of the analysis template to analyze the online collection stream to generate unified reporting data.
2. The method of claim 1, wherein, Generating the first version of the analysis template and the satisfiability residual comprises: based on the preprocessed message sequence, inducing structure rules to form a syntax constraint set; based on the environment-side reference sequence, establishing a physical prior to form a physical constraint set; under the joint constraints of the syntax constraint set and the physical constraint set, jointly solving to obtain a semantic mapping scheme; based on the semantic mapping scheme, generating the first version of the analysis template and the satisfiability residual.
3. The method of claim 2, wherein, Establishing a physical prior to form a physical constraint set comprises: based on the environment-side reference sequence, constructing an energy conservation constraint, the energy conservation constraint representing the integral relationship between energy and power; constructing a unit dimension consistency constraint, the unit dimension consistency constraint representing the product relationship of voltage, current and power; and constructing grid-connected limit and efficiency prior constraints; based on the energy conservation constraint, the unit dimension consistency constraint and the grid-connected limit and efficiency prior constraints, generating the physical constraint set.
4. The method of claim 2, wherein, The joint solving is performed on joint optimization variables, the joint optimization variables comprising: a semantic mapping scheme of fields to physical semantics; and discrete encoding parameters, the discrete encoding parameters at least comprising: end sequence or scaling factor.
5. The method of claim 4, wherein, Jointly solving to obtain a semantic mapping scheme comprises: based on the physical constraint set, determining a physical constraint violation penalty; based on the syntax constraint set, determining a syntax constraint violation penalty; minimizing the weighted sum of the physical constraint violation penalty and the syntax constraint violation penalty to obtain the semantic mapping scheme.
6. The method of claim 5, wherein, Minimizing the weighted sum comprises: performing a physical step, which minimizes the physical constraint violation penalty under the premise of fixing the syntax constraint, to update the semantic mapping scheme; performing a syntax step, which updates the syntax constraint under the premise of fixing the semantic mapping scheme; alternately performing the physical step and the syntax step until convergence.
7. The method of claim 1, wherein, Generating the revised version of the analysis template comprises: based on the first version of the analysis template and the satisfiability residual, establishing a mutation spectrum posterior of a template family and a mutation operation; based on the mutation spectrum posterior, generating an active probing plan; executing the active probing plan to determine the mutation type and generate a compensation mapping; applying the compensation mapping to the first version of the analysis template to generate the revised version of the analysis template.
8. The method of claim 7, wherein, Generating the active probing plan comprises: based on the mutation spectrum posterior, calculating the expected utility of the candidate action within the preset limited read-only action set; the calculation of the expected utility aims to minimize the expected regret; according to the expected utility, selecting the candidate action under the preconfigured safety constraint model to form the active probing plan.
9. The method of claim 7, wherein, The mutation operation comprises at least one of field rearrangement, encoding variant, cross-family mixing, scaling variation or end sequence variation.
10. The method of claim 7, wherein, Generating the compensation mapping comprises: For the determined mutation type, a corresponding compensation mapping is generated; wherein if the mutation type is field rearrangement, the compensation mapping includes a permutation matrix; and if the mutation type is an encoding variant, the compensation mapping includes a selected decoder.
Citation Information
Cited By
Model training method, communication protocol analysis method, system, device and medium
CN121711420A