Control Right Determination Method and Device
By calculating the hash value between the control center equipment and the station equipment and matching the data consistency, the problem of inaccurate control ownership caused by data inconsistency is solved, and the reliability of natural gas pipeline control and the stability of natural gas transportation are improved.
Patent Information
- Application Number
- CN202110148561.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-03
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2041-02-03
AI Technical Summary
The prior art cannot effectively detect and resolve the inconsistency between the data of the control center equipment and the station equipment, resulting in inaccurate results of the ownership of control rights.
The hash value is calculated separately by the control center equipment and the station equipment, and based on the consistency matching of the hash value data calculated by the two, the attribution result of the control right is determined.
It improves the reliability of long-term natural gas pipeline control, ensures smooth transmission of natural gas, and enhances the accuracy of the results of the ownership of control.
Smart Images

Figure CN114859825B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technologies, and particularly to a method, apparatus, computer device, and storage medium for determining control rights. Background Art
[0002] Natural gas long-distance pipelines are generally distributed in areas of several hundred or even thousands of kilometers, equipped with multiple compressor stations, gas distribution stations, pigging stations, and a unified control center. The control center communicates with each station yard and is responsible for the monitoring and control of natural gas transportation for the entire pipeline. Therefore, the station yard and the control center need to ensure data consistency. If the data is inconsistent, the station yard obtains the control right; if the data is consistent, the control center device obtains the control right.
[0003] The related art provides a control right switching method based on a heartbeat protocol. The method is as follows: The control center device detects the communication situation by sending heartbeats to the station yard device at a preset frequency. When the time interval between sending and receiving the heartbeat signal is too long, the station yard device automatically obtains the control right.
[0004] However, when the communication between the control center device and the station yard device is normal, there are other reasons for the data inconsistency between the control center device and the station yard device. For example, the sampling period of the data point is set inaccurately, resulting in the data not being refreshed for a long time; the address corresponding to the collected data point is incorrect, resulting in data inconsistency; the range conversion of the data point is inconsistent, resulting in the data being multiplied or reduced; the numerical precision setting is not matched, resulting in a small deviation in the data, etc. The method provided by the related art cannot detect the data inconsistency caused by the above reasons, resulting in an inaccurate attribution result of the control right. Summary of the Invention
[0005] The embodiments of the present application provide a method, apparatus, computer device, and storage medium for determining control rights, which improve the accuracy of the attribution result of the determined control right. The technical solution includes:
[0006] On the one hand, the embodiments of the present application provide a method for determining control rights, which is applied to a control center device. The method includes:
[0007] Receiving at least one first hash value sent by a station yard device, where the first hash value is generated by the station yard device based on a set of first data collected, and the set of first data is generated based on first transmission data, and the first transmission data is data sent by the station yard device to the control center device;
[0008] Obtaining at least one set of second data, calculating a hash value for each set of the at least one set of second data to obtain at least one second hash value, where the set of second data is generated based on second transmission data, and the second transmission data is data received by the control center device;
[0009] Based on the first hash value and the second hash value, determine whether the control right of the station yard belongs to the dispatching center device or the station yard device.
[0010] On the other hand, an embodiment of the present application provides a control right determination method, which is applied to a station yard device. The method includes:
[0011] Obtain at least one set of first data, where the set of first data is generated based on first transmission data, and the first transmission data is data sent by the station yard device to the dispatching center device;
[0012] Calculate the hash value for each set of the at least one set of first data to obtain at least one first hash value;
[0013] Send the at least one first hash value to the dispatching center device, where the dispatching center device is used to determine whether to switch the control right from the dispatching center device to the station yard device based on the first hash value and the second hash value. The second hash value is calculated by the dispatching center device based on a set of second data collected, and the set of second data is generated based on second transmission data, and the second transmission data is data received by the dispatching center device.
[0014] On yet another aspect, an embodiment of the present application provides a control right determination device, and the device includes:
[0015] A hash value receiving module, configured to receive at least one first hash value sent by a station yard device, where the first hash value is generated by the station yard device based on a set of first data collected, and the set of first data is generated based on first transmission data, and the first transmission data is data sent by the station yard device to the dispatching center device;
[0016] A first obtaining module, configured to obtain at least one set of second data, where the set of second data is generated based on second transmission data, and the second transmission data is data received by the dispatching center device;
[0017] A first calculation module, configured to calculate the hash value for each set of the at least one set of second data to obtain at least one second hash value;
[0018] A control right determination module, configured to determine whether the control right of the station yard belongs to the dispatching center device or the station yard device based on the first hash value and the second hash value.
[0019] On still another aspect, an embodiment of the present application provides a control right determination device, and the device includes:
[0020] A second acquisition module, configured to acquire at least one set of first data, where the set of first data is generated based on first transmission data, and the first transmission data is data sent by the station equipment to the control center equipment;
[0021] A second calculation module, configured to calculate a hash value for each set of the at least one set of first data to obtain at least one first hash value;
[0022] A hash value sending module, configured to send the at least one first hash value to the control center equipment, where the control center equipment is configured to determine whether to switch the control right from the control center equipment to the station equipment based on the first hash value and a second hash value, and the second hash value is calculated by the control center equipment based on a set of second data collected, and the set of second data is generated based on second transmission data, and the second transmission data is data received by the control center equipment.
[0023] In another aspect, an embodiment of the present application provides a computer device, which includes a processor, a memory, and a wireless communication chip. The memory stores computer instructions, and the computer instructions are loaded and executed by the wireless communication chip to perform the control right determination method as described in one aspect.
[0024] In another aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program is loaded and executed by a processor to implement the control right determination method as described in one aspect.
[0025] In another aspect, an embodiment of the present application provides a computer program product. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above control right determination method.
[0026] The beneficial effects brought by the technical solutions provided by the embodiments of the present application at least include:
[0027] By calculating hash values separately by the control center equipment and the station equipment, then based on the data consistency matching of the hash values calculated by the two, and based on the matching result to determine the attribution result of the control right. If the data is consistently matched, it is determined that the control right belongs to the control center; if the data is not consistently matched, it is determined that the control right belongs to the station equipment, which improves the reliability of the control of the long-distance natural gas pipeline and plays a certain role in ensuring the stable transmission of natural gas. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1It is a schematic diagram of an implementation environment provided by an embodiment of the present application;
[0029] Figure 2 It is a schematic diagram of a control right determination method provided by an embodiment of the present application;
[0030] Figure 3 It is a flowchart of a control right determination method provided by an embodiment of the present application;
[0031] Figure 4 It is a flowchart of obtaining second data provided by an embodiment of the present application;
[0032] Figure 5 It is a flowchart of a control right determination method provided by another embodiment of the present application;
[0033] Figure 6 It is a flowchart of a control right determination method provided by another embodiment of the present application;
[0034] Figure 7 It is a block diagram of a control right determination device provided by an embodiment of the present application;
[0035] Figure 8 It is a block diagram of a control right determination device provided by another embodiment of the present application;
[0036] Figure 9 It is a block diagram of a computer device provided by another embodiment of the present application. Detailed implementation manners
[0037] To make the objectives, technical solutions and advantages of the present application clearer, the following will further describe the implementation manners of the present application in detail with reference to the accompanying drawings.
[0038] Figure 1 It is a schematic diagram of an implementation environment shown by an embodiment of the present application. The implementation environment includes: a regulation center device 11 and at least one station device 12.
[0039] The regulation center device 11 is used to be responsible for the monitoring and control work of natural gas transportation in the entire long-distance natural gas pipeline. Optionally, the regulation center device 11 is a Supervisory Control and Data Acquisition (SCADA) system. The SCADA system is a remote supervision control and data acquisition system that comprehensively applies computer technology, automatic control technology, communication and network technology, and is widely used in the long-distance natural gas transportation industry.
[0040] The station device 12 is used to be responsible for the monitoring and control work of natural gas transportation within the station in the long-distance natural gas pipeline. Optionally, the station device 12 is also a SCADA system.
[0041] The control center device 11 establishes a communication connection with at least one station device 12 through a wired or wireless network. The above-mentioned wireless network or wired network uses standard communication technologies and / or protocols. The network is usually the Internet, but it can also be any other network, including but not limited to any combination of a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or a virtual private network). In some embodiments, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent the data exchanged through the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec), etc. can be used to encrypt all or some of the links. In other embodiments, custom and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.
[0042] Figure 2 It is a schematic diagram of determining the control right shown in an embodiment of the present application. The station device obtains the first transmission data, stores the digital quantity data in the first transmission data into the third string in ascending order according to the transmission address, stores the analog quantity data in the first transmission data into the fourth string in ascending order according to the transmission address, obtains a set of first data, and then generates a first hash value corresponding to the set of first data. In addition, the first transmission data is also transmitted to the control center device. The control center device obtains the second transmission data, stores the digital quantity data in the second transmission data into the first string in ascending order according to the transmission address, stores the analog quantity data in the first transmission data into the second string in ascending order according to the transmission address, obtains a set of second data, and then generates a second hash value corresponding to the set of second data. The control center device compares the first hash value and the second hash value to determine the ownership of the control right.
[0043] An embodiment of the present application provides a control right determination method. The control center device and the station field device calculate hash values respectively, and then determine the attribution result of the control right based on the data consistency matching of the hash values calculated by the two. If the data is consistently matched, it is determined that the control right belongs to the control center; if the data is not consistently matched, it is determined that the control right belongs to the station field device, improving the reliability of the long-distance natural gas pipeline control and playing a certain role in ensuring the stable transportation of natural gas.
[0044] Figure 3 It is a flowchart of the control right determination method shown in an embodiment of the present application. This method is applied to Figure 1 the control center device shown as follows. This method includes:
[0045] Step 301: Receive at least one first hash value sent by the station field device.
[0046] The first hash value is generated by the station field device based on a set of first data collected. The set of first data is generated based on the first transmission data. The first transmission data is the data sent by the station field device to the control center device. The process of generating the first data based on the first transmission data and generating the hash value based on the first data will be introduced in the following embodiments.
[0047] Step 302: Obtain at least one set of second data.
[0048] A set of second data is generated based on the second transmission data, and the second transmission data is the data received by the control center device. Optionally, the process of obtaining the second data includes the following sub-steps:
[0049] Step 302a: Divide the second transmission data into second digital quantity data and second analog quantity data.
[0050] The control center device obtains the second transmission data, and then divides the second transmission data into second digital quantity data and second analog quantity data according to the data type. The data with the data type of digital quantity is determined as the second digital quantity data, and the data with the data type of analog quantity is determined as the second analog quantity data.
[0051] The second transmission data refers to the data received by the control center device. Digital quantity refers to a physical quantity that is discrete both in time and quantity. Analog quantity refers to a physical quantity that is continuous either in time or in value.
[0052] Step 302b: Store the second digital quantity data in the first string in the specified order of the transmission address, and store the second analog quantity data in the second string in the specified order.
[0053] The specified order of the transmission addresses is set by default by the control center device, or can be customized by technicians. Optionally, the specified order of the transmission addresses is from large to small, or from small to large. In the embodiments of this application, only the example of the specified order of the transmission addresses from small to large is used for explanation.
[0054] The control center device defines a first string and a second string, stores the second digital quantity data into the first string in ascending order of the transmission addresses, and stores the second analog quantity data into the second string in ascending order of the transmission addresses. It should be noted that when storing the second analog quantity data into the second string, only two decimal places are taken to prevent the numerical value from fluctuating continuously when there is interference in the analog quantity signal. For example, when storing the incoming station pressure value "6.7032 MPa", the digits "6", ".", "7", "0" are stored into the second string in sequence.
[0055] Step 302c: Obtain a set of second data based on the first string and the second string.
[0056] The control center device splices the first string and the second string to obtain a set of second data. The embodiments of this application do not limit the splicing order. In one possible implementation, the control center device splices them in the order that the first string is in the front and the second string is in the back to obtain a set of second data. In another possible implementation, the control center device splices them in the order that the first string is in the back and the second string is in the front to obtain a set of second data. In the embodiments of this application, only the former splicing method is used for explanation.
[0057] Optionally, the control center device collects the second data at a moment with a first time interval from the specified moment. The specified moment refers to the moment when the station equipment collects a set of first data, and the specified moment is set by the control center device. Optionally, the control center device sends the specified moment to the station equipment when performing initial settings or modifying settings. It should be noted that the specified moments corresponding to each station are different to prevent data congestion. For example, the specified moment corresponding to Station A is 0 minutes and 0 seconds, and the specified moment corresponding to Station B is 1 minute and 0 seconds. The first time interval is the transmission delay between the station equipment and the control center device. The first time interval can be estimated based on experience or measured based on the transmission situation between the station equipment and the control center device.
[0058] The number of times the control center device collects the second data is the same as the number of times the station equipment collects the first data.
[0059] Figure 4 The flowchart of data collection shown in an embodiment of this application is shown. The data collection process includes the following steps:
[0060] Step 401, start data aggregation.
[0061] Step 402, divide the transmitted data into digital quantities and analog quantities.
[0062] Step 403, define a string.
[0063] Step 404, sort and aggregate the digital quantities.
[0064] Step 405, sort and aggregate the analog quantities.
[0065] Step 406, end data aggregation.
[0066] Step 303, calculate the hash value for each group of second data in at least one group of second data to obtain at least one second hash value.
[0067] The control center device calculates the hash value for each group of second data by using the message digest algorithm to obtain the second hash value corresponding to each group of second data.
[0068] The message digest algorithm refers to an algorithm that hashes an input of any length to produce a fixed-length pseudo-random output. Generally, as long as the input messages are different, the hash values generated by calculating them using the message digest algorithm are also different, but the same input will surely produce the same output.
[0069] Step 304, based on the first hash value and the second hash value, determine whether the control right of the station yard belongs to the control center device or the station yard device.
[0070] Optionally, if the first hash value and the second hash value in each hash value pair are different, it is determined that the control right belongs to the station yard device. If there is at least one hash value pair in which the first hash value and the second hash value are the same, it is determined that the control right belongs to the control center device.
[0071] The hash value pair includes the first hash value and the second hash value corresponding to the first hash value. A group of first data that generates the first hash value corresponds to a group of second data that generates the second hash value corresponding to the first hash value. That is, the first data refers to the data transmitted by the station yard device to the control center device, and the second data corresponding to the first data is the data received by the control center device. The time interval between the acquisition time of the first data and the acquisition time of the second data corresponding to the first data is the first time interval, and the first time interval is the transmission delay between the station yard device and the control center device.
[0072] When the first hash value and the second hash value in each hash value pair are different, it indicates that the data of the control center device is inconsistent with the data of the station yard device. In this case, the station yard device should obtain the control right of the station yard to avoid scheduling errors when the control center device controls the station yard. When there is at least one hash value pair in which the first hash value and the second hash value are the same, it indicates that the data of the control center device is consistent with the data of the station yard device. In this case, the control center device should obtain the control right of the station yard.
[0073] Optionally, after determining that the control right belongs to the station yard device, the control right determination method further includes the following steps: If the current control right of the station yard belongs to the control center device, a control right switching instruction is sent to the station yard device, and the station yard device is used to switch the control right from the control center device to the station yard device according to the control right switching instruction.
[0074] Optionally, before receiving at least one hash value, the control center device also sends a time calibration signal to the station yard device, and the station yard device is used to calibrate the time according to the time calibration signal to ensure that the time of the control center device is consistent with the time of the station yard device, making the subsequent determination of the ownership of the control right more accurate. Among them, the calibration signal includes time data such as year, month, day, week, hour, minute, and second.
[0075] In summary, the technical solution provided by the embodiments of the present application calculates the hash values by the control center device and the station yard device respectively, then matches based on the consistency of the hash value data calculated by the two, and determines the ownership result of the control right based on the matching result. If the data consistency matches, it is determined that the control right belongs to the control center. If the data consistency does not match, it is determined that the control right belongs to the station yard device, improving the reliability of the long-distance natural gas pipeline control and playing a certain role in ensuring the stable transportation of natural gas.
[0076] Figure 5 is a flowchart of the control right determination method shown in an embodiment of the present application. This method is applied to Figure 1 the station yard device 12 shown. This method includes:
[0077] Step 501, obtain at least one set of first data.
[0078] One set of first data is generated based on the first transmission data, and the first transmission data is the data sent by the station yard device to the control center device. Optionally, the process of obtaining the first data includes the following sub-steps:
[0079] Step 501a, divide the first transmission data into first digital quantity data and first analog quantity data.
[0080] The control center device obtains the first transmission data, and then divides the first transmission data into first digital quantity data and first analog quantity data according to the data type, determines the data with the data type of digital quantity as the first digital quantity data, and determines the data with the data type of analog quantity as the first analog quantity data. The first transmission data refers to the data transmitted from the substation equipment to the control center device.
[0081] Step 501b: Store the first digital quantity data into the third string in sequence according to the specified order of the transmission address, and store the first analog quantity data into the fourth string in sequence according to the specified order.
[0082] The specified order of the transmission address is set by default by the control center device, or is customized by the technician. Optionally, the specified order of the transmission address is from large to small, or from small to large. In the embodiments of the present application, only the example where the specified order of the transmission address is from small to large is used for explanation.
[0083] The control center device defines the third string and the fourth string, stores the first digital quantity data into the third string in sequence according to the order of the transmission address from small to large, and stores the first analog quantity data into the fourth string in sequence according to the order of the transmission address from small to large. It should be noted that when storing the first analog quantity data into the fourth string, only two decimal places are taken to prevent the numerical value from fluctuating continuously when there is interference in the analog quantity signal.
[0084] Step 501c: Obtain a set of first data based on the third string and the fourth string.
[0085] The control center device splices the third string and the fourth string to obtain a set of first data. The embodiments of the present application do not limit the splicing order. In one possible implementation, the substation equipment splices them in the order that the third string is in the front and the fourth string is in the back to obtain a set of first data. In another possible implementation, the substation equipment splices them in the order that the third string is in the back and the fourth string is in the front to obtain a set of first data. In the embodiments of the present application, only the former splicing method is used for explanation.
[0086] Optionally, the substation equipment collects the first data at a specified moment. The specified moment is set by the control center device. Optionally, the control center device sends the specified moment to the substation equipment when performing initial settings or modifying settings.
[0087] Optionally, the station equipment collects a set of first data every second time interval until the number of collections reaches a preset number. The second time interval is default set by the control center equipment, or is custom set by the technical personnel, or is set through negotiation between the control center equipment and the station equipment. Exemplarily, the second time interval is 30 seconds. The preset number is default set by the control center equipment, or is custom set by the technical personnel, or is set through negotiation between the control center equipment and the station equipment. Exemplarily, the preset number is 3 times.
[0088] Optionally, before the station equipment collects at least one set of first data, it receives the time calibration signal sent by the control center equipment; and performs time calibration according to the time calibration signal. By the above method, it is ensured that the time of the control center equipment and the station equipment is consistent, making the subsequent determination of the ownership of the control right more accurate.
[0089] Step 502, calculate the hash value for each set of first data in at least one set to obtain at least one first hash value.
[0090] The station equipment calculates the hash value for each set of first data by using the message digest algorithm to obtain the first hash value corresponding to each set of first data.
[0091] Step 503, send at least one first hash value to the control center equipment.
[0092] Correspondingly, the control center equipment receives at least one first hash value, and then determines whether to switch the control right from the control center equipment to the station equipment based on the first hash value and the second hash value. The second hash value is calculated by the control center equipment based on a set of second data collected. A set of second data is generated based on the first transmission data, and the first transmission data is the data received by the control center equipment.
[0093] In summary, the technical solution provided by the embodiment of the present application calculates the hash values by the control center equipment and the station equipment respectively, then matches the consistency of the hash value data calculated by the two, and determines the ownership result of the control right based on the matching result. If the data consistency matches, it is determined that the control right belongs to the control center; if the data consistency does not match, it is determined that the control right belongs to the station equipment, improving the reliability of the control of the long-distance natural gas pipeline and playing a certain role in ensuring the stable transmission of natural gas.
[0094] Figure 6 The flowchart of the control right determination method shown in an embodiment of the present application is shown. The method includes:
[0095] Step 601, the control center equipment periodically sends a time calibration signal.
[0096] Step 602, the control center equipment detects whether the data consistency verification time has been modified.
[0097] If a modification occurs, step 603 is executed. If no modification occurs, the subsequent steps are continued. The data consistency verification time is also the specified time in the above embodiments.
[0098] Step 603: The control center device sends the modified data consistency verification time to the substation device.
[0099] Step 604: The substation device detects whether the data consistency verification time has arrived.
[0100] If it has arrived, step 605 is executed. If it has not arrived, no step is executed.
[0101] Step 605: The substation device performs data aggregation.
[0102] That is, a set of first data is collected.
[0103] Step 606: The substation device calculates the data hash value.
[0104] That is, calculates the hash value for a set of first data.
[0105] Step 607: The substation device detects whether the repeated calculation times have been reached.
[0106] If it has arrived, step 608 is executed. If it has not arrived, it starts to execute from step 605 after the first preset time interval.
[0107] Step 608: The substation device sends the hash value to the control center device.
[0108] Step 609: The control center device waits for the second preset time interval, collects data and calculates the hash value.
[0109] Step 610: The control center device detects whether there is at least one set of identical data.
[0110] If not, step 611 is executed. If so, it starts to execute from step 601 again.
[0111] Step 611: The control center device prompts that the data is inconsistent.
[0112] Step 612: The control center device sends a control right switching instruction to the substation device.
[0113] The following is the device embodiment of this application. For the parts not elaborated in detail in the device embodiment, refer to the technical details disclosed in the method embodiment.
[0114] Refer to Figure 7, which shows a block diagram of a control right determination device provided by an exemplary embodiment of the present application. The control right determination device is implemented as all or part of a terminal through software, hardware, or a combination of both. The control right determination device includes:
[0115] A hash value receiving module 701, configured to receive at least one first hash value sent by a station device, where the first hash value is generated by the station device based on a set of first data collected, and the set of first data is generated based on first transmission data, and the first transmission data is data sent by the station device to the control center device.
[0116] A first obtaining module 702, configured to obtain at least one set of second data, where the set of second data is generated based on second transmission data, and the second transmission data is data received by the control center device.
[0117] A first calculation module 703, configured to calculate a hash value for each set of the at least one set of second data to obtain at least one second hash value.
[0118] A control right determination module 704, configured to determine, based on the first hash value and the second hash value, whether the control right of the station belongs to the control center device or the station device.
[0119] In summary, in the technical solution provided by the embodiment of the present application, the control center device and the station device calculate hash values respectively, and then determine the ownership result of the control right based on the consistency matching of the hash value data calculated by the two. If the data is consistently matched, it is determined that the control right belongs to the control center. If the data is not consistently matched, it is determined that the control right belongs to the station device, which improves the reliability of the control of the long-distance natural gas pipeline and plays a certain role in ensuring the stable transportation of natural gas.
[0120] In an optional embodiment provided based on Figure 7 the embodiment shown, the control right determination module 704 is configured to:
[0121] If the first hash value and the second hash value in each hash value pair are different, it is determined that the control right belongs to the station device;
[0122] If there is at least one hash value pair in which the first hash value and the second hash value are the same, it is determined that the control right belongs to the control center device;
[0123] Wherein, the hash value pair includes the first hash value and the second hash value corresponding to the first hash value, and the set of first data for generating the first hash value corresponds to the set of second data for generating the second hash value corresponding to the first hash value.
[0124] Optionally, the device further includes: an instruction sending module ( Figure 7 not shown).
[0125] The instruction sending module is configured to: if the current control right of the station yard belongs to the dispatching center device, send a control right switching instruction to the station yard device, and the station yard device is configured to switch the control right from the dispatching center device to the station yard device according to the control right switching instruction.
[0126] In an optional embodiment provided based on the Figure 7 illustrated embodiment, the first obtaining module 702 is configured to:
[0127] Divide the second transmission data into second digital quantity data and second analog quantity data;
[0128] Store the second digital quantity data into a first string in the specified order of the transmission address, and store the second analog quantity data into a second string in the specified order;
[0129] Based on the first string and the second string, obtain the set of second data.
[0130] In an optional embodiment provided based on the Figure 7 illustrated embodiment, the device further includes: a time calibration signal sending module ( Figure 7 not shown).
[0131] The time calibration signal sending module is configured to send a time calibration signal to the station yard device, and the station yard device is configured to perform time calibration according to the time calibration signal.
[0132] Referring to Figure 8 , a block diagram of a control right determination device provided by an exemplary embodiment of the present application is shown. The control right determination device is implemented as all or part of a terminal through software, hardware, or a combination of both. The control right determination device includes:
[0133] A second obtaining module 801, configured to obtain at least one set of first data, where the set of first data is generated based on first transmission data, and the first transmission data is data sent by the station yard device to the dispatching center device.
[0134] A second calculation module 802, configured to calculate a hash value for each set of the at least one set of first data to obtain at least one first hash value.
[0135] The hash value sending module 803 is configured to send the at least one first hash value to the control center device, where the control center device is configured to determine whether to switch the control right from the control center device to the station yard device based on the first hash value and a second hash value, the second hash value is calculated by the control center device based on a set of second data collected, and the set of second data is generated based on second transmission data, and the second transmission data is the data received by the control center device.
[0136] In summary, for the technical solution provided by the embodiment of the present application, the control center device and the station yard device respectively calculate hash values, and then match the consistency of the hash value data calculated by the two, and determine the attribution result of the control right based on the matching result. If the data consistency matches, it is determined that the control right belongs to the control center. If the data consistency does not match, it is determined that the control right belongs to the station yard device, which improves the reliability of the long-distance natural gas pipeline control and plays a certain role in ensuring the stable transmission of natural gas.
[0137] In the optional embodiment provided based on Figure 8 the embodiment shown, the second obtaining module 801 is configured to:
[0138] Divide the first transmission data into first digital quantity data and first analog quantity data;
[0139] Store the first digital quantity data in a third string in the specified order of the transmission address, and store the first analog quantity data in a fourth string in the specified order;
[0140] Based on the third string and the fourth string, obtain the set of first data.
[0141] In the optional embodiment provided based on Figure 8 the embodiment shown, the device further includes: a time calibration signal receiving module and a time calibration module ( Figure 8 not shown).
[0142] The time calibration signal sending module is configured to receive the time calibration signal sent by the control center device.
[0143] The time calibration module is configured to perform time calibration according to the time calibration signal.
[0144] Figure 9It is a schematic structural diagram of a computer device provided by an embodiment of the present application. The computer device 900 includes a Central Processing Unit (CPU) 901, a system memory 904 including a Random Access Memory (RAM) 902 and a Read-Only Memory (ROM) 903, and a system bus 905 connecting the system memory 904 and the central processing unit 901. The computer device 900 further includes a basic Input / Output (I / O) system 906 for facilitating information transmission between various components within the computer, and a mass storage device 907 for storing an operating system 913, application programs 914, and other program modules 915.
[0145] The basic Input / Output system 906 includes a display 909 for displaying information and input devices 909 such as a mouse and a keyboard for user input of information. The display 909 and the input devices 909 are both connected to the central processing unit 901 through an Input / Output controller 906 connected to the system bus 905. The basic Input / Output system 909 may further include an input / output controller 99 for receiving and processing inputs from multiple other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 99 also provides outputs to a display screen, a printer, or other types of output devices.
[0146] The mass storage device 907 is connected to the central processing unit 901 through a mass storage controller (not shown) connected to the system bus 905. The mass storage device 907 and its associated computer-readable medium provide non-volatile storage for the computer device 900. That is to say, the mass storage device 907 may include a computer-readable medium (not shown) such as a hard disk or a Compact Disc Read-Only Memory (CD-ROM) drive.
[0147] Without loss of generality, the computer-readable medium may include a computer storage medium and a communication medium. The computer storage medium includes volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. The computer storage medium includes RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid-state storage technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape cartridges, tapes, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above several types. The above-mentioned system memory 904 and mass storage device 907 can be collectively referred to as memory.
[0148] According to various embodiments of the present application, the computer device 900 can also run on a remote computer on the network through a network such as the Internet. That is, the computer device 900 can be connected to the network 912 through the network interface unit 911 connected to the system bus 905. Or rather, the network interface unit 911 can also be used to connect to other types of networks or remote computer systems (not shown).
[0149] Specifically, in the embodiment of the present application, the computer device 900 further includes a memory, and one or more programs, wherein one or more programs are stored in the memory and are configured to be executed by one or more processors. The above one or more programs include instructions for executing the above-mentioned control right determination method.
[0150] In an exemplary embodiment, there is also provided a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor of a mobile terminal to implement the control right determination method in the above method embodiment.
[0151] Optionally, the above computer-readable storage medium may be ROM, RAM, magnetic tape, floppy disk, and optical data storage device, etc.
[0152] In an exemplary embodiment, a computer program product is further provided. The computer program product includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in any of the above-mentioned aspects or various alternative implementation manners of an aspect.
[0153] It should be understood that the "plurality" mentioned herein refers to two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. The "first", "second" and similar terms used herein do not represent any order, quantity or importance, but are only used to distinguish different components.
[0154] The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages or disadvantages of the embodiments.
[0155] The above are only exemplary embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining control right, characterized in that, it is applied to a control center device, and the method includes: receiving at least one first hash value sent by a station device, where the first hash value is generated by the station device based on a set of first data collected, and the set of first data is generated based on first transmission data, and the first transmission data is data sent by the station device to the control center device; obtaining at least one set of second data, calculating a hash value for each set of the at least one set of second data to obtain at least one second hash value, where the set of second data is generated based on second transmission data, and the second transmission data is data received by the control center device; determining whether the control right of the station belongs to the control center device or the station device based on the first hash value and the second hash value; where determining whether the control right of the station belongs to the control center device or the station device based on the first hash value and the second hash value includes: if the first hash value and the second hash value in each hash value pair are different, determining that the control right belongs to the station device; if there is at least one hash value pair in which the first hash value and the second hash value are the same, determining that the control right belongs to the control center device; where the hash value pair includes the first hash value and the second hash value corresponding to the first hash value, and the set of first data for generating the first hash value corresponds to the set of second data for generating the second hash value corresponding to the first hash value.
2. The method according to claim 1, characterized in that, after determining that the control right belongs to the station device, it includes: if the current control right of the station belongs to the control center device, sending a control right switching instruction to the station device, and the station device is used to switch the control right from the control center device to the station device according to the control right switching instruction.
3. The method according to any one of claims 1 to 2, characterized in that, the obtaining at least one set of second data includes: dividing the second transmission data into second digital quantity data and second analog quantity data; sequentially storing the second digital quantity data in a first string in a specified order of transmission addresses, and sequentially storing the second analog quantity data in a second string in the specified order; obtaining the set of second data based on the first string and the second string.
4. The method according to any one of claims 1 to 2, characterized in that, before receiving at least one first hash value sent by the station device, it further includes: sending a time calibration signal to the station device, and the station device is used to perform time calibration according to the time calibration signal.
5. A method for determining control right, characterized in that, it is applied to a station device, and the method includes: obtaining at least one set of first data, where the set of first data is generated based on first transmission data, and the first transmission data is data sent by the station device to a control center device; calculating a hash value for each set of the at least one set of first data to obtain at least one first hash value; Send the at least one first hash value to the control center device, where the control center device is configured to determine whether the control right of the station yard belongs to the control center device or the station yard device based on the first hash value and the second hash value, and the second hash value is calculated by the control center device based on a set of second data collected, and the set of second data is generated based on second transmission data, and the second transmission data is the data received by the control center device; Wherein, the determining whether the control right of the station yard belongs to the control center device or the station yard device based on the first hash value and the second hash value includes: If the first hash value and the second hash value in each hash value pair are different, it is determined that the control right belongs to the station yard device; If there is at least one hash value pair in which the first hash value and the second hash value are the same, it is determined that the control right belongs to the control center device; Wherein, the hash value pair includes the first hash value and the second hash value corresponding to the first hash value, and the set of first data for generating the first hash value corresponds to the set of second data for generating the second hash value corresponding to the first hash value.
6. The method according to claim 5, wherein, the obtaining at least one set of first data includes: Dividing the first transmission data into first digital quantity data and first analog quantity data; Sequentially storing the first digital quantity data in a third string in the specified order of the transmission address, and sequentially storing the first analog quantity data in a fourth string in the specified order; Obtaining the set of first data based on the third string and the fourth string.
7. The method according to claim 5 or 6, wherein, before obtaining the at least one set of first data, further includes: Receiving a time calibration signal sent by the control center device; Performing time calibration according to the time calibration signal.
8. A control right determination device, wherein, the device includes: A hash value receiving module, configured to receive at least one first hash value sent by a station yard device, where the first hash value is generated by the station yard device based on a set of first data collected, and the set of first data is generated based on first transmission data, and the first transmission data is the data sent by the station yard device to the control center device; A first obtaining module, configured to obtain at least one set of second data, where the set of second data is generated based on second transmission data, and the second transmission data is the data received by the control center device; A first calculation module, configured to perform hash value calculation on each set of second data in the at least one set of second data to obtain at least one second hash value; A control right determination module, configured to determine whether the control right of the station yard belongs to the control center device or the station yard device based on the first hash value and the second hash value; where the control right determination module is configured to: If the first hash value and the second hash value in each hash value pair are different, it is determined that the control right belongs to the station yard device; If the first hash value and the second hash value in at least one hash value pair are the same, it is determined that the control right belongs to the control center device; Wherein, the hash value pair includes the first hash value and the second hash value corresponding to the first hash value, and the set of first data for generating the first hash value corresponds to the set of second data for generating the second hash value corresponding to the first hash value.
9. A control right determination device, Characterized in that, The device includes: A second acquisition module, configured to acquire at least one set of first data, where the set of first data is generated based on first transmission data, and the first transmission data is data sent by a station field device to a control center device; A second calculation module, configured to calculate a hash value for each set of the at least one set of first data to obtain at least one first hash value; A hash value sending module, configured to send the at least one first hash value to the control center device, where the control center device is configured to determine, based on the first hash value and a second hash value, whether the control right of the station field belongs to the control center device or the station field device, and the second hash value is calculated by the control center device based on a set of second data collected, and the set of second data is generated based on second transmission data, and the second transmission data is data received by the control center device; The control center device is configured to: If the first hash value and the second hash value in each hash value pair are different, it is determined that the control right belongs to the station field device; If the first hash value and the second hash value in at least one hash value pair are the same, it is determined that the control right belongs to the control center device; Wherein, the hash value pair includes the first hash value and the second hash value corresponding to the first hash value, and the set of first data for generating the first hash value corresponds to the set of second data for generating the second hash value corresponding to the first hash value.
Citation Information
Patent Citations
Heartbeat protocol-based control switching method of supervisory control and data acquisition system
CN105404287A
Channel control right switching method and device for multi-redundancy computer
CN111367706A