Interface calling method and device, equipment and storage medium
Based on the bypass calls before the interface version, the proportion of traffic accounted for bypass is performed, and the problem of the verification of the unplayable interface version of the existing technology in the existing technology has been solved. Essence
Patent Information
- Application Number
- CN202411412909.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-28
AI Technical Summary
In microservice architecture systems, the prior art may affect the user experience when verifying the unreleased interface version, especially if there is a problem with the new interface version.
Through response call requests, the interface to be called and the unpopular version of the barrier calling traffic ratio is determined, and bypass calls are performed based on the proportion to verify the performance and stability of the unpacished interface version.
Without affecting the actual user, the potential problems of the interface version are found and verified in advance to ensure that the interface version is more reliable when it is officially launched, and the proportion of traffic is accurately controlled to effectively use system resources.
Smart Images

Figure CN119376880A_ABST
Abstract
Description
Technical Field
[0001] Example embodiments of the present disclosure generally relate to the field of information technology, and in particular, to a method, apparatus, device, and computer-readable storage medium for interface calling. Background Art
[0002] In modern software development and operation systems, especially those with microservice architectures, interface version management is an important part of ensuring system stability and performance. In particular, before an interface version goes online, its functions and performance need to be called and verified to avoid unforeseen problems after it goes online.
[0003] In the related art, methods such as A / B testing or grayscale release are usually used to gradually verify the new version of the interface, that is, to verify by assigning a portion of user call requests to the new interface version that has not been launched. However, this method may affect the user experience, especially when there are problems with the new interface version.
[0004] Therefore, a more secure and effective method is needed to call the offline interface version. Summary of the invention
[0005] In a first aspect of the present disclosure, a method for interface calling is provided. The method includes: in response to receiving a call request, determining an interface to be called; determining a bypass call traffic ratio of at least one interface version that is not online for the interface to be called, each bypass call traffic ratio indicating a ratio of traffic that can be called by the corresponding interface version that is not online to the total traffic of the interface to be called; and based on the determined bypass call traffic ratio, using at least one interface version that is not online to perform a bypass call on the traffic corresponding to the call request.
[0006] In a second aspect of the present disclosure, a device for interface calling is provided. The device includes: a determination module, configured to determine an interface to be called in response to receiving a call request; the determination module is also configured to determine the bypass call traffic ratio of at least one interface version that is not online of the interface to be called, each bypass call traffic ratio indicates the ratio of the traffic that can be called by the corresponding interface version that is not online in the total traffic of the interface to be called; and a calling module, configured to perform a bypass call on the traffic corresponding to the call request using at least one interface version that is not online based on the determined bypass call traffic ratio.
[0007] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the device executes the method of the first aspect.
[0008] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.
[0009] In a fifth aspect of the present disclosure, a computer program product is provided, which is tangibly stored in a computer storage medium and includes computer executable instructions, which when executed by a device cause the device to perform the method according to the first aspect of the present disclosure.
[0010] It should be understood that the content described in this content section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0012] Figure 1A A schematic diagram showing the system structure of some embodiments of the present disclosure;
[0013] Figure 1B A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;
[0014] Figure 2 A flowchart showing a process of interface calling according to some embodiments of the present disclosure is shown;
[0015] Figure 3A A schematic diagram showing interface configuration information according to some embodiments of the present disclosure;
[0016] Figure 3B A schematic diagram showing interface version configuration information according to some embodiments of the present disclosure is shown;
[0017] Figure 3C A schematic diagram showing a process of executing a bypass call in some embodiments of the present disclosure is shown;
[0018] Figure 4 A block diagram showing an apparatus for interface calling according to some embodiments of the present disclosure; and
[0019] Figure 5 A block diagram of an electronic device capable of implementing one or more embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0020] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0021] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0022] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0023] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0024] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0025] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0026] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0027] As briefly mentioned above, in modern software development and operation systems, especially in microservice architecture systems, applications are decomposed into multiple small and independent services, each with clear business functions, and these services communicate and collaborate through interfaces. Interface call management and verification are important links to ensure system stability and performance.
[0028] Figure 1A Schematic diagram showing the structure of the system 10 of some embodiments of the present disclosure. Figure 1A As shown, in the system 10 , the external system 11 calls one or more internal interfaces 130 - 1 , 130 - 2 , . . . 130 -N (collectively or individually referred to as interfaces 130 ) by communicating with the gateway 12 .
[0029] The external system 11 refers to a client or other service that needs to call an interface in the system. For example, the external system 11 may be a user interface, a mobile application, a third-party service, etc. The gateway 12 is a middleware that connects the external system and the internal service interface, and is responsible for receiving, processing, and forwarding call requests. It acts as a bridge between the external system 11 and the internal service. The interface 130 in the system is the service that actually executes the business logic. They may be individual services or modules in the microservice architecture, which are responsible for processing specific business logic and returning results.
[0030] In this architecture, each interface may have several versions to facilitate version iteration and update in the process of system function expansion and optimization. The interface version needs to be fully called and verified before going online to ensure that the functions and performance of the new version meet expectations, thereby avoiding problems in actual use.
[0031] In related technologies, grayscale release and A / B testing are usually used to verify the unreleased interface version. Grayscale release gradually increases the traffic share of the new version of the interface to gradually verify its stability and performance; A / B testing runs multiple versions of the interface at the same time to compare and analyze their performance.
[0032] However, these verification methods have some defects and shortcomings. Both grayscale release and A / B testing require a certain proportion of real user requests to be directly assigned to the unreleased API version for processing, which means that potential problems with the unreleased API version may directly affect the user experience. If the unreleased API version has functional defects or performance issues, users may encounter errors or delays, which reduces user satisfaction and system reliability.
[0033] Therefore, there is an urgent need for a solution to bypass the call and verification of the interface version that is not online, so as to improve the reliability and stability of the interface version online, thereby reducing the potential impact on the business system and user use.
[0034] In an embodiment of the present disclosure, a scheme for interface calling is provided. According to the embodiment of the present disclosure, in response to receiving a calling request, an interface to be called is determined; the bypass calling traffic proportion of at least one interface version that is not online of the interface to be called is determined, and each bypass calling traffic proportion indicates the proportion of the traffic that can be called by the corresponding interface version that is not online in the total traffic of the interface to be called; and based on the determined bypass calling traffic proportion, a bypass calling is performed on the traffic corresponding to the calling request using at least one interface version that is not online.
[0035] Therefore, by performing bypass calls and verification before the interface version goes online, the performance and stability of the interface version can be tested without affecting actual users. This can detect potential problems in advance and ensure that the interface version is more reliable when it is officially launched. And by setting the traffic proportion of bypass calls, the number of requests used to verify the interface version can be accurately controlled, thereby effectively utilizing system resources. When performing multi-version bypass calls, the traffic distribution can also be flexibly adjusted according to the needs of different interface versions, further improving resource utilization efficiency.
[0036] Figure 1B A schematic diagram of an example environment 100 in which an embodiment of the present disclosure can be implemented is shown. In the environment 100, the electronic device 110 receives a call request 120 for an interface from an external system and determines the interfaces 130-1, 130-2, ... 130-N (collectively or individually referred to as interfaces 130) to be called. In addition, each interface in the electronic device 110 may include different interface versions, for example, the interface 130-1 includes interface versions 130-1-1, 130-1-2, ... 130-1-N. The process of interface calling involved in the embodiments of the present disclosure may be implemented for at least one interface version of at least one interface in the electronic device 110. For example, a call request for at least one interface 130-1 is received in a software system terminal device, and the traffic corresponding to the call request is distributed to different interface versions of the interface 130-1 to perform an interface call operation.
[0037] In the environment 100, the electronic device 110 can be any type of device with computing capabilities, including a terminal device or a server device. The terminal device can be any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an e-book device, a gaming device, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. The server device can include, for example, a computing system / server, such as a mainframe, an edge computing node, a computing device in a cloud environment, and the like.
[0038] It should be understood that the structure and functionality of environment 100 are described for exemplary purposes only and does not imply any limitation on the scope of the present disclosure.
[0039] Figure 2 A flowchart of a process 200 of interface calling according to some embodiments of the present disclosure is shown. The process 200 may be implemented in the environment 100 , for example, the process 200 may be implemented at the electronic device 110 .
[0040] In block 210 , the electronic device 110 determines an interface to be called in response to receiving the call request.
[0041] In some embodiments, after receiving the call request, the electronic device 110 first needs to determine the interface to be called. For example, according to the content of the call request and the interface configuration information, the electronic device 110 determines the interface corresponding to the call request.
[0042] Figure 3A FIG. 3 is a schematic diagram showing interface configuration information 310 according to some embodiments of the present disclosure. Figure 3A As shown, the interface configuration information 310 includes at least one of the following: interface name: a unique identification name of the interface, used to distinguish different interfaces; interface description: a brief description of the interface function, which helps to understand the purpose and usage scenario of the interface; online status: indicates whether the interface is currently officially put into use in the production environment, usually including "online", "not online" and other states. In other embodiments, the interface configuration information may also include more, less or different other information.
[0043] As an example, an interface may include at least one interface version, and as long as one interface version under the interface is online, the online state of the interface is online. If all interface versions under the interface are not online, the online state of the interface is not online.
[0044] Continue to refer Figure 2 In box 220, the electronic device 110 determines the bypass call traffic ratio of at least one offline interface version of the interface to be called.
[0045] In some embodiments, each bypass call traffic ratio indicates the ratio of the traffic that can be called by the corresponding interface version that is not online to the total traffic of the interface to be called.
[0046] In some embodiments, each interface may include at least one interface version. When an interface includes multiple interface versions and supports multiple versions online, in addition to managing interface configuration information, information of each interface version also needs to be managed and maintained separately.
[0047] Figure 3B FIG. 3 is a schematic diagram of interface version configuration information 320 according to some embodiments of the present disclosure. Interface version configuration information 320 refers to detailed information required for managing and controlling different interface versions of a certain interface. Figure 3B As shown, the interface version configuration information includes at least one of the following: interface name: the unique identification name of the interface, used to distinguish different interfaces; interface address information: the access address or path information of the interface, used to route requests; interface version number: used to distinguish different interface versions of the same interface; online status: indicates whether the interface version is currently officially put into use in the production environment, usually including "online", "not online" and other states; online traffic share: indicates the proportion of traffic corresponding to call requests undertaken by the online interface version in the total traffic.
[0048] In some embodiments, after receiving the call request, the electronic device 110 can distribute the traffic corresponding to the call request to each online interface version according to the online traffic proportion of each online interface version. In addition, the electronic device 110 can also copy and forward at least part of the traffic corresponding to the call request to the offline interface version for bypass calling and / or verification.
[0049] In some embodiments, the interface version configuration information 320 may also include a bypass call switch and a bypass call traffic ratio. The bypass call switch indicates whether the interface version participates in bypass calls and verification. The bypass call traffic ratio indicates the ratio of the traffic of the interface version for bypass calls to the total traffic of the interface to be called. In other embodiments, the interface version configuration information may also include more, less, or different other information.
[0050] Return to reference Figure 2 In box 230, the electronic device 110 performs a bypass call on the traffic corresponding to the call request using at least one offline interface version based on the determined bypass call traffic proportion.
[0051] In some embodiments, if it is determined that there is at least one offline interface version of the interface to be called, the electronic device 110 can distribute at least part of the traffic to the corresponding interface version to perform the bypass call based on the bypass call traffic ratio of the offline interface version.
[0052] Figure 3C A schematic diagram of an example process 300A for performing a bypass call according to some embodiments of the present disclosure is shown. The process 300A may be implemented at the electronic device 110.
[0053] In block 331 , the electronic device 110 determines a target interface version for performing a bypass call from at least one offline interface version based on the determined bypass call traffic ratio.
[0054] In some embodiments, before the reliability of the interface version that has not been put online is fully determined, the electronic device 110 can limit the proportion of request traffic it receives by setting a bypass call traffic ratio and / or determine the target interface version for performing bypass calls in the case of multiple interface versions, so as to prevent possible problems from having a widespread impact on actual business.
[0055] In some embodiments, the electronic device 110 may generate a random percentage within a predetermined threshold range. If the bypass call traffic percentage of the first interface version in at least one interface version that is not online is greater than the random percentage, the first interface version is determined as the target interface version for performing the bypass call.
[0056] As an example, a bypass call is performed on the interface version 130-1-1 of the interface 130-1 in the electronic device 110 that is not online, and the bypass call traffic of the interface version 130-1-1 accounts for 30%. When performing a call on the interface 130-1, the electronic device 110 can generate a random number between 1 and 100. If the generated random number is between 1 and 30 (i.e., a probability of 30%), the interface version 130-1-1 is determined to be the target interface version for performing the bypass call. If the generated random number is between 31 and 100 (i.e., a probability of 70%), the bypass call is not performed on the interface version 130-1-1.
[0057] As another example, the interface versions that are not online and support bypass calls of interface 130-1 in electronic device 110 include interface version 130-1-1 and interface version 130-1-2, and the bypass call traffic accounts for 30% and 40% respectively. When executing a call to interface 130-1, electronic device 110 can generate a random number between 1 and 100. If the random number is between 1 and 30, bypass calls are executed for both interface version 130-1-1 and interface version 130-1-2. If the random number is between 30 and 40, bypass calls are only executed for interface version 130-1-2. If the random number is between 41 and 100, bypass calls are not executed for interface version 130-1-1 and interface version 130-1-2. Note that only an example of determining the interface version is given here, and other methods can also be used to determine the interface version to be bypassed in actual applications.
[0058] In the disclosed embodiment, by generating a random traffic ratio, the target interface version for bypass call can be determined, and the call traffic can be accurately controlled according to the bypass call traffic ratio, and the traffic is allocated to the interface version that is not online for call and verification according to the set ratio. And through this traffic ratio control method, parallel verification of multiple versions is supported, and different interface versions can be independently verified according to their respective bypass call traffic ratios. By generating a random ratio and judging the interval it falls into, it is flexible to decide whether to make a bypass call. This method can reasonably allocate resources, ensure that bypass calls do not occupy too many system resources, and allow other normal business traffic to continue to be processed.
[0059] Continue to refer Figure 3C In box 332, the electronic device 110 copies at least part of the traffic corresponding to the call request based on the determined bypass call traffic ratio.
[0060] In some embodiments, the electronic device 110 can also flexibly adjust the bypass call traffic ratio as needed, which can ensure that the interface version that is not online obtains sufficient traffic for calling and verification, and avoids excessive occupation of system resources.
[0061] At block 333 , the electronic device 110 forwards at least a portion of the traffic to the target interface version.
[0062] In some embodiments, the electronic device 110 copies at least part of the traffic corresponding to the call request based on the bypass call traffic ratio of the interface version, and then forwards the copied traffic to the offline interface version that performs the bypass call for testing and verification.
[0063] In the disclosed embodiment, the electronic device 110 can perform a bypass call on the target interface version based on the bypass call traffic of the interface version, so that the interface version that is not online can be verified by bypass call before the grayscale verification, avoiding directly exposing the unstable new version to the actual business, thereby reducing the impact on business operations. And by replicating part of the traffic in the actual production environment for bypass call, it can more realistically reflect the performance of the interface version that is not online in the real business scenario, provide more reliable data than simulation testing, and improve the coverage and accuracy of verification and testing.
[0064] In some embodiments, the electronic device 110 may allocate corresponding asynchronous threads to at least one offline interface version. In the allocated asynchronous threads, the electronic device 110 performs bypass calls on the traffic corresponding to the call request using at least one offline interface version based on the determined bypass call traffic ratio.
[0065] In some embodiments, the electronic device 110 can process bypass call requests of multiple versions that are not online in parallel through asynchronous threads, using multi-threading technology to fully utilize the multi-core resources of the system and improve the overall processing efficiency and response speed of the system. In addition, each asynchronous thread can independently record the log and monitoring data of the bypass call, which is convenient for analyzing and troubleshooting the performance and behavior of each version. Secondly, the electronic device 110 can also select the best interface version to go online and deploy it to a real production environment based on the execution results of the bypass calls of each interface version.
[0066] In the disclosed embodiment, an asynchronous thread is allocated to the interface version that is not online to execute the bypass call operation separately from the main thread, thereby avoiding the impact on the performance of real user calls in the main thread, thereby avoiding possible blocking and performance bottlenecks, and ensuring the efficient operation and stability of the main thread.
[0067] In some embodiments, the electronic device 110 can perform a bypass call to an interface version that is not online in a generalized call manner based on remote procedure call (RPC) technology. Generalized calls allow the caller to make remote calls and obtain call results without the service provider providing an application programming interface (API) or software development kit (SDK). This flexible calling method reduces the coupling between system components and improves the overall efficiency and maintainability of the system.
[0068] In some embodiments, the electronic device 110 may perform testing and verification on at least one interface version that is not online during the execution of the bypass call. Based on the results of the testing and verification, the electronic device 110 may determine an online decision for at least one interface version that is not online, and the online decision indicates whether each interface version that is not online is to be online.
[0069] In the disclosed embodiment, by bypassing the real production environment data, more objective and accurate execution results can be provided. In addition, the test and verification results during the bypass call process can be used as an important basis for decision-making, helping decision-makers to more accurately determine whether each unreleased interface version meets the release standard, reducing the impact and risk that the release of a new interface version may have on existing businesses, and enhancing system stability and reliability.
[0070] In some embodiments, the electronic device 110 may obtain the call result of the bypass call, and perform a comparative analysis on the call result of the bypass call and the call result of the online interface version of the interface, wherein the comparative analysis may include performance testing and / or data consistency verification.
[0071] In some embodiments, the electronic device 110 can evaluate the performance of the interface version that is not online by comparing the performance indicators (such as response time, throughput, etc.) of the bypass call and the online interface version. Based on the comparative analysis results, it is determined whether the performance of the interface version that is not online needs to be further optimized to improve the overall efficiency and response speed of the system.
[0072] In some embodiments, the electronic device 110 can compare the data returned by the bypass call and the online version interface to verify the consistency and accuracy of the data. In this way, it is ensured that the offline interface version does not introduce data loss or errors when processing and returning data, thereby ensuring the integrity and reliability of system data.
[0073] In the disclosed embodiment, the electronic device 110 forwards at least part of the call request traffic by executing a bypass call to simulate the actual user usage, and the obtained call result reflects the behavior and performance of the interface in the actual user operation scenario. By obtaining the call results through the bypass call and performing comparative analysis, it is possible to discover performance problems, data inconsistencies or functional defects that may exist in the interface version that is not online at an early stage, and it can also provide data support for the continuous optimization and improvement of the system, thereby improving the overall quality of the product and user satisfaction.
[0074] In some embodiments, the electronic device 110 may perform grayscale call verification on at least one offline interface version based on the result of the comparative analysis. In the grayscale call verification, at least part of the call traffic corresponding to the call request is distributed to at least one offline interface version for call and verification.
[0075] In the disclosed embodiment, after performing a bypass call on an interface version that is not online, the electronic device 110 can perform grayscale call verification on the interface version that has passed the bypass call and verification based on the results of the comparative analysis. In the grayscale call verification, the electronic device 110 can directly forward a small portion of the real call traffic to the corresponding interface version to verify the performance and stability of the interface version under the actual load. And by gradually increasing the proportion of traffic for grayscale call verification, the new interface version can be smoothly introduced into the production environment, minimizing interference with the user experience.
[0076] Figure 4 A block diagram of a device 400 for interface calling according to some embodiments of the present disclosure is shown. The device 400 may be implemented as or include the electronic device 110.
[0077] The device 400 includes a determination module 410, which is configured to determine the interface to be called in response to receiving a call request; the determination module 410 is also configured to determine the bypass call traffic ratio of at least one non-online interface version of the interface to be called, each bypass call traffic ratio indicates the ratio of the traffic that can be called by the corresponding non-online interface version in the total traffic of the interface to be called; the calling module 420 is configured to perform a bypass call on the traffic corresponding to the call request using at least one non-online interface version based on the determined bypass call traffic ratio.
[0078] In some embodiments, the calling module 420 is further configured to determine a target interface version for performing a bypass call from at least one interface version that is not online based on the determined bypass call traffic ratio; copy at least part of the traffic corresponding to the call request based on the determined bypass call traffic ratio; and forward at least part of the traffic to the target interface version.
[0079] In some embodiments, the calling module 420 also includes a determination unit, which is further configured to generate a random proportion within a predetermined threshold range; if the bypass call traffic proportion of the first interface version in at least one interface version that is not online is greater than the random proportion, the first interface version is determined as the target interface version for performing the bypass call.
[0080] In some embodiments, the calling module 420 is further configured to allocate corresponding asynchronous threads to at least one interface version that is not online; and in the allocated asynchronous threads, based on the determined bypass call traffic ratio, use at least one interface version that is not online to perform a bypass call on the traffic corresponding to the call request.
[0081] In some embodiments, the device 400 also includes a verification module 430, which is configured to perform testing and verification on at least one interface version that is not online during the execution of the bypass call; based on the results of the testing and verification, determine the online decision of at least one interface version that is not online, and the online decision indicates whether each interface version that is not online should be online.
[0082] In some embodiments, the verification module 430 is further configured to obtain the call result of the bypass call; and perform a comparative analysis on the call result of the bypass call and the call result of the online interface version of the interface, the comparative analysis including performance testing and / or data consistency verification.
[0083] In some embodiments, the verification module 430 is further configured to perform grayscale call verification on at least one offline interface version based on the results of the comparative analysis. In the grayscale call verification, at least part of the call traffic corresponding to the call request is distributed to at least one offline interface version for calling and verification.
[0084] The modules included in the device 400 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units in the device 400 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0085] Figure 5 1 shows a block diagram of an electronic device 500 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 5 The electronic device 500 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein.
[0086] like Figure 5As shown, the electronic device 500 is in the form of a general electronic device. The components of the electronic device 500 may include, but are not limited to, one or more processors or processing units 510, a memory 520, a storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. The processing unit 510 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 520. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 500.
[0087] The electronic device 500 typically includes a plurality of computer storage media. Such media may be any available media accessible to the electronic device 500, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 520 may be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 530 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data and may be accessed within the electronic device 500.
[0088] The electronic device 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 5 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 520 may include a computer program product 525 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.
[0089] The communication unit 540 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 500 can be implemented in a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 500 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.
[0090] The input device 550 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 560 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 500 may also communicate with one or more external devices (not shown) through the communication unit 540 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 500, or communicate with any device that allows the electronic device 500 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).
[0091] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which one or more computer instructions are stored, wherein the one or more computer instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.
[0092] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0093] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0094] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0095] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.
[0096] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the marketplace, or to enable other persons of ordinary skill in the art to understand the implementations disclosed herein.
Claims
1. A method for interface calling, comprising: In response to receiving the call request, determining an interface to be called; Determine the bypass call traffic proportion of each of at least one interface version that is not online of the interface to be called, each bypass call traffic proportion indicates the proportion of the traffic that can be called by the corresponding interface version that is not online in the total traffic of the interface to be called; as well as Based on the determined bypass call traffic proportion, a bypass call is performed on the traffic corresponding to the call request using the at least one offline interface version.
2. The method according to claim 1, wherein based on the determined bypass call traffic proportion, using the at least one offline interface version to perform a bypass call on the traffic corresponding to the call request comprises: Based on the determined bypass call traffic proportion, determining a target interface version for performing the bypass call from the at least one interface version that is not online; Based on the determined bypass call traffic proportion, copy at least part of the traffic corresponding to the call request; as well as The at least a portion of the traffic is forwarded to the target interface version.
3. The method according to claim 2, wherein the determining, based on the determined bypass call traffic, from the at least one offline interface version, a target interface version for performing the bypass call comprises: Generate a random percentage within a predetermined threshold range; If the bypass call traffic proportion of the first interface version in the at least one interface version that is not online is greater than the random proportion, the first interface version is determined as the target interface version for performing the bypass call.
4. The method according to claim 1, wherein the performing a bypass call on the traffic corresponding to the call request by using the at least one offline interface version based on the determined bypass call traffic proportion further comprises: Allocating corresponding asynchronous threads to the at least one interface version that is not online respectively; as well as In the allocated asynchronous thread, based on the determined bypass call traffic proportion, a bypass call is performed on the traffic corresponding to the call request using the at least one offline interface version.
5. The method according to claim 1, further comprising: During the execution of the bypass call, testing and verifying the at least one offline interface version; Based on the test and verification results, an online decision of the at least one interface version that is not online is determined, where the online decision indicates whether each interface version that is not online is to be online.
6. The method according to claim 5, wherein during the execution of the bypass call, performing testing and verification on the at least one offline interface version comprises: Obtaining a call result of the bypass call; as well as A comparative analysis is performed on the calling result of the bypass call and the calling result of the online interface version of the interface, wherein the comparative analysis includes performance testing and / or data consistency verification.
7. The method according to claim 6, further comprising: Based on the result of the comparative analysis, grayscale call verification is performed on the at least one offline interface version, wherein in the grayscale call verification, at least part of the call traffic corresponding to the call request is distributed to the at least one offline interface version for calling and verification.
8. A device for interface calling, comprising: A determination module, configured to determine an interface to be called in response to receiving a call request; The determination module is further configured to determine the bypass call traffic proportion of each of at least one interface version of the interface to be called that is not online, each bypass call traffic proportion indicating the proportion of the traffic that can be called by the corresponding interface version that is not online in the total traffic of the interface to be called; The calling module is configured to perform a bypass call on the traffic corresponding to the calling request using the at least one offline interface version based on the determined bypass call traffic proportion.
9. An electronic device, comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 7 when executed by the at least one processing unit.
10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 7.
11. A computer program product tangibly stored in a computer storage medium and comprising computer executable instructions which, when executed by a device, cause the device to perform the method according to any one of claims 1 to 7.