CN116346948A - Multi-protocol conversion method and system based on micro-service - Google Patents

Multi-protocol conversion method and system based on micro-service Download PDF

Info

Publication number
CN116346948A
CN116346948A CN202310377800.4A CN202310377800A CN116346948A CN 116346948 A CN116346948 A CN 116346948A CN 202310377800 A CN202310377800 A CN 202310377800A CN 116346948 A CN116346948 A CN 116346948A
Authority
CN
China
Prior art keywords
data
conversion
micro
protocol
service
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.)
Pending
Application number
CN202310377800.4A
Other languages
Chinese (zh)
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.)
Shandong Dete Zhilian Information Technology Co ltd
Original Assignee
Shandong Dete Zhilian 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 Shandong Dete Zhilian Information Technology Co ltd filed Critical Shandong Dete Zhilian Information Technology Co ltd
Priority to CN202310377800.4A priority Critical patent/CN116346948A/en
Publication of CN116346948A publication Critical patent/CN116346948A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • 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/568Storing data temporarily at an intermediate stage, e.g. caching
    • 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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • 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/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
    • 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
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a multi-protocol conversion method and system based on micro-service, the method is based on a multi-protocol conversion system, the conversion system adopts a micro-service architecture, data sent by a message end is received through a micro-service gateway, a central processing unit module calls a service logic processing engine, a matched rule is searched for performing rule class operation, a persistent cache layer is formed, the data is converted into target protocol data through a data conversion module, and the target protocol data is sent to a target end through a network route. The invention has the following effects: the method can rapidly and accurately convert the data among different protocols, realizes the intellectualization, high efficiency, security and visualization of multi-protocol conversion, and is suitable for various business scenes needing multi-protocol conversion.

Description

Multi-protocol conversion method and system based on micro-service
Technical Field
The invention relates to a multi-protocol conversion method and system based on micro-services, in particular to a protocol conversion problem among different protocols.
Background
In recent years, mobile communication technology has been rapidly developed, and has been in a trend of diversification and complication. From 2G to 5G, wireless transmission technology is continuously upgraded and bandwidth is also continuously increased, so that wireless communication dominates the current communication industry. However, in different communication environments, the protocol conventions used are also changing. Protocol conventions in mobile communication technology are protocol specifications that must be commonly followed when different devices (e.g., mobile phones, sensors, industrial control devices, servers, etc.) communicate with each other, and these specifications include IP protocols, TCP protocols, HTTP protocols, UDP protocols, FTP protocols, etc. However, since protocol conventions may be different between the respective devices, normal communication may not be possible even though they may be connected. With the rapid development of mobile communication technology, unified standardization of protocol conventions has become an urgent need at present.
In conventional data communication systems, the same protocol specifications are used by each device transmitting data to ensure error-free transfer of information. However, in a multiprotocol network environment, the protocol types and versions used between devices may be different from each other, resulting in data transfer failure between different devices. At this time, the function of the multi-protocol conversion system is exerted, and data conversion among different protocols can be realized, so that mutual transmission among devices and data processing are realized. However, the existing multi-protocol conversion system cannot autonomously implement communication protocol conversion, which limits the development of various application fields. Currently, in the market, most of the multi-protocol conversion systems solve the communication problem by privately exchanging information data. However, they cannot handle variations between various communication protocols, nor can they implement conversions between different protocols. Once protocol conventions are required, the problems need to be handed to system developers for processing, which makes application development and maintenance very difficult and increases costs rapidly.
In order to solve the problem that the existing multi-protocol conversion system cannot autonomously realize communication protocol conversion, a multi-protocol conversion method and system based on micro-services are provided, which support a plurality of different types of protocol conversion, such as TCP/IP protocol conversion, HTTP/HTTPS protocol conversion, webSocket protocol conversion, MQTT protocol conversion and the like, so that a data packet can be freely converted among different protocols, and quick and accurate data transmission is realized. And supporting dynamic updating and expanding various protocol analysis programs. The method and the system adopt a micro-service architecture, and can update or expand the communication protocol analysis program in real time according to the requirements of users or systems. The data analysis and micro-analysis service can analyze and process the data packets of different protocols in real time and convert the data packets into a data format which can be processed uniformly by the system so as to facilitate the subsequent processing operation. An efficient and stable conversion micro-service is provided, and the data conversion micro-service converts the parsed data packets of different protocol specifications into target protocol specifications through proper data formats and protocol conversion so as to facilitate subsequent data transmission and processing operations. The method and the system have strong compatibility and high reliability, and provide stable and efficient conversion service.
Disclosure of Invention
In real life, communication between different protocols has become increasingly common. On the one hand, the traditional implementation method generally adopts static compiling or runtime analysis and other modes, and lacks flexibility. On the other hand, as the application scene changes, the protocol conversion needs to be continuously adjusted and improved, but the traditional implementation method is generally difficult to realize. In order to solve the problems, the invention provides a multi-protocol conversion method and a system based on micro-services. The method can efficiently realize protocol conversion among different protocols, and has good flexibility and expandability. The invention also provides a system for realizing the protocol conversion method.
In a first aspect, the present application provides a method for converting multiprotocol protocols based on micro services, which adopts the following technical scheme:
the message end establishes connection with the micro-service gateway and sends data to the micro-service gateway;
the data is converted into a target protocol through the dispatching of the central processing unit module, a business logic processing engine is called, the matched rules are searched for rule class operation and are subjected to persistent caching, if the rule content changes, optimization updating caching is performed, and generation and storage of the preprocessed data are completed;
performing data conversion according to the rule table, converting the input data into data in a final target format through multiple rounds of data conversion, and caching the data;
outputting the converted data to a target protocol;
the target protocol is sent to the target end through the network port;
the monitoring system collects information of the conversion micro-service to carry out comprehensive monitoring and optimization.
By adopting the technical scheme, the method consists of a plurality of micro services, and each micro service is responsible for realizing a specific function and can support data conversion among various application protocols (such as HTTP, SOAP, RESTful and the like); executing rules by using a business logic processing engine, and automatically selecting corresponding conversion rules according to scene requirements; the system comprises a central scheduler module for coordinating data interaction among the micro services; and a micro-service architecture is adopted, and each micro-service is mutually independent and supports elastic expansion, so that the conversion efficiency is improved.
And carrying out data transmission and interaction between the message end and the micro-service gateway, and establishing connection. The message end refers to a terminal (client end, server end, etc.) in a user or other systems, and the micro service gateway is an API gateway, which is responsible for receiving a request sent by the message end through a network and transmitting the request to a central processing unit module for processing. The micro service gateway is used as a unified entry, and can perform certain operations such as filtering, authentication and the like on the request.
The central processor module is a central of the whole system and is responsible for scheduling components such as data conversion and business logic processing engines and returning processing results to the micro-service gateway. The main functions include distributing the data stream to a designated micro service to realize data stream conversion; monitoring the state of the micro-services, automatically adjusting the number of the micro-services and optimizing the service load; a configurable flow control is provided to prevent collapse due to excessive system pressure. Specifically, after receiving the request sent by the micro service gateway, the central processing unit module decomposes and analyzes the request, finds a corresponding service processing engine and a rule matcher, and respectively transmits the request to the service processing engine and the rule matcher for processing. After the processing is completed, the central processing unit module can combine and integrate the processing results, perform format conversion according to the requirements and finally return the processing results to the micro-service gateway.
The business logic processing engine acquires corresponding conversion rules according to business scene requirements, including but not limited to mapping tables, function closures, regular expressions and the like; analyzing and preprocessing input data by a data preprocessing technology, and caching the preprocessing result into an efficient matching rule so as to improve the conversion efficiency; constructing a data conversion model according to input data and conversion rules, and automatically executing data conversion through a data reflection technology; and providing a data verification and error processing mechanism, and adopting corresponding load adjustment measures according to the actual application scene to improve the system stability.
The data conversion and caching convert the input data according to the business rules and logic to generate data related to the target protocol, and the converted data is cached to the persistence caching layer. Specifically, the central processing unit module invokes the rule matcher and transmits the request data, and the rule matcher processes the request according to the rule table, including operations such as data conversion and data merging. The system comprises a format conversion micro-service, a data processing unit and a data processing unit, wherein the format conversion micro-service is used for converting an input data format into a format of a specific protocol so as to facilitate the processing of a subsequent micro-service; the semantic conversion micro service is used for mapping the semantics of the input data to the semantics of different protocols so as to realize the mutual conversion among multiple protocols; the structure conversion micro-service is used for converting the structure of input data into the structure of a target protocol so as to realize structure matching among multiple protocols; the old protocol is converted into the new protocol micro-service, and the old protocol data is converted into the new protocol data so as to adapt to the evolution and the upgrade of different protocols. And simultaneously, the processing result is cached in a persistent cache layer for subsequent processing.
The converted data is output to the target protocol through the micro-service gateway, and specifically, the micro-service gateway transmits the converted data to a component related to the target protocol for processing. These components may include network transport protocols (e.g., TCP, HTTP, etc.), data transfer facilities (e.g., kafka, rabbitMQ, etc.), and the like. After receiving the data, the target protocol caches the data in the target system for the use and processing of the subsequent service.
The monitoring system is a tool for monitoring performance, bottleneck, faults and the like of the micro-service architecture system. In the conversion micro-service, the supervisory system needs to collect information of the conversion micro-service, including information of calling time between services, large-scale concurrency, and the like, analyze the collected information, comprehensively monitor and optimize, timely follow-up the problem, and adjust the system in real time to improve performance and efficiency.
The data processing flow of the multi-protocol conversion method realizes the rapid and accurate conversion of data among multiple protocols, and can be adjusted and optimized according to the system requirements.
In a second aspect, the present application provides a multi-protocol conversion system based on micro-services, which adopts the following technical scheme:
micro service gateway: the micro service gateway is used as an entrance of the multi-protocol conversion system and is responsible for processing the functions of connection state control, encryption and decryption, access mechanism control, data quality detection and the like of each data source. The main functions include connection management, maintenance of connection states between the data sources, including connection establishment, disconnection and connection state monitoring; the security control mechanism supports various encryption and decryption algorithms, and performs encryption storage and transmission on sensitive information so as to ensure data security; the access control mechanism is used for establishing a user identity authentication and access control mechanism, so that the system safety is ensured; and the data monitoring and flow limiting mechanism is used for monitoring and limiting the request, preventing flow attack and DOS attack and improving the fault tolerance of the system.
A central scheduler module: and data transmission and interaction among the micro services are coordinated, so that data conversion and flow control are realized. The main functions comprise service registration and discovery, wherein all micro services are registered to a central dispatcher when being started, and the central dispatcher is responsible for maintaining information of the micro services so as to realize dynamic discovery and call of the services; load balancing, dynamically distributing tasks to each micro service according to the load condition of the system, and ensuring the efficient operation of the system; data routing, which routes data to corresponding microservices for processing, depending on the source and destination of the data.
Service logic processing engine: a core component that decides and implements specific rules for data conversion between various protocols. The main functions comprise a rule engine, and a process and a result of data conversion are decided according to a preset conversion rule; and the execution engine is used for executing specific data conversion operation according to the decision result of the rule engine.
And a data conversion module: and the method is responsible for carrying out unified format conversion on data among various protocol formats so as to realize data interoperability. The main functions include protocol adaptation to support a variety of data protocols, including but not limited to XML, JSON, CSV, etc.; mapping data, namely mapping the attribute value of the source data to the attribute value of the target data according to a preset mapping rule; and converting the data format of the source data according to the requirements of a target data protocol, including data type conversion, code conversion and the like.
And a cache module: including preprocessing buffers and translation result buffers to support flow control and efficient matching rules. The main functions include preprocessing and caching, caching the received original data, and reducing the risk of data loss; and the conversion result is cached, and the converted data is cached so as to facilitate subsequent business logic processing and improve the data processing speed.
Dynamic expansion module: and elastically expanding the quantity of micro services and hardware resources according to the flow peak value and the quantity of infrastructure resources, and guaranteeing the stability and response performance of the system. The main functions comprise resource monitoring and real-time monitoring of the resource use condition of the system, including CPU, memory, network and the like; and (3) elastically expanding and contracting, and dynamically adjusting the quantity of micro services and hardware resources according to the monitoring data so as to adapt to different service requirements.
Infrastructure module: storage equipment, computing equipment, network equipment and the like, and monitoring operation management of the infrastructure is realized, so that stable and efficient operation of the system is realized. The main functions comprise resource management, wherein the unified management of hardware resources of the system comprises resource allocation, recovery, scheduling and the like; monitoring and alarming, namely monitoring the running state of the system in real time, and sending out alarming in time when abnormal conditions are found out, so that the stable running of the system is ensured; and (3) log management: and recording operation logs, running logs, error logs and the like of the system so as to conduct fault detection and performance optimization.
In a third aspect, the present application provides a computer device, which adopts the following technical scheme: the system comprises a memory, a processor and a network, wherein the memory is stored with a computer program which can be loaded and executed by the processor, and the computer program is used for converting the multi-protocol based on the micro-service into the system, and the converted information is transmitted to a target end through the network.
By adopting the technical scheme, after receiving the protocol conversion request, the system generates expected information through the protocol adaptation and conversion engine, and sends the information packet to the target end within a preset time limit.
In a fourth aspect, the present application provides a cache storage medium, which adopts the following technical scheme: the storage medium caches protocol data to be processed and distributed so as to support flow control and efficient matching rules, and improve system efficiency and stability.
By adopting the technical scheme, after the system receives the protocol data, the protocol data to be converted is cached, the service logic processing engine and the data conversion micro-service are comprehensively scheduled by the central processing unit module, the cached data are processed, the converted data are stored in the cache storage medium, and the data are sent to the target end through the infrastructure network, so that the conversion efficiency is improved.
The application comprises at least one of the following beneficial technical effects:
1. the protocol conversion operation is split into a plurality of small tasks by adopting a micro-service architecture mode, so that flexible combination of protocol conversion is realized. The method can make the protocol conversion operation more flexible, and can be combined and split according to the requirement.
2. And a general protocol description language is adopted to unify protocol descriptions among various protocols, so that the realization of protocol conversion is facilitated. The language can be used as a common language basis for communication between different protocols, so that different protocol conversion services can be better cooperated.
3. And a good micro-service cooperative mechanism is provided, and the correctness and consistency of protocol conversion are ensured. Through a good cooperative mechanism, the problem of data exchange between protocol conversion services can be solved, and the data consistency between the protocol conversion services is ensured.
4. The dynamic management mechanism is provided, so that the micro-services can be dynamically adjusted and managed, and efficient execution of protocol conversion operation is ensured. Through a dynamic management mechanism, the micro-service can be optimized, upgraded, added or deleted according to actual conditions, so that the efficiency and reliability of protocol conversion operation are improved.
Drawings
Fig. 1 is a flowchart of a multi-protocol conversion method based on micro services in an embodiment of the present application.
Fig. 2 is a block diagram of a multi-protocol conversion system based on micro services according to an embodiment of the present application.
Reference numerals illustrate: 201. a micro service gateway; 202. a data conversion module; 203. a business logic processing engine; 204. a central scheduler module; 205. a cache module; 206. a dynamic expansion module; 207. an infrastructure module.
Detailed Description
The present application is described in further detail below in conjunction with figures 1-2.
The embodiment of the application discloses a multi-protocol conversion method based on micro-service, which is based on a multi-protocol conversion system, wherein the conversion system adopts a micro-service architecture, receives data sent by a message end through a micro-service gateway, a central processing unit module calls a service logic processing engine, searches matched rules to perform rule class operation, persistence caching layers of the rules, converts the data into target protocol data through a data conversion module, and sends the target protocol data to a target end through network routing.
As shown in fig. 1, the method comprises the steps of:
s100, the message end establishes connection with the micro-service gateway.
Specifically, the micro service gateway and the message end realize the functional points of connection management, security control mechanism, access control mechanism, data monitoring and flow limiting mechanism, and the like. For connection management, a Netty NIO framework is used to realize efficient asynchronous IO processing, ensure connection period and state monitoring and the like; for a security control mechanism, a TLS/SSL encryption algorithm is used for ensuring the security of data, and standard authorization protocols such as OAuth2.0 and the like are also used for realizing an identity authentication and access control mechanism; for a data monitoring and flow limiting mechanism, by monitoring micro services, indexes of various services are collected, so that data monitoring and prevention of flow attack, DOS attack and the like are realized.
Wherein, according to the service scene and the calling mode. For connection management, providing an API interface for establishing connection and disconnection and a connection state monitoring interface; for the security control mechanism, providing an API interface for encryption and decryption, providing an API interface for identity and authentication, etc.; for data monitoring and traffic limiting mechanisms, API interfaces that provide monitoring and limiting, etc. The micro-service gateway is realized, the capabilities of data source connection state control, encryption and decryption, access mechanism control, data quality detection and the like are ensured, the safety and performance of the system are ensured, and support and acceleration are provided for the following multi-protocol conversion.
S200, the central processing unit module schedules related micro services and caches data.
The central scheduler module implements the capabilities of service registration and discovery, load balancing, and data routing. Service registration and discovery. In the micro service architecture, each micro service needs to register with a central scheduler and provide metadata information of itself, such as an IP address, a port number, a service name, and the like. Based on this information, the central scheduler maintains a list of service instances. The specific steps are that when the micro-service is started, a registration request is sent to a central dispatcher, and necessary metadata information is contained; after receiving the registration request, the central dispatcher adds the registration request to a service instance list and distributes a unique identifier for each service instance; ) The central scheduler periodically checks the health status of the service instances to ensure availability of the service instances.
The realization step of the service discovery process is that when a client or other micro services need to call a certain service, a service discovery request is sent to a central dispatcher and contains the name of the required service; the central dispatcher searches corresponding service examples in the service example list according to the service names and returns metadata information of the service examples; the client or other micro-service communicates directly with the target service instance based on the returned metadata information.
To ensure efficient operation of the system, the central scheduler needs to implement load balancing functions, dynamically assigning tasks to individual micro-services. The load balancing implementation step is that the central dispatcher distributes requests to service instances in sequence through a polling method, and returns to the first service instance after distributing the requests to the last service instance; and allocating different request amounts according to the weight value of the service instance by a weighted polling method. The weight value can be dynamically adjusted according to factors such as the performance, the load and the like of the service instance; and distributing the request to the service instance with the least current connection number by a least connection method so as to ensure reasonable utilization of resources.
The data routing enforcement policy is that the central scheduler needs to route data to the corresponding micro-services for processing, depending on the source and destination of the data. The data routing implementation step is that a client or other micro-service sends a data request to a central scheduler, and data source and target information are provided at the same time; the central dispatcher searches corresponding service examples in the service example list according to the data source and target information; the central dispatcher forwards the data request to the found service instance and waits for a processing result; after the service instance processes the data, the result is returned to the central dispatcher.
S300, the business logic processing engine performs regulation matching.
The business logic processing engine is a critical component for making decisions and performing data transformations for the various protocols. To implement this engine, we design and implement a rules engine and an enforcement engine, respectively.
The rule engine is a core part of the business logic processing engine and is responsible for deciding the process and the result of data conversion according to a preset conversion rule. The rule engine implementation step includes rule definition, which first requires defining data conversion rules including original protocol, target protocol, and conversion rules. These rules may be stored and managed using XML, JSON, etc. formats; rule loading, the rule engine needs to provide a module responsible for loading and parsing stored conversion rules. The rule loading module loads rules into the memory when starting so as to be accessed quickly; rule matching, when a data conversion request is received, a rule engine needs to match in a rule set in a memory according to a source protocol and a target protocol of the request, and a corresponding conversion rule is found; and the rule engine generates a decision result according to the matched rule, wherein the decision result comprises a specific step of data conversion, required resources and the like. The decision results are passed to the execution engine for actual data conversion operations.
The execution engine is responsible for executing specific data conversion operations according to the decision result of the rule engine. The implementation steps of the execution engine are resource preparation, and the execution engine needs to prepare necessary resources, such as loading a needed class library, initializing a conversion tool and the like, according to a decision result; data preprocessing, wherein an execution engine needs to preprocess original data, such as blank character removal, data format verification and the like, before actual data conversion is executed; data conversion, namely performing data conversion by an execution engine according to specific steps in a decision result, wherein the data conversion comprises conversion of a data structure, conversion of a data format, conversion of a data unit and the like, and the execution engine needs to process various abnormal conditions such as data format errors, conversion failures and the like in the process; after the data is processed and converted, the execution engine needs to perform data post-processing, such as adding verification information, formatting output and the like; and returning the result, namely returning the converted data to the requester by the execution engine, and simultaneously updating the conversion log and the statistical information.
S400, performing data conversion according to the rule table.
The data conversion module is one of the core components of the system and is responsible for realizing the uniform format conversion of data among various protocol formats so as to realize the interoperability of the data. Specific embodiments include protocol adaptation, data mapping, data conversion, exception handling.
The data conversion module needs to support a variety of data protocols including, but not limited to XML, JSON, CSV, etc. The method for realizing protocol adaptation is to package the processing logic of each data protocol into an independent module, so as to realize the design principle of high cohesion and low coupling. Thus, protocol support can be conveniently added or deleted, and maintainability and expansibility of the system are improved; a unified interface is defined for all protocol processing modules, including operations such as data analysis and data serialization. This may decouple the data conversion module from the specific protocol processing logic, facilitating later upgrades or replacement.
The data mapping mainly maps the attribute value of the source data to the attribute value of the target data according to a preset mapping rule. Defining a mapping rule, namely defining a data mapping rule comprising attribute corresponding relation of source data and target data, wherein the mapping rule can be stored and managed by using XML, JSON and other formats; the mapping rule loading, the data conversion module needs to provide a module for loading and analyzing the stored mapping rule, and the mapping rule loading module loads the rule into the memory when starting so as to be accessed quickly; and mapping the attribute value of the source data to the attribute value of the target data according to the loaded mapping rule when the data is converted, wherein various abnormal conditions such as data missing, type mismatch and the like need to be processed in the process.
The data conversion mainly converts the source data into a data format according to the requirements of a target data protocol, including data type conversion, code conversion and the like. The step of realizing data conversion is data analysis, and according to a source data protocol, a corresponding protocol processing module is called to analyze the source data into an internal unified data structure, so that the subsequent data mapping and conversion operation is irrelevant to the specific data protocol; mapping and converting data, namely mapping attribute values of source data to attribute values of target data according to steps in a data mapping function, and performing necessary data type conversion, code conversion and other operations; and (3) serializing data, namely calling a corresponding protocol processing module according to a target data protocol, and serializing the internal unified data structure into a target data format. This ensures that the data is properly parsed and processed in the target system.
Exception handling. Exception handling is required at each stage of the data conversion module. When an abnormal situation is encountered, detailed error information is recorded, and corresponding measures such as retry, rollback operation and the like are taken according to the type of the abnormality. Meanwhile, the related personnel need to be informed of the abnormal information so as to be processed in time.
S500, the converted target protocol data is cached and sent.
The high-speed buffer comprises a preprocessing buffer, and the received original data is buffered, so that the risk of data loss is reduced; and the conversion result is cached, and the converted data is cached so as to facilitate subsequent business logic processing and improve the data processing speed. The part focuses on making a caching strategy, and according to the system requirements and resource limitations, the caching strategy based on factors such as time, capacity, access frequency and the like can be selected. For example, the validity period of the cache may be set and automatically cleared after expiration; or setting the upper limit of the cache capacity, and eliminating the cache item according to a certain strategy (such as Least Recently Used (LRU)) when the upper limit is exceeded.
In the data conversion process, a caching operation is needed, including caching inquiry, and when a conversion request is received, firstly, whether converted target protocol data exist in a cache or not is inquired. If the data exists, the data is directly obtained from the cache, and data conversion is not needed; and updating the cache, if the target protocol data does not exist in the cache, converting the data, and storing the converted data into the cache. Cache policies such as expiration date, capacity limitation, etc. need to be considered; cache deletion, in some cases, may require manual or automatic deletion of data in the cache, such as expiration of data, cache elimination, and the like.
And the data transmission transmits the target protocol data obtained or converted from the cache to the requesting party. The data transmission can be synchronous or asynchronous, depending on the real-time requirements and performance index of the system. Before transmitting data, operations such as data compression, encryption and the like need to be considered so as to optimize transmission efficiency and ensure data security.
S600, detecting and dynamically optimizing the infrastructure.
Specifically, storage equipment, computing equipment, network equipment and the like of the infrastructure are monitored and run in real time, so that stable and efficient running of the system is realized. The method mainly comprises the steps of resource management, unified management of hardware resources of a system, including resource allocation, recovery, scheduling and the like; monitoring and alarming, namely monitoring the running state of the system in real time, and sending out alarming in time when abnormal conditions are found out, so that the stable running of the system is ensured; log management, recording operation logs, running logs, error logs and the like of the system so as to conduct fault detection and performance optimization; security protection includes access control, data encryption, and intrusion detection.
Based on the method, the embodiment of the application also discloses a multi-protocol conversion system based on the micro-service.
In connection with fig. 2, the system comprises the following modules:
the micro service gateway [201] adopts a micro service architecture, can automatically adapt to the connection mode according to the different communication protocols of the message end and the target end, and is responsible for the micro services such as connection state control, encryption and decryption, access mechanism control, data quality detection and the like of each data source;
central processing unit module [202]: after receiving the message drive of the module [201], the main control center is responsible for coordinating the data transmission and interaction among all the micro services to realize data conversion and flow control;
service logic processing engine [203]: based on the [202] module schedule, a rules engine is started to adapt the protocol conversion logic and execute the engine specific to the rules of data conversion between the various protocols. The main functions comprise a rule engine, and a process and a result of data conversion are decided according to a preset conversion rule; the execution engine is used for executing specific data conversion operation according to the decision result of the rule engine;
a data conversion module [204]: driving a data conversion module to work based on the rule logic determined by the [203] module, wherein the module is responsible for micro-service for carrying out unified format conversion on data between various protocol formats;
cache module [205]: based on the processing process of [204], caching various data in the processing process, including preprocessing cache and conversion result cache, so as to support flow control and efficient matching rules;
the dynamic expansion module [206] elastically expands the quantity of micro-service and hardware resources based on the load intensity instructions [204], [205] and the flow peak value, and ensures the stability and the corresponding performance of the system;
infrastructure module [207]: a computer device with functions of storage, calculation, network and the like provides monitoring management and dynamic optimization of an operation environment, and realizes stable and efficient operation of a system.
The embodiment of the application also discloses a computer device.
Specifically, the apparatus includes a memory, a processor, a network, and the like, on which a computer program capable of being loaded and executed by the processor, as described above, of a micro-service-based multi-protocol conversion system is stored, and the converted information is transmitted to a target terminal through the network.
The embodiment of the application also discloses a computer cache storage medium.
In particular, the computer cache storage medium stores a computer program capable of being loaded by a processor and executing a multi-protocol conversion method based on a micro-service as above, the computer readable and writable storage medium for example comprising: various media capable of storing program codes, such as a hard disk, a Read-only memory (ROM), a random access memory (RandomAccessMemory, RAM), and the like.
The embodiments of the present invention are all preferred embodiments of the present application, and are not intended to limit the scope of the present application in this way, therefore: all equivalent changes in structure, shape and principle of this application should be covered in the protection scope of this application.

Claims (9)

1. A multi-protocol conversion method based on micro-service is used for data conversion between multi-protocol systems. The method consists of a plurality of micro services, wherein each micro service is responsible for realizing a specific function and realizing the following characteristics:
the method can support data conversion between various application protocols (such as HTTP, SOAP, RESTful and the like); the method uses a business logic processing engine to execute rules, and can automatically select corresponding conversion rules according to scene requirements; the method comprises a central dispatcher module for coordinating data interaction among the micro services; the method adopts a micro-service architecture, and each micro-service is mutually independent and supports elastic expansion, so that the conversion efficiency is improved.
2. The microservice-based multiprotocol protocol conversion method of claim 1, wherein at least the following microservices are included:
format conversion microservices: the method is used for converting the input data format into a format of a specific protocol so as to facilitate the processing of subsequent micro services; semantic conversion microservices: the method comprises the steps of mapping semantics of input data to semantics of different protocols to realize interconversion between multiple protocols; structural transformation microservices: the structure is used for converting the structure of input data into the structure of a target protocol so as to realize the structure matching among multiple protocols; old protocol to new protocol micro-service: for converting the data of the old protocol into the data of the new protocol to accommodate the evolution and upgrades of the different protocols.
3. The microservice-based multiprotocol protocol conversion method of claim 1, wherein the functions of the central scheduler module include:
distributing the data stream to a designated micro-service to realize data stream conversion; monitoring the state of the micro-services, automatically adjusting the number of the micro-services and optimizing the service load; a configurable flow control is provided to prevent collapse due to excessive system pressure.
4. The method for converting multiprotocol protocol based on micro-services according to claim 1, wherein the business logic processing engine implements the following features:
obtaining corresponding conversion rules according to the service scene requirements, including but not limited to mapping tables, function closures, regular expressions and the like; analyzing and preprocessing input data by a data preprocessing technology, and caching the preprocessing result into an efficient matching rule so as to improve the conversion efficiency; constructing a data conversion model according to input data and conversion rules, and automatically executing data conversion through a data reflection technology; and providing a data verification and error processing mechanism, and adopting corresponding load adjustment measures according to the actual application scene to improve the system stability.
5. A microservice-based multiprotocol protocol conversion system according to claim 1, capable of rapidly and accurately converting data between different protocols, including but not limited to the conversion of protocols such as HTTP, SOAP, RESTful, XML, JSON. The system comprises the following components:
the micro service gateway (201) is responsible for micro services such as connection state control, encryption and decryption, access mechanism control and data quality detection of each data source;
a central scheduler module [202]: coordination of data transmission and interaction among the micro services, and realization of data conversion and flow control;
service logic processing engine [203]: an engine that decides and executes specific rules for data conversion between various protocols;
a data conversion module [204]: micro service in charge of carrying out unified format conversion for data between various protocol formats;
cache module [205]: the method comprises a preprocessing buffer and a conversion result buffer to support flow control and high-efficiency matching rules;
the dynamic expansion module [206] elastically expands the quantity of micro services and hardware resources according to the flow peak value and the quantity of infrastructure resources, and ensures the stability and the corresponding performance of the system;
infrastructure module [207]: the system comprises storage equipment, computing equipment, network equipment and the like, and monitors and manages the infrastructure, so that the stable and efficient operation of the system is realized.
6. The microservice-based multiprotocol protocol conversion system of claim 5, further comprising the following security control mechanism for avoiding attacks of illegal data or malicious requests:
encryption and decryption technology: the sensitive information is stored and transmitted in an encrypted mode, so that the data security is guaranteed; access control mechanism: establishing a user identity authentication and access control mechanism, and guaranteeing system safety; data monitoring and traffic limiting mechanisms: and the request is monitored and limited, so that the flow attack and DOS attack are prevented, and the fault tolerance of the system is improved.
7. The microservice-based multiprotocol protocol conversion system of claim 5 further comprising the following optimization mechanism:
elastic expansion mechanism: automatically adjusting the micro service quantity according to the flow condition so as to adapt to the flow peak value; data caching mechanism: caching the hot data by using a caching technology, so that the response speed of the system is improved; fluency control mechanism: and the input data is smoothly controlled by using a fluent control technology, so that the stability and the response performance of the system are ensured.
8. A computer device, characterized by: comprising a memory, a processor and a network, said memory having stored thereon a multi-protocol conversion method computer program capable of being loaded by the processor and executing the microservice-based multi-protocol conversion method of any one of claims 1 to 7.
9. A computer readable and writable cache storage medium, characterized in that the cache storage medium is capable of caching data processed by a microservice-based multiprotocol conversion method as claimed in any one of claims 1 to 7.
CN202310377800.4A 2023-04-11 2023-04-11 Multi-protocol conversion method and system based on micro-service Pending CN116346948A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310377800.4A CN116346948A (en) 2023-04-11 2023-04-11 Multi-protocol conversion method and system based on micro-service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310377800.4A CN116346948A (en) 2023-04-11 2023-04-11 Multi-protocol conversion method and system based on micro-service

Publications (1)

Publication Number Publication Date
CN116346948A true CN116346948A (en) 2023-06-27

Family

ID=86880499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310377800.4A Pending CN116346948A (en) 2023-04-11 2023-04-11 Multi-protocol conversion method and system based on micro-service

Country Status (1)

Country Link
CN (1) CN116346948A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116582364A (en) * 2023-07-12 2023-08-11 苏州浪潮智能科技有限公司 Data access method, system, device, electronic equipment and readable storage medium
CN117579700A (en) * 2024-01-11 2024-02-20 中国人民解放军国防科技大学 General micro-service processing method, system and equipment based on message queue

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116582364A (en) * 2023-07-12 2023-08-11 苏州浪潮智能科技有限公司 Data access method, system, device, electronic equipment and readable storage medium
CN116582364B (en) * 2023-07-12 2023-10-03 苏州浪潮智能科技有限公司 Data access method, system, device, electronic equipment and readable storage medium
CN117579700A (en) * 2024-01-11 2024-02-20 中国人民解放军国防科技大学 General micro-service processing method, system and equipment based on message queue
CN117579700B (en) * 2024-01-11 2024-04-02 中国人民解放军国防科技大学 General micro-service processing method, system and equipment based on message queue

Similar Documents

Publication Publication Date Title
CN112799789B (en) Node cluster management method, device, equipment and storage medium
CN116346948A (en) Multi-protocol conversion method and system based on micro-service
US7673029B2 (en) Grid automation bus to integrate management frameworks for dynamic grid management
US7949686B2 (en) Method and apparatus for scalable transport processing fulfillment system
US7200657B2 (en) Autonomic provisioning of network-accessible service behaviors within a federated grid infrastructure
JP3980596B2 (en) Method and system for remotely and dynamically configuring a server
US8266630B2 (en) High-performance XML processing in a common event infrastructure
US20080162690A1 (en) Application Management System
CN111309374A (en) Micro-service system and service calling method in micro-service system
US20050154770A1 (en) Information system and data access method
US7500251B2 (en) Method and system for managing programs for web service system
US8589381B2 (en) Resource management program, resource management process, and resource management apparatus
JP5666620B2 (en) Network system and service quality control method thereof
CN113468221A (en) System integration method based on kafka message data bus
US20230137879A1 (en) In-flight incremental processing
Bali et al. Rule based auto-scalability of IoT services for efficient edge device resource utilization
CN110661780A (en) Wireless city data sharing method and system based on SAAS application
CN112817539A (en) Industrial data storage method and system, electronic device and storage medium
US20020199022A1 (en) System and method for establishing and managing communications between mangement protocol different system
JP5809743B2 (en) Method for providing heterogeneous system data in a distributed system
CN115499432A (en) Family terminal computing resource management system and computing resource scheduling method
CN113726578B (en) Fusion method of API gateway and network architecture system
EP4277224A1 (en) Application status detection in the context of network abstraction
CN113873033B (en) Intelligent edge computing gateway platform with fault-tolerant function
CN113411382B (en) Real-time data acquisition system and method based on network equipment F5

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