Coal mine sensor upgrade method and device
Verify the upgrade files of coal mine sensors through verification information to ensure their consistency and integrity during the transmission process, solve the problems of low upgrade success rate and reliability in the existing technology, and achieve a more efficient remote upgrade process.
Patent Information
- Application Number
- CN202210245330.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-14
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-03-14
AI Technical Summary
The upgrade success rate and reliability of existing coal mine sensors are low, especially in remote upgrade scenarios where file transfer abnormalities are caused.
By receiving the actual upgrade files and reference verification information sent by the server, the actual verification information is generated and compared with the reference verification information to identify the consistency of the file. Only upgrade when the file passes the verification to ensure the safety of the sensor and stable updates.
It improves the reliability and success rate of upgrades of coal mine sensors, ensures the accuracy and integrity of files in remote upgrade scenarios, and avoids abnormal situations caused by file inconsistencies.
Smart Images

Figure CN114679445B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of coal mining, and in particular to an upgrading method, device, electronic equipment and storage medium for a coal mine sensor. Background Art
[0002] At present, in order to improve the safety and intelligence of coal mining, most sensors are used to monitor the environmental parameters and mining parameters of coal mines. With the advancement of technology and the change of demand, sensors also need to be continuously upgraded. However, sensors in related technologies have problems such as low upgrade success rate and low reliability. Summary of the invention
[0003] The present invention aims to solve one of the technical problems in the above-mentioned technology at least to some extent.
[0004] To this end, an object of the present invention is to propose a method for upgrading a coal mine sensor, which can verify the actual upgrade file received based on verification information, and upgrade the coal mine sensor based on the actual upgrade file only when the actual upgrade file passes the verification, thereby improving the reliability and success rate of the coal mine sensor upgrade, and can be applied to the scenario of remote upgrade of coal mine sensors.
[0005] The second object of the present invention is to provide an upgrading device for coal mine sensors.
[0006] The third object of the present invention is to provide a coal mine sensor.
[0007] A fourth objective of the present invention is to provide an electronic device.
[0008] A fifth object of the present invention is to provide a computer-readable storage medium.
[0009] The first aspect of the present invention proposes a method for upgrading a coal mine sensor, comprising: receiving an actual upgrade file and reference verification information sent by a server, wherein the reference verification information is generated based on the reference upgrade file; generating actual verification information based on the received actual upgrade file; generating a verification result of the actual upgrade file based on the actual verification information and the reference verification information; in response to the verification result indicating that the actual upgrade file has passed the verification, upgrading the coal mine sensor based on the actual upgrade file.
[0010] According to the upgrade method of the coal mine sensor of the embodiment of the present invention, the actual upgrade file and reference verification information sent by the server can be received, wherein the reference verification information is generated based on the reference upgrade file, the actual verification information is generated based on the received actual upgrade file, the verification result of the actual upgrade file is generated based on the actual verification information and the reference verification information, and in response to the verification result indicating that the actual upgrade file has passed the verification, the coal mine sensor is upgraded based on the actual upgrade file. Thus, the received actual upgrade file can be verified based on the verification information, and the coal mine sensor can be upgraded based on the actual upgrade file only when the actual upgrade file has passed the verification, which can improve the reliability and success rate of the coal mine sensor upgrade, and can be applied to the scenario of remote upgrade of coal mine sensors.
[0011] In addition, the coal mine sensor upgrade method proposed in the above embodiment of the present invention may also have the following additional technical features:
[0012] In one embodiment of the present invention, the generating of actual verification information based on the received actual upgrade file includes: converting the actual generation file to generate the actual verification information.
[0013] In one embodiment of the present invention, generating a verification result of the actual upgrade file based on the actual verification information and the reference verification information includes: identifying whether the actual upgrade file is consistent with the reference upgrade file based on the actual verification information and the reference verification information; in response to the actual upgrade file being consistent with the reference upgrade file, generating the verification result that the actual upgrade file passes the verification; or, in response to the actual upgrade file being inconsistent with the reference upgrade file, generating the verification result that the actual upgrade file fails the verification.
[0014] In one embodiment of the present invention, identifying whether the actual upgrade file is consistent with the reference upgrade file based on the actual verification information and the reference verification information includes: comparing the actual verification information with the reference verification information; in response to the actual verification information being consistent with the reference verification information, identifying that the actual upgrade file is consistent with the reference upgrade file; or, in response to the actual verification information being inconsistent with the reference verification information, identifying that the actual upgrade file is inconsistent with the reference upgrade file.
[0015] In one embodiment of the present invention, the method further includes: in response to the verification result indicating that the actual upgrade file fails to pass the verification, sending indication information to the server, wherein the indication information is used to instruct the server to resend the upgrade file.
[0016] In one embodiment of the present invention, after the response to the verification result indicating that the actual upgrade file has passed the verification, the method further includes: caching the actual upgrade file into a target storage space of the coal mine sensor.
[0017] In one embodiment of the present invention, before caching the actual upgrade file into the target storage space of the coal mine sensor, it also includes: caching the running file in the target storage space into the backup storage space of the coal mine sensor, and erasing the running file in the target storage space.
[0018] In one embodiment of the present invention, it also includes: in the process of upgrading the coal mine sensor based on the actual upgrade file, monitoring whether the upgrade process of the coal mine sensor has any abnormality; in response to the abnormality in the upgrade process of the coal mine sensor, controlling the coal mine sensor to continue running according to the running file in the backup storage space.
[0019] In one embodiment of the present invention, the verification information includes a hash value.
[0020] The second aspect of the present invention proposes an upgrade device for a coal mine sensor, comprising: a receiving module, used to receive an actual upgrade file and reference verification information sent by a server, wherein the reference verification information is generated based on the reference upgrade file; a generating module, used to generate actual verification information based on the received actual upgrade file; a verification module, used to generate a verification result of the actual upgrade file based on the actual verification information and the reference verification information; and an upgrading module, used to upgrade the coal mine sensor based on the actual upgrade file in response to the verification result indicating that the actual upgrade file has passed the verification.
[0021] The upgrade device of the coal mine sensor of the embodiment of the present invention can receive the actual upgrade file and reference verification information sent by the server, wherein the reference verification information is generated based on the reference upgrade file, the actual verification information is generated based on the received actual upgrade file, the verification result of the actual upgrade file is generated based on the actual verification information and the reference verification information, and the coal mine sensor is upgraded based on the actual upgrade file in response to the verification result indicating that the actual upgrade file has passed the verification. Thus, the received actual upgrade file can be verified based on the verification information, and the coal mine sensor can be upgraded based on the actual upgrade file only when the actual upgrade file has passed the verification, which can improve the reliability and success rate of the coal mine sensor upgrade, and can be applied to the scenario of remote upgrade of coal mine sensors.
[0022] In addition, the upgrading device of the coal mine sensor proposed in the above embodiment of the present invention may also have the following additional technical features:
[0023] In one embodiment of the present invention, the generation module is further used to: convert the actual generation file to generate the actual verification information.
[0024] In one embodiment of the present invention, the verification module is further used to: identify whether the actual upgrade file is consistent with the reference upgrade file based on the actual verification information and the reference verification information; in response to the actual upgrade file being consistent with the reference upgrade file, generate the verification result that the actual upgrade file has passed the verification; or, in response to the actual upgrade file being inconsistent with the reference upgrade file, generate the verification result that the actual upgrade file has failed the verification.
[0025] In one embodiment of the present invention, the verification module is further used to: compare the actual verification information with the reference verification information; in response to the actual verification information being consistent with the reference verification information, identify that the actual upgrade file is consistent with the reference upgrade file; or, in response to the actual verification information being inconsistent with the reference verification information, identify that the actual upgrade file is inconsistent with the reference upgrade file.
[0026] In one embodiment of the present invention, the upgrading device of the coal mine sensor further includes: a sending module, wherein the sending module is used to: in response to the verification result indicating that the actual upgrade file has not passed the verification, send an indication message to the server, wherein the indication message is used to instruct the server to resend the upgrade file.
[0027] In one embodiment of the present invention, the upgrade module is further used to: cache the actual upgrade file into the target storage space of the coal mine sensor.
[0028] In one embodiment of the present invention, the upgrade module is further used to: cache the operating files in the target storage space to the backup storage space of the coal mine sensor, and erase the operating files in the target storage space.
[0029] In one embodiment of the present invention, the upgrade module is also used to: during the process of upgrading the coal mine sensor based on the actual upgrade file, monitor whether there is any abnormality in the upgrade process of the coal mine sensor; in response to an abnormality in the upgrade process of the coal mine sensor, control the coal mine sensor to continue running according to the operation file.
[0030] In one embodiment of the present invention, the verification information includes a hash value.
[0031] The third embodiment of the present invention provides a coal mine sensor, including the upgrading device of the coal mine sensor described in the second embodiment of the present invention.
[0032] The coal mine sensor of the embodiment of the present invention can receive the actual upgrade file and reference verification information sent by the server, wherein the reference verification information is generated based on the reference upgrade file, the actual verification information is generated based on the received actual upgrade file, the verification result of the actual upgrade file is generated based on the actual verification information and the reference verification information, and in response to the verification result indicating that the actual upgrade file has passed the verification, the coal mine sensor is upgraded based on the actual upgrade file. Thus, the received actual upgrade file can be verified based on the verification information, and the coal mine sensor is upgraded based on the actual upgrade file only when the actual upgrade file has passed the verification, which can improve the reliability and success rate of the coal mine sensor upgrade, and can be applied to the scenario of remote upgrade of coal mine sensors.
[0033] The fourth aspect of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method for upgrading the coal mine sensor as described in the first aspect of the present invention is implemented.
[0034] The electronic device of the embodiment of the present invention can receive the actual upgrade file and reference verification information sent by the server through the processor executing the computer program stored in the memory, wherein the reference verification information is generated based on the reference upgrade file, the actual verification information is generated based on the received actual upgrade file, the verification result of the actual upgrade file is generated based on the actual verification information and the reference verification information, and the coal mine sensor is upgraded based on the actual upgrade file in response to the verification result indicating that the actual upgrade file has passed the verification. Thus, the received actual upgrade file can be verified based on the verification information, and the coal mine sensor can be upgraded based on the actual upgrade file only when the actual upgrade file has passed the verification, which can improve the reliability and success rate of the coal mine sensor upgrade, and can be applied to the scenario of remote upgrade of coal mine sensors.
[0035] The fifth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for upgrading the coal mine sensor as described in the first aspect of the present application is implemented.
[0036] The computer-readable storage medium of the embodiment of the present invention can receive the actual upgrade file and reference verification information sent by the server by storing a computer program and being executed by a processor, wherein the reference verification information is generated based on the reference upgrade file, the actual verification information is generated based on the received actual upgrade file, the verification result of the actual upgrade file is generated based on the actual verification information and the reference verification information, and the coal mine sensor is upgraded based on the actual upgrade file in response to the verification result indicating that the actual upgrade file has passed the verification. Thus, the received actual upgrade file can be verified based on the verification information, and the coal mine sensor can be upgraded based on the actual upgrade file only when the actual upgrade file has passed the verification, which can improve the reliability and success rate of the coal mine sensor upgrade, and can be applied to the scenario of remote upgrade of coal mine sensors.
[0037] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0039] Figure 1 A schematic diagram of a flow chart of a method for upgrading a coal mine sensor according to an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of an upgrade system for a coal mine sensor according to an embodiment of the present invention;
[0041] Figure 3 A schematic diagram of a storage space of a coal mine sensor according to an embodiment of the present invention;
[0042] Figure 4 A schematic diagram of a process for generating a verification result of an actual upgrade file in a method for upgrading a coal mine sensor according to an embodiment of the present invention;
[0043] Figure 5 An interactive flow chart of a method for upgrading a coal mine sensor according to an embodiment of the present invention;
[0044] Figure 6 A schematic diagram of the structure of a coal mine sensor according to an embodiment of the present invention;
[0045] Figure 7 It is a structural schematic diagram of an upgrading device for a coal mine sensor according to an embodiment of the present invention;
[0046] Figure 8 is a schematic structural diagram of a coal mine sensor according to another embodiment of the present invention; and
[0047] Fig. 9 FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0049] The following describes the coal mine sensor upgrade method, device, coal mine sensor, electronic device and storage medium according to the embodiments of the present invention in conjunction with the accompanying drawings.
[0050] Figure 1 The figure is a flow chart of a method for upgrading a coal mine sensor according to an embodiment of the present invention.
[0051] like Figure 1 As shown, the method for upgrading the coal mine sensor according to the embodiment of the present invention includes:
[0052] S101, receiving an actual upgrade file and reference verification information sent by a server, wherein the reference verification information is generated based on the reference upgrade file.
[0053] In an embodiment of the present invention, the coal mine sensor may receive an actual upgrade file and reference verification information sent by a server, wherein the reference verification information is generated based on the reference upgrade file. For example, the reference upgrade file may include the actual upgrade file of the server before sending. It is understandable that the actual upgrade file received by the coal mine sensor may be inconsistent with the actual upgrade file of the server before sending due to transmission anomalies and other reasons. For example, the reference upgrade file may be pre-set in the storage space of the server.
[0054] In the embodiment of the present disclosure, the reference verification information is generated based on the reference upgrade file. The verification information corresponds to the upgrade file one by one. One reference upgrade file can correspond to unique reference verification information.
[0055] It should be noted that there are no excessive restrictions on the type, structure, installation location, etc. of coal mine sensors. For example, coal mine sensors include but are not limited to light sensors, dust and fog sensors, etc. For example, coal mine sensors can be installed in underground tunnels, mining working faces, etc.
[0056] In one embodiment, the server may include a monitoring system host, such as Figure 2As shown, the upgrade system of the coal mine sensor may include a monitoring system host, a monitoring substation, a coal mine sensor and a network switch. The monitoring system host is used to generate reference verification information based on the reference upgrade file, and send the actual upgrade file and the reference verification information to the coal mine sensor through the monitoring substation. The network switch is used to realize the communication between the monitoring system host and the monitoring substation.
[0057] In one embodiment, the monitoring substation may include an intrinsically safe monitoring substation, and the network switch may include an intrinsically safe network switch.
[0058] In one embodiment, the monitoring system host and the monitoring substation use the Ymodem protocol for communication, which can improve the efficiency and success rate of communication between the monitoring system host and the monitoring substation. It should be noted that Ymodem is a file transfer protocol.
[0059] In one embodiment, the monitoring substation and the coal mine sensor communicate with each other using a CAN (Controller Area Network) bus or an RS485 bus. It should be noted that the RS485 bus is a communication bus.
[0060] It should be noted that there are no excessive restrictions on the types of verification information. For example, the verification information includes a hash value, and the hash value may include an MD5 (Message-Digest Algorithm) code. For example, the verification information may include a timestamp, a key string, an identity identifier, and the like.
[0061] S102: Generate actual verification information based on the received actual upgrade file.
[0062] In an embodiment of the present invention, the coal mine sensor can generate actual verification information based on the received actual upgrade file. That is, the actual verification information is generated based on the actual upgrade file. The verification information corresponds to the upgrade file one by one. One actual upgrade file can correspond to unique actual verification information.
[0063] In one embodiment, generating actual verification information based on the received actual upgrade file may include converting the actual generated file to generate the actual verification information. For example, a conversion strategy may be used to convert the actual upgrade file to generate the actual verification information. It should be noted that there are no excessive restrictions on the conversion strategy. For example, the conversion strategy may include a hash function, and the hash function may include MD5.
[0064] In one embodiment, generating actual verification information based on the received actual upgrade file may include extracting the upgrade verification information from the actual upgrade file. For example, the upgrade verification information may be extracted from the actual upgrade file by setting an extraction strategy. For example, setting the extraction strategy may include setting an extraction location, an amount of extracted data, etc. It should be noted that there is no excessive limitation on setting the conversion strategy.
[0065] S103: Generate a verification result of the actual upgrade file based on the actual verification information and the reference verification information.
[0066] In an embodiment of the present invention, the coal mine sensor can generate a verification result of the actual upgrade file based on the actual verification information and the reference verification information. It should be noted that the verification result may include that the actual upgrade file passes the verification, the actual upgrade file fails the verification, etc.
[0067] In one embodiment, the verification information may include at least one of a timestamp, a key string, an identity identifier, etc., and a verification result of the actual upgrade file is generated based on the actual verification information and the reference verification information. It may include verifying the timeliness of the actual upgrade file based on the actual timestamp in the actual verification information and the reference timestamp of the reference verification information, verifying the authenticity of the actual upgrade file based on the actual key string in the actual verification information and the reference key string of the reference verification information, and verifying the legitimacy of the identity of the server based on the actual identity identifier in the actual verification information and the reference identity identifier of the reference verification information. In response to the timeliness, authenticity and legitimacy all passing the verification, a verification result is generated that the actual upgrade file passes the verification, or, in response to at least one of the timeliness, authenticity and legitimacy failing the verification, a verification result is generated that the actual upgrade file fails the verification.
[0068] In one embodiment, based on the actual timestamp in the actual verification information and the reference timestamp in the reference verification information, the timeliness of the actual upgrade file is verified, which may include identifying that the timeliness of the actual upgrade file has passed the verification in response to the difference between the actual timestamp and the reference timestamp being less than or equal to a set threshold; or identifying that the timeliness of the actual upgrade file has not passed the verification in response to the difference between the actual timestamp and the reference timestamp being greater than the set threshold.
[0069] In one embodiment, the authenticity of the actual upgrade file is verified based on the actual key string in the actual verification information and the reference key string in the reference verification information, which may include, in response to the actual key string being consistent with the reference key string, identifying that the authenticity of the actual upgrade file has passed the verification; or, in response to the actual key string being inconsistent with the reference key string, identifying that the authenticity of the actual upgrade file has not passed the verification.
[0070] In one embodiment, based on the actual identity identifier in the actual verification information and the reference identity identifier in the reference verification information, the legitimacy of the server's identity is verified, which may include, in response to the actual identity identifier being consistent with the reference identity identifier, identifying that the legitimacy of the actual upgrade file has passed the verification; or, in response to the actual identity identifier being inconsistent with the reference identity identifier, identifying that the legitimacy of the actual upgrade file has not passed the verification.
[0071] S104: In response to the verification result indicating that the actual upgrade file passes the verification, the coal mine sensor is upgraded based on the actual upgrade file.
[0072] In an embodiment of the present invention, the coal mine sensor may upgrade the coal mine sensor based on the actual upgrade file in response to the verification result indicating that the actual upgrade file has passed the verification.
[0073] In one embodiment, upgrading the coal mine sensor based on the actual upgrade file may include starting an upgrade driver program, and the upgrade driver program upgrades the coal mine sensor based on the actual upgrade file. It should be noted that the upgrade driver program may be pre-set in the storage space of the coal mine sensor.
[0074] In one embodiment, Figure 3 As shown, the storage space of the coal mine sensor may include a target storage space, a backup storage space, a first storage space, a second storage space, and a third storage space. Among them, the first storage space is used to store the actual upgrade file and the upgrade driver before verification, the second storage space is used to store the upgrade flag, the target storage space and the backup storage space are used to store the running file, and the third storage space is used to store the identification information of the historical upgrade file of the coal mine sensor, the parameter information of the coal mine sensor, etc.
[0075] It should be noted that there is no excessive restriction on the amount of data in each storage space included in the storage space of the coal mine sensor. For example, the address of the storage space of the coal mine sensor is 0x08000000~0x08080000, wherein the address of the first storage space is 0x08000000~0x0801FFFF, the address of the second storage space is 0x0801FFFF~0x08020000, the address of the target storage space is 0x08020000~0x08040000, the address of the backup storage space is 0x08040000~0x08060000, and the address of the third storage space is 0x08060000~0x08080000.
[0076] In one implementation, after receiving the actual upgrade file sent by the server, the actual upgrade file may be cached in the first storage space of the coal mine sensor.
[0077] In one embodiment, in response to the verification result indicating that the actual upgrade file has passed the verification, the method further includes caching the actual upgrade file into the target storage space of the coal mine sensor. Thus, the actual upgrade file can be updated to the running file in the method, and the running file can be updated in real time.
[0078] In one embodiment, before caching the actual upgrade file into the target storage space of the coal mine sensor, it also includes caching the running file in the target storage space into the backup storage space of the coal mine sensor, and erasing the running file in the target storage space. It should be noted that the running file refers to the file currently running by the coal mine sensor. Therefore, the method can realize the backup of the running file, ensuring the reliability of the operation of the coal mine sensor.
[0079] In one implementation, before caching the running files in the target storage space into the backup storage space of the coal mine sensor, the method further includes erasing the running files in the backup storage space.
[0080] In one embodiment, during the process of upgrading the coal mine sensor based on the actual upgrade file, the upgrade process of the coal mine sensor is monitored to see if there is an abnormality. In response to the abnormality in the upgrade process of the coal mine sensor, the coal mine sensor is controlled to continue to run according to the operation file in the backup storage space. It is understandable that the upgrade process of the coal mine sensor may be abnormal due to power failure of the coal mine sensor, communication interruption, etc. Therefore, in this method, when an abnormality occurs in the upgrade process of the coal mine sensor, the coal mine sensor can be controlled to continue to run according to the operation file in the backup storage space, thereby ensuring the reliability of the operation of the coal mine sensor.
[0081] In summary, according to the upgrade method of the coal mine sensor of the embodiment of the present invention, the actual upgrade file and reference verification information sent by the server can be received, wherein the reference verification information is generated based on the reference upgrade file, the actual verification information is generated based on the received actual upgrade file, the verification result of the actual upgrade file is generated based on the actual verification information and the reference verification information, and in response to the verification result indicating that the actual upgrade file has passed the verification, the coal mine sensor is upgraded based on the actual upgrade file. Thus, the actual upgrade file received can be verified based on the verification information, and the coal mine sensor can be upgraded based on the actual upgrade file only when the actual upgrade file has passed the verification, which can improve the reliability and success rate of the coal mine sensor upgrade, and can be applied to the scenario of remote upgrade of coal mine sensors.
[0082] Based on any of the above embodiments, Figure 4 As shown, in step S103, generating a verification result of the actual upgrade file based on the actual verification information and the reference verification information may include:
[0083] S401, based on actual verification information and reference verification information, identifying whether the actual upgrade file is consistent with the reference upgrade file.
[0084] S402: In response to the actual upgrade file being consistent with the reference upgrade file, a verification result is generated indicating that the actual upgrade file passes the verification.
[0085] S403: In response to the actual upgrade file being inconsistent with the reference upgrade file, a verification result is generated indicating that the actual upgrade file fails the verification.
[0086] In an embodiment of the present invention, the actual upgrade file and the reference upgrade file may be consistent or inconsistent. Based on the actual verification information and the reference verification information, it can be identified whether the actual upgrade file is consistent with the reference upgrade file. In response to the consistency of the actual upgrade file and the reference upgrade file, it indicates that the actual upgrade file received by the coal mine sensor is consistent with the reference upgrade file that the server wants to send, and the verification result is generated as the actual upgrade file passes the verification; or, in response to the inconsistency of the actual upgrade file and the reference upgrade file, it indicates that the actual upgrade file received by the coal mine sensor is inconsistent with the reference upgrade file that the server wants to send, and the verification result is generated as the actual upgrade file fails the verification.
[0087] In one embodiment, identifying whether an actual upgrade file is consistent with a reference upgrade file based on actual verification information and reference verification information may include comparing the actual verification information with the reference verification information, and in response to the actual verification information being consistent with the reference verification information, identifying that the actual upgrade file is consistent with the reference upgrade file; or, in response to the actual verification information being inconsistent with the reference verification information, identifying that the actual upgrade file is inconsistent with the reference upgrade file.
[0088] Therefore, the method can identify whether the actual upgrade file is consistent with the reference upgrade file based on the actual verification information and the reference verification information. When the actual upgrade file is consistent with the reference upgrade file, it is identified that the actual upgrade file has passed the verification. When the actual upgrade file is inconsistent with the reference upgrade file, it is identified that the actual upgrade file has not passed the verification, so as to realize the verification of the actual upgrade file.
[0089] Based on any of the above embodiments, after the verification result of the actual upgrade file is generated in step S103, the method further includes sending an indication message to the server in response to the verification result indicating that the actual upgrade file has not passed the verification, and the indication message is used to instruct the server to resend the upgrade file. Thus, in the method, when the actual upgrade file has not passed the verification, the server can be promptly reminded to resend the upgrade file.
[0090] Based on any of the above embodiments, before upgrading the coal mine sensor based on the upgrade file in step S104, it also includes identifying that the value of the upgrade flag in the storage space of the coal mine sensor is a first set value, wherein the first set value is used to indicate that the coal mine sensor is in an upgrade-allowed state. Figure 3 As shown, the second storage space in the storage space of the coal mine sensor is used to store the upgrade flag. It should be noted that there is no excessive limitation on the first setting value, for example, the first setting value is 1. Therefore, in this method, the coal mine sensor can be upgraded based on the upgrade file after the value of the upgrade flag is identified as the first setting value, thereby ensuring the flexibility of the coal mine sensor upgrade.
[0091] In one embodiment, the coal mine sensor can set the value of the upgrade flag to the first set value in response to the upgrade instruction sent by the server. Therefore, in the method, the value of the upgrade flag can be updated to the first set value in a timely manner based on the upgrade instruction sent by the server, so as to update the coal mine sensor to the upgrade-allowed state in a timely manner.
[0092] In one embodiment, the coal mine sensor can set the value of the upgrade flag to a second set value in response to the completion of the upgrade, wherein the second set value is used to indicate that the coal mine sensor is in a prohibited upgrade state. Thus, in the method, after the coal mine sensor is upgraded, the value of the upgrade flag can be updated to the second set value in a timely manner, so as to update the coal mine sensor to a prohibited upgrade state in a timely manner.
[0093] In order to make those skilled in the art understand the present invention more clearly, Figure 5 FIG. 1 is an interactive flow chart of a method for upgrading a coal mine sensor according to an embodiment of the present invention. Figure 5 As shown, the upgrade method may include the following steps:
[0094] S501, the monitoring system host generates reference verification information based on the reference upgrade file.
[0095] S502, the monitoring system host sends the actual upgrade file and reference verification information to the monitoring substation.
[0096] S503, the monitoring substation sends the actual upgrade file and reference verification information to the coal mine sensor.
[0097] S504, the coal mine sensor generates actual verification information based on the received actual upgrade file.
[0098] S505, the coal mine sensor generates a verification result of the actual upgrade file based on the actual verification information and the reference verification information.
[0099] S506: In response to the verification result indicating that the actual upgrade file has passed the verification, the coal mine sensor upgrades the coal mine sensor based on the actual upgrade file.
[0100] S507, in response to the verification result indicating that the actual upgrade file has not passed the verification, the coal mine sensor sends an indication message to the monitoring substation, where the indication message is used to instruct the monitoring system host to resend the upgrade file.
[0101] S508, the monitoring substation sends the instruction information to the monitoring system host.
[0102] It should be noted that the relevant contents of steps S501-S508 can be referred to the above embodiment and will not be described again here.
[0103] Based on any of the above embodiments, Figure 6 As shown, the coal mine sensor 100 includes a processor 1 , an environmental parameter acquisition module 2 , and a verification module 3 .
[0104] The processor 1 includes a communication module 11, a display module 12, an alarm module 13, a power module 14, and a storage module 15. The communication module 11 is used to realize the communication between the coal mine sensor and the server. For example, the communication module 11 is used to receive the actual upgrade file and reference verification information sent by the server. The display module 12 is used to display the collected environmental parameters, sensor status information, etc. The alarm module 13 is used for abnormal alarms, such as low voltage, abnormal collected environmental parameters, etc. The power module 14 is used for charging and discharging the coal mine sensor, and the storage module 15 is used for data storage.
[0105] The environmental parameter acquisition module 2 comprises an acquisition submodule 21, a processing submodule 22 and a conversion submodule 23, which are respectively used for the acquisition, processing and signal conversion of environmental parameters.
[0106] The verification module 3 is used to generate actual verification information based on the received actual upgrade file, and to generate a verification result of the actual upgrade file based on the actual verification information and the reference verification information.
[0107] In one implementation, the mainboard of the coal mine sensor is a universal mainboard, a plurality of universal serial ports are arranged on the mainboard, and each module is connected to the mainboard via a corresponding universal serial port.
[0108] Therefore, the coal mine sensor adopts a modular design, which improves the flexibility and applicability of the coal mine sensor and reduces the development cost.
[0109] In order to implement the above embodiment, the present invention also proposes an upgrading device for a coal mine sensor.
[0110] Figure 7 The figure is a schematic diagram of the structure of a device for upgrading a coal mine sensor according to an embodiment of the present invention.
[0111] like Figure 7 As shown, the coal mine sensor upgrading device 200 according to the embodiment of the present invention includes: a receiving module 210 , a generating module 220 , a verifying module 230 and an upgrading module 240 .
[0112] The receiving module 210 is used to receive the actual upgrade file and reference verification information sent by the server, wherein the reference verification information is generated based on the reference upgrade file;
[0113] The generating module 220 is used to generate actual verification information based on the received actual upgrade file;
[0114] The verification module 230 is used to generate a verification result of the actual upgrade file based on the actual verification information and the reference verification information;
[0115] The upgrading module 240 is used for upgrading the coal mine sensor based on the actual upgrading file in response to the verification result indicating that the actual upgrading file passes the verification.
[0116] In one embodiment of the present invention, the generating module 220 is further used to: convert the actual generated file to generate the actual verification information.
[0117] In one embodiment of the present invention, the verification module 230 is also used to: identify whether the actual upgrade file is consistent with the reference upgrade file based on the actual verification information and the reference verification information; in response to the actual upgrade file being consistent with the reference upgrade file, generate the verification result that the actual upgrade file has passed the verification; or, in response to the actual upgrade file being inconsistent with the reference upgrade file, generate the verification result that the actual upgrade file has failed the verification.
[0118] In one embodiment of the present invention, the verification module 230 is also used to: compare the actual verification information with the reference verification information; in response to the actual verification information being consistent with the reference verification information, identify that the actual upgrade file is consistent with the reference upgrade file; or, in response to the actual verification information being inconsistent with the reference verification information, identify that the actual upgrade file is inconsistent with the reference upgrade file.
[0119] In one embodiment of the present invention, the coal mine sensor upgrade device 200 also includes: a sending module, the sending module is used to: in response to the verification result indicating that the actual upgrade file has not passed the verification, send an indication message to the server, the indication message is used to instruct the server to resend the upgrade file.
[0120] In one embodiment of the present invention, the upgrade module 240 is further used to: cache the actual upgrade file into the target storage space of the coal mine sensor.
[0121] In one embodiment of the present invention, the upgrade module 240 is further used to: cache the operating files in the target storage space to the backup storage space of the coal mine sensor, and erase the operating files in the target storage space.
[0122] In one embodiment of the present invention, the upgrade module 240 is also used to: during the process of upgrading the coal mine sensor based on the actual upgrade file, monitor whether there is any abnormality in the upgrade process of the coal mine sensor; in response to an abnormality in the upgrade process of the coal mine sensor, control the coal mine sensor to continue running according to the running file in the backup storage space.
[0123] In one embodiment of the present invention, the verification information includes a hash value.
[0124] It should be noted that for details not disclosed in the upgrading device for the coal mine sensor in the embodiment of the present invention, please refer to the details disclosed in the upgrading method for the coal mine sensor in the embodiment of the present invention, which will not be repeated here.
[0125] In summary, the upgrade device of the coal mine sensor of the embodiment of the present invention can receive the actual upgrade file and reference verification information sent by the server, wherein the reference verification information is generated based on the reference upgrade file, and the actual verification information is generated based on the received actual upgrade file, and the verification result of the actual upgrade file is generated based on the actual verification information and the reference verification information, and in response to the verification result indicating that the actual upgrade file has passed the verification, the coal mine sensor is upgraded based on the actual upgrade file. Therefore, the actual upgrade file received can be verified based on the verification information, and the coal mine sensor can be upgraded based on the actual upgrade file only when the actual upgrade file has passed the verification, which can improve the reliability and success rate of the coal mine sensor upgrade, and can be applied to the scenario of remote upgrade of coal mine sensors.
[0126] In order to implement the above embodiment, Figure 8 As shown, the embodiment of the present invention proposes a coal mine sensor 100, including the above-mentioned coal mine sensor upgrading device 200.
[0127] The coal mine sensor of the embodiment of the present invention can receive the actual upgrade file and reference verification information sent by the server, wherein the reference verification information is generated based on the reference upgrade file, the actual verification information is generated based on the received actual upgrade file, the verification result of the actual upgrade file is generated based on the actual verification information and the reference verification information, and in response to the verification result indicating that the actual upgrade file has passed the verification, the coal mine sensor is upgraded based on the actual upgrade file. Thus, the received actual upgrade file can be verified based on the verification information, and the coal mine sensor is upgraded based on the actual upgrade file only when the actual upgrade file has passed the verification, which can improve the reliability and success rate of the coal mine sensor upgrade, and can be applied to the scenario of remote upgrade of coal mine sensors.
[0128] In order to implement the above embodiment, Fig. 9 As shown, an embodiment of the present invention proposes an electronic device 300, including: a memory 310, a processor 320, and a computer program stored in the memory 310 and executable on the processor 320. When the processor 320 executes the program, the above-mentioned coal mine sensor upgrade method is implemented.
[0129] The electronic device of the embodiment of the present invention can receive the actual upgrade file and reference verification information sent by the server through the processor executing the computer program stored in the memory, wherein the reference verification information is generated based on the reference upgrade file, the actual verification information is generated based on the received actual upgrade file, the verification result of the actual upgrade file is generated based on the actual verification information and the reference verification information, and the coal mine sensor is upgraded based on the actual upgrade file in response to the verification result indicating that the actual upgrade file has passed the verification. Thus, the received actual upgrade file can be verified based on the verification information, and the coal mine sensor can be upgraded based on the actual upgrade file only when the actual upgrade file has passed the verification, which can improve the reliability and success rate of the coal mine sensor upgrade, and can be applied to the scenario of remote upgrade of coal mine sensors.
[0130] In order to implement the above embodiment, the embodiment of the present invention proposes a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the above-mentioned coal mine sensor upgrade method is implemented.
[0131] The computer-readable storage medium of the embodiment of the present invention can receive the actual upgrade file and reference verification information sent by the server by storing a computer program and being executed by a processor, wherein the reference verification information is generated based on the reference upgrade file, the actual verification information is generated based on the received actual upgrade file, the verification result of the actual upgrade file is generated based on the actual verification information and the reference verification information, and the coal mine sensor is upgraded based on the actual upgrade file in response to the verification result indicating that the actual upgrade file has passed the verification. Thus, the received actual upgrade file can be verified based on the verification information, and the coal mine sensor can be upgraded based on the actual upgrade file only when the actual upgrade file has passed the verification, which can improve the reliability and success rate of the coal mine sensor upgrade, and can be applied to the scenario of remote upgrade of coal mine sensors.
[0132] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0133] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0134] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0135] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0136] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0137] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for upgrading a coal mine sensor, characterized in that: include: Receive the actual upgrade file and reference verification information sent by the server through the monitoring substation, the reference verification information includes a reference timestamp, a reference key string and a reference identity, wherein the server includes a monitoring system host, the monitoring system host generates the reference verification information based on the reference upgrade file, and monitors the communication between the monitoring system host and the monitoring substation through a network switch, the monitoring system host and the monitoring substation communicate using a Ymodem protocol, the monitoring system host is located above the mine, and the coal mine sensor is located underground; The actual upgrade file is converted by using a hash function to generate actual verification information, wherein one actual upgrade file corresponds to unique actual verification information, the hash function includes an information digest algorithm, the actual verification information includes an actual timestamp, an actual key string and an actual identity identifier, and the coal mine sensor generates the actual verification information based on the received actual upgrade file, including: using a set extraction strategy including a set extraction position and an extraction data amount to extract the upgrade verification information from the actual upgrade file; Verifying the timeliness of the actual upgrade file based on the actual timestamp and the reference timestamp, verifying the authenticity of the actual upgrade file based on the actual key string and the reference key string, and verifying the legitimacy of the identity of the server based on the actual identity identifier and the reference identity identifier, and when the timeliness, authenticity and legitimacy all pass the verification, the generated verification result of the actual upgrade file is that the actual upgrade file passes the verification; In response to the verification result indicating that the actual upgrade file has passed the verification, the running file in the target storage space is cached in the backup storage space of the coal mine sensor, the running file in the target storage space is erased, and the actual upgrade file is cached in the target storage space of the coal mine sensor, so that the coal mine sensor is upgraded based on the actual upgrade file, wherein the running file refers to the file currently running the coal mine sensor, and in the process of upgrading the coal mine sensor based on the actual upgrade file, whether the upgrade process of the coal mine sensor is abnormal is monitored, and when the upgrade process of the coal mine sensor is abnormal, the running file in the backup storage space is controlled to continue running.
2. The method according to claim 1, characterized in that Also includes: In response to the verification result indicating that the actual upgrade file fails the verification, an indication message is sent to the server, where the indication message is used to instruct the server to resend the upgrade file.
3. The method according to claim 2, characterized in that After the operation files in the target storage space are cached in the backup storage space of the coal mine sensor, the operation files in the target storage space are erased.
4. The method according to any one of claims 1 to 3, characterized in that: The verification information includes a hash value.
5. A coal mine sensor upgrade device, characterized in that: include: A receiving module, used for receiving the actual upgrade file and reference verification information sent by the server through the monitoring substation, wherein the reference verification information includes a reference timestamp, a reference key string and a reference identity, wherein the server includes a monitoring system host, the monitoring system host generates the reference verification information based on the reference upgrade file, and the communication between the monitoring system host and the monitoring substation is monitored through a network switch, the monitoring system host and the monitoring substation communicate using a Ymodem protocol, the monitoring system host is located above the mine, and the coal mine sensor is located underground; A generation module, used for converting the actual upgrade file by using a hash function to generate actual verification information, wherein one actual upgrade file corresponds to unique actual verification information, the hash function includes an information digest algorithm, the actual verification information includes an actual timestamp, an actual key string and an actual identity identifier, and the coal mine sensor generates the actual verification information based on the received actual upgrade file, including: using a set extraction strategy including a set extraction position and an extraction data amount to extract the upgrade verification information from the actual upgrade file; A verification module, used to verify the timeliness of the actual upgrade file based on the actual timestamp and the reference timestamp, verify the authenticity of the actual upgrade file based on the actual key string and the reference key string, and verify the legitimacy of the identity of the server based on the actual identity identifier and the reference identity identifier, and generate a verification result of the actual upgrade file when the timeliness, authenticity and legitimacy are all verified; An upgrade module is used for caching the running file in the target storage space to the backup storage space of the coal mine sensor in response to the verification result indicating that the actual upgrade file has passed the verification, erasing the running file in the target storage space, and caching the actual upgrade file to the target storage space of the coal mine sensor, so that the coal mine sensor is upgraded based on the actual upgrade file, wherein the running file refers to the file currently running by the coal mine sensor, and in the process of upgrading the coal mine sensor based on the actual upgrade file, monitoring whether the upgrade process of the coal mine sensor is abnormal, and when the upgrade process of the coal mine sensor is abnormal, controlling the running file in the backup storage space to continue running.
