US 12,288,084 B2
Interface calling method and apparatus, and computer-readable storage medium
Yuansheng Xue, Shenzhen (CN); Yuan Hai, Shenzhen (CN); Yanghao Ou, Shenzhen (CN); Zhiwei Guo, Shenzhen (CN); Chao Lin, Shenzhen (CN); Canhui Huang, Shenzhen (CN); and Sicheng Huang, Shenzhen (CN)
Assigned to TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED, Shenzhen (CN)
Filed by Tencent Technology (Shenzhen) Company Limited, Shenzhen (CN)
Filed on Oct. 2, 2023, as Appl. No. 18/375,878.
Application 18/375,878 is a continuation of application No. 17/725,424, filed on Apr. 20, 2022, granted, now 11,809,882.
Application 17/725,424 is a continuation of application No. PCT/CN2021/091868, filed on May 6, 2021.
Claims priority of application No. 202010454247.6 (CN), filed on May 26, 2020.
Prior Publication US 2024/0028349 A1, Jan. 25, 2024
This patent is subject to a terminal disclaimer.
Int. Cl. G06F 3/00 (2006.01); G06F 9/448 (2018.01); G06F 9/455 (2018.01); G06F 9/54 (2006.01)
CPC G06F 9/448 (2018.02) [G06F 9/455 (2013.01); G06F 9/54 (2013.01)] 15 Claims
OG exemplary drawing
 
1. An interface calling simulation method for developing an applet of an application program, performed by an electronic device, the method comprising:
receiving, from the applet of the application program, an interface calling request for a target interface in the application program, the interface calling request including interface calling information of the target interface;
querying a simulated interface set for the target interface based on the interface calling information of the target interface, wherein the simulated interface set includes simulated interfaces that simulate real interfaces in the application program;
in accordance with a determination that the simulated interface set includes a candidate simulation interface corresponding to the target interface:
intercepting the interface calling request using a WebSocket-based message manager;
forwarding, by the WebSocket-based message manager, the interface calling information of the target interface to a Mocking module;
comparing, by the Mocking module, the interface calling information of the target interface with interface configuration information of the candidate simulated interface;
in accordance with a determination that the interface calling information of the target interface matches the interface configuration information of the simulated interface, obtaining, by the Mocking module, simulated response data corresponding to the simulation interface;
generating, by the Mocking module, calling response data of the interface calling request based on the simulated response data; and
returning, by the Mocking module, the calling response data of the interface calling request to the applet via the WebSocket-based message manager.