A register address acquisition method, device, terminal and readable storage medium

By analyzing the data packets of the HMI system and the processing module, the PLC register address is directly determined, which solves the problem of low efficiency in obtaining PLC point table information in the existing technology, and efficient register address acquisition is realized, avoiding the comparison process of large data volume. .

CN113050992BActive Publication Date: 2024-11-26HANYUN TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202110258294.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-09
Publication Date
2024-11-26
Estimated Expiration
2041-03-09

AI Technical Summary

Technical Problem

When obtaining the point table information of the PLC, the prior art needs to traverse all registers or crack the encryption program, resulting in large amount of data, low acquisition efficiency and adverse consequences.

Method used

By grabbing data packets between the HMI system and the processing module, extracting request packets and reply packets, parsing the initial variable data, converting them into judgment data, comparing with the current page variable data, determining the register address of a specific variable, and avoiding obtaining All register data reduces the comparison workload.

Benefits of technology

It improves the efficiency of register address acquisition, reduces redundant data processing, avoids the risk of cracking encryption programs, and shortens the time to obtain PLC point table information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113050992B_ABST
    Figure CN113050992B_ABST
Patent Text Reader

Abstract

The present application provides a register address acquisition method, device, terminal and readable storage medium. When the method is implemented, the current page of an HMI system is selected, data messages between the HMI system and a processing module are captured, and a valid message pair including a request message and a response message is extracted from the data message; then, according to the communication protocol of the communication bus, initial variable data is extracted from the response message in the valid message pair, and the extracted initial variable data is parsed, and the initial variable data is converted into determination data consistent with the data type of the variable data; the address of the register that sends the determination data is parsed from the request message in the valid message pair; the determination data is compared with the variable data on the current page to determine the register address corresponding to the specific variable. The method does not need to obtain all the data of all the registers, reduces the acquisition of redundant data, and improves the acquisition efficiency of the register address.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a register address acquisition method, device, terminal and readable storage medium. Background Art

[0002] With the development of electronic information technology, the degree of industrial informatization is also constantly improving. In order to meet the needs of industrial informatization, it is necessary to make informatization and digital transformation of old equipment in factories.

[0003] PLC is a central processing module commonly used in industrial equipment. In the process of informatization and digitalization of old equipment, it is usually necessary to obtain the point table information of PLC. The point table information records the correspondence between the registers of PLC and the variables in the equipment.

[0004] To obtain the point table information of the PLC, two solutions are usually adopted: one is to traverse all registers, read the data in each register, process the data, and then analyze whether it is the data required by the customer; the other is to crack the encryption program of the PLC, the second step: monitor the running status of the PLC program, read the PLC program, analyze the program code, extract the data, and compare the extracted data with the variable value of the current page of the HMI system one by one, so as to determine the register address of the data required by the customer, and thus obtain the point table information. Summary of the invention

[0005] In view of this, an object of the present invention is to provide a register address acquisition method, device, terminal and readable storage medium.

[0006] The present invention is achieved in that:

[0007] A method for obtaining a register address comprises the following steps:

[0008] Selecting a current page of the HMI system, wherein the current page includes n variables and n variable data corresponding to the variables one by one; 1≤n;

[0009] Capture the data message between the HMI system and the processing module, and extract a valid message pair including a request message and a response message from the data message; the request message is a message including variable value information of a specific variable sent by the HMI system to the processing module, and the request message carries register information; the response message is the variable value information of the specific variable sent by the processing module; the variable value information carries initial variable data;

[0010] Extracting initial variable data from the response message in the valid message pair according to the communication protocol of the communication bus, parsing the extracted initial variable data, and converting the initial variable data into determination data consistent with the data type of the variable data;

[0011] Parsing the address of the register for sending the determination data from the request message in the valid message pair;

[0012] The determination data is compared with the variable data on the current page to determine the register address corresponding to the specific variable.

[0013] Preferably, in order to avoid the situation where two variable data are the same by chance when comparing a single determination data and the variable corresponding to the determination data cannot be determined, comparing the determination data with the variable data on the current page and determining the address of the register corresponding to the variable on the current page includes the following steps:

[0014] If the determination data changes synchronously with the variable data i on the current page, the address of the register sending the determination data is determined to be the register address corresponding to the variable i; 1≤i≤n.

[0015] Furthermore, parsing the extracted initial variable data and converting the initial variable data into determination data consistent with the data type of the variable data includes the following steps:

[0016] Determine the type of data type, set the data type to have m types in total; remove the first abnormal data type from the m data types, and determine p types of data types to be converted;

[0017] According to the type of data to be converted, the initial variable data is converted into p types of first conversion data;

[0018] According to the features of the p types of first conversion data and the current page variable, the second abnormal data type is eliminated from the p types of first conversion data to determine f types of second conversion data;

[0019] And compare the f types of second conversion data with the variable data of the current page one by one; if there is a variable data in the current page that changes synchronously with the second conversion data q, then the second conversion data q is determined as the judgment data; the second conversion data q is any one of the f types of second conversion data.

[0020] In some embodiments, extracting a valid message pair including a request message and a response message from the data message comprises the following steps:

[0021] Extracting a valid message from the data message, wherein the valid message is a message carrying register information or variable value information;

[0022] Determine the valid message carrying register information as a request message, and determine the valid message carrying variable value information as a response message;

[0023] According to the communication protocol of the communication bus, the request message and the response message are paired, and the request message and the response message that are successfully paired are valid message pairs.

[0024] In some embodiments, when pairing a request message and a response message according to the communication protocol of the communication bus, the request message and the response message are paired according to whether the pairing features of the request message and the response message match; the pairing features are byte length and keywords.

[0025] Specifically, the processing module is a PLC; the acquired register address is the register address of the PLC;

[0026] Get the PLC point table information based on the PLC register address and corresponding variables.

[0027] A register address acquisition device includes a page selection module, a message capture module, a first extraction module, a second extraction module, a parsing module, a conversion module, and a comparison module;

[0028] The page selection module is used to select the current page of the HMI system, and the current page includes n variables and n variable data corresponding to the variables one by one; 1≤n;

[0029] The message capture module is used to capture data messages between the HMI system and the processing module;

[0030] The first extraction module is used to extract a valid message pair including a request message and a response message from the data message; the request message is a message including variable value information of a request specific variable sent by the HMI system to the processing module, and the request message carries register information; the response message is the variable value information of the specific variable sent by the processing module; the variable value information carries initial variable data;

[0031] The second extraction module is used to extract the initial variable data from the response message in the valid message pair according to the communication protocol of the communication bus;

[0032] The parsing module is used to parse the extracted initial variable data; and parse the address of the register that sends the determination data from the request message in the valid message pair;

[0033] The conversion module is used to convert the initial variable data into determination data consistent with the data type of the variable data;

[0034] The comparison module is used to compare the determination data with the variable data on the current page to determine the register address corresponding to the specific variable.

[0035] Preferably, in some embodiments, the first extraction module includes a valid message extraction unit, a message classification unit and a pairing unit;

[0036] The valid message extraction unit is used to extract a valid message from the data message, wherein the valid message is a message carrying register information or variable value information;

[0037] The message classification unit is used to determine a valid message carrying register information as a request message, and determine a valid message carrying variable value information as a response message;

[0038] The pairing unit is used to pair the request message and the response message according to the communication protocol of the communication bus, and the request message and the response message that are successfully paired are a valid message pair.

[0039] A register address acquisition terminal comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor executes the computer program to enable the terminal to implement the above-mentioned register address acquisition method.

[0040] A readable storage medium includes a computer program. When the computer program is executed, the terminal device where the readable storage medium is located is controlled to execute the register address acquisition method.

[0041] The beneficial effects of the present invention are mainly:

[0042] The method provided in the present application only captures the data message corresponding to the variable on the current page of the HMI system, extracts the initial variable data corresponding to the variable and the register address sending the initial variable data from the data message, processes the initial variable data, and obtains the correspondence between the initial variable data and the variable on the current page by comparing the processed initial variable data with the variable data on the current page, parses the address of the register sending the initial variable data, and thus determines the address of the register corresponding to the variable on the current page; the method does not need to obtain all the data of all the registers, reduces the redundant data obtained, thereby reducing the workload of the subsequent comparison steps, and improves the efficiency of obtaining the register address; and does not need to crack the encryption program of the processing module, avoiding the adverse consequences caused by cracking the encryption program. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0044] Figure 1 A flowchart of a register address acquisition method provided by an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of the correspondence between register addresses, initial variable data and determination data provided in an embodiment of the present invention;

[0046] Figure 3 A flow chart of a variable value data conversion method provided by an embodiment of the present invention;

[0047] Figure 4 A flowchart of a method for extracting valid message pairs provided by an embodiment of the present invention;

[0048] Figure 5 A schematic diagram of the structure of a register address acquisition device provided by an embodiment of the present invention;

[0049] Figure 6 A schematic diagram of the structure of a first extraction module provided in an embodiment of the present invention;

[0050] Figure 7 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention.

[0051] In the figure: 110, page selection module; 120, message capture module; 130, first extraction module; 1301, valid message extraction unit; 1302, message classification unit; 1303, matching unit; 140, second extraction module; 150, analysis module; 160, conversion module; 170, comparison module; 200, terminal; 210, memory; 220, processor; 230, input unit; 240, display unit. DETAILED DESCRIPTION

[0052] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0053] In the process of informatization and digital transformation of old equipment, it is usually necessary to obtain the point table information of PLC. PLC is a central processing module commonly used in industrial equipment. PLC processes signals in equipment operation, such as speed, acceleration, pressure, set pressure, power on and off, and transmits them to the HMI system. The staff checks the variable data from the HMI system to determine whether the speed, acceleration, pressure, set pressure and other states are normal. The point table information records the correspondence between the registers of the PLC and the variables in the equipment. Only by determining the address of the register that sends the variable data can the program be edited and digital transformation be performed. For example, at the speed signal output end of the PLC, to install an intelligent speed monitoring device, it is necessary to first determine the address of the register that sends the speed data and send the speed data to the intelligent speed monitoring device.

[0054] It can be seen that in the intelligentization and transformation of old equipment, it is only necessary to determine the address of the register corresponding to the required specific variable. There are two existing solutions: one is to traverse all registers, read the data in each register, process the data, and then analyze whether it is the variable data of the required specific variable; the other is to crack the encryption program of the PLC, the second step: monitor the running status of the PLC program, read the PLC program, analyze the program code, extract the data, and compare the extracted data with the variable data of the current page of the HMI system one by one, so as to determine the variable data of the required specific variable, and then determine the register address of the variable data, so as to obtain the point table information.

[0055] It can be seen that in the existing solutions, a large amount of redundant data irrelevant to the specific variables required will be obtained. Taking Siemens PLC200 as an example, there are 8,000 registers. In addition to storing the initial variable data of variables such as speed, these registers also store a large amount of intermediate data in the process of converting variable signals into initial variable data.

[0056] However, the actual required speed data is only dozens, and the existing method will obtain thousands of redundant data. In the process of comparing these redundant data with the variable data on the current page of the HMI system, the amount of calculation is extremely huge, and the cycle of obtaining PLC point table information is long (one device requires two technicians to invest 2-3 days).

[0057] In view of the above-mentioned problem that too much redundant data is obtained, resulting in a large amount of calculation in the comparison process and a long period for obtaining PLC point table information, the inventor of the present application believes that the following register address acquisition method can be used to solve the problem.

[0058] like Figure 1 As shown, the register address acquisition method includes the following steps:

[0059] S101, selecting a current page of the HMI system, wherein the current page includes n variables and n variable data corresponding to the variables one by one; 1≤n;

[0060] S102, capturing data messages between the HMI system and the processing module, and extracting a valid message pair including a request message and a response message from the data message; the request message is a message including variable value information of a request specific variable sent by the HMI system to the processing module, and the request message carries register information; the response message is variable value information of a specific variable sent by the processing module; the variable value information carries initial variable data;

[0061] S103, extracting initial variable data from the response message in the valid message pair according to the communication protocol of the communication bus, parsing the extracted initial variable data, and converting the initial variable data into determination data consistent with the data type of the variable data;

[0062] S104, parsing the request message in the valid message pair to obtain an address of a register for sending the determination data;

[0063] S105, comparing the determination data with the variable data on the current page to determine the register address corresponding to the specific variable.

[0064] In step S101, the variables displayed in the HMI system may be located on multiple pages, and each page displays several variables and variable data corresponding to the variables. After determining the current page, the address of the corresponding register of one or more variables among the n variables on the current page is obtained through subsequent steps. The corresponding register of the variable refers to the register that sends the initial data of the variable. The initial data of the variable is processed by the HMI system to obtain the variable data and displayed on the current page.

[0065] When step S102 is implemented, the data message between the HMI system and the processing module is formed during the normal operation of the device. The transmission process of the data message during normal operation is as follows: when the HMI system needs to display the variable data of certain specific variables (such as speed, acceleration, pressure, set pressure, power on / off), a request message is sent to the processing module, and the request message carries register information; when the processing module receives the request message, it reads the variable value information stored in the corresponding register according to the register information, and sends the variable value information as a response message to the HMI system. The HMI system extracts the initial variable data in the variable value information and converts it into variable data.

[0066] Therefore, the data message between the HMI system and the processing module can be captured by the data capture module, and the data message includes the request message and the response message corresponding to the specific variables (speed, acceleration, pressure, set pressure, power on / off). And the number of captured data messages is roughly equivalent to the number of specific variables (speed, acceleration, pressure, set pressure, power on / off).

[0067] Valid message pairs are extracted from the captured data messages, such as a speed request message and a speed response message, an acceleration request message and an acceleration response message, and a pressure request message and a pressure response message.

[0068] Step S103, when the device is operating normally, in order to complete the communication between the HMI system and the processing module, the response message and the request message need to be packaged into a certain format according to the communication protocol. Therefore, according to the communication protocol, the initial variable data is extracted from the response message in the valid message pair.

[0069] The extracted initial variable data are parsed and converted into determination data consistent with the data type of the variable data, wherein the number of the determination data is approximately equal to the number of the specific variables.

[0070] like Figure 2 As shown, a schematic diagram of the correspondence between register addresses, initial variable data and determination data is given. The data corresponding to the first row of each register address is the initial variable data, and the data corresponding to the second row is the determination data. There is a correspondence between the determination data and the register address. As long as the specific variable corresponding to the determination data can be determined, the register address corresponding to the specific variable can be determined.

[0071] like Figure 3 As shown, specifically, parsing the extracted initial variable data and converting the initial variable data into determination data consistent with the data type of the variable data can be performed in the following manner;

[0072] Step S1031, determine the type of data type, set the data type to have m types; Figure 2 As shown, in this embodiment, combined with the characteristics of specific variables (speed, acceleration, pressure, set pressure, power on / off), the data types are determined to be i8, u8, i16, u16, i32, u32, and float;

[0073] Step S1032, remove the first abnormal data type from the m data types, and determine p data types to be converted; if the initial variable data corresponding to the register address DB1.20 is 0x3f 0x8c 0xcc 0xcd, 0x3f 0x8c 0xcc 0xcd cannot be int / unsigned int type data, then int / unsigned int type is removed. The data type to be converted is float, and there is only one type.

[0074] Step S1033, converting the initial variable data into p kinds of first conversion data according to the type of the data to be converted;

[0075] Step S1034, according to the features of the p types of first conversion data and the current page variable, remove the second abnormal data type from the p types of first conversion data to determine f types of second conversion data;

[0076] The characteristics of the current page variable include the scope of the variable data of the variable.

[0077] Step S1035, and compare the f types of second conversion data with the variable data of the current page one by one; if there is a variable data in the current page that changes synchronously with the second conversion data q, then the second conversion data q is determined as the judgment data; the second conversion data q is any one of the f types of second conversion data.

[0078] Step S104: parse the request message in the valid message pair to obtain the address of the register used to send the determination data.

[0079] Therefore, step S105 determines the specific variable corresponding to the determination data by comparing the determination data with the variable data on the current page, thereby determining the register address corresponding to the specific variable.

[0080] Since the number of determination data is roughly equal to the specific number, the redundant data to be acquired is reduced, thereby reducing the workload of subsequent comparison steps and improving the efficiency of register address acquisition.

[0081] It should be noted that in the specific implementation process, due to errors in the data capture process, such as a register address is too far or the operation speed is slow, when the data message is captured, the response message has not been sent. At this time, there is no request message matching the response message in the data message. The number of determination data is roughly equivalent to the number of specific variables rather than one-to-one correspondence.

[0082] Specifically, the data message between the HMI system and the processing module is captured during the operation of the processing module and the HMI system. The device does not need to perform additional operations (such as traversing registers), does not affect the normal operation of the device, and ensures the production efficiency of the factory.

[0083] Since data capture and device operation are carried out simultaneously, the process of obtaining the register address of a specific variable using the register address acquisition method described in the present invention is dynamic. In the specific implementation process, data messages are captured multiple times and subsequent steps are performed to reduce the error rate in the data capture process and ensure that the register address of a specific variable can be obtained.

[0084] Furthermore, the step S105 of comparing the determination data with the variable data on the current page to determine the address of the register corresponding to the variable on the current page can be implemented by the following steps:

[0085] If the determination data changes synchronously with the variable data i on the current page, the address of the register sending the determination data is determined to be the register address corresponding to the variable i; 1≤i≤n.

[0086] Because the process of obtaining the register address of a specific variable by the register address acquisition method described in the present invention is dynamic, a comparison time can be set. The comparison time is relatively long. Only when the judgment data changes synchronously with the variable data i on the current page within the comparison time, the specific variable corresponding to the judgment data is determined to be variable i, and then the corresponding register address of the variable i is determined. This avoids the situation where two variable data are accidentally the same when comparing a single judgment data and the variable corresponding to the judgment data cannot be determined. It also avoids the situation where a single judgment data is only accidentally the same as the variable data i, thereby reducing the error when obtaining the register address and improving the accuracy of register address acquisition.

[0087] In the communication process between the HMI system and the processing module, in addition to the request-response process, for some models of PLC, such as s7-200, the communication protocol will add the following messages to ensure the communication quality. These messages contain neither register information nor initial variable data, and are invalid messages for this method. Figure 4 As shown, in step S102, extracting a valid message pair including a request message and a response message from the data message includes the following steps:

[0088] Step S1021, extracting a valid message from the data message, wherein the valid message is a message carrying register information or variable value information;

[0089] Step S1022, determining the valid message carrying the register information as the request message, and determining the valid message carrying the variable value information as the response message;

[0090] Step S1023, according to the communication protocol of the communication bus, the request message and the response message are paired, and the successfully paired request message and response message are valid message pairs. The purpose of extracting valid message pairs is to determine the correspondence between the initial variable data and the register that sends the initial variable data in multiple request messages and multiple response messages.

[0091] Specifically, the processing module is a PLC; the register address obtained is the register address of the PLC; according to the register address of the PLC and the corresponding variables, the PLC point table information is obtained. It is suitable for informatization and digital transformation of old equipment in factories. For example, after obtaining the addresses of the registers corresponding to the speed, acceleration, pressure, set pressure, and power on / off, an intelligent monitoring system can be installed on the PLC, and the initial variable data of the speed, acceleration, pressure, set pressure, and power on / off can be input into the intelligent monitoring system, so as to realize modern monitoring of the speed, acceleration, pressure, set pressure, and power on / off in real time.

[0092] Specifically, in this embodiment, when pairing a request message and a response message according to the communication protocol of the communication bus, such as the PPI protocol, the request message and the response message are paired according to whether the pairing features of the request message and the response message match; the pairing features are byte length and keywords.

[0093] Different communication protocols have different ways of pairing request messages and response messages. Some communication protocols can pair them through timestamps.

[0094] In this embodiment, a register address acquisition device is also provided. Figure 5 As shown, it includes a page selection module, a message capture module, a first extraction module, a second extraction module, a parsing module, a conversion module, and a comparison module;

[0095] The page selection module is used to select the current page of the HMI system, and the current page includes n variables and n variable data corresponding to the variables one by one; 1≤n;

[0096] The message capture module is used to capture data messages between the HMI system and the processing module;

[0097] The first extraction module is used to extract a valid message pair including a request message and a response message from the data message; the request message is a message including variable value information of a request specific variable sent by the HMI system to the processing module, and the request message carries register information; the response message is the variable value information of the specific variable sent by the processing module; the variable value information carries initial variable data;

[0098] The second extraction module is used to extract the initial variable data from the response message in the valid message pair according to the communication protocol of the communication bus;

[0099] The parsing module is used to parse the extracted initial variable data; and parse the address of the register that sends the determination data from the request message in the valid message pair;

[0100] The conversion module is used to convert the initial variable data into determination data consistent with the data type of the variable data;

[0101] The comparison module is used to compare the determination data with the variable data on the current page to determine the register address corresponding to the specific variable.

[0102] like Figure 6 As shown, in some embodiments, the first extraction module includes a valid message extraction unit, a message classification unit and a pairing unit;

[0103] The valid message extraction unit is used to extract a valid message from the data message, wherein the valid message is a message carrying register information or variable value information;

[0104] The message classification unit is used to determine a valid message carrying register information as a request message, and determine a valid message carrying variable value information as a response message;

[0105] The pairing unit is used to pair the request message and the response message according to the communication protocol of the communication bus, and the request message and the response message that are successfully paired are a valid message pair.

[0106] like Figure 7 As shown, this embodiment provides a register address acquisition terminal, including a memory and a processor, the memory is used to store a computer program, and the processor executes the computer program to enable the terminal to implement the above-mentioned register address acquisition method.

[0107] The memory may include a high-speed random access memory, and may also include a non-volatile memory (eg, at least one disk storage device, flash memory device, or other volatile solid-state storage device). The memory may provide instructions and data to the processor 601 .

[0108] The terminal also includes an input unit and a display unit. The input unit is used to receive various instructions or parameters (such as the name of the edited variable) input by the user, including a mouse, keyboard, touch panel and other input devices. The display unit is used to display various information of the terminal (including the acquired register address, initial variable data, judgment data, variables), including a display panel.

[0109] A readable storage medium is also provided herein, wherein the readable storage medium includes a computer program, and when the computer program is executed, the terminal device where the readable storage medium is located is controlled to execute the register address acquisition method.

[0110] The readable storage medium may be any available medium that can be accessed by the terminal device 10 (e.g., a personal computer, a server, etc.) or a data storage device such as a server or a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc., which can store program codes.

[0111] To summarize, in the register address acquisition method, device, terminal and readable storage medium provided in the embodiments of the present application, the register address acquisition method and device, when searching for the address of the register corresponding to the variable of the current page, only captures the data message related to the request message sent by the current page, and extracts the variable value data and register address corresponding to the variable. There is no need to obtain all the data of all the registers, which reduces the acquisition of redundant data, thereby reducing the workload of the subsequent comparison steps and improving the efficiency of register address acquisition.

[0112] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or modules can be electrical, mechanical or other forms.

[0113] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0114] In addition, each functional module in the embodiments provided in the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0115] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0116] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0117] Finally, it should be noted that the above embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the aforementioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A register address acquisition method, characterized in that: The following steps are involved: Selecting a current page of the HMI system, wherein the current page includes n variables and n variable data corresponding to the variables one by one; 1≤n; Capture the data message between the HMI system and the processing module, and extract a valid message pair including a request message and a response message from the data message; the request message is a message including variable value information of a specific variable sent by the HMI system to the processing module, and the request message carries register information; the response message is the variable value information of the specific variable sent by the processing module; the variable value information carries initial variable data; Extracting initial variable data from the response message in the valid message pair according to the communication protocol of the communication bus, parsing the extracted initial variable data, and converting the initial variable data into determination data consistent with the data type of the variable data; Parsing the address of the register for sending the determination data from the request message in the valid message pair; Comparing the determination data with the variable data on the current page to determine the register address corresponding to the specific variable; Parsing the extracted initial variable data and converting the initial variable data into determination data consistent with the data type of the variable data includes the following steps: Determine the type of data type, set the data type to have m types in total; remove the first abnormal data type from the m data types, and determine p types of data types to be converted; According to the type of data to be converted, the initial variable data is converted into p types of first conversion data; According to the features of the p types of first conversion data and the current page variable, the second abnormal data type is eliminated from the p types of first conversion data to determine f types of second conversion data; and comparing the f types of second conversion data with the variable data of the current page one by one; if there is a variable data on the current page that changes synchronously with the second conversion data q, then determining the second conversion data q as the determination data; The second conversion data q is any one of the f types of second conversion data.

2. The register address acquisition method according to claim 1, characterized in that: Comparing the determination data with the variable data on the current page to determine the address of the register corresponding to the variable on the current page includes the following steps: If the determination data changes synchronously with the variable data i on the current page, the address of the register sending the determination data is determined to be the register address corresponding to the variable i; 1≤i≤n.

3. The register address acquisition method according to claim 1, characterized in that: Extracting a valid message pair including a request message and a response message from the data message comprises the following steps: Extracting a valid message from the data message, wherein the valid message is a message carrying register information or variable value information; Determine the valid message carrying register information as a request message, and determine the valid message carrying variable value information as a response message; According to the communication protocol of the communication bus, the request message and the response message are paired, and the request message and the response message that are successfully paired are valid message pairs.

4. The register address acquisition method according to claim 1, characterized in that: When pairing a request message and a response message according to the communication protocol of the communication bus, the request message and the response message are paired according to whether the pairing features of the request message and the response message match; the pairing features are byte length and keywords.

5. The register address acquisition method according to any one of claims 1 to 4, characterized in that: The processing module is a PLC; the acquired register address is the register address of the PLC; Get the PLC point table information based on the PLC register address and corresponding variables.

6. A register address acquisition device, characterized in that: It includes a page selection module, a message grabbing module, a first extraction module, a second extraction module, a parsing module, a conversion module, and a comparison module; The page selection module is used to select the current page of the HMI system, and the current page includes n variables and n variable data corresponding to the variables one by one; 1≤n; The message capture module is used to capture data messages between the HMI system and the processing module; The first extraction module is used to extract a valid message pair including a request message and a response message from the data message; the request message is a message including variable value information of a request specific variable sent by the HMI system to the processing module, and the request message carries register information; the response message is the variable value information of the specific variable sent by the processing module; the variable value information carries initial variable data; The second extraction module is used to extract the initial variable data from the response message in the valid message pair according to the communication protocol of the communication bus; The conversion module is used to convert the initial variable data into determination data consistent with the data type of the variable data; The parsing module is used to parse the extracted initial variable data; and parsing the address of the register for sending the determination data from the request message in the valid message pair; The comparison module is used to compare the determination data with the variable data on the current page to determine the register address corresponding to the specific variable; Parsing the extracted initial variable data and converting the initial variable data into determination data consistent with the data type of the variable data includes the following steps: Determine the type of data type, set the data type to have m types in total; remove the first abnormal data type from the m data types, and determine p types of data types to be converted; According to the type of data to be converted, the initial variable data is converted into p types of first conversion data; According to the features of the p types of first conversion data and the current page variable, the second abnormal data type is eliminated from the p types of first conversion data to determine f types of second conversion data; and comparing the f types of second conversion data with the variable data of the current page one by one; if there is a variable data on the current page that changes synchronously with the second conversion data q, then determining the second conversion data q as the determination data; The second conversion data q is any one of the f types of second conversion data.

7. The register address acquisition device according to claim 6, characterized in that: The first extraction module includes a valid message extraction unit, a message classification unit and a pairing unit; The valid message extraction unit is used to extract a valid message from the data message, wherein the valid message is a message carrying register information or variable value information; The message classification unit is used to determine a valid message carrying register information as a request message, and determine a valid message carrying variable value information as a response message; The pairing unit is used to pair the request message and the response message according to the communication protocol of the communication bus, and the request message and the response message that are successfully paired are a valid message pair.

8. A register address acquisition terminal, characterized in that: The method comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor executes the computer program so that the terminal implements the register address acquisition method described in any one of claims 1 to 5.

9. A readable storage medium, characterized in that: The readable storage medium includes a computer program, and when the computer program is executed, the terminal device where the readable storage medium is located is controlled to execute the register address acquisition method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Touch screen single page display method, touch screen and programmable logic controller

    CN107450829A

  • Nvme-based data reading method, apparatus and system

    CN111095231A

  • Data processing method and device for realizing cross-domain request at webpage end and related equipment

    CN111666514A

  • Method for improving modbus equipment collection efficiency of gateway

    CN111884915A

  • Data processing method and system based on PLC, electronic equipment and storage medium

    CN112269351A