CN111741079A - An interface processing method and system based on microservice architecture - Google Patents

An interface processing method and system based on microservice architecture Download PDF

Info

Publication number
CN111741079A
CN111741079A CN202010486903.0A CN202010486903A CN111741079A CN 111741079 A CN111741079 A CN 111741079A CN 202010486903 A CN202010486903 A CN 202010486903A CN 111741079 A CN111741079 A CN 111741079A
Authority
CN
China
Prior art keywords
interface
service
request
microservice
service request
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
CN202010486903.0A
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.)
Electric Power Research Institute of Guangxi Power Grid Co Ltd
Original Assignee
Electric Power Research Institute of Guangxi Power Grid 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 Electric Power Research Institute of Guangxi Power Grid Co Ltd filed Critical Electric Power Research Institute of Guangxi Power Grid Co Ltd
Priority to CN202010486903.0A priority Critical patent/CN111741079A/en
Publication of CN111741079A publication Critical patent/CN111741079A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/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
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/6245Modifications to standard FIFO or LIFO
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses an interface processing method and system based on a micro-service architecture, wherein the method comprises the following steps: each business system provides an access interface micro-service request to the interface service request center, and the interface service request center decomposes the access interface micro-service request to obtain a service request queue; the interface service dynamic dispatching center monitors the interface service of the service request queue and dynamically dispatches the service request; and according to the equipment type of the access interface micro-service request, the interface micro-service center deploys the micro-service corresponding to the equipment type. In the implementation of the invention, the dynamic decomposition and scheduling processing of the interface service task are realized, and the interface processing efficiency is improved.

Description

一种基于微服务架构的接口处理方法及系统An interface processing method and system based on microservice architecture

技术领域technical field

本发明涉及配电网及微服务的技术领域,尤其涉及一种基于微服务架构的接口处理方法及系统。The present invention relates to the technical field of power distribution network and micro-services, in particular to an interface processing method and system based on a micro-service architecture.

背景技术Background technique

目前,基于restful接口规范的微服务架构已成为当前Java开发的主流架构,应用广泛,通过接口或应用的微服务化,可以将海量用户产生的大规模的访问流量进行分解,采用分而治之的方法,达成用户需要的功能指标,并同时满足用户对高可用、高性能、可伸缩、可扩展和安全性的非功能质量的要求。在当前系统中,存在大量的实时及非实时的数据同步需求,其中:设备档案变更信息及设备运维信息接口为低频次,每天或每周一次,设备的实时运行数据接口为高频率,按照设备采集的频率,一般配变为15分钟,主变、高压线路、中压线路为5分钟或更高的频次,由于存在实时与非实时的大量数据交互,数据接口服务访问量较大,缺少对接口服务的监控及动态调度,无法根据各个接口服务的任务数据、数据传输量、接口运行状态、服务器硬件资源运行情况,进行动态智能调度,容易造成占用大量系统资源,接口服务任务堵塞的问题,接口处理效率低下,影响系统日常应用。At present, the micro-service architecture based on the restful interface specification has become the mainstream architecture of current Java development and is widely used. Through the micro-service of the interface or application, the large-scale access traffic generated by a large number of users can be decomposed, and the divide-and-conquer method can be adopted. Achieve the functional indicators required by users, and at the same time meet the user's non-functional quality requirements for high availability, high performance, scalability, scalability and security. In the current system, there are a large number of real-time and non-real-time data synchronization requirements, among which: the equipment file change information and equipment operation and maintenance information interfaces are low-frequency, once a day or weekly, and the equipment's real-time operation data interface is high-frequency, according to The frequency of equipment collection is generally set to 15 minutes, and the frequency of main transformers, high-voltage lines, and medium-voltage lines is 5 minutes or more. Due to the large amount of real-time and non-real-time data interaction, the data interface service has a large number of visits and lacks The monitoring and dynamic scheduling of interface services cannot be dynamically and intelligently scheduled according to the task data, data transmission volume, interface operation status, and server hardware resource operation status of each interface service, which may easily cause the problem of occupying a large amount of system resources and blocking interface service tasks. , the interface processing efficiency is low, affecting the daily application of the system.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于克服现有技术的不足,本发明提供了一种基于微服务架构的接口处理方法及系统,实现接口服务任务动态分解及调度处理,提高接口处理效率。The purpose of the present invention is to overcome the deficiencies of the prior art, and the present invention provides an interface processing method and system based on a micro-service architecture, which realizes dynamic decomposition and scheduling processing of interface service tasks and improves interface processing efficiency.

为了解决上述技术问题,本发明实施例提供了一种基于微服务架构的接口处理方法,包括接口服务请求中心、接口服务动态调度中心以及接口微服务中心,所述方法包括:In order to solve the above technical problems, an embodiment of the present invention provides an interface processing method based on a micro-service architecture, including an interface service request center, an interface service dynamic dispatch center, and an interface micro-service center, and the method includes:

各个业务系统向所述接口服务请求中心提出访问接口微服务请求,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列;Each business system submits an access interface microservice request to the interface service request center, and the interface service request center decomposes the access interface microservice request to obtain a service request queue;

所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度;The interface service dynamic scheduling center performs interface service monitoring and service request dynamic scheduling on the service request queue;

根据所述访问接口微服务请求的设备类型,所述接口微服务中心部署与所述设备类型相应的微服务。According to the device type requested by the access interface microservice, the interface microservice center deploys the microservice corresponding to the device type.

可选的,所述各个业务系统向所述接口服务请求中心提出访问接口微服务请求,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列包括:Optionally, each business system submits an access interface micro-service request to the interface service request center, and the interface service request center decomposes the access interface micro-service request, and obtaining a service request queue includes:

各个业务系统根据自身系统产生的增量业务数据情况,向所述接口服务请求中心提出访问接口微服务请求;Each business system submits an access interface microservice request to the interface service request center according to the incremental business data situation generated by its own system;

根据所述访问接口微服务请求的增量数据块大小、或频率、或数据类型的特征,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列;According to the characteristics of the incremental data block size, frequency, or data type of the access interface microservice request, the interface service request center decomposes the access interface microservice request to obtain a service request queue;

所述接口服务请求中心将所述服务请求队列传送至所述接口服务动态调度中心。The interface service request center transmits the service request queue to the interface service dynamic dispatch center.

可选的,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列还包括:当所述访问接口微服务请求增量当数据块大小超过限额时,根据所述访问接口微服请求的对象所属区域、或设备类型、或数据类型、或数据传输频率,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列。Optionally, the interface service request center decomposes the access interface micro-service request, and obtaining the service request queue further includes: when the access interface micro-service request increments and the data block size exceeds the limit, according to the access interface micro-service request. According to the region to which the object requested by the interface microservice belongs, or the device type, or the data type, or the data transmission frequency, the interface service request center decomposes the access interface microservice request to obtain a service request queue.

可选的,所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度包括:所述接口服务动态调度中心通过监控分布式接口服务的运行情况,获取当前各个服务节点的资源应用情况,并快速感知系统流量变化及找出系统瓶颈,为服务请求动态调度提供依据。Optionally, the interface service dynamic dispatching center performing interface service monitoring and service request dynamic dispatching on the service request queue includes: the interface service dynamic dispatching center obtains each current service node by monitoring the operation of the distributed interface service. It can quickly sense changes in system traffic and identify system bottlenecks, providing a basis for dynamic scheduling of service requests.

可选的,所述接口服务监控包括:对服务请求的监控、和对服务资源的监控、和对微服务的监控。Optionally, the interface service monitoring includes: monitoring of service requests, monitoring of service resources, and monitoring of microservices.

可选的,所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度还包括:Optionally, the interface service monitoring and dynamic scheduling of service requests performed by the interface service dynamic scheduling center on the service request queue further include:

根据FIFO逻辑顺序,所述接口服务动态调度中心将访问接口微服务请求分配至各个微服务接口,并得到服务请求子队列;According to the FIFO logical sequence, the interface service dynamic dispatch center allocates the access interface microservice request to each microservice interface, and obtains a service request subqueue;

根据动态调整策略,所述接口服务动态调度中心对所述各个微服务接口执行中的所述服务请求子队列进行动态的调整,得到新的服务请求子队列。According to the dynamic adjustment policy, the interface service dynamic dispatch center dynamically adjusts the service request sub-queues in the execution of each micro-service interface to obtain a new service request sub-queue.

可选的,所述根据FIFO逻辑顺序,所述接口服务动态调度中心将访问接口微服务请求分配至各个微服务接口,并得到服务请求子队列包括:基于对服务请求的监控、和对服务资源的监控、和对微服务的监控,根据FIFO逻辑顺序,所述接口服务动态调度中心将访问接口微服务请求分配至各个微服务接口,并得到服务请求子队列。Optionally, according to the FIFO logical sequence, the interface service dynamic dispatch center allocates the access interface micro-service request to each micro-service interface, and obtains the service request sub-queue including: According to the FIFO logical sequence, the interface service dynamic dispatch center allocates the access interface microservice request to each microservice interface, and obtains the service request subqueue.

可选的,所述根据动态调整策略,所述接口服务动态调度中心对所述各个微服务接口执行中的所述服务请求子队列进行动态的调整,得到新的服务请求子队列包括:Optionally, according to the dynamic adjustment policy, the interface service dynamic dispatch center dynamically adjusts the service request sub-queues in the execution of each micro-service interface, and obtaining a new service request sub-queue includes:

所述接口动态调度中心激活当前访问接口微服务请求,并根据所述FIFO顺序对所述访问接口微服务请求进行处理;The interface dynamic dispatch center activates the current access interface microservice request, and processes the access interface microservice request according to the FIFO order;

在对所述访问接口微服务请求进行处理完成之后,返回至请求处理完成信息及接口服务请求调用情况报告和异常报告信息。After the processing of the access interface microservice request is completed, the request processing completion information and the interface service request invocation status report and exception report information are returned.

另外,本发明实施例还提供了一种基于微服务架构的接口处理系统,所述系统包括:In addition, an embodiment of the present invention also provides an interface processing system based on a micro-service architecture, the system comprising:

服务请求分解模块:用于各个业务系统向所述接口服务请求中心提出访问接口微服务请求,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列;Service request decomposition module: used by each business system to submit an access interface microservice request to the interface service request center, and the interface service request center decomposes the access interface microservice request to obtain a service request queue;

服务动态调度模块:用于所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度;Service dynamic scheduling module: used for the interface service dynamic scheduling center to perform interface service monitoring and service request dynamic scheduling on the service request queue;

微服务部署模块:用于根据所述访问接口微服务请求的设备类型,所述接口微服务中心部署与所述设备类型相应的微服务。Microservice deployment module: configured to deploy the microservice corresponding to the device type by the interface microservice center according to the device type requested by the access interface microservice.

在本发明实施中,基于微服务架构,动态的将接口服务请求分解为若干可以进行并行处理的服务请求队列,并根据接口服务请求动态调度策略,实现对服务请求队列的动态分配,实现自动化、顺序化、准确且响应时间更快的接口数据处理,提高接口数据批量处理效率,增强配置的灵活性,减少了额外资源的开销,并且改善用户体验。In the implementation of the present invention, based on the micro-service architecture, the interface service request is dynamically decomposed into several service request queues that can be processed in parallel, and the dynamic allocation of the service request queue is realized according to the dynamic scheduling strategy of the interface service request, and the automation, Serialized, accurate and faster response time interface data processing, improve the batch processing efficiency of interface data, enhance the flexibility of configuration, reduce the overhead of additional resources, and improve user experience.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见的,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.

图1是本发明实施例中的基于微服务架构的接口处理方法的流程示意图;1 is a schematic flowchart of an interface processing method based on a microservice architecture in an embodiment of the present invention;

图2是本发明实施例中的基于微服务架构的接口处理系统的结构组成示意图。FIG. 2 is a schematic structural composition diagram of an interface processing system based on a microservice architecture in an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

实施例一Example 1

请参阅图1,图1是本发明实施例中的基于微服务架构的接口处理方法的流程示意图。Please refer to FIG. 1. FIG. 1 is a schematic flowchart of an interface processing method based on a microservice architecture in an embodiment of the present invention.

如图1所示,一种基于微服务架构的接口处理方法,包括接口服务请求中心、接口服务动态调度中心以及接口微服务中心,所述方法包括:As shown in Figure 1, an interface processing method based on a microservice architecture includes an interface service request center, an interface service dynamic dispatch center, and an interface microservice center. The method includes:

S11:各个业务系统向所述接口服务请求中心提出访问接口微服务请求,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列;S11: Each business system submits an access interface microservice request to the interface service request center, and the interface service request center decomposes the access interface microservice request to obtain a service request queue;

在本发明具体实施过程中,所述各个业务系统向所述接口服务请求中心提出访问接口微服务请求,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列包括:各个业务系统根据自身系统产生的增量业务数据情况,向所述接口服务请求中心提出访问接口微服务请求;根据所述访问接口微服务请求的增量数据块大小、或频率、或数据类型的特征,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列;所述接口服务请求中心将所述服务请求队列传送至所述接口服务动态调度中心。需要说明的是,当所述访问接口微服务请求增量当数据块大小超过限额时,根据所述访问接口微服请求的对象所属区域、或设备类型、或数据类型、或数据传输频率,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列。In the specific implementation process of the present invention, each business system submits an access interface microservice request to the interface service request center, and the interface service request center decomposes the access interface microservice request to obtain a service request queue including: Each business system submits an access interface microservice request to the interface service request center according to the incremental business data generated by its own system; according to the incremental data block size, or frequency, or data type requested by the access interface microservice. The interface service request center decomposes the access interface micro-service request to obtain a service request queue; the interface service request center transmits the service request queue to the interface service dynamic dispatch center. It should be noted that, when the access interface microservice request increments and the data block size exceeds the limit, according to the region to which the object requested by the access interface microservice belongs, or the device type, or the data type, or the data transmission frequency, the The interface service request center decomposes the access interface microservice request to obtain a service request queue.

具体的,各个业务系统1~N根据自身系统产生的增量业务数据情况,向接口服务请求中心申请访问接口微服务,接口服务请求中心根据服务请求的增量数据块大小、频率、数据类型的特征,采用动态分解方法,将接口服务请求动态分解成服务请求队列,并将服务请求队列发送到接口服务动态调度中心。需要说明的是,服务请求分解原则是根据服务请求对应的数据,按照不同区域,不同设备类型,不同数据类型,不同数据传输频率等,根据获取的增量业务系统数据块大小,将接口服务请求分解成服务请求队列;例如:当一次服务请求增量的数据块大小超过限额50000行时,服务请求限额为10000行,可以根据服务请求数据对象所属区域,设备类型,数据类型,数据传输频率,将服务请求分解成①、②、③,……等若干个服务请求,并形成服务请求队列。Specifically, each business system 1-N applies to the interface service request center to access the interface micro-service according to the incremental business data generated by its own system. It adopts the dynamic decomposition method to dynamically decompose the interface service requests into service request queues, and sends the service request queues to the interface service dynamic dispatch center. It should be noted that the principle of service request decomposition is to divide the interface service request according to the data corresponding to the service request, according to different regions, different device types, different data types, different data transmission frequencies, etc., according to the acquired incremental business system data block size. Decomposed into service request queues; for example: when the incremental data block size of a service request exceeds the limit of 50,000 lines, the service request limit is 10,000 lines, which can be determined according to the region, device type, data type, and data transmission frequency to which the service request data object belongs. The service request is decomposed into several service requests such as ①, ②, ③, ... and so on, and a service request queue is formed.

S12:所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度;S12: The interface service dynamic scheduling center performs interface service monitoring and service request dynamic scheduling on the service request queue;

在本发明具体实施过程中,所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度包括:所述接口服务动态调度中心通过监控分布式接口服务的运行情况,获取当前各个服务节点的资源应用情况,并快速感知系统流量变化及找出系统瓶颈,为服务请求动态调度提供依据;其中,所述接口服务监控包括:对服务请求的监控、和对服务资源的监控、和对微服务的监控。In the specific implementation process of the present invention, the interface service dynamic dispatch center performs interface service monitoring on the service request queue and the service request dynamic dispatch includes: the interface service dynamic dispatch center obtains the operation status of the distributed interface service by monitoring the operation of the distributed interface service. The current resource application status of each service node, and quickly perceive system traffic changes and identify system bottlenecks, providing a basis for dynamic scheduling of service requests; wherein, the interface service monitoring includes: monitoring of service requests and monitoring of service resources , and monitoring of microservices.

具体的,对服务请求的监控:动态的监控接口服务请求中心每种类型的服务请求队列长度、每个微服务接口对应的待执行子服务请求队列长度、子队列中每个服务请求执行状态,包括每个子服务请求待执行的数量大小,获取当前各个微服务接口任务量;对服务资源的监控:动态的监控每个微服务对应的服务器资源的应用情况,包括服务器的网络带宽、I/O、CPU、内存、缓存执行情况;对微服务的监控:监控每个微服务的请求量、服务平均请求时间、错误率、吞吐率等情况,获取微服务的执行性能指标。Specifically, the monitoring of service requests: dynamically monitor the queue length of each type of service request in the interface service request center, the queue length of the sub-service request to be executed corresponding to each micro-service interface, and the execution status of each service request in the sub-queue, Including the number of each sub-service request to be executed, to obtain the current task volume of each micro-service interface; monitoring of service resources: dynamically monitor the application of server resources corresponding to each micro-service, including server network bandwidth, I/O , CPU, memory, cache execution; Microservice monitoring: Monitor the request volume, service average request time, error rate, throughput rate, etc. of each microservice, and obtain the execution performance indicators of the microservice.

另外,所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度还包括:根据FIFO逻辑顺序,所述接口服务动态调度中心将访问接口微服务请求分配至各个微服务接口,并得到服务请求子队列;根据动态调整策略,所述接口服务动态调度中心对所述各个微服务接口执行中的所述服务请求子队列进行动态的调整,得到新的服务请求子队列;在本发明实施中,压缩整个服务请求处理时间和提高资源利用效率。In addition, the interface service dynamic scheduling center performing interface service monitoring and service request dynamic scheduling on the service request queue further includes: according to the FIFO logical order, the interface service dynamic scheduling center allocates the access interface microservice request to each microservice interface, and obtain the service request sub-queue; according to the dynamic adjustment strategy, the interface service dynamic dispatch center dynamically adjusts the service request sub-queue in the execution of each micro-service interface, and obtains a new service request sub-queue; In the implementation of the present invention, the entire service request processing time is compressed and the resource utilization efficiency is improved.

可选的,所述根据FIFO逻辑顺序,所述接口服务动态调度中心将访问接口微服务请求分配至各个微服务接口,并得到服务请求子队列包括:基于对服务请求的监控、和对服务资源的监控、和对微服务的监控,根据FIFO逻辑顺序,所述接口服务动态调度中心将访问接口微服务请求分配至各个微服务接口,并得到服务请求子队列。Optionally, according to the FIFO logical sequence, the interface service dynamic dispatch center allocates the access interface micro-service request to each micro-service interface, and obtains the service request sub-queue including: According to the FIFO logical sequence, the interface service dynamic dispatch center allocates the access interface microservice request to each microservice interface, and obtains the service request subqueue.

具体的,接口服务请求中心按照服务请求规则形成一个①、②、③,……⑩的服务请求队列,并将接口服务队列发送给接口服务动态调度中心,接口服务动态调度中心根据服务请求监控、服务资源监控、微服务监控的情况,按照FIFO逻辑顺序分配给各个微服务,形成新的服务子请求队列;服务请求分配主要考虑服务请求监控、服务资源监控、微服务监控的综合评估情况;其中,服务请求监控的执行策略包括:每个服务请求子队列待执行的服务请求数量、每个服务请求的执行状态、每个服务请求的预估执行时间的参数;服务资源监控的执行策略包括:网络带宽、服务器CUP、内存的执行情况;微服务监控的执行策略包括每个服务请求的平均等待时间、吞吐量的指标。Specifically, the interface service request center forms a service request queue of ①, ②, ③, ... ⑩ according to the service request rules, and sends the interface service queue to the interface service dynamic dispatch center, which monitors, The situation of service resource monitoring and micro-service monitoring is allocated to each micro-service according to the FIFO logical order to form a new service sub-request queue; service request allocation mainly considers the comprehensive evaluation of service request monitoring, service resource monitoring, and micro-service monitoring; among them , the execution strategy of service request monitoring includes: the number of service requests to be executed in each service request subqueue, the execution status of each service request, and the parameters of the estimated execution time of each service request; the execution strategy of service resource monitoring includes: Execution of network bandwidth, server CUP, and memory; the execution strategy of microservice monitoring includes indicators of average waiting time and throughput for each service request.

可选的,所述根据动态调整策略,所述接口服务动态调度中心对所述各个微服务接口执行中的所述服务请求子队列进行动态的调整,得到新的服务请求子队列包括:所述接口动态调度中心激活当前访问接口微服务请求,并根据所述FIFO顺序对所述访问接口微服务请求进行处理;在对所述访问接口微服务请求进行处理完成之后,返回至请求处理完成信息及接口服务请求调用情况报告和异常报告信息。Optionally, according to the dynamic adjustment policy, the interface service dynamic dispatch center dynamically adjusts the service request sub-queues in the execution of each micro-service interface, and obtaining a new service request sub-queue includes: the The interface dynamic dispatch center activates the current access interface microservice request, and processes the access interface microservice request according to the FIFO order; after processing the access interface microservice request, returns to the request processing completion information and Interface service request invocation report and exception report information.

具体的,每个服务请求子队列的接口服务请求按照FIFO逻辑顺序进行处理,首先激活当前接口服务请求,待当前接口服务请求任务处理完成后才激活后续接口服务请求,每个接口服务请求处理完成后返回请求处理完成信息及接口服务请求调用情况报告和异常报告信息;当某个子服务请求队列等待时间过长或者服务请求调用异常时,通过服务请求动态调度对接口服务请求进行重新分配,插入到新的子队列中进行处理。Specifically, the interface service requests of each service request subqueue are processed according to the FIFO logical order, the current interface service request is activated first, and the subsequent interface service requests are activated after the current interface service request task is processed, and the processing of each interface service request is completed. Then return the request processing completion information and the interface service request invocation report and exception report information; when the waiting time of a sub-service request queue is too long or the service request invocation is abnormal, the interface service request is reassigned through the service request dynamic scheduling, and inserted into The new subqueue is processed.

需要说明的是:当某个子服务请求子队列过长,接口服务请求等待时间过长,会影响接口服务的效率,按照接口服务监控对服务请求监控、服务资源监控、微服务监控的综合评估接口,将在子服务请求子队列后续未执行的服务请求分配到其他微服务节点进行处理;针对接口服务请求调用异常的情况,系统挂起该接口服务请求,并根据接口服务请求异常日志信息,执行回滚程序,通过服务请求动态调度进行重新分配。It should be noted that when a sub-service request sub-queue is too long and the waiting time for interface service requests is too long, the efficiency of the interface service will be affected. According to the interface service monitoring, the comprehensive evaluation interface for service request monitoring, service resource monitoring, and microservice monitoring , assign the service requests that are not executed in the sub-service request sub-queue to other micro-service nodes for processing; for the abnormal call of the interface service request, the system suspends the interface service request, and executes the request according to the abnormal log information of the interface service request. Roll back the program, reallocate through dynamic scheduling of service requests.

S13:根据所述访问接口微服务请求的设备类型,所述接口微服务中心部署与所述设备类型相应的微服务。S13: According to the device type requested by the access interface microservice, the interface microservice center deploys a microservice corresponding to the device type.

在本发明实施中,基于微服务架构,动态的将接口服务请求分解为若干可以进行并行处理的服务请求队列,并根据接口服务请求动态调度策略,实现对服务请求队列的动态分配,实现自动化、顺序化、准确且响应时间更快的接口数据处理,提高接口数据批量处理效率,增强配置的灵活性,减少了额外资源的开销,并且改善用户体验。In the implementation of the present invention, based on the micro-service architecture, the interface service request is dynamically decomposed into several service request queues that can be processed in parallel, and the dynamic allocation of the service request queue is realized according to the dynamic scheduling strategy of the interface service request, and the automation, Serialized, accurate and faster response time interface data processing, improve the batch processing efficiency of interface data, enhance the flexibility of configuration, reduce the overhead of additional resources, and improve user experience.

实施例二Embodiment 2

请参阅图2,图2是本发明实施例中的基于微服务架构的接口处理系统的结构组成示意图。Please refer to FIG. 2. FIG. 2 is a schematic structural composition diagram of an interface processing system based on a microservice architecture in an embodiment of the present invention.

如图2所示,一种基于微服务架构的接口处理系统,所述系统包括:As shown in Figure 2, an interface processing system based on a microservice architecture, the system includes:

服务请求分解模块11:用于各个业务系统向所述接口服务请求中心提出访问接口微服务请求,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列;Service request decomposition module 11: used by each business system to submit an access interface microservice request to the interface service request center, and the interface service request center decomposes the access interface microservice request to obtain a service request queue;

服务动态调度模块12:用于所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度;Service dynamic scheduling module 12: used for the interface service dynamic scheduling center to perform interface service monitoring and service request dynamic scheduling on the service request queue;

微服务部署模块13:用于根据所述访问接口微服务请求的设备类型,所述接口微服务中心部署与所述设备类型相应的微服务。Micro-service deployment module 13: configured to deploy the micro-service corresponding to the device type by the interface micro-service center according to the device type requested by the access interface micro-service.

具体地,本发明实施例的系统相关功能模块的工作原理可参见方法实施例一的相关描述,这里不再赘述。Specifically, for the working principle of the system-related functional modules in the embodiment of the present invention, reference may be made to the relevant description of the method embodiment 1, and details are not repeated here.

在本发明实施中,基于微服务架构,动态的将接口服务请求分解为若干可以进行并行处理的服务请求队列,并根据接口服务请求动态调度策略,实现对服务请求队列的动态分配,实现自动化、顺序化、准确且响应时间更快的接口数据处理,提高接口数据批量处理效率,增强配置的灵活性,减少了额外资源的开销,并且改善用户体验。In the implementation of the present invention, based on the micro-service architecture, the interface service request is dynamically decomposed into several service request queues that can be processed in parallel, and the dynamic allocation of the service request queue is realized according to the dynamic scheduling strategy of the interface service request, and the automation, Serialized, accurate and faster response time interface data processing, improve the batch processing efficiency of interface data, enhance the flexibility of configuration, reduce the overhead of additional resources, and improve user experience.

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,RandomAccess Memory)、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: Read Only Memory (ROM, Read Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.

另外,以上对本发明实施例所提供的一种基于微服务架构的接口处理方法及系统进行了详细介绍,本文中应采用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。In addition, the above has described in detail an interface processing method and system based on a micro-service architecture provided by the embodiments of the present invention. In this paper, specific examples should be used to illustrate the principles and implementations of the present invention. The description is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. , the contents of this specification should not be construed as limiting the invention.

Claims (9)

1.一种基于微服务架构的接口处理方法,包括接口服务请求中心、接口服务动态调度中心以及接口微服务中心,其特征在于,所述方法包括:1. An interface processing method based on a microservice architecture, comprising an interface service request center, an interface service dynamic dispatch center and an interface microservice center, wherein the method comprises: 各个业务系统向所述接口服务请求中心提出访问接口微服务请求,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列;Each business system submits an access interface microservice request to the interface service request center, and the interface service request center decomposes the access interface microservice request to obtain a service request queue; 所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度;The interface service dynamic scheduling center performs interface service monitoring and service request dynamic scheduling on the service request queue; 根据所述访问接口微服务请求的设备类型,所述接口微服务中心部署与所述设备类型相应的微服务。According to the device type requested by the access interface microservice, the interface microservice center deploys the microservice corresponding to the device type. 2.根据权利要求1所述的基于微服务架构的接口处理方法,其特征在于,所述各个业务系统向所述接口服务请求中心提出访问接口微服务请求,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列包括:2. The interface processing method based on a micro-service architecture according to claim 1, wherein each business system submits a request to the interface service request center for accessing the interface micro-service, and the interface service request center has a The access interface microservice request is decomposed, and the service request queue is obtained including: 各个业务系统根据自身系统产生的增量业务数据情况,向所述接口服务请求中心提出访问接口微服务请求;Each business system submits an access interface microservice request to the interface service request center according to the incremental business data situation generated by its own system; 根据所述访问接口微服务请求的增量数据块大小、或频率、或数据类型的特征,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列;According to the characteristics of the incremental data block size, frequency, or data type of the access interface microservice request, the interface service request center decomposes the access interface microservice request to obtain a service request queue; 所述接口服务请求中心将所述服务请求队列传送至所述接口服务动态调度中心。The interface service request center transmits the service request queue to the interface service dynamic dispatch center. 3.根据权利要求1所述的基于微服务架构的接口处理方法,其特征在于,所述根据所述访问接口微服务请求的增量数据块大小、或频率、或数据类型的特征,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列还包括:当所述访问接口微服务请求增量当数据块大小超过限额时,根据所述访问接口微服请求的对象所属区域、或设备类型、或数据类型、或数据传输频率,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列。3. The interface processing method based on a microservice architecture according to claim 1, wherein, according to the characteristics of the incremental data block size, or frequency, or data type requested by the access interface microservice, the The interface service request center decomposes the access interface microservice request, and obtaining the service request queue further includes: when the access interface microservice request increments and the data block size exceeds the limit, according to the access interface microservice request object belongs to area, or device type, or data type, or data transmission frequency, the interface service request center decomposes the access interface micro-service request to obtain a service request queue. 4.根据权利要求1所述的基于微服务架构的接口处理方法,其特征在于,所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度包括:所述接口服务动态调度中心通过监控分布式接口服务的运行情况,获取当前各个服务节点的资源应用情况,并快速感知系统流量变化及找出系统瓶颈,为服务请求动态调度提供依据。4. The interface processing method based on a micro-service architecture according to claim 1, wherein the interface service monitoring and dynamic scheduling of service requests performed by the interface service dynamic dispatch center on the service request queue comprises: the interface service By monitoring the operation of distributed interface services, the dynamic dispatch center obtains the current resource application status of each service node, and quickly senses system traffic changes and finds system bottlenecks, providing a basis for dynamic scheduling of service requests. 5.根据权利要求4所述的基于微服务架构的接口处理方法,其特征在于,所述接口服务监控包括:对服务请求的监控、和对服务资源的监控、和对微服务的监控。5 . The interface processing method based on a microservice architecture according to claim 4 , wherein the interface service monitoring comprises: monitoring service requests, monitoring service resources, and monitoring microservices. 6 . 6.根据权利要求1所述的基于微服务架构的接口处理方法,其特征在于,所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度还包括:6. The interface processing method based on micro-service architecture according to claim 1, wherein the interface service monitoring and dynamic scheduling of service requests performed by the interface service dynamic dispatch center on the service request queue further comprises: 根据FIFO逻辑顺序,所述接口服务动态调度中心将访问接口微服务请求分配至各个微服务接口,并得到服务请求子队列;According to the FIFO logical sequence, the interface service dynamic dispatch center allocates the access interface microservice request to each microservice interface, and obtains a service request subqueue; 根据动态调整策略,所述接口服务动态调度中心对所述各个微服务接口执行中的所述服务请求子队列进行动态的调整,得到新的服务请求子队列。According to the dynamic adjustment policy, the interface service dynamic dispatch center dynamically adjusts the service request sub-queues in the execution of each micro-service interface to obtain a new service request sub-queue. 7.根据权利要求6所述的基于微服务架构的接口处理方法,其特征在于,所述根据FIFO逻辑顺序,所述接口服务动态调度中心将访问接口微服务请求分配至各个微服务接口,并得到服务请求子队列包括:基于对服务请求的监控、和对服务资源的监控、和对微服务的监控,根据FIFO逻辑顺序,所述接口服务动态调度中心将访问接口微服务请求分配至各个微服务接口,并得到服务请求子队列。7. The interface processing method based on a microservice architecture according to claim 6, wherein, according to the FIFO logic sequence, the interface service dynamic dispatch center allocates the access interface microservice request to each microservice interface, and Obtaining the service request sub-queue includes: based on the monitoring of service requests, the monitoring of service resources, and the monitoring of micro-services, according to the FIFO logical sequence, the interface service dynamic dispatch center allocates the access interface micro-service request to each micro-service. Service interface, and get service request subqueue. 8.根据权利要求6所述的基于微服务架构的接口处理方法,其特征在于,所述根据动态调整策略,所述接口服务动态调度中心对所述各个微服务接口执行中的所述服务请求子队列进行动态的调整,得到新的服务请求子队列包括:8 . The interface processing method based on a micro-service architecture according to claim 6 , wherein, according to the dynamic adjustment policy, the interface service dynamic dispatch center performs the service requests in the execution of the respective micro-service interfaces. 9 . The subqueues are dynamically adjusted to obtain new service request subqueues including: 所述接口动态调度中心激活当前访问接口微服务请求,并根据所述FIFO顺序对所述访问接口微服务请求进行处理;The interface dynamic dispatch center activates the current access interface microservice request, and processes the access interface microservice request according to the FIFO order; 在对所述访问接口微服务请求进行处理完成之后,返回至请求处理完成信息及接口服务请求调用情况报告和异常报告信息。After the processing of the access interface microservice request is completed, the request processing completion information and the interface service request invocation status report and exception report information are returned. 9.一种基于微服务架构的接口处理系统,其特征在于,所述系统包括:9. An interface processing system based on a microservice architecture, wherein the system comprises: 服务请求分解模块:用于各个业务系统向所述接口服务请求中心提出访问接口微服务请求,所述接口服务请求中心对所述访问接口微服务请求进行分解,得到服务请求队列;Service request decomposition module: used by each business system to submit an access interface microservice request to the interface service request center, and the interface service request center decomposes the access interface microservice request to obtain a service request queue; 服务动态调度模块:用于所述接口服务动态调度中心对所述服务请求队列进行接口服务监控以及服务请求动态调度;Service dynamic scheduling module: used for the interface service dynamic scheduling center to perform interface service monitoring and service request dynamic scheduling on the service request queue; 微服务部署模块:用于根据所述访问接口微服务请求的设备类型,所述接口微服务中心部署与所述设备类型相应的微服务。Microservice deployment module: configured to deploy the microservice corresponding to the device type by the interface microservice center according to the device type requested by the access interface microservice.
CN202010486903.0A 2020-06-01 2020-06-01 An interface processing method and system based on microservice architecture Pending CN111741079A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010486903.0A CN111741079A (en) 2020-06-01 2020-06-01 An interface processing method and system based on microservice architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010486903.0A CN111741079A (en) 2020-06-01 2020-06-01 An interface processing method and system based on microservice architecture

Publications (1)

Publication Number Publication Date
CN111741079A true CN111741079A (en) 2020-10-02

Family

ID=72648132

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010486903.0A Pending CN111741079A (en) 2020-06-01 2020-06-01 An interface processing method and system based on microservice architecture

Country Status (1)

Country Link
CN (1) CN111741079A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491650A (en) * 2020-11-17 2021-03-12 中国平安财产保险股份有限公司 Method for dynamically analyzing call loop condition between services and related equipment
CN112817727A (en) * 2021-02-08 2021-05-18 上海百胜软件股份有限公司 Task management method, system, equipment and storage medium based on micro-service architecture
CN113992742A (en) * 2021-09-17 2022-01-28 深圳云天励飞技术股份有限公司 Interface access method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701921A (en) * 2013-12-31 2014-04-02 曙光云计算技术有限公司 Business realization method and device based on interface calling under cloud environment
CN108255614A (en) * 2016-12-28 2018-07-06 中国移动通信集团公司 A kind of interface calling system and method based on micro services framework
CN108322472A (en) * 2016-05-11 2018-07-24 甲骨文国际公司 Multi-tenant identity and data security management cloud service
CN110737517A (en) * 2019-08-14 2020-01-31 广西电网电力调度控制中心 electric power system cloud platform computing analysis micro-service resource scheduling method
CN111198727A (en) * 2020-01-06 2020-05-26 成都库珀区块链科技有限公司 Microservice interface data aggregation system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701921A (en) * 2013-12-31 2014-04-02 曙光云计算技术有限公司 Business realization method and device based on interface calling under cloud environment
CN108322472A (en) * 2016-05-11 2018-07-24 甲骨文国际公司 Multi-tenant identity and data security management cloud service
CN108255614A (en) * 2016-12-28 2018-07-06 中国移动通信集团公司 A kind of interface calling system and method based on micro services framework
CN110737517A (en) * 2019-08-14 2020-01-31 广西电网电力调度控制中心 electric power system cloud platform computing analysis micro-service resource scheduling method
CN111198727A (en) * 2020-01-06 2020-05-26 成都库珀区块链科技有限公司 Microservice interface data aggregation system and method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491650A (en) * 2020-11-17 2021-03-12 中国平安财产保险股份有限公司 Method for dynamically analyzing call loop condition between services and related equipment
CN112491650B (en) * 2020-11-17 2023-07-07 中国平安财产保险股份有限公司 Method for dynamically analyzing call loop condition between services and related equipment
CN112817727A (en) * 2021-02-08 2021-05-18 上海百胜软件股份有限公司 Task management method, system, equipment and storage medium based on micro-service architecture
CN113992742A (en) * 2021-09-17 2022-01-28 深圳云天励飞技术股份有限公司 Interface access method, device, equipment and storage medium
CN113992742B (en) * 2021-09-17 2023-10-10 深圳云天励飞技术股份有限公司 Interface access method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106294472B (en) A kind of querying method and device of Hadoop database HBase
WO2018130163A1 (en) Scheduling method and device for mobile cloud computing platform
CN111741079A (en) An interface processing method and system based on microservice architecture
CN107087019A (en) A Device-Cloud Collaborative Computing Architecture and Task Scheduling Device and Method
CN112162865A (en) Server scheduling method and device and server
CN112506808B (en) Test task execution method, computing device, computing system and storage medium
CN107968802A (en) The method, apparatus and filtering type scheduler of a kind of scheduling of resource
CN112783659A (en) Resource allocation method and device, computer equipment and storage medium
WO2020019743A1 (en) Traffic control method and device
CN103036946A (en) Method and system for processing file backup on cloud platform
CN104980314B (en) A kind of clustered node monitoring polling mechanism based on dynamic priority queue
WO2021129862A1 (en) Method and apparatus for managing container cluster node resource pool
CN114138434B (en) Big data task scheduling system
CN113535398B (en) Resource allocation adjustment method, device, electronic equipment and readable storage medium
CN106878389B (en) Method and device for resource scheduling in cloud system
CN109960591A (en) A method of the cloud application resource dynamic dispatching occupied towards tenant's resource
CN112272201B (en) Device management method, system and management cluster
CN104123185A (en) Resource scheduling method, device and system
CN111913784A (en) Task scheduling method and device, network element, and storage medium
CN110297698A (en) A kind of multipriority dynamic current limiting method, apparatus, server and storage medium
Rodriguez et al. VNF modeling towards the Cloud-RAN implementation
CN112104679A (en) Method, apparatus, device and medium for processing hypertext transfer protocol request
CN113934525A (en) Hadoop cluster task scheduling method based on positive and negative feedback load scheduling algorithm
CN111400021B (en) Deep learning method, device and system
CN107463433A (en) The method and apparatus for managing the resource of virtual machine

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201002