CN113810357B - Distributed gateway system, data interaction method and medium of distributed gateway system - Google Patents

Distributed gateway system, data interaction method and medium of distributed gateway system Download PDF

Info

Publication number
CN113810357B
CN113810357B CN202110003049.2A CN202110003049A CN113810357B CN 113810357 B CN113810357 B CN 113810357B CN 202110003049 A CN202110003049 A CN 202110003049A CN 113810357 B CN113810357 B CN 113810357B
Authority
CN
China
Prior art keywords
gateway
execution
resource consumption
consumption value
access equipment
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.)
Active
Application number
CN202110003049.2A
Other languages
Chinese (zh)
Other versions
CN113810357A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110003049.2A priority Critical patent/CN113810357B/en
Publication of CN113810357A publication Critical patent/CN113810357A/en
Application granted granted Critical
Publication of CN113810357B publication Critical patent/CN113810357B/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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • 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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure relates to the technical field of internet of things, and provides a distributed gateway system, a data interaction method of the distributed gateway system, a computer storage medium and electronic equipment, wherein the distributed gateway system comprises: the management gateway is used for acquiring the current resource consumption value of each execution gateway when receiving a connection request message sent by the access equipment; allocating an execution gateway for the access equipment according to the current resource consumption value; wherein, the connection request message is in a predefined message format; and the execution gateway is used for processing the service request of the access equipment. The distributed gateway system in the disclosure not only can be simultaneously accessed into mass equipment, but also can solve the problem that network congestion and data processing speed are influenced due to overlarge consumption value of single hardware gateway resources in the related technology, ensures high availability of the system, and improves service processing efficiency.

Description

Distributed gateway system, data interaction method and medium of distributed gateway system
Technical Field
The disclosure relates to the technical field of internet of things, and in particular relates to a distributed gateway system, a data interaction method of the distributed gateway system, a computer storage medium and electronic equipment.
Background
Along with the continuous and deep concept of the internet of things, various intelligent household appliances are layered endlessly, and our lives are improved. Meanwhile, the gateway of the internet of things will become an important link for connection. As gateway equipment, the gateway of the internet of things is required to be provided with a certain management function of bottom node equipment besides being responsible for protocol conversion among different types of perception networks, know the relevant information of each node and realize remote control.
The existing IoT-Gateway (internet of things Gateway) is mainly based on intelligent hardware, and remote control of equipment is achieved through an internal communication protocol MQTT (Message Queuing Telemetry Transport, message queue telemetry transport protocol, an instant messaging protocol), MODBUS (a serial communication protocol), JTT808 (beidou standard 808 protocol) and the like. However, on the one hand, a single hardware gateway only supports access to a small number of devices; on the other hand, each equipment manufacturer has own private communication protocol, and the communication protocols are not uniform.
In view of this, there is a need in the art to develop a new distributed gateway system.
It should be noted that the information disclosed in the foregoing background section is only for enhancing understanding of the background of the present disclosure.
Disclosure of Invention
The disclosure aims to provide a distributed gateway system, a data interaction method of the distributed gateway system, a computer storage medium and electronic equipment, so that the defect of high development cost caused by non-uniform communication protocols of access equipment in the related technology is avoided at least to a certain extent.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a distributed gateway system comprising: the management gateway is used for acquiring the current resource consumption value of each execution gateway when receiving a connection request message sent by the access equipment; allocating an execution gateway for the access equipment according to the current resource consumption value; wherein, the connection request message is in a predefined message format; and the execution gateway is used for processing the service request of the access equipment.
In an exemplary embodiment of the present disclosure, after receiving the connection request packet sent by the access device, the management gateway is further configured to: detecting whether the connection request message contains a pre-agreed reverse definition identifier or not; if the connection request message contains the antisense mark, carrying out antisense processing on the connection request message; and carrying out safety verification on the information obtained after the antisense processing.
In an exemplary embodiment of the present disclosure, the connection request packet includes identity information of the access device; after performing security verification on the information obtained after the antisense processing, the management gateway is further configured to: if the security check is passed, analyzing the connection request message according to the predefined message format to acquire the identity information of the access equipment; and authenticating the access equipment according to the identity information.
In an exemplary embodiment of the present disclosure, the step of parsing the connection request message according to the predefined message format to obtain the identity information of the access device includes: analyzing the connection request message according to the predefined message format to obtain an encrypted message body; and decrypting the encrypted message body to obtain the identity information of the access equipment.
In an exemplary embodiment of the present disclosure, the encrypted message body is formed by splicing a byte code and a byte code length of an original message body; the step of decrypting the encrypted message body to obtain the identity information of the access device includes: determining byte codes and byte code lengths of the original message body according to the encrypted message body; and decrypting the byte codes and the byte code length by adopting a preset decryption algorithm to obtain the identity information of the access equipment.
In an exemplary embodiment of the present disclosure, the allocating an execution gateway to the access device according to the current resource consumption value includes: detecting whether at least one execution gateway with a resource consumption value smaller than a preset threshold exists currently; if yes, selecting an execution gateway from the execution gateways with the resource consumption values smaller than a preset threshold value, and distributing the execution gateway to the access equipment; if not, selecting the execution gateway with the minimum resource consumption value, and distributing the execution gateway to the access equipment.
In an exemplary embodiment of the disclosure, the selecting an execution gateway from the execution gateways whose resource consumption values are smaller than a preset threshold value includes: randomly selecting an execution gateway from the execution gateways with the resource consumption values smaller than a preset threshold value based on a random algorithm; or selecting an execution gateway with the minimum gateway serial number from the execution gateways with the resource consumption value smaller than a preset threshold value; or selecting an execution gateway with the largest gateway sequence number from the execution gateways with the resource consumption values smaller than a preset threshold value.
In an exemplary embodiment of the present disclosure, the system further comprises a standby management gateway for: receiving a heartbeat data packet sent by the management gateway at fixed time; if the heartbeat data packet is not received within the preset time, determining that the management gateway is down, and taking over the management gateway.
According to a second aspect of the present disclosure, there is provided a data interaction method of a distributed gateway system, including: when the management gateway receives a connection request message sent by the access equipment, acquiring the current resource consumption value of each execution gateway; wherein, the connection request message is in a predefined message format; and allocating an execution gateway for the access equipment according to the current resource consumption value so as to enable the execution gateway to process the service request of the access equipment.
According to a third aspect of the present disclosure, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the data interaction method of the distributed gateway system described in the second aspect above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the data interaction method of the distributed gateway system of the second aspect described above via execution of the executable instructions.
As can be seen from the above technical solutions, the distributed gateway system, the data interaction method of the distributed gateway system, the computer storage medium, and the electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
In the technical solutions provided by some embodiments of the present disclosure, on one hand, on the other hand, by setting a predefined message format in the present disclosure, the problem that in the related art, a communication protocol between equipment manufacturers is not uniform, which results in a need of protocol adaptation and a large development difficulty can be solved, and development cost is reduced. On the other hand, when the management gateway receives a connection request message sent by the access equipment, the current resource consumption value of each execution gateway is obtained, and the execution gateway is allocated to the access equipment according to the current resource consumption value, so that the execution gateway processes the service request of the access equipment, and based on the master-slave architecture, mass equipment can be accessed simultaneously, the problems of network congestion and data processing speed influence caused by overlarge single hardware gateway resource consumption value in the related technology can be solved, the high availability of the system is ensured, and the service processing efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
Fig. 1 shows an architecture schematic of a distributed gateway system in an exemplary embodiment of the present disclosure;
fig. 2 is a flow diagram illustrating an access device generating an encrypted message body in an exemplary embodiment of the present disclosure;
fig. 3 is a schematic flow chart of an access device for encapsulating, checking, and escaping an encrypted message body in an exemplary embodiment of the disclosure;
fig. 4 is a schematic flow chart of a management gateway acquiring identity information of an access device according to an exemplary embodiment of the disclosure;
fig. 5 is a flow diagram of an allocation of an execution gateway for an access device by a management gateway in an exemplary embodiment of the present disclosure;
6A-6E illustrate schematic diagrams of a management gateway assigning an enforcement gateway to an access device in an exemplary embodiment of the present disclosure;
fig. 7 is a flow diagram illustrating processing of a service request of an access device by an execution gateway in an exemplary embodiment of the present disclosure;
FIG. 8 illustrates an interactive process diagram of a distributed gateway system in an exemplary embodiment of the present disclosure;
fig. 9 shows a flow diagram of a data interaction method of a distributed gateway system in an exemplary embodiment of the present disclosure;
FIG. 10 illustrates an overall flow diagram of a method of data interaction for a distributed gateway system in an exemplary embodiment of the present disclosure;
Fig. 11 shows a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. One skilled in the relevant art will recognize, however, that the aspects of the disclosure may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
The terms "a," "an," "the," and "said" are used in this specification to denote the presence of one or more elements/components/etc.; the terms "comprising" and "having" are intended to be inclusive and mean that there may be additional elements/components/etc. in addition to the listed elements/components/etc.; the terms "first" and "second" and the like are used merely as labels, and are not intended to limit the number of their objects.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
The existing IoT-Gateway is mainly based on intelligent hardware, and remote control of the device is achieved through an internal communication protocol MQTT (Message Queuing Telemetry Transport, message queue telemetry transport protocol, an instant messaging protocol), MODBUS (a serial communication protocol), JTT808 (beidou standard 808 protocol), and the like. However, the above scheme has the following drawbacks:
(1) a single gateway only supports access to a small number of devices, a large number of gateways must be deployed to support access of mass devices, and the cost is extremely high;
(2) faults are easy to occur, and the fault recovery time is long;
(3) the hardware development period is long;
(4) each equipment manufacturer has own private communication protocol, the communication protocols are not uniform, protocol adaptation is needed, and development difficulty is high.
In the embodiments of the present disclosure, a distributed gateway system is provided first, which overcomes, at least to some extent, the defect that the development cost is high due to non-uniform communication protocols of access devices in the related art.
Fig. 1 illustrates a schematic diagram of a distributed gateway system in an exemplary embodiment of the present disclosure, referring to fig. 1, a distributed gateway system according to one embodiment of the present disclosure may include a management gateway 110 and an execution gateway 120. Wherein:
a management gateway 110, configured to obtain a current resource consumption value of each execution gateway when receiving a connection request packet sent by an access device; allocating an execution gateway for the access equipment according to the current resource consumption value; wherein, the connection request message is in a predefined message format;
gateway 120 is implemented for processing service requests of access devices.
In the technical scheme provided by the embodiment shown in fig. 1, on one hand, by setting a predefined message format in the disclosure, the problem that in the related art, a communication protocol between equipment manufacturers is not uniform, so that protocol adaptation is required and development difficulty is high can be solved, and development cost is reduced. On the other hand, when the management gateway receives a connection request message sent by the access equipment, the current resource consumption value of each execution gateway is obtained, and the execution gateway is allocated to the access equipment according to the current resource consumption value, so that the execution gateway processes the service request of the access equipment, and based on the master-slave architecture, mass equipment can be accessed simultaneously, the problems of network congestion and data processing speed influence caused by overlarge single hardware gateway resource consumption value in the related technology can be solved, the high availability of the system is ensured, and the service processing efficiency is improved.
The detailed implementation of the various parts of fig. 1 is described in detail below:
the access device in the disclosure can be an internet of things device, such as a television, a computer, a washing machine, a refrigerator, an air conditioner, an electric lamp and the like, and can be set according to actual conditions, and belongs to the protection scope of the disclosure.
The management gateway and the execution gateway in the present disclosure may be software gateways, that is, the whole set of gateway system is installed and deployed on its own server, and by changing the port mapping, the setting of the external network such as IP ((Internet Protocol, internet protocol, abbreviated as IP)), etc., all the mails of the enterprise are filtered by the software gateway, and then reach the mail server inside the enterprise.
By deploying the software gateway, the method has the following advantages: the product is convenient to carry and easy to install and test. Enterprises can download manufacturer products through a network at any time to perform local tests; (2) lower cost. Compared with a hardware gateway and a managed gateway, the software gateway concentrates all resources on the research and development and updating of products, so that on one hand, the gateway system with stronger effect can be concentrated for clients, and on the other hand, the cost of the products can be reduced; (3) easy maintenance. As long as the enterprise network keeps the connection of the external network smooth, manufacturers can provide 24-hour online technical support service for the enterprise through the remote network at any time, and the fault of more than 99% is solved. If a hardware fault is encountered, the hardware gateway manufacturer can only solve the problem by providing field service, which is time-consuming and labor-consuming. Because the software product has the characteristic of high portability, when hardware faults which cannot be solved in a short time are encountered, the gateway application can be recovered in time by replacing the server, and the original server is repaired to recover the software gateway system, so that the influence on enterprise mail communication is reduced to the greatest extent; and (4) the enterprise has strong management master control on the gateway system. The whole set of gateway system is deployed on the enterprise server, and a system administrator can manage and control the gateway system; and (5) the data security is high. On one hand, an administrator can comprehensively manage and control the gateway system, and on the other hand, for software intercepted by the gateway system, the administrator can search, check, release or restore operation at any time, so that the misjudgment rate of system mails is reduced; (6) powerful. Compared with a fixed hardware gateway product, the software gateway has stronger system function expansibility, is convenient for upgrading and customizing personalized function requirements, and provides other functions (such as global relay service, mail monitoring, mail auditing, intelligent filtering, mail archiving, intelligent filtering and the like) besides anti-spam and anti-virus for enterprises.
In an exemplary embodiment of the present disclosure, a description is first given of a message format predefined in the present disclosure: the message format includes a frame header, a message body, and a frame check, and specifically, reference may be made to table 1:
TABLE 1
Figure BDA0002882485910000071
Figure BDA0002882485910000081
It should be noted that, in the message body attribute, different first frame marks and last frame marks correspond to different frame numbers. Specifically, when the first frame is marked as 1 and the last frame is marked as 1, the short message is represented, and the short message has only one frame, and the frame number is 1; when the first frame is marked as 1 and the last frame is marked as 0, the message is a long message, the subpacket is required to be transmitted, and the frame number is 1 (which indicates that the frame is the first frame currently); when the first frame is marked as 0 and the last frame is marked as 0, the middle frame of the long message is represented, and the frame sequence number is 2-N-1; when the first frame is marked as 0 and the last frame is marked as 1, this indicates that the message is the last frame of a long message, and the frame number is N. Specifically, reference may be made to the following table 2:
TABLE 2
Figure BDA0002882485910000082
Illustratively, the custom message formats in this disclosure are explained below in connection with a specific one complete frame example:
for example, one complete frame example may be "7E-64310001001060002000-000200086C617469747564650008343236393338383400096C6F6E67697475646500093132353531383736340000-3A4C", wherein:
7E represents a frame header, 1 byte;
"64310001001060002000" indicates the header of the message, 10 bytes. Where "6431" is the byte code of the device ID ("d 1"). "0001" is an opcode that is a byte code of "1" and is defined by itself, for example, "1" may be defined to indicate registration. "0010" is a serial number, representing a byte code of "2". "60002000" is a message body attribute, the binary form of which is: 01100000000000000010000101110000, 31bit 0 indicates that the message is not encrypted, 30bit and 29bit 1 indicate that the message is short message (011), only one frame is provided, the frame number is 1 (0000000000000001), and the message body length is: 46 (decimal form of 0000101110), bit 2-0 being "000" indicates that the message type is data;
the method and the device have the advantages that '000200086C 617469747564650008343236393338383400096C6F6E 67697475646500093132353531383736340000' represents a message body, and comprises two key-value pairs (longitude: 125518764 and latitude: 42693884), each information item is represented in a key-value form by adopting a Map data structure, so that dynamic addition and deletion of the information item can be realized to support complex business scenes, and therefore, the problems that the format of the message body is fixed, the information item is preset fixed information, the dynamic addition and deletion of the information item is not supported, and therefore, only a small amount of business requirements can be met and the complex business scenes cannot be supported can be solved.
"3A4C" means a frame check, which is obtained by performing CRC check on bytes from a message header to a message body by a table look-up method.
The following process of generating a connection request message by the access device and transmitting the connection request message to the management gateway is described:
the access device may first encrypt the original message body (including identity information of the access device, e.g., device ID, manufacturer, etc.) to obtain an encrypted message body. Specifically, referring to fig. 2, fig. 2 shows a schematic flow chart of generating an encrypted message body by an access device in an exemplary embodiment of the disclosure, including steps S201 to S203:
in step S201, key-value pairs (key-value) in the original message body are determined.
In step S202, the byte code and the byte code length corresponding to the key are obtained, and the byte code length corresponding to the key are obtained.
Determining byte codes corresponding to the keywords (such as identification numbers and manufacturers) based on a coding algorithm, and determining byte code lengths corresponding to the byte codes; and determining the byte codes corresponding to the key values (such as d1 and XX manufacturer), and determining the byte code length corresponding to the byte codes. In the calculation process, the obtained value can be temporarily stored in a buffer area to avoid data loss.
Wherein, byte (usually used as a computer information measurement unit, not dividing into data types, one byte represents eight bits) is a unit for transmitting information (or storing information in a hard disk or a memory) through a network, and according to the rule in a computer, one English character occupies one byte, and one Chinese character and punctuation marks and characters of the Chinese character occupy two bytes. Byte-code (Byte-code) is a binary file consisting of a sequence of op code/data pairs, which contains the executable program, and is an intermediate code.
For example, taking the keyword "longitude" as an example, the corresponding bytecode based on the encoding algorithm is: 6C6F6E676974756465. The byte code is in hexadecimal form, two hexadecimal bits represent a byte, and 18 bits are the total number of the byte code, so that the byte code length is 9 by dividing 18 by 2.
In step S203, the byte codes and the byte code lengths are spliced to obtain an encrypted message body.
Illustratively, the following shows program pseudocode that encrypts an original message body to obtain an encrypted message body:
Figure BDA0002882485910000101
Figure BDA0002882485910000111
Figure BDA0002882485910000121
after obtaining the encrypted message body, the access device may encapsulate, check, and escape the encrypted message body, and for example, reference may be made to fig. 3, where fig. 3 illustrates a flowchart of encapsulating, checking, and escape the encrypted message body in an exemplary embodiment of the disclosure, including steps S301-S303:
In step S301, the encrypted message body is encapsulated, and a data packet is obtained.
When one computer is to transmit data information to another computer, some network control information and data information are added and transmitted together, and during the transmission, the network device decides how to forward according to the control information. Examples of network control information include address, session ID, and protocol parameters. The operation of adding control information is encapsulation. Encapsulation is a network-modular mechanism that allows the network at the location of the packet to read control information from the received packet and react appropriately according to the protocol.
In step S302, a check code is calculated for all bytes from the header to the body of the message, and the resulting check code is padded into the data packet.
In this step, the access device may calculate its check code for all bytes from the message header to the message body. Illustratively, the hash function can be evaluated on the data, illustratively, the data string of any length can be converted into a short value of fixed length based on the Md5 verification algorithm, so as to obtain the verification code of the data; or, calculating CRC (Cyclical Redundancy Check, cyclic redundancy code) of the data to obtain a check code thereof; or, the data is digitally signed, and the digital signature is used as verification information.
The following describes a specific embodiment of this step by taking CRC check as an example: the CRC code is calculated by presetting 16-bit registers to be 1. And then gradually processing every 8 bits of data information. When the CRC code calculation is performed, only 8 data bits are used, and the start bit and the stop bit, including parity check bits if any, do not participate in the CRC code calculation. When calculating CRC code, 8-bit data is exclusive-or' ed with the data of the register, the obtained result is shifted one byte to the lower side, and the highest bit is filled with 0. Checking the lowest bit, xoring the content of the register with the preset number if the lowest bit is 1, and not xoring if the lowest bit is 0. This process was repeated 8 times all the time. After the 8 th shift, the next 8 bits are exclusive-ored with the contents of the now-present register, and the process is repeated 8 times as above. After all the data information is processed, the content of the last register is the CRC code value. The low byte is before the data in the CRC code is sent and received.
After the above CRC check code is obtained, the CRC check code may be filled in a preset position in the transmission information, for example: and sending the tail of the information.
In step S303, it is detected whether the message header, the message body or the frame check includes an escape identifier, and if so, the escape identifier is subjected to an escape process according to a preset escape rule.
For example, it may be detected whether the message header, the message body or the frame check includes an escape identifier 0x7e, and if so, the escape identifier is subjected to an escape process according to a preset escape rule. The escape is performed because the data reported by the device is transmitted in a streaming form, for example, the device sends two messages: 0x7e … … 0x7e … …, each frame must be precisely located from the stream data when the message is parsed, and the location frame depends on the frame header 0x7e. If a frame, except for the frame header, is 0x7e, which occurs at other locations, such as: 0x7e … 0x7e … x7e … …, in fact two frames of data, if not escape, would resolve into three frames (misinterpretation of 3 frame headers).
For example, the preset escape rule may be: 0x7e is represented by 0x7d0x 01; 0x7d is denoted by 0x7d0x 00. For example, when the data content is "0x30 0x7e 0x08 0x7d 0x55 0xff 0x05 0xfe 0x66", the data content obtained after escape is "0x30 0x7d0x01 0x08 0x7d0x00 0x55 0xff 0x05 0xfe 0x66".
After the escape processing, the connection request message may be obtained, and further, the access device may send the connection request message to the management gateway.
Referring to fig. 1, a management gateway 110 is configured to obtain current resource consumption values of each execution gateway when receiving a connection request packet sent by an access device; and allocating an execution gateway for the access device according to the current resource consumption value.
After the management gateway receives the connection request message, the management may process the connection request message to obtain identity information of the access device. Specifically, referring to fig. 4, fig. 4 shows a schematic flow chart of a management gateway obtaining identity information of an access device in an exemplary embodiment of the present disclosure, including steps S401 to S405:
in step S401, it is detected whether the connection request message contains a pre-agreed antisense flag. The predefined antisense markers may be 0x7d 0x01 and 0x7d 0x00, among others.
In step S402, if the anti-sense flag is included, the connection request message is subjected to anti-sense processing.
In this step, if the escape identifier is included, the data may be inverted, and the inversion rule may be: 0x7d 0x00 is denoted by 0x7d, and 0x7d 0x01 is denoted by ox7 e.
In step S403, security verification is performed on the information obtained after the escape processing.
In the step, the management gateway performs security check on the data packet according to the cyclic redundancy code of the data packet; or, according to the digital signature of the data packet, carrying out security check on the data packet; or, according to the hash function of the data packet, carrying out security check on the data packet. Taking the cyclic redundancy code as an example for illustration, the management gateway can recalculate the CRC check code for the data request message and compare the calculated CRC check code with the CRC check code included in the received connection request message, if the two CRCs are different, it indicates that an error occurs in the data transmission process, otherwise, it indicates that no error occurs in the data transmission process.
In step S404, if the security check is passed, the connection request message is parsed according to a predefined message format to obtain the identity information of the access device.
After the security check passes, the management gateway may parse the message to gradually parse out the frame header, the message header, and the encrypted message body. After the encrypted message body is obtained, the encrypted message body may be decrypted to recover the real data. Specifically, the byte code and the byte code length can be decoded by a decoding algorithm to restore the real data (the real data contains the identity information of the access device). The following shows the program pseudocode for decoding an encrypted message body by a decoding algorithm:
Figure BDA0002882485910000141
/>
Figure BDA0002882485910000151
/>
Figure BDA0002882485910000161
Figure BDA0002882485910000171
In step S405, authentication processing is performed on the access device according to the identity information.
After decoding to obtain the identity information, the management gateway may perform authentication processing on the access device. For example, when the identity information is a device ID, a preset legal ID storage table may be queried, and if the device ID exists in the legal ID storage table, it may be determined that the authentication is passed, and the access device is a legal device.
After determining that the access device is a legitimate device, the management gateway may assign an enforcement gateway for the access device. Specifically, referring to fig. 5, fig. 5 shows a schematic flow chart of allocating an execution gateway to an access device by a management gateway in an exemplary embodiment of the present disclosure, including step S501 to step S503:
in step S501, it is detected whether there is currently at least one execution gateway whose resource consumption value is smaller than a preset threshold.
In this step, the management gateway may obtain a pre-created resource consumption table, where the resource consumption table is used to store resource consumption values corresponding to each execution gateway (for example, each execution gateway has different sequence numbers and is arranged in an ascending order at a time), and further obtain an execution gateway whose current resource consumption value is less than a preset threshold (for example, 1). For example, if there are 3 execution gateways (when the execution gateway 1, the execution gateway 2, and the execution gateway 3), referring to fig. 6A, it may be determined that the resource consumption values of the execution gateway 1, the execution gateway 2, and the execution gateway 3 are all 0, which is smaller than the above-mentioned preset threshold.
In step S502, if yes, an execution gateway is selected from the execution gateways whose resource consumption values are smaller than the preset threshold value, and allocated to the execution gateway.
In this step, when there is an execution gateway whose resource consumption value is smaller than the preset threshold, an execution gateway may be selected from the execution gateways whose resource consumption value is smaller than the preset threshold (for example, any one of them is selected based on a random algorithm), and allocated to the execution gateway. For example, if the number of execution gateways whose resource consumption value is smaller than the preset threshold is one, the execution gateway may be directly allocated to the above access device. If the number is multiple, the sequence numbers of the execution gateways can be arranged in order from small to large, and the execution gateway with the smallest/largest sequence number is allocated to the access device, and then the management gateway can send the access information of the selected execution gateway to the access device to complete the allocation of the execution gateway for the access device, wherein the access information comprises one or more of the following: identification, port information, connection address (ip address).
For example, for the access device a (the resource consumption value is 100), when the resource consumption values of the execution gateway 1, the execution gateway 2, and the execution gateway 3 are all null, with continued reference to fig. 6A, the access device a may be allocated to the execution gateway 1, so that, after the first allocation, the resource consumption value of the execution gateway 1 is 100 and the resource consumption values of the execution gateways 2 and 3 are 0.
For the access device B (resource consumption value is 200), when the resource consumption values of the execution gateway 2 and the execution gateway 3 are both empty, referring to fig. 6B, it may be allocated to the execution gateway 2 such that, after the second allocation, the resource consumption value of the execution gateway 1 is 100, the resource consumption value of the execution gateway 2 is 200, and the resource consumption value of the execution gateway 3 is 0.
For the access device C (the resource consumption value is 300), when the resource consumption value of the execution gateway 3 is smaller than the preset threshold, referring to fig. 6C, the execution gateway 3 may be allocated to the access device C, so that, after the third allocation, the resource consumption value of the execution gateway 1 is 100, the resource consumption value of the execution gateway 2 is 200, and the resource consumption value of the execution gateway 3 is 300.
If not, the resource consumption values of the execution gateways are sorted in the order from small to large, and the execution gateway with the smallest resource consumption value is allocated to the access device in step S503.
In this step, if there is no execution gateway whose resource consumption value is smaller than the preset threshold, the resource consumption values of the execution gateways may be sorted in order from small to large, and the execution gateway with the smallest resource consumption value may be allocated to the access device (for example, the connection address of the execution gateway with the smallest resource consumption value is sent to the access device).
For example, for the access device D (the resource consumption value is 400), at this time, referring to fig. 6D, it may be determined that there is no execution gateway whose resource consumption value is smaller than the preset threshold, and further, the resource consumption values of the execution gateways may be sorted in order from small to large, which is in turn: executive gateway 1-executive gateway 2-executive gateway 3. Further, it can be determined that the resource consumption value of the execution gateway 1 is minimum, and further, the execution gateway 1 can be allocated to the access device d. After the allocation, it may be determined that the resource consumption value of the execution gateway 1 is 100+400=500, the resource consumption value of the execution gateway 2 is 200, and the resource consumption value of the execution gateway 3 is 300.
Similarly, for the access device E (the resource consumption value is 10), at this time, referring to fig. 6E, it may be determined that there is no execution gateway whose resource consumption value is smaller than the preset threshold, and further, the resource consumption values of the execution gateways may be sorted in order from small to large, which is in turn: executive gateway 2-executive gateway 3-executive gateway 1. Further, it can be determined that the resource consumption value of the execution gateway 2 is minimum, and further, the execution gateway 2 can be allocated to the access device e. After the allocation, it may be determined that the resource consumption value of the execution gateway 2 is 200+10=210, the resource consumption value of the execution gateway 3 is 300, and the resource consumption value of the execution gateway 1 is 400.
It should be noted that after allocating the execution gateway to the access device, each execution gateway may send a heartbeat data packet to the management gateway at a fixed time, and if the heartbeat data packet sent by the execution gateway is not received within a preset duration, the execution gateway is considered to be unstable, so that the management gateway may reallocate an incomplete task in the execution gateway to a new execution gateway, so as to ensure timely processing of the task.
Based on the gateway allocation algorithm, on one hand, the method and the device can solve the problems that in the related art, a single execution gateway is in load hyperbranched, network congestion is caused, and service processing efficiency is affected, balance the load of each execution gateway, and prolong the network life cycle. On the other hand, under the condition that any execution gateway is unstable, the task which is not finished on the unstable gateway can be migrated to other proper execution gateways, so that the task is ensured to be finished within a time limit, and the task distribution efficiency, the processing efficiency and the finishing quality are improved.
Referring next to fig. 1, gateway 120 is implemented for processing service requests for access devices.
After receiving the connection address of the execution gateway sent by the management gateway, the execution gateway may establish a connection with the execution gateway, so that the execution gateway may process a service request of the access device. For example, reference may be made to fig. 7, where fig. 7 is a schematic flow diagram illustrating processing a service request of an access device by an execution gateway in an exemplary embodiment of the present disclosure, and a specific implementation gateway is deployed with a high-performance four-layer network model (including a receiving thread, a network processing thread pool, a request and response queue, and a request processing thread pool), and a specific data processing procedure is described below:
The access device sends a connection request message to the execution gateway, and a receiving Thread (accepter Thread) receives the connection request message and sends the connection request message to a network processing Thread pool (Network Handler Pool); the network processing thread pool encapsulates the received Connection request message as a class object, and registers a READ event for the class object (e.g., maintaining an attribute in the abstract class Connection, such as eventType, assigning eventType to READ when encapsulating the Connection), so that the socket processing thread (Socket Processor Thread) starts to receive the service request message sent by the access device.
Receiving a service request message sent by a socket processing thread through a request and response queue (Request and response queue), and sending the service request message to the request processing thread; the service request message is processed through a request processing thread pool (Request Handle Pool), the generated service response message is put into a response queue, and the service response message is sent to a subsequent service processing thread pool through the response queue. Based on the four-layer network model, high throughput of the system can be ensured.
It should be noted that, the formats of the connection request message and the service request message sent by the access device to the execution gateway are the above-mentioned custom message formats. Further, the following description will be given by taking, as an example, a service request message sent by an access device to an execution gateway: after receiving the service request message, the execution gateway can detect whether the service request message contains the antisense mark, if so, the service request message is subjected to antisense processing, and further, the information obtained after the antisense processing is subjected to security check. After the security check is passed, the service request message is analyzed according to the predefined message format to obtain the service request information of the access equipment, the service is processed, and the generated service response message containing the processing result is returned to the access equipment.
For example, after the connection between the access device and the gateway is successfully established, a heartbeat packet may be sent to the management gateway at regular time (e.g., every 5 seconds), if a return packet is received within 5 seconds, the connection is considered normal, if no return packet of the access device is received within more than 5 seconds, the heartbeat is considered to be overtime, and after the heartbeat is overtime for 3 times, the access device may start the timing restart function.
Referring next to fig. 1, the distributed gateway system of the present disclosure further includes a standby management gateway 130, where the standby management gateway 130 may receive heartbeat packets sent by the management gateway at regular times; if the heartbeat data packet is not received within the preset time, determining that the management gateway is down, and replacing the management gateway. Therefore, the method and the device can realize real-time fault recovery, and avoid data loss and service write-down.
By way of example, fig. 8 shows a schematic diagram of an interaction process of a distributed gateway system in an exemplary embodiment of the present disclosure, and a specific embodiment is explained below in conjunction with fig. 8:
the access device establishes TCP (Transmission Control Protocol, transmission control protocol, TCP for short) connection with the management gateway, the management gateway returns a connection address of the execution gateway to the access device, and the access device is disconnected with the management gateway;
The access device establishes TCP connection with the execution gateway, and the access device sends a service request message to the execution gateway, and simultaneously, the access device sends a heartbeat to the execution gateway at regular time.
Fig. 9 is a flowchart illustrating a data interaction method of a distributed gateway system in an exemplary embodiment of the present disclosure, and an execution subject of the data interaction method of the distributed gateway system may be a management gateway.
Referring to fig. 9, a data interaction method of a distributed gateway system according to one embodiment of the present disclosure includes the steps of:
step S910, when the management gateway receives a connection request message sent by the access device, the current resource consumption value of each execution gateway is obtained; wherein, the connection request message is in a predefined message format;
step S920, allocating an execution gateway for the access device according to the current resource consumption value, so that the execution gateway processes the service request of the access device.
In an exemplary embodiment of the present disclosure, the management gateway detects whether the connection request message contains a pre-agreed antisense identity; if the connection request message contains the anti-sense identification, performing anti-sense processing on the connection request message; and carrying out safety check on the information obtained after the antisense processing.
In an exemplary embodiment of the present disclosure, if the security check passes, the management gateway parses the connection request message according to a predefined message format to obtain identity information of the access device; and authenticating the access equipment according to the identity information.
In an exemplary embodiment of the present disclosure, a management gateway parses a connection request message according to a predefined message format to obtain an encrypted message body; and decrypting the encrypted message body to obtain the identity information of the access equipment.
In an exemplary embodiment of the present disclosure, a management gateway determines a byte code and a byte code length of an original message body from an encrypted message body; and decrypting the byte codes and the byte code length by adopting a preset decryption algorithm to obtain the identity information of the access equipment.
In an exemplary embodiment of the present disclosure, the management gateway detects whether there is at least one execution gateway whose resource consumption value is less than a preset threshold; if yes, selecting an execution gateway from the execution gateways with the resource consumption values smaller than the preset threshold value, and distributing the execution gateway to the access equipment; if not, selecting the execution gateway with the minimum resource consumption value and distributing the execution gateway to the access equipment.
In an exemplary embodiment of the present disclosure, the management gateway randomly selects an execution gateway from among the execution gateways whose resource consumption values are smaller than a preset threshold based on a random algorithm; or selecting an execution gateway with the minimum gateway serial number from the execution gateways with the resource consumption value smaller than the preset threshold value; or selecting an execution gateway with the largest gateway sequence number from the execution gateways with the resource consumption value smaller than the preset threshold value.
In an exemplary embodiment of the present disclosure, a standby management gateway receives heartbeat packets sent by the management gateway at regular time; if the heartbeat data packet is not received within the preset time, determining that the management gateway is down, and replacing the management gateway.
The details of each step in the data interaction method of the distributed gateway system are described in detail in the corresponding distributed gateway system, so that the details are not repeated here.
For example, fig. 10 shows an overall flowchart of a data interaction method of a distributed gateway system in an exemplary embodiment of the present disclosure, including steps S1001 to S1015:
in step S1001, the device is powered on;
in step S1002, a management gateway is connected;
in step S1003, it is determined whether the connection is successful;
if the connection fails, the step S1004 is entered, and the management gateway is reconnected after 60 seconds;
if the connection is successful, the step S1005 is entered, an authentication message is sent and an execution gateway address is received;
in step S1006, the connection with the management gateway is disconnected;
in step S1007, the execution gateway is connected;
in step S1008, it is determined whether the connection is successful;
if the connection is successful, the process proceeds to step S1009, where normal service processing is executed, and in step S1010, disconnection from the execution gateway is found; then in step S1007, the connection execution gateway is connected;
If the connection fails, the step S1011 is entered, and the execution gateway is reconnected after 60 seconds;
in step S1012, it is determined whether the number of reconnections is 3 or less, if so, the process proceeds to step S1013, the number of reconnections is +1, and in step S1014, the management gateway is reconnected after 60 seconds;
if the number of reconnections is greater than 3, the process proceeds to step S1015, where the management gateway is reconnected after 60 seconds.
In general, the present disclosure has the following technical effects:
by simulating the hardware gateway by using the software system, the development period can be shortened and the development cost can be reduced on the basis of realizing the core capacity of the hardware gateway. By setting the standby management gateway, the fault real-time recovery can be realized. The data communication format can be unified through the custom message format, and the development cost is reduced. Through a master-slave architecture (management gateway-a plurality of execution gateways), the high availability of the system can be ensured, and the simultaneous access of mass equipment is supported. Through the gateway allocation algorithm, the network hot spot problem can be avoided. The high throughput of the system is guaranteed through a four-layer network model deployed in the execution gateway.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
Those skilled in the art will appreciate that the various aspects of the present disclosure may be implemented as a system, method, or program product. Accordingly, various aspects of the disclosure may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 1100 according to such an embodiment of the present disclosure is described below with reference to fig. 11. The electronic device 1100 shown in fig. 11 is merely an example and should not be construed as limiting the functionality and scope of use of the disclosed embodiments.
As shown in fig. 11, the electronic device 1100 is embodied in the form of a general purpose computing device. Components of electronic device 1100 may include, but are not limited to: the at least one processing unit 1110, the at least one memory unit 1120, a bus 1130 connecting the different system components (including the memory unit 1120 and the processing unit 1110), and a display unit 1140.
Wherein the storage unit stores program code that is executable by the processing unit 1110 such that the processing unit 1110 performs steps according to various exemplary embodiments of the present disclosure described in the above-described "exemplary methods" section of the present specification. For example, the processing unit 1110 may perform as shown in fig. 9: step S910, when the management gateway receives a connection request message sent by the access device, the current resource consumption value of each execution gateway is obtained; wherein, the connection request message is in a predefined message format; and step S920, allocating an execution gateway for the access equipment according to the current resource consumption value so that the execution gateway processes the service request of the access equipment.
The storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as a Random Access Memory (RAM) 11201 and/or a cache memory 11202, and may further include a Read Only Memory (ROM) 11203.
The storage unit 1120 may also include a program/utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The bus 1130 may be a local bus representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a bus using any of a variety of bus architectures.
The electronic device 1100 may also communicate with one or more external devices 1200 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 1100, and/or any devices (e.g., routers, modems, etc.) that enable the electronic device 1100 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 1150. Also, electronic device 1100 can communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 1160. As shown, network adapter 1160 communicates with other modules of electronic device 1100 via bus 1130. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 1100, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Furthermore, the above-described figures are only schematic illustrations of processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A distributed gateway system, comprising:
the management gateway is used for acquiring the current resource consumption value of each execution gateway when receiving a connection request message sent by the access equipment; allocating an execution gateway for the access equipment according to the current resource consumption value; wherein, the connection request message is in a predefined message format; the allocating an execution gateway to the access device according to the current resource consumption value comprises: detecting whether at least one execution gateway with a resource consumption value smaller than a preset threshold exists currently; if yes, selecting an execution gateway from the execution gateways with the resource consumption values smaller than a preset threshold value, and distributing the execution gateway to the access equipment; if not, selecting an execution gateway with the minimum resource consumption value, and distributing the execution gateway to the access equipment;
the execution gateway is used for processing the service request of the access equipment and returning the generated service response message containing the processing result to the access equipment; the access device is an internet of things device.
2. The system of claim 1, wherein the management gateway is further configured to, after receiving a connection request message sent by the access device:
Detecting whether the connection request message contains a pre-agreed reverse definition identifier or not;
if the connection request message contains the antisense mark, carrying out antisense processing on the connection request message;
and carrying out safety verification on the information obtained after the antisense processing.
3. The system according to claim 2, wherein the connection request message contains identity information of the access device;
after performing security verification on the information obtained after the antisense processing, the management gateway is further configured to:
if the security check is passed, analyzing the connection request message according to the predefined message format to acquire the identity information of the access equipment;
and authenticating the access equipment according to the identity information.
4. A system according to claim 3, wherein said step of parsing said connection request message according to said predefined message format to obtain identity information of said access device comprises:
analyzing the connection request message according to the predefined message format to obtain an encrypted message body;
and decrypting the encrypted message body to obtain the identity information of the access equipment.
5. The system of claim 4, wherein the encrypted message body is spliced from byte codes and byte code lengths of the original message body;
the step of decrypting the encrypted message body to obtain the identity information of the access device includes:
determining byte codes and byte code lengths of the original message body according to the encrypted message body;
and decrypting the byte codes and the byte code length by adopting a preset decryption algorithm to obtain the identity information of the access equipment.
6. The system of claim 1, wherein selecting an execution gateway from the execution gateways having the resource consumption value less than a predetermined threshold comprises:
randomly selecting an execution gateway from the execution gateways with the resource consumption values smaller than a preset threshold value based on a random algorithm; or alternatively, the first and second heat exchangers may be,
selecting an execution gateway with the minimum gateway sequence number from the execution gateways with the resource consumption value smaller than a preset threshold value; or alternatively, the first and second heat exchangers may be,
and selecting an execution gateway with the largest gateway sequence number from the execution gateways with the resource consumption value smaller than a preset threshold value.
7. The system of any one of claims 1 to 6, further comprising a standby management gateway for:
Receiving a heartbeat data packet sent by the management gateway at fixed time;
if the heartbeat data packet is not received within the preset time, determining that the management gateway is down, and taking over the management gateway.
8. A method for data interaction in a distributed gateway system, comprising:
when the management gateway receives a connection request message sent by the access equipment, acquiring the current resource consumption value of each execution gateway; wherein, the connection request message is in a predefined message format;
distributing an execution gateway for the access equipment according to the current resource consumption value so that the execution gateway processes the service request of the access equipment, and returning a generated service response message containing a processing result to the access equipment; the access equipment is Internet of things equipment;
the allocating an execution gateway to the access device according to the current resource consumption value comprises: detecting whether at least one execution gateway with a resource consumption value smaller than a preset threshold exists currently; if yes, selecting an execution gateway from the execution gateways with the resource consumption values smaller than a preset threshold value, and distributing the execution gateway to the access equipment; if not, selecting the execution gateway with the minimum resource consumption value, and distributing the execution gateway to the access equipment.
9. A computer storage medium having stored thereon a computer program, which when executed by a processor implements the data interaction method of a distributed gateway system according to claim 8.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data interaction method of the distributed gateway system of claim 8 via execution of the executable instructions.
CN202110003049.2A 2021-01-04 2021-01-04 Distributed gateway system, data interaction method and medium of distributed gateway system Active CN113810357B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110003049.2A CN113810357B (en) 2021-01-04 2021-01-04 Distributed gateway system, data interaction method and medium of distributed gateway system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110003049.2A CN113810357B (en) 2021-01-04 2021-01-04 Distributed gateway system, data interaction method and medium of distributed gateway system

Publications (2)

Publication Number Publication Date
CN113810357A CN113810357A (en) 2021-12-17
CN113810357B true CN113810357B (en) 2023-06-27

Family

ID=78892851

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110003049.2A Active CN113810357B (en) 2021-01-04 2021-01-04 Distributed gateway system, data interaction method and medium of distributed gateway system

Country Status (1)

Country Link
CN (1) CN113810357B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104580031A (en) * 2015-01-28 2015-04-29 中国人民解放军国防科学技术大学 Multi-protocol link encapsulation technique based POS (packet over synchronous optical network/internet protocol) frame decoding and framing device and method thereof
KR20160025994A (en) * 2014-08-28 2016-03-09 네이버 주식회사 Cluster management method and data storage system for selecting gateway in distributed storage environment
CN106936709A (en) * 2017-01-19 2017-07-07 广州华多网络科技有限公司 Remote service access path control method and relevant device
CN107360034A (en) * 2017-07-25 2017-11-17 美的智慧家居科技有限公司 Gateway restoration methods, device and its equipment
CN108390890A (en) * 2018-03-27 2018-08-10 吉旗(成都)科技有限公司 A kind of packet splicing, the method for packaging of agreement transmission
CN108965484A (en) * 2018-09-30 2018-12-07 深圳市酷达通讯有限公司 A kind of transmission method of internet of things data, system and terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160025994A (en) * 2014-08-28 2016-03-09 네이버 주식회사 Cluster management method and data storage system for selecting gateway in distributed storage environment
CN104580031A (en) * 2015-01-28 2015-04-29 中国人民解放军国防科学技术大学 Multi-protocol link encapsulation technique based POS (packet over synchronous optical network/internet protocol) frame decoding and framing device and method thereof
CN106936709A (en) * 2017-01-19 2017-07-07 广州华多网络科技有限公司 Remote service access path control method and relevant device
CN107360034A (en) * 2017-07-25 2017-11-17 美的智慧家居科技有限公司 Gateway restoration methods, device and its equipment
CN108390890A (en) * 2018-03-27 2018-08-10 吉旗(成都)科技有限公司 A kind of packet splicing, the method for packaging of agreement transmission
CN108965484A (en) * 2018-09-30 2018-12-07 深圳市酷达通讯有限公司 A kind of transmission method of internet of things data, system and terminal

Also Published As

Publication number Publication date
CN113810357A (en) 2021-12-17

Similar Documents

Publication Publication Date Title
CN108173938B (en) Server load distribution method and device
CN111083161A (en) Data transmission processing method and device and Internet of things equipment
US20120030437A1 (en) Processing a write request in a dispersed storage network
CN104754062B (en) Information popularization method, server and user terminal based on internet
JP2012199974A (en) Media container file management
CN104348578B (en) The method and device of data processing
CN107622207B (en) Encrypted system-level data structure
CN112422588B (en) Internet of things equipment information processing method and system
CN112532673B (en) Message sending method and device, computer readable storage medium and electronic equipment
CN113556359A (en) Communication protocol conversion method, device, system and gateway device
CN113220481A (en) Request processing and feedback method and device, computer equipment and readable storage medium
CN111181698A (en) Data processing method, device, equipment and medium
CN114449291A (en) Data transmission method, device and computer storage medium
CN113810357B (en) Distributed gateway system, data interaction method and medium of distributed gateway system
CN108460044B (en) Data processing method and device
CN112511620A (en) Network communication method, device, equipment and storage medium
CN114513418B (en) Data processing method and related equipment
KR20210011243A (en) Method and apparatus for monitoring HTTP/2 header compressed packet
CN110517045B (en) Block chain data processing method, device, equipment and storage medium
CN112039751B (en) Communication message sending method and device
CN109995589B (en) Log collection method and system
CN112468454A (en) Remote file management system and remote file management method thereof
CN112398668A (en) IaaS cluster-based cloud platform and node switching method
CN113542520B (en) Data transmission method, read-write equipment and consumable chip
CN116488931B (en) Information interaction method and device based on distributed networking equipment

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
GR01 Patent grant
GR01 Patent grant