CN110944059A - Communication method and device - Google Patents

Communication method and device Download PDF

Info

Publication number
CN110944059A
CN110944059A CN201911228706.2A CN201911228706A CN110944059A CN 110944059 A CN110944059 A CN 110944059A CN 201911228706 A CN201911228706 A CN 201911228706A CN 110944059 A CN110944059 A CN 110944059A
Authority
CN
China
Prior art keywords
subscription request
subscription
sub
cache
sending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911228706.2A
Other languages
Chinese (zh)
Other versions
CN110944059B (en
Inventor
田中山
赖少川
林样
石莹
许少新
杨昌群
董丹娜
李军汲
招达明
刘维国
汪涛
李育特
黄桂锋
郑家宜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Petroleum and Chemical Corp
Zhejiang Supcon Technology Co Ltd
China Oil and Gas Pipeline Network Corp
Original Assignee
Zhejiang Supcon Technology Co Ltd
Sinopec Sales Co Ltd South China Branch
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Supcon Technology Co Ltd, Sinopec Sales Co Ltd South China Branch filed Critical Zhejiang Supcon Technology Co Ltd
Priority to CN201911228706.2A priority Critical patent/CN110944059B/en
Publication of CN110944059A publication Critical patent/CN110944059A/en
Application granted granted Critical
Publication of CN110944059B publication Critical patent/CN110944059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/566Grouping or aggregating service requests, e.g. for unified processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application provides a communication method and a communication device, which are applied to any equipment in an automatic control system, wherein different equipment in the automatic control system at least communicates through a preset communication network; the method comprises the following steps: sending a first subscription request to a referenced device under the condition that subscription request information is stored in the device; the first subscription request includes: subscribing to the content; the subscription content represents real-time data required to be acquired by the equipment; the quoted equipment is preset equipment storing the real-time data. Under the condition that the device receives the second subscription request, sending subscription response data to the reference device for multiple times; the second subscription request includes: subscribing to the content; the subscription response data includes: real-time data indicated by the subscription content in the second subscription request; the reference device is a device sending a second subscription request to the device; the second subscription request is any one of the subscription requests. By adopting the communication method, the network load of the system can be reduced.

Description

Communication method and device
Technical Field
The present application relates to the field of communications, and in particular, to a method and an apparatus for inter-station communication.
Background
In various automatic control systems, signals that a single device can access are always limited, and in a practical application scenario, any device may need to acquire signals from other devices (i.e., acquire real-time data stored by other devices), that is, communication of real-time data between different devices is needed.
Currently, the way for real-time data communication between different devices includes: any device actively sends real-time data to other devices, and the other devices use the received real-time data if necessary and discard the received real-time data if not necessary.
However, the manner in which any device actively transmits real-time data to other devices causes a problem of heavy system network load.
Disclosure of Invention
The application provides a communication method and a communication device, and aims to solve the problem of high system network load.
In order to achieve the above object, the present application provides the following technical solutions:
the application provides a communication method, which is applied to any equipment in an automatic control system, wherein different equipment in the automatic control system at least communicates through a preset communication network; the method comprises the following steps:
sending a first subscription request to a referenced device under the condition that subscription request information is stored in the device; the first subscription request comprises: subscribing to the content; the subscription content represents real-time data required to be acquired by the equipment; the referenced device is a preset device which stores the real-time data;
under the condition that the device receives the second subscription request, sending subscription response data to the reference device for multiple times; the second subscription request includes: subscribing to the content; the subscription response data includes: real-time data indicated by subscription content in the second subscription request; the reference device is a device sending the second subscription request to the device; the second subscription request is any one subscription request.
Optionally, any one piece of the subscription request information includes: subscribing to content and a subscription request path; the subscription request path is a path of a preset device which stores real-time data required by the device;
the sending of the first subscription request to the referenced device specifically includes:
respectively sending a first subscription request to equipment indicated by a subscription request path in each piece of subscription request information; the first subscription request comprises: and subscribing the content in the corresponding subscription request information.
Optionally, the memory of the device is provided with a subscription request sending buffer; the subscription request sending cache region comprises a plurality of subscription request sending sub-cache regions; any one subscription request sending sub-cache region is used for storing a piece of subscription request information; any one piece of the subscription request information further includes: a subscription request period;
the sending the first subscription request to the device indicated by the subscription request path in each piece of subscription request information respectively includes:
every other preset first calling period, polling all the subscription request sending sub-cache regions, and sequentially judging whether a subscription request period in the subscription request information in each subscription request sending sub-cache region arrives;
and under the condition that the subscription request period in the subscription request information in any one subscription request sending sub-cache region arrives, sending a first subscription request to the device which sends the subscription request path indication in the subscription request information in the sub-cache region to the subscription request.
Optionally, the sequentially determining whether the subscription request period in the subscription request information in each subscription request sending sub-cache region arrives includes:
the subscription request period in the subscription request information in any subscription request sending sub-cache region does not reach; or, under the condition that the subscription request period in the subscription request information in the subscription request sending sub-cache reaches and the first subscription request is sent, judging whether the subscription request period in the subscription request information in the next subscription request sending sub-cache reaches.
Optionally, the sending of the subscription request information in the sub-cache by any one of the subscription requests further includes: subscribing the overtime alarm duration;
the method further comprises the following steps:
every second calling period, polling each subscription request sending sub-cache region, and sequentially judging whether the accumulated time length of the subscription request information in each subscription request sending sub-cache region is equal to the subscription overtime alarm time length; wherein, the accumulated duration of any subscription request information is: the sent time length of the first subscription request of the subscription request information is the sent time length under the condition that the subscription response data information sent by the equipment indicated by the subscription request path in the subscription request information is not received;
and setting an overtime alarm identification bit corresponding to any subscription request information under the condition that the accumulated time length of any subscription request information is equal to the subscription overtime alarm time length.
Optionally, the sending of the subscription request information in the sub-cache by any one of the subscription requests further includes: a subscription request identifier and a subscription request characteristic word;
in the case that a subscription request cycle in subscription request information in any subscription request sending sub-cache arrives, after sending the first subscription request, the device that sends a subscription request path indication in subscription request information in the sub-cache to the subscription request further includes:
under the condition of receiving subscription response data information sent by equipment indicated by a subscription request path in any subscription request information, acquiring a subscription request identifier, a subscription characteristic word and real-time data in the subscription response data information;
under the condition that the subscription request sending sub-cache region comprises a target subscription request sending sub-cache region, storing real-time data in the subscription response data information; the target subscription request sending sub-cache is that a subscription request identifier in the stored subscription request information is the same as a subscription request identifier in the subscription response data information, and a subscription characteristic word in the stored subscription request information is the same as a subscription characteristic word in the subscription response data information.
Optionally, the sending of the subscription request information in the sub-cache by any one of the subscription requests further includes: a subscription response receiving cache area corresponding to the subscription request identifier and the subscription request characteristic word;
the saving of the real-time data in the subscription response data information includes:
and storing the real-time data in the subscription response data information in a subscription response receiving cache area stored in the target subscription request sending sub-cache area.
Optionally, the method further includes:
and deleting the subscription response data information under the condition that the target subscription request information is not stored in the subscription request sending sub-cache region.
Optionally, the method further includes:
and eliminating the overtime alarm identification bit.
Optionally, any piece of subscription request information further includes: a subscription response path, a subscription response period and a subscription number; the subscription response path is used for indicating equipment indicated by the subscription request path in the piece of subscription request information and responding to the path of the subscription request of the piece of subscription request information; the subscription response period is used for indicating equipment indicated by a subscription request path in the piece of subscription request information and responding to the period of a first subscription request of the piece of subscription request information; the subscription times are used for indicating the times of the first subscription request periodically responding to the device indicated by the subscription request path in the piece of subscription request information.
Optionally, the second subscription request further includes a subscription response path; the subscription response path is a path for instructing the device to respond to the second subscription request;
the sending of the subscription response data to the citing device for multiple times specifically includes:
and sending subscription response data to the equipment indicated by the subscription response path in the second subscription request for multiple times.
Optionally, before the sending the subscription response data to the device indicated by the subscription response path in the second subscription request for multiple times, the method further includes:
and saving the information in the second subscription request.
Optionally, the second subscription request further includes: a subscription request identifier, a subscription request characteristic word and subscription times; a memory of the device is provided with a subscription request receiving cache region; the subscription request receiving cache region comprises a plurality of subscription request receiving sub-cache regions; any subscription request receiving sub-cache region is used for storing the information in a received second subscription request;
the saving information in the second subscription request includes:
resetting the number of subscriptions in the target subscription request receiving sub-cache to the number of subscriptions in a second subscription request when the target subscription request receiving sub-cache exists in the subscription request receiving cache; the target subscription request receiving sub-cache is used for storing the subscription request identifier which is the same as the subscription request identifier in the second subscription request, and the feature word of the stored subscription request is the same as the subscription request feature word in the second subscription request.
Optionally, the method further includes:
when the target subscription request receiving sub-cache region does not exist in the subscription request receiving cache region and an idle subscription request receiving sub-cache region exists in the subscription request receiving cache region, storing information in the second subscription request in the idle subscription request receiving sub-cache region;
and waiting for receiving a next second subscription request under the condition that the target subscription request receiving sub-cache region does not exist in the subscription request receiving cache region and an idle subscription request receiving sub-cache region does not exist in the subscription request receiving cache region.
Optionally, the second subscription request further includes: a subscription response period;
the sending, by the device indicated by the subscription response path in the second subscription request, subscription response data multiple times includes:
every other preset third calling period, polling the subscription request receiving sub-cache regions, and sequentially judging whether a subscription response period in each subscription request receiving sub-cache region is reached;
and sending subscription response data to the device indicated by the subscription response path in the subscription request receiving sub-cache region when the subscription response period in any subscription request receiving sub-cache region arrives and the response times of the second subscription request in the subscription request receiving sub-cache region do not reach the corresponding subscription times.
Optionally, a subscription response sending sub-cache corresponding to any subscription request receiving sub-cache is set in a memory of the device;
the sending, by the device that receives the subscription response path indication in the sub-cache from the subscription request, subscription response data includes:
acquiring real-time data indicated by subscription content in a subscription request receiving sub-cache region to obtain real-time data to be sent;
packaging the real-time data to be sent into a subscription response sending sub-cache region;
and under the condition that the packaging is completed, sending subscription response data to the device which receives the subscription response path indication in the sub-cache region according to the subscription request.
Optionally, the method further includes:
and when the subscription response period in any subscription request receiving sub-cache reaches and the number of responses to the subscription request in the subscription request receiving sub-cache reaches the corresponding subscription number, setting the identification position of the subscription request receiving sub-cache as invalid.
Optionally, the polling the subscription request receiving sub-cache regions to sequentially determine whether a subscription response period in each subscription request receiving sub-cache region arrives includes:
and judging whether the subscription response period in the next subscription request receiving sub-cache zone arrives or not under the condition that the subscription response period in any subscription request receiving sub-cache zone does not arrive or the subscription response period in the subscription request receiving sub-cache zone arrives and the second subscription request in the sub-cache zone is received in response to the subscription request.
Optionally, different devices in the automation control system communicate at least through a preset communication network, specifically:
different devices in the automatic control system communicate with the gateway device through a preset communication network.
The application also provides a communication device which is applied to any equipment in the automatic control system, wherein different equipment in the automatic control system at least communicates through a preset communication network; the device comprises:
the first sending module is used for sending a first subscription request to the quoted equipment under the condition that the subscription request information is stored in the equipment; the first subscription request comprises: subscribing to the content; the subscription content represents real-time data required to be acquired by the equipment; the referenced device is a preset device which stores the real-time data;
a second sending module, configured to send subscription response data to the reference device multiple times when the device receives the second subscription request; the second subscription request includes: subscribing to the content; the subscription response data includes: real-time data indicated by subscription content in the second subscription request; the reference device is a device sending the second subscription request to the device; the second subscription request is any one subscription request.
Optionally, any one piece of the subscription request information includes: subscribing to content and a subscription request path; the subscription request path is a path of a preset device which stores real-time data required by the device;
the first sending module is configured to send a first subscription request to a referenced device, and specifically is:
the first sending module is specifically configured to send a first subscription request to a device indicated by a subscription request path in each piece of subscription request information; the first subscription request comprises: and subscribing the content in the corresponding subscription request information.
Optionally, the memory of the device is provided with a subscription request sending buffer; the subscription request sending cache region comprises a plurality of subscription request sending sub-cache regions; any one subscription request sending sub-cache region is used for storing a piece of subscription request information; any one piece of the subscription request information further includes: a subscription request period;
the first sending module is configured to send the first subscription request to the device indicated by the subscription request path in each piece of subscription request information, and includes:
the first sending module is used for polling all the subscription request sending sub-cache regions at intervals of a preset first calling period and sequentially judging whether the subscription request period in the subscription request information in each subscription request sending sub-cache region arrives;
and under the condition that the subscription request period in the subscription request information in any one subscription request sending sub-cache region arrives, sending a first subscription request to the device which sends the subscription request path indication in the subscription request information in the sub-cache region to the subscription request.
Optionally, the first sending module is configured to sequentially determine whether a subscription request period in the subscription request information in each subscription request sending sub-cache reaches, and includes:
the first sending module is configured to send the subscription request information to the subscription request sending sub-cache area in a first subscription request period; or, under the condition that the subscription request period in the subscription request information in the subscription request sending sub-cache reaches and the first subscription request is sent, judging whether the subscription request period in the subscription request information in the next subscription request sending sub-cache reaches.
Optionally, the sending of the subscription request information in the sub-cache by any one of the subscription requests further includes: subscribing the overtime alarm duration; the device further comprises:
the overtime processing module is used for polling each subscription request sending sub-cache region every second calling period and sequentially judging whether the accumulated time length of the subscription request information in each subscription request sending sub-cache region is equal to the subscription overtime alarm time length or not; wherein, the accumulated duration of any subscription request information is: the sent time length of the first subscription request of the subscription request information is the sent time length under the condition that the subscription response data information sent by the equipment indicated by the subscription request path in the subscription request information is not received;
and setting an overtime alarm identification bit corresponding to any subscription request information under the condition that the accumulated time length of any subscription request information is equal to the subscription overtime alarm time length.
Optionally, the sending of the subscription request information in the sub-cache by any one of the subscription requests further includes: a subscription request identifier and a subscription request characteristic word;
the device further comprises: a first execution module;
the first executing module is configured to, when a subscription request cycle in subscription request information in any subscription request sending sub-cache region arrives, the first sending module sends, to a device indicated by a subscription request path in the subscription request information in the sub-cache region, a first subscription request, and then, when receiving subscription response data information sent by the device indicated by the subscription request path in any subscription request information, acquires a subscription request identifier, a subscription feature word, and real-time data in the subscription response data information;
under the condition that the subscription request sending sub-cache region comprises a target subscription request sending sub-cache region, storing real-time data in the subscription response data information; the target subscription request sending sub-cache is that a subscription request identifier in the stored subscription request information is the same as a subscription request identifier in the subscription response data information, and a subscription characteristic word in the stored subscription request information is the same as a subscription characteristic word in the subscription response data information.
Optionally, the sending of the subscription request information in the sub-cache by any one of the subscription requests further includes: a subscription response receiving cache area corresponding to the subscription request identifier and the subscription request characteristic word;
the first execution module is configured to store real-time data in the subscription response data information, and includes:
the first executing module is specifically configured to store the real-time data in the subscription response data information in the subscription response receiving cache region stored in the target subscription request sending sub-cache region.
Optionally, the first executing module is further configured to delete the subscription response data information when the subscription request sending sub-cache region does not include the target subscription request sending sub-cache region.
Optionally, the first execution module is further configured to eliminate the timeout alarm flag.
Optionally, any piece of subscription request information further includes: a subscription response path, a subscription response period and a subscription number; the subscription response path is used for indicating equipment indicated by the subscription request path in the piece of subscription request information and responding to the path of the subscription request of the piece of subscription request information; the subscription response period is used for indicating equipment indicated by a subscription request path in the piece of subscription request information and responding to the period of a first subscription request of the piece of subscription request information; the subscription times are used for indicating the times of the first subscription request periodically responding to the device indicated by the subscription request path in the piece of subscription request information.
Optionally, the second subscription request further includes a subscription response path; the subscription response path is a path for instructing the device to respond to the second subscription request;
the second sending module is configured to send subscription response data to the reference device for multiple times, and specifically includes:
the second sending module is specifically configured to send the subscription response data to the device indicated by the subscription response path in the second subscription request for multiple times.
Optionally, the apparatus further comprises: a second execution module;
the second executing module is configured to store the information in the second subscription request before the second sending module sends the subscription response data to the device indicated by the subscription response path in the second subscription request for multiple times.
Optionally, the second subscription request further includes: a subscription request identifier, a subscription request characteristic word and subscription times; a memory of the device is provided with a subscription request receiving cache region; the subscription request receiving cache region comprises a plurality of subscription request receiving sub-cache regions; any subscription request receiving sub-cache region is used for storing the information in a received second subscription request;
the second executing module is configured to store information in the second subscription request, and includes:
the second execution module is specifically configured to reset the subscription times in the target subscription request receiving sub-cache to the subscription times in the second subscription request when the target subscription request receiving sub-cache exists in the subscription request receiving cache; the target subscription request receiving sub-cache is used for storing the subscription request identifier which is the same as the subscription request identifier in the second subscription request, and the feature word of the stored subscription request is the same as the subscription request feature word in the second subscription request.
Optionally, the second executing module is further configured to, when the target subscription request receiving sub-cache does not exist in the subscription request receiving cache, and an idle subscription request receiving sub-cache exists in the subscription request receiving cache, store information in the second subscription request in the idle subscription request receiving sub-cache;
and waiting for receiving a next second subscription request under the condition that the target subscription request receiving sub-cache region does not exist in the subscription request receiving cache region and an idle subscription request receiving sub-cache region does not exist in the subscription request receiving cache region.
Optionally, the second subscription request further includes: a subscription response period;
the second sending module is configured to send subscription response data to the device indicated by the subscription response path in the second subscription request for multiple times, and includes:
the second sending module is specifically configured to poll the subscription request receiving sub-cache regions every preset third call period, and sequentially judge whether a subscription response period in each subscription request receiving sub-cache region arrives;
and sending subscription response data to the device indicated by the subscription response path in the subscription request receiving sub-cache region when the subscription response period in any subscription request receiving sub-cache region arrives and the response times of the second subscription request in the subscription request receiving sub-cache region do not reach the corresponding subscription times.
Optionally, a subscription response sending sub-cache corresponding to any subscription request receiving sub-cache is set in a memory of the device;
the second sending module is configured to send subscription response data to the device that receives the subscription response path indication in the sub-cache from the subscription request, and includes:
the second sending module is specifically configured to obtain real-time data indicated by the subscription content in the subscription request receiving sub-cache region, and obtain real-time data to be sent;
packaging the real-time data to be sent into a subscription response sending sub-cache region;
and under the condition that the packaging is completed, sending subscription response data to the device which receives the subscription response path indication in the sub-cache region according to the subscription request.
Optionally, the second sending module is further configured to, when a subscription response cycle in any subscription request receiving sub-cache reaches and the number of responses to the subscription request in the subscription request receiving sub-cache reaches the corresponding subscription number, invalidate the identification position of the subscription request receiving sub-cache.
Optionally, the second sending module is configured to sequentially determine whether a subscription response period in each subscription request receiving sub-buffer arrives by polling the subscription request receiving sub-buffers, and includes:
the second sending module is specifically configured to, when the subscription response period in any subscription request receiving sub-cache does not arrive, or the subscription response period in the subscription request receiving sub-cache arrives and a second subscription request in the subscription request receiving sub-cache has been responded, determine whether a subscription response period in a next subscription request receiving sub-cache arrives.
In the communication method and the communication device, the communication method is applied to any equipment in an automatic control system, wherein different equipment in the automatic control system is connected at least through a preset communication network, so that any two pieces of equipment in the automatic control system can be communicated with each other.
In this application, when subscription request information is stored in the device, it indicates that the device needs to acquire real-time data from another device, and sends a first subscription request to a referenced device, where the first subscription request includes: and subscribing content, wherein the subscribing content represents real-time data required to be acquired by the device, and the referenced device is a preset device storing the real-time data, that is, the device only sends a first subscription request to the referenced device. And under the condition that the device receives the second subscription request, sending the real-time data indicated by the subscription content in the second subscription request to the reference device for multiple times, wherein the reference device is the device sending the second subscription request, that is, the device only sends the real-time data to the device sending the subscription request.
Therefore, in the present application, on one hand, the device sends the real-time data only to the device that sends the subscription request, so that the network load of the system can be reduced compared with the prior art in which the device sends the real-time data to all other devices. On the other hand, when receiving the second subscription request, the device sends the real-time data indicated by the subscription content in the second subscription request for multiple times, so that the number of sending the second subscription requests by the reference device can be reduced, and the network load of the system can be further reduced.
In summary, by using the communication method of the present application, the network load of the system can be reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a network connection of an apparatus disclosed in an embodiment of the present application;
fig. 2 is a schematic diagram of memory allocation of a device disclosed in an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a process of sending a subscription request by the device according to an embodiment of the present application;
fig. 4 is a schematic diagram of a subscription request timeout alarm processing procedure disclosed in an embodiment of the present application;
fig. 5 is a schematic diagram of a process of receiving subscription response data disclosed in an embodiment of the present application;
fig. 6 is a schematic diagram of a process of receiving a second subscription request disclosed in an embodiment of the present application;
fig. 7 is a schematic diagram illustrating a process of a device responding to a subscription request according to an embodiment of the present disclosure;
fig. 8 is a flow chart of a communication method disclosed in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a communication device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In this embodiment of the application, any two devices in the automation control system communicate at least through a preset communication network, and specifically, any two devices may communicate with the gateway device through the preset communication network. Specifically, assume that the automation control system includes 4 devices, device a, device B, device D, and device F. The network connection of the four devices is schematically shown in fig. 1. In fig. 1, a device a, a device B, and a gateway device C are connected in a communication network 1, and a device D and a gateway device E are connected with the gateway device C through a communication network 2. The device F is connected to the gateway device E via the communication network 3.
In this embodiment, for convenience of description, a technical solution of the present application is described by taking any device in an automation control system as an example, and in this embodiment, for convenience of description, a device that requests real-time data from the device is referred to as a reference device. The device that requests the real-time data is referred to as the referenced device. In practice, the referenced device of the device is set according to actual requirements, and the setting is completed before communication is carried out between the devices in the automation control system.
Before communication is performed between devices in the automation control system in this embodiment, each device in the automation control system is set, and the content of the setting is described by taking the device as an example. Specifically, the device comprises at least one memory, which is divided into: the device comprises a subscription request sending cache region, a subscription response sending cache region, a subscription request receiving cache region, a subscription response receiving cache region and a state control region, wherein the state control region stores a state control table, and the state control table is used for storing state parameters in the communication process of the device and a referenced device. Meanwhile, a configuration table is also stored in the memory. Specifically, the memory allocation diagram of the device is shown in fig. 2, and A, B, C, D, E and F in fig. 2 respectively represent different memory spaces.
The subscription request sending cache region is used for storing the information of the subscription request sent to the referenced device.
The subscription request sending cache region can be divided into a plurality of subscription request sending sub-cache regions according to the subscription request.
Subscription response receiving cache: for saving real-time data received from the referenced device.
The subscription response receiving cache is divided into a plurality of subscription response receiving sub-caches according to the subscription request.
Subscription request receiving cache: for storing information referencing the subscription request sent by the device.
Subscription request receiving cache: the subscription request receiving sub-cache is divided into a plurality of subscription request receiving sub-caches according to the received subscription request.
Subscription response sending buffer: for storing real-time data referencing device subscriptions.
The subscription response sending cache is divided into a plurality of subscription response sending sub-caches according to the subscription request.
A state control area: a storage area for storing a state control table. The state control table is used for controlling the equipment to subscribe the request process state and subscribe the response process state.
Configuration table: the device is used for storing the information of the mapping relation between the subscription request and the device storage space, the mapping relation between the subscription response data and the device storage space, the subscription request path, the subscription request period, the subscription response path, the subscription response period, the subscription times and the like of the device.
In the embodiment of the present application, a request for acquiring real-time data, which is sent by one device in the automation control system to a preset referenced device, is referred to as a subscription request. And the subscription request identifier and the subscription request characteristic word are used for uniquely identifying the subscription request. The subscription request feature word is used for uniquely identifying a configuration table to which the subscription request belongs, and the subscription request identifier is used for uniquely identifying the subscription request in the configuration table. The information indicating the real-time data requested by any subscription request is called subscription content.
In the embodiment of the present application, a device may send a subscription request to a referenced device periodically, and a period in which the device sends the subscription request to the referenced device is referred to as a subscription request period. In the embodiment of the present application, a path indicating a preset referenced device is referred to as a subscription request path. In the embodiment of the present application, a path that instructs a referenced device to send subscription response data is referred to as a subscription response path. In the embodiment of the present application, a period for instructing a preset referenced device to send subscription response data is referred to as a subscription response period. In this embodiment, the number of times that the preset referenced device transmits the subscription response data is referred to as the subscription number.
In this embodiment of the present application, according to the configuration table and the preset state control table, the configuration table and the state control table are set in the subscription request sending cache region, and since the device may send the subscription request to each of the multiple referenced devices, or may send multiple subscription requests to one referenced device, in this embodiment, according to the subscription request, the subscription request sending cache region may be divided into multiple subscription request sending sub-cache regions, where one subscription request sending sub-cache region may correspond to one subscription request. And respectively setting a configuration table and a state control table in each subscription request sending sub-cache region, wherein the configuration table set in any subscription request sending sub-cache region is used for storing the information of the subscription request corresponding to the subscription request sending sub-cache region. The state control table set in any one of the subscription request sending sub-buffers is used for storing state parameters, such as timeout request alarm duration. In the embodiment of the present application, each subscription request is sent to the configuration table and the information in the state control table in the sub-cache area, which are all referred to as subscription request information.
For any subscription request sending sub-cache region, the subscription request information stored in the configuration table in the subscription request sending sub-cache region may include: the subscription request characteristic word, the subscription request identification, the subscription content, the subscription request path, the subscription request period, the subscription response path, the subscription response period, the subscription times and the like.
In this embodiment of the present application, the device is taken as an example to introduce the technical solution of the present application, and for convenience of description, subscription requests sent by the device are all referred to as first subscription requests, and subscription requests received by the device are all referred to as second subscription requests.
Fig. 3 is a process of sending a subscription request by the device according to the embodiment of the present application, where the process may include the following steps:
s301, judging whether a preset first calling period is reached, if so, executing S302, and if not, executing S301.
In this embodiment, the preset value of the first invocation period may be a minimum value in the subscription request periods respectively included in all the subscription request information in the subscription request sending cache region, and certainly, in practice, the value of the first invocation period may be set according to an actual situation, and this embodiment does not limit a specific value of the first invocation period.
In this step, the meaning of reaching the first call cycle is: the time length from the starting time of judging the subscription request sending subscription request information in the sub-cache region by the last polling to the current time is equal to the first calling period.
It should be noted that if this step is executed for the first time, the determination result is yes, that is, S302 is executed.
S302, judging whether the subscription request period in the subscription request information in the current subscription request sending sub-cache region is reached, if so, entering S303, and if not, entering S304.
And executing the step under the condition that the preset first calling period is reached. In this step, the initial value of the current subscription request sending sub-buffer is the first subscription request sending sub-buffer in the subscription request sending buffer. Specifically, in this step, the subscription request period may be queried from the configuration table stored in the current subscription request sending sub-cache, and when the subscription request period is reached, S303 is executed.
Specifically, in this step, the subscription request cycle in the subscription request information in the current subscription request sending sub-cache arrives, and the meaning represented by the cycle is as follows: the time length from the last time of sending the first subscription request of the subscription request information in the current subscription request sending sub-cache region to the current time is the subscription request period.
And S303, sending the first subscription request to the equipment indicated by the subscription request path in the subscription request information in the sub cache region to the current subscription request.
In this step, the first subscription request may include: the subscription request identification, the subscription characteristic word, the subscription content, the subscription response path, the subscription response period, the subscription times and the like. Specifically, the specific content of the first subscription request may be obtained from a configuration table in the current subscription request sending sub-cache.
In this embodiment, after the first subscription request is sent in this step, a time when the first subscription request is sent this time may be recorded in the state control table in the subscription request sending sub-cache.
S304, judging whether the subscription request sending sub-cache areas in the subscription request sending cache area are inquired, if not, executing S305, and if so, executing S301.
In this step, it is determined whether each of the subscription request transmission sub-buffers in the subscription request transmission buffer is polled in the first call cycle, if not, S305 is executed, and if so, S301 is executed.
S305, updating the current subscription request sending sub-cache region.
Specifically, the next subscription request of the current subscription request sending sub-cache region is sent to the sub-cache region as the current subscription request sending sub-cache region.
Execution returns to S302.
The purpose of this embodiment is: and at intervals of a preset first calling period, polling all the subscription request sending sub-cache regions, sequentially judging whether the subscription request period in the subscription request information in each subscription request sending sub-cache region reaches, and sending a first subscription request to the equipment indicated by the subscription request path in the subscription request information in the subscription request sending sub-cache region under the condition that the subscription request period in the subscription request information in any subscription request sending sub-cache region reaches.
In order to reduce the influence of the device on the network load in a short time, in this embodiment, a subscription request period in subscription request information in any subscription request sending sub-cache is not reached; or, under the condition that the subscription request period in the subscription request information in the subscription request sending sub-cache reaches and the first subscription request is sent, judging whether the subscription request period in the subscription request information in the next subscription request sending sub-cache reaches.
Fig. 4 is a processing procedure of a subscription request timeout alert provided in an embodiment of the present application, including the following steps:
s401, judging whether a preset second calling period is reached, if so, executing S402, and if not, executing S401.
In this embodiment, a value of the preset second call cycle may be set according to an actual situation, and the specific value of the first call cycle is not limited in this embodiment.
In this step, the meaning of reaching the second call cycle is: and the time length from the starting time of the last polling judgment subscription request sending sub-cache to the current time is equal to the second calling period.
It should be noted that if this step is executed for the first time, the determination result is yes, that is, S402 is executed.
S402, judging whether the accumulated time length of the subscription request information in the current subscription request sending sub-cache region is equal to the subscription overtime alarm time length, if so, entering S403, and if not, entering S404.
And executing the step under the condition that the preset second calling period is reached.
In this step, the initial value of the current subscription request sending sub-buffer is the first subscription request sending sub-buffer in the subscription request sending buffer. Specifically, in this step, the time of the first subscription request that is newly sent may be searched for the subscription request information in the sub-cache area sent for the current subscription request from the state control table stored in the sub-cache area sent for the current subscription request.
And calculating the time length from the moment of the first subscription request which is sent latest to the current moment to obtain the accumulated time length of the subscription request information in the current subscription request sending sub-cache region.
In this step, it is determined whether the accumulated time duration is equal to the subscription timeout alarm time duration stored in the subscription request sending sub-buffer, if yes, S403 is executed, and if no, S404 is executed.
S403, obtaining the overtime alarm storage area from the configuration table stored in the subscription request sending sub-cache area, and setting an overtime alarm identification bit.
After this step is performed, S404 is performed.
S404, judging whether the subscription request sending sub-cache areas in the subscription request sending cache area are inquired, if not, executing S405, and if so, executing S401.
In this step, it is determined whether each of the subscription request transmission sub-caches in the subscription request transmission cache is polled in the second call cycle, if not, S405 is executed, and if so, S401 is executed.
S405, updating the current subscription request sending sub-cache region.
Specifically, the next subscription request of the current subscription request sending sub-cache region is sent to the sub-cache region as the current subscription request sending sub-cache region.
Execution returns to S402.
The purpose of this embodiment is: every second calling period, polling each subscription request sending sub-cache region, and sequentially judging whether the accumulated time length of the subscription request information in each subscription request sending sub-cache region is equal to the subscription overtime alarm time length; wherein, the accumulated duration of any subscription request information is: the sent time length of the first subscription request of the subscription request information is the sent time length under the condition that the subscription response data information sent by the equipment indicated by the subscription request path in the subscription request information is not received;
and setting an overtime alarm identification bit corresponding to any subscription request information under the condition that the accumulated time length of any subscription request information is equal to the subscription overtime alarm time length.
After the device sends the first subscription request to the referenced device, the referenced device responds to the first subscription request to obtain subscription response data, and sends the subscription response data to the device, and the device receives the subscription response data, specifically, as shown in fig. 5, fig. 5 is a process of receiving the subscription response data in this embodiment, and may include the following steps:
s501, obtaining subscription response data information.
In this step, the subscription response data information includes: the subscription request identification, the subscription characteristic word and the real-time data.
S502, judging whether the subscription request sending sub-cache region comprises a target subscription request sending sub-cache region or not, if so, executing S503, and if not, executing S506.
In this embodiment, the target subscription request sending sub-cache is that the subscription request identifier in the stored subscription request information is the same as the subscription request identifier in the subscription response data information, and the subscription characteristic word in the stored subscription request information is the same as the subscription characteristic word in the subscription response data information.
And S503, storing the real-time data in the subscription response data information.
Optionally, in this step, the real-time data in the subscription response data information may be stored in the subscription response receiving cache region stored in the target subscription request sending sub-cache region.
Specifically, the subscription response receiving cache corresponding to the subscription request identifier and the subscription feature word may be obtained from the configuration table of the target subscription request sending sub-cache, and the real-time data in the subscription response data information is stored in the subscription response receiving cache.
And S504, notifying the subscription data to quote the task updating data.
In this step, the preset subscription data reference task is notified, and the real-time data is updated to the currently received real-time data. The specific updating process is the prior art and is not described herein again.
And S505, eliminating the overtime alarm identification bit.
In this step, the overtime alarm identification bit corresponding to the target subscription request sending sub-cache region is eliminated. Specifically, the overtime alarm storage area is obtained from the configuration table of the target subscription request sending sub-cache area, and the overtime alarm identification bit is cleared.
And S506, deleting the subscription response data information.
In the case that the target subscription request transmission sub-cache is not included in the subscription request transmission sub-cache, the present step is performed. In this embodiment, the reason why the subscription request sending sub-cache does not include the target subscription request sending sub-cache is mainly as follows: the configuration table in the subscription request sending cache of the device is reset, and the previous subscription request information is invalidated.
In this step, the subscription response data information is deleted, i.e. discarded.
Fig. 6 is a process of receiving a second subscription request according to an embodiment of the present application, including the following steps:
s601, acquiring information in the second subscription request under the condition of receiving the second subscription request.
In this embodiment, the subscription request received by the device is referred to as a second subscription request.
In this step, the information in the second subscription request may include: subscription request identification, subscription request characteristic words, subscription content, subscription request response paths, subscription request response periods, subscription times and the like.
S602, judging whether a target subscription request receiving sub-cache region exists in the subscription request receiving cache region, if so, executing S603, and if not, executing S604.
In this step, the target subscription request receiving sub-cache is configured to store the subscription request identifier that is the same as the subscription request identifier in the second subscription request, and the feature word of the stored subscription request is the same as the subscription request feature word in the second subscription request.
S603, receiving the subscription times of the target subscription request in the sub-cache area, and resetting the subscription times of the target subscription request to the subscription times of the second subscription request.
In this step, the target subscription request receives the subscription times in the second subscription request whose subscription times in the sub-cache are set.
S604, judging whether an idle subscription request receiving sub-cache region exists in the subscription request receiving cache region, if so, executing S605, and if not, executing S607.
In this embodiment, the idle subscription request receiving sub-buffer indicates a subscription request receiving sub-buffer that does not store the second subscription request.
S605, setting an idle subscription request receiving sub-buffer zone as effective.
When the target subscription request receiving sub-cache does not exist in the subscription request receiving cache and an idle subscription request receiving sub-cache exists in the subscription request receiving cache, the step is executed.
S606, saving the information in the second subscription request in the idle subscription request receiving sub-buffer.
Specifically, in this step, the information in the second subscription request may be stored in a form of a configuration table, and of course, in practice, the information in the second subscription request may also be stored in other forms, and this embodiment does not limit the specific storage form.
S607, waiting for receiving the next second subscription request, and sending a notification message to the reference device.
When the target subscription request receiving sub-cache does not exist in the subscription request receiving cache, and an idle subscription request receiving sub-cache does not exist in the subscription request receiving cache, the step is executed.
Specifically, in this step, the second subscription request packet is discarded, that is, the next second subscription request is waited to be received. And, notifying the referring device of the reason for discarding the second subscription request packet.
Fig. 7 is a process of responding to a subscription request by a device according to an embodiment of the present application, where the process may include the following steps:
and S701, judging whether a preset third calling period is reached, if so, executing S702, and if not, executing S701.
In this embodiment, the preset value of the third invocation period may be a minimum value in the subscription request receiving buffer and the subscription response periods in all the second subscription requests. Of course, in practice, the value of the third invoking period may also be set according to the actual situation, and the specific value of the third invoking period is not limited in this embodiment.
It should be noted that, in the embodiment of the present application, all subscription requests received by the device are referred to as second subscription requests.
In this step, the meaning of reaching the third calling period is: the time length from the starting time of the last polling to the current time of the subscription request information in the sub-cache area is judged to be equal to the third calling period.
It should be noted that if this step is executed for the first time, the determination result is yes, that is, S702 is executed.
S702, judging whether the subscription response period in the current subscription request receiving sub-cache region is reached, if so, executing S703, and if not, executing S706.
And executing the step under the condition that the preset third calling period is reached.
In this step, the initial value of the current subscription request receiving sub-buffer is the first subscription request receiving sub-buffer in the subscription request receiving buffers. Specifically, if the information of the second subscription request in the current subscription request receiving sub-cache is stored in the configuration table, in this step, the subscription response period may be queried from the configuration table of the current subscription request receiving sub-cache, and if the subscription response period is reached, S703 is executed.
In this step, the meaning of the arrival of the subscription response period in the current subscription request receiving sub-cache is as follows: the time length from the time of last response to the current subscription request to the time of receiving the second subscription request in the sub-cache is equal to the subscription response period.
S703, determining whether the number of responses to the second subscription request in the current subscription request receiving sub-cache reaches the corresponding subscription number, if not, executing S704, and if so, executing S708.
In this step, the corresponding subscription number refers to the subscription number in the second subscription request in the current subscription request receiving sub-cache.
S704, sending subscription response data to the equipment which receives the subscription response path indication in the sub-cache region according to the current subscription request.
In this step, the subscription response data may include: and the current subscription request receives the subscription request identifier, the subscription request characteristic word and the real-time data indicated by the subscription content in the second subscription request in the sub-cache region.
Optionally, a specific implementation manner of this step may include step a1 to step A3:
and A1, acquiring the real-time data indicated by the subscription content in the current subscription request receiving sub-cache region, and acquiring the real-time data to be sent.
In this step, for convenience of description, the real-time data indicated by the subscription content in the current subscription request receiving sub-buffer is referred to as real-time data to be sent.
And A2, packaging the real-time data to be sent into a subscription response sending sub-buffer area.
The specific implementation manner of this step is the prior art, and is not described herein again.
A3, when the group package is completed, sending the subscription response data to the device indicated by the subscription response path in the current subscription request receiving sub-buffer.
In this step, the subscription response data may include: and the current subscription request receives the subscription request identifier, the subscription request characteristic word and the real-time data indicated by the subscription content in the second subscription request in the sub-cache region.
After the present step is executed, S705 is executed.
S705, subtracting 1 from the remaining response times of the second subscription request in the current subscription request receiving sub-cache.
In this step, the initial value of the remaining response times of the second subscription request in the current subscription request receiving sub-cache is: and the current subscription request receives the subscription times in the second subscription request in the sub-cache region.
S706, judging whether the subscription request receiving sub-cache regions in the subscription request receiving cache region are inquired, if not, executing S707, and if so, executing S701.
In this step, it is determined whether each subscription request receiving sub-cache in the subscription request receiving cache is polled in the third call cycle, if not, S707 is executed, and if yes, S701 is executed.
And S707, updating the current subscription request receiving sub-cache region.
Specifically, the next subscription request receiving sub-cache region of the current subscription request receiving sub-cache region is used as the current subscription request receiving sub-cache region.
Execution returns to S702.
And S708, setting the current subscription request receiving sub-cache area as invalid.
In this step, the current subscription request receiving sub-cache is released for use by other subsequent second subscription requests.
After the present step is executed, S706 is executed.
The purpose of this embodiment is: and at intervals of a preset third calling period, sequentially judging whether the subscription response period in each subscription request receiving sub-cache region arrives or not by polling the subscription request receiving sub-cache regions.
And sending subscription response data to the device indicated by the subscription response path in the subscription request receiving sub-cache region when the subscription response period in any subscription request receiving sub-cache region arrives and the response times of the second subscription request in the subscription request receiving sub-cache region do not reach the corresponding subscription times.
And when the subscription response period in any subscription request receiving sub-cache reaches and the response times of the subscription requests in the subscription request receiving sub-cache reach the corresponding subscription times, setting the identification bit of the subscription request receiving sub-cache to be invalid.
In this embodiment, in order to reduce the influence of the device on the network load in a short time, when the subscription response period in any subscription request receiving sub-cache does not arrive, or the subscription response period in the subscription request receiving sub-cache arrives and a second subscription request in the sub-cache has been received in response to the subscription request, it is determined whether the subscription response period in the next subscription request receiving sub-cache arrives.
The beneficial effects of the above embodiment include:
the beneficial effects are that:
in the embodiment of the application, any two devices in the automatic control system are communicated through the network in a preset mode, so that the devices are not required to be connected together in a hard-wired mode, the cost can be reduced, and meanwhile, the limitation of field working conditions is avoided.
The beneficial effects are that:
in the embodiment of the application, as for any equipment in the automatic control system, which needs to acquire real-time data from the cited equipment, the equipment only needs to be simply set, and the equipment automatically realizes the functions of the embodiment of the application, so that the embodiment of the application has better usability.
The beneficial effects are three:
in the embodiment of the application, the sizes of the subscription request sending cache region, the subscription request receiving cache region, the subscription response receiving cache region and the subscription response sending cache region can be set according to actual conditions, so that for any one device, communication with more or fewer devices can be realized, and the expansibility is better.
The beneficial effects are four:
in the embodiment of the application, for any device, only the data in the subscription request sending cache region needs to be configured in advance, and the subscription request receiving cache region, the subscription response receiving cache region and the subscription response sending cache region do not need to be set in advance. Moreover, a subscription request sending path and a subscription request response path in the subscription request sending cache region can be configured, so that the embodiment of the application is more flexible to use.
The beneficial effects are five:
for any device, when the configuration table in the device changes, the subscription request identifier and the subscription request feature word in the configuration table change, and when the subscription response data sent by the referenced device is received, and when the subscription request identifier and the subscription feature word in the subscription response data are different from the subscription request identifier and the subscription request feature word in the configuration table of the device, the subscription response data are discarded, so that the security of the device is ensured.
The beneficial effects are six:
in the embodiment of the application, for any device, after the device sends the first subscription request, the sent time length of the first subscription request is determined under the condition that subscription response data is not received, and the corresponding alarm identification bit is set under the condition that the sent time length is equal to the preset subscription timeout alarm time length. In addition, the alarm identification position can participate in logic control, so that the embodiment of the application is easy to perform troubleshooting and linkage control.
Fig. 8 is a communication method according to an embodiment of the present application, including the following steps:
s801, when the subscription request information is stored in the device, sends a first subscription request to the referenced device.
Wherein the first subscription request comprises: content is subscribed to. The subscription content represents real-time data that the device needs to acquire. The quoted equipment is preset equipment storing the real-time data.
And S802, under the condition that the equipment receives the second subscription request, sending subscription response data to the reference equipment for multiple times.
In this step, the second subscription request includes: content is subscribed to. The subscription response data includes: the subscription content in the second subscription request indicates real-time data.
The reference device is a device sending a second subscription request to the device, and the second subscription request is any one subscription request.
Fig. 9 is a schematic diagram of a communication device according to an embodiment of the present application, applied to any device in an automation control system, where different devices in the automation control system communicate at least through a predetermined communication network; the device comprises: a first transmission module 901 and a second transmission module 902.
The first sending module 901 is configured to send a first subscription request to a referenced device when subscription request information is stored in the device; the first subscription request includes: subscribing to the content; the subscription content represents real-time data required to be acquired by the equipment; the quoted equipment is preset equipment which stores real-time data;
a second sending module 902, configured to send subscription response data to the reference device multiple times when the device receives the second subscription request; the second subscription request includes: subscribing to the content; the subscription response data includes: real-time data indicated by the subscription content in the second subscription request; the reference device is a device sending a second subscription request to the device; the second subscription request is any one of the subscription requests.
Optionally, any piece of subscription request information includes: subscribing to content and a subscription request path; the subscription request path is a path of a preset device which stores real-time data required by the device;
a first sending module 901, configured to send a first subscription request to a referenced device, specifically:
a first sending module 901, configured to send a first subscription request to a device indicated by a subscription request path in each piece of subscription request information; the first subscription request includes: and subscribing the content in the corresponding subscription request information.
Optionally, the memory of the device is provided with a subscription request sending buffer; the subscription request sending cache region comprises a plurality of subscription request sending sub-cache regions; any subscription request sending sub-cache region is used for storing a piece of subscription request information; any piece of subscription request information further includes: a subscription request period;
a first sending module 901, configured to send a first subscription request to a device indicated by a subscription request path in each piece of subscription request information, respectively, where the first subscription request includes:
a first sending module 901, configured to poll all the subscription request sending sub-cache regions every preset first call period, and sequentially determine whether a subscription request period in the subscription request information in each subscription request sending sub-cache region arrives;
and under the condition that the subscription request period in the subscription request information in any one subscription request sending sub-cache region arrives, sending a first subscription request to the device which sends the subscription request path indication in the subscription request information in the sub-cache region to the subscription request.
Optionally, the first sending module 901 is configured to sequentially determine whether a subscription request period in the subscription request information in each subscription request sending sub-cache reaches, and includes:
a first sending module 901, configured to send a subscription request in the subscription request information in the sub-cache without reaching a subscription request period; or, under the condition that the subscription request period in the subscription request information in the subscription request sending sub-cache reaches and the first subscription request is sent, judging whether the subscription request period in the subscription request information in the next subscription request sending sub-cache reaches.
Optionally, the sending of the subscription request information in the sub-cache by any subscription request further includes: subscribing the overtime alarm duration; the device still includes:
the overtime processing module is used for polling each subscription request sending sub-cache region every second calling period and sequentially judging whether the accumulated time length of the subscription request information in each subscription request sending sub-cache region is equal to the subscription overtime alarm time length or not; wherein, the accumulated duration of any subscription request information is: the sent time length of the first subscription request of the subscription request information is the sent time length under the condition that the subscription response data information sent by the equipment indicated by the subscription request path in the subscription request information is not received;
and setting an overtime alarm identification bit corresponding to any subscription request information under the condition that the accumulated time length of any subscription request information is equal to the subscription overtime alarm time length.
Optionally, the sending of the subscription request information in the sub-cache by any subscription request further includes: a subscription request identifier and a subscription request characteristic word;
the device still includes: a first execution module;
a first executing module, configured to, when a subscription request cycle in subscription request information in any subscription request sending sub-cache reaches, the first sending module 901 sends, to a device indicated by a subscription request path in the subscription request information in the sub-cache, after sending the first subscription request, and when receiving subscription response data information sent by the device indicated by the subscription request path in any subscription request information, the first sending module acquires a subscription request identifier, a subscription feature word, and real-time data in the subscription response data information;
under the condition that the subscription request sending sub-cache region comprises a target subscription request sending sub-cache region, storing real-time data in the subscription response data information; the target subscription request sending sub-cache is that the subscription request identifier in the stored subscription request information is the same as the subscription request identifier in the subscription response data information, and the subscription characteristic word in the stored subscription request information is the same as the subscription characteristic word in the subscription response data information.
Optionally, the sending of the subscription request information in the sub-cache by any subscription request further includes: a subscription response receiving cache area corresponding to the subscription request identifier and the subscription request characteristic word;
the first execution module is used for storing the real-time data in the subscription response data information, and comprises:
the first executing module is specifically configured to store the real-time data in the subscription response data information in the subscription response receiving cache region stored in the target subscription request sending sub-cache region.
Optionally, the first executing module is further configured to delete the subscription response data information when the subscription request sending sub-cache region does not include the target subscription request sending sub-cache region.
Optionally, the first execution module is further configured to eliminate the timeout alarm flag.
Optionally, any piece of subscription request information further includes: a subscription response path, a subscription response period and a subscription number; the subscription response path is used for indicating equipment indicated by the subscription request path in the piece of subscription request information and responding to the path of the subscription request of the piece of subscription request information; the subscription response period is used for indicating a device indicated by a subscription request path in the piece of subscription request information and responding to the period of a first subscription request of the piece of subscription request information; the number of subscriptions is used to indicate the number of times of the first subscription request periodically responding to the device indicated by the subscription request path in the piece of subscription request information.
Optionally, the second subscription request further includes a subscription response path; the subscription response path is a path used for indicating the equipment to respond to the second subscription request;
a second sending module 902, configured to send subscription response data to the referring device multiple times, specifically:
the second sending module 902 is specifically configured to send the subscription response data to the device indicated by the subscription response path in the second subscription request for multiple times.
Optionally, the apparatus further comprises: a second execution module;
and the second execution module is used for storing the information in the second subscription request before the second sending module sends the subscription response data to the device indicated by the subscription response path in the second subscription request for multiple times.
Optionally, the second subscription request further includes: a subscription request identifier, a subscription request characteristic word and subscription times; a memory of the device is provided with a subscription request receiving cache region; the subscription request receiving cache region comprises a plurality of subscription request receiving sub-cache regions; any subscription request receiving sub-cache region is used for storing the information in a received second subscription request;
the second executing module is configured to store information in the second subscription request, and includes:
the second execution module is specifically configured to reset the subscription times in the target subscription request receiving sub-cache to the subscription times in the second subscription request when the target subscription request receiving sub-cache exists in the subscription request receiving cache; the target subscription request receiving sub-cache stores the same subscription request identifier as the subscription request identifier in the second subscription request, and the stored feature word of the subscription request is the same as the subscription request feature word in the second subscription request.
Optionally, the second executing module is further configured to, when the target subscription request receiving sub-cache region does not exist in the subscription request receiving cache region, and when an idle subscription request receiving sub-cache region exists in the subscription request receiving cache region, store information in the second subscription request in the idle subscription request receiving sub-cache region;
and waiting for receiving the next second subscription request under the condition that the target subscription request receiving sub-cache region does not exist in the subscription request receiving cache region and the idle subscription request receiving sub-cache region does not exist in the subscription request receiving cache region.
Optionally, the second subscription request further includes: a subscription response period;
a second sending module 902, configured to send the subscription response data multiple times to the device indicated by the subscription response path in the second subscription request, where the sending module includes:
the second sending module 902 is specifically configured to, every preset third call period, poll the subscription request receiving sub-buffers and sequentially determine whether a subscription response period in each subscription request receiving sub-buffer arrives;
and sending subscription response data to the device indicated by the subscription response path in the subscription request receiving sub-cache region when the subscription response period in any subscription request receiving sub-cache region arrives and the response times of the second subscription request in the subscription request receiving sub-cache region do not reach the corresponding subscription times.
Optionally, a subscription response sending sub-cache corresponding to any subscription request receiving sub-cache is set in a memory of the device;
a second sending module 902, configured to send subscription response data to a device that receives the subscription response path indication in the sub-cache for the subscription request, where the subscription response data includes:
a second sending module 902, configured to specifically obtain real-time data indicated by the subscription content in the subscription request receiving sub-cache region, and obtain real-time data to be sent;
packaging the real-time data to be sent into a subscription response sending sub-cache region;
and under the condition that the packaging is completed, sending subscription response data to the device which receives the subscription response path indication in the sub-cache region according to the subscription request.
Optionally, the second sending module 902 is further configured to, when a subscription response cycle in any subscription request receiving sub-cache reaches and the number of responses to the subscription request in the subscription request receiving sub-cache reaches the corresponding subscription number, invalidate the identification position of the subscription request receiving sub-cache.
Optionally, the second sending module 902 is configured to sequentially determine whether a subscription response period in each subscription request receiving sub-buffer arrives by polling the subscription request receiving sub-buffers, and includes:
the second sending module 902 is specifically configured to, when the subscription response period in any subscription request receiving sub-cache does not arrive, or the subscription response period in the subscription request receiving sub-cache arrives and a second subscription request in the subscription request receiving sub-cache has been received in response to the subscription request, determine whether a subscription response period in a next subscription request receiving sub-cache arrives.
The functions described in the method of the embodiment of the present application, if implemented in the form of software functional units and sold or used as independent products, may be stored in a storage medium readable by a computing device. Based on such understanding, part of the contribution to the prior art of the embodiments of the present application or part of the technical solution may be embodied in the form of a software product stored in a storage medium and including several instructions for causing a computing device (which may be a personal computer, a server, a mobile computing device or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (20)

1. A communication method is characterized in that the method is applied to any equipment in an automatic control system, and different equipment in the automatic control system at least communicates through a preset communication network; the method comprises the following steps:
sending a first subscription request to a referenced device under the condition that subscription request information is stored in the device; the first subscription request comprises: subscribing to the content; the subscription content represents real-time data required to be acquired by the equipment; the referenced device is a preset device which stores the real-time data;
under the condition that the device receives the second subscription request, sending subscription response data to the reference device for multiple times; the second subscription request includes: subscribing to the content; the subscription response data includes: real-time data indicated by subscription content in the second subscription request; the reference device is a device sending the second subscription request to the device; the second subscription request is any one subscription request.
2. The method of claim 1, wherein any piece of the subscription request information comprises: subscribing to content and a subscription request path; the subscription request path is a path of a preset device which stores real-time data required by the device;
the sending of the first subscription request to the referenced device specifically includes:
respectively sending a first subscription request to equipment indicated by a subscription request path in each piece of subscription request information; the first subscription request comprises: and subscribing the content in the corresponding subscription request information.
3. The method of claim 2, wherein the memory of the device is configured with a subscription request send buffer; the subscription request sending cache region comprises a plurality of subscription request sending sub-cache regions; any one subscription request sending sub-cache region is used for storing a piece of subscription request information; any one piece of the subscription request information further includes: a subscription request period;
the sending the first subscription request to the device indicated by the subscription request path in each piece of subscription request information respectively includes:
every other preset first calling period, polling all the subscription request sending sub-cache regions, and sequentially judging whether a subscription request period in the subscription request information in each subscription request sending sub-cache region arrives;
and under the condition that the subscription request period in the subscription request information in any one subscription request sending sub-cache region arrives, sending a first subscription request to the device which sends the subscription request path indication in the subscription request information in the sub-cache region to the subscription request.
4. The method of claim 3, wherein the sequentially determining whether the subscription request period in the subscription request information in each subscription request sending sub-buffer has arrived comprises:
the subscription request period in the subscription request information in any subscription request sending sub-cache region does not reach; or, under the condition that the subscription request period in the subscription request information in the subscription request sending sub-cache reaches and the first subscription request is sent, judging whether the subscription request period in the subscription request information in the next subscription request sending sub-cache reaches.
5. The method of claim 4, wherein any of the subscription request sending subscription request information in the sub-cache further comprises: subscribing the overtime alarm duration;
the method further comprises the following steps:
every second calling period, polling each subscription request sending sub-cache region, and sequentially judging whether the accumulated time length of the subscription request information in each subscription request sending sub-cache region is equal to the subscription overtime alarm time length; wherein, the accumulated duration of any subscription request information is: the sent time length of the first subscription request of the subscription request information is the sent time length under the condition that the subscription response data information sent by the equipment indicated by the subscription request path in the subscription request information is not received;
and setting an overtime alarm identification bit corresponding to any subscription request information under the condition that the accumulated time length of any subscription request information is equal to the subscription overtime alarm time length.
6. The method of claim 5, wherein any of the subscription request sending subscription request information in the sub-cache further comprises: a subscription request identifier and a subscription request characteristic word;
in the case that a subscription request cycle in subscription request information in any subscription request sending sub-cache arrives, after sending the first subscription request, the device that sends a subscription request path indication in subscription request information in the sub-cache to the subscription request further includes:
under the condition of receiving subscription response data information sent by equipment indicated by a subscription request path in any subscription request information, acquiring a subscription request identifier, a subscription characteristic word and real-time data in the subscription response data information;
under the condition that the subscription request sending sub-cache region comprises a target subscription request sending sub-cache region, storing real-time data in the subscription response data information; the target subscription request sending sub-cache is that a subscription request identifier in the stored subscription request information is the same as a subscription request identifier in the subscription response data information, and a subscription characteristic word in the stored subscription request information is the same as a subscription characteristic word in the subscription response data information.
7. The method of claim 6, wherein any of the subscription request sending subscription request information in the sub-cache further comprises: a subscription response receiving cache area corresponding to the subscription request identifier and the subscription request characteristic word;
the saving of the real-time data in the subscription response data information includes:
and storing the real-time data in the subscription response data information in a subscription response receiving cache area stored in the target subscription request sending sub-cache area.
8. The method of claim 6, further comprising:
and deleting the subscription response data information under the condition that the subscription request sending sub-cache region does not comprise the target subscription request sending sub-cache region.
9. The method of claim 6, further comprising:
and eliminating the overtime alarm identification bit.
10. The method of claim 6, wherein any piece of subscription request information further comprises: a subscription response path, a subscription response period and a subscription number; the subscription response path is used for indicating equipment indicated by the subscription request path in the piece of subscription request information and responding to the path of the subscription request of the piece of subscription request information; the subscription response period is used for indicating equipment indicated by a subscription request path in the piece of subscription request information and responding to the period of a first subscription request of the piece of subscription request information; the subscription times are used for indicating the times of the first subscription request periodically responding to the device indicated by the subscription request path in the piece of subscription request information.
11. The method of claim 1, wherein the second subscription request further comprises a subscription response path; the subscription response path is a path for instructing the device to respond to the second subscription request;
the sending of the subscription response data to the citing device for multiple times specifically includes:
and sending subscription response data to the equipment indicated by the subscription response path in the second subscription request for multiple times.
12. The method according to claim 11, before the sending the subscription response data to the device indicated by the subscription response path in the second subscription request for a plurality of times, further comprising:
and saving the information in the second subscription request.
13. The method of claim 12, wherein the second subscription request further comprises: a subscription request identifier, a subscription request characteristic word and subscription times; a memory of the device is provided with a subscription request receiving cache region; the subscription request receiving cache region comprises a plurality of subscription request receiving sub-cache regions; any subscription request receiving sub-cache region is used for storing the information in a received second subscription request;
the saving information in the second subscription request includes:
resetting the number of subscriptions in the target subscription request receiving sub-cache to the number of subscriptions in a second subscription request when the target subscription request receiving sub-cache exists in the subscription request receiving cache; the target subscription request receiving sub-cache is used for storing the subscription request identifier which is the same as the subscription request identifier in the second subscription request, and the feature word of the stored subscription request is the same as the subscription request feature word in the second subscription request.
14. The method of claim 13, further comprising:
when the target subscription request receiving sub-cache region does not exist in the subscription request receiving cache region and an idle subscription request receiving sub-cache region exists in the subscription request receiving cache region, storing information in the second subscription request in the idle subscription request receiving sub-cache region;
and waiting for receiving a next second subscription request under the condition that the target subscription request receiving sub-cache region does not exist in the subscription request receiving cache region and an idle subscription request receiving sub-cache region does not exist in the subscription request receiving cache region.
15. The method of claim 14, wherein the second subscription request further comprises: a subscription response period;
the sending, by the device indicated by the subscription response path in the second subscription request, subscription response data multiple times includes:
every other preset third calling period, polling the subscription request receiving sub-cache regions, and sequentially judging whether a subscription response period in each subscription request receiving sub-cache region is reached;
and sending subscription response data to the device indicated by the subscription response path in the subscription request receiving sub-cache region when the subscription response period in any subscription request receiving sub-cache region arrives and the response times of the second subscription request in the subscription request receiving sub-cache region do not reach the corresponding subscription times.
16. The method according to claim 15, wherein a subscription response sending sub-buffer corresponding to any subscription request receiving sub-buffer is provided in a memory of the device;
the sending, by the device that receives the subscription response path indication in the sub-cache from the subscription request, subscription response data includes:
acquiring real-time data indicated by subscription content in a subscription request receiving sub-cache region to obtain real-time data to be sent;
packaging the real-time data to be sent into a subscription response sending sub-cache region;
and under the condition that the packaging is completed, sending subscription response data to the device which receives the subscription response path indication in the sub-cache region according to the subscription request.
17. The method of claim 15, further comprising:
and when the subscription response period in any subscription request receiving sub-cache reaches and the number of responses to the subscription request in the subscription request receiving sub-cache reaches the corresponding subscription number, setting the identification position of the subscription request receiving sub-cache as invalid.
18. The method of claim 15, wherein the sequentially determining whether the subscription response period in each subscription request receiving sub-buffer arrives by polling the subscription request receiving sub-buffers comprises:
and judging whether the subscription response period in the next subscription request receiving sub-cache zone arrives or not under the condition that the subscription response period in any subscription request receiving sub-cache zone does not arrive or the subscription response period in the subscription request receiving sub-cache zone arrives and the second subscription request in the sub-cache zone is received in response to the subscription request.
19. The method according to any one of claims 1 to 18, wherein different devices in the automation control system communicate at least via a predetermined communication network, in particular:
different devices in the automatic control system communicate with the gateway device through a preset communication network.
20. The communication device is applied to any equipment in an automatic control system, and different equipment in the automatic control system at least communicates through a preset communication network; the device comprises:
the first sending module is used for sending a first subscription request to the quoted equipment under the condition that the subscription request information is stored in the equipment; the first subscription request comprises: subscribing to the content; the subscription content represents real-time data required to be acquired by the equipment; the referenced device is a preset device which stores the real-time data;
a second sending module, configured to send subscription response data to the reference device multiple times when the device receives the second subscription request; the second subscription request includes: subscribing to the content; the subscription response data includes: real-time data indicated by subscription content in the second subscription request; the reference device is a device sending the second subscription request to the device; the second subscription request is any one subscription request.
CN201911228706.2A 2019-12-04 2019-12-04 Communication method and device Active CN110944059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911228706.2A CN110944059B (en) 2019-12-04 2019-12-04 Communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911228706.2A CN110944059B (en) 2019-12-04 2019-12-04 Communication method and device

Publications (2)

Publication Number Publication Date
CN110944059A true CN110944059A (en) 2020-03-31
CN110944059B CN110944059B (en) 2022-07-05

Family

ID=69909537

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911228706.2A Active CN110944059B (en) 2019-12-04 2019-12-04 Communication method and device

Country Status (1)

Country Link
CN (1) CN110944059B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100064005A1 (en) * 2006-06-16 2010-03-11 Toshiyuki Amaya Content acquisition processing device, content distribution system, content acquisition processing method, and its program
US20110214170A1 (en) * 2011-04-15 2011-09-01 Wenqing Wu Method and system of serving subscribed contents from multiple sources via a global communications network
CN104539662A (en) * 2014-12-12 2015-04-22 小米科技有限责任公司 Information transmission method and device
CN106605208A (en) * 2014-08-29 2017-04-26 微软技术许可有限责任公司 Client device and host device subscriptions
CN108696374A (en) * 2017-04-10 2018-10-23 北京京东尚科信息技术有限公司 Update the method and apparatus of client configuration
CN109033312A (en) * 2018-07-17 2018-12-18 北京百度网讯科技有限公司 Method and apparatus for obtaining information
CN109525625A (en) * 2017-09-20 2019-03-26 华为技术有限公司 A kind of information subscribing method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100064005A1 (en) * 2006-06-16 2010-03-11 Toshiyuki Amaya Content acquisition processing device, content distribution system, content acquisition processing method, and its program
US20110214170A1 (en) * 2011-04-15 2011-09-01 Wenqing Wu Method and system of serving subscribed contents from multiple sources via a global communications network
CN106605208A (en) * 2014-08-29 2017-04-26 微软技术许可有限责任公司 Client device and host device subscriptions
CN104539662A (en) * 2014-12-12 2015-04-22 小米科技有限责任公司 Information transmission method and device
CN108696374A (en) * 2017-04-10 2018-10-23 北京京东尚科信息技术有限公司 Update the method and apparatus of client configuration
CN109525625A (en) * 2017-09-20 2019-03-26 华为技术有限公司 A kind of information subscribing method and device
CN109033312A (en) * 2018-07-17 2018-12-18 北京百度网讯科技有限公司 Method and apparatus for obtaining information

Also Published As

Publication number Publication date
CN110944059B (en) 2022-07-05

Similar Documents

Publication Publication Date Title
CN110365748B (en) Service data processing method and device, storage medium and electronic device
US20150026277A1 (en) Method and system for message processing
JP5222002B2 (en) In-vehicle relay connection unit
CN109688214B (en) Data transmission method, device and storage medium
EP3122077B1 (en) Resource notification method, local common service entity (cse) and resource notification system
JP7348293B2 (en) Data processing methods and equipment
CN113114570A (en) Control method, device and system of flow table item
CN112579515A (en) Thread message processing method and related product
CN112737940A (en) Data transmission method and device
CN112671813A (en) Server determination method, device, equipment and storage medium
CN110944059B (en) Communication method and device
CN112838980B (en) Message processing method, system, device, electronic equipment and storage medium
CN112039835B (en) Adaptive polling time estimation method, device, equipment and storage medium
CN110460486B (en) Service node monitoring method and system
US10469388B2 (en) Flow entry delivering method, flow entry storage method, related apparatus, and related system
CN112804301A (en) Method and device for determining equipment state, gateway and storage medium
CN114585026A (en) Frequency point switching method, terminal, base station and storage medium
CN111953608B (en) Neighbor table entry management method and device, electronic equipment and storage medium
CN107820205A (en) Chat creation method and equipment under a kind of mobile context
CN111464442B (en) Method and device for routing data packet
CN108512769B (en) Method and related equipment for sending and receiving flow table items in software defined network
JPH0927989A (en) Polling system
CN117891779A (en) Access method and device of network file system, storage medium and electronic equipment
CN117909269A (en) Network control method, system, device, equipment and storage medium
EP3843342A1 (en) Communication method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200904

Address after: 100029 No. 22 North Main Street, Chaoyang District, Beijing, Chaoyangmen

Applicant after: China Petroleum & Chemical Corp.

Applicant after: South China branch of Sinopec Sales Co.,Ltd.

Applicant after: ZHEJIANG SUPCON TECHNOLOGY Co.,Ltd.

Address before: 510180 room 1402, No. 81, Zhongshan 7th Road, Liwan District, Guangzhou City, Guangdong Province

Applicant before: South China branch of Sinopec Sales Co.,Ltd.

Applicant before: ZHEJIANG SUPCON TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230712

Address after: 100029 No. 22 North Main Street, Chaoyang District, Beijing, Chaoyangmen

Patentee after: CHINA PETROLEUM & CHEMICAL Corp.

Patentee after: National Petroleum and natural gas pipeline network Group Co.,Ltd.

Patentee after: ZHEJIANG SUPCON TECHNOLOGY Co.,Ltd.

Address before: 100029 No. 22 North Main Street, Chaoyang District, Beijing, Chaoyangmen

Patentee before: CHINA PETROLEUM & CHEMICAL Corp.

Patentee before: South China branch of Sinopec Sales Co.,Ltd.

Patentee before: ZHEJIANG SUPCON TECHNOLOGY Co.,Ltd.