A method and device for dynamically parsing final values ​​by configuring logical relationships

By configuring status parsing characters and logical relationship strings, the final value of the monitored object can be dynamically parsed, solving the problem of incompatibility of system monitoring data status values, and realizing automated status parsing and flexible system updates.

CN116821432BActive Publication Date: 2025-09-23FUZHOU FUZE INTELLIGENT TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310621599.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2025-09-23
Estimated Expiration
2043-05-30

AI Technical Summary

Technical Problem

In the existing technology, the status values ​​of system monitoring data cannot be universally used, which requires code modification when making complex logical judgments, increasing the amount of code maintenance and instability.

Method used

By configuring status parsing characters and logical relationship strings, the final value of the monitored object can be dynamically parsed, and the current status can be automatically parsed using the processor and memory.

Benefits of technology

It realizes automatic analysis of the state of the monitored object, has strong adaptability and high flexibility. When the members or parameters of the monitored object change, the system can be updated by simply reconfiguring the characters and strings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116821432B_ABST
    Figure CN116821432B_ABST
Patent Text Reader

Abstract

The present invention relates to an algorithm for dynamically parsing a final value based on a configured logical relationship, comprising the following steps: Step 1, configuring the corresponding state parsing characters of the monitored object under each state type; Step 2, configuring a corresponding logical relationship string based on the state parsing characters; Step 3, extracting the current state parameter value of the monitored object from the data collected by the system, bringing it into the logical relationship string to generate a final value; matching the final value with the state parsing character, and if they are consistent, parsing the current state type of the monitored object. The present invention also relates to a device for dynamically parsing a final value based on a configured logical relationship. Advantages of the present invention: The present invention dynamically parses the final value by configuring the state parsing characters and the logical relationship string, thereby obtaining the current state of the monitored object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data analysis, and in particular to a method and device for dynamically analyzing final values ​​by configuring logical relationships. Background Art

[0002] At present, a lot of the system's monitoring data is collected status data, with numerical values ​​representing different states, such as: the operating state of the pump, 1 represents running, 0 represents stopping, and the valve state, 1 represents closing, 0 represents opening. The situation where the same numerical value represents different states on the same platform has always existed, resulting in the platform displaying or judging these states. It is necessary to judge one by one according to the numerical representation of each state, which cannot be universal. Moreover, when performing some complex logical judgments, for example, multiple component states need to be determined through logical relationships to determine the final state, and the state is bound by the numerical value. If the represented state value changes, the code must be modified again, which greatly increases the code maintenance and program instability. Summary of the Invention

[0003] In order to solve the above problems, the purpose of the present invention is to provide a method for dynamically parsing the final value by configuring logical relationships, which automatically parses the final value by configuring status parsing characters and logical relationship strings and outputs the current status of the monitored object.

[0004] To achieve the above object, the present invention adopts the following technical solutions:

[0005] Technical Solution 1

[0006] A method for dynamically parsing a final value based on a configured logical relationship comprises the following steps: Step 1, configuring corresponding state parsing characters for a monitored object under each state type; Step 2, configuring a corresponding logical relationship character string based on the state parsing character; Step 3, extracting the current state parameter value of the monitored object from data collected by the system, bringing it into the logical relationship character string to generate a final value; and matching the final value with the state parsing character. If they are consistent, parsing the current state type of the monitored object.

[0007] Technical Solution 2

[0008] Based on the same inventive concept, the present invention also provides a device for dynamically parsing a final value according to a configuration logic relationship.

[0009] A device for dynamically parsing a final value by configuring a logical relationship, comprising a processor and a memory, wherein the memory stores a computer program that can be executed by the processor. When the processor executes the computer program, the method steps described in the first technical solution are implemented.

[0010] Technical Solution 3

[0011] Based on the same inventive concept, the present invention also provides a computer-readable storage medium.

[0012] A computer-readable storage medium stores a computer program programmed or configured to execute the method for dynamically parsing final values ​​by configuring logical relationships as described in Technical Solution 1.

[0013] The present invention has the following beneficial effects:

[0014] 1. The present invention realizes dynamic parsing of the final value by configuring the state parsing characters and the logical relationship character string to obtain the current state of the monitored object.

[0015] 2. The present invention has strong adaptability and high flexibility. When the status of the parameter definition in the platform changes, or when the members included in the monitoring object change, it is only necessary to reconfigure the status parsing characters and logical relationship strings to complete the system update. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a flow chart of a method for dynamically parsing a final value by configuring a logical relationship according to the present invention.

[0017] Figure 2 This is a structural block diagram of a device for dynamically parsing final values ​​by configuring logical relationships according to the present invention. DETAILED DESCRIPTION

[0018] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0019] Example 1

[0020] An algorithm for dynamically parsing final values ​​based on configuration logic relationships includes the following steps:

[0021] Step 1. First, determine the member names and corresponding parameters contained in the monitoring object. The monitoring object generally refers to a function of the system. Secondly, configure the corresponding state parsing characters according to each state type of the monitoring object. Each state parsing character consists of a state type text value and at least one parameter splicing value. The parameter splicing value consists of a single parameter or a combination of multiple parameters. Then, establish a correspondence between each parameter splicing value and the state type, and create a map set. The set includes multiple arrays, each array consists of a key and a corresponding result text value. Each corresponding relationship is used as a result text value, and the result text value is sequentially numbered to generate a key. Step 2. Convert the parameters in the parameter splicing value into the corresponding member names in order, and then splice to generate a logical relationship string. Each parameter splicing value generates a corresponding logical relationship string, and each logical relationship string is set with a number. The number is the same as the key in the array where the corresponding parameter splicing value is located. Step 3. Extract the current state parameter values ​​of the members contained in the monitored object from the data collected by the system; splice the current state parameter values ​​in the order of the members in the logical relationship string to generate a final value, query the map set according to the number corresponding to the logical relationship string, find the array where the key with the same number is located, match the final value with the parameter splicing value therein, if they are consistent, obtain the state type text value from the result text value to determine the current state of the monitored object; if they are inconsistent, poll the next logical relationship string until a match is found.

[0022] An application example is given below to illustrate the application process of the first embodiment.

[0023] Step 1: The monitoring object is the water outlet function of pipeline 1.

[0024] The members of this monitoring object are as follows:

[0025] 1# valve operation status (f1_status: 0: Close 1: Open) Current status value: 0

[0026] 2# valve operation status (f2_status: 0: Close 1: Open) Current status value: 0

[0027] 1# Pump running status (b1_status: 0: Stop 1: Run) Current status value: 0

[0028] 1# pump fault status (b1_gz: 0: normal 1: fault) Current status value: 0

[0029] Taking the running status of pump 1# as an example, the member name is f1_status, and the parameters include 0 or 1.

[0030] The status types of the water outlet function are:

[0031] Operation: 1# valve is open, 2# valve is closed and 1# pump is operating normally;

[0032] Stop: 1# valve is closed, 2# valve is open and 1# pump stops normally;

[0033] Fault: 1# pump fault or not (1# valve open and 2# valve closed) and (1# valve closed and 2# valve open).

[0034] Status parsing character configuration: 1010: running

[0035] 0100: Stop

[0036] 1,00,11: Failure

[0037] During computer program processing, each configured state parsing character generates a state parsing string: 1010: run; 0100: stop; 1, 00, 11: fault, and then the state parsing string is segmented using the delimiter ";" in the code to generate a type set array: fx_type[] = {"1010: run", "0100: stop", "1, 00, 11: fault"}, and then looped and segmented each element in the type set array one by one using ":" to generate a type array options[], such as {"1010", "run"}, {"0100", "stop"}, {"1, 00, 11", "fault"}, and then established a corresponding relationship between each parameter splicing value and the state type {"1010": "run"}, {"0100": "stop"}, {"1": "fault"}, {"00": "fault"}, {"11": "fault"}. When sequentially numbering the corresponding relationships, this application example combines the subscripts of each corresponding relationship in the type collection array with the subscripts of the parameter concatenation value in the type array to generate a key. This has the advantage that the code automatically recognizes and combines the subscripts during execution, ensuring uniqueness without manually setting encoding rules. However, key generation is not limited to this method. The subscripts of each element in the array are integers from 0 to n, and adjacent elements are separated by a ",". For example, the corresponding relationship {"1010":"Run"} is the first element in the type collection array with subscript 0. The parameter splicing value 1010 in the type array is also the first element with subscript 0. Therefore, the key of the corresponding relationship {"1010":"Run"} is 0_0. Similarly, the keys of the corresponding relationships are generated, and the created map set is map = {"0_0":{"1010":"Run"},"1_0":{"0100":"Stop"},"2_0":{"1":"Fault"},"2_1":{"00":"Fault"},"2_2":{"00":"Fault"}}.

[0038] Step 2: Generate logical relationship strings: The parameter splicing values ​​configured in step 1 include 1010, 0100, 1, 00, and 11. Therefore, the logical strings corresponding to the parameter splicing values ​​are:

[0039] {"f1_status / f2_status / b1_status / b1_gz"}, the corresponding number is 0_0;

[0040] {"f1_status / f2_status / b1_status / b1_gz"}, the corresponding number is 1_0;

[0041] {"b1_gz"}, corresponding number is 2_0;

[0042] {"f1_status / f2_status"}, the corresponding number is 2_1;

[0043] {"f1_status / f2_status"}, the corresponding number is 2_2.

[0044] Step 3: Analyze the current status of the monitored object:

[0045] The current status parameter values ​​of the members of the water discharge function extracted from the data collected by the system are:

[0046] f1_status:0; f2_status:0; b1_status:0; b1_gz:0.

[0047] Correspondingly, the logical relationship string numbered 0_0

[0048] The final value of {"f1_status / f2_status / b1_status / b1_gz"} concatenated with the current status value is 0000. The map set is searched according to the number, where the result text value of key 0_0 is {"1010":"Running"}. The final value 0000 is not equal to 1010, so it does not match.

[0049] Poll the logical relationship string {"f1_status / f2_status / b1_status / b1_gz"} with the number 1_0. The final value concatenated with the current status value is 0000. Search the map set based on the number. The result text value of the key 1_0 is {"0100":"Stop"}. The final value 0000 is not equal to 0100, so it does not match.

[0050] The logical relationship string {"b1_gz"} with the polling number 2_0 is concatenated with the current state value, and the final value is 0. The map set is searched based on the number, where the result text value of the key 2_0 is {"1":"fault"}. The final value 0 is not equal to 1, so there is no match.

[0051] The logical relationship string {"f1_status / f2_status"} with the polling number 2_1 is concatenated with the current status value, and the final value is 00. The map set is searched according to the number, where the result text value with the key 2_1 is {"00":"fault"}. The final value 00 = 00, which matches. The status type text value "fault" is obtained from the result text value, and the current status of the monitored object is parsed as fault, and the polling is stopped.

[0052] Example 2

[0053] The difference between this embodiment and embodiment 1 is that the parameter splicing value in this embodiment can also be composed of multiple parameters combined by logical operators, which can simplify the configuration process and is particularly suitable for scenarios where the monitored object contains many members and the logical relationships between the members are complex.

[0054] An algorithm for dynamically parsing final values ​​based on configuration logic relationships includes the following steps:

[0055] Step 1: First, determine the member names and corresponding parameters contained in the monitoring object; second, configure the corresponding state parsing characters according to each state type of the monitoring object, each of which is composed of a state type text value and at least one parameter splicing value, and the parameter splicing value is composed of a single parameter, a combination of multiple parameters, or a combination of multiple parameters through a logical operator; then, establish a corresponding relationship between each parameter splicing value and the state type, and create a map set, which includes multiple arrays, each array is composed of a key and a corresponding result text value; each corresponding relationship is used as a result text value, and the result text value is sequentially numbered to generate a key. Step 2: For parameter splicing values ​​that do not contain logical operators, convert the parameters into corresponding member names in order; for parameter splicing values ​​that contain logical operators, express the member names in combination with logical relationship symbols to make them conform to the corresponding state type, and then splice to generate a logical relationship string; each logical relationship string is correspondingly set with a number, which is the same as the key in the array where the corresponding parameter splicing value is located. Step 3 is: extract the current state parameter values ​​of the members contained in the monitored object from the data collected by the system; splice the current state parameter values ​​in the order of each member in the logical relationship string to generate a final value; search the array where the corresponding key is located in the map set according to the number corresponding to the logical relationship string. If the final value does not contain a logical relationship operator, match the final value with the parameter splicing value therein; if the final value contains a logical relationship operator, operate the final value according to the logical relationship operator, and match the result with the corresponding parameter splicing value in the result text value. If they are consistent, obtain the state type text value from the result text value to determine the current state of the monitored object; if they are inconsistent, poll the next logical relationship string.

[0056] The following also takes the water outlet function of pipeline 1 as an example. However, when configuring the status parsing character, the parameter splicing value with the logical relational operator is combined. The specific application process is as follows.

[0057] Step 1:

[0058] The members of this monitoring object are as follows:

[0059] 1# valve operation status (f1_status: 0: Close 1: Open) Current status value: 0

[0060] 2# valve operation status (f2_status: 0: Close 1: Open) Current status value: 0

[0061] 1# Pump running status (b1_status: 0: Stop 1: Run) Current status value: 0

[0062] 1# pump fault status (b1_gz: 0: normal 1: fault) Current status value: 0

[0063] Taking the running status of pump 1# as an example, the member name is f1_status, and the parameters include 0 or 1.

[0064] The status types of the water outlet function are:

[0065] Operation: 1# valve is open, 2# valve is closed and 1# pump is operating normally;

[0066] Stop: 1# valve is closed, 2# valve is open and 1# pump stops normally;

[0067] Fault: 1# pump fault or not (1# valve open and 2# valve closed) and (1# valve closed and 2# valve open).

[0068] Status parsing character configuration: 1010: running

[0069] 0100: Stop

[0070] 1,10&01:Fault

[0071] During computer program processing, each configured state parsing character generates a state parsing string: 1010: Run; 0100: Stop; 1, 10&01: Fault, and then the state parsing string is segmented using the delimiter ";" in the code to generate a type set array: fx_type[] = {"1010: Run", "0100: Stop", "1, 10&01: Fault"}, and then looped and segmented each element in the type set array one by one using ":" to generate a type array options[], such as {"1010", "Run"}, {"0100", "Stop"}, {"1, 10&01", "Fault"}, and then established a corresponding relationship between each parameter splicing value and the state type {"1010":"Run"}, {"0100":"Stop"}, {"1":"Fault"}, {"10&01":"Fault"}. When the corresponding relationships are numbered in order, in this application example, the subscripts of each corresponding relationship in the type set array and the subscripts of the parameter splicing values ​​in the type array are combined to generate a key. For example, the corresponding relationship {"10&01":"fault"} is the second element in the type set array with a subscript of 2, and the parameter splicing value 10&01 in the type array is the second element with a subscript of 1. Therefore, the key of the corresponding relationship {"10&01":"fault"} is 2_1. Similarly, the keys of the corresponding relationships are generated, and the created map set is map = {"0_0":{"1010":"running"},"1_0":{"0100":"stopping"},"2_0":{"1":"fault"},"2_1":{"10&01":"fault"}}.

[0072] Step 2: Generate logical relationship strings: The parameter splicing values ​​configured in step 1 include 1010, 0100, 1, 10&01. Therefore, the logical strings corresponding to the parameter splicing values ​​are:

[0073] {"f1_status / f2_status / b1_status / b1_gz"}, the corresponding number is 0_0;

[0074] {"f1_status / f2_status / b1_status / b1_gz"}, the corresponding number is 1_0;

[0075] {"b1_gz"}, corresponding number is 2_0;

[0076] {"!f1_status / f2_status&!f1_status / f2_status"}, the corresponding number is 2_1;

[0077] It is important to note that when generating a logical relation string for parameter concatenation values ​​with logical relation operators, the logical relation operators must be combined to make it conform to the corresponding state type. In the state parsing character string, 10&01 does not express that "not (1# valve open and 2# valve closed) and (1# valve closed and 2# valve open)" are faults. Therefore, when generating a logical relation string, its logical relation string is

[0078] {"!f1_status / f2_status&!f1_status / f2_status"}, where "&

[0079] " represents logical AND, and "!" represents logical NOT.

[0080] Step 3: Analyze the current status of the monitored object:

[0081] The current status parameter values ​​of the members of the water discharge function extracted from the data collected by the system are:

[0082] f1_status:0; f2_status:0; b1_status:0; b1_gz:0.

[0083] Correspondingly, the logical relationship string numbered 0_0

[0084] The final value of {"f1_status / f2_status / b1_status / b1_gz"} concatenated with the current status value is 0000. The map set is searched according to the number, where the result text value of key 0_0 is {"1010":"Running"}. The final value 0000 is not equal to 1010, so it does not match.

[0085] Poll the logical relationship string {"f1_status / f2_status / b1_status / b1_gz"} with the number 1_0. The final value concatenated with the current status value is 0000. Search the map set based on the number. The result text value of the key 1_0 is {"0100":"Stop"}. The final value 0000 is not equal to 0100, so it does not match.

[0086] The logical relationship string {"b1_gz"} with the polling number 2_0 is concatenated with the current state value, and the final value is 0. The map set is searched based on the number, where the result text value of the key 2_0 is {"1":"fault"}. The final value 0 is not equal to 1, so there is no match.

[0087] Logical relationship string with polling number 2_1

[0088] {"!f1_status / f2_status&!f1_status / f2_status"} contains a logical &, indicating that all & items match, which is considered a successful match. Therefore, each item must be analyzed separately. First, the current status value is concatenated with f1_status / f2_status in the first & item, resulting in a final value of 00. The map set is searched by number, where the result text value for key 2_1 is {"10&01":"fault"}. This final value 00 is applied to the logical relational operator and then matched with the corresponding concatenated parameter value "10": 10 = 00! A successful match is achieved. The current status value is then concatenated with f1_status / f2_status in the second & item, resulting in a final value of 00. This final value 00 is applied to the logical relational operator and then matched with the corresponding concatenated parameter value "01": 01 = 00! A successful match is achieved. Because the result text value {"10&01":"fault"} contains &, all items are matched successfully, indicating that the status type is matched successfully. The status type text value "fault" is obtained from the result text value, and the current status of the monitored object is parsed as fault, and polling is stopped.

[0089] Example 3

[0090] See also Figure 1 and Figure 2 Based on the same inventive concept, this embodiment also provides a device for dynamically parsing a final value by configuring a logical relationship, including a processor 1 and a memory 2, wherein the memory 3 stores a computer program that can be executed by the processor 1. When the processor 1 executes the computer program, the method steps described in embodiment 1 or embodiment 2 are implemented.

[0091] Example 4

[0092] Based on the same inventive concept, this embodiment also provides a computer-readable storage medium, which stores a computer program programmed or configured to execute the method for dynamically parsing final values ​​by configuring logical relationships described in Example 1 or Example 2.

[0093] The present invention dynamically resolves the final value by configuring state parsing characters and logical relationship strings, thereby obtaining the current state of the monitored object. When the members of the monitored object change, or the meaning represented by the parameter value changes, the system can be updated simply by modifying the configuration item without modifying the code, thus achieving strong adaptability.

[0094] The above description is only a specific embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformation made by using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for dynamically parsing a final value based on a configuration logic relationship, characterized by: The steps include: Step 1: Configure the corresponding status parsing characters of the monitoring object under each status type. The specific steps are as follows: determine the member names and corresponding parameters contained in the monitoring object, configure the corresponding status parsing characters according to each status type of the monitoring object, each of the status parsing characters consists of a status type text value and at least one parameter splicing value; the parameter splicing value consists of a single parameter or a combination of multiple parameters; establish a correspondence between each parameter splicing value and the status type, create a map set, the set includes multiple arrays, each array consists of a key and a corresponding result text value; each correspondence is used as a result text value, and the result text values ​​are sequentially numbered to generate a key; Step 2: Configure the corresponding logical relationship string according to the state parsing character. The specific steps are as follows: convert the parameters in the parameter splicing value into the corresponding member names in order, and then splice them to generate the logical relationship string; each parameter splicing value generates a corresponding logical relationship string, and each logical relationship string is assigned a number, which is the same as the key in the array where the corresponding parameter splicing value is located; Step 3. Extract the current state parameter value of the monitored object from the data collected by the system, bring it into the logical relationship string, generate a final value, match the final value with the state parsing character, if consistent, parse out the current state type of the monitored object, if inconsistent, poll the next logical relationship string, the specific steps are: extract the current state parameter values ​​of the members contained in the monitored object from the data collected by the system; splice the current state parameter values ​​in the order of each member in the logical relationship string to generate a final value, query the map set according to the number corresponding to the logical relationship string, find the array where the key with the consistent number is located, match the final value with the parameter splicing value therein, if consistent, obtain the state type text value from the result text value, and parse out the current state of the monitored object; if inconsistent, poll the next logical relationship string.

2. The method of dynamically parsing a final value according to a configuration logic relationship according to claim 1, characterized in that: In step 1, the parameter concatenation value also includes a combination of multiple parameters through logical operators; The step 2 is as follows: for the parameter splicing values ​​that do not contain logical operators, the parameters are converted into corresponding member names in order; for the parameter splicing values ​​that contain logical operators, the member names are expressed in combination with logical relationship symbols to make them conform to the corresponding state type, and then splicing is performed to generate a logical relationship string; each logical relationship string is correspondingly assigned a number, which is the same as the key in the array where the corresponding parameter splicing value is located; The step 3 is: extracting the current state parameter values ​​of the members contained in the monitored object from the data collected by the system; splicing the current state parameter values ​​according to the order of the members in the logical relationship string to generate a final value; searching the array where the corresponding key is located in the map set according to the number corresponding to the logical relationship string, if the final value does not contain a logical relationship operator, then matching the final value with the parameter splicing value therein; if the final value contains a logical relationship operator, then operating the final value according to the logical relationship operator, and matching the result with the corresponding parameter splicing value in the result text value; if they are consistent, obtaining the state type text value from the result text value, and parsing the current state of the monitored object; if they are inconsistent, polling the next logical relationship string.

3. A device for dynamically parsing final values ​​by configuring logical relationships, characterized by: The method comprises a processor and a memory, wherein the memory stores a computer program that can be executed by the processor. When the processor executes the computer program, the method steps as claimed in any one of claims 1 to 2 are implemented.

4. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that is programmed or configured to execute the method for dynamically resolving final values ​​by configuring logical relationships as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Data verification method and device, computer device and storage medium

    CN110442756A

  • Pressing plate on-off state detection method, remote management system, terminal and storage medium

    CN114646831A