[go: up one dir, main page]

CN115220992A - Interface change monitoring method and device, computer equipment and storage medium - Google Patents

Interface change monitoring method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115220992A
CN115220992A CN202210385202.7A CN202210385202A CN115220992A CN 115220992 A CN115220992 A CN 115220992A CN 202210385202 A CN202210385202 A CN 202210385202A CN 115220992 A CN115220992 A CN 115220992A
Authority
CN
China
Prior art keywords
interface
data
target
target interface
stored
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
CN202210385202.7A
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.)
Terminus Technology Group Co Ltd
Original Assignee
Terminus Technology Group 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 Terminus Technology Group Co Ltd filed Critical Terminus Technology Group Co Ltd
Priority to CN202210385202.7A priority Critical patent/CN115220992A/en
Publication of CN115220992A publication Critical patent/CN115220992A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3041Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is an input/output interface
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to an interface change monitoring method, an interface change monitoring device, computer equipment and a storage medium, wherein the method comprises the following steps: monitoring the service state of the service module according to a preset monitoring period; according to the service state triggering interface calling instruction, calling a target interface to obtain return data of the target interface; and determining whether the return data of the target interface is consistent with interface data prestored in a database so as to monitor the change event of the target interface, wherein the prestored interface data is determined based on the historical return data of the target interface. The method reduces the interface operation and maintenance management cost, improves the service operation efficiency, and ensures the data accuracy and quality of the interface data acquisition link.

Description

接口变更监控方法、装置、计算机设备和存储介质Interface change monitoring method, device, computer equipment and storage medium

技术领域technical field

本发明涉及计算机技术领域,特别是涉及一种接口变更监控方法、装置、计算机设备和存储介质。The present invention relates to the field of computer technology, and in particular, to an interface change monitoring method, device, computer equipment and storage medium.

背景技术Background technique

现行常见的接口数据采集,通常以人工录入数据为主,例如百度、阿里、京东等大厂产品为例,也主要是人工处理为主,鲜有采用自动化方式进行处理的案例,能够支持不限定数据标准进行采集的案例极为罕见。The current common interface data collection is usually based on manual data entry. For example, Baidu, Ali, JD.com and other major products are mainly processed manually. There are few cases of automatic processing, which can support unlimited Cases where data standards are collected are extremely rare.

在众多企业接口网关产品中,接口信息的采集是必不可少的一个环节,从接口的初次创建、变更到废弃,涉及接口信息的维护工作都是通过人工操作的方式来进行,耗费了大量的人力和时间成本。In many enterprise interface gateway products, the collection of interface information is an indispensable link. From the initial creation, modification to disposal of the interface, the maintenance work involving interface information is carried out by manual operation, which consumes a lot of time. manpower and time costs.

依赖于人工进行接口数据维护的方式,不仅耗费人力和成本,而且在多个环节的时效性差,在接口发生增减、变更的时候,不能及时同步到接口信息采集方或者接口使用方,易造成延误。Relying on manual interface data maintenance is not only labor-intensive and cost-intensive, but also has poor timeliness in multiple links. When the interface is increased, decreased or changed, it cannot be synchronized to the interface information collector or interface user in time, which is easy to cause delay.

传统人工采集接口数据的方式,在数据的正确率上难以得到很好的保证,很可能造成一些录入错误,导致新问题的出现或返工。The traditional method of manually collecting interface data cannot guarantee the accuracy of the data, which may cause some input errors, resulting in the emergence of new problems or rework.

对于采用适配器模式进行设计和研发的接口信息采集产品时,其无疑是大大限制了接口提供方所采用的技术标准,无法适应新的数据格式或数据标准,通常的解决办法是进行二次开发,增加新的能力,用于弥补设计上的不足和缺陷。For interface information collection products designed and developed using the adapter mode, it will undoubtedly greatly limit the technical standards adopted by the interface provider, and cannot adapt to new data formats or data standards. The usual solution is to carry out secondary development. Add new capabilities to make up for design deficiencies and deficiencies.

发明内容SUMMARY OF THE INVENTION

本申请提供了一种接口变更监控方法、装置、计算机设备和存储介质。The present application provides an interface change monitoring method, apparatus, computer equipment and storage medium.

第一方面提供了一种接口变更监控方法,所述方法包括:A first aspect provides an interface change monitoring method, the method comprising:

根据预设的监测周期,监测服务模块的服务状态;Monitor the service status of the service module according to the preset monitoring period;

根据所述服务状态触发接口调用指令,调用目标接口,得到目标接口的返回数据;Trigger the interface calling instruction according to the service state, call the target interface, and obtain the return data of the target interface;

确定所述目标接口的返回数据与数据库中预存的接口数据是否一致,以监测所述目标接口的变更事件,其中,所述预存的接口数据基于所述目标接口的历史返回数据确定。It is determined whether the return data of the target interface is consistent with the interface data pre-stored in the database, so as to monitor the change event of the target interface, wherein the pre-stored interface data is determined based on the historical return data of the target interface.

在一些实施例中,所述根据所述服务状态触发接口调用指令,包括:In some embodiments, the triggering an interface invocation instruction according to the service state includes:

当所述服务模块的服务状态发生状态变更时,触发接口调用指令。When a state change occurs in the service state of the service module, an interface calling instruction is triggered.

在一些实施例中,所述调用目标接口,得到目标接口的返回数据,包括:In some embodiments, the calling target interface to obtain return data of the target interface, including:

所述服务模块返回JSON数据结构的返回数据,所述返回数据包含有所述目标接口的描述信息。The service module returns return data in a JSON data structure, and the return data includes description information of the target interface.

在一些实施例中,所述预存的接口数据基于所述目标接口的历史返回数据确定,包括:In some embodiments, the pre-stored interface data is determined based on historical return data of the target interface, including:

至少两次调用所述目标接口,如果每次调用后返回的历史返回数据相同,则存储所述历史返回数据。The target interface is called at least twice, and if the historical return data returned after each call is the same, the historical return data is stored.

在一些实施例中,所述返回数据包括所述目标接口的数据结构、提取路径和接口参数之一或组合;In some embodiments, the return data includes one or a combination of a data structure of the target interface, an extraction path, and interface parameters;

所述确定所述目标接口的返回数据与数据库中预存的接口数据是否一致,包括以下之一或组合:The determining whether the returned data of the target interface is consistent with the interface data pre-stored in the database includes one or a combination of the following:

确定所述返回数据的数据结构与预存的数据结构是否一致;Determine whether the data structure of the returned data is consistent with the pre-stored data structure;

确定所述返回数据的提取路径与预存的提取路径是否一致;Determine whether the extraction path of the returned data is consistent with the pre-stored extraction path;

确定所述返回数据的接口参数与预存的接口参数是否一致。Determine whether the interface parameters of the returned data are consistent with the pre-stored interface parameters.

在一些实施例中,所述接口的返回数据的数据结构通过以下步骤获得:In some embodiments, the data structure of the returned data of the interface is obtained by the following steps:

利用抽象语法树对所述返回数据进行词法分析,获得所述返回数据的数据结构。Perform lexical analysis on the returned data using an abstract syntax tree to obtain a data structure of the returned data.

在一些实施例中,所述方法还包括:In some embodiments, the method further includes:

接收首次运行的所述服务模块的基本信息。Receive basic information of the service module that is run for the first time.

本申请提供的接口变更监控方法、装置、计算机设备和存储介质中,该接口变更监控方法根据服务状态触发接口调用指令,调用目标接口,得到目标接口的返回数据;确定返回数据与数据库中预存的数据是否一致,以监测所述目标接口的变更事件。因此,本申请采用发现机制触发并自动化完成接口信息的采集、变更等同步工作为下游产品提供及时、准确的数据源。减少了服务模块运维管理成本,提高了业务运转效率。In the interface change monitoring method, device, computer equipment and storage medium provided by this application, the interface change monitoring method triggers an interface call instruction according to the service state, calls the target interface, and obtains the return data of the target interface; determines the return data and the pre-stored data in the database. Whether the data is consistent to monitor the change event of the target interface. Therefore, the present application adopts the discovery mechanism to trigger and automatically complete the collection and change of interface information and other synchronization tasks to provide timely and accurate data sources for downstream products. It reduces the operation and maintenance management cost of the service module and improves the efficiency of business operation.

附图说明Description of drawings

图1为一个实施例中提供的接口变更监控方法的流程图;1 is a flowchart of an interface change monitoring method provided in one embodiment;

图2为一个实施例中提供的接口变更监控方法的另一流程图;Fig. 2 is another flowchart of the interface change monitoring method provided in one embodiment;

图3为一个实施例中提供的接口变更监控装置的的框图;3 is a block diagram of an interface change monitoring device provided in one embodiment;

图4为一个实施例中计算机设备的框图。Figure 4 is a block diagram of a computer device in one embodiment.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.

可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。It will be understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element.

应用程序编程接口(Application Programming Interface,接口)可以实现计算机软件之间、不同平台之间的相互通讯与数据共享。开发人员根据实际需要会对接口进行更改,此外,开发程序中的BUG同样会导致接口发生意料之外的变更。接口的变更是指接口底层数据的变更,包括接口字段的新增、减少、字段类型和内容的改变、以及接口可用状态与不可用状态的切换。随着微服务化的流行,及时感知到接口的变更在开发和发布后尤为重要,如果因为开发中的问题导致接口变更未能及时发现,或者后端开发人员在对接口进行更改后,前端开发人员未能及时获取到接口更改信息,就可能会导致整个应用系统的崩溃。在相关技术中,主要由开发人员维护接口文档,然而开发人员往往难以独立高效地维护大量接口文档,通过人力维护接口文档感知接口变更,并不能及时高效地发现问题,继而使得对问题的处理也存在滞后性。对此,为了解决人工维护感知接口变更滞后性的问题,本申请提供了一种接口变更监测方法,可以自动监测接口的变更事件。Application programming interface (Application Programming Interface, interface) can realize mutual communication and data sharing between computer software and different platforms. Developers will make changes to the interface according to actual needs. In addition, bugs in the development program will also cause unexpected changes to the interface. The change of the interface refers to the change of the underlying data of the interface, including the addition and deletion of interface fields, the change of the field type and content, and the switch between the available state and the unavailable state of the interface. With the popularity of microservices, it is particularly important to perceive the changes of the interface in time after development and release. If the interface changes are not discovered in time due to problems in development, or the back-end developers make changes to the interfaces, the front-end development If the personnel fails to obtain the interface change information in time, it may lead to the collapse of the entire application system. In related technologies, developers are mainly responsible for maintaining interface documents. However, it is often difficult for developers to maintain a large number of interface documents independently and efficiently. By manpower maintaining interface documents to perceive interface changes, problems cannot be found in a timely and efficient manner, which in turn makes it difficult to deal with problems. There is lag. In this regard, in order to solve the hysteresis problem of manual maintenance perception of interface changes, the present application provides an interface change monitoring method, which can automatically monitor interface change events.

如图1和2所示,在一些实施例中,提供了一种接口变更监控方法,可以包括:As shown in Figures 1 and 2, in some embodiments, an interface change monitoring method is provided, which may include:

步骤101、根据预设的监测周期,监测服务模块的服务状态;Step 101, monitor the service status of the service module according to a preset monitoring period;

其中,服务模块的服务状态监测的密集度可以根据实际需要设定。例如通过设置定时器,当到达定时器所设置的时间时,则对服务模块的服务状发出监测指令。Among them, the intensity of service status monitoring of the service module can be set according to actual needs. For example, by setting a timer, when the time set by the timer is reached, a monitoring instruction is sent to the service status of the service module.

在一些实施例中,如图2所示,在服务模块运行平台上配置有多个业务服务模块,这些业务服务模块可以提供不同的功能,例如微信平台上的登录服务模块、语音聊天服务模块等。服务模块运行平台上还配置有服务注册模块、自动发现模块、映射关系配置模块、API数据采集模块、JSON数据转换模块、数据更新/API信息存储模块、服务管理模块。In some embodiments, as shown in FIG. 2 , a plurality of business service modules are configured on the service module operating platform, and these business service modules can provide different functions, such as a login service module on the WeChat platform, a voice chat service module, etc. . The service module operating platform is also configured with a service registration module, an automatic discovery module, a mapping relationship configuration module, an API data collection module, a JSON data conversion module, a data update/API information storage module, and a service management module.

服务注册模块:作为服务注册中心,提供注册API供服务模块进行调用,各服务模块部署上线或服务模块的基础服务变更以后,会第一时间向注册中心发出注册请求,记录服务模块的服务名称、标识信息、运行状态等信息。服务模块在运行阶段,以心跳机制的方式,定时向注册中心上报自身的存活状态或运行状态等信息。Service registration module: As the service registration center, it provides registration API for the service module to call. After each service module is deployed and the basic service of the service module is changed, it will send a registration request to the registration center at the first time, and record the service name of the service module, Identification information, running status and other information. During the running phase, the service module regularly reports information such as its own survival status or running status to the registration center by means of a heartbeat mechanism.

自动发现模块:自动发现模块有两个功能,自动发现模块有两个功能,第一、通过轮询机制,定时向服务注册模块发出检索请求,查询可用的服务列表,由服务管理模块接收服务信息进行管理;第二、服务状态切换为运行状态时,触发接口查询与对比操作,判断是否有接口更新事件发生,若有接口更新,则会触发新一轮的接口信息采集任务。Automatic discovery module: The automatic discovery module has two functions. The automatic discovery module has two functions. First, through the polling mechanism, it regularly sends a retrieval request to the service registration module to query the list of available services, and the service management module receives service information. Second, when the service state is switched to the running state, interface query and comparison operations are triggered to determine whether an interface update event occurs. If there is an interface update, a new round of interface information collection tasks will be triggered.

映射关系配置模块:这里的映射关系主要指的是json数据转换过程中用于从json文本信息中提取指定数据的路径,通常指的是jsonpath。该模块主要的功能是在服务模块正常运行阶段,通过在配置界面进行简单的路径配置,即可为任意json文件的解析工作提供可依赖的配置的数据,实现了从硬编码到配置化或数据化的一个技术转变。返回的数据格式不同,重新开发功能模块,进行升级或者修改。Mapping relationship configuration module: The mapping relationship here mainly refers to the path used to extract the specified data from the json text information during the json data conversion process, usually jsonpath. The main function of this module is to provide dependable configuration data for the parsing of any json file by simply configuring the path in the configuration interface during the normal operation of the service module, realizing the transition from hard coding to configuration or data. a technological shift. The returned data format is different, re-develop the function module, upgrade or modify it.

API数据采集模块:当自动发现模块发现有新的服务、或者某个服务的API清单发生变化时,会触发当前模块进行工作。本模块主要功能为,根据服务注册信息,获取服务地址,并根据服务提供的API信息查询接口一次性获取该服务下的所有API信息,并分别交由自动发现模块、JSON数据转换模块进行处理。自动发现模块对于接收到的最新API信息,会与上个版本的API信息进行对比,检查是否有更新,如果有更新,则直接交由JSON数据转换模块进行处理。API data collection module: When the automatic discovery module finds a new service or the API list of a service changes, it will trigger the current module to work. The main function of this module is to obtain the service address according to the service registration information, and obtain all the API information under the service at one time according to the API information query interface provided by the service, and hand it over to the automatic discovery module and the JSON data conversion module for processing. The automatic discovery module will compare the received latest API information with the API information of the previous version to check whether there is an update. If there is an update, it will be directly handed over to the JSON data conversion module for processing.

JSON数据转换模块:该模块为任务执行模块,主要用来完成原始JSON格式的数据向存储数据模型的转换,在转换过程中涉及提取数据的重要参数:提取路径(jsonpath),以及目标数据结构(targetObject)或字段(targetFiled),都应该从映射关系配置模块获取。JSON data conversion module: This module is a task execution module, which is mainly used to complete the conversion of the original JSON format data to the storage data model. In the conversion process, important parameters for extracting data are involved: the extraction path (jsonpath), and the target data structure ( targetObject) or field (targetFiled), should be obtained from the mapping relationship configuration module.

数据更新/API信息存储模块:本模块属于后置操作,是最后一个执行阶段,用于将转换后的目标数据持久化或更新到我们的存储设备,通常为数据库。Data update/API information storage module: This module belongs to the post operation and is the last execution stage, which is used to persist or update the converted target data to our storage device, usually a database.

服务管理模块:是纯管理模块,提供服务状态和服务配置两类数据,其中服务状态,用于记录各个服务模块的运行状态;服务配置,用于保存和管理jsonpath配置信息,为后续转换工作提供动态配置的数据。Service management module: It is a pure management module, which provides two types of data: service status and service configuration. Service status is used to record the running status of each service module; service configuration is used to save and manage jsonpath configuration information, which is used for subsequent conversion work. Dynamically configured data.

在一些实施例中,上述步骤101可以包括:In some embodiments, the above step 101 may include:

当服务模块的服务状态发生状态变更时,触发接口调用指令。When the service state of the service module changes, the interface calling instruction is triggered.

其中,状态变更包括第一状态变更和第二状态变更,第一状态变更包括服务模块的服务状态在上一个监测周期为停止状态,且服务模块的服务状态在当前监测周期为运行状态;第二状态变更包括服务模块是新增的服务模块,且新增的服务模块处于运行状态。The state change includes a first state change and a second state change, and the first state change includes that the service state of the service module is a stopped state in the previous monitoring period, and the service state of the service module is a running state in the current monitoring period; the second state change includes: The status change includes that the service module is a newly added service module, and the newly added service module is in a running state.

步骤102、根据服务状态触发接口调用指令,调用目标接口,得到目标接口的返回数据;Step 102: Trigger the interface calling instruction according to the service status, call the target interface, and obtain the return data of the target interface;

可以理解的是,目标API响应于调用指令会发送返回数据,返回数据可以反映目标API的底层数据,当目标API发生变更时,其返回数据也会随之变更。因此通过分析目标API的返回数据,可以监测API是否发生了变更事件。It can be understood that the target API will send return data in response to the calling instruction, and the return data can reflect the underlying data of the target API. When the target API changes, the return data will also change accordingly. Therefore, by analyzing the return data of the target API, it is possible to monitor whether the API has changed.

在一些实施例中,服务模块返回JSON数据结构的返回数据,返回数据包含有目标接口的描述信息。为了配合实现API的自动发现,各个服务模块必须提供一个可访问的API,用于返回json格式的信息。这里API信息指的是API的描述信息或者叫元数据信息。In some embodiments, the service module returns return data in a JSON data structure, and the return data includes description information of the target interface. In order to cooperate with the automatic discovery of API, each service module must provide an accessible API for returning information in json format. The API information here refers to the description information or metadata information of the API.

其中,述JSON(JavaScript Object Notation)数据结构是轻量级的数据交换格式,是基于javascript的一个子集,其完全采用独立语言的文本格式,容易阅读和编写,易于机器解析和生成,非常适合于服务端和客户端的交互。Among them, the JSON (JavaScript Object Notation) data structure is a lightweight data exchange format, which is a subset based on javascript. It completely adopts the text format of independent language, which is easy to read and write, and easy to parse and generate by machine. It is very suitable for for server-client interaction.

本申请采用“动态配置+Jsonpath解析”的方式,使自动化API数据采集的普遍适用性得到了很大的扩展,打破了常规地需要二次编码才能够进行扩展的技术屏障,使自动化API采集功能的落地和应用成为必然。一次开发即可完成不同json格式的API信息的采集,减少了可能带来的二次开发和扩展。This application adopts the method of "dynamic configuration + Jsonpath analysis", which greatly expands the universal applicability of automated API data collection, breaks the conventional technical barrier that requires secondary coding to be expanded, and enables the automatic API collection function The landing and application become inevitable. The collection of API information in different json formats can be completed in one development, reducing possible secondary development and expansion.

步骤103、确定目标接口的返回数据与数据库中预存的接口数据是否一致,以监测目标接口的变更事件,其中,预存的接口数据基于目标接口的历史返回数据确定。Step 103: Determine whether the return data of the target interface is consistent with the interface data pre-stored in the database, so as to monitor the change event of the target interface, wherein the pre-stored interface data is determined based on the historical return data of the target interface.

在一些实施例中,上述步骤103中预存的接口数据基于目标接口的历史返回数据确定,可以包括:In some embodiments, the pre-stored interface data in step 103 is determined based on historical return data of the target interface, and may include:

至少两次调用目标接口,如果每次调用后返回的历史返回数据相同,则存储历史返回数据。The target interface is called at least twice, and if the historical return data returned after each call is the same, the historical return data is stored.

在一些实施例中,返回数据包括目标接口的数据结构、提取路径和接口参数之一或组合;In some embodiments, the return data includes one or a combination of a data structure of the target interface, an extraction path, and interface parameters;

确定目标接口的返回数据与数据库中预存的接口数据是否一致,包括以下之一或组合:Determine whether the returned data of the target interface is consistent with the interface data pre-stored in the database, including one or a combination of the following:

确定返回数据的数据结构与预存的数据结构是否一致;Determine whether the data structure of the returned data is consistent with the pre-stored data structure;

确定返回数据的提取路径与预存的提取路径是否一致;Determine whether the extraction path of the returned data is consistent with the pre-stored extraction path;

确定返回数据的接口参数与预存的接口参数是否一致。Determine whether the interface parameters of the returned data are consistent with the pre-stored interface parameters.

其中,当目标API发生变更时,返回数据的数据结构也会随之变化,而且当目标API未发生变更时,针对每一次调用的返回数据的数据结构都是一致的。因此通过对比返回数据的数据结构与预存的数据结构是否一致,可以监测目标API的变更事件,无需人工介入对API文档进行维护,实现了API变更的自动监测。Among them, when the target API changes, the data structure of the returned data also changes accordingly, and when the target API does not change, the data structure of the returned data for each call is consistent. Therefore, by comparing whether the data structure of the returned data is consistent with the pre-stored data structure, the change events of the target API can be monitored, and the API documents can be maintained without manual intervention, realizing the automatic monitoring of API changes.

在一些实施例中,接口的返回数据的数据结构通过以下步骤获得:In some embodiments, the data structure of the returned data of the interface is obtained by the following steps:

利用抽象语法树对返回数据进行词法分析,获得返回数据的数据结构。Use the abstract syntax tree to perform lexical analysis on the returned data to obtain the data structure of the returned data.

本申请采用自动化发现和采集机制实现了接口信息的统一收集,在数据准确性、业务效率、运维管理成本方面,作出了很大积极改进。特别是针对于一些业务服务较多,API数量庞大,又不断更新迭代的业务体系下,API的管理和维护必然是一项复杂而又庞大的工作量。特别是API基础信息定的录入,效率极低。The application adopts the automatic discovery and collection mechanism to realize the unified collection of interface information, and has made great positive improvements in terms of data accuracy, business efficiency, and operation and maintenance management costs. Especially for some business systems with many business services, a large number of APIs, and continuous updates and iterations, the management and maintenance of APIs must be a complex and huge workload. In particular, the input of basic API information is extremely inefficient.

同时,接口变更自动发现作为一种集成能力,可以与其他业务产品进行整合,进而形成一些产品生态圈。例如:API网关管理平台、自动化API测试平台、接口全生命周期管理系统等等,所有以API作为基础资源的产品,都会从此得到很大的产品整合优势。At the same time, automatic discovery of interface changes, as an integration capability, can be integrated with other business products to form some product ecosystems. For example: API gateway management platform, automated API testing platform, interface life cycle management system, etc. All products that use API as the basic resource will gain great product integration advantages from now on.

在一些实施例中,如图3所示提供了一种接口变更监控装置,包括:In some embodiments, as shown in FIG. 3, an interface change monitoring device is provided, including:

状态监测单元311,用于根据预设的监测周期,监测服务模块的服务状态;a state monitoring unit 311, configured to monitor the service state of the service module according to a preset monitoring period;

接口数据采集单元312,用于根据服务状态触发接口调用指令,调用目标接口,得到目标接口的返回数据;The interface data collection unit 312 is used to trigger the interface calling instruction according to the service state, call the target interface, and obtain the return data of the target interface;

变更确定单元313,用于确定目标接口的返回数据与数据库中预存的接口数据是否一致,以监测目标接口的变更事件,其中,预存的接口数据基于目标接口的历史返回数据确定。The change determination unit 313 is configured to determine whether the return data of the target interface is consistent with the interface data pre-stored in the database, so as to monitor the change event of the target interface, wherein the pre-stored interface data is determined based on the historical return data of the target interface.

本申请采用发现机制触发并自动化完成API信息的采集、变更等同步工作为下游产品提供及时、准确的数据源。采用先进的数据解析技术,支持数据解析环节相关数据动态配置,支持任意json格式的API信息等类型的数据提取,不限于API信息的提取,可应用于其他数据转换和提取场景;一次开发,通过简单配置即可扩展能力,后续无需开发人员参与编码。This application uses the discovery mechanism to trigger and automate the collection and change of API information to provide timely and accurate data sources for downstream products. It adopts advanced data analysis technology, supports dynamic configuration of data in the data analysis process, and supports data extraction of API information in any json format. It is not limited to the extraction of API information, and can be applied to other data conversion and extraction scenarios; The capabilities can be extended with simple configuration, and subsequent coding by developers is not required.

在一个实施例中,如图4所示,提出了一种计算机设备,该计算机设备包括通过系统总线连接的处理器、非易失性存储介质、存储器和网络接口。其中,该计算机设备的非易失性存储介质存储有操作系统、知识库和计算机可读指令,知识库中可存储有控件信息序列,该计算机可读指令被处理器执行时,可使得处理器实现一种短媒体标签抽取方法。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该计算机设备的存储器中可存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行一种短媒体标签抽取方法。该计算机设备的网络接口用于与终端连接通信。本领域技术人员可以理解,图4中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。In one embodiment, as shown in FIG. 4, a computer device is presented, the computer device including a processor, a non-volatile storage medium, a memory and a network interface connected by a system bus. The non-volatile storage medium of the computer device stores an operating system, a knowledge base, and computer-readable instructions, and the knowledge base may store a sequence of control information. When the computer-readable instructions are executed by the processor, the Implement a short media tag extraction method. The processor of the computer device is used to provide computing and control capabilities and support the operation of the entire computer device. Computer-readable instructions may be stored in the memory of the computer device, and when executed by the processor, the computer-readable instructions may cause the processor to execute a method for extracting short media tags. The network interface of the computer equipment is used for communication with the terminal connection. Those skilled in the art can understand that the structure shown in FIG. 4 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.

处理器执行计算机程序时实现以下步骤:根据预设的监测周期,监测服务模块的服务状态;根据服务状态触发接口调用指令,调用目标接口,得到目标接口的返回数据;确定目标接口的返回数据与数据库中预存的接口数据是否一致,以监测目标接口的变更事件,其中,预存的接口数据基于目标接口的历史返回数据确定。When the processor executes the computer program, the following steps are implemented: monitor the service status of the service module according to a preset monitoring period; trigger an interface calling instruction according to the service status, call the target interface, and obtain the return data of the target interface; determine the return data of the target interface and Check whether the pre-stored interface data in the database are consistent, so as to monitor the change event of the target interface, wherein the pre-stored interface data is determined based on the historical return data of the target interface.

在一个实施例中,提出了一种存储有计算机可读指令的存储介质,该计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:根据预设的监测周期,监测服务模块的服务状态;根据服务状态触发接口调用指令,调用目标接口,得到目标接口的返回数据;确定目标接口的返回数据与数据库中预存的接口数据是否一致,以监测目标接口的变更事件,其中,预存的接口数据基于目标接口的历史返回数据确定。In one embodiment, a storage medium storing computer-readable instructions is provided. When executed by one or more processors, the computer-readable instructions cause the one or more processors to perform the following steps: according to a preset Monitoring cycle, monitoring the service status of the service module; triggering the interface calling instruction according to the service status, calling the target interface, and obtaining the return data of the target interface; Change event, wherein the pre-stored interface data is determined based on the historical return data of the target interface.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that the realization of all or part of the processes in the methods of the above embodiments can be accomplished by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the program is During execution, it may include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM).

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, all It is considered to be the range described in this specification.

以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present invention, and the descriptions thereof are specific and detailed, but should not be construed as a limitation on the scope of the patent of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can also be made, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the appended claims.

Claims (10)

1.一种接口变更监控方法,其特征在于,包括:1. an interface change monitoring method, is characterized in that, comprises: 根据预设的监测周期,监测服务模块的服务状态;Monitor the service status of the service module according to the preset monitoring period; 根据所述服务状态触发接口调用指令,调用目标接口,得到目标接口的返回数据;Trigger the interface calling instruction according to the service state, call the target interface, and obtain the return data of the target interface; 确定所述目标接口的返回数据与数据库中预存的接口数据是否一致,以监测所述目标接口的变更事件,其中,所述预存的接口数据基于所述目标接口的历史返回数据确定。It is determined whether the return data of the target interface is consistent with the interface data pre-stored in the database, so as to monitor the change event of the target interface, wherein the pre-stored interface data is determined based on the historical return data of the target interface. 2.根据权利要求1所述的接口变更监控方法,其特征在于,所述根据所述服务状态触发接口调用指令,包括:2. The interface change monitoring method according to claim 1, wherein the triggering an interface calling instruction according to the service state comprises: 当所述服务模块的服务状态发生状态变更时,触发接口调用指令。When a state change occurs in the service state of the service module, an interface calling instruction is triggered. 3.根据权利要求1所述的接口变更监控方法,其特征在于,所述调用目标接口,得到目标接口的返回数据,包括:3. The interface change monitoring method according to claim 1, wherein the calling target interface obtains the return data of the target interface, comprising: 所述服务模块返回JSON数据结构的返回数据,所述返回数据包含有所述目标接口的描述信息。The service module returns return data in a JSON data structure, and the return data includes description information of the target interface. 4.根据权利要求1所述的接口变更监控方法,其特征在于,所述预存的接口数据基于所述目标接口的历史返回数据确定,包括:4. The interface change monitoring method according to claim 1, wherein the pre-stored interface data is determined based on historical return data of the target interface, comprising: 至少两次调用所述目标接口,如果每次调用后返回的历史返回数据相同,则存储所述历史返回数据。The target interface is called at least twice, and if the historical return data returned after each call is the same, the historical return data is stored. 5.根据权利要求1所述的接口变更监控方法,其特征在于,所述返回数据包括所述目标接口的数据结构、提取路径和接口参数之一或组合;5. The interface change monitoring method according to claim 1, wherein the returned data comprises one or a combination of a data structure, an extraction path and an interface parameter of the target interface; 所述确定所述目标接口的返回数据与数据库中预存的接口数据是否一致,包括以下之一或组合:The determining whether the returned data of the target interface is consistent with the interface data pre-stored in the database includes one or a combination of the following: 确定所述返回数据的数据结构与预存的数据结构是否一致;Determine whether the data structure of the returned data is consistent with the pre-stored data structure; 确定所述返回数据的提取路径与预存的提取路径是否一致;Determine whether the extraction path of the returned data is consistent with the pre-stored extraction path; 确定所述返回数据的接口参数与预存的接口参数是否一致。Determine whether the interface parameters of the returned data are consistent with the pre-stored interface parameters. 6.根据权利要求5所述的接口变更监控方法,其特征在于,所述接口的返回数据的数据结构通过以下步骤获得:6. The interface change monitoring method according to claim 5, wherein the data structure of the returned data of the interface is obtained by the following steps: 利用抽象语法树对所述返回数据进行词法分析,获得所述返回数据的数据结构。Perform lexical analysis on the returned data using an abstract syntax tree to obtain a data structure of the returned data. 7.根据权利要求1所述的接口变更监控方法,其特征在于,所述方法还包括:7. The interface change monitoring method according to claim 1, wherein the method further comprises: 接收首次运行的所述服务模块的基本信息。Receive basic information of the service module that is run for the first time. 8.一种接口变更监控装置,其特征在于,包括:8. An interface change monitoring device, characterized in that, comprising: 状态监测单元,用于根据预设的监测周期,监测服务模块的服务状态;a state monitoring unit, used for monitoring the service state of the service module according to a preset monitoring period; 接口数据采集单元,用于根据所述服务状态触发接口调用指令,调用目标接口,得到目标接口的返回数据;an interface data collection unit, configured to trigger an interface calling instruction according to the service state, call a target interface, and obtain return data of the target interface; 变更确定单元,用于确定所述目标接口的返回数据与数据库中预存的接口数据是否一致,以监测所述目标接口的变更事件,其中,所述预存的接口数据基于所述目标接口的历史返回数据确定。A change determination unit, configured to determine whether the returned data of the target interface is consistent with the interface data pre-stored in the database, so as to monitor the change event of the target interface, wherein the pre-stored interface data is returned based on the history of the target interface Data OK. 9.一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行如权利要求1至7中任一项权利要求所述接口变更监控方法的步骤。9. A computer device comprising a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the processor is caused to perform as claimed in claims 1 to 7 The steps of the interface change monitoring method described in any one of claims. 10.一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行如权利要求1至7中任一项权利要求所述接口变更监控方法的步骤。10. A storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform any one of claims 1 to 7 The steps of the interface change monitoring method.
CN202210385202.7A 2022-04-13 2022-04-13 Interface change monitoring method and device, computer equipment and storage medium Pending CN115220992A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210385202.7A CN115220992A (en) 2022-04-13 2022-04-13 Interface change monitoring method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210385202.7A CN115220992A (en) 2022-04-13 2022-04-13 Interface change monitoring method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115220992A true CN115220992A (en) 2022-10-21

Family

ID=83606421

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210385202.7A Pending CN115220992A (en) 2022-04-13 2022-04-13 Interface change monitoring method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115220992A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117850741A (en) * 2024-01-10 2024-04-09 杭州优时软件有限公司 Interface design method and system for ERP system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710298A (en) * 2018-08-20 2019-05-03 平安普惠企业管理有限公司 Interface managerial method, interface management apparatus, interface management equipment and storage medium
CN110175099A (en) * 2019-04-15 2019-08-27 平安普惠企业管理有限公司 Interface changes reminding method, device, computer equipment and storage medium
CN110727555A (en) * 2019-09-20 2020-01-24 平安普惠企业管理有限公司 Service interface management method, device, medium and computer equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710298A (en) * 2018-08-20 2019-05-03 平安普惠企业管理有限公司 Interface managerial method, interface management apparatus, interface management equipment and storage medium
CN110175099A (en) * 2019-04-15 2019-08-27 平安普惠企业管理有限公司 Interface changes reminding method, device, computer equipment and storage medium
CN110727555A (en) * 2019-09-20 2020-01-24 平安普惠企业管理有限公司 Service interface management method, device, medium and computer equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117850741A (en) * 2024-01-10 2024-04-09 杭州优时软件有限公司 Interface design method and system for ERP system

Similar Documents

Publication Publication Date Title
US8938421B2 (en) Method and a system for synchronizing data
WO2020253079A1 (en) Jmeter-based distributed performance test method and apparatus, device, and storage medium
WO2019001312A1 (en) Method and apparatus for realizing alarm association, and computer readable storage medium
CN114697232B (en) System and method for acquiring index data of Skywalk probe and electronic equipment
CN115934855A (en) Full-link field level blood margin analysis method, system, equipment and storage medium
CN107241315A (en) Cut-in method, device and the computer-readable recording medium of bank's gateway interface
CN113157411B (en) Celery-based reliable configurable task system and device
CN113946559A (en) Data processing method, target database system and data processing system
CN111752916A (en) Data acquisition method and device, computer readable storage medium and electronic equipment
CN115220992A (en) Interface change monitoring method and device, computer equipment and storage medium
CN114244740B (en) Network data acquisition method and system
CN111459827A (en) A method, device and computer for realizing cross-platform debugging shell
CN115858499A (en) Database partition processing method and device, computer equipment and storage medium
CN109324892B (en) Distributed management method, distributed management system and device
WO2025124206A1 (en) Micro-service configuration real-time management method and system, storage medium, and computer device
CN112260902A (en) Network device monitoring method, device, device and storage medium
CN117407205A (en) Abnormality processing method, abnormality processing device, storage medium and electronic equipment
US20220358003A1 (en) Data Management Method, Apparatus, and Device, Computer-Readable Storage Medium, and System
CN116880872A (en) Cluster firmware combination upgrade method, system, terminal and storage media
CN112711466B (en) Hanging affair inspection method and device, electronic equipment and storage medium
CN114500289B (en) Control plane recovery method, device, control node and storage medium
CN116916356A (en) Log analysis method, device, terminal, network equipment and readable storage medium
CN113238901B (en) Multi-device automatic testing method and device, storage medium and computer device
CN112765188B (en) Configuration information processing method, configuration management system, electronic device and storage medium
CN116566810A (en) System exception handling method, device and equipment based on Spring MVC framework

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