A method and apparatus for data offloading and access processing via a gateway device.
By setting up a data exchange area and a mapping sub-area in the gateway device and using the Modbus-RTU communication protocol, field devices are used as hosts to achieve data offloading and access processing. This solves the hardware interface limitations and bus conflict problems of existing devices, improves the efficiency and security of data cloud interaction, reduces transformation costs, and enhances the stability and compatibility of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JINGXIANG (BEIJING) TECHNOLOGY CO LTD
- Filing Date
- 2026-04-08
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies in industrial automation control systems suffer from limitations in hardware interface resources of existing equipment, bus conflicts, rigid and limited gateway register function design, low efficiency of traditional polling mechanisms, and mismatch between communication resource allocation and industrial data characteristics. These issues make data transfer to the cloud difficult, and also result in high transformation costs, poor stability, and poor security.
By using the Modbus-RTU communication protocol through the gateway device, the field device is used as the master and the gateway device is used as the slave device to realize data flow access processing. Data exchange area and mapping sub-area are set up, and data is allocated according to function code and pre-configured routing policy to realize data classification, storage and processing, avoid accidental triggering of physical peripheral device actions, prevent tampering of key parameters, and improve response speed and bus bandwidth utilization.
Without altering the original physical architecture and control logic, the system reduces transformation costs, improves the efficiency and security of data cloud interaction, ensures system stability and real-time performance, and enhances compatibility with existing equipment of different brands and models.
Smart Images

Figure CN122093318A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial automation control technology, and in particular to a method and device for data diversion and access processing via a gateway device. Background Technology
[0002] In industrial automation control systems, field human-machine interface devices (such as HMIs, programmable logic controllers (PLCs), and industrial panel PCs) serve as the interaction window between operators and field equipment, and are widely used in scenarios such as parameter setting, status monitoring, and command issuance. With the deepening of the Industrial Internet strategy, a large number of existing industrial equipment face the need for intelligent upgrades. One of the core objectives of these upgrades is to connect previously isolated field equipment to the network and enable data uploading to the cloud. For example, this involves sending process parameters and recipe data from the equipment to a remote server, or receiving the latest process commands from a remote server.
[0003] In traditional HMI-gateway interaction schemes, a "dual-role HMI" architecture is typically adopted to achieve complete bidirectional data exchange: on the one hand, the HMI acts as a Modbus master, actively querying and controlling the lower-level RS485 sensors or secondary instruments; on the other hand, the HMI also acts as a Modbus slave, passively waiting for the industrial gateway (acting as the master at this time) to poll and read its internal process parameters and operating status so that the gateway can perform data fusion and report to the cloud.
[0004] However, in the practice of intelligent transformation of existing equipment, the above-mentioned traditional solutions have the following significant drawbacks: First, hardware interface resource limitations make it difficult to reuse existing equipment. Traditional bidirectional communication architectures require field devices to have two independent serial communication interfaces (such as RS485), one for master mode and one for slave mode, or the ability to handle complex tasks such as real-time switching between master and slave roles on the same interface. However, many existing HMIs and PLCs on the market are only configured with a single serial interface, and this interface is already occupied by existing lower-level communication tasks. Forced modifications usually require replacing the entire device, resulting in huge equipment waste and modification costs.
[0005] Second, there are issues with bus conflicts and the exclusivity of existing communication tasks. Even if some existing devices have multiple interfaces, their slave interfaces are often already occupied by existing host systems (such as DCS or third-party monitoring equipment). In this "one master, multiple slaves" Modbus architecture, if a new gateway is added as a master, it will directly lead to bus conflicts, address conflicts, and communication interruptions, seriously affecting the stability of the original control logic.
[0006] Third, the rigidity and limitations of gateway register functionality design. Existing gateway products have register spaces with clearly defined hardware-bound attributes. For example, coil registers are typically directly associated with local physical relays, maintaining the register's configuration parameters within the device itself. This design prevents data from field devices from being relayed and isolated within the gateway, increasing the risk of false triggering or unauthorized configuration tampering.
[0007] Fourth, the traditional polling mechanism suffers from inefficiency and response delays. Traditional architectures rely on gateways to periodically scan field devices. As the scale of monitoring data increases, the polling cycle lengthens linearly. In this mode, the importance of data and the priority of response cannot be matched; critical emergency signals (such as emergency stops and fire alarms) must wait in the polling queue, leading to delays in responding to critical events. Simultaneously, repeatedly scanning static data that hardly changes results in significant waste of bus bandwidth.
[0008] Fifth, the allocation of communication resources is mismatched with the characteristics of industrial data. Industrial field data includes discrete "event-type" switching quantities and continuous "trend-type" numerical quantities. Traditional solutions process all data points indiscriminately and at the same frequency, resulting in bus bandwidth being occupied by a large number of redundant, unchanging readings, while truly valuable status events are often drowned out by continuous routine polling, and the processing resources of field devices and gateways are consumed by a large number of invalid communication tasks.
[0009] In summary, how to break through the limitations of existing equipment hardware interfaces and achieve efficient, real-time, and secure data cloud interaction without changing the original physical architecture and control logic has become an urgent technical problem to be solved in the upgrading and transformation of the industrial internet. Summary of the Invention
[0010] One of the objectives of this invention is to provide a method and device for data offloading and access processing via a gateway device.
[0011] According to one aspect of this application, a method for data offloading access processing via a gateway device is provided. The gateway device includes a data exchange area and at least one serial communication interface. The data exchange area includes an uplink data area, and the uplink data area includes a mapping sub-area. The method includes: S11. Receive a first write request sent by a first field device; wherein, the first field device is connected to the serial communication interface of the gateway device through the host communication interface, and the gateway device and the first field device use the Modbus-RTU communication protocol; the first write request includes first data information, a first function code and a first address; S12. If the first address points to the data exchange area, determine the target mapping sub-area corresponding to the first data information according to the first function code, so as to save the first data information to the target mapping sub-area. S13. Determine the target allocation operation for the first data information according to the pre-configured routing policy of the data exchange area; wherein the target allocation operation includes sending the first data information to a network device, local storage, or forwarding it to other communication interfaces.
[0012] According to another aspect of this application, a gateway device is provided, characterized in that the gateway device includes a data exchange area and at least one serial communication interface, the data exchange area including an uplink data area, the uplink data area including a mapping sub-area; the gateway device further includes: The first receiving module is used to receive a first write request sent by a first field device; wherein the first field device is connected to the serial communication interface of the gateway device through the host communication interface, and the gateway device and the first field device use the Modbus-RTU communication protocol; the first write request includes first data information, a first function code and a first address; The off-flow storage module is used to determine the target mapping sub-area corresponding to the first data information according to the first function code if the first address points to the data exchange area, so as to save the first data information to the target mapping sub-area. The routing decision module is used to determine the target allocation operation for the first data information according to the pre-configured routing policy of the data exchange area; wherein the target allocation operation includes sending the first data information to a network device, local storage, or forwarding it to other communication interfaces.
[0013] According to another aspect of this application, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed as described above.
[0014] According to another aspect of this application, a computer-readable storage medium is provided, storing a computer program that can be loaded by a processor and executed as described above.
[0015] Compared with existing technologies, this application, by using a first field device as a Modbus communication master and a gateway device as a slave to receive write requests, enables existing field devices with only a single serial communication interface to connect to the cloud by actively pushing data to the gateway without adding hardware interfaces or changing the original physical wiring. This significantly reduces the equipment investment cost and construction difficulty of industrial internet transformation. By setting up a data exchange area in the gateway device that is completely decoupled from the physical output hardware and its own configuration parameters, logical isolation of business data is achieved within the gateway. This effectively avoids the accidental triggering of physical peripherals such as local relays of the gateway due to data reporting operations, and also prevents the gateway's own critical operating parameters such as baud rate and device address from being accidentally tampered with, ensuring the stability and security of system operation. The first field device actively initiates writes according to business logic. The request pattern changes the traditional gateway's periodic polling mode, allowing critical signals and urgent commands to queue across polling cycles and immediately trigger write operations, achieving millisecond-level response speeds and ensuring the real-time upload of critical operating condition data. A mechanism based on matching the target mapping sub-region with the first function code enables data classification, storage, and processing. When there are no data changes, the bus remains idle, effectively reducing redundant and ineffective scans of unchanged data and significantly improving the effective utilization of bus bandwidth. By setting software-defined virtual mapping sub-regions, the bottleneck of the number of physical registers being limited by the number of hardware I / O points is broken, enabling flexible expansion of storage capacity. Simultaneously, this standard Modbus mapping mechanism allows field devices to adapt with only minor adjustments to the write address, achieving high compatibility with existing devices of different brands and models, enhancing the system's versatility. Attached Figure Description
[0016] Figure 1 A flowchart illustrating a method for data offloading and access processing via a gateway device according to an embodiment of this application is shown. Figure 2 A schematic diagram of the structure of a gateway device according to an embodiment of this application is shown; Figure 3 Exemplary systems that can be used to implement the various embodiments described in this application are shown. Detailed Implementation
[0017] The present application will now be described in further detail with reference to the accompanying drawings.
[0018] In a typical configuration of this application, the terminal, the device of the service network, and the trusted party all include one or more processors (e.g., a central processing unit (CPU)), input / output interfaces, network interfaces, and memory.
[0019] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory. Memory is an example of computer-readable media.
[0020] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PCM), programmable random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0021] The devices referred to in this application include, but are not limited to, terminals, network devices, or devices formed by integrating terminals and network devices through a network. The terminals include, but are not limited to, any mobile electronic product capable of human-computer interaction (e.g., via a touchpad), such as smartphones and tablets. These mobile electronic products can use any operating system, such as Android or iOS. The network devices include electronic devices capable of automatically performing numerical calculations and information processing according to pre-set or stored instructions. Their hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), and embedded devices. The network devices include, but are not limited to, computers, network hosts, single network servers, multiple network server clusters, or clouds composed of multiple servers. Here, a cloud consists of a large number of computers or network servers based on cloud computing, where cloud computing is a type of distributed computing, consisting of a virtual supercomputer composed of a group of loosely coupled computer clusters. The network includes, but is not limited to, the Internet, wide area network, metropolitan area network, local area network, VPN network, wireless ad hoc network, etc. Preferably, the device can also be a program running on the terminal, network device, or a device formed by integrating the terminal and network device, network device, touch terminal, or network device and touch terminal through a network.
[0022] Of course, those skilled in the art should understand that the above-described devices are merely examples, and other existing or future devices that are applicable to this application should also be included within the scope of protection of this application, and are hereby incorporated by reference.
[0023] In the description of this application, "multiple" means two or more, unless otherwise expressly and specifically defined.
[0024] refer to Figure 1This invention provides a method for data offloading and access processing via a gateway device. The gateway device includes a data exchange area and at least one serial communication interface. The data exchange area includes an uplink data area and a mapping sub-area. The method includes steps S11, S12, and S13. In step S11, a first write request is received from a first field device. The first field device is connected to the serial communication interface of the gateway device via a host communication interface, and the gateway device and the first field device communicate using the Modbus-RTU communication protocol. The first write request includes first data information, a first function code, and a first address. In step S12, if the first address points to the data exchange area, the target mapping sub-area corresponding to the first data information is determined according to the first function code, so that the first data information is saved to the target mapping sub-area. In step S13, a target allocation operation for the first data information is determined according to the pre-configured routing policy of the data exchange area. The target allocation operation includes sending the first data information to a network device, local storage, or forwarding it to at least one of other communication interfaces. In some embodiments, the data exchange area is used to receive first data information actively written by the first field device; in other embodiments, the data exchange area is also used to receive second data information sent by the network device. In some embodiments, the uplink data area allows the first field device to write the first data information and allows the gateway device to read the first data information to report the first data information to the network device. In some embodiments, the data exchange area also includes a downlink data area, which only allows the first field device to read the second data information and does not allow the first field device to write to it. The mapping sub-area includes, but is not limited to, a switch quantity mapping sub-area and a continuous quantity mapping sub-area, and different mapping sub-areas are used to store different function codes. For a detailed description of this part, please refer to the corresponding embodiments below, which will not be repeated here. This embodiment sets up a data exchange area in the gateway device that can be completely decoupled from the physical output hardware and its own configuration parameters. While realizing data diversion access interaction, it also realizes the logical isolation of service relay data inside the gateway, effectively avoiding the accidental triggering of physical peripheral devices such as local relays of the gateway due to data reporting operations. It also prevents the gateway's own key operating parameters such as baud rate and device address from being accidentally tampered with, ensuring the stability and security of the system operation.
[0025] Specifically, in step S11, a first write request sent by a first field device is received. The first field device communicates with the gateway device via a host communication interface and a serial communication interface, using the Modbus-RTU communication protocol. The first write request includes first data information, a first function code, and a first address. In some embodiments, the serial communication interface includes, but is not limited to, an RS485 communication interface. In some embodiments, the first field device includes, but is not limited to, an HMI (Human Machine Interface), a PLC (Programmable Logic Controller), or an industrial panel PC. For example, the first field device may include an existing HMI, whose RS485 communication interface is used as a host communication interface and connected to the gateway device's RS485 communication interface. The existing HMI maintains its original local control logic. The gateway device receives the write request sent by the existing HMI. In some embodiments, the first field device can maintain its host identity throughout the communication process, writing the first data information to the gateway device, which then distributes and distributes the first data information. In some embodiments, the first function code includes, but is not limited to, bit operation function codes and word operation function codes. For specific details on this part, please refer to the corresponding embodiments below; further explanation is not provided here. In some embodiments, the data exchange area conforms to the Modbus standard, using standard Modbus addresses and function codes. Existing first field devices do not need to modify their communication programs; they only need to associate the first data information to be reported with the specified first address.
[0026] In step S12, if the first address points to the data exchange area, the target mapping sub-area corresponding to the first data information is determined according to the first function code, so that the first data information is saved to the target mapping sub-area. In this embodiment, the network device performs data splitting based on the first address in the first write request. For example, if the first address points to the data exchange area, a second data splitting is performed based on the first function code. In some embodiments, the gateway device further includes an inherent functional area, which is associated with the physical output hardware (such as relays, current, voltage outputs, etc.) of the gateway device or the configuration parameters (such as device address, communication baud rate, server pointer, etc.) of the gateway device itself, and is used to implement local control or configuration functions. If the first data information points to the inherent functional area, the gateway device performs local control or configuration operations based on the first data information. For a detailed description of the inherent functional area, please refer to the corresponding embodiments below, which will not be repeated here.
[0027] In step S13, a target allocation operation for the first data information is determined according to the pre-configured routing policy of the data exchange area. The target allocation operation includes at least one of sending the first data information to a network device, local storage, or forwarding it to another communication interface. In some embodiments, the routing policy may be a routing table stored in the non-volatile memory of the gateway device, where each entry defines a target allocation operation corresponding to an address range in the data exchange area. For example, data corresponding to addresses 2000-2999 may be configured for local storage; data corresponding to addresses 3000-3999 may be configured to be forwarded to downstream devices via other communication interfaces of the gateway device. In some embodiments, the routing policy may be pre-configured by: setting the routing policy through the gateway device's configuration webpage; setting the routing policy by importing a configuration file into the gateway device; or remotely distributing the routing policy to the gateway device via the cloud (e.g., a network device). In some embodiments, the uplink data area not only allows the first field device to write the first data information but also allows the first field device to read the first data information from the uplink data area via the host communication interface. In this embodiment, a routing policy allows downstream devices of the gateway device to read first data information from the data exchange area through other communication interfaces. In some embodiments, if the target allocation operation includes sending the first data information to the corresponding network device, the gateway device can directly send the first data information to the corresponding network device; in other embodiments, the gateway device merges the first data information with third data information obtained through other interfaces before sending it to the network device; for a detailed explanation of this part, please refer to the corresponding embodiments below, which will not be repeated here. In some embodiments, if the target allocation operation includes local storage by the gateway device, the gateway device can perform corresponding control operations when necessary based on the first data information. For example, the gateway device stores the temperature information of the first field device (e.g., the first data information includes temperature information) locally based on the routing policy and monitors the temperature information in real time. If the temperature information reaches a preset temperature value, the gateway device automatically drives the local alarm device through its inherent functional area without waiting for cloud instructions. In some embodiments, if the target allocation operation includes forwarding to downstream devices through other communication interfaces, the gateway device allows downstream devices to read the corresponding first data information from the data exchange area through these other communication interfaces. Downstream devices include, but are not limited to, other host devices (such as another PLC or HMI) connected to the gateway device via other communication interfaces. These devices act as Modbus hosts and can read data from the gateway device's data exchange area. Other communication interfaces include, but are not limited to, RS485 communication interfaces.In this embodiment, the first data information written by the first field device is diverted through the data exchange area, which solves the problems of low efficiency and slow response of the traditional polling mechanism, and also solves the problem of mismatch between communication resource allocation and industrial data characteristics.
[0028] In some embodiments, the data exchange area further includes a downlink data area, and the method further includes step S14 (not shown), in which a second write request sent by a network device is received; wherein the second write request includes second data information; in response to the second write request, the second data information is stored in the downlink data area so that the first field device can read the corresponding second data information from the downlink data area. In some embodiments, the downlink data area only allows read operations by the first field device and does not allow write operations by the first field device. In some embodiments, if the target allocation operation includes forwarding to a downstream device through other communication interfaces, the gateway device allows the downstream device to read the corresponding first data information from the data exchange area through the other communication interface. The downstream device includes, but is not limited to, other host devices (such as another PLC or HMI) connected to the gateway device through other communication interfaces. These devices act as Modbus hosts and can read data from the data exchange area of the gateway device. Other communication interfaces include, but are not limited to, RS485 communication interfaces. For example, the data exchange area has access control attributes for the uplink data area and the downlink data area, which allows the first field device to write the first data information in the uplink data area and only allows the first field device to read the second data information in the downlink data area. This not only prevents tampering but also achieves data uplink and downlink separation.
[0029] In some embodiments, the gateway device further includes an inherent functional area, which is associated with the physical output hardware of the gateway device or the configuration parameters of the gateway device itself, and is used to implement local control or configuration functions. For example, the gateway device is provided with an address association database. If a first address points to the inherent functional area, the target physical output hardware or target configuration parameters associated with the first address are determined according to the first address and the address association database. The address association database includes multiple register addresses and the physical output hardware or configuration parameters corresponding to each register address. The target physical output hardware is driven or the target configuration parameters are modified according to the first data information. In some embodiments, the address space of the inherent functional area and the address space of the data exchange area are set continuously or intermittently. In some embodiments, to save space in the gateway device, the address spaces of the data exchange area and the inherent functional area are set continuously. For example, the address space of the data exchange area includes 0 to 99, and the address space of the inherent functional area includes 100 to 200. In other embodiments, to enhance data isolation, the address spaces of the data exchange area and the inherent functional area are set intermittently. For example, the address space of the data exchange area includes 0 to 99, and the address space of the inherent functional area includes 120 to 220. In some embodiments, the data exchange area includes multiple addresses, and the inherent functional area includes multiple addresses, so that the gateway device determines whether the first address points to the data exchange area or the inherent functional area based on the first address in the first write request. For example, if the first address includes 11, the address space of the data exchange area includes 0 to 99, and the address space of the inherent functional area includes 100 to 200, then the first address 11 is determined to point to the data exchange area.
[0030] In some embodiments, each mapping sub-area has a mapping relationship with the corresponding function code. Determining the target mapping sub-area corresponding to the first data information based on the first function code includes: querying the mapping sub-area that has a mapping relationship with the first function code from the mapping relationship to determine the target mapping sub-area. For example, the gateway device is configured with the mapping relationship shown in Table 1. The gateway device queries the mapping sub-area that has a mapping relationship with the first function code from the mapping relationship. In some embodiments, each mapping sub-area in the uplink data area may also allow the first field device to read the first data information from it. However, since the first data information is written by the first field device to the corresponding target mapping sub-area, the first field device usually does not need to read the first data information from it.
[0031] Table 1 Mapping Relationships In some embodiments, the mapping sub-region includes a switch quantity mapping sub-region and a continuous quantity mapping sub-region; the function code includes bit operation function code and word operation function code; wherein, there is a mapping relationship between the bit operation function code and the switch quantity mapping sub-region, and there is a mapping relationship between the word operation function code and the continuous quantity mapping sub-region. For example, the bit operation function code includes, but is not limited to, 05 (write single coil), 15 (write multiple coils), etc., and the word function code includes, but is not limited to, 06 (write single register), 16 (write multiple registers), etc.
[0032] In some embodiments, the first write request is generated by the first field device based on an event-driven mechanism. For example, the first field device can monitor the changes of various variables in real time. When a variable meets a preset event-driven condition (such as a value change exceeding a threshold, receiving an emergency stop signal, etc.), the current value of the variable is used as the first data information, and a corresponding first write request is generated. In some embodiments, the event-driven condition includes, but is not limited to, key switching quantities such as emergency stop signals and valve control commands; continuous quantities such as parameter setpoints and status monitoring values (e.g., delayed write time, merged write, or write only when the value change exceeds a threshold, etc.). For example, variable A meets the event-driven condition when it is equal to or greater than threshold A; variable B meets the event-driven condition when it should be closed, etc. In some embodiments, each variable also corresponds to weight information so that when multiple first data information needs to be written to the gateway device simultaneously, the first field device can write the most important first data information to the gateway device first. In some embodiments, the data type includes, but is not limited to, switching quantities, continuous quantities, etc. For example, the data type is determined based on the memory attributes of the target variable; if the data type is Boolean, the function code is further determined based on the number N of coils to be written: if N=1, the function code is 05; if N>1, the function code is 15; if the data type is numeric, the function code is further determined based on the register word length L occupied by the variable to be written: if L=1, the function code is 06; if L>1, the function code is 16. In this embodiment, an event-driven mechanism enables the first field device to promptly write the first data information that needs attention into the gateway device, so that the gateway device can perform the corresponding target allocation operation.
[0033] In some embodiments, the method further includes step S15 (not shown), in which third data information of the second field device is obtained through other interfaces; wherein the second field device and the gateway device are connected for communication through other interfaces; the target allocation operation includes sending the first data information to the corresponding network device; step S13 includes: fusing the first data information and the third data information to obtain fused comprehensive data information, and sending the comprehensive data information to the network device. In some embodiments, the third data information includes data from the lower-level sensor (e.g., RS485 instrument) read by the gateway device. For example, the second field device includes, but is not limited to, sensors. In some embodiments, other interfaces include, but are not limited to, analog interfaces, digital interfaces, switch interfaces, etc. In some embodiments, the fusion processing method includes, but is not limited to, time-based or business logic-based methods. For example, timestamp T1 of the reception time of the first data information and timestamp T2 of the reception time of the third data information are recorded respectively. In time-based fusion processing, the first data information and the third data information with similar or identical T1 and T2 are encapsulated into the same data frame for uploading to the network device. In some embodiments, business logic-based fusion processing includes, but is not limited to, structured mapping, such as encapsulating data from the same device into the same data frame for uploading to the network device.
[0034] Figure 2 A schematic diagram of a gateway device according to an embodiment of this application is shown. The gateway device includes a data exchange area and at least one serial communication interface. The data exchange area includes an uplink data area and a mapping sub-area. The gateway device also includes a first receiving module, a split storage module, and a routing decision module. The first receiving module is used to receive a first write request sent by a first field device. The first field device is connected to the serial communication interface of the gateway device through a host communication interface, and the gateway device and the first field device communicate using the Modbus communication protocol. The first write request includes first data information, a first function code, and a first address. The split storage module is used to determine the target mapping sub-area corresponding to the first data information based on the first function code if the first address points to the data exchange area, so as to save the first data information to the target mapping sub-area. The routing decision module is used to determine a target allocation operation for the first data information according to a pre-configured routing policy of the data exchange area. The target allocation operation includes sending the first data information to a network device, local storage, or forwarding it to at least one of other communication interfaces.
[0035] Here, the specific implementation methods corresponding to the first receiving module, the split storage module, and the routing decision module are the same as or similar to the specific embodiments of steps S11, S12, and S13 above, and therefore will not be repeated here, but are included by reference.
[0036] In addition to the methods and devices described in the above embodiments, this application also provides a computer-readable storage medium storing computer code that, when executed, performs the method described in any of the preceding embodiments.
[0037] This application also provides a computer program product that, when executed by a computer device, performs the method described in any of the preceding claims.
[0038] This application also provides a computer device, the computer device comprising: One or more processors; Memory, used to store one or more computer programs; When the one or more computer programs are executed by the one or more processors, the one or more processors cause the one or more processors to perform the method as described in any of the preceding methods.
[0039] Figure 3 Exemplary systems that can be used to implement the various embodiments described in this application are shown; like Figure 3 As shown in some embodiments, system 300 can function as any of the devices described in each of the embodiments. In some embodiments, system 300 may include one or more computer-readable media having instructions (e.g., system memory or NVM / storage device 320) and one or more processors (e.g., one or more processors 305) coupled to the one or more computer-readable media and configured to execute the instructions to implement the module and thus perform the actions described in this application.
[0040] In one embodiment, the system control module 310 may include any suitable interface controller to provide any suitable interface to at least one of the processors 305 and / or any suitable device or component communicating with the system control module 310.
[0041] The system control module 310 may include a memory controller module 330 to provide an interface to the system memory 315. The memory controller module 330 may be a hardware module, a software module, and / or a firmware module.
[0042] System memory 315 can be used, for example, to load and store data and / or instructions for system 300. In one embodiment, system memory 315 may include any suitable volatile memory, such as suitable DRAM. In some embodiments, system memory 315 may include double data rate type quad synchronous dynamic random access memory (DDR4 SDRAM).
[0043] In one embodiment, the system control module 310 may include one or more input / output (I / O) controllers to provide interfaces to the NVM / storage device 320 and (one or more) communication interfaces 325.
[0044] For example, NVM / storage device 320 may be used to store data and / or instructions. NVM / storage device 320 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable (one or more) non-volatile storage devices (e.g., one or more hard disk drives (HDDs), one or more optical disc drives (CDs), and / or one or more digital universal optical disc (DVD) drives).
[0045] NVM / storage device 320 may include storage resources that are physically part of a device on which system 300 is mounted, or that can be accessed by the device without necessarily being part of it. For example, NVM / storage device 320 may be accessed via a network through one or more communication interfaces 325.
[0046] One or more communication interfaces 325 may provide the system 300 with an interface to communicate over one or more networks and / or with any other suitable device. The system 300 may wirelessly communicate with one or more components of a wireless network in accordance with any of one or more wireless network standards and / or protocols.
[0047] In one embodiment, at least one of the processors 305 may be logically packaged with one or more controllers of the system control module 310 (e.g., memory controller module 330). In one embodiment, at least one of the processors 305 may be logically packaged with one or more controllers of the system control module 310 to form a system-in-package (SiP). In one embodiment, at least one of the processors 305 may be integrated with the logic of one or more controllers of the system control module 310 on the same die. In one embodiment, at least one of the processors 305 may be integrated with the logic of one or more controllers of the system control module 310 on the same die to form a system-on-a-chip (SoC).
[0048] In various embodiments, system 300 may be, but is not limited to, a server, workstation, desktop computing device, or mobile computing device (e.g., laptop computing device, handheld computing device, tablet computer, netbook, etc.). In various embodiments, system 300 may have more or fewer components and / or different architectures. For example, in some embodiments, system 300 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touchscreen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.
[0049] It should be noted that this application can be implemented in software and / or a combination of software and hardware, for example, using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In one embodiment, the software program of this application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, a magnetic or optical drive, a floppy disk, or similar devices. Furthermore, some steps or functions of this application can be implemented in hardware, for example, as circuitry that cooperates with a processor to perform the various steps or functions.
[0050] Furthermore, a portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0051] Communication media include media through which communication signals containing, for example, computer-readable instructions, data structures, program modules, or other data are transmitted from one system to another. Communication media can include guided transmission media (such as cables and wires (e.g., optical fibers, coaxial cables, etc.)) and wireless (unguided transmission) media capable of propagating energy waves, such as sound, electromagnetic, RF, microwave, and infrared. Computer-readable instructions, data structures, program modules, or other data can be embodied as modulated data signals in, for example, wireless media (such as carrier waves or similar mechanisms embodied as part of spread spectrum technology). The term "modulated data signal" refers to a signal whose one or more characteristics are altered or set in a manner that encodes information in the signal. Modulation can be analog, digital, or a hybrid modulation technique.
[0052] By way of example and not limitation, computer-readable storage media may include volatile and non-volatile, removable and non-removable media implemented by any method or technique for storing information such as computer-readable instructions, data structures, program modules or other data. For example, computer-readable storage media include, but are not limited to, volatile memories such as random access memory (RAM, DRAM, SRAM); and non-volatile memories such as flash memory, various read-only memories (ROM, PROM, EPROM, EEPROM), magnetic and ferromagnetic / ferroelectric memories (MRAM, FeRAM); and magnetic and optical storage devices (hard disks, magnetic tapes, CDs, DVDs); or other media now known or hereafter developed capable of storing computer-readable information / data for use by a computer system.
[0053] Herein, one embodiment of this application includes an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the apparatus is triggered to run a method and / or technical solution based on the foregoing embodiments of this application.
[0054] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within this application. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in the apparatus claims may also be implemented by a single unit or device in software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any particular order.
Claims
1. A method for data offloading and access processing via a gateway device, characterized in that, The gateway device includes a data exchange area and at least one serial communication interface; the data exchange area includes an uplink data area, and the uplink data area includes a mapping sub-area; the method includes: S11. Receive a first write request sent by a first field device; wherein, the first field device is connected to the serial communication interface of the gateway device through a host communication interface, the gateway device and the first field device use the Modbus-RTU communication protocol, and the first write request includes first data information, a first function code and a first address; S12. If the first address points to the data exchange area, determine the target mapping sub-area corresponding to the first data information according to the first function code, so as to save the first data information to the target mapping sub-area. S13. Determine a target allocation operation for the first data information according to the pre-configured routing policy of the data exchange area; wherein, the target allocation operation includes sending the first data information to a network device, local storage, or forwarding it to another communication interface at least one.
2. The method according to claim 1, characterized in that, The data exchange area further includes a downlink data area, and the method further includes: Receive a second write request sent by the network device; wherein the second write request includes second data information; In response to the second write request, the second data information is stored in the downlink data area so that the first field device can read the corresponding second data information from the downlink data area.
3. The method according to claim 1, characterized in that, The gateway device also includes an inherent functional area, which is associated with the local physical output hardware of the gateway device or the configuration parameters of the gateway device itself, and is used to realize local control or configuration functions.
4. The method according to claim 1, characterized in that, Each of the mapping sub-regions has a mapping relationship with the corresponding function code; determining the target mapping sub-region corresponding to the first data information based on the first function code includes: Based on the first function code, query the mapping sub-region that has a mapping relationship with the first function code from the mapping relationship to determine the target mapping sub-region.
5. The method according to claim 4, characterized in that, The mapping sub-region includes a switch quantity mapping sub-region and a continuous quantity mapping sub-region; the function code includes a bit operation function code and a word operation function code; wherein, there is a mapping relationship between the bit operation function code and the switch quantity mapping sub-region, and there is a mapping relationship between the word operation function code and the continuous quantity mapping sub-region.
6. The method according to claim 1, characterized in that, The first write request is generated by the first field device based on an event-driven mechanism.
7. The method according to claim 1, characterized in that, The method further includes: The third data information of the second field device is obtained through other interfaces; wherein the second field device and the gateway device are communicatively connected through the other interfaces. The target allocation operation includes sending the first data information to the corresponding network device; step S13 includes: The first data information and the third data information are fused together to obtain the fused comprehensive data information, which is then sent to the network device.
8. A gateway device, characterized in that, The gateway device includes a data exchange area and at least one serial communication interface; the data exchange area includes an uplink data area, and the uplink data area includes a mapping sub-area; the gateway device further includes: A first receiving module is configured to receive a first write request sent by a first field device; wherein the first field device is connected to the serial communication interface of the gateway device via a host communication interface, and the gateway device and the first field device use the Modbus-RTU communication protocol; the first write request includes first data information, a first function code, and a first address. The off-flow storage module is used to determine the target mapping sub-area corresponding to the first data information according to the first function code if the first address points to the data exchange area, so as to save the first data information to the target mapping sub-area. The routing decision module is used to determine a target allocation operation for the first data information according to the pre-configured routing policy of the data exchange area; wherein the target allocation operation includes sending the first data information to a network device, local storage, or forwarding it to another communication interface at least one.
9. A computer device, characterized in that, It includes a memory and a processor, wherein the memory stores a method for data offloading access processing via a gateway device as described in any one of claims 1 to 7, which can be loaded by the processor and executed.
10. A computer-readable storage medium, characterized in that, The storage contains a method for data offloading access processing via a gateway device, which can be loaded by a processor and executed as described in any one of claims 1 to 7.