A data forwarding method based on Mine Hong configuration system
Through the data forwarding method based on the Minhong configuration system, the problems of complex and poor flexibility of data forwarding in traditional Minhong application development are solved, and flexible, high reusable and low-cost data forwarding effects are achieved.
Patent Information
- Application Number
- CN202410732771.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-06-07
AI Technical Summary
In traditional Mining Application Development, the forwarding process of lower-level computer data is complex, has poor flexibility, and requires customized development, resulting in high development costs and low reusability.
Using the data forwarding method based on the Minhong configuration system, create data sources through the Minhong configuration editor, configure forwarding rules, generate configuration files, and initialize device objects and data rule objects through the configuration application, dynamically create device connections and monitor Request instructions and perform validity detection and parsing.
It realizes the flexibility and high reusability of data forwarding, simplifies the development process, reduces costs, avoids instruction squeezing and blocking, and enhances the compatibility and verification rigor of data parsing.
Smart Images

Figure CN118449987B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial control technology, and in particular to a data forwarding method based on a mining configuration system. Background Art
[0002] Regarding the external data forwarding process of the Mine Hong application, in the traditional application development of the Mine Hong application, how to forward the data of the lower computer to the upper access device through the protocol in a convenient and flexible way, the configuration mode data forwarding protocol provides a convenient and fast setting interface, the setting process is quick and convenient, and the data rules can be customized. Compared with the traditional development mode that requires customized development and adjustment, the configuration mode data forwarding protocol achieves the effects of high efficiency, stability, high flexibility, strong reusability and low cost in the field of Mine Hong data protocol forwarding, and the traditional communication access to the device is to create objects in the code according to the needs, which has poor flexibility. Summary of the invention
[0003] The purpose of the present invention is to propose a data forwarding method based on a mining configuration system in view of the problems existing in the background technology.
[0004] The technical solution of the present invention is a data forwarding method based on the mining configuration system, comprising:
[0005] The Kuanghong configuration editor interface creates the Kuanghong configuration data source of the target configuration;
[0006] Configure the forwarding rules of the mining configuration data source to obtain a configuration file for data forwarding, wherein the forwarding rules include accessing the data access format provided by the target mining device and simulating the relationship between externally accessing the address of the target mining device and memory variables;
[0007] The mining configuration application imports the data forwarding configuration file, and initializes the target mining device object and data rule object based on the data forwarding configuration file, thereby obtaining the target mining device configuration;
[0008] Dynamically create a device object connected to the target mining device based on the configuration of the target mining device, start the target mining device and periodically monitor the request instructions transmitted by the host computer, thereby obtaining a plurality of the request instructions, splice the plurality of the request instructions to obtain the spliced request instructions, and calculate the unit time slice of the cyclic monitoring of the host computer based on the baud rate of the mining configuration data source;
[0009] Performing a validity check on each of the spliced request instructions, and if the validity check fails, discarding the spliced request instructions;
[0010] If the validity check is qualified, the concatenated request instruction is parsed to obtain a corresponding request instruction object, and the request instruction object is added to the instruction request queue;
[0011] Popping the request instruction object from the instruction request queue, parsing the attributes and data forwarding protocol of the request instruction object to obtain feedback content, and if the feedback content is a modification instruction, encapsulating the modification instruction into a modification instruction object, and transmitting the modification instruction object to a downstream device, and the downstream device uses the modification instruction object as an execution parameter;
[0012] The downstream device replies to the requesting end with a reply of the modification instruction.
[0013] Preferably, the target configuration's mining configuration data source includes mining device serial number, device index, slave address, device IP address, Bluetooth identification number, baud rate and valid bits.
[0014] Preferably, the validity detection of each spliced request instruction includes:
[0015] Obtaining the request instruction, and detecting whether the station address of the request instruction is correct, if the station address of the request instruction is incorrect, the validity detection of the request instruction fails;
[0016] If the station address of the request instruction is correct, then detecting whether the function code of the request instruction is correct; if the function code of the request instruction is incorrect, then the validity detection of the request instruction fails;
[0017] If the function code of the request instruction is correct, then detecting whether the instruction length of the request instruction is correct; if the instruction length of the request instruction is incorrect, then the validity detection of the request instruction fails;
[0018] If the instruction length of the request instruction is correct, then detecting whether the verification code of the request instruction is correct; if the verification code of the request instruction is incorrect, then the validity detection of the request instruction fails;
[0019] If the verification code of the request instruction is correct, then check whether the starting address and the ending address of the request instruction are in a reasonable range. If the starting address and the ending address of the request instruction are not in a reasonable range, the validity check of the request instruction fails. Otherwise, the validity check of the request instruction passes.
[0020] Preferably, the device object connected to the target mining device is dynamically created based on the configuration of the target mining device, the target mining device is started and the request instruction transmitted by the host computer is periodically monitored, thereby obtaining a plurality of the request instructions, the plurality of the request instructions are spliced together to obtain the spliced request instructions, and the unit time slice of the cyclic monitoring of the host computer is calculated based on the baud rate of the mining configuration data source, including:
[0021] Determine whether the target mining device is started, and if the target mining device is started, obtain the request content of the target mining device within a unit time slice;
[0022] Determine whether the request content of the target mining device is not empty. If the request content of the target mining device is not empty, determine whether the request content of the target mining device conforms to the instruction format. If the request content of the target mining device conforms to the instruction format, clear the instruction fragment to be matched;
[0023] If the request content of the target mining device does not conform to the instruction format, the request content of the target mining device is spliced with the instruction to be matched to obtain a new request content, and it is determined whether the new request content conforms to the instruction format. If the new request content conforms to the instruction format, the instruction fragment to be matched is cleared, otherwise, the request content is updated in the cycle unit time slice;
[0024] The request content and the new request content are converted into a request instruction object, and the request instruction object is pushed into a request instruction queue, and the request instruction queue is updated while waiting for a cycle unit time slice.
[0025] Preferably, the request instruction object is popped from the instruction request queue, the attributes and data forwarding protocol of the request instruction object are parsed to obtain feedback content, if the feedback content is a modification instruction, the modification instruction is encapsulated as a modification instruction object, and the modification instruction object is transmitted to the downstream device, and the downstream device uses the modification instruction object as an execution parameter, including:
[0026] Determine whether the instruction object verification of the request instruction object passes, if the instruction object verification of the request instruction object fails, determine whether the station address of the request instruction object is correct, if the station address of the request instruction object is incorrect, do not feedback the request instruction object, otherwise, feedback error information;
[0027] If the instruction object verification of the request instruction object passes, determine whether the request instruction object is a query instruction; if the request instruction object is a query instruction, parse out the query range of the query instruction, find the corresponding variable according to the conversion rule, and splice the value of the variable into a feedback instruction format;
[0028] If the request instruction object is not a query instruction, determine whether the request instruction object is a single data unit modification, if the request instruction object is not a single data unit modification, find the storage unit set to be modified, and convert the storage unit set into an instruction variable array, and convert the instruction variable array into a configured variable assignment event set, and generate a feedback instruction code based on the variable assignment event set, and reply the feedback instruction to the request end based on the feedback instruction format and the feedback instruction code;
[0029] If the request instruction object is a single data unit modification, find the storage unit to be modified, organize the downstream modification instruction according to the data unit and the value to be modified, and determine whether the downstream modification instruction is executed successfully. If the downstream modification instruction is executed successfully, directly feedback the request instruction, otherwise, feedback error information.
[0030] Compared with the prior art, the above technical solution of the present invention has the following beneficial technical effects:
[0031] The present invention can customize the organization of mining data protocol rules according to the characteristics of the project, support multiple standard mining protocols for feedback to the other party, and the configuration method only needs to simply configure the data forwarding protocol rules on the interface, which is simple, flexible and convenient to operate, and the forwarding protocol class can adjust the parameters according to different needs without recompilation, so it has high reusability, and adopts a dual decoupled queue mode for request instructions and result feedback, and there will be no instruction squeezing and blocking process. In addition, the verification and judgment of the instructions are rigorous, and the data analysis compatibility is strong, which eliminates the situation where erroneous data leads to erroneous processing. Finally, no code development is required throughout the development process, and the operation processing process is a fully intelligent operation instead of the complex traditional development model. Operators do not need professional developers, so the cost and personnel will be greatly reduced compared with the traditional one. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A schematic flow chart of an overall method in an embodiment of the present invention;
[0033] Figure 2 A schematic diagram of a flow chart of the processing logic of a request instruction entering a request instruction queue in an embodiment of the present invention;
[0034] Figure 3 A schematic diagram of a flow chart of determining whether a request instruction is valid in an embodiment of the present invention;
[0035] Figure 4 A schematic diagram of a flow chart of obtaining instruction feedback according to a request instruction and a parsing rule in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] Embodiment 1, as Figure 1 As shown, the present invention proposes a data forwarding method based on a mining configuration system, comprising:
[0037] D01. Create the forwarded Kuanghong data source: Create the Kuanghong configuration data source of the target configuration in the Kuanghong configuration editor interface;
[0038] D02. Configure data forwarding rules: Configure the forwarding rules of the industrial control mining configuration data source to obtain the data forwarding configuration file. The industrial control forwarding rules include the data access format provided by the target mining device and the relationship between the simulated exposure of external access to the industrial control target mining device address and memory variables;
[0039] D03. Importing configuration rule files into the Mine Configuration Application: The Mine Configuration Application imports the configuration file of industrial control data forwarding, and initializes the industrial control target Mine Device object and data rule object based on the configuration file of industrial control data forwarding, thereby obtaining the industrial control target Mine Device configuration;
[0040] D04. Start device monitoring request instructions: dynamically create a device object connected to the industrial control target mining device based on the industrial control target mining device configuration, start the industrial control target mining device and regularly monitor the request instructions transmitted by the host computer, thereby obtaining multiple industrial control request instructions, splicing multiple industrial control request instructions to obtain spliced industrial control request instructions, and calculate the unit time slice of the cyclic monitoring of the host computer based on the baud rate of the industrial control mining configuration data source;
[0041] D05. Organize and verify instructions: Perform validity check on each spliced industrial control request instruction. If the validity check fails, the spliced industrial control request instruction will be discarded.
[0042] D06. Parse the request instruction and put it into the queue: If the validity test is qualified, parse the spliced industrial control request instruction to obtain the corresponding request instruction object, and add the industrial control request instruction object to the instruction request queue;
[0043] D07. Parse the request instruction to obtain feedback content: pop up the industrial control request instruction object from the industrial control instruction request queue, parse the attributes and data forwarding protocol of the industrial control request instruction object, and obtain feedback content. If the industrial control feedback content is a modification instruction, encapsulate the industrial control modification instruction into a modification instruction object, and transmit the industrial control modification instruction object to the downstream device. The industrial control downstream device uses the industrial control modification instruction object as an execution parameter.
[0044] D08. Reply to the request end with the command reply: The industrial control lower-end device replies to the request end with the reply of the industrial control modification command.
[0045] In the present invention, the request instruction object includes the verification result.
[0046] In an optional embodiment, the Bluetooth configuration data source of the industrial control target configuration includes the Bluetooth device serial number, device index, slave address, device IP address, Bluetooth identification number, baud rate and valid bits.
[0047] Embodiment 2, as Figure 2-4 As shown, the data forwarding method based on the mining configuration system proposed by the present invention, compared with the first embodiment, this embodiment also includes:
[0048] Industrial control performs validity checks on each spliced industrial control request instruction, including:
[0049] Obtaining an industrial control request instruction, and detecting whether the station address of the industrial control request instruction is correct. If the station address of the industrial control request instruction is incorrect, the validity detection of the industrial control request instruction fails;
[0050] If the station address of the industrial control request instruction is correct, then whether the function code of the industrial control request instruction is correct is detected; if the function code of the industrial control request instruction is incorrect, then the validity detection of the industrial control request instruction fails;
[0051] If the function code of the industrial control request instruction is correct, then whether the instruction length of the industrial control request instruction is correct is detected; if the instruction length of the industrial control request instruction is incorrect, then the validity detection of the industrial control request instruction fails;
[0052] If the instruction length of the industrial control request instruction is correct, then whether the verification code of the industrial control request instruction is correct is detected; if the verification code of the industrial control request instruction is incorrect, then the validity detection of the industrial control request instruction fails;
[0053] If the verification code of the industrial control request instruction is correct, then check whether the starting address and the ending address of the industrial control request instruction are in a reasonable range. If the starting address and the ending address of the industrial control request instruction are not in a reasonable range, the validity check of the industrial control request instruction fails. Otherwise, the validity check of the industrial control request instruction passes.
[0054] In an optional embodiment, the industrial control dynamically creates a device object connected to the industrial control target mining device based on the industrial control target mining device configuration, starts the industrial control target mining device and periodically monitors the request instructions transmitted by the host computer, thereby obtaining multiple industrial control request instructions, splicing the multiple industrial control request instructions to obtain spliced industrial control request instructions, and calculates the unit time slice of the host computer for cyclic monitoring based on the baud rate of the industrial control mining configuration data source, including:
[0055] Determine whether the industrial control target mining device is started. If the industrial control target mining device is started, obtain the request content of the industrial control target mining device within a unit time slice;
[0056] Determine whether the request content of the industrial control target mining device is not empty. If the request content of the industrial control target mining device is not empty, determine whether the request content of the industrial control target mining device conforms to the instruction format. If the request content of the industrial control target mining device conforms to the instruction format, clear the instruction fragment to be matched;
[0057] If the request content of the industrial control target mining device does not conform to the instruction format, the request content of the industrial control target mining device is spliced with the instruction to be matched to obtain a new request content, and it is determined whether the new request content of the industrial control conforms to the instruction format. If the new request content of the industrial control conforms to the instruction format, the instruction fragment to be matched is cleared, otherwise, the request content is updated in the cycle unit time slice;
[0058] The industrial control request content and the industrial control new request content are converted into request instruction objects, and the industrial control request instruction objects are pushed into the request instruction queue, and the industrial control request instruction queue is updated in the cycle unit time slice.
[0059] In an optional embodiment, the industrial control pops up the industrial control request instruction object from the industrial control instruction request queue, parses the attributes and data forwarding protocol of the industrial control request instruction object, and obtains feedback content. If the industrial control feedback content is a modification instruction, the industrial control modification instruction is encapsulated as a modification instruction object, and the industrial control modification instruction object is transmitted to the lower-end device. The industrial control lower-end device uses the industrial control modification instruction object as an execution parameter, including:
[0060] Determine whether the instruction object verification of the industrial control request instruction object passes. If the instruction object verification of the industrial control request instruction object fails, determine whether the station address of the industrial control request instruction object is correct. If the station address of the industrial control request instruction object is incorrect, do not feedback the industrial control request instruction object. Otherwise, feedback error information.
[0061] If the instruction object verification of the industrial control request instruction object passes, it is determined whether the industrial control request instruction object is a query instruction. If the industrial control request instruction object is a query instruction, the query range of the industrial control query instruction is parsed, and the corresponding variable is found according to the conversion rule, and the value of the industrial control variable is spliced into the feedback instruction format;
[0062] If the industrial control request instruction object is not a query instruction, determine whether the industrial control request instruction object is a single data unit modification. If the industrial control request instruction object is not a single data unit modification, find the storage unit set to be modified, convert the industrial control storage unit set into an instruction variable array, and convert the industrial control instruction variable array into a configured variable assignment event set, and generate a feedback instruction code based on the industrial control variable assignment event set, and reply the feedback instruction to the request end based on the industrial control feedback instruction format and the industrial control feedback instruction code;
[0063] If the industrial control request instruction object is a single data unit modification, then find the storage unit to be modified, organize the downstream modification instruction according to the data unit and the value to be modified, and determine whether the industrial control downstream modification instruction is executed successfully. If the industrial control downstream modification instruction is executed successfully, then directly feedback the request instruction, otherwise, feedback error information.
[0064] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited thereto, and various changes can be made within the knowledge scope of technicians in the relevant technical field without departing from the purpose of the present invention.
Claims
1. A data forwarding method based on the Mine Hong configuration system, characterized in that: include: The Kuanghong configuration editor interface creates the Kuanghong configuration data source of the target configuration; Configure the forwarding rules of the mining configuration data source to obtain a configuration file for data forwarding, wherein the forwarding rules include accessing the data access format provided by the target mining device and simulating the relationship between externally accessing the address of the target mining device and memory variables; The mining configuration application imports the data forwarding configuration file, and initializes the target mining device object and data rule object based on the data forwarding configuration file, thereby obtaining the target mining device configuration; Dynamically create a device object connected to the target mining device based on the configuration of the target mining device, start the target mining device and periodically monitor the request instructions transmitted by the host computer, thereby obtaining a plurality of the request instructions, splice the plurality of the request instructions to obtain the spliced request instructions, and calculate the unit time slice of the cyclic monitoring of the host computer based on the baud rate of the mining configuration data source; Performing a validity check on each of the spliced request instructions, and if the validity check fails, discarding the spliced request instructions; If the validity check is qualified, the concatenated request instruction is parsed to obtain a corresponding request instruction object, and the request instruction object is added to the instruction request queue; Popping the request instruction object from the instruction request queue, parsing the attributes and data forwarding protocol of the request instruction object to obtain feedback content, and if the feedback content is a modification instruction, encapsulating the modification instruction into a modification instruction object, and transmitting the modification instruction object to a downstream device, and the downstream device uses the modification instruction object as an execution parameter; The downstream device replies to the requesting end with a reply of the modification instruction.
2. According to claim 1, a data forwarding method based on a mining configuration system is characterized in that: The target configuration's mining configuration data source includes the mining device serial number, device index, slave address, device IP address, Bluetooth identification number, baud rate and valid bits.
3. According to claim 1, a data forwarding method based on a mining configuration system is characterized in that: The validity detection of each spliced request instruction includes: Obtaining the request instruction, and detecting whether the station address of the request instruction is correct, if the station address of the request instruction is incorrect, the validity detection of the request instruction fails; If the station address of the request instruction is correct, then detecting whether the function code of the request instruction is correct; if the function code of the request instruction is incorrect, then the validity detection of the request instruction fails; If the function code of the request instruction is correct, then detecting whether the instruction length of the request instruction is correct; if the instruction length of the request instruction is incorrect, then the validity detection of the request instruction fails; If the instruction length of the request instruction is correct, then detecting whether the verification code of the request instruction is correct; if the verification code of the request instruction is incorrect, then the validity detection of the request instruction fails; If the verification code of the request instruction is correct, then check whether the starting address and the ending address of the request instruction are in a reasonable range. If the starting address and the ending address of the request instruction are not in a reasonable range, the validity check of the request instruction fails. Otherwise, the validity check of the request instruction passes.
4. According to claim 1, a data forwarding method based on a mining configuration system is characterized in that: The device object connected to the target mining device is dynamically created based on the configuration of the target mining device, the target mining device is started and the request instruction transmitted by the host computer is periodically monitored, thereby obtaining a plurality of the request instructions, the plurality of the request instructions are spliced together to obtain the spliced request instructions, and the unit time slice of the cyclic monitoring of the host computer is calculated based on the baud rate of the mining configuration data source, including: Determine whether the target mining device is started, and if the target mining device is started, obtain the request content of the target mining device within a unit time slice; Determine whether the request content of the target mining device is not empty. If the request content of the target mining device is not empty, determine whether the request content of the target mining device conforms to the instruction format. If the request content of the target mining device conforms to the instruction format, clear the instruction fragment to be matched; If the request content of the target mining device does not conform to the instruction format, the request content of the target mining device is spliced with the instruction to be matched to obtain a new request content, and it is determined whether the new request content conforms to the instruction format. If the new request content conforms to the instruction format, the instruction fragment to be matched is cleared, otherwise, the request content is updated in the cycle unit time slice; The request content and the new request content are converted into a request instruction object, and the request instruction object is pushed into a request instruction queue, and the request instruction queue is updated while waiting for a cycle unit time slice.
5. According to a data forwarding method based on the mining configuration system of claim 1, it is characterized in that: The request instruction object is popped from the instruction request queue, and the attributes and data forwarding protocol of the request instruction object are parsed to obtain feedback content. If the feedback content is a modification instruction, the modification instruction is encapsulated into a modification instruction object, and the modification instruction object is transmitted to the downstream device, and the downstream device uses the modification instruction object as an execution parameter, including: Determine whether the instruction object verification of the request instruction object passes, if the instruction object verification of the request instruction object fails, determine whether the station address of the request instruction object is correct, if the station address of the request instruction object is incorrect, do not feedback the request instruction object, otherwise, feedback error information; If the instruction object verification of the request instruction object passes, determine whether the request instruction object is a query instruction; if the request instruction object is a query instruction, parse out the query range of the query instruction, find the corresponding variable according to the conversion rule, and splice the value of the variable into a feedback instruction format; If the request instruction object is not a query instruction, determine whether the request instruction object is a single data unit modification, if the request instruction object is not a single data unit modification, find the storage unit set to be modified, and convert the storage unit set into an instruction variable array, and convert the instruction variable array into a configured variable assignment event set, and generate a feedback instruction code based on the variable assignment event set, and reply the feedback instruction to the request end based on the feedback instruction format and the feedback instruction code; If the request instruction object is a single data unit modification, find the storage unit to be modified, organize the downstream modification instruction according to the data unit and the value to be modified, and determine whether the downstream modification instruction is executed successfully. If the downstream modification instruction is executed successfully, directly feedback the request instruction, otherwise, feedback error information.
Citation Information
Patent Citations
Coal mine underground multi-system fusion linkage control relationship configuration method and linkage intelligent gateway
CN111049936A
Industrial control system communication method and device, computer equipment and storage medium
CN112073470A
Protocol analysis method and device and computer readable storage medium
CN114640727A
Remote communication method and device, equipment and storage medium
CN116647588A
Hong-mine system-based configuration system
CN117908868A
