Data processing method and device, electronic equipment and storage medium
By awakening the virtual programmable logic controller module in the slave station, dynamically determining the logical operation algorithm and processing data, the problem of slave station responding to static data is solved, and more flexible and efficient data processing and calculation is achieved.
Patent Information
- Application Number
- CN202411810980.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, slaves can only respond based on predefined static data, lack dynamic adaptability, affecting the real-time calculation and interaction efficiency of data.
By responding to the data processing instructions issued by the master station, the virtual programmable logic controller module in the slave station is awakened, the logical operation algorithm is dynamically determined, and the pending data is obtained according to the instructions for processing, generating target data and reply messages.
The slave station dynamically determines the logical operation algorithm according to data processing instructions, improves the flexibility of calculation and data processing, avoids the defects based on static data response, and improves the real-time calculation and interaction efficiency of data.
Smart Images

Figure CN119758899A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial control technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art
[0002] In industrial automation applications, commonly used communication protocols include IEC60870-5-104 (abbreviated as 104) protocol, OPC Unified Architecture (OPC UA) protocol and Modbus protocol. These protocols all adopt the master-slave (also known as slave) communication mode, that is, the master initiates a request or command, and the slave responds to it; some protocols also support the slave to actively push data to the master. In the application, these communication protocols require the master and the slave to negotiate and predefine the data area in advance to clarify the location, length and meaning of each data item (a data item implies N elements that constitute the data element in the protocol, for example: Modbus protocol, elements include function code, register address, target data type; 104 protocol, elements include ASDU and information object address; OPC UA, elements include Node ID, target data type; other protocols are similar). However, when the actual program is running, after the master initiates a request or command, the slave can only respond based on predefined static data, lacking dynamic adaptability, thus affecting the real-time calculation and interaction efficiency of the data. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a data processing method, device, electronic device and storage medium to solve the problem in the prior art that the slave station can only respond based on predefined static data, lacks dynamic adaptability, and affects the real-time calculation and interaction efficiency of data.
[0004] According to a first aspect of an embodiment of the present application, a data processing method is provided, the method comprising: in response to a data processing instruction issued by a master station, waking up a virtual programmable logic controller module independently set in a slave station, and determining a logic operation algorithm from the virtual programmable logic controller module according to the data processing instruction; obtaining data to be processed according to the data processing instruction, and processing the data to be processed based on the logic operation algorithm to generate target data; generating a response message according to the target data, and transmitting the response message to the master station.
[0005] According to a second aspect of an embodiment of the present application, a data processing device is provided, which includes: a determination module, which is used to respond to a data processing instruction issued by a master station, wake up a virtual programmable logic controller module independently set in a slave station, and determine a logic operation algorithm from the virtual programmable logic controller module according to the data processing instruction; a logic module, which is used to obtain data to be processed according to the data processing instruction, and process the data to be processed based on the logic operation algorithm to generate target data; a message module, which is used to generate a response message according to the target data, and transmit the response message to the master station.
[0006] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0007] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0008] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the method of the embodiments of the present application responds to the data processing instruction issued by the master station, wakes up the independently arranged virtual programmable logic controller module in the slave station, and determines the logic operation algorithm from the virtual programmable logic controller module according to the data processing instruction; obtains the data to be processed according to the data processing instruction, and processes the data to be processed based on the logic operation algorithm to generate target data; generates a response message according to the target data, and transmits the response message to the master station. In the scheme provided by the present application, the slave station determines the logic operation algorithm according to the data processing instruction, realizes the dynamic determination of the logic operation algorithm, and enables the slave station to calculate and process data more flexibly, avoiding the problem in the related technology that the slave station can only respond based on predefined static data, lacks dynamic adaptability, and affects the real-time calculation and interaction efficiency of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 It is a flowchart of a data processing method provided in an embodiment of the present application;
[0011] Figure 2 It is a basic flow chart of a data processing method provided by an embodiment of the present application;
[0012] Figure 3 It is a flowchart of another data processing method provided in an embodiment of the present application;
[0013] Figure 4 It is a flowchart of another data processing method provided in an embodiment of the present application;
[0014] Figure 5 It is a flowchart of another data processing method provided in an embodiment of the present application;
[0015] Figure 6 It is a flowchart of another data processing method provided in an embodiment of the present application;
[0016] Figure 7 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0017] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0019] A data processing method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0020] Figure 1 This is a data processing method provided by an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0021] S101, waking up a virtual programmable logic controller module independently provided in a slave station in response to a data processing instruction issued by a master station, and determining a logic operation algorithm from the virtual programmable logic controller module according to the data processing instruction;
[0022] S102, acquiring the data to be processed according to the data processing instruction, and processing the data to be processed based on the logic operation algorithm to generate target data;
[0023] S103: Generate a response message according to the target data, and transmit the response message to the master station.
[0024] It can be understood that the data processing method provided in the present application is applicable to the communication protocol of the master-slave communication mode of industrial automation applications, wherein the data processing method provided in the present application is applied to the slave.
[0025] Specifically, the master station sends the data processing instruction to the slave station through the communication protocol. Exemplarily, taking the communication protocol as the 104 protocol as an example, the 104 master station completes the data interaction with the 104 slave station through the 104 protocol to achieve the sending of the data processing instruction to the 104 slave station. Taking the communication protocol as the OPC UA protocol as an example, the OPC UA master station completes the data interaction with the OPC UA slave station through the OPC UA protocol to achieve the sending of the data processing instruction to the OPC UA slave station; taking the communication protocol as the Modbus protocol as an example, the Modbus master station completes the data interaction with the Modbus slave station through the Modbus protocol to achieve the sending of the data processing instruction to the Modbus slave station.
[0026] It can be understood that the above-mentioned data processing instruction may be a control command issued by the master station, and the above-mentioned data processing instruction may also be a data transfer command issued by the master station.
[0027] It can be understood that an independently set virtual programmable logic controller module (Programmable logic controller, PLC) (also known as a soft PLC module) is set in the slave station. After receiving the data processing instruction, the slave station will wake up the independently set virtual programmable logic controller module in the slave station, and determine the logic operation algorithm from the virtual programmable logic controller module according to the data processing instruction; when not awakened, the soft PLC in the slave station is in a dormant state, achieving the effect of saving resources, and the slave station receives the data processing instruction sent by the master station; wherein, after receiving the data processing instruction, the slave station parses the data processing instruction to obtain the data parameter, and then the slave station obtains the data to be processed corresponding to the data parameter from its own storage area or the connected physical programmable logic controller device according to the data parameter. Exemplarily, after parsing the data processing instruction, the slave station obtains the data parameter, and the data parameter is the real-time speed of the physical PLC device, and the slave station obtains the real-time speed from the physical PLC device as the data to be processed.
[0028] In some examples, the present application also determines a logical operation algorithm based on a data processing instruction, wherein the data processing instruction carries a target logical operation data item value for indicating the logical operation algorithm, and different target logical operation data item values correspond to different logical operation algorithms.
[0029] It can be understood that the present application sets up a plurality of different logic operation algorithms in the soft PLC set up in the slave station (the user can set the logic operation algorithm contained in the soft PLC according to actual needs); it can be understood that the slave station can be divided into three configurable areas, namely IOM, OM, and IM, where IOM is a readable and writable area, OM is a writable area, and IM is a readable area. The soft PLC is used to implement logical management calculations and access to the three areas of IOM, OM, and IM.
[0030] In some examples, after determining the logical operation algorithm, the present application processes the data to be processed according to the logical operation algorithm to generate target data. For example, the write command sent by the master station to the slave station is recorded as OM(x,y), wherein x represents the data item written to the OM area, and y represents the target logical operation data item value written. The slave station receives the command OM(x,y), makes judgments on the legality and access conditions, and after passing the judgments, triggers the soft PLC to execute the corresponding logical operation algorithm of OM(x,y), and the obtained value is recorded as IOM(x,y), that is, IOM(x,y)≡f(OM(x,y)).
[0031] In some examples, the present application will also generate a response message based on the target data and transmit the response message to the master station so that the master station can understand the generation result of the target data; in some examples, the slave station will also transmit the response message to the connected PLC device; in some examples, the slave station can also directly send the target data to the connected PLC device and / or the master station.
[0032] According to the technical solution provided in the embodiment of the present application, in response to the data processing instruction issued by the master station, the data to be processed is obtained; the logical operation algorithm is determined according to the data processing instruction, and the data to be processed is processed according to the logical operation algorithm to generate target data; a response message is generated according to the target data, and the response message is transmitted to the master station. In the solution provided by the present application, the slave station determines the logical operation algorithm according to the data processing instruction, realizes the dynamic determination of the logical operation algorithm, and enables the slave station to calculate and process data more flexibly, avoiding the problem in the related technology that the slave station can only respond based on predefined static data, lacks dynamic adaptability, and affects the real-time calculation and interaction efficiency of data.
[0033] In some embodiments, Figure 2 As shown, a logic operation algorithm is determined from a virtual programmable logic controller module according to a data processing instruction, including:
[0034] S201, parsing the data processing instruction to obtain the target logic operation data item value;
[0035] S202, obtaining a correspondence between a preset data item value and a logic operation algorithm from a virtual programmable logic controller module;
[0036] S203. Match the target logic operation data item value with the preset correspondence between the data item value and the logic operation algorithm to obtain the logic operation algorithm corresponding to the target logic operation data item value.
[0037] Specifically, the present application will parse the data processing instruction to obtain the target logical operation data item value. The data processing instruction will carry the target logical operation data item value for indicating the logical operation algorithm. Different target logical operation data item values correspond to different logical operation algorithms. The slave station can parse the data processing instruction to obtain the target logical operation data item value.
[0038] In some examples, the present application will obtain the correspondence between the preset data item value and the logic operation algorithm from the virtual programmable logic controller module, and the data item value and the logic operation algorithm are preset by relevant personnel according to actual needs. It can be understood that, specifically, a soft PLC is designed in the slave station, and the soft PLC includes logic AND, OR, XOR, NOT, addition, subtraction, multiplication, division, linear conversion and any combination thereof, and the above logic AND, OR, XOR, NOT, addition, subtraction, multiplication, division, linear conversion and any combination thereof constitute different logic operation algorithms.
[0039] It can be understood that the present application does not limit the storage form of the correspondence between data item values and logical operation algorithms. The correspondence between the above data item values and logical operation algorithms can be stored in the form of tables, databases, key-value pairs, file storage (i ni format file storage, xml format file storage, json format file storage), etc. Exemplarily, the correspondence between data item values and logical operation algorithms is stored in a configuration file as follows:
[0040] Conf1={OM1=1},A&B, that is, in the first configuration item, when the data item value 1=1, the corresponding logic operation algorithm is A&B, where A&B represents the bitwise AND operation on Boolean values. After obtaining the two parameters A and B, the result of A&B is true (or 1) only when both A and B are true (or 1), otherwise the result is false (or 0).
[0041] Conf2={OM1=0},A&B&C, that is, in the second configuration item, when the data item value is 1=0, the corresponding logic operation algorithm is A&B&C, where A&B&C represents the bitwise AND operation on Boolean values. After obtaining the two parameters A and B, the result of A&B&C is true (or 1) only when A, B, and C are all true (or 1), otherwise the result is false (or 0).
[0042] Conf3={OM2=1},A|B|C, that is, in the third configuration item, when the data item value 2=1, the corresponding logic operation algorithm is A|B|C, where A|B|C represents the "or" in the logic operation. After obtaining the two parameters A, B and C, as long as at least one of A, B or C is true (or 1), the result is true (or 1); only when A, B and C are all false (or 0), the result is false (or 0).
[0043] Conf4={OM2=0},10*A, that is, in the fourth configuration item, when the data item value 2=0, the corresponding logic operation algorithm is 10*A, where after obtaining the A parameter, 10 is multiplied by A to obtain the result.
[0044] Conf5={OM3=1},10*A+B, that is, in the fifth configuration item, when the data item value 3=1, the corresponding logic operation algorithm is 10*A+B, where after obtaining the two parameters A and B, 10 is multiplied by A to obtain the result, and then the result is added to B.
[0045] According to the technical solution provided in the embodiment of the present application, the data processing instruction is parsed to obtain the target logical operation data item value; the correspondence between the preset data item value and the logical operation algorithm is obtained, and the target logical operation data item value is matched with the correspondence between the preset data item value and the logical operation algorithm to obtain the logical operation algorithm corresponding to the target logical operation data item value. This method achieves accurate acquisition of the logical operation algorithm corresponding to the target logical operation data item value by obtaining the correspondence between the preset data item value and the logical operation algorithm.
[0046] In some embodiments, Figure 3 As shown, the data to be processed is processed based on the logical operation algorithm to generate target data, including:
[0047] S301, matching the data to be processed with the processing parameters corresponding to the logic operation algorithm;
[0048] S302: If the data to be processed successfully matches the processing parameters corresponding to the logic operation algorithm, the data to be processed is processed according to the logic operation algorithm to generate target data.
[0049] It can be understood that in order to avoid errors in the acquired data to be processed or the inability to perform the logical operation corresponding to the logical operation algorithm, the present application, in the process of processing the data to be processed according to the logical operation algorithm, will first match the data to be processed with the processing parameters corresponding to the logical operation algorithm, and then determine whether the logical operation algorithm can perform the logical operation on the data to be processed. If the data to be processed matches the logical operation algorithm, it indicates that the logical operation algorithm can perform the logical operation on the data to be processed; if the data to be processed does not match the logical operation algorithm, it indicates that the logical operation algorithm cannot perform the logical operation on the data to be processed.
[0050] Continuing with the above example, if the data to be processed successfully matches the processing parameters corresponding to the logical operation algorithm, this application will process the data to be processed according to the logical operation algorithm to generate target data.
[0051] If the data to be processed fails to match the processing parameters corresponding to the logic operation algorithm, this application will report the abnormal status to the main station.
[0052] According to the technical solution provided in the embodiment of the present application, the data to be processed is matched with the processing parameters corresponding to the logical operation algorithm; if the data to be processed and the processing parameters corresponding to the logical operation algorithm are successfully matched, the data to be processed is processed according to the logical operation algorithm to generate target data. The above method ensures the correct execution of the logical operation algorithm and avoids the problem of executing the logical operation algorithm when the data to be processed does not match the logical operation algorithm and generating erroneous target data.
[0053] In some embodiments, Figure 4 As shown, a response message is generated according to the target data, including:
[0054] S401, determining a data storage location corresponding to the master station, and writing target data into the data storage location;
[0055] S402: If the target data is successfully written into the data storage location, a response message is generated, and the response message carries the target data and information that the target data has been verified.
[0056] It can be understood that after generating the target data, the present application will determine the data storage location corresponding to the master station and write the target data to the data storage location so that subsequent slave stations and the master station can obtain the target data from the data storage location when needed.
[0057] Exemplarily, the slave station can be divided into three configurable areas, namely IOM, OM, and IM, where IOM is a readable and writable area, OM is a writable area, and IM is a readable area. The soft PLC is used to implement logical management calculations and access to the three areas of IOM, OM, and IM. The write command sent by the master station to the slave station is recorded as OM(x, y), where x represents the data item written to the OM area, and y represents the target logical operation data item value written. The slave station receives the command OM(x, y), makes judgments on the legality and access conditions, and after passing them, triggers the soft PLC to execute the corresponding logical operation algorithm of OM(x, y). The obtained value is recorded as IOM(x, y), that is, IOM(x, y)≡f(OM(x, y)), and then writes the obtained result IOM(x, y) to the corresponding position of the master station IOM, so that subsequent slave stations and master stations can obtain the target data from the data storage location when needed.
[0058] In the case where the target data is successfully written to the data storage location, the present application will generate a response message. In some examples, the above-mentioned response message includes an affirmative response message and an abnormal response message, wherein, when the target data is successfully written to the data storage location, it indicates that there are no abnormalities in the process of executing the above steps from the station. At this time, an affirmative response message for indicating that the generation of the target data is completed and there are no abnormalities will be generated, and the affirmative response message will be sent to the master station. After receiving the affirmative response message, the master station determines that the target data is successfully generated by the slave station. Among them, if the slave station has a calculation abnormality or the legality and access conditions are not judged, resulting in a failure to write the target data to the data storage location, the slave station will generate an abnormal response message (the abnormal response message is used to report abnormal status and abnormal process), and send the abnormal response message to the master station, so that the master station can be informed of the specific abnormal situation.
[0059] According to the technical solution provided in the embodiment of the present application, the data storage location corresponding to the master station is determined, and the target data is written to the data storage location; if the target data is successfully written to the data storage location, a response message is generated, and the response message carries the target data and information on whether the target data has been verified, so that the master station can learn whether the slave station has successfully generated the target data, thereby avoiding the problem of the master station failing to learn whether the slave station has successfully generated the target data, resulting in repeated issuance of data processing instructions.
[0060] In some embodiments, Figure 5 As shown, after generating a response message according to the target data and transmitting the response message to the master station, the method further includes:
[0061] S501, obtaining a storage location of a data processing instruction in a temporary storage area, where the temporary storage area is a location area set by the slave station for storing data processing instructions;
[0062] S502: Reset the data processing instructions in the temporary storage area according to the storage location.
[0063] In some examples, after receiving a data processing instruction, the slave station stores the data processing instruction in a temporary storage area and then scans the temporary storage area. When the data processing instruction is scanned, the slave station executes subsequent steps in response to the data processing instruction issued by the master station. In order to avoid the problem that after the slave station executes subsequent steps such as obtaining data to be processed in response to the data processing instruction issued by the master station, the temporary storage area is subsequently scanned, and the data processing instruction is scanned again, causing the slave station to once again respond to the data processing instruction to execute subsequent steps such as obtaining data to be processed, the present application generates a response message based on the target data and transmits the response message to the master station. The storage location of the data processing instruction in the temporary storage area is obtained. The temporary storage area is a location area set by the slave station for storing data processing instructions.
[0064] Continuing with the above example, in the present application, the slave station will reset the data processing instructions in the temporary storage area according to the storage location (reset to a meaningless default value), so that subsequent slave stations will no longer process the data processing instructions.
[0065] For example, the slave station can be divided into three configurable areas, namely IOM, OM, and IM, where IOM is a readable and writable area, OM is a writable area, and IM is a readable area. The soft PLC is used to implement the logical management calculation and access of the three areas of IOM, OM, and IM. The write command sent by the master station to the slave station is recorded as OM (x, y), where x represents the data item written to the OM area, and y represents the target logical operation data item value written. The slave station receives the command OM (x, y) and writes OM (x, y) to the corresponding position of the OM area (in the temporary storage area) The storage location of the master station is stored in the master station, and the legality and access conditions are judged and passed. The soft PLC is triggered to execute the corresponding logical operation algorithm of OM (x, y). The obtained value is recorded as IOM (x, y), that is, IOM (x, y) ≡ f (OM (x, y)). Then the result IOM (x, y) is written to the corresponding position of the master station IOM, so that the subsequent slave stations and the master station can obtain the target data from the data storage location when needed. The OM (x, y) value of the corresponding position of the slave station resets the OM area to 0 (0 is a pre-set meaningless default value).
[0066] According to the technical solution provided in the embodiment of the present application, the storage location of the data processing instruction in the temporary storage area is obtained, and the temporary storage area is a location area set by the slave station for storing the data processing instruction; the data processing instruction in the temporary storage area is reset according to the storage location, so that the subsequent slave station will no longer process the data processing instruction, thereby saving system resources and improving the stability of the system.
[0067] In some embodiments, Figure 6 As shown, after generating a response message according to the target data and transmitting the response message to the master station, the method further includes:
[0068] S601, if the data to be processed is updated, generating new target data according to the updated data to be processed;
[0069] S602: Generate an update message according to the new target data, and transmit the update message to the master station.
[0070] Specifically, if the above-mentioned data to be processed is non-fixed data (for example, the data to be processed is the motor speed of a PLC device, and the motor speed is a value that changes according to the actual state, then the data to be processed is non-fixed data; for another example, the data to be processed is the transmission ratio of the motor in the PLC device, and the transmission ratio is a fixed value, then the data to be processed is fixed data), this application will regenerate new target data based on the updated data to be processed when the data to be processed is updated.
[0071] Then, the present application generates an update message according to the new target data, and transmits the update message to the master station, so that the master station can be informed of the target data update; in some examples, the update message carries the new target data, and the master station can directly obtain the new target data; in some examples, the update message does not carry the new target data, and the master station can be informed that the target data has been updated, and when the target data needs to be used, the new target data can be obtained from the corresponding data storage location of the master station.
[0072] Exemplarily, the slave station can be divided into three configurable areas, namely IOM, OM, and IM, where IOM is a readable and writable area, OM is a writable area, and IM is a readable area. The soft PLC is used to implement the logical management calculation and access of the three areas of IOM, OM, and IM. The write command sent by the master station to the slave station is recorded as OM (x, y), where x represents the data item written to the OM area, and y represents the target logical operation data item value written. The slave station receives the command OM (x, y), writes OM (x, y) to the corresponding position of the OM area (the storage position in the temporary storage area), and judges the legality and access conditions and passes them, and triggers the soft PLC to execute the corresponding logic of OM (x, y). The operation algorithm is used, and the obtained value is recorded as IOM(x,y), that is, IOM(x,y)≡f(OM(x,y)), and then the obtained result IOM(x,y) is written into the corresponding position of the master station IOM, so that the subsequent slave station and the master station can obtain the target data from the data storage location when needed, and the slave station resets the OM(x,y) value of the corresponding position in the OM area to 0 (0 is a pre-set meaningless default value). After the slave station recognizes that the corresponding instant value IOM(x,y) of the IOM area has changed, it immediately generates a response message according to the new IOM(x,y) value and actively sends it to the master station, thereby completing the update of the slave station to the master station based on the configurable algorithm, variably defined data and commands.
[0073] In the solution provided by the present application, a slave station data area can dynamically define different data. Secondly, the meaning of the data item value can be functionally associated with the data item value through the soft PLC module, and the association relationship is configurable. The solution provided by the present application does not require physical PLC support and can be used for edge computing.
[0074] According to the technical solution provided in the embodiment of the present application, if the data to be processed is updated, new target data is generated based on the updated data to be processed; an update message is generated based on the new target data, and the update message is transmitted to the main station. The present application realizes the dynamic generation of new target data based on the dynamic data to be processed, and transmits the update message to the main station, so that the main station can be informed of the target data update.
[0075] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0076] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0077] This embodiment also provides a data processing device, such as Figure 7 As shown, the device comprises:
[0078] The determination module 701 is used to respond to the data processing instruction issued by the master station, wake up the virtual programmable logic controller module independently set in the slave station, and determine the logic operation algorithm from the virtual programmable logic controller module according to the data processing instruction;
[0079] The logic module 702 is used to obtain the data to be processed according to the data processing instruction, and process the data to be processed based on the logic operation algorithm to generate the target data;
[0080] The message module 703 is used to generate a response message according to the target data and transmit the response message to the master station.
[0081] In some examples, the logic module 702 is also used to parse data processing instructions to obtain a target logic operation data item value; obtain the correspondence between a preset data item value and a logic operation algorithm from the virtual programmable logic controller module, and match the target logic operation data item value with the correspondence between the preset data item value and the logic operation algorithm to obtain the logic operation algorithm corresponding to the target logic operation data item value.
[0082] In some examples, the logic module 702 is also used to match the data to be processed with the processing parameters corresponding to the logic operation algorithm; if the data to be processed successfully matches the processing parameters corresponding to the logic operation algorithm, the data to be processed is processed according to the logic operation algorithm to generate target data.
[0083] In some examples, the message module 703 is also used to determine the data storage location corresponding to the master station, and write the target data into the data storage location; if the target data is successfully written into the data storage location, a response message is generated.
[0084] In some examples, the message module 703 is also used to obtain the storage location of the data processing instruction in the temporary storage area, which is a location area set by the slave station for storing data processing instructions; and reset the data processing instruction in the temporary storage area according to the storage location.
[0085] In some examples, the message module 703 is also used to generate new target data according to the updated data to be processed if the data to be processed is updated; generate an update message according to the new target data, and transmit the update message to the master station.
[0086] According to the technical solution provided by the embodiment of the present application, the data processing device provided by the present embodiment responds to the data processing instruction issued by the master station, wakes up the virtual programmable logic controller module independently set in the slave station, and determines the logic operation algorithm from the virtual programmable logic controller module according to the data processing instruction; obtains the data to be processed according to the data processing instruction, and processes the data to be processed based on the logic operation algorithm to generate target data; generates a response message according to the target data, and transmits the response message to the master station. In the solution provided by the present application, the slave station determines the logic operation algorithm according to the data processing instruction, realizes the dynamic determination of the logic operation algorithm, and enables the slave station to calculate and process data more flexibly, avoiding the problem in the related technology that the slave station can only respond based on predefined static data, lacks dynamic adaptability, and affects the real-time calculation and interaction efficiency of data.
[0087] Figure 8 Schematic diagram of an electronic device 8 provided in an embodiment of the present application. Figure 8 As shown, the electronic device 8 of this embodiment includes: a processor 801, a memory 802, and a computer program 803 stored in the memory 802 and executable on the processor 801. When the processor 801 executes the computer program 803, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 801 executes the computer program 803, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0088] The electronic device 8 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 8 may include, but is not limited to, a processor 801 and a memory 802. Those skilled in the art will appreciate that Figure 8 The electronic device 8 is merely an example and does not limit the electronic device 8 . The electronic device 8 may include more or fewer components than those shown in the figure, or different components.
[0089] The processor 801 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0090] The memory 802 may be an internal storage unit of the electronic device 8, for example, a hard disk or memory of the electronic device 8. The memory 802 may also be an external storage device of the electronic device 8, for example, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the electronic device 8. The memory 802 may also include both an internal storage unit of the electronic device 8 and an external storage device. The memory 802 is used to store computer programs and other programs and data required by the electronic device.
[0091] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0092] If the integrated module / unit 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 present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of regional requirements and patent practice. For example, in some areas, according to regional requirements and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0093] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data processing method, characterized in that: The method is applied to a slave station, and the method comprises: In response to a data processing instruction issued by the master station, a virtual programmable logic controller module independently provided in the slave station is awakened, and a logic operation algorithm is determined from the virtual programmable logic controller module according to the data processing instruction; Acquire the data to be processed according to the data processing instruction, and process the data to be processed based on the logic operation algorithm to generate target data; A response message is generated according to the target data, and the response message is transmitted to the master station.
2. The method according to claim 1, characterized in that Determining a logic operation algorithm from the virtual programmable logic controller module according to the data processing instruction includes: Parsing the data processing instruction to obtain a target logic operation data item value; Acquire the correspondence between the preset data item value and the logic operation algorithm from the virtual programmable logic controller module; The target logic operation data item value is matched with a preset correspondence between the data item value and the logic operation algorithm to obtain the logic operation algorithm corresponding to the target logic operation data item value.
3. The method according to claim 2, characterized in that Processing the data to be processed based on the logic operation algorithm to generate target data includes: Matching the data to be processed with processing parameters corresponding to the logic operation algorithm; If the data to be processed successfully matches the processing parameters corresponding to the logic operation algorithm, the data to be processed is processed according to the logic operation algorithm to generate the target data.
4. The method according to claim 1, characterized in that: Generating a response message according to the target data, including: Determine a data storage location corresponding to the master station, and write the target data into the data storage location; If the target data is successfully written into the data storage location, the response message is generated.
5. The method according to claim 1, characterized in that After generating a response message according to the target data and transmitting the response message to the master station, the method further includes: Acquire a storage location of the data processing instruction in a temporary storage area, where the temporary storage area is a location area set by the slave station for storing the data processing instruction; The data processing instructions in the temporary storage area are reset according to the storage location.
6. The method according to claim 1, characterized in that After generating a response message according to the target data and transmitting the response message to the master station, the method further includes: If the data to be processed is updated, generating new target data according to the updated data to be processed; An update message is generated according to the new target data, and the update message is transmitted to the master station.
7. A data processing device, characterized in that: The device comprises: A determination module, configured to respond to a data processing instruction issued by the master station, wake up a virtual programmable logic controller module independently provided in the slave station, and determine a logic operation algorithm from the virtual programmable logic controller module according to the data processing instruction; A logic module, used for acquiring the data to be processed according to the data processing instruction, and processing the data to be processed based on the logic operation algorithm to generate target data; The message module is used to generate a response message according to the target data and transmit the response message to the master station.
8. The device according to claim 7, characterized in that The logic module is also used to parse the data processing instructions to obtain the target logic operation data item value; obtain the correspondence between the preset data item value and the logic operation algorithm, and match the target logic operation data item value with the preset correspondence between the data item value and the logic operation algorithm to obtain the logic operation algorithm corresponding to the target logic operation data item value.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Attribute management method and system in graph database
CN120492690A
A method and system for attribute management in a graph database
CN120492690B