Interface data processing method, device, equipment and storage medium

By receiving source data and determining the destination interface based on the target template, combined with the window algorithm to manage the number of interface requests, the problem of inconsistent data formats in joint debugging of system interfaces from different manufacturers is solved, automatic adaptation and efficient conversion of interface data are realized, and avoidance of Risk of interface downtime.

CN113867986BActive Publication Date: 2024-10-18RUN TECH CO LTD BEIJING
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111152607.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2024-10-18
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

There is a lack of uniformity in data formats and naming standards in interface joint debugging between systems from different manufacturers, which results in the need to re-develop test interfaces, increasing the workload, and too frequent interface calls may cause the target interface to crash.

Method used

By receiving data from the source interface, the target template is determined and matched to the destination interface, and the current request quantity is determined based on the number of preset window data blocks and sliding window request data blocks. If the request conditions are met, the data is processed and the destination interface is called to realize data format conversion and Interface adaptation.

Benefits of technology

Parameter format adaptation of interface data from different sources can be achieved without secondary development, avoiding interface downtime and improving interface joint debugging efficiency and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113867986B_ABST
    Figure CN113867986B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses an interface data processing method, device, equipment and storage medium, the method comprising: receiving source data sent by a source interface, and determining a target template corresponding to the source data; determining at least one destination interface corresponding to the source data according to the target template; for each destination interface, determining the current request quantity of the destination interface according to the preset window data block quantity and the sliding window request data block; if the current request quantity of the destination interface meets the preset request condition, processing the source data according to the target template, determining the destination data corresponding to each destination interface; calling the destination interface, and sending the destination data to the corresponding destination interface. The problem that the corresponding test interface must be adapted when converting the source data of different source interfaces into the parameter format of the destination interface is solved. By setting the request condition, the interface downtime caused by too frequent destination interface calls can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of communication technology, and in particular to an interface data processing method, device, equipment and storage medium. Background Art

[0002] Nowadays, big data is increasingly used, and the sources of big data are diverse. To achieve data transmission through interfaces, unified design principles and development methods are usually used to develop business interfaces, such as RESTful. RESTful architecture design often transmits data in JSON format to prevent injection and other security issues. How to solve the system joint debugging of multiple manufacturers is a common problem. At present, the solution to system interface joint debugging is usually to develop and adapt an interface for each interface.

[0003] However, there is no unified standard for the data format and naming of JSON. Even developers from the same manufacturer may construct completely different parameter formats for the same requirements. This requires the joint debugging between different manufacturers to redevelop the test interface for adaptation, which increases the workload. In addition, if the interface is called too frequently, the destination interface may crash. Summary of the invention

[0004] The present invention provides an interface data processing method, device, equipment and storage medium to realize processing of interface data from different sources.

[0005] In a first aspect, an embodiment of the present invention provides an interface data processing method, the interface data processing method comprising:

[0006] Receive source data sent by a source interface, and determine a target template corresponding to the source data;

[0007] Determine at least one destination interface corresponding to the source data according to the target template;

[0008] For each destination interface, determine the current request quantity of the destination interface according to the preset window data block quantity and the sliding window request data block;

[0009] If the current request quantity of the destination interface meets the preset request condition, the source data is processed according to the target template to determine the destination data corresponding to each of the destination interfaces;

[0010] The destination interface is called, and the destination data is sent to the corresponding destination interface.

[0011] In a second aspect, an embodiment of the present invention further provides an interface data processing device, the interface data processing device comprising:

[0012] A receiving module, used for receiving source data sent by a source interface, and determining a target template corresponding to the source data;

[0013] An interface determination module, used to determine at least one destination interface corresponding to the source data according to the target template;

[0014] A request quantity determination module, used to determine the current request quantity of each destination interface according to the preset window data block quantity and the sliding window request data block;

[0015] A data processing module, configured to process the source data according to the target template to determine the destination data corresponding to each of the destination interfaces if the current request quantity of the destination interface meets a preset request condition;

[0016] The interface calling module is used to call the destination interface and send the destination data to the corresponding destination interface.

[0017] In a third aspect, an embodiment of the present invention further provides a computer device, the device comprising:

[0018] one or more processors;

[0019] a memory for storing one or more programs,

[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement an interface data processing method as described in any one of the embodiments of the present invention.

[0021] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements an interface data processing method as described in any one of the embodiments of the present invention.

[0022] The embodiment of the present invention provides an interface data processing method, device, equipment and storage medium, which receives source data sent by a source interface and determines a target template corresponding to the source data; determines at least one destination interface corresponding to the source data according to the target template; for each destination interface, determines the current request quantity of the destination interface according to the preset window data block quantity and the sliding window request data block; if the current request quantity of the destination interface meets the preset request condition, processes the source data according to the target template to determine the destination data corresponding to each destination interface; calls the destination interface and sends the destination data to the corresponding destination interface. The problem that the corresponding test interface must be adapted when the source data of different source interfaces is converted into the parameter format of the destination interface is solved. The template is used to uniformly manage and convert the format of different types of source data to complete parameter format adaptation. The current request quantity of the destination interface is determined according to the preset window data block quantity and the sliding window request data block, and it is judged whether the current request quantity of the destination interface meets the preset request condition. When the request condition is met, the format conversion from the source data to the destination data is completed, and the destination interface is called to avoid the interface downtime caused by too frequent calls to the destination interface. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flow chart of an interface data processing method in Embodiment 1 of the present invention;

[0024] Figure 2 is a flow chart of an interface data processing method in Embodiment 2 of the present invention;

[0025] Figure 3 It is a structural schematic diagram of an interface data processing device in Embodiment 3 of the present invention;

[0026] Figure 4 It is a structural diagram of a computer device in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings. It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0028] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0029] In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0030] Embodiment 1

[0031] Figure 1 A flow chart of an interface data processing method provided in the first embodiment of the present application is given, and the method is applicable to the case where data of different interfaces are uniformly and standardizedly processed. The method can be executed by a computer device loaded with a software tool, and the interface data processing method can be integrated as a plug-in in the loaded software tool, and the method is implemented by running the software tool. The computer device can be composed of two or more physical entities, or it can be composed of one physical entity. Generally speaking, the computer device can be a notebook, a desktop computer, a smart tablet, etc.

[0032] like Figure 1 As shown, the interface data processing method provided in the first embodiment specifically includes the following steps:

[0033] S101, receiving source data sent by a source interface, and determining a target template corresponding to the source data.

[0034] In this embodiment, the source interface can be specifically understood as an interface that sends source data and calls interface requirements. The source data can be specifically understood as the data sent by the information source, and the source data in this application refers to the data sent by the source interface. The target template can be specifically understood as the template corresponding to the source data, and the target template at least includes the data format of the source data and the data format of the interface to which the source data is sent.

[0035] Specifically, templates corresponding to different source interfaces are pre-configured. Usually, one interface implements one type of service. Templates of different source interfaces are configured according to specific service types and service requirements. The call of the source interface is received, and the source data sent by the source interface is received. By parsing the source data, identification information for distinguishing different templates is determined, and each template is matched according to the identification information to determine the corresponding target template.

[0036] S102: Determine at least one destination interface corresponding to the source data according to the target template.

[0037] In this embodiment, the destination interface can be specifically understood as the interface called to receive information. The destination template is searched, and the destination interface corresponding to the source data is determined according to the mapping relationship between the interfaces included in the target template. The source data may correspond to one or more destination interfaces.

[0038] S103: For each destination interface, determine the current request quantity of the destination interface according to the preset window data block quantity and the sliding window request data block.

[0039] In this embodiment, the preset window data block number can be specifically understood as the number of data blocks contained in the preset sliding window. The sliding window request data block can be specifically understood as the data block recording the number of requests in the sliding window. The current request number can be specifically understood as the number of requests when the destination interface is currently processing data.

[0040] Specifically, when limiting the number of requests, it is usually measured by the response time QPS, that is, within a certain period of time, the number of requests has an upper limit. The present application limits the number of requests through a window sliding algorithm. The sliding window is divided into sliding window request data blocks of the same time length, and the number of requests of the corresponding time is stored in each sliding window request data block. The number of preset window data blocks is the number of sliding window request data blocks included in a sliding window. The length of the window can be set according to demand. In order to facilitate practical application, the sliding window length in the present application is consistent with the response time, and the response time is usually set to 1s. Therefore, the sliding window length in the present application is set to 1s as an example, and the number of preset window data blocks is 5, then the divided time length is 0.2, that is, [0-0.20)s is the first sliding window request data block, [0.2-0.4) is the second sliding window request data block... [0.8-1) is the third sliding window request data block. For each destination interface, a different number of preset window data blocks can be set. At the same time, since the number of times each destination interface is called is different, each destination interface has a corresponding current request number. For each destination interface, obtain the corresponding preset window data block quantity and at least one sliding window request data block, obtain the corresponding number of sliding window request data blocks according to the preset window data block quantity, and calculate the current request quantity according to the number of requests in each sliding window request data block.

[0041] S104: If the current request quantity of the destination interface meets the preset request condition, the source data is processed according to the target template to determine the destination data corresponding to each destination interface.

[0042] In this embodiment, the request condition can be specifically understood as a judgment condition for determining whether the current request quantity meets the requirements. For example, the current request quantity is less than a certain threshold to meet the preset request condition. The request condition is configured according to the current limiting requirements of different destination interfaces. The request condition can also be stored in the target template. The destination data can be specifically understood as data in a data format that can be recognized by the destination interface.

[0043] Specifically, each destination interface has a corresponding request condition, that is, the request conditions of different destination interfaces may be different. If the current number of requests for the destination interface meets the corresponding request condition, the call of the destination interface does not exceed the upper limit, and the destination interface can be called. The source data is processed according to the data format contained in the target template to obtain the destination data that meets the format requirements of the destination interface. Since one source data may correspond to multiple destination interfaces, the number of destination data may be one or more.

[0044] S105: Call the destination interface and send the destination data to the corresponding destination interface.

[0045] Call each destination interface and send the destination data to the corresponding destination interface. Realize data transmission between the source interface and the destination interface, and adapt it without secondary development. Perform data format conversion through pre-configured target templates to achieve interface adaptation.

[0046] The embodiment of the present invention provides an interface data processing method, which receives source data sent by a source interface and determines a target template corresponding to the source data; determines at least one destination interface corresponding to the source data according to the target template; for each destination interface, determines the current request quantity of the destination interface according to the preset window data block quantity and the sliding window request data block; if the current request quantity of the destination interface meets the preset request condition, processes the source data according to the target template to determine the destination data corresponding to each destination interface; calls the destination interface and sends the destination data to the corresponding destination interface. The problem that the corresponding test interface must be adapted when the source data of different source interfaces is converted into the parameter format of the destination interface is solved. The template is used to uniformly manage and convert the format of different types of source data, complete the parameter format adaptation, and the adaptation can be achieved without secondary development. The current request quantity of the destination interface is determined according to the preset window data block quantity and the sliding window request data block, and it is judged whether the current request quantity of the destination interface meets the preset request condition. When the request condition is met, the format conversion from the source data to the destination data is completed, and the destination interface is called to avoid the interface downtime caused by too frequent calls to the destination interface.

[0047] Embodiment 2

[0048] Figure 2 This is a flow chart of an interface data processing method provided in Embodiment 2 of the present invention. The technical solution of this embodiment is further refined on the basis of the above technical solution, and specifically mainly includes the following steps:

[0049] S201, receiving source data sent by a source interface, parsing the source data, and determining a uniform resource locator.

[0050] In this embodiment, the uniform resource locator is a uniform resource locator mark, which is the network address of the file. The uniform resource locator is obtained by parsing the source data from the storage field of the uniform resource locator.

[0051] S202: Search the server directory according to the uniform resource locator to determine a matching target template.

[0052] In this embodiment, the server directory can be specifically understood as a directory for storing files on the server. The developer fills in the information of the parameter transmission format of each source interface in the provided template in advance, forms a corresponding template after filling in, uploads it to the specified directory of the server, and restarts the service. During the application process, the server directory is searched according to the uniform resource locator, the corresponding server directory is found, and the matching target template is obtained from the corresponding server directory.

[0053] S203: Determine at least one destination interface corresponding to the source data according to the target template.

[0054] The target template includes each destination interface corresponding to the source interface, and each destination interface corresponding to the source interface is determined as the destination interface corresponding to the source data.

[0055] S204: For each destination interface, taking the sliding window request data block at the current time as the starting point, search forward for the sliding window request data block according to the preset number of window data blocks.

[0056] In this embodiment, the current time can be specifically understood as the current moment of the execution method. Specifically, after determining the destination interface, since the current number of requests of the destination interface needs to be determined, the current time is obtained after the destination interface is determined (or before the current number of requests is determined). For each destination interface, determine the sliding window request data block where the current time is located. Taking the division of the sliding window in the above embodiment as an example, the current time is 10:20:32, 0.56 milliseconds. Since the length of the sliding window is 1s, it is only necessary to determine the sliding window request data block where the current time is located based on milliseconds. The sliding window request data block where 0.56 milliseconds is located is the third of the sliding window. Taking this sliding window request data block as the first one, search forward (i.e., in the direction of historical time) for the sliding window request data block with the preset number of window data blocks, that is, search forward for 5 sliding window request data blocks.

[0057] What you need to know is that when there are multiple destination interfaces, if the current number of requests for each destination interface is determined in sequence, the current time should be obtained before the current number of requests for this destination interface is determined, so as to avoid the time difference between the time point of obtaining the current time and the time point of determining the current number of requests being too long, resulting in inaccurate data.

[0058] S205: Calculate the total number of requests for data block records in each sliding window, and determine the total number as the current request quantity of the destination interface.

[0059] Determine the number of requests recorded in each obtained sliding window request data block, calculate the sum of each request number, and use the obtained sum as the current request quantity of the destination interface.

[0060] The current number of requests is calculated by sliding windows to avoid uneven distribution of requests in a fixed time period, which may cause the interface to be called too frequently. For example, the upper limit of 1s request is 60 times. If 40 requests are made in the first 0.4s, high concurrency will result, which will cause downtime due to frequent interface calls. The current number of requests is calculated by sliding windows. The upper limit of the number of calls in the first 0.4s is related to the number of calls in the previous second (the number of requests for the last three sliding windows requesting data blocks in the previous second). Reduce or even avoid high concurrency.

[0061] S206: If the current request quantity of the destination interface meets the preset request condition, parse the source data and determine the call type.

[0062] In this embodiment, the call type includes synchronous call and asynchronous call. The source data carries the call type in the field. If the current request quantity of the destination interface meets the preset request condition, the source data is parsed to obtain the relevant information of the call type carried in the specific field, and the call type of the source data is determined.

[0063] S207, determine whether the call type is an asynchronous call, if so, execute S208; otherwise, execute S209.

[0064] S208. Feedback the call success information to the source interface.

[0065] When the call type is an asynchronous call, a call success message is generated and fed back to the source interface. Then the subsequent destination data is determined and sent, that is, S209 is executed. If the call type is not an asynchronous call, the subsequent destination data is directly determined and sent, that is, S209 is executed. If the call type is not an asynchronous call, its call type is a synchronous call.

[0066] S209: Determine the source data format of the source interface and the destination data format of each destination interface according to the target template.

[0067] In this embodiment, the source data format can be specifically understood as a data format processed and recognized by the source interface, and the destination data format can be specifically understood as a data format that can be processed and recognized by the destination interface.

[0068] Specifically, the target template predefines the data formats of different interfaces and the correspondence between the source interface and the destination interface. When the target template is obtained, the source data format of the source interface and the destination data format of each destination interface corresponding to the source interface can be determined by querying the data in the target template.

[0069] S210: Process the source data according to the source data format, and extract at least one source key-value pair.

[0070] In this embodiment, the source key-value pair can be specifically understood as a key-value pair in the source data, that is, a key and a corresponding value, where the key is the source key and the value is the source value. The various keys in the source data can be determined according to the source data format. For example, name1 and age1 are different keys respectively. The various source key-value pairs in the source data are extracted according to the source data format.

[0071] S211. For each destination interface, match the source key in the source key-value pair with the destination key in the destination data format corresponding to the destination interface, and use the source value in the source key-value pair as the destination value of the corresponding destination key to form a destination key-value pair.

[0072] In this embodiment, the destination key-value pair can be specifically understood as the key-value pair in the destination data, which is also divided into a key and a corresponding value. The key is the destination key, and the value is the destination value. For example, nameA and ageA are different keys.

[0073] For different destination interfaces, they have their own destination key-value pairs. The source key in the source data is matched with the destination key in the destination data format. For example, name1 corresponds to nameA, and the source value corresponding to name1 is used as the destination value of nameA to form a destination key-value pair; age1 corresponds to ageA, and the source value corresponding to age1 is used as the destination value of ageA to form another destination key-value pair.

[0074] S212. Form destination data according to each destination key-value pair.

[0075] Write each destination key-value pair into the corresponding field to generate destination data containing each destination key-value pair.

[0076] S213: Call the destination interface and send the destination data to the corresponding destination interface.

[0077] Each destination interface is called separately, and each destination data is sent to the corresponding destination interface.

[0078] As an optional embodiment of the present embodiment, the further optimization of the present optional embodiment includes determining the corresponding target sliding window request data block according to the interface call time of the destination interface; and updating the number of requests in the target sliding window request data block.

[0079] In this embodiment, the interface call time can be specifically understood as the time of calling the target interface. The target sliding window request data block can be specifically understood as the sliding window request data block corresponding to the interface call time.

[0080] Specifically, the interface call time of the destination interface is obtained, and the sliding window request data block corresponding to the interface call time is determined, and it is used as the target sliding window request data block. Taking the above exemplary distance as an example, the interface call time is 10 hours, 20 minutes, 33 seconds, and 0.27 milliseconds. The sliding window request data block where the interface call time is located is the second one in the sliding window. This sliding window request data block is used as the target sliding window request data block, and the number of requests in the target sliding window request data block is accumulated and added by 1 to update the number of requests.

[0081] S214: Receive interface feedback information fed back by the destination interface.

[0082] In this embodiment, the interface feedback information can be specifically understood as data generated after data processing according to the target data, which can be fed back to the tool as a response result, and fed back to the source interface by the tool. After receiving the target data, the target interface performs corresponding data processing according to the target data, generates corresponding interface feedback information, and feeds it back to the tool that executes the method provided in the embodiment of this application.

[0083] S215. Process the interface feedback information according to the target module to determine target feedback information.

[0084] In this embodiment, the target feedback information can be specifically understood as feedback information that can be identified by the source interface. Since the source data format of the source interface and the destination data format of the destination interface are stored in the target template, the interface feedback information is converted into a data format according to the target template to obtain the target feedback information that can be identified by the source interface. The method for processing the interface feedback information is the same as that for processing the source data, for example, by extracting key-value pairs to form the target feedback information.

[0085] S216: Send the target feedback information to the source interface.

[0086] Feedback the target feedback information to the source interface to realize the data forwarding function between the source interface and the destination interface.

[0087] It can be known that one source interface can correspond to multiple destination interfaces. The same destination interface can also receive data sent by multiple source interfaces. When data sent by multiple source interfaces are received, it is determined that the multiple source interfaces all correspond to the same destination interface. The data to be received by this destination interface can be sent sequentially, or it can be called once to convert the source data of different source interfaces into a single piece of data and sent to the destination interface. The embodiments of the present application do not limit this.

[0088] An embodiment of the present invention provides an interface data processing method, which solves the problem that when source data of different source interfaces are converted into the parameter format of the destination interface, the corresponding test interface must be adapted. Different types of source data are uniformly managed and format converted through templates to complete parameter format adaptation, and adaptation can be achieved without secondary development. The current number of requests of the destination interface is determined based on the number of preset window data blocks and the sliding window request data blocks, and it is determined whether the current number of requests of the destination interface meets the preset request conditions. When the request conditions are met, the format conversion from source data to destination data is completed, and the destination interface is called to avoid interface downtime caused by too frequent calls to the destination interface. The current number of requests is calculated by means of a sliding window to avoid too frequent interface calls caused by uneven distribution of the number of requests in a fixed time period.

[0089] Embodiment 3

[0090] Figure 3 This is a structural diagram of an interface data processing device provided in Embodiment 3 of the present invention. The device includes: a receiving module 31, an interface determining module 32, a request quantity determining module 33, a data processing module 34 and an interface calling module 35.

[0091] The receiving module 31 is used to receive source data sent by the source interface and determine the target template corresponding to the source data;

[0092] An interface determination module 32, configured to determine at least one destination interface corresponding to the source data according to the target template;

[0093] A request quantity determination module 33, configured to determine, for each destination interface, the current request quantity of the destination interface according to the preset window data block quantity and the sliding window request data block;

[0094] A data processing module 34, configured to process the source data according to the target template to determine the target data corresponding to each of the target interfaces if the current request quantity of the target interface meets the preset request condition;

[0095] The interface calling module 35 is used to call the destination interface and send the destination data to the corresponding destination interface.

[0096] An embodiment of the present invention provides an interface data processing device, which solves the problem that when source data of different source interfaces are converted into the parameter format of a destination interface, a corresponding test interface must be adapted. Different types of source data are uniformly managed and format converted through templates to complete parameter format adaptation, and adaptation can be achieved without secondary development. The current request number of the destination interface is determined based on the preset window data block number and the sliding window request data block, and it is determined whether the current request number of the destination interface meets the preset request conditions. When the request conditions are met, the format conversion from the source data to the destination data is completed, and the destination interface is called to avoid interface downtime caused by too frequent calls to the destination interface.

[0097] Furthermore, the receiving module 31 includes:

[0098] A locator determination unit, used to parse the source data and determine a uniform resource locator;

[0099] The template determination unit is used to search the server directory according to the uniform resource locator to determine a matching target template.

[0100] Furthermore, the request quantity determination module 33 includes:

[0101] A data block search unit is used to use the sliding window request data block at the current time as a starting point and search forward for the sliding window request data block according to a preset number of window data blocks;

[0102] The request data determination unit is used to calculate the sum of the number of requests recorded in each sliding window request data block, and determine the sum as the current request quantity of the destination interface.

[0103] Furthermore, the device also includes:

[0104] A target data block determination module, used to determine a corresponding target sliding window request data block according to the interface call time of the destination interface;

[0105] An updating module is used to update the number of requests in the target sliding window request data block.

[0106] Furthermore, the device also includes:

[0107] A call type determination module, used for parsing the source data and determining the call type before processing the source data according to the target template to determine the destination data corresponding to each of the destination interfaces;

[0108] The call information feedback module is used to feedback call success information to the source interface if the call type is an asynchronous call.

[0109] Furthermore, the data processing module 34 includes:

[0110] A data format determination unit, configured to determine a source data format of a source interface and a destination data format of each destination interface according to the target template;

[0111] a source key-value pair extraction unit, configured to perform data processing on the source data according to the source data format and extract at least one source key-value pair;

[0112] a destination key-value pair determining unit, for each destination interface, matching a source key in the source key-value pair with a destination key in a destination data format corresponding to the destination interface, and using a source value in the source key-value pair as a destination value of the corresponding destination key to form a destination key-value pair;

[0113] The destination data determining unit is used to form destination data according to each of the destination key-value pairs.

[0114] Furthermore, the device also includes:

[0115] A feedback information receiving module, used to receive interface feedback information fed back by the destination interface;

[0116] A feedback information determination module, used to process the interface feedback information according to the target module to determine target feedback information;

[0117] A feedback information sending module is used to send the target feedback information to the source interface.

[0118] The interface data processing device provided in the embodiment of the present invention can execute the interface data processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0119] Embodiment 4

[0120] Figure 4 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention is shown in FIG. Figure 4 As shown, the device includes a processor 40, a memory 41, an input device 42 and an output device 43; the number of processors 40 in the device can be one or more. Figure 4 A processor 40 is taken as an example; the processor 40, memory 41, input device 42 and output device 43 in the device can be connected by a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0121] The memory 41, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the interface data processing method in the embodiment of the present invention (for example, the receiving module 31, the interface determination module 32, the request quantity determination module 33, the data processing module 34 and the interface calling module 35 in the interface data processing device). The processor 40 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 41, that is, implements the above-mentioned interface data processing method.

[0122] The memory 41 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 41 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 41 may further include a memory remotely arranged relative to the processor 40, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0123] The input device 42 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 43 may include a display device such as a display screen.

[0124] Embodiment 5

[0125] Embodiment 5 of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute an interface data processing method when executed by a computer processor, the method comprising:

[0126] Receive source data sent by a source interface, and determine a target template corresponding to the source data;

[0127] Determine at least one destination interface corresponding to the source data according to the target template;

[0128] For each destination interface, determine the current request quantity of the destination interface according to the preset window data block quantity and the sliding window request data block;

[0129] If the current request quantity of the destination interface meets the preset request condition, the source data is processed according to the target template to determine the destination data corresponding to each of the destination interfaces;

[0130] The destination interface is called, and the destination data is sent to the corresponding destination interface.

[0131] Of course, the computer executable instructions of a storage medium containing computer executable instructions provided in an embodiment of the present invention are not limited to the operations of the method described above, and can also execute related operations in the interface data processing method provided in any embodiment of the present invention.

[0132] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0133] It is worth noting that in the embodiment of the above-mentioned interface data processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0134] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. An interface data processing method, characterized in that: include: Receive source data sent by a source interface, and determine a target template corresponding to the source data; Determine at least one destination interface corresponding to the source data according to the target template; For each destination interface, determine the current request quantity of the destination interface according to the preset window data block quantity and the sliding window request data block; If the current request quantity of the destination interface meets the preset request condition, the source data is processed according to the target template to determine the destination data corresponding to each of the destination interfaces; Calling the destination interface and sending the destination data to the corresponding destination interface; The determining of the target template corresponding to the source data includes: Parsing the source data to determine a uniform resource locator; Search the server directory according to the uniform resource locator to determine a matching target template; wherein, according to the mapping relationship between the interfaces included in the target template, the destination interface corresponding to the source data is determined; The determining the current request quantity of the destination interface according to the preset window data block quantity and the sliding window request data block comprises: Taking the sliding window request data block at the current time as the starting point, search for the sliding window request data block forward according to the preset number of window data blocks; The sum of the number of requests recorded in each sliding window requesting the data block is calculated, and the sum is determined as the current number of requests of the destination interface.

2. The method according to claim 1, characterized in that After calling the destination interface, the method further includes: Determine the corresponding target sliding window request data block according to the interface call time of the destination interface; The number of requests in the target sliding window request data block is updated.

3. The method according to claim 1, characterized in that Before the source data is processed according to the target template to determine the destination data corresponding to each destination interface, the method further includes: Parsing the source data to determine the call type; If the call type is an asynchronous call, call success information is fed back to the source interface.

4. The method according to claim 1, characterized in that: The processing of the source data according to the target template to determine the destination data corresponding to each of the destination interfaces includes: Determine the source data format of the source interface and the destination data format of each of the destination interfaces according to the target template; Performing data processing on the source data according to the source data format, and extracting at least one source key-value pair; For each destination interface, matching the source key in the source key-value pair with the destination key in the destination data format corresponding to the destination interface, and using the source value in the source key-value pair as the destination value of the corresponding destination key to form a destination key-value pair; The destination data is formed according to each of the destination key-value pairs.

5. The method according to any one of claims 1 to 4, characterized in that: Also includes: Receiving interface feedback information fed back by the destination interface; Processing the interface feedback information according to the target module to determine target feedback information; The target feedback information is sent to the source interface.

6. An interface data processing device, characterized in that: include: A receiving module, used for receiving source data sent by a source interface, and determining a target template corresponding to the source data; An interface determination module, used to determine at least one destination interface corresponding to the source data according to the target template; A request quantity determination module, used to determine the current request quantity of each destination interface according to the preset window data block quantity and the sliding window request data block; A data processing module, configured to process the source data according to the target template to determine the destination data corresponding to each of the destination interfaces if the current request quantity of the destination interface meets a preset request condition; An interface calling module, used to call the destination interface and send the destination data to the corresponding destination interface; The receiving module comprises: A locator determination unit, used to parse the source data and determine a uniform resource locator; A template determination unit, configured to search a server directory according to the uniform resource locator and determine a matching target template; wherein, according to the mapping relationship between the interfaces included in the target template, the destination interface corresponding to the source data is determined; The request quantity determination module includes: A data block search unit is used to use the sliding window request data block at the current time as a starting point and search forward for the sliding window request data block according to a preset number of window data blocks; The request data determination unit is used to calculate the sum of the number of requests recorded in each sliding window request data block, and determine the sum as the current request quantity of the destination interface.

7. A computer device, characterized in that: The device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the interface data processing method as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the interface data processing method as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Algorithm service interface management method and system

    CN112153152A

  • Sliding window current limiting method and device based on double pointers, equipment and storage medium

    CN112367269A

  • Data processing method, device, electronic equipment and storage medium

    CN112860798A

  • Adaptive software interface

    US20030093551A1